# HG changeset patch # User unc0rr # Date 1217188032 0 # Node ID d595dc56b4f31ac0d38510af2fd070a404d345db # Parent eb5a9f86f9c625567f1d7f7c8afcd9e84522c571 Remember initial resolution settings to use when switching to fullscreen mode diff -r eb5a9f86f9c6 -r d595dc56b4f3 hedgewars/CCHandlers.inc --- a/hedgewars/CCHandlers.inc Sun Jul 27 19:37:24 2008 +0000 +++ b/hedgewars/CCHandlers.inc Sun Jul 27 19:47:12 2008 +0000 @@ -456,8 +456,13 @@ SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); flags:= SDL_OPENGL or SDL_RESIZABLE; -if cFullScreen then flags:= flags or SDL_FULLSCREEN - else SDL_WM_SetCaption('Hedgewars', nil); +if cFullScreen then + begin + flags:= flags or SDL_FULLSCREEN; + cScreenWidth:= cInitWidth; + cScreenHeight:= cInitHeight + end + else SDL_WM_SetCaption('Hedgewars', nil); {$IFDEF DEBUGFILE} AddFileLog('Freeing old primary surface...'); {$ENDIF} diff -r eb5a9f86f9c6 -r d595dc56b4f3 hedgewars/hwengine.dpr --- a/hedgewars/hwengine.dpr Sun Jul 27 19:37:24 2008 +0000 +++ b/hedgewars/hwengine.dpr Sun Jul 27 19:47:12 2008 +0000 @@ -156,7 +156,7 @@ SDL_KEYDOWN: if GameState = gsChat then KeyPressChat(event.key.keysym.unicode); SDL_ACTIVEEVENT: if (event.active.state and SDL_APPINPUTFOCUS) <> 0 then cHasFocus:= event.active.gain = 1; - SDL_VIDEORESIZE: Resize(max(event.resize.w, 320), max(event.resize.h, 240)); + SDL_VIDEORESIZE: Resize(max(event.resize.w, 600), max(event.resize.h, 450)); SDL_QUITEV: isTerminated:= true end; CurrTime:= SDL_GetTicks; @@ -187,6 +187,8 @@ 14: begin val(ParamStr(2), cScreenWidth); val(ParamStr(3), cScreenHeight); + cInitWidth:= cScreenWidth; + cInitHeight:= cScreenHeight; cBitsStr:= ParamStr(4); val(cBitsStr, cBits); val(ParamStr(5), ipcPort); diff -r eb5a9f86f9c6 -r d595dc56b4f3 hedgewars/uMisc.pas --- a/hedgewars/uMisc.pas Sun Jul 27 19:37:24 2008 +0000 +++ b/hedgewars/uMisc.pas Sun Jul 27 19:47:12 2008 +0000 @@ -40,6 +40,8 @@ cCloudsNumber : LongInt = 9; cScreenWidth : LongInt = 1024; cScreenHeight : LongInt = 768; + cInitWidth : LongInt = 1024; + cInitHeight : LongInt = 768; cBits : LongInt = 16; cBitsStr : string[2] = '16'; cTagsMask : byte = 7;