Author: Reiner Herrmann <reiner@reiner-h.de>
Description: Fix FTBFS with gdc 12
Bug-Debian: https://bugs.debian.org/1013049

--- a/import/hell2.d
+++ b/import/hell2.d
@@ -136,12 +136,12 @@
  */
 void _reloadTexture()
 {
-	delete g_fontTexture;
+	g_fontTexture.destroy();
 	Hell_loadFont();
 	foreach(key; g_poolTexture.keys)
 	{
 		string path = g_poolTexture[key].getPath();
-		int mask[]  = g_poolTexture[key].getMaskInfo();
+		int[] mask  = g_poolTexture[key].getMaskInfo();
 		Hell_loadTexture(key, path, [mask[0], mask[1], mask[2]]);
 	}
 }
@@ -192,7 +192,7 @@
 //	gluDeleteQuadric(g_quadricObj);
 	
 	// テクスチャ破棄
-	delete g_fontTexture;
+	g_fontTexture.destroy();
 	Hell_disposeTexture();
 	
 	if(g_joy) SDL_JoystickClose(g_joy);
@@ -949,7 +949,7 @@
 		foreach(k; g_poolTexture.keys)
 		{
 			Texture tex = g_poolTexture[k];
-			delete tex;
+			tex.destroy();
 			g_poolTexture.remove(key);
 		}
 	}
@@ -957,7 +957,7 @@
 	{
 		if(!(key in g_poolTexture)) { throw new Error("Hell_disposeTexture: Has exist key: " ~ key); }
 		Texture tex = g_poolTexture[key];
-		delete tex;
+		tex.destroy();
 		g_poolTexture.remove(key);
 	}
 }
--- a/src/br/mainloop.d
+++ b/src/br/mainloop.d
@@ -63,7 +63,7 @@
 		maxSkipFrame = MAX_SKIP_FRAME;
 		SDL_Event event;
 		SDLKey *sdlkey;
-		GLubyte mask[128];
+		GLubyte[128] mask;
 		Uint32 prevTime;
 		//count = 0;
 		
--- a/src/br/screen.d
+++ b/src/br/screen.d
@@ -21,13 +21,13 @@
 	static const int GAME_NEAR = -2;
 	static const int GAME_FAR = -1600;
 	
-	static const GLfloat ambientCol[] = [1, 1, 1, 0.5]; 
+	static const GLfloat[] ambientCol = [1, 1, 1, 0.5]; 
 	
-	static const GLfloat lightPos1[] = [ 0 , 0 , 100 , 0.0 ];
-	static const GLfloat lightCol1[] = [ 1 , 1 , 1 , 1 ];
+	static const GLfloat[] lightPos1 = [ 0 , 0 , 100 , 0.0 ];
+	static const GLfloat[] lightCol1 = [ 1 , 1 , 1 , 1 ];
 	
-	static const GLfloat lightPos2[] = [ 0 , 0 , 100 , 1.0 ];
-	static const GLfloat lightCol2[] = [ 0 , 0 , 1 , 1 ];
+	static const GLfloat[] lightPos2 = [ 0 , 0 , 100 , 1.0 ];
+	static const GLfloat[] lightCol2 = [ 0 , 0 , 1 , 1 ];
 
 
 	static int g_videoFlags = SDL_SWSURFACE|SDL_OPENGL;
--- a/src/util/parts.d
+++ b/src/util/parts.d
@@ -443,7 +443,7 @@
 			
 			//glScaled(size * scaleX ,size * scaleY ,size * scaleZ);
 			
-			GLfloat color[] = [ R, G, B, alpha ];
+			GLfloat[] color = [ R, G, B, alpha ];
 			glMaterialfv(GL_FRONT_AND_BACK, GL_DIFFUSE, cast(float*)color);
 			
 			
--- a/src/br/bullet.d
+++ b/src/br/bullet.d
@@ -7,6 +7,7 @@
 private import br.screen;
 private import br.mainloop;
 private import br.gamemanager;
+private import std.algorithm;
 
 
 
@@ -155,7 +156,7 @@
 			
 			
 			poseZ = atan2(vel.y,vel.x)*180.0/PI;
-			re = cast(int)fmax(0,re-1);
+			re = max(0,re-1);
 		}
 		poseX += mulsp(2f);
 	}
--- a/src/util/matrix.d
+++ b/src/util/matrix.d
@@ -22,7 +22,7 @@
 	public Object clone(){
 		return new Matrix(this);
 	}
-	public Matrix opMul(Matrix t) {
+	public Matrix opBinary(string op)(Matrix t) if (op == "*") {
     Matrix result = new Matrix();
 		for(int i = 0;i < m.length;i ++){
 			for(int j = 0;j < m[i].length;j ++){
@@ -41,7 +41,7 @@
 		}
 		return result;
   }
-	public void opMulAssign(Matrix t) {
+	public void opOpAssign(string op)(Matrix t) if (op == "*") {
 		double[4][4] temp;
 		for(int i = 0;i < m.length;i ++){
 			for(int j = 0;j < m[i].length;j ++){
--- a/src/util/shape.d
+++ b/src/util/shape.d
@@ -101,7 +101,7 @@
 		
 	}
 	
-	public Shape opAdd(Shape s){
+	public Shape opBinary(string op)(Shape s) if (op == "+") {
 		
 		Vector3[] v1;
 		int[][] wires1;
--- a/src/util/vector.d
+++ b/src/util/vector.d
@@ -65,41 +65,41 @@
 	public Object clone(){
 		return new Vector(this);
 	}
-	public float opMul(Vector v) {
+	public float opBinary(string op)(Vector v) if (op == "*") {
     return x * v.x + y * v.y;
   }
-	public Vector opMul(float mul){
+	public Vector opBinary(string op)(float mul) if (op == "*") {
 		return new Vector(x * mul ,y * mul);
 	}
-	public Vector opDiv(float div){
+	public Vector opBinary(string op)(float div) if (op == "/") {
 		return new Vector(x / div ,y / div);
 	}
-	public Vector opAdd(Vector v){
+	public Vector opBinary(string op)(Vector v) if (op == "+") {
 		return new Vector(x + v.x ,y + v.y);
 	}
-	public Vector opSub(Vector v){
+	public Vector opBinary(string op)(Vector v) if (op == "-") {
 		return new Vector(x - v.x ,y - v.y);
 	}
 	public override bool opEquals(Object o){
 		Vector v = cast(Vector)o;
 		return v && (x == v.x) && (y == v.y);
 	}
-	public void opAddAssign(Vector v) {
+	public void opOpAssign(string op)(Vector v) if (op == "+") {
     x += v.x;
     y += v.y;
   }
 
-  public void opSubAssign(Vector v) {
+  public void opOpAssign(string op)(Vector v) if (op == "-") {
     x -= v.x;
     y -= v.y;
   }
 
-  public void opMulAssign(float a) {	
+  public void opOpAssign(string op)(float a) if (op == "*") {
     x *= a;
     y *= a;
   }
 
-  public void opDivAssign(float a) {	
+  public void opOpAssign(string op)(float a) if (op == "/") {
     x /= a;
     y /= a;
   }
@@ -167,41 +167,41 @@
     y = v1.y * ratio + v2.y * (1 - ratio);
     z = v1.z * ratio + v2.z * (1 - ratio);
   }
-	public Vector3 opAdd(Vector3 v){
+	public Vector3 opBinary(string op)(Vector3 v) if (op == "+") {
 		return new Vector3(x + v.x ,y + v.y ,z + v.z);
 	}
-	public Vector3 opSub(Vector3 v){
+	public Vector3 opBinary(string op)(Vector3 v) if (op == "-") {
 		return new Vector3(x - v.x ,y - v.y ,z - v.z);
 	}
-	public Vector3 opMul(float mul){
+	public Vector3 opBinary(string op)(float mul) if (op == "*") {
 		return new Vector3(x * mul ,y * mul ,z * mul);
 	}
-	public Vector3 opDiv(float div){
+	public Vector3 opBinary(string op)(float div) if (op == "/") {
 		return new Vector3(x / div ,y / div ,z /div);
 	}
 	public override bool opEquals(Object o){
 		Vector3 v = cast(Vector3)o;
 		return v && (x == v.x) && (y == v.y) && (z == v.z);
 	}
-  public void opAddAssign(Vector3 v) {
+  public void opOpAssign(string op)(Vector3 v) if (op == "+") {
     x += v.x;
     y += v.y;
     z += v.z;
   }
 
-  public void opSubAssign(Vector3 v) {
+  public void opOpAssign(string op)(Vector3 v) if (op == "-") {
     x -= v.x;
     y -= v.y;
     z -= v.z;
   }
 
-  public void opMulAssign(float a) {	
+  public void opOpAssign(string op)(float a) if (op == "*") {
     x *= a;
     y *= a;
     z *= a;
   }
 
-  public void opDivAssign(float a) {	
+  public void opOpAssign(string op)(float a) if (op == "/") {
     x /= a;
     y /= a;
     z /= a;
