X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fapp.c;h=a79777fa58297494f3bb77664d1238998723bb52;hb=HEAD;hp=b0fc2e82679fffacbc46cca9989e69e6bda571d9;hpb=e17bfec530d9d476c61c9bb2a156788c742db43b;p=retroray diff --git a/src/app.c b/src/app.c index b0fc2e8..a79777f 100644 --- a/src/app.c +++ b/src/app.c @@ -77,8 +77,6 @@ int app_init(void) #endif rend_init(); - load_options("retroray.cfg"); - app_resize(opt.xres, opt.yres); app_vsync(opt.vsync); if(opt.fullscreen) { app_fullscreen(1); @@ -165,8 +163,6 @@ void app_reshape(int x, int y) int numpix = x * y; int prev_numpix = win_width * win_height; - dbgmsg("reshape(%d, %d)\n", x, y); - if(!framebuf || numpix > prev_numpix) { void *tmp; if(!(tmp = realloc(framebuf, numpix * sizeof *framebuf))) { @@ -188,6 +184,8 @@ void app_reshape(int x, int y) if(cur_scr && cur_scr->reshape) { cur_scr->reshape(x, y); } + + app_redisplay(0, 0, 0, 0); } void app_keyboard(int key, int press) @@ -202,9 +200,10 @@ void app_keyboard(int key, int press) msec = get_msec(); if(msec - prev_esc < 1000) { app_quit(); + return; } prev_esc = msec; - return; + break; #endif case 'q': @@ -327,11 +326,21 @@ static void gui_blit(int x, int y, rtk_icon *icon) static void gui_drawtext(int x, int y, const char *str) { + use_font(uifont); + dtx_position(x, y); + dtx_color(0, 0, 0, 1); + dtx_string(str); } static void gui_textrect(const char *str, rtk_rect *rect) { - rect->x = rect->y = 0; - rect->width = 20; - rect->height = 10;/* TODO */ + struct dtx_box dbox; + + use_font(uifont); + dtx_string_box(str, &dbox); + + rect->x = dbox.x; + rect->y = dbox.y; + rect->width = dbox.width; + rect->height = dbox.height; }