summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--build.zig58
-rw-r--r--config.txt22
3 files changed, 61 insertions, 22 deletions
diff --git a/.gitignore b/.gitignore
index 567609b..67415cd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,4 @@
 build/
+zig-cache/
+zig-out/
+config.txt
diff --git a/build.zig b/build.zig
new file mode 100644
index 0000000..3803827
--- /dev/null
+++ b/build.zig
@@ -0,0 +1,58 @@
+const std = @import("std");
+
+pub fn build(b: *std.build.Builder) void {
+    const exe = b.addExecutable("blackshades", null);
+    const cxxflags = [_][]const u8{ "--std=c++17" };
+    exe.addCSourceFile("src/Main.cpp", &cxxflags);
+    exe.addCSourceFile("src/Camera.cpp", &cxxflags);
+    exe.addCSourceFile("src/Decals.cpp", &cxxflags);
+    exe.addCSourceFile("src/Fog.cpp", &cxxflags);
+    exe.addCSourceFile("src/Frustum.cpp", &cxxflags);
+    exe.addCSourceFile("src/GameDraw.cpp", &cxxflags);
+    exe.addCSourceFile("src/GameInitDispose.cpp", &cxxflags);
+    exe.addCSourceFile("src/GameLoop.cpp", &cxxflags);
+    exe.addCSourceFile("src/GameTick.cpp", &cxxflags);
+    exe.addCSourceFile("src/Globals.cpp", &cxxflags);
+    exe.addCSourceFile("src/MacInput.cpp", &cxxflags);
+    exe.addCSourceFile("src/Main.cpp", &cxxflags);
+    exe.addCSourceFile("src/Models.cpp", &cxxflags);
+    exe.addCSourceFile("src/Person.cpp", &cxxflags);
+    exe.addCSourceFile("src/Quaternions.cpp", &cxxflags);
+    exe.addCSourceFile("src/Serialize.cpp", &cxxflags);
+    exe.addCSourceFile("src/Skeleton.cpp", &cxxflags);
+    exe.addCSourceFile("src/Sprites.cpp", &cxxflags);
+    exe.addCSourceFile("src/Support.cpp", &cxxflags);
+    exe.addCSourceFile("src/TGALoader.cpp", &cxxflags);
+    exe.addCSourceFile("src/Text.cpp", &cxxflags);
+    exe.addCSourceFile("src/Timer.cpp", &cxxflags);
+    exe.addCSourceFile("src/Textures.cpp", &cxxflags);
+
+    exe.linkSystemLibrary("GL");
+    exe.linkSystemLibrary("GLU");
+    exe.linkSystemLibrary("SDL");
+    exe.linkSystemLibrary("SDL_image");
+    exe.linkSystemLibrary("alut");
+    exe.linkSystemLibrary("c++");
+    exe.linkSystemLibrary("openal");
+
+    // Standard target options allows the person running `zig build` to choose
+    // what target to build for. Here we do not override the defaults, which
+    // means any target is allowed, and the default is native. Other options
+    // for restricting supported target set are available.
+    exe.setTarget(b.standardTargetOptions(.{}));
+
+    // Standard release options allow the person running `zig build` to select
+    // between Debug, ReleaseSafe, ReleaseFast, and ReleaseSmall.
+    exe.setBuildMode(b.standardReleaseOptions());
+
+    exe.install();
+
+    const run_cmd = exe.run();
+    run_cmd.step.dependOn(b.getInstallStep());
+    if (b.args) |args| {
+        run_cmd.addArgs(args);
+    }
+
+    const run_step = b.step("run", "Run the app");
+    run_step.dependOn(&run_cmd.step);
+}
diff --git a/config.txt b/config.txt
deleted file mode 100644
index b0967ae..0000000
--- a/config.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-Screenwidth:
-640
-Screenheight:
-480
-Mouse sensitivity:
-0.7
-Show fps and other info:
-0
-VBL sync:
-1
-Blood:
-1
-Blur:
-0
-Main Menu:
-1
-Custom levels:
-0
-Music:
-1
-azerty keyboard:
-0
\ No newline at end of file