diff --git a/Makefile b/Makefile index 9f773f6..4c2e675 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ CXXFLAGS ?= -O2 -Wall -g CXXFLAGS += `pkg-config --cflags sdl2 SDL2_image SDL2_mixer` LIBS = `pkg-config --libs sdl2 SDL2_image SDL2_mixer` -OBJS = alien.o audio.o bullet.o cargo.o collectable.o explosion.o game.o globals.o graphics.o init.o intermission.o loadSave.o messages.o misc.o missions.o player.o resources.o script.o ship.o shop.o Starfighter.o title.o weapons.o +OBJS = alien.o audio.o bullet.o cargo.o collectable.o engine.o explosion.o game.o graphics.o init.o intermission.o loadSave.o messages.o misc.o missions.o player.o resources.o script.o ship.o shop.o Starfighter.o title.o weapons.o -VERSION = 1.3.3 +VERSION = 1.3.4-dev PROG = starfighter DOCS = docs/* DATA = data gfx sound music diff --git a/src/Starfighter.cpp b/src/Starfighter.cpp index c088847..d75e447 100644 --- a/src/Starfighter.cpp +++ b/src/Starfighter.cpp @@ -29,7 +29,7 @@ int main(int argc, char **argv) if (chdir(DATADIR) == -1) printf("Warning: failed to change directory to \"%s\"\n", DATADIR); - defineGlobals(); // Must do this first! + engine_init(); // Must do this first! cheatAttempt = false; cheatCount = 0; diff --git a/src/Starfighter.h b/src/Starfighter.h index 53b07dd..dd17d87 100644 --- a/src/Starfighter.h +++ b/src/Starfighter.h @@ -40,9 +40,9 @@ along with this program. If not, see . #include "bullet.h" #include "cargo.h" #include "collectable.h" +#include "engine.h" #include "explosion.h" #include "game.h" -#include "globals.h" #include "graphics.h" #include "init.h" #include "intermission.h" diff --git a/src/globals.cpp b/src/engine.cpp similarity index 97% rename from src/globals.cpp rename to src/engine.cpp index 7720e4d..7dc7f8f 100644 --- a/src/globals.cpp +++ b/src/engine.cpp @@ -19,9 +19,9 @@ along with this program. If not, see . #include "Starfighter.h" -globalEngineVariables engine; +Engine engine; -void defineGlobals() +void engine_init() { engine.musicVolume = 100; engine.useAudio = true; diff --git a/src/globals.h b/src/engine.h similarity index 92% rename from src/globals.h rename to src/engine.h index e9d60ba..4f510f5 100644 --- a/src/globals.h +++ b/src/engine.h @@ -20,8 +20,8 @@ along with this program. If not, see . #ifndef GLOBALS_H #define GLOBALS_H -extern globalEngineVariables engine; +extern Engine engine; -void defineGlobals(); +void engine_init(); #endif diff --git a/src/structs.h b/src/structs.h index 6c05e5a..1c4d76f 100644 --- a/src/structs.h +++ b/src/structs.h @@ -240,7 +240,7 @@ enum keys { KEY_LAST }; -struct globalEngineVariables { +struct Engine { SDL_Event event; int done;