Add SetAutoRepeat impl for SDL

This commit is contained in:
kichikuou
2017-02-11 00:10:04 +09:00
parent ded3f702b2
commit 7c54d0d4d6
2 changed files with 10 additions and 0 deletions
+2
View File
@@ -94,6 +94,7 @@ extern boolean sdl_cursorNew(BYTE* data, int no, CursorImage *cursorImage, TCur
extern int sdl_getKeyInfo();
extern int sdl_getMouseInfo(MyPoint *p);
extern int sdl_getjoyinfo(void);
extern void sdl_setAutoRepeat(boolean bool);
/* misc */
extern void sdl_mainIteration();
@@ -162,6 +163,7 @@ extern boolean RawKeyInfo[];
#define Keywait(r,flg) sdl_keywait(r,flg)
#define SetCursorLocation(x,y) sdl_setCursorLocation((x),(y))
#define CursorNew(d,no,i,dir) sdl_cursorNew((d),(no),(i),(dir))
#define SetAutoRepeat(b) sdl_setAutoRepeat(b)
/* misc */
#define ResourceInit(c,v) sdl_ResourceInit((c),(v))
+8
View File
@@ -212,3 +212,11 @@ agsurface_t *sdl_getDIB(void) {
return sdl_dibinfo;
}
/* AutoRepeat の設定 */
void sdl_setAutoRepeat(boolean bool) {
if (bool) {
SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
} else {
SDL_EnableKeyRepeat(0, 0);
}
}