X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fapp.c;h=92759f6749cf679c4bbabb3ba502fedb394a6793;hb=7e576adc58f91db8dd89cffd1c4fd7401c70e36c;hp=87f3a1070c6cb6bef3aa38663a581b1d82f67a21;hpb=a8b3d0279566b8a49ea64d7e9e3dfa958364e347;p=retroray
diff --git a/src/app.c b/src/app.c
index 87f3a10..92759f6 100644
--- a/src/app.c
+++ b/src/app.c
@@ -23,6 +23,7 @@ along with this program. If not, see .
#include
#include "gaw/gaw.h"
#include "app.h"
+#include "timer.h"
#include "rend.h"
#include "options.h"
#include "font.h"
@@ -67,7 +68,7 @@ int app_init(void)
static rtk_draw_ops guigfx = {gui_fill, gui_blit, gui_drawtext, gui_textrect};
#if !defined(NDEBUG) && defined(DBG_FPEXCEPT)
- printf("floating point exceptions enabled\n");
+ infomsg("floating point exceptions enabled\n");
enable_fpexcept();
#endif
@@ -111,7 +112,7 @@ int app_init(void)
}
}
- time_msec = app_getmsec();
+ time_msec = get_msec();
for(i=0; iname && start_scr_name && strcmp(screens[i]->name, start_scr_name) == 0) {
@@ -154,7 +155,7 @@ void app_shutdown(void)
void app_display(void)
{
- time_msec = app_getmsec();
+ time_msec = get_msec();
cur_scr->display();
}
@@ -164,7 +165,7 @@ void app_reshape(int x, int y)
int numpix = x * y;
int prev_numpix = win_width * win_height;
- printf("reshape(%d, %d)\n", x, y);
+ dbgmsg("reshape(%d, %d)\n", x, y);
if(!framebuf || numpix > prev_numpix) {
void *tmp;
@@ -191,12 +192,20 @@ void app_reshape(int x, int y)
void app_keyboard(int key, int press)
{
+ long msec;
+ static long prev_esc;
+
if(press) {
switch(key) {
#ifdef DBG_ESCQUIT
case 27:
- app_quit();
- return;
+ msec = get_msec();
+ if(msec - prev_esc < 1000) {
+ app_quit();
+ return;
+ }
+ prev_esc = msec;
+ break;
#endif
case 'q':