X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FOpenGL_Windows.cpp;h=4c8326915dc57cb5e63dc1cd1fd4d9eed69c2ff5;hb=f77ab80df9b206477192d6b78080cda056816161;hp=30b0312670ba367bb8248a17105cc0dc19318be1;hpb=982282c738f6f48e0c1e8ad9156557b6930cbfa7;p=lugaru.git diff --git a/Source/OpenGL_Windows.cpp b/Source/OpenGL_Windows.cpp index 30b0312..4c83269 100644 --- a/Source/OpenGL_Windows.cpp +++ b/Source/OpenGL_Windows.cpp @@ -891,9 +891,6 @@ Boolean SetUp (Game & game) SDL_WM_SetCaption("Lugaru", "lugaru"); - if (!cmdline("nomousegrab")) - SDL_WM_GrabInput(SDL_GRAB_ON); - SDL_ShowCursor(0); if (SDL_SetVideoMode(kContextWidth, kContextHeight, 0, sdlflags) == NULL) @@ -902,6 +899,8 @@ Boolean SetUp (Game & game) return false; } + if (!cmdline("nomousegrab")) + SDL_WM_GrabInput(SDL_GRAB_ON); #elif (defined WIN32) //------------------------------------------------------------------ @@ -1393,7 +1392,34 @@ static bool try_launch_browser(const char *browser, const char *url) strcat(dst, " "); strcat(dst, url); } - return(system(buf) == 0); + + #define MAX_BROWSER_ARGS 512 + char *args[MAX_BROWSER_ARGS]; + char *path = NULL; + memset(args, '\0', sizeof (args)); + path = args[0] = strtok(buf, " "); + if (path == NULL) + return false; + + size_t i = 0; + for (i = 1; i < MAX_BROWSER_ARGS; i++) + { + args[i] = strtok(NULL, " "); + if (args[i] == NULL) + break; + } + + if (i == MAX_BROWSER_ARGS) + return false; + #undef MAX_BROWSER_ARGS + + //printf("calling execvp(\"%s\"", path); + //for (i = 0; args[i]; i++) + // printf(", \"%s\"", args[i]); + //printf("); ...\n\n\n"); + + execvp(path, args); + return(false); // exec shouldn't return unless there's an error. } #endif @@ -1643,7 +1669,11 @@ int main(int argc, char **argv) // if(game.registernow){ if(regnow) { + #if PLATFORM_LINUX // (this may not be necessary any more.) + launch_web_browser("http://www.wolfire.com/registerlinux.html"); + #else launch_web_browser("http://www.wolfire.com/registerpc.html"); + #endif } #if PLATFORM_LINUX // (this may not be necessary any more.) @@ -2649,10 +2679,6 @@ static bool load_png(const char *file_name, TGAImageRec &tex) if (!row_pointers) goto png_done; - retval = malloc(width * height * 4); - if (!retval) - goto png_done; - if (!hasalpha) { png_byte *dst = tex.data;