X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=putt%2Fmain.c;h=2b08ba7b8861082b2bfb2adbb673d942db8af56d;hb=a863f290379543d092c9aafb5eb4d06080a567d8;hp=31841fecc86ba39940c367632551be2e65abaf2a;hpb=39de98299ae3429e5fc83d41f3c5c521f771ff72;p=neverball diff --git a/putt/main.c b/putt/main.c index 31841fe..2b08ba7 100644 --- a/putt/main.c +++ b/putt/main.c @@ -15,8 +15,6 @@ /*---------------------------------------------------------------------------*/ #include -#include - #include #include #include @@ -33,6 +31,7 @@ #include "game.h" #include "gui.h" #include "text.h" +#include "syswm.h" #include "st_conf.h" #include "st_all.h" @@ -44,15 +43,12 @@ static int shot(void) { static char filename[MAXSTR]; - static int num = 0; - - sprintf(filename, "screen%02d.png", num++); - image_snap(filename); + sprintf(filename, "screen%05d.png", config_screenshot()); + image_snap(config_user(filename)); return 1; } - /*---------------------------------------------------------------------------*/ static void toggle_wire(void) @@ -172,10 +168,8 @@ static int loop(void) case SDL_ACTIVEEVENT: if (e.active.state == SDL_APPINPUTFOCUS) - { - if (e.active.gain == 0) + if (e.active.gain == 0 && config_get_grab()) goto_pause(&st_over, 0); - } break; case SDL_JOYAXISMOTION: @@ -197,7 +191,6 @@ static int loop(void) int main(int argc, char *argv[]) { int camera = 0; - SDL_Surface *icon; SDL_Joystick *joy = NULL; srand((int) time(NULL)); @@ -241,15 +234,9 @@ int main(int argc, char *argv[]) SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); -#ifndef __APPLE__ - icon = IMG_Load(config_data("icon/neverputt.png")); + /* This has to happen before mode setting... */ - if (icon) - { - SDL_WM_SetIcon(icon, NULL); - SDL_FreeSurface(icon); - } -#endif /* __APPLE__ */ + set_SDL_icon("icon/neverputt.png"); /* Initialize the video. */ @@ -259,6 +246,10 @@ int main(int argc, char *argv[]) { int t1, t0 = SDL_GetTicks(); + /* ... and this has to happen after it. */ + + set_EWMH_icon("icon/neverputt.png"); + SDL_WM_SetCaption(TITLE, TITLE); /* Run the main game loop. */ @@ -270,7 +261,7 @@ int main(int argc, char *argv[]) if ((t1 = SDL_GetTicks()) > t0) { st_timer((t1 - t0) / 1000.f); - st_paint(); + st_paint(0.001f * t1); SDL_GL_SwapBuffers(); t0 = t1;