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
|
# Copyright (C) 2007 Marcel Unbehaun <frostworks@gmx.de>
# Distributed under the same license as the game. See debian/copyright.
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,11 @@
+GDC=gdc
+DSRC=$(shell find import src -name '*.d' | LC_ALL=C sort)
+EXE=torus-trooper
+
+all: $(EXE)
+
+$(EXE): $(DSRC)
+ $(GDC) -o $@ $^ -Iimport -Isrc -Wno-deprecated $(DFLAGS) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) -lSDL -lGL -lGLU -lSDL_mixer -lbulletml
+
+clean:
+ rm -f $(EXE)
--- a/src/abagames/util/logger.d
+++ b/src/abagames/util/logger.d
@@ -5,7 +5,7 @@
*/
module abagames.util.logger;
-private import std.stream;
+private import std.cstream;
private import std.string;
/**
@@ -56,28 +56,28 @@
public static void info(char[] msg, bool nline = true) {
if (nline)
- stderr.writeLine(msg);
+ derr.writeLine(msg);
else
- stderr.writeString(msg);
+ derr.writeString(msg);
}
public static void info(double n, bool nline = true) {
if (nline)
- stderr.writeLine(std.string.toString(n));
+ derr.writeLine(std.string.toString(n));
else
- stderr.writeString(std.string.toString(n) ~ " ");
+ derr.writeString(std.string.toString(n) ~ " ");
}
public static void error(char[] msg) {
- stderr.writeLine("Error: " ~ msg);
+ derr.writeLine("Error: " ~ msg);
}
public static void error(Exception e) {
- stderr.writeLine("Error: " ~ e.toString());
+ derr.writeLine("Error: " ~ e.toString());
}
public static void error(Error e) {
- stderr.writeLine("Error: " ~ e.toString());
+ derr.writeLine("Error: " ~ e.toString());
if (e.next)
error(e.next);
}
--- a/src/abagames/util/sdl/luminous.d
+++ b/src/abagames/util/sdl/luminous.d
@@ -9,6 +9,7 @@
private import std.string;
private import opengl;
private import abagames.util.actor;
+import std.c.string;
/**
* Luminous effect texture.
@@ -30,7 +31,7 @@
}
private void makeLuminousTexture() {
- uint *data = td;
+ uint *data = td.ptr;
int i;
memset(data, 0, luminousTextureWidth * luminousTextureHeight * 4 * uint.sizeof);
glGenTextures(1, &luminousTexture);
--- a/src/abagames/tt/barrage.d
+++ b/src/abagames/tt/barrage.d
@@ -98,6 +98,7 @@
public static void load() {
char[][] dirs = listdir(BARRAGE_DIR_NAME);
foreach (char[] dirName; dirs) {
+ parser[dirName] = null;
char[][] files = listdir(BARRAGE_DIR_NAME ~ "/" ~ dirName);
foreach (char[] fileName; files) {
if (getExt(fileName) != "xml")
--- a/src/abagames/tt/camera.d
+++ b/src/abagames/tt/camera.d
@@ -155,10 +155,10 @@
moveCnt--;
if (moveCnt < 0) {
moveCnt = 15 + rand.nextInt(15);
- float lox = fabs(_lookAtPos.x - _cameraPos.x);
- if (lox > PI)
- lox = PI * 2 - lox;
- float ofs = lox * 3 + fabs(_lookAtPos.y - _cameraPos.y);
+ float newlox = fabs(_lookAtPos.x - _cameraPos.x);
+ if (newlox > PI)
+ newlox = PI * 2 - newlox;
+ float ofs = newlox * 3 + fabs(_lookAtPos.y - _cameraPos.y);
zoomTrg = 3.0f / ofs;
if (zoomTrg < zoomMin)
zoomTrg = zoomMin;
--- a/src/abagames/tt/shape.d
+++ b/src/abagames/tt/shape.d
@@ -248,21 +248,23 @@
float wingD1, float wingD2, int color, int shp, int divNum,
int rev, bool damaged = false) {
Structure[] sts;
- Structure st = new Structure;
- st.pos.x = ox;
- st.pos.y = oy;
- st.d1 = st.d2 = 0;
- st.width = rocketLength * 0.15;
- st.height = rocketLength;
- st.shape = Structure.Shape.ROCKET;
- st.shapeXReverse = 1;
- if (!damaged)
- st.color = 1;
- else
- st.color = 0;
- if (rev == -1)
- st.pos.x *= -1;
- sts ~= st;
+ {
+ Structure st = new Structure;
+ st.pos.x = ox;
+ st.pos.y = oy;
+ st.d1 = st.d2 = 0;
+ st.width = rocketLength * 0.15;
+ st.height = rocketLength;
+ st.shape = Structure.Shape.ROCKET;
+ st.shapeXReverse = 1;
+ if (!damaged)
+ st.color = 1;
+ else
+ st.color = 0;
+ if (rev == -1)
+ st.pos.x *= -1;
+ sts ~= st;
+ }
float wofs = offset;
float whgt = rocketLength * (rand.nextFloat(0.5) + 1.5);
for (int i = 0; i < wingNum; i++) {
--- a/src/abagames/util/rand.d
+++ b/src/abagames/util/rand.d
@@ -165,14 +165,14 @@
void next_state()
{
- uint *p=state;
+ uint *p=state.ptr;
/* if init_genrand() has not been called, */
/* a default initial seed is used */
if (initf==0) init_genrand(5489UL);
left = N;
- next = state;
+ next = state.ptr;
for (int j=N-M+1; --j; p++)
*p = p[M] ^ TWIST(p[0], p[1]);
|