simplify code ios-revival
authorsheepluva
Fri, 11 Sep 2015 21:41:35 +0200
branchios-revival
changeset 11158 797bc8d70e75
parent 11153 2ac6b0d29aba
child 11159 48190da6af61
child 11160 f1f044e88039
simplify code
hedgewars/uRender.pas
--- a/hedgewars/uRender.pas	Fri Sep 11 01:05:02 2015 +0200
+++ b/hedgewars/uRender.pas	Fri Sep 11 21:41:35 2015 +0200
@@ -359,31 +359,29 @@
 {$ENDIF}
 
 function glLoadExtension(extension : shortstring) : boolean;
+var logmsg: shortstring;
 begin
-{$IFNDEF IPHONEOS}
-    //TODO: pas2c does not handle {$IF (GLunit = gles11) OR DEFINED(PAS2C)}
-    {$IFNDEF PAS2C}
-    {$IF GLunit = gles11}
-        // FreePascal doesnt come with OpenGL ES 1.1 Extension headers
-        extension:= extension; // avoid hint
-        glLoadExtension:= false;
-        AddFileLog('OpenGL - "' + extension + '" skipped')
-    {$ELSE}
-        glLoadExtension:= glext_LoadExtension(extension);
-        if glLoadExtension then
-            AddFileLog('OpenGL - "' + extension + '" loaded')
-        else
-            AddFileLog('OpenGL - "' + extension + '" failed to load');
-    {$ENDIF}
-
-    {$ELSE} // pas2c part
-        glLoadExtension:= false;
-    {$ENDIF}
-{$ELSE}
     extension:= extension; // avoid hint
     glLoadExtension:= false;
-    AddFileLog('OpenGL - "' + extension + '" skipped')
+    logmsg:= 'OpenGL - "' + extension + '" skipped';
+
+{$IFNDEF IPHONEOS}
+//TODO: pas2c does not handle
+{$IFNDEF PAS2C}
+// FreePascal doesnt come with OpenGL ES 1.1 Extension headers
+{$IF GLunit <> gles11}
+
+    glLoadExtension:= glext_LoadExtension(extension);
+
+    if glLoadExtension then
+        logmsg:= 'OpenGL - "' + extension + '" loaded'
+    else
+        logmsg:= 'OpenGL - "' + extension + '" failed to load';
+
 {$ENDIF}
+{$ENDIF}
+{$ENDIF}
+    AddFileLog(logmsg);
 end;
 
 {$IFDEF USE_S3D_RENDERING OR USE_VIDEO_RECORDING}