# HG changeset patch # User koda # Date 1329056845 -3600 # Node ID 4d3209a189ca2a3bfc98bb6be4bfa388e76f02ac # Parent 1ee72dcea26398d31fff64713cae28b6c03a7e0f gather context restoration under a single keyword diff -r 1ee72dcea263 -r 4d3209a189ca hedgewars/hwengine.pas --- a/hedgewars/hwengine.pas Sun Feb 12 15:04:17 2012 +0100 +++ b/hedgewars/hwengine.pas Sun Feb 12 15:27:25 2012 +0100 @@ -267,7 +267,7 @@ ParseCommand('fullscr '+intToStr(LongInt(cFullScreen)), true); WriteLnToConsole('window resize: ' + IntToStr(cScreenWidth) + ' x ' + IntToStr(cScreenHeight)); ScriptOnScreenResize(); - InitCameraBorders() + InitCameraBorders(); end; if isTerminated = false then diff -r 1ee72dcea263 -r 4d3209a189ca hedgewars/options.inc --- a/hedgewars/options.inc Sun Feb 12 15:04:17 2012 +0100 +++ b/hedgewars/options.inc Sun Feb 12 15:27:25 2012 +0100 @@ -33,8 +33,9 @@ {$DEFINE S3D_DISABLED} {$DEFINE GLunit:=gles11} {$DEFINE MOBILE} - {$DEFINE Java_Prefix := 'Java_org_hedgewars_hedgeroid_EngineProtocol_PascalExports_'} + {$DEFINE Java_Prefix:= 'Java_org_hedgewars_hedgeroid_EngineProtocol_PascalExports_'} {$DEFINE USE_SDLTHREADS} + {$DEFINE USE_CONTEXT_RESTORE} {$ENDIF} {$IFDEF IPHONEOS} @@ -45,8 +46,15 @@ {$DEFINE MOBILE} {$ENDIF} +{$IFDEF WIN32} + {$DEFINE USE_CONTEXT_RESTORE} +{$ENDIF} + {$IFNDEF IPHONEOS} - // not needed on ios because it is switched from the compiler command line arguments + {$IFDEF DARWIN} + {$DEFINE USE_CONTEXT_RESTORE} + {$ENDIF} + // not needed on ios because DEBUGFILE is switched from command line {$DEFINE DEBUGFILE} //{$DEFINE TRACEAIACTIONS} //{$DEFINE COUNTTICKS} diff -r 1ee72dcea263 -r 4d3209a189ca hedgewars/uLocale.pas --- a/hedgewars/uLocale.pas Sun Feb 12 15:04:17 2012 +0100 +++ b/hedgewars/uLocale.pas Sun Feb 12 15:27:25 2012 +0100 @@ -96,7 +96,7 @@ end; end; Close(f); - {$IFNDEF IPHONEOS}WriteLnToConsole('Locale loaded "' + FileName + '"');{$ENDIF} + {$IFNDEF HWLIBRARY}WriteLnToConsole('Locale loaded "' + FileName + '"');{$ENDIF} end; {$I+} end; diff -r 1ee72dcea263 -r 4d3209a189ca hedgewars/uStore.pas --- a/hedgewars/uStore.pas Sun Feb 12 15:04:17 2012 +0100 +++ b/hedgewars/uStore.pas Sun Feb 12 15:27:25 2012 +0100 @@ -126,7 +126,6 @@ r, rr: TSDL_Rect; drY: LongInt; texsurf, flagsurf, iconsurf: PSDL_Surface; - s: shortstring; begin r.x:= 0; r.y:= 0; @@ -369,7 +368,7 @@ // This should maybe be flagged. It wastes quite a bit of memory. if not reload then begin -{$IF DEFINED(DARWIN) OR DEFINED(WIN32) or DEFINED(ANDROID)} +{$IFDEF USE_CONTEXT_RESTORE} Surface:= tmpsurf {$ELSE} if saveSurf then @@ -1030,7 +1029,7 @@ exit; {$ELSE} SetScale(cDefaultZoomLevel); - {$IF DEFINED(DARWIN) OR DEFINED(WIN32) or DEFINED(ANDROID)} + {$IFDEF USE_CONTEXT_RESTORE} reinit:= true; StoreRelease(true); ResetLand;