- Remove few PAS2C ifdef's
authorunc0rr
Wed, 12 Feb 2014 23:40:35 +0400
changeset 10133 d73412fbf3b4
parent 10132 701844ed50d3
child 10134 81d733899e06
- Remove few PAS2C ifdef's - Load localization
hedgewars/hwengine.pas
hedgewars/pas2cSystem.pas
hedgewars/uMatrix.pas
hedgewars/uStore.pas
hedgewars/uVariables.pas
--- a/hedgewars/hwengine.pas	Wed Feb 12 22:40:35 2014 +0400
+++ b/hedgewars/hwengine.pas	Wed Feb 12 23:40:35 2014 +0400
@@ -117,7 +117,7 @@
         begin
         flagMakeCapture:= false;
         {$IFDEF PAS2C}
-        s:= '/Screenshots/hw';
+        s:= '/Screenshots/hw_' + inttostr(GameTicks);
         {$ELSE}
         s:= '/Screenshots/hw_' + FormatDateTime('YYYY-MM-DD_HH-mm-ss', Now()) + inttostr(GameTicks);
         {$ENDIF}
--- a/hedgewars/pas2cSystem.pas	Wed Feb 12 22:40:35 2014 +0400
+++ b/hedgewars/pas2cSystem.pas	Wed Feb 12 23:40:35 2014 +0400
@@ -94,7 +94,8 @@
     glUniform1i, glGetUniformLocation, glEnableVertexAttribArray,
     glGetError, glDeleteProgram, glDeleteBuffers,
     glGenBuffers, glBufferData, glBindBuffer, glewInit,
-    glUniform4f, glDisableVertexAttribArray, glTexEnvi : procedure;
+    glUniform4f, glDisableVertexAttribArray, glTexEnvi,
+    glLoadMatrixf, glMultMatrixf, glGetFloatv: procedure;
 
     GL_BGRA, GL_BLEND, GL_CLAMP_TO_EDGE, GL_COLOR_ARRAY,
     GL_COLOR_BUFFER_BIT, GL_DEPTH_BUFFER_BIT, GL_DEPTH_COMPONENT,
@@ -111,7 +112,8 @@
     GL_COLOR_ATTACHMENT0_EXT, GL_FLOAT, GL_UNSIGNED_BYTE, GL_COMPILE_STATUS,
     GL_INFO_LOG_LENGTH, GL_LINK_STATUS, GL_VERTEX_SHADER, GL_FRAGMENT_SHADER,
     GL_NO_ERROR, GL_ARRAY_BUFFER, GL_STATIC_DRAW, GLEW_OK,
-    GL_AUX_BUFFERS, GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE, GL_ADD: integer;
+    GL_AUX_BUFFERS, GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE, GL_ADD,
+    GL_MODELVIEW_MATRIX: integer;
 
     TThreadId : function : integer;
 
--- a/hedgewars/uMatrix.pas	Wed Feb 12 22:40:35 2014 +0400
+++ b/hedgewars/uMatrix.pas	Wed Feb 12 23:40:35 2014 +0400
@@ -228,7 +228,6 @@
     Result[3,3]:=lhs[0,3]*rhs[3,0] + lhs[1,3]*rhs[3,1] + lhs[2,3]*rhs[3,2] + lhs[3,3]*rhs[3,3];
 }
 
-    {$IFNDEF PAS2C}
     glPushMatrix;
     glLoadMatrixf(@lhs[0, 0]);
     glMultMatrixf(@rhs[0, 0]);
@@ -241,6 +240,7 @@
         if Abs(test[i, j] - Result[i, j]) > 0.000001 then
           error:=true;
 
+    {$IFNDEF PAS2C}
     if error then
     begin
         writeln('shall:');
--- a/hedgewars/uStore.pas	Wed Feb 12 22:40:35 2014 +0400
+++ b/hedgewars/uStore.pas	Wed Feb 12 23:40:35 2014 +0400
@@ -475,7 +475,6 @@
 
 end;
 
-{$IFNDEF PAS2C}
 {$IF DEFINED(USE_S3D_RENDERING) OR DEFINED(USE_VIDEO_RECORDING)}
 procedure CreateFramebuffer(var frame, depth, tex: GLuint);
 begin
@@ -500,7 +499,6 @@
     glDeleteFramebuffersEXT(1, @frame);
 end;
 {$ENDIF}
-{$ENDIF}
 
 procedure StoreRelease(reload: boolean);
 var ii: TSprite;
@@ -972,7 +970,6 @@
     UpdateModelviewProjection;
 {$ENDIF}
 
-{$IFNDEF PAS2C}
 {$IFNDEF USE_S3D_RENDERING}
     if (cStereoMode = smHorizontal) or (cStereoMode = smVertical) or (cStereoMode = smAFR) then
     begin
@@ -989,7 +986,6 @@
             cStereoMode:= smNone;
     end;
 {$ENDIF}
-{$ENDIF}
 
 // set view port to whole window
 glViewport(0, 0, cScreenWidth, cScreenHeight);
--- a/hedgewars/uVariables.pas	Wed Feb 12 22:40:35 2014 +0400
+++ b/hedgewars/uVariables.pas	Wed Feb 12 23:40:35 2014 +0400
@@ -2397,9 +2397,6 @@
 procedure freeModule;
 
 implementation
-{$IFNDEF PAS2C}
-uses strutils;
-{$ENDIF}
 
 procedure preInitModule;
 begin
@@ -2444,14 +2441,10 @@
 end;
 
 procedure initModule;
+var s: shortstring;
 begin
-// TODO: fixme
-{$IFDEF PAS2C}
-    cLocale:= 'en';
-{$ELSE}
-    // TODO: we could just have one cLocale variables and drop strutils
-    cLocale:= ExtractDelimited(1, cLocaleFName, StdWordDelims);
-{$ENDIF}
+    cLocale:= cLocaleFName;
+    SplitByChar(cLocale, s, '.');
 
     cFlattenFlakes      := false;
     cFlattenClouds      := false;