- Better error handling when creating the window
authorunc0rr
Sun, 04 May 2008 19:47:47 +0000
changeset 904 a573c949e61c
parent 903 d4e5d8cbe449
child 905 57fec00e1b66
- Better error handling when creating the window - Increase protocol number due to physics changes in previous revision
CMakeLists.txt
hedgewars/CCHandlers.inc
--- a/CMakeLists.txt	Sun May 04 14:21:47 2008 +0000
+++ b/CMakeLists.txt	Sun May 04 19:47:47 2008 +0000
@@ -9,7 +9,7 @@
 endif(DEFINED DATA_INSTALL_DIR)
 set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
 
-set(HEDGEWARS_PROTO_VER 10)
+set(HEDGEWARS_PROTO_VER 11)
 
 add_subdirectory(bin)
 add_subdirectory(QTfrontend)
--- a/hedgewars/CCHandlers.inc	Sun May 04 14:21:47 2008 +0000
+++ b/hedgewars/CCHandlers.inc	Sun May 04 19:47:47 2008 +0000
@@ -431,14 +431,15 @@
 if cFullScreen then flags:= flags or SDL_FULLSCREEN
                else SDL_WM_SetCaption('Hedgewars', nil);
 SDL_FreeSurface(SDLPrimSurface);
+
 SDLPrimSurface:= SDL_SetVideoMode(cScreenWidth, cScreenHeight, cBits, flags);
+SDLTry(SDLPrimSurface <> nil, true);
 
 SetupOpenGL();
 
 {$IFDEF DEBUGFILE}
 AddFileLog('SDL video driver: ' + string(SDL_VideoDriverName(buf, sizeof(buf))));
 {$ENDIF}
-TryDo(SDLPrimSurface <> nil, errmsgCreateSurface, true);
 PixelFormat:= SDLPrimSurface^.format
 end;