fix hint and gl2 build. NOTE: this does not change that GL2 segfaults right away. that is an issue that dates back at least 50 commits, but most likely even back to the webgl merge. I guess nobody actually tried to run hedgewars in GL2 since back then :P
authorsheepluva
Wed, 11 Jun 2014 12:55:24 +0200
changeset 10276 89056c7254ef
parent 10275 6c91047f59b6
child 10277 b325e36f8e54
fix hint and gl2 build. NOTE: this does not change that GL2 segfaults right away. that is an issue that dates back at least 50 commits, but most likely even back to the webgl merge. I guess nobody actually tried to run hedgewars in GL2 since back then :P
hedgewars/uRender.pas
hedgewars/uStore.pas
hedgewars/uWorld.pas
--- a/hedgewars/uRender.pas	Tue Jun 10 23:21:22 2014 +0200
+++ b/hedgewars/uRender.pas	Wed Jun 11 12:55:24 2014 +0200
@@ -51,7 +51,7 @@
 procedure DrawFillRect          (r: TSDL_Rect);
 procedure DrawHedgehog          (X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
 procedure DrawScreenWidget      (widget: POnScreenWidget);
-procedure DrawWaterBody         (pVertexBuffer: Pointer; length: LongInt);
+procedure DrawWaterBody         (pVertexBuffer: Pointer);
 
 procedure Tint                  (r, g, b, a: Byte); inline;
 procedure Tint                  (c: Longword); inline;
@@ -119,27 +119,47 @@
 
 procedure openglPushMatrix(); inline;
 begin
-{$IFDEF GL2}h{$ENDIF}glPushMatrix();
+{$IFDEF GL2}
+    hglPushMatrix();
+{$ELSE}
+    glPushMatrix();
+{$ENDIF}
 end;
 
 procedure openglPopMatrix(); inline;
 begin
-{$IFDEF GL2}h{$ENDIF}glPopMatrix();
+{$IFDEF GL2}
+    hglPopMatrix();
+{$ELSE}
+    glPopMatrix();
+{$ENDIF}
 end;
 
 procedure openglTranslatef(X, Y, Z: GLfloat); inline;
 begin
-{$IFDEF GL2}h{$ENDIF}glTranslatef(X, Y, Z);
+{$IFDEF GL2}
+    hglTranslatef(X, Y, Z);
+{$ELSE}
+    glTranslatef(X, Y, Z);
+{$ENDIF}
 end;
 
 procedure openglScalef(ScaleX, ScaleY, ScaleZ: GLfloat); inline;
 begin
-{$IFDEF GL2}h{$ENDIF}glScalef(ScaleX, ScaleY, ScaleZ);
+{$IFDEF GL2}
+    hglScalef(ScaleX, ScaleY, ScaleZ);
+{$ELSE}
+    glScalef(ScaleX, ScaleY, ScaleZ);
+{$ENDIF}
 end;
 
 procedure openglRotatef(RotX, RotY, RotZ: GLfloat; dir: LongInt); inline;
 begin
-{$IFDEF GL2}h{$ENDIF}glRotatef(RotX, RotY, RotZ, dir);
+{$IFDEF GL2}
+    hglRotatef(RotX, RotY, RotZ, dir);
+{$ELSE}
+    glRotatef(RotX, RotY, RotZ, dir);
+{$ENDIF}
 end;
 
 procedure openglUseColorOnly(b :boolean); inline;
@@ -732,7 +752,7 @@
     openglUseColorOnly(false);
 end;
 
-procedure DrawWaterBody(pVertexBuffer: Pointer; length: LongInt);
+procedure DrawWaterBody(pVertexBuffer: Pointer);
 begin
 {$IFDEF GL2}
         UpdateModelviewProjection;
--- a/hedgewars/uStore.pas	Tue Jun 10 23:21:22 2014 +0200
+++ b/hedgewars/uStore.pas	Wed Jun 11 12:55:24 2014 +0200
@@ -73,6 +73,12 @@
 
 procedure updateViewLimits();
 
+{$IFDEF GL2}
+var
+    shaderMain: GLuint;
+    shaderWater: GLuint;
+{$ENDIF}
+
 implementation
 uses uMisc, uConsole, uVariables, uUtils, uTextures, uRender, uRenderUtils,
      uCommands, uPhysFSLayer, uDebug
@@ -91,13 +97,6 @@
     numsquares : LongInt;
     ProgrTex: PTexture;
 
-{$IFDEF GL2}
-    shaderMain: GLuint;
-    shaderWater: GLuint;
-
-    // attributes
-{$ENDIF}
-
     prevHat: shortstring;
     tmpHatSurf: PSDL_Surface;
 
--- a/hedgewars/uWorld.pas	Tue Jun 10 23:21:22 2014 +0200
+++ b/hedgewars/uWorld.pas	Wed Jun 11 12:55:24 2014 +0200
@@ -833,7 +833,7 @@
         VertexBuffer[3].X:= -lw;
         VertexBuffer[3].Y:= lh;
 
-        DrawWaterBody(@VertexBuffer[0], Length(VertexBuffer));
+        DrawWaterBody(@VertexBuffer[0]);
 
 {$IFNDEF GL2}
         // must not be Tint() as color array seems to stay active and color reset is required