mirror of
https://github.com/Interlisp/maiko.git
synced 2026-05-05 15:54:21 +00:00
Fix "error: implicit declaration of function" from dspsubrs
Creates an sdldefs.h, declares a few more functions in sdl.c static, and includes sdldefs.h in dspsubrs.c when necessary.
This commit is contained in:
11
inc/sdldefs.h
Normal file
11
inc/sdldefs.h
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
#ifndef SDLDEFS_H
|
||||||
|
#define SDLDEFS_H 1
|
||||||
|
|
||||||
|
void sdl_notify_damage(int x, int y, int w, int h);
|
||||||
|
void sdl_setCursor(int hot_x, int hot_y);
|
||||||
|
void sdl_bitblt_to_screen(int _x, int _y, int _w, int _h);
|
||||||
|
void sdl_set_invert(int flag);
|
||||||
|
void sdl_setMousePosition(int x, int y);
|
||||||
|
void process_SDLevents();
|
||||||
|
int init_SDL(char *windowtitle, int w, int h, int s);
|
||||||
|
#endif
|
||||||
@@ -18,9 +18,11 @@
|
|||||||
#include "lispemul.h" // for LispPTR, DLword, ATOM_T, NIL
|
#include "lispemul.h" // for LispPTR, DLword, ATOM_T, NIL
|
||||||
#include "lispmap.h" // for S_POSITIVE
|
#include "lispmap.h" // for S_POSITIVE
|
||||||
#include "lsptypes.h" // for GETWORD
|
#include "lsptypes.h" // for GETWORD
|
||||||
#ifdef XWINDOW
|
#if defined(XWINDOW)
|
||||||
#include "xcursordefs.h" // for Set_XCursor
|
#include "xcursordefs.h" // for Set_XCursor
|
||||||
#include "xlspwindefs.h" // for lisp_Xvideocolor, set_Xmouseposition
|
#include "xlspwindefs.h" // for lisp_Xvideocolor, set_Xmouseposition
|
||||||
|
#elif defined(SDL)
|
||||||
|
#include "sdldefs.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern int DebugDSP;
|
extern int DebugDSP;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
#include <SDL.h>
|
#include <SDL.h>
|
||||||
#include <SDL_keycode.h>
|
#include <SDL_keycode.h>
|
||||||
|
#include "sdldefs.h"
|
||||||
#include "lispemul.h"
|
#include "lispemul.h"
|
||||||
#include "miscstat.h"
|
#include "miscstat.h"
|
||||||
#include "keyboard.h"
|
#include "keyboard.h"
|
||||||
@@ -275,7 +276,7 @@ void sdl_bitblt_to_screen(int _x, int _y, int _w, int _h) {
|
|||||||
/* after = SDL_GetTicks(); */
|
/* after = SDL_GetTicks(); */
|
||||||
/* printf("UpdateTexture took %dms\n", after - before); */
|
/* printf("UpdateTexture took %dms\n", after - before); */
|
||||||
}
|
}
|
||||||
int map_key(SDL_Keycode k) {
|
static int map_key(SDL_Keycode k) {
|
||||||
for(int i = 0; keymap[i] != -1; i+= 2) {
|
for(int i = 0; keymap[i] != -1; i+= 2) {
|
||||||
if(keymap[i+1] == k)
|
if(keymap[i+1] == k)
|
||||||
return keymap[i];
|
return keymap[i];
|
||||||
@@ -283,7 +284,7 @@ int map_key(SDL_Keycode k) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
#define KEYCODE_OFFSET 0
|
#define KEYCODE_OFFSET 0
|
||||||
void handle_keydown(SDL_Keycode k, unsigned short mod) {
|
static void handle_keydown(SDL_Keycode k, unsigned short mod) {
|
||||||
int lk = map_key(k);
|
int lk = map_key(k);
|
||||||
if(lk == -1) {
|
if(lk == -1) {
|
||||||
printf("No mapping for key %s\n", SDL_GetKeyName(k));
|
printf("No mapping for key %s\n", SDL_GetKeyName(k));
|
||||||
@@ -294,7 +295,7 @@ void handle_keydown(SDL_Keycode k, unsigned short mod) {
|
|||||||
if ((KBDEventFlg += 1) > 0) Irq_Stk_End = Irq_Stk_Check = 0;
|
if ((KBDEventFlg += 1) > 0) Irq_Stk_End = Irq_Stk_Check = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void handle_keyup(SDL_Keycode k, unsigned short mod) {
|
static void handle_keyup(SDL_Keycode k, unsigned short mod) {
|
||||||
int lk = map_key(k);
|
int lk = map_key(k);
|
||||||
if(lk == -1) {
|
if(lk == -1) {
|
||||||
printf("No mapping for key %s\n", SDL_GetKeyName(k));
|
printf("No mapping for key %s\n", SDL_GetKeyName(k));
|
||||||
@@ -320,7 +321,7 @@ extern MISCSTATS *MiscStats;
|
|||||||
#define MOUSE_LEFT 13
|
#define MOUSE_LEFT 13
|
||||||
#define MOUSE_RIGHT 14
|
#define MOUSE_RIGHT 14
|
||||||
#define MOUSE_MIDDLE 15
|
#define MOUSE_MIDDLE 15
|
||||||
void sdl_update_viewport(int width, int height) {
|
static void sdl_update_viewport(int width, int height) {
|
||||||
int w = width / 32 * 32;
|
int w = width / 32 * 32;
|
||||||
if(w > sdl_displaywidth * sdl_pixelscale)
|
if(w > sdl_displaywidth * sdl_pixelscale)
|
||||||
w = sdl_displaywidth * sdl_pixelscale;
|
w = sdl_displaywidth * sdl_pixelscale;
|
||||||
|
|||||||
Reference in New Issue
Block a user