diff options
author | Ian C <ianc@noddybox.co.uk> | 2003-12-22 00:01:31 +0000 |
---|---|---|
committer | Ian C <ianc@noddybox.co.uk> | 2003-12-22 00:01:31 +0000 |
commit | a500f050272a8cca97ed0bbb7f8d7156555c61a7 (patch) | |
tree | 879d83916f2dae38e3574c4937098e40ae27bdb0 /src/gfx.c | |
parent | 9443eab98692b668fd35fc2a7e2cfb043953dbc7 (diff) |
Added memory menu and some devel changes
Diffstat (limited to 'src/gfx.c')
-rw-r--r-- | src/gfx.c | 52 |
1 files changed, 51 insertions, 1 deletions
@@ -225,6 +225,16 @@ void GFXEndFrame(int delay) } +void GFXKeyRepeat(int repeat) +{ + if (repeat) + SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, + SDL_DEFAULT_REPEAT_INTERVAL); + else + SDL_EnableKeyRepeat(0,0); +} + + SDL_Event *GFXGetKey(void) { static SDL_Event e; @@ -246,7 +256,7 @@ SDL_Event *GFXWaitKey(void) do { SDL_WaitEvent(&e); - } while (e.type!=SDL_KEYUP); + } while (e.type!=SDL_KEYDOWN); return &e; } @@ -342,4 +352,44 @@ void GFXPrint(int x, int y, Uint32 col, const char *format, ...) } +void GFXPrintPaper(int x, int y, Uint32 col, Uint32 paper, + const char *format, ...) +{ + char buff[257]; + va_list va; + char *p; + int sx,sy; + + va_start(va,format); + vsprintf(buff,format,va); + va_end(va); + + p=buff; + + LOCK; + + while(*p) + { + for(sy=0;sy<8;sy++) + { + if (y+sy<SCR_H && x<SCR_W) + { + for(sx=0;sx<8;sx++) + { + if (font[(int)*p][sx+sy*8] && x+sx<SCR_W) + putpixel(x+sx,y+sy,col); + else + putpixel(x+sx,y+sy,paper); + } + } + } + + p++; + x+=8; + } + + UNLOCK; +} + + /* END OF FILE */ |