gather context restoration under a single keyword
authorkoda
Sun, 12 Feb 2012 15:27:25 +0100
changeset 6674 4d3209a189ca
parent 6673 1ee72dcea263
child 6675 dab56311daa5
gather context restoration under a single keyword
hedgewars/hwengine.pas
hedgewars/options.inc
hedgewars/uLocale.pas
hedgewars/uStore.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
--- 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}
--- 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;
--- 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;