diff options
-rw-r--r-- | .build.yml | 1 | ||||
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | CHANGES | 5 | ||||
-rw-r--r-- | Makefile | 59 | ||||
-rw-r--r-- | build.zig | 4 | ||||
-rw-r--r-- | src/Game.cc (renamed from src/Main.cpp) | 6 | ||||
-rw-r--r-- | src/Game.h | 4 | ||||
-rw-r--r-- | src/GameDraw.cpp | 20 | ||||
-rw-r--r-- | src/main.zig | 5 |
9 files changed, 18 insertions, 87 deletions
diff --git a/.build.yml b/.build.yml index 9475eb6..eb68c02 100644 --- a/.build.yml +++ b/.build.yml @@ -12,5 +12,4 @@ sources: tasks: - build: | cd blackshades - make -j `nproc` zig build diff --git a/.gitignore b/.gitignore index a9e49e2..2f12ded 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -build/ zig-cache/ zig-out/ config.txt diff --git a/CHANGES b/CHANGES index 163e86a..ea41eae 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,8 @@ +Tag: 1.3.4 +Date: 2021-08-09 + + Disable footstep sounds for NPCs. + Tag: 1.3.3 Date: 2021-07-26 diff --git a/Makefile b/Makefile deleted file mode 100644 index 5c7b612..0000000 --- a/Makefile +++ /dev/null @@ -1,59 +0,0 @@ -CXX := g++ -LINKER := g++ -SRCDIR := ./src -BINDIR := ./build -EXE := $(BINDIR)/blackshades - -CXXFLAGS := -O2 -Wall -Wextra -Wformat-security -Wduplicated-cond \ - -Wfloat-equal -Wshadow -Wconversion -Wlogical-not-parentheses \ - -Wnull-dereference -g -I$(SRCDIR) -LDFLAGS := -lSDL -lGL -lGLU -lopenal -lalut -lvorbisfile - -SRCS := Camera.cpp \ - Decals.cpp \ - Fog.cpp \ - Frustum.cpp \ - GameDraw.cpp \ - GameInitDispose.cpp \ - GameLoop.cpp \ - GameTick.cpp \ - Globals.cpp \ - MacInput.cpp \ - Main.cpp \ - Models.cpp \ - Person.cpp \ - Quaternions.cpp \ - Serialize.cpp \ - Skeleton.cpp \ - Sprites.cpp \ - Support.cpp \ - Text.cpp \ - Timer.cpp \ - Textures.cpp - -OBJS := $(foreach f,$(SRCS:.cpp=.o),$(BINDIR)/$(f)) -SRCS := $(foreach f,$(SRCS),$(SRCDIR)/$(f)) - -CLEANUP = $(wildcard *.exe) $(wildcard *.obj) \ - $(wildcard $(BINDIR)/*.exe) $(wildcard $(BINDIR)/*.obj) \ - $(wildcard *~) $(wildcard *.err) \ - $(wildcard .\#*) $(EXE) - -# Rules for compiling individual source files... - -$(BINDIR)/%.o: $(SRCDIR)/%.cpp - $(CXX) -c -o $@ $< $(CXXFLAGS) - -.PHONY: all clean -all: $(EXE) - -$(EXE): $(BINDIR) $(OBJS) - $(LINKER) -o $(EXE) $(OBJS) $(LDFLAGS) - -$(BINDIR): - mkdir -p $(BINDIR) - make $(BINDIR) - -clean: - rm -f $(CLEANUP) - rm -rf $(BINDIR) diff --git a/build.zig b/build.zig index 0fa7bfd..bd2a063 100644 --- a/build.zig +++ b/build.zig @@ -1,9 +1,9 @@ const std = @import("std"); pub fn build(b: *std.build.Builder) void { - const exe = b.addExecutable("blackshades", null); + const exe = b.addExecutable("blackshades", "src/main.zig"); const cxxflags = [_][]const u8{ "--std=c++17" }; - exe.addCSourceFile("src/Main.cpp", &cxxflags); + exe.addCSourceFile("src/Game.cc", &cxxflags); exe.addCSourceFile("src/Camera.cpp", &cxxflags); exe.addCSourceFile("src/Decals.cpp", &cxxflags); exe.addCSourceFile("src/Fog.cpp", &cxxflags); diff --git a/src/Main.cpp b/src/Game.cc index 5873425..be16a7a 100644 --- a/src/Main.cpp +++ b/src/Game.cc @@ -19,11 +19,9 @@ #include "Game.h" -// Globals are zero-initialized. -Game game; - -int main(int argc, char *argv[]) +void run() { + Game game {}; game.InitGL(); game.InitGame(); game.EventLoop(); diff --git a/src/Game.h b/src/Game.h index cdc05c8..a1fc4ae 100644 --- a/src/Game.h +++ b/src/Game.h @@ -201,4 +201,8 @@ public: void InitGame(); ~Game(); }; + +extern "C" { + void run(); +} #endif // BLACKSHADES_GAME_H diff --git a/src/GameDraw.cpp b/src/GameDraw.cpp index 6ddfed8..925cf38 100644 --- a/src/GameDraw.cpp +++ b/src/GameDraw.cpp @@ -1,46 +1,26 @@ #include "Game.h" extern int thirdperson; - extern double multiplier; - extern int nocolors; - extern int visions; - extern unsigned int gSourceID[100]; - extern unsigned int gSampleSet[100]; - extern Camera camera; - extern Sprites sprites; - extern float camerashake; - extern Fog fog; - extern float fogcolorr; - extern float fogcolorg; - extern float fogcolorb; - extern float sinefluct; - extern float sinefluctprog; - extern int environment; - extern Decals decals; -/*********************> DrawGLScene() <*****/ - int Game::DrawGLScene(void) - { //Main menu - if(mainmenu==1){ //Setup fast sine fluctuation diff --git a/src/main.zig b/src/main.zig new file mode 100644 index 0000000..10f6b75 --- /dev/null +++ b/src/main.zig @@ -0,0 +1,5 @@ +extern fn run() void; + +pub fn main() void { + run(); +} |