File: fixes.patch

package info (click to toggle)
parsec47 0.2.dfsg1-11
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 6,352 kB
  • sloc: xml: 2,178; ansic: 47; makefile: 28
file content (674 lines) | stat: -rw-r--r-- 22,594 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
# Copyright (C) 2007  Marcel Unbehaun <frostworks@gmx.de>
# Distributed under the same license as the game. See debian/copyright.

--- a/src/abagames/p47/Bonus.d
+++ b/src/abagames/p47/Bonus.d
@@ -63,7 +63,7 @@
   }
 
   public override void init(ActorInitializer ini) {
-    BonusInitializer bi = (BonusInitializer) ini;
+    BonusInitializer bi = cast(BonusInitializer) ini;
     field = bi.field;
     ship = bi.ship;
     manager = bi.manager;
@@ -132,7 +132,7 @@
     if (cnt < RETRO_CNT)
       return;
     float d = pos.dist(ship.pos);
-    if (d < ACQUIRE_WIDTH * (1 + (float) inhaleCnt * 0.2) && ship.cnt >= -Ship.INVINCIBLE_CNT) {
+    if (d < ACQUIRE_WIDTH * (1 + cast(float) inhaleCnt * 0.2) && ship.cnt >= -Ship.INVINCIBLE_CNT) {
       getBonus();
       isExist = false;
       return;
@@ -157,8 +157,8 @@
   public override void draw() {
     float retro;
     if (cnt < RETRO_CNT)
-      retro = 1 - (float) cnt / RETRO_CNT;
-    else 
+      retro = 1 - cast(float) cnt / RETRO_CNT;
+    else
       retro = 0;
     float d = cnt * 0.1;
     float ox = sin(d) * 0.3;
--- a/src/abagames/p47/BulletActor.d
+++ b/src/abagames/p47/BulletActor.d
@@ -59,7 +59,7 @@
   }
 
   public override void init(ActorInitializer ini) {
-    BulletActorInitializer bi = (BulletActorInitializer) ini;
+    BulletActorInitializer bi = cast(BulletActorInitializer) ini;
     field = bi.field;
     ship = bi.ship;
     bullet = new P47Bullet(nextId);
--- a/src/abagames/p47/BulletActorPool.d
+++ b/src/abagames/p47/BulletActorPool.d
@@ -32,10 +32,10 @@
   }
 
   public void addBullet(float deg, float speed) {
-    BulletActor ba = (BulletActor) getInstance();
+    BulletActor ba = cast(BulletActor) getInstance();
     if (!ba)
       return;
-    P47Bullet rb = (P47Bullet) Bullet.now;
+    P47Bullet rb = cast(P47Bullet) Bullet.now;
     if (rb.isMorph) {
       BulletMLRunner *runner = BulletMLRunner_new_parser(rb.morphParser[rb.morphIdx]);
       BulletActorPool.registFunctions(runner);
@@ -51,12 +51,12 @@
   }
 
   public void addBullet(BulletMLState *state, float deg, float speed) {
-    BulletActor ba = (BulletActor) getInstance();
+    BulletActor ba = cast(BulletActor) getInstance();
     if (!ba)
       return;
     BulletMLRunner* runner = BulletMLRunner_new_state(state);
     registFunctions(runner);
-    P47Bullet rb = (P47Bullet) Bullet.now;
+    P47Bullet rb = cast(P47Bullet) Bullet.now;
     if (rb.isMorph)
       ba.set(runner, Bullet.now.pos.x, Bullet.now.pos.y, deg, speed, 
 	     Bullet.now.rank, 
@@ -72,7 +72,7 @@
 			       float x, float y, float deg, float speed,
 			       float rank, 
 			       float speedRank, int shape, int color, float size, float xReverse) {
-    BulletActor ba = (BulletActor) getInstance();
+    BulletActor ba = cast(BulletActor) getInstance();
     if (!ba)
       return null;
     ba.set(runner, x, y, deg, speed, rank, speedRank, shape, color, size, xReverse);
@@ -99,7 +99,7 @@
 			       float rank,
 			       float speedRank, int shape, int color, float size, float xReverse,
 			       BulletMLParser *morph[], int morphNum, int morphCnt) {
-    BulletActor ba = (BulletActor) getInstance();
+    BulletActor ba = cast(BulletActor) getInstance();
     if (!ba)
       return null;
     ba.set(runner, x, y, deg, speed, rank, 
@@ -119,14 +119,14 @@
   }
   
   public void killMe(Bullet bullet) {
-    assert(((BulletActor) actor[bullet.id]).bullet.id == bullet.id);
-    ((BulletActor) actor[bullet.id]).remove();
+    assert((cast(BulletActor) actor[bullet.id]).bullet.id == bullet.id);
+    (cast(BulletActor) actor[bullet.id]).remove();
   }
 
   public override void clear() {
     for (int i = 0; i < actor.length; i++) {
       if (actor[i].isExist)
-	((BulletActor) actor[i]).remove();
+	(cast(BulletActor) actor[i]).remove();
     }
   }
 
@@ -155,7 +155,7 @@
   double getAimDirectionWithXRev_(BulletMLRunner* r) {
     Vector b = Bullet.now.pos;
     Vector t = Bullet.target;
-    float xrev = ((P47Bullet) Bullet.now).xReverse;
+    float xrev = (cast(P47Bullet) Bullet.now).xReverse;
     return rtod(std.math.atan2(t.x - b.x, t.y - b.y) * xrev);
   }
 }
--- a/src/abagames/p47/Enemy.d
+++ b/src/abagames/p47/Enemy.d
@@ -88,7 +88,7 @@
   }
 
   public override void init(ActorInitializer ini) {
-    EnemyInitializer ei = (EnemyInitializer) ini;
+    EnemyInitializer ei = cast(EnemyInitializer) ini;
     field = ei.field;
     bullets = ei.bullets;
     shots = ei.shots;
@@ -234,7 +234,7 @@
   }
 
   private void addBonuses(Vector p, int sl) {
-    int bn = (float) sl * 3 / (((float) cnt / 30) + 1) * Bonus.rate + 0.9;
+    int bn = cast(int)(cast(float) sl * 3 / ((cast(float) cnt / 30) + 1) * Bonus.rate + 0.9);
     manager.addBonus(pos, p, bn);
   }
 
@@ -389,7 +389,7 @@
     for (int i = 0; i < shots.actor.length; i++) {
       if (!shots.actor[i].isExist)
 	continue;
-      Vector sp = ((Shot) shots.actor[i]).pos;
+      Vector sp = (cast(Shot) shots.actor[i]).pos;
       ch = checkHit(sp, 0.7, 0);
       if (ch >= HIT) {
 	manager.addParticle(sp, rand.nextSignedFloat(0.3), 0, Shot.SPEED / 4);
@@ -407,7 +407,7 @@
       for (int i = 0; i < rolls.actor.length; i++) {
 	if (!rolls.actor[i].isExist)
 	  continue;
-	Roll rl = (Roll) rolls.actor[i];
+	Roll rl = cast(Roll) rolls.actor[i];
 	ch = checkHit(rl.pos[0], 1.0, 1.0);
 	if (ch >= HIT) {
 	  for (int i = 0; i < 4; i++)
@@ -420,9 +420,9 @@
 	      continue;
 	  }
 	  if (ch == HIT)
-	    addDamage(rd);
+	    addDamage(cast(int)rd);
 	  else
-	    addDamageBattery(ch, rd);
+	    addDamageBattery(ch, cast(int)rd);
 	}
       }
     } else if (type.type != EnemyType.SMALL) {
@@ -430,7 +430,7 @@
       for (int i = 0; i < locks.actor.length; i++) {
 	if (!locks.actor[i].isExist)
 	  continue;
-	Lock lk = (Lock) locks.actor[i];
+	Lock lk = cast(Lock) locks.actor[i];
 	if (lk.state == Lock.SEARCH || lk.state == Lock.SEARCHED) {
 	  ch = checkLocked(lk.pos[0], 2.5, lk);
 	  if (ch >= HIT) {
@@ -595,7 +595,7 @@
 	if (z < 0)
 	  z -= APPEARANCE_Z / 60;
 	appCnt--;
-	mtr = 1.0 - (float)appCnt / APPEARANCE_CNT;
+	mtr = 1.0 - cast(float)appCnt / APPEARANCE_CNT;
       } else if (dstCnt > 0) {
 	addFragments(1, z, 0.05, rand.nextSignedFloat(std.math.PI));
 	manager.clearBullets();
@@ -609,7 +609,7 @@
 	  manager.setBossShieldMeter(0, 0, 0, 0, 0, 0);
 	  return;
 	}
-	mtr = (float)dstCnt / DESTROYED_CNT;
+	mtr = cast(float)dstCnt / DESTROYED_CNT;
       } else if (timeoutCnt > 0) {
 	z += DESTROYED_Z / 60;
 	timeoutCnt--;
@@ -641,16 +641,16 @@
     if (appCnt > 0) {
       // Appearance effect of the boss.
       P47Screen.setRetroZ(z);
-      ap = (float) appCnt / APPEARANCE_CNT;
+      ap = cast(float) appCnt / APPEARANCE_CNT;
       P47Screen.setRetroParam(1, type.retroSize * (1 + ap * 10));
       P47Screen.setRetroColor(type.r, type.g, type.b, (1 - ap));
     } else if (dstCnt > 0) {
       P47Screen.setRetroZ(z);
-      ap = (float) dstCnt / DESTROYED_CNT / 2 + 0.5;
+      ap = cast(float) dstCnt / DESTROYED_CNT / 2 + 0.5;
       P47Screen.setRetroColor(type.r, type.g, type.b, ap);
     } else if (timeoutCnt > 0) {
       P47Screen.setRetroZ(z);
-      ap = (float) timeoutCnt / TIMEOUT_CNT;
+      ap = cast(float) timeoutCnt / TIMEOUT_CNT;
       P47Screen.setRetroColor(type.r, type.g, type.b, ap);
     } else {
       P47Screen.setRetroParam(1, type.retroSize);
--- a/src/abagames/p47/EnemyType.d
+++ b/src/abagames/p47/EnemyType.d
@@ -244,9 +244,9 @@
      [0.9, 0.3, 0.7, 0.2,  0.25,  5.0, 0.6, 3.0, 1.5],
      [1.2, 0.2, 0.9, 0.1,  0.3,  7.0, 0.8, 4.5, 1.5],
      ];
-  private enum {
-    SMALL, MIDDLE, LARGE, MIDDLEBOSS, LARGEBOSS,
-  }
+//  private enum {
+//    SMALL, MIDDLE, LARGE, MIDDLEBOSS, LARGEBOSS,
+//  }
 
   // Set the shepe of the BatteryType.
   private void setEnemyShapeAndWings(int size) {
@@ -482,12 +482,12 @@
       shield = 40 + rand.nextInt(10);
       setBattery(sr, 1, BarrageManager.MIDDLESUB, NORMAL, 0, 0, 1, mode);
       fireInterval = 100 + rand.nextInt(60);
-      firePeriod = fireInterval / (1.8 + rand.nextFloat(0.7));
+      firePeriod = cast(int)(fireInterval / (1.8 + rand.nextFloat(0.7)));
     } else {
       shield = 30 + rand.nextInt(8);
       setBattery(sr, 1, BarrageManager.MIDDLESUB_LOCK, NORMAL, 0, 0, 1, mode);
       fireInterval = 72 + rand.nextInt(30);
-      firePeriod = fireInterval / (1.2 + rand.nextFloat(0.2));
+      firePeriod = cast(int)(fireInterval / (1.2 + rand.nextFloat(0.2)));
     }
     if (rank < 10)
       firePeriod /= (2 - rank * 0.1);
@@ -565,13 +565,13 @@
       setBattery(sr1, 1, BarrageManager.MIDDLESUB, NORMAL, 0, 0, 1, mode);
       setBattery(sr2, 1, BarrageManager.MIDDLESUB, NORMAL, 2, 0, 1, mode);
       fireInterval = 150 + rand.nextInt(60);
-      firePeriod = fireInterval / (1.3 + rand.nextFloat(0.8));
+      firePeriod = cast(int)(fireInterval / (1.3 + rand.nextFloat(0.8)));
     } else {
       shield = 45 + rand.nextInt(8);
       setBattery(sr1, 1, BarrageManager.MIDDLESUB_LOCK, NORMAL, 0, 0, 1, mode);
       setBattery(sr2, 1, BarrageManager.MIDDLESUB_LOCK, NORMAL, 2, 0, 1, mode);
       fireInterval = 100 + rand.nextInt(50);
-      firePeriod = fireInterval / (1.2 + rand.nextFloat(0.2));
+      firePeriod = cast(int)(fireInterval / (1.2 + rand.nextFloat(0.2)));
     }
     if (rank < 10)
       firePeriod /= (2 - rank * 0.1);
@@ -609,7 +609,7 @@
     }
     shield = 300 + rand.nextInt(50);
     fireInterval = 200 + rand.nextInt(40);
-    firePeriod = fireInterval / (1.2 + rand.nextFloat(0.4));
+    firePeriod = cast(int)(fireInterval / (1.2 + rand.nextFloat(0.4)));
     if (rank < 10)
       firePeriod /= (2 - rank * 0.1);
   }
@@ -650,7 +650,7 @@
     }
     shield = 400 + rand.nextInt(50);
     fireInterval = 220 + rand.nextInt(60);
-    firePeriod = fireInterval / (1.2 + rand.nextFloat(0.3));
+    firePeriod = cast(int)(fireInterval / (1.2 + rand.nextFloat(0.3)));
     if (rank < 10)
       firePeriod /= (2 - rank * 0.1);
   }
--- a/src/abagames/p47/Field.d
+++ b/src/abagames/p47/Field.d
@@ -97,7 +97,7 @@
     float d = -RING_NUM * RING_ANGLE_INT / 2 + roll;
     for (int i = 0; i < RING_NUM; i++) {
       for (int j = 1; j < 8; j++) {
-	float sc = (float) j / 16 + 0.5;
+	float sc = cast(float) j / 16 + 0.5;
 	glPushMatrix();
 	glTranslatef(0, 0, z);
 	glRotatef(d, 1, 0, 0);
@@ -126,7 +126,7 @@
 
   private static const int RING_POS_NUM = 16;
   private static Vector ringPos[RING_POS_NUM];
-  private static const float RING_DEG = std.math.PI / 3 / ((float) (RING_POS_NUM / 2) + 0.5);
+  private static const float RING_DEG = std.math.PI / 3 / (cast(float) (RING_POS_NUM / 2) + 0.5);
   private static const float RING_RADIUS = 10;
   private static const float RING_SIZE = 0.5;
 
@@ -159,7 +159,7 @@
   }
 
   public static void createDisplayLists() {
-    float d = -RING_DEG * ((float) (RING_POS_NUM / 2) - 0.5);
+    float d = -RING_DEG * (cast(float) (RING_POS_NUM / 2) - 0.5);
     for (int i = 0; i < RING_POS_NUM; i++, d += RING_DEG) {
       ringPos[i] = new Vector;
       ringPos[i].x = sin(d) * RING_RADIUS;
--- a/src/abagames/p47/Fragment.d
+++ b/src/abagames/p47/Fragment.d
@@ -43,7 +43,7 @@
   }
 
   public override void init(ActorInitializer ini) {
-    FragmentInitializer fi = (FragmentInitializer) ini;
+    FragmentInitializer fi = cast(FragmentInitializer) ini;
     for (int i = 0; i < POINT_NUM; i++) {
       pos[i] = new Vector;
       vel[i] = new Vector;
--- a/src/abagames/p47/LetterRender.d
+++ b/src/abagames/p47/LetterRender.d
@@ -177,22 +177,22 @@
     float x, y, length, size, t;
     int deg;
     for (int i = 0;; i++) {
-      deg = (int) spData[idx][i][4];
+      deg = cast(int) spData[idx][i][4];
       if (deg > 99990) break;
-      x = -spData[idx][i][0]; 
+      x = -spData[idx][i][0];
       y = -spData[idx][i][1];
-      size = spData[idx][i][2]; 
+      size = spData[idx][i][2];
       length = spData[idx][i][3];
-      size *= 0.66f; 
+      size *= 0.66f;
       length *= 0.6f;
-      x = -x; 
+      x = -x;
       y = y;
       deg %= 180;
-      if (deg <= 45 || deg > 135) 
+      if (deg <= 45 || deg > 135)
 	drawBox(x, y, size, length, r, g, b);
-      else 
+      else
 	drawBox(x, y, length, size, r, g, b);
-    }    
+    }
   }
 
   private static const int LETTER_NUM = 42;
--- a/src/abagames/p47/Lock.d
+++ b/src/abagames/p47/Lock.d
@@ -52,7 +52,7 @@
   }
 
   public override void init(ActorInitializer ini) {
-    LockInitializer li = (LockInitializer) ini;
+    LockInitializer li = cast(LockInitializer) ini;
     ship = li.ship;
     field = li.field;
     manager = li.manager;
--- a/src/abagames/p47/LuminousActorPool.d
+++ b/src/abagames/p47/LuminousActorPool.d
@@ -22,7 +22,7 @@
   public void drawLuminous() {
     for (int i = 0; i < actor.length; i++) {
       if (actor[i].isExist)
-	((LuminousActor) actor[i]).drawLuminous();
+	(cast(LuminousActor) actor[i]).drawLuminous();
     }
   }
 }
--- a/src/abagames/p47/LuminousScreen.d
+++ b/src/abagames/p47/LuminousScreen.d
@@ -19,7 +19,7 @@
   GLuint luminousTexture;
   const int LUMINOUS_TEXTURE_WIDTH_MAX = 64;
   const int LUMINOUS_TEXTURE_HEIGHT_MAX = 64;
-  GLuint td[LUMINOUS_TEXTURE_WIDTH_MAX * LUMINOUS_TEXTURE_HEIGHT_MAX * 4 * uint.size];
+  GLuint td[LUMINOUS_TEXTURE_WIDTH_MAX * LUMINOUS_TEXTURE_HEIGHT_MAX * 4 * uint.sizeof];
   int luminousTextureWidth = 64, luminousTextureHeight = 64;
   int screenWidth, screenHeight;
   float luminous;
@@ -27,7 +27,7 @@
   private void makeLuminousTexture() {
     uint *data = td;
     int i;
-    memset(data, 0, luminousTextureWidth * luminousTextureHeight * 4 * uint.size);
+    memset(data, 0, luminousTextureWidth * luminousTextureHeight * 4 * uint.sizeof);
     glGenTextures(1, &luminousTexture);
     glBindTexture(GL_TEXTURE_2D, luminousTexture);
     glTexImage2D(GL_TEXTURE_2D, 0, 4, luminousTextureWidth, luminousTextureHeight, 0,
--- a/src/abagames/p47/P47Boot.d
+++ b/src/abagames/p47/P47Boot.d
@@ -42,7 +42,7 @@
 	throw new Exception("Invalid options");
       }
       i++;
-      float b = (float) atoi(args[i]) / 100;
+      float b = cast(float) atoi(args[i]) / 100;
       if (b < 0 || b > 1) {
 	usage(args[0]);
 	throw new Exception("Invalid options");
@@ -55,7 +55,7 @@
 	throw new Exception("Invalid options");
       }
       i++;
-      float l = (float) atoi(args[i]) / 100;
+      float l = cast(float) atoi(args[i]) / 100;
       if (l < 0 || l > 1) {
 	usage(args[0]);
 	throw new Exception("Invalid options");
--- a/src/abagames/p47/P47GameManager.d
+++ b/src/abagames/p47/P47GameManager.d
@@ -88,9 +88,9 @@
 
   // Initialize actor pools, load BGMs/SEs and textures.
   public override void init() {
-    pad = (Pad) input;
-    prefManager = (P47PrefManager) abstPrefManager;
-    screen = (P47Screen) abstScreen;
+    pad = cast(Pad) input;
+    prefManager = cast(P47PrefManager) abstPrefManager;
+    screen = cast(P47Screen) abstScreen;
     rand = new Rand;
     Field.createDisplayLists();
     field = new Field;
@@ -177,7 +177,7 @@
   }
 
   public void addParticle(Vector pos, float deg, float ofs, float speed) {
-    Particle pt = (Particle) particles.getInstanceForced();
+    Particle pt = cast(Particle) particles.getInstanceForced();
     assert(pt);
     pt.set(pos, deg, ofs, speed);
   }
@@ -185,14 +185,14 @@
   public void addFragments(int n, float x1, float y1, float x2, float y2, float z, 
 			   float speed, float deg) {
     for (int i = 0; i < n; i++) {
-      Fragment ft = (Fragment) fragments.getInstanceForced();
+      Fragment ft = cast(Fragment) fragments.getInstanceForced();
       assert(ft);
       ft.set(x1, y1, x2, y2, z, speed, deg);
     }
   }
 
   public void addEnemy(Vector pos, float d, EnemyType type, BulletMLParser *moveParser) {
-    Enemy en = (Enemy) enemies.getInstance();
+    Enemy en = cast(Enemy) enemies.getInstance();
     if (!en)
       return;
     en.set(pos, d, type, moveParser);
@@ -202,33 +202,33 @@
     for (int i = 0; i < bullets.actor.length; i++) {
       if (!bullets.actor[i].isExist)
 	continue;
-      ((BulletActor) bullets.actor[i]).toRetro();
+      (cast(BulletActor) bullets.actor[i]).toRetro();
     }
   }
 
   public void addBoss(Vector pos, float d, EnemyType type) {
-    Enemy en = (Enemy) enemies.getInstance();
+    Enemy en = cast(Enemy) enemies.getInstance();
     if (!en)
       return;
     en.setBoss(pos, d, type);
   }
 
   public void addShot(Vector pos, float deg) {
-    Shot shot = (Shot) shots.getInstance();
+    Shot shot = cast(Shot) shots.getInstance();
     if (!shot)
       return;
     shot.set(pos, deg);
   }
 
   public void addRoll() {
-    Roll roll = (Roll) rolls.getInstance();
+    Roll roll = cast(Roll) rolls.getInstance();
     if (!roll)
       return;
     roll.set();
   }
 
   public void addLock() {
-    Lock lock = (Lock) locks.getInstance();
+    Lock lock = cast(Lock) locks.getInstance();
     if (!lock)
       return;
     lock.set();
@@ -238,7 +238,7 @@
     for (int i = 0; i < rolls.actor.length; i++) {
       if (!rolls.actor[i].isExist)
 	continue;
-      ((Roll) rolls.actor[i]).released = true;
+      (cast(Roll) rolls.actor[i]).released = true;
     }
   }
 
@@ -246,14 +246,14 @@
     for (int i = 0; i < locks.actor.length; i++) {
       if (!locks.actor[i].isExist)
 	continue;
-      ((Lock) locks.actor[i]).released = true;
+      (cast(Lock) locks.actor[i]).released = true;
     }
   }
 
 
   public void addBonus(Vector pos, Vector ofs, int num) {
     for (int i = 0; i < num; i++) {
-      Bonus bonus = (Bonus) bonuses.getInstance();
+      Bonus bonus = cast(Bonus) bonuses.getInstance();
       if (!bonus)
 	return;
       bonus.set(pos, ofs);
@@ -262,11 +262,11 @@
 
   public void setBossShieldMeter(int bs, int s1, int s2, int s3, int s4, float r) {
     r *= 0.7;
-    bossShield = bs * r;
-    bossWingShield[0] = s1 * r ;
-    bossWingShield[1] = s2 * r;
-    bossWingShield[2] = s3 * r;
-    bossWingShield[3] = s4 * r;
+    bossShield = cast(int)(bs * r);
+    bossWingShield[0] = cast(int)(s1 * r);
+    bossWingShield[1] = cast(int)(s2 * r);
+    bossWingShield[2] = cast(int)(s3 * r);
+    bossWingShield[3] = cast(int)(s4 * r);
   }
 
   // Difficulty.
@@ -341,7 +341,7 @@
     rolls.clear();
     locks.clear();
     setScreenShake(0, 0);
-    mainLoop.interval = interval = mainLoop.INTERVAL_BASE;
+    mainLoop.interval = cast(int)(interval = mainLoop.INTERVAL_BASE);
     cnt = 0;
     if (score > prefManager.hiScore[mode][difficulty][parsecSlot])
       prefManager.hiScore[mode][difficulty][parsecSlot] = score;
@@ -396,10 +396,10 @@
 	if (sm > 1.75)
 	  sm = 1.75;
 	interval += (sm * mainLoop.INTERVAL_BASE - interval) * 0.1;
-	mainLoop.interval = interval;
+	mainLoop.interval = cast(int)(interval);
       } else {
 	interval += (mainLoop.INTERVAL_BASE - interval) * 0.08;
-	mainLoop.interval = interval;
+	mainLoop.interval = cast(int)(interval);
       }
     }
   }
@@ -578,7 +578,7 @@
     LetterRender.drawNum(Bonus.bonusScore, 24, 20, 12, LetterRender.TO_UP);
   }
 
-  private void drawLeft() {
+  public void drawLeft() {
     if (left < 0)
       return;
     LetterRender.drawString("LEFT", 520, 260, 25, LetterRender.TO_DOWN);
--- a/src/abagames/p47/P47Screen.d
+++ b/src/abagames/p47/P47Screen.d
@@ -128,7 +128,7 @@
       float ly = std.math.fabs(y2 - y1);
       glBegin(GL_QUADS);
       if (lx < ly) {
-	int n = ly / ds;
+	int n = cast(int)(ly / ds);
 	if (n > 0) {
 	  float xo = (x2 - x1) / n, xos  = 0;
 	  float yo;
@@ -152,7 +152,7 @@
 	  }
 	}
       } else {
-	int n = lx / ds;
+	int n = cast(int)(lx / ds);
 	if (n > 0) {
 	  float yo = (y2 - y1) / n, yos = 0;
 	  float xo;
--- a/src/abagames/p47/Roll.d
+++ b/src/abagames/p47/Roll.d
@@ -40,7 +40,7 @@
   }
 
   public override void init(ActorInitializer ini) {
-    RollInitializer ri = (RollInitializer) ini;
+    RollInitializer ri = cast(RollInitializer) ini;
     ship = ri.ship;
     field = ri.field;
     manager = ri.manager;
--- a/src/abagames/p47/Shot.d
+++ b/src/abagames/p47/Shot.d
@@ -35,7 +35,7 @@
   }
 
   public override void init(ActorInitializer ini) {
-    ShotInitializer si = (ShotInitializer) ini;
+    ShotInitializer si = cast(ShotInitializer) ini;
     field = si.field;
     pos = new Vector;
     vel = new Vector;
--- a/src/abagames/util/sdl/MainLoop.d
+++ b/src/abagames/util/sdl/MainLoop.d
@@ -88,7 +88,7 @@
       if (event.type == SDL_QUIT)
 	breakLoop();
       nowTick = SDL_GetTicks();
-      frame = (int) (nowTick-prvTickCount) / interval;
+      frame = cast(int) (nowTick-prvTickCount) / interval;
       if (frame <= 0) {
 	frame = 1;
 	SDL_Delay(prvTickCount+interval-nowTick);
--- a/src/abagames/util/sdl/Screen3D.d
+++ b/src/abagames/util/sdl/Screen3D.d
@@ -67,8 +67,8 @@
     //gluPerspective(45.0f, (GLfloat)width/(GLfloat)height, nearPlane, farPlane);
     glFrustum(-nearPlane,
 	      nearPlane,
-	      -nearPlane * (GLfloat)height / (GLfloat)width,
-	      nearPlane * (GLfloat)height / (GLfloat)width,
+	      -nearPlane * cast(GLfloat)height / cast(GLfloat)width,
+	      nearPlane * cast(GLfloat)height / cast(GLfloat)width,
 	      0.1f, farPlane);
     glMatrixMode(GL_MODELVIEW);
   }
--- a/src/mt.d
+++ b/src/mt.d
@@ -162,7 +162,7 @@
     y ^= (y << 15) & 0xefc60000UL;
     y ^= (y >> 18);
 
-    return (long)(y>>1);
+    return cast(long)(y>>1);
 }
 
 /* generates a random number on [0,1]-real-interval */
@@ -179,7 +179,7 @@
     y ^= (y << 15) & 0xefc60000UL;
     y ^= (y >> 18);
 
-    return (double)y * (1.0/4294967295.0); 
+    return cast(double)y * (1.0/4294967295.0); 
     /* divided by 2^32-1 */ 
 }
 
@@ -197,7 +197,7 @@
     y ^= (y << 15) & 0xefc60000UL;
     y ^= (y >> 18);
 
-    return (double)y * (1.0/4294967296.0); 
+    return cast(double)y * (1.0/4294967296.0); 
     /* divided by 2^32 */
 }
 
@@ -215,7 +215,7 @@
     y ^= (y << 15) & 0xefc60000UL;
     y ^= (y >> 18);
 
-    return ((double)y + 0.5) * (1.0/4294967296.0); 
+    return (cast(double)y + 0.5) * (1.0/4294967296.0); 
     /* divided by 2^32 */
 }