From 9f1ce610d0ba654e5d5b9bed8daa2c9d120d8df1 Mon Sep 17 00:00:00 2001 From: Deathsbreed Date: Sun, 19 Oct 2014 21:39:06 -0500 Subject: [PATCH] Improved Makefile (and reset just in case you fall off the map). --- Makefile | 12 ++++++++---- src/main.cpp | 6 +++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 37945c8..60ddfe0 100644 --- a/Makefile +++ b/Makefile @@ -8,11 +8,15 @@ MV=mv MKDIR=mkdir -p RM=rm -rf -main: +SRC_FILES := $(wildcard src/*.cpp) +OBJ_FILES := $(addprefix src/, $(notdir $(SRC_FILES:.cpp=.o))) + +all: $(OBJ_FILES) $(MKDIR) bin - $(CXX) $(INCLUDES) -c -o src/main.o src/main.cpp - $(CXX) $(INCLUDES) -c -o src/eventReceiver.o src/eventReceiver.cpp - $(CXX) $(LIBS) -o bin/castletour src/*.o + $(CXX) $(CXXFLAGS) $(LIBS) -o bin/castletour src/*.o + +src/%.o: src/%.cpp + $(CXX) $(CXXFLAGS) $(INCLUDES) -c -o $@ $< clean: $(RM) src/*.o diff --git a/src/main.cpp b/src/main.cpp index 3432ae9..51b650a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -23,7 +23,7 @@ int main() { gui::IGUIEnvironment *guienv = device->getGUIEnvironment(); // Add text to game - guienv->addStaticText(L"Use WASD to move\nUse SPACE to jump\nUse ESC to exit", core::rect(30, 30, 120, 65), false, false, 0, -1, true); + guienv->addStaticText(L"Use WASD to move\nUse SPACE to jump\nUse R to reset\nUse ESC to exit", core::rect(30, 30, 120, 72), false, false, 0, -1, true); // Load map device->getFileSystem()->addFileArchive("../res/map-20kdm2.pk3"); @@ -86,6 +86,10 @@ int main() { if(eventReceiver.IsKeyDown(KEY_ESCAPE)) { device->closeDevice(); } + if(eventReceiver.IsKeyDown(KEY_KEY_R)) { + cam->setPosition(core::vector3df(50, 50, -60)); + cam->setTarget(core::vector3df(-70, 30, -60)); + } // Print FPS int fps = driver->getFPS();