intro (logo for now) screen done
authorJohn Tsiombikas <nuclear@member.fsf.org>
Thu, 5 Mar 2020 14:03:03 +0000 (16:03 +0200)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Thu, 5 Mar 2020 14:03:03 +0000 (16:03 +0200)
src/introscr.c
src/sdl/main.c

index 610db90..b4d4ec4 100644 (file)
@@ -53,8 +53,8 @@ void intro_draw(void)
        } else if(tm < FADE_DUR * 3) {
                fade = 256 - (tm - 2 * FADE_DUR) * 256 / FADE_DUR;
        } else {
+               fade = 0;
                menu_start();
-               return;
        }
 
        for(i=0; i<fb_height; i++) {
index 52b9aa7..8d60d12 100644 (file)
@@ -18,7 +18,7 @@ static int sdlkey_to_gamekey(int sdlkey, unsigned int mod);
 static int quit;
 static SDL_Surface *fbsurf;
 
-static int fbscale = 2;
+static int fbscale = 1;
 static int xsz, ysz;
 static unsigned int sdl_flags = SDL_SWSURFACE;
 
@@ -35,6 +35,8 @@ int main(int argc, char **argv)
 
        xsz = FB_WIDTH * fbscale;
        ysz = FB_HEIGHT * fbscale;
+       fb_width = xsz;
+       fb_height = ysz;
 
        /* allocate 1 extra row as a guard band, until we fucking fix the rasterizer */
        if(!(fb_pixels = malloc(FB_WIDTH * (FB_HEIGHT + 1) * FB_BPP / CHAR_BIT))) {
@@ -159,8 +161,14 @@ static void handle_event(SDL_Event *ev)
                        toggle_fullscreen();
                        break;
                }
-               key = sdlkey_to_gamekey(ev->key.keysym.sym, ev->key.keysym.mod);
-               key_event(key, ev->key.state == SDL_PRESSED ? 1 : 0);
+               if(key_event) {
+                       key = sdlkey_to_gamekey(ev->key.keysym.sym, ev->key.keysym.mod);
+                       key_event(key, ev->key.state == SDL_PRESSED ? 1 : 0);
+               } else {
+                       if(ev->key.keysym.sym == SDLK_ESCAPE) {
+                               quit = 1;
+                       }
+               }
                break;
 
                /*