r15798 - packages/trunk/mu-cade/debian/patches

Peter De Wachter pdewacht-guest at moszumanska.debian.org
Sun Jun 19 17:57:13 UTC 2016


Author: pdewacht-guest
Date: 2016-06-19 17:57:13 +0000 (Sun, 19 Jun 2016)
New Revision: 15798

Modified:
   packages/trunk/mu-cade/debian/patches/dlang_v2.patch
Log:
mu-cade: get rid of more deprecated constructs

Old code: assert(x <>= 0);
New code: assert(!isNaN(x));



Modified: packages/trunk/mu-cade/debian/patches/dlang_v2.patch
===================================================================
--- packages/trunk/mu-cade/debian/patches/dlang_v2.patch	2016-06-10 20:15:44 UTC (rev 15797)
+++ packages/trunk/mu-cade/debian/patches/dlang_v2.patch	2016-06-19 17:57:13 UTC (rev 15798)
@@ -186,15 +186,22 @@
  }
 --- a/src/abagames/mcd/bullet.d
 +++ b/src/abagames/mcd/bullet.d
-@@ -52,7 +52,7 @@
+@@ -52,11 +52,11 @@
    ShapeGroup shape;
    LinePoint linePoint;
  
 -  invariant {
 +  invariant() {
      if (bullet && bullet.pos) {
-       assert(bullet.pos.x <>= 0);
-       assert(bullet.pos.y <>= 0);
+-      assert(bullet.pos.x <>= 0);
+-      assert(bullet.pos.y <>= 0);
+-      assert(bullet.deg <>= 0);
++      assert(!isNaN(bullet.pos.x));
++      assert(!isNaN(bullet.pos.y));
++      assert(!isNaN(bullet.deg));
+     }
+     assert(cnt >= 0);
+   }
 @@ -184,7 +184,7 @@
        removeForced();
    }
@@ -204,15 +211,22 @@
    }
  
    public void slowdown() {
-@@ -215,7 +215,7 @@
+@@ -215,11 +215,11 @@
    LinePoint linePoint;
    int cnt;
  
 -  invariant {
 +  invariant() {
      if (pos) {
-       assert(pos.x <>= 0);
-       assert(pos.y <>= 0);
+-      assert(pos.x <>= 0);
+-      assert(pos.y <>= 0);
+-      assert(deg <>= 0);
++      assert(!isNaN(pos.x));
++      assert(!isNaN(pos.y));
++      assert(!isNaN(deg));
+       assert(speed > 0 && speed < 10);
+     }
+   }
 @@ -296,7 +296,7 @@
      }
    }
@@ -244,15 +258,30 @@
    }
 --- a/src/abagames/mcd/enemy.d
 +++ b/src/abagames/mcd/enemy.d
-@@ -43,7 +43,7 @@
+@@ -43,16 +43,16 @@
    EnemyState state;
    Vector3 lastForce;
  
 -  invariant {
 +  invariant() {
      if (state && state.pos) {
-       assert(state.pos.x <>= 0);
-       assert(state.pos.y <>= 0);
+-      assert(state.pos.x <>= 0);
+-      assert(state.pos.y <>= 0);
+-      assert(state.pos.z <>= 0);
++      assert(!isNaN(state.pos.x));
++      assert(!isNaN(state.pos.y));
++      assert(!isNaN(state.pos.z));
+     }
+     if (lastForce) {
+-      assert(lastForce.x <>= 0);
+-      assert(lastForce.y <>= 0);
+-      assert(lastForce.z <>= 0);
++      assert(!isNaN(lastForce.x));
++      assert(!isNaN(lastForce.y));
++      assert(!isNaN(lastForce.z));
+     }
+   }
+ 
 @@ -64,7 +64,7 @@
      rand.setSeed(seed);
    }
@@ -298,15 +327,35 @@
      state.linePoint.draw();
      spec.drawSubShape(state);
    }
-@@ -422,7 +422,7 @@
+@@ -422,17 +422,17 @@
    static const int MAX_LINE_POINT_NUM = 24;
    Field field;
  
 -  invariant {
+-    assert(pos.x <>= 0);
+-    assert(pos.y <>= 0);
+-    assert(pos.z <>= 0);
+-    assert(fabs(linearVel[0]) <>= 0);
+-    assert(fabs(linearVel[1]) <>= 0);
+-    assert(fabs(linearVel[2]) <>= 0);
+-    assert(fabs(angularVel[0]) <>= 0);
+-    assert(fabs(angularVel[1]) <>= 0);
+-    assert(fabs(angularVel[2]) <>= 0);
+-    assert(deg <>= 0);
 +  invariant() {
-     assert(pos.x <>= 0);
-     assert(pos.y <>= 0);
-     assert(pos.z <>= 0);
++    assert(!isNaN(pos.x));
++    assert(!isNaN(pos.y));
++    assert(!isNaN(pos.z));
++    assert(!isNaN(fabs(linearVel[0])));
++    assert(!isNaN(fabs(linearVel[1])));
++    assert(!isNaN(fabs(linearVel[2])));
++    assert(!isNaN(fabs(angularVel[0])));
++    assert(!isNaN(fabs(angularVel[1])));
++    assert(!isNaN(fabs(angularVel[2])));
++    assert(!isNaN(deg));
+     if (sizeScale) {
+       assert(sizeScale.x > 0);
+       assert(sizeScale.y > 0);
 @@ -537,7 +537,7 @@
    public void recordLinePoints(EnemyState state, LinePoint lp) {
      glPushMatrix();
@@ -423,24 +472,67 @@
            break;
 --- a/src/abagames/mcd/particle.d
 +++ b/src/abagames/mcd/particle.d
-@@ -35,7 +35,7 @@
+@@ -35,16 +35,16 @@
    float decayRatio;
    LinePoint linePoint;
  
 -  invariant {
 +  invariant() {
      if (pos) {
-       assert(pos.x <>= 0);
-       assert(pos.y <>= 0);
-@@ -171,7 +171,7 @@
+-      assert(pos.x <>= 0);
+-      assert(pos.y <>= 0);
+-      assert(pos.z <>= 0);
+-      assert(vel.x <>= 0);
+-      assert(vel.y <>= 0);
+-      assert(vel.z <>= 0);
+-      assert(deg <>= 0);
+-      assert(md <>= 0);
++      assert(!isNaN(pos.x));
++      assert(!isNaN(pos.y));
++      assert(!isNaN(pos.z));
++      assert(!isNaN(vel.x));
++      assert(!isNaN(vel.y));
++      assert(!isNaN(vel.z));
++      assert(!isNaN(deg));
++      assert(!isNaN(md));
+       assert(size > 0 && size < 10);
+       assert(r >= 0 && r <= 1);
+       assert(g >= 0 && g <= 1);
+@@ -171,23 +171,23 @@
    ConnectedParticle prevParticle;
    LinePoint linePoint;
  
 -  invariant {
 +  invariant() {
      if (_pos) {
-       assert(_pos.x <>= 0);
-       assert(_pos.y <>= 0);
+-      assert(_pos.x <>= 0);
+-      assert(_pos.y <>= 0);
+-      assert(_pos.z <>= 0);
+-      assert(_vel.x <>= 0);
+-      assert(_vel.y <>= 0);
+-      assert(_vel.z <>= 0);
++      assert(!isNaN(_pos.x));
++      assert(!isNaN(_pos.y));
++      assert(!isNaN(_pos.z));
++      assert(!isNaN(_vel.x));
++      assert(!isNaN(_vel.y));
++      assert(!isNaN(_vel.z));
+       assert(r >= 0 && r <= 1);
+       assert(g >= 0 && g <= 1);
+       assert(b >= 0 && b <= 1);
+-      assert(baseLength <>= 0);
++      assert(!isNaN(baseLength));
+     }
+     if (prevParticle && prevParticle._exists) {
+-      assert(prevParticle._pos.x <>= 0);
+-      assert(prevParticle._pos.y <>= 0);
+-      assert(prevParticle._pos.z <>= 0);
++      assert(!isNaN(prevParticle._pos.x));
++      assert(!isNaN(prevParticle._pos.y));
++      assert(!isNaN(prevParticle._pos.z));
+     }
+   }
+ 
 @@ -286,7 +286,7 @@
      glPushMatrix();
      Screen.glTranslate(_pos);
@@ -450,33 +542,71 @@
      linePoint.beginRecord();
      linePoint.record(0, 0, 0);
      linePoint.record((prevParticle.pos.x - _pos.x) * 2,
-@@ -358,7 +358,7 @@
+@@ -358,16 +358,16 @@
    ShapeGroup shape;
    LinePoint linePoint;
  
 -  invariant {
 +  invariant() {
      if (pos) {
-       assert(pos.x <>= 0);
-       assert(pos.y <>= 0);
-@@ -483,7 +483,7 @@
+-      assert(pos.x <>= 0);
+-      assert(pos.y <>= 0);
+-      assert(pos.z <>= 0);
+-      assert(vel.x <>= 0);
+-      assert(vel.y <>= 0);
+-      assert(vel.z <>= 0);
++      assert(!isNaN(pos.x));
++      assert(!isNaN(pos.y));
++      assert(!isNaN(pos.z));
++      assert(!isNaN(vel.x));
++      assert(!isNaN(vel.y));
++      assert(!isNaN(vel.z));
+       assert(size > 0 && size < 10);
+-      assert(deg <>= 0);
++      assert(!isNaN(deg));
+       assert(r >= 0 && r <= 1);
+       assert(g >= 0 && g <= 1);
+       assert(b >= 0 && b <= 1);
+@@ -483,14 +483,14 @@
    float size;
    int cnt;
  
 -  invariant {
 +  invariant() {
      if (pos) {
-       assert(pos.x <>= 0);
-       assert(pos.y <>= 0);
-@@ -542,7 +542,7 @@
+-      assert(pos.x <>= 0);
+-      assert(pos.y <>= 0);
+-      assert(pos.z <>= 0);
+-      assert(vel.x <>= 0);
+-      assert(vel.y <>= 0);
+-      assert(vel.z <>= 0);
++      assert(!isNaN(pos.x));
++      assert(!isNaN(pos.y));
++      assert(!isNaN(pos.z));
++      assert(!isNaN(vel.x));
++      assert(!isNaN(vel.y));
++      assert(!isNaN(vel.z));
+       assert(size > 0 && size < 10);
+     }
+   }
+@@ -542,12 +542,12 @@
    int cnt;
    int num1, num2;
  
 -  invariant {
 +  invariant() {
      if (pos) {
-       assert(pos.x <>= 0);
-       assert(pos.y <>= 0);
+-      assert(pos.x <>= 0);
+-      assert(pos.y <>= 0);
+-      assert(vel.x <>= 0);
+-      assert(vel.y <>= 0);
++      assert(!isNaN(pos.x));
++      assert(!isNaN(pos.y));
++      assert(!isNaN(vel.x));
++      assert(!isNaN(vel.y));
+       assert(size > 0 && size < 10);
+     }
+   }
 --- a/src/abagames/mcd/prefmanager.d
 +++ b/src/abagames/mcd/prefmanager.d
 @@ -7,8 +7,9 @@
@@ -590,16 +720,31 @@
                                float x2, float y2, float z2, float a = 1) {
 --- a/src/abagames/mcd/shape.d
 +++ b/src/abagames/mcd/shape.d
-@@ -74,7 +74,7 @@
+@@ -5,6 +5,7 @@
+  */
+ module abagames.mcd.shape;
+ 
++private import std.math;
+ private import opengl;
+ private import ode.ode;
+ private import abagames.util.vector;
+@@ -74,11 +75,11 @@
    float mass = 1;
    float shapeBoxScale = 1;
  
 -  invariant {
 +  invariant() {
      if (pos) {
-       assert(pos.x <>= 0);
-       assert(pos.y <>= 0);
-@@ -158,7 +158,7 @@
+-      assert(pos.x <>= 0);
+-      assert(pos.y <>= 0);
+-      assert(pos.z <>= 0);
++      assert(!isNaN(pos.x));
++      assert(!isNaN(pos.y));
++      assert(!isNaN(pos.z));
+       assert(size.x >= 0);
+       assert(size.y >= 0);
+       assert(size.z >= 0);
+@@ -158,7 +159,7 @@
      size = new Vector3(sx, sy, sz);
    }
  
@@ -608,7 +753,7 @@
      lp.setPos(pos);
      lp.setSize(size);
      lp.record(-1, -1, 0);
-@@ -171,7 +171,7 @@
+@@ -171,7 +172,7 @@
      lp.record(-1, -1, 0);
    }
  
@@ -617,7 +762,7 @@
      lp.setPos(pos);
      lp.setSize(size);
      if (!lp.setShadowColor())
-@@ -224,7 +224,7 @@
+@@ -224,7 +225,7 @@
      }
    }
  
@@ -626,7 +771,7 @@
      lp.setPos(pos);
      lp.setSize(size);
      lp.record(-1, -1, 0);
-@@ -237,7 +237,7 @@
+@@ -237,7 +238,7 @@
      lp.record(-1, -1, 0);
    }
  
@@ -635,7 +780,7 @@
      lp.setPos(pos);
      lp.setSize(size);
      if (!lp.setShadowColor())
-@@ -262,7 +262,7 @@
+@@ -262,7 +263,7 @@
      shapeBoxScale = 1;
    }
  
@@ -644,7 +789,7 @@
      lp.setPos(pos);
      lp.setSize(size);
      lp.record( 0,  1, 0);
-@@ -273,7 +273,7 @@
+@@ -273,7 +274,7 @@
      lp.record( 0,  1, 0);
    }
  
@@ -653,7 +798,7 @@
      lp.setPos(pos);
      lp.setSize(size);
      if (!lp.setShadowColor())
-@@ -296,7 +296,7 @@
+@@ -296,7 +297,7 @@
      size = new Vector3(sx, sy, sz);
    }
  
@@ -662,7 +807,7 @@
      lp.setPos(pos);
      lp.setSize(size);
      lp.record(-1, -1, -1);
-@@ -327,7 +327,7 @@
+@@ -327,7 +328,7 @@
      lp.record(-1,  1, -1);
    }
  
@@ -671,7 +816,7 @@
      lp.setPos(pos);
      lp.setSize(size);
      if (!lp.setShadowColor())
-@@ -382,7 +382,7 @@
+@@ -382,7 +383,7 @@
    float _alpha, _alphaTrg;
    bool _enableSpectrumColor;
  
@@ -680,7 +825,20 @@
      if (pos) {
        assert(posIdx >= 0);
        assert(histIdx >= 0 && histIdx < HISTORY_MAX);
-@@ -407,11 +407,11 @@
+@@ -395,9 +396,9 @@
+       assert(spectrumColorG >= 0 && spectrumColorG <= 1);
+       assert(spectrumColorB >= 0 && spectrumColorB <= 1);
+       for (int i = 0; i < posIdx; i++) {
+-        assert(pos[i].x <>= 0);
+-        assert(pos[i].y <>= 0);
+-        assert(pos[i].z <>= 0);
++        assert(!isNaN(pos[i].x));
++        assert(!isNaN(pos[i].y));
++        assert(!isNaN(pos[i].z));
+       }
+     }
+   }
+@@ -407,11 +408,11 @@
      pos = new Vector3[pointMax];
      posHist = new Vector3[][HISTORY_MAX];
      this.field = field;
@@ -695,7 +853,7 @@
          p = new Vector3;
      }
      spectrumColorRTrg = spectrumColorGTrg = spectrumColorBTrg = 0;
-@@ -512,7 +512,7 @@
+@@ -512,7 +513,7 @@
      glVertex3f(tx, ty, tz);
    }
  
@@ -706,7 +864,7 @@
      float y = basePos.y + baseSize.y / 2 * oy;
 --- a/src/abagames/mcd/ship.d
 +++ b/src/abagames/mcd/ship.d
-@@ -78,7 +78,7 @@
+@@ -78,14 +78,14 @@
    int titleCnt;
    bool _replayMode;
  
@@ -715,6 +873,15 @@
      if (_pos && field) {
        assert(_pos.x > -field.size.x * 100);
        assert(_pos.x <  field.size.x * 100);
+       assert(_pos.y > -field.size.y * 100);
+       assert(_pos.y <  field.size.y * 100);
+-      assert(_pos.z <>= 0);
+-      assert(deg <>= 0);
++      assert(!isNaN(_pos.z));
++      assert(!isNaN(deg));
+     }
+   }
+ 
 @@ -127,7 +127,7 @@
      linePoint = new LinePoint(field);
      linePoint.setSpectrumParams(0, 1.0f, 0, 1.0f);
@@ -768,15 +935,24 @@
      subShape.draw();
      glPopMatrix();
    }
-@@ -525,7 +525,7 @@
+@@ -525,12 +525,12 @@
    LinePoint linePoint;
    dJointID joint;
  
 -  invariant {
 +  invariant() {
      if (_pos) {
-       assert(_pos.x <>= 0);
-       assert(_pos.y <>= 0);
+-      assert(_pos.x <>= 0);
+-      assert(_pos.y <>= 0);
+-      assert(_pos.z <>= 0);
+-      assert(deg <>= 0);
++      assert(!isNaN(_pos.x));
++      assert(!isNaN(_pos.y));
++      assert(!isNaN(_pos.z));
++      assert(!isNaN(deg));
+       assert(size.x >= 0);
+       assert(size.y >= 0);
+       assert(size.z >= 0);
 @@ -593,7 +593,7 @@
      linePoint.init();
    }
@@ -815,15 +991,22 @@
      shape.drawShadow(linePoint);
 --- a/src/abagames/mcd/shot.d
 +++ b/src/abagames/mcd/shot.d
-@@ -37,7 +37,7 @@
+@@ -37,11 +37,11 @@
    ShapeGroup shape;
    LinePoint linePoint;
  
 -  invariant {
 +  invariant() {
      if (pos) {
-       assert(pos.x <>= 0);
-       assert(pos.y <>= 0);
+-      assert(pos.x <>= 0);
+-      assert(pos.y <>= 0);
+-      assert(_deg <>= 0);
++      assert(!isNaN(pos.x));
++      assert(!isNaN(pos.y));
++      assert(!isNaN(_deg));
+     }
+     assert(cnt >= 0);
+   }
 @@ -82,7 +82,7 @@
      doCollide();
    }
@@ -1767,15 +1950,20 @@
      Uint32* surfacePixels = cast(Uint32*) s.pixels;
 --- a/src/abagames/util/sdl/twinstickpad.d
 +++ b/src/abagames/util/sdl/twinstickpad.d
-@@ -65,7 +65,7 @@
+@@ -65,10 +65,10 @@
          state.right.x = state.right.y = 0;
        } else {
          ry = -ry;
 -        float rd = atan2(rx, ry) * reverse + rotate;
+-        assert(rd <>= 0);
 +        float rd = atan2(cast(float)rx, cast(float)ry) * reverse + rotate;
-         assert(rd <>= 0);
++        assert(!isNaN(rd));
          float rl = sqrt(cast(float) rx * rx + cast(float) ry * ry);
-         assert(rl <>= 0);
+-        assert(rl <>= 0);
++        assert(!isNaN(rl));
+         state.right.x = adjustAxis(cast(int) (sin(rd) * rl));
+         state.right.y = adjustAxis(cast(int) (cos(rd) * rl));
+       }
 @@ -162,7 +162,7 @@
    int button;
   private:




More information about the Pkg-games-commits mailing list