From 4e94b83ac6d66510cdd9ec9104c6196e9b018381 Mon Sep 17 00:00:00 2001 From: Rtch90 Date: Fri, 13 Jan 2012 23:28:22 +0000 Subject: [PATCH] [Change] I had a big clean up. sorted libUnuk into sub directories. -- Teehee, KonoM will have a tough time with VS now. :D --- Unuk-QT/Makefile | 720 ++++++++++++++++---------------- Unuk-QT/Unuk-QT.pro | 128 +++--- Unuk-QT/Unuk-QT.pro.user | 32 +- Unuk-QT/Unuk-QT.pro.user.1.3 | 228 ---------- Unuk-QT/Unuk.qrc | 1 - src/Unuk/Game.cpp | 4 +- src/Unuk/Game.h | 12 +- src/Unuk/Player.h | 4 +- src/Unuk/main.cpp | 8 +- src/libUnuk/AStar.cpp | 92 ---- src/libUnuk/AStar.h | 30 -- src/libUnuk/AStarBase.h | 26 -- src/libUnuk/ApplySurface.cpp | 23 - src/libUnuk/ApplySurface.h | 16 - src/libUnuk/Button.cpp | 120 ------ src/libUnuk/Button.h | 62 --- src/libUnuk/ButtonGroup.cpp | 101 ----- src/libUnuk/ButtonGroup.h | 33 -- src/libUnuk/ButtonToggle.cpp | 35 -- src/libUnuk/ButtonToggle.h | 36 -- src/libUnuk/Character.cpp | 204 --------- src/libUnuk/Character.h | 117 ------ src/libUnuk/Collision.cpp | 27 -- src/libUnuk/Collision.h | 6 - src/libUnuk/Debug.cpp | 101 ----- src/libUnuk/Debug.h | 20 - src/libUnuk/FPS.cpp | 41 -- src/libUnuk/FPS.h | 25 -- src/libUnuk/Font.cpp | 11 - src/libUnuk/Font.h | 8 - src/libUnuk/ImageLoader.cpp | 37 -- src/libUnuk/ImageLoader.h | 8 - src/libUnuk/IngameMenu.cpp | 99 ----- src/libUnuk/IngameMenu.h | 32 -- src/libUnuk/Input.cpp | 82 ---- src/libUnuk/Input.h | 43 -- src/libUnuk/MainMenu.cpp | 171 -------- src/libUnuk/MainMenu.h | 37 -- src/libUnuk/Map.cpp | 251 ----------- src/libUnuk/Map.h | 64 --- src/libUnuk/MapElement.cpp | 39 -- src/libUnuk/MapElement.h | 36 -- src/libUnuk/MapEntities.cpp | 16 - src/libUnuk/MapEntities.h | 19 - src/libUnuk/MapTile.h | 66 --- src/libUnuk/MemClass.h | 32 -- src/libUnuk/MemManager.cpp | 206 --------- src/libUnuk/MemManager.h | 88 ---- src/libUnuk/NPC.cpp | 59 --- src/libUnuk/NPC.h | 26 -- src/libUnuk/ParticleEmitter.cpp | 80 ---- src/libUnuk/ParticleEmitter.h | 52 --- src/libUnuk/Rect.cpp | 66 --- src/libUnuk/Rect.h | 35 -- src/libUnuk/Text.cpp | 269 ------------ src/libUnuk/Text.h | 62 --- src/libUnuk/Texture.cpp | 53 --- src/libUnuk/Texture.h | 33 -- src/libUnuk/TextureManager.cpp | 55 --- src/libUnuk/TextureManager.h | 39 -- src/libUnuk/Timer.cpp | 54 --- src/libUnuk/Timer.h | 31 -- src/libUnuk/WorldManager.cpp | 54 --- src/libUnuk/WorldManager.h | 20 - 64 files changed, 467 insertions(+), 4118 deletions(-) delete mode 100644 Unuk-QT/Unuk-QT.pro.user.1.3 delete mode 100644 Unuk-QT/Unuk.qrc delete mode 100644 src/libUnuk/AStar.cpp delete mode 100644 src/libUnuk/AStar.h delete mode 100644 src/libUnuk/AStarBase.h delete mode 100644 src/libUnuk/ApplySurface.cpp delete mode 100644 src/libUnuk/ApplySurface.h delete mode 100644 src/libUnuk/Button.cpp delete mode 100644 src/libUnuk/Button.h delete mode 100644 src/libUnuk/ButtonGroup.cpp delete mode 100644 src/libUnuk/ButtonGroup.h delete mode 100644 src/libUnuk/ButtonToggle.cpp delete mode 100644 src/libUnuk/ButtonToggle.h delete mode 100644 src/libUnuk/Character.cpp delete mode 100644 src/libUnuk/Character.h delete mode 100644 src/libUnuk/Collision.cpp delete mode 100644 src/libUnuk/Collision.h delete mode 100644 src/libUnuk/Debug.cpp delete mode 100644 src/libUnuk/Debug.h delete mode 100644 src/libUnuk/FPS.cpp delete mode 100644 src/libUnuk/FPS.h delete mode 100644 src/libUnuk/Font.cpp delete mode 100644 src/libUnuk/Font.h delete mode 100644 src/libUnuk/ImageLoader.cpp delete mode 100644 src/libUnuk/ImageLoader.h delete mode 100644 src/libUnuk/IngameMenu.cpp delete mode 100644 src/libUnuk/IngameMenu.h delete mode 100644 src/libUnuk/Input.cpp delete mode 100644 src/libUnuk/Input.h delete mode 100644 src/libUnuk/MainMenu.cpp delete mode 100644 src/libUnuk/MainMenu.h delete mode 100644 src/libUnuk/Map.cpp delete mode 100644 src/libUnuk/Map.h delete mode 100644 src/libUnuk/MapElement.cpp delete mode 100644 src/libUnuk/MapElement.h delete mode 100644 src/libUnuk/MapEntities.cpp delete mode 100644 src/libUnuk/MapEntities.h delete mode 100644 src/libUnuk/MapTile.h delete mode 100644 src/libUnuk/MemClass.h delete mode 100644 src/libUnuk/MemManager.cpp delete mode 100644 src/libUnuk/MemManager.h delete mode 100644 src/libUnuk/NPC.cpp delete mode 100644 src/libUnuk/NPC.h delete mode 100644 src/libUnuk/ParticleEmitter.cpp delete mode 100644 src/libUnuk/ParticleEmitter.h delete mode 100644 src/libUnuk/Rect.cpp delete mode 100644 src/libUnuk/Rect.h delete mode 100644 src/libUnuk/Text.cpp delete mode 100644 src/libUnuk/Text.h delete mode 100644 src/libUnuk/Texture.cpp delete mode 100644 src/libUnuk/Texture.h delete mode 100644 src/libUnuk/TextureManager.cpp delete mode 100644 src/libUnuk/TextureManager.h delete mode 100644 src/libUnuk/Timer.cpp delete mode 100644 src/libUnuk/Timer.h delete mode 100644 src/libUnuk/WorldManager.cpp delete mode 100644 src/libUnuk/WorldManager.h diff --git a/Unuk-QT/Makefile b/Unuk-QT/Makefile index be56da9..74dae28 100644 --- a/Unuk-QT/Makefile +++ b/Unuk-QT/Makefile @@ -1,6 +1,6 @@ ############################################################################# # Makefile for building: Unuk-QT -# Generated by qmake (2.01a) (Qt 4.7.3) on: Wed Jan 11 02:42:42 2012 +# Generated by qmake (2.01a) (Qt 4.7.3) on: Fri Jan 13 23:26:53 2012 # Project: Unuk-QT.pro # Template: app # Command: /usr/bin/qmake-qt4 -spec /usr/share/qt4/mkspecs/linux-g++ CONFIG+=debug -o Makefile Unuk-QT.pro @@ -43,66 +43,66 @@ OBJECTS_DIR = ./ ####### Files -SOURCES = ../src/libUnuk/Debug.cpp \ - ../src/Unuk/main.cpp \ - ../src/libUnuk/Input.cpp \ - ../src/libUnuk/Timer.cpp \ - ../src/libUnuk/Font.cpp \ - ../src/libUnuk/ApplySurface.cpp \ - ../src/Unuk/Globals.cpp \ - ../src/libUnuk/Rect.cpp \ - ../src/libUnuk/ImageLoader.cpp \ - ../src/libUnuk/TextureManager.cpp \ - ../src/libUnuk/Texture.cpp \ - ../src/libUnuk/Text.cpp \ - ../src/libUnuk/Map.cpp \ - ../src/libUnuk/Button.cpp \ - ../src/libUnuk/ButtonToggle.cpp \ - ../src/libUnuk/ParticleEmitter.cpp \ - ../src/libUnuk/MainMenu.cpp \ - ../src/libUnuk/IngameMenu.cpp \ - ../src/libUnuk/Collision.cpp \ - ../src/libUnuk/Character.cpp \ - ../src/libUnuk/NPC.cpp \ +SOURCES = ../src/libUnuk/Engine/WorldManager.cpp \ + ../src/libUnuk/Engine/ParticleEmitter.cpp \ + ../src/libUnuk/Engine/NPC.cpp \ + ../src/libUnuk/Engine/MemManager.cpp \ + ../src/libUnuk/Engine/Collision.cpp \ + ../src/libUnuk/Engine/Character.cpp \ + ../src/libUnuk/Engine/AStar.cpp \ + ../src/libUnuk/Map/MapEntities.cpp \ + ../src/libUnuk/Map/MapElement.cpp \ + ../src/libUnuk/Map/Map.cpp \ + ../src/libUnuk/Sprite/TextureManager.cpp \ + ../src/libUnuk/Sprite/Texture.cpp \ + ../src/libUnuk/Sprite/ImageLoader.cpp \ + ../src/libUnuk/Sprite/ApplySurface.cpp \ + ../src/libUnuk/System/Timer.cpp \ + ../src/libUnuk/System/Rect.cpp \ + ../src/libUnuk/System/Input.cpp \ + ../src/libUnuk/System/FPS.cpp \ + ../src/libUnuk/System/Debug.cpp \ + ../src/libUnuk/Ui/Text.cpp \ + ../src/libUnuk/Ui/MainMenu.cpp \ + ../src/libUnuk/Ui/IngameMenu.cpp \ + ../src/libUnuk/Ui/Font.cpp \ + ../src/libUnuk/Ui/ButtonToggle.cpp \ + ../src/libUnuk/Ui/ButtonGroup.cpp \ + ../src/libUnuk/Ui/Button.cpp \ ../src/Unuk/Player.cpp \ - ../src/Unuk/Game.cpp \ - ../src/libUnuk/MapElement.cpp \ - ../src/libUnuk/MapEntities.cpp \ - ../src/libUnuk/FPS.cpp \ - ../src/libUnuk/MemManager.cpp \ - ../src/libUnuk/AStar.cpp \ - ../src/libUnuk/ButtonGroup.cpp \ - ../src/libUnuk/WorldManager.cpp -OBJECTS = Debug.o \ - main.o \ - Input.o \ - Timer.o \ - Font.o \ - ApplySurface.o \ - Globals.o \ - Rect.o \ - ImageLoader.o \ - TextureManager.o \ - Texture.o \ - Text.o \ - Map.o \ - Button.o \ - ButtonToggle.o \ + ../src/Unuk/main.cpp \ + ../src/Unuk/Globals.cpp \ + ../src/Unuk/Game.cpp +OBJECTS = WorldManager.o \ ParticleEmitter.o \ - MainMenu.o \ - IngameMenu.o \ + NPC.o \ + MemManager.o \ Collision.o \ Character.o \ - NPC.o \ - Player.o \ - Game.o \ - MapElement.o \ - MapEntities.o \ - FPS.o \ - MemManager.o \ AStar.o \ + MapEntities.o \ + MapElement.o \ + Map.o \ + TextureManager.o \ + Texture.o \ + ImageLoader.o \ + ApplySurface.o \ + Timer.o \ + Rect.o \ + Input.o \ + FPS.o \ + Debug.o \ + Text.o \ + MainMenu.o \ + IngameMenu.o \ + Font.o \ + ButtonToggle.o \ ButtonGroup.o \ - WorldManager.o + Button.o \ + Player.o \ + main.o \ + Globals.o \ + Game.o DIST = /usr/share/qt4/mkspecs/common/g++.conf \ /usr/share/qt4/mkspecs/common/unix.conf \ /usr/share/qt4/mkspecs/common/linux.conf \ @@ -202,7 +202,7 @@ qmake: FORCE dist: @$(CHK_DIR_EXISTS) .tmp/Unuk-QT1.0.0 || $(MKDIR) .tmp/Unuk-QT1.0.0 - $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/Unuk-QT1.0.0/ && $(COPY_FILE) --parents ../src/libUnuk/Debug.h ../src/Libs/wglext.h ../src/Libs/glxext.h ../src/libUnuk/Input.h ../src/libUnuk/Rect.h ../src/libUnuk/Timer.h ../src/libUnuk/Font.h ../Constants.h ../src/Unuk/Constants.h ../src/libUnuk/ApplySurface.h ../src/Unuk/Globals.h ../src/libUnuk/ImageLoader.h ../src/libUnuk/TextureManager.h ../src/libUnuk/Texture.h ../src/libUnuk/Text.h ../src/libUnuk/MapTile.h ../src/libUnuk/Map.h ../src/libUnuk/Button.h ../src/libUnuk/ButtonToggle.h ../src/libUnuk/MainMenu.h ../src/libUnuk/ParticleEmitter.h ../src/libUnuk/IngameMenu.h ../src/libUnuk/Collision.h ../src/libUnuk/Character.h ../src/libUnuk/NPC.h ../src/Unuk/Player.h ../src/Unuk/Game.h ../src/libUnuk/MapElement.h ../src/libUnuk/MapEntities.h ../src/libUnuk/FPS.h ../src/libUnuk/MemManager.h ../src/libUnuk/MemClass.h ../src/libUnuk/Node.h ../src/libUnuk/AStarBase.h ../src/libUnuk/AStar.h ../src/libUnuk/ButtonGroup.h ../src/libUnuk/WorldManager.h .tmp/Unuk-QT1.0.0/ && $(COPY_FILE) --parents ../src/libUnuk/Debug.cpp ../src/Unuk/main.cpp ../src/libUnuk/Input.cpp ../src/libUnuk/Timer.cpp ../src/libUnuk/Font.cpp ../src/libUnuk/ApplySurface.cpp ../src/Unuk/Globals.cpp ../src/libUnuk/Rect.cpp ../src/libUnuk/ImageLoader.cpp ../src/libUnuk/TextureManager.cpp ../src/libUnuk/Texture.cpp ../src/libUnuk/Text.cpp ../src/libUnuk/Map.cpp ../src/libUnuk/Button.cpp ../src/libUnuk/ButtonToggle.cpp ../src/libUnuk/ParticleEmitter.cpp ../src/libUnuk/MainMenu.cpp ../src/libUnuk/IngameMenu.cpp ../src/libUnuk/Collision.cpp ../src/libUnuk/Character.cpp ../src/libUnuk/NPC.cpp ../src/Unuk/Player.cpp ../src/Unuk/Game.cpp ../src/libUnuk/MapElement.cpp ../src/libUnuk/MapEntities.cpp ../src/libUnuk/FPS.cpp ../src/libUnuk/MemManager.cpp ../src/libUnuk/AStar.cpp ../src/libUnuk/ButtonGroup.cpp ../src/libUnuk/WorldManager.cpp .tmp/Unuk-QT1.0.0/ && (cd `dirname .tmp/Unuk-QT1.0.0` && $(TAR) Unuk-QT1.0.0.tar Unuk-QT1.0.0 && $(COMPRESS) Unuk-QT1.0.0.tar) && $(MOVE) `dirname .tmp/Unuk-QT1.0.0`/Unuk-QT1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/Unuk-QT1.0.0 + $(COPY_FILE) --parents $(SOURCES) $(DIST) .tmp/Unuk-QT1.0.0/ && $(COPY_FILE) --parents ../src/Libs/wglext.h ../src/Libs/glxext.h ../src/libUnuk/Engine/WorldManager.h ../src/libUnuk/Engine/ParticleEmitter.h ../src/libUnuk/Engine/NPC.h ../src/libUnuk/Engine/MemManager.h ../src/libUnuk/Engine/MemClass.h ../src/libUnuk/Engine/Collision.h ../src/libUnuk/Engine/Character.h ../src/libUnuk/Engine/AStarBase.h ../src/libUnuk/Engine/AStar.h ../src/libUnuk/Map/MapTile.h ../src/libUnuk/Map/MapEntities.h ../src/libUnuk/Map/MapElement.h ../src/libUnuk/Map/Map.h ../src/libUnuk/Sprite/TextureManager.h ../src/libUnuk/Sprite/Texture.h ../src/libUnuk/Sprite/ImageLoader.h ../src/libUnuk/Sprite/ApplySurface.h ../src/libUnuk/System/Rect.h ../src/libUnuk/System/Input.h ../src/libUnuk/System/FPS.h ../src/libUnuk/System/Debug.h ../src/libUnuk/System/Timer.h ../src/libUnuk/Ui/MainMenu.h ../src/libUnuk/Ui/IngameMenu.h ../src/libUnuk/Ui/Font.h ../src/libUnuk/Ui/ButtonToggle.h ../src/libUnuk/Ui/ButtonGroup.h ../src/libUnuk/Ui/Button.h ../src/libUnuk/Ui/Text.h ../src/Unuk/Globals.h ../src/Unuk/Game.h ../src/Unuk/Constants.h ../src/Unuk/Player.h .tmp/Unuk-QT1.0.0/ && $(COPY_FILE) --parents ../src/libUnuk/Engine/WorldManager.cpp ../src/libUnuk/Engine/ParticleEmitter.cpp ../src/libUnuk/Engine/NPC.cpp ../src/libUnuk/Engine/MemManager.cpp ../src/libUnuk/Engine/Collision.cpp ../src/libUnuk/Engine/Character.cpp ../src/libUnuk/Engine/AStar.cpp ../src/libUnuk/Map/MapEntities.cpp ../src/libUnuk/Map/MapElement.cpp ../src/libUnuk/Map/Map.cpp ../src/libUnuk/Sprite/TextureManager.cpp ../src/libUnuk/Sprite/Texture.cpp ../src/libUnuk/Sprite/ImageLoader.cpp ../src/libUnuk/Sprite/ApplySurface.cpp ../src/libUnuk/System/Timer.cpp ../src/libUnuk/System/Rect.cpp ../src/libUnuk/System/Input.cpp ../src/libUnuk/System/FPS.cpp ../src/libUnuk/System/Debug.cpp ../src/libUnuk/Ui/Text.cpp ../src/libUnuk/Ui/MainMenu.cpp ../src/libUnuk/Ui/IngameMenu.cpp ../src/libUnuk/Ui/Font.cpp ../src/libUnuk/Ui/ButtonToggle.cpp ../src/libUnuk/Ui/ButtonGroup.cpp ../src/libUnuk/Ui/Button.cpp ../src/Unuk/Player.cpp ../src/Unuk/main.cpp ../src/Unuk/Globals.cpp ../src/Unuk/Game.cpp .tmp/Unuk-QT1.0.0/ && (cd `dirname .tmp/Unuk-QT1.0.0` && $(TAR) Unuk-QT1.0.0.tar Unuk-QT1.0.0 && $(COMPRESS) Unuk-QT1.0.0.tar) && $(MOVE) `dirname .tmp/Unuk-QT1.0.0`/Unuk-QT1.0.0.tar.gz . && $(DEL_FILE) -r .tmp/Unuk-QT1.0.0 clean:compiler_clean @@ -244,346 +244,346 @@ compiler_clean: ####### Compile -Debug.o: ../src/libUnuk/Debug.cpp ../src/libUnuk/Debug.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Debug.o ../src/libUnuk/Debug.cpp - -main.o: ../src/Unuk/main.cpp ../src/libUnuk/MainMenu.h \ - ../src/Unuk/Constants.h \ - ../src/libUnuk/FPS.h \ +WorldManager.o: ../src/libUnuk/Engine/WorldManager.cpp ../src/libUnuk/Engine/WorldManager.h \ + ../src/libUnuk/Engine/NPC.h \ + ../src/libUnuk/Engine/Character.h \ ../src/Unuk/Globals.h \ - ../src/libUnuk/Timer.h \ - ../src/libUnuk/ButtonGroup.h \ - ../src/libUnuk/Button.h \ - ../src/libUnuk/Input.h \ - ../src/libUnuk/Text.h \ - ../src/libUnuk/ApplySurface.h \ - ../src/libUnuk/Debug.h \ - ../src/libUnuk/Font.h \ - ../src/libUnuk/Rect.h \ - ../src/libUnuk/MemClass.h \ - ../src/libUnuk/MemManager.h \ - ../src/libUnuk/Map.h \ - ../src/libUnuk/ImageLoader.h \ - ../src/libUnuk/MapTile.h \ - ../src/libUnuk/MapElement.h \ - ../src/libUnuk/TextureManager.h \ - ../src/libUnuk/MapEntities.h \ - ../src/libUnuk/WorldManager.h \ - ../src/libUnuk/NPC.h \ - ../src/libUnuk/Character.h \ - ../src/libUnuk/Collision.h \ - ../src/libUnuk/AStar.h \ - ../src/libUnuk/AStarBase.h \ - ../src/Unuk/Game.h \ - ../src/Unuk/Player.h \ - ../src/libUnuk/IngameMenu.h \ - ../src/libUnuk/ButtonToggle.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o ../src/Unuk/main.cpp + ../src/Unuk/Constants.h \ + ../src/libUnuk/Engine/MemClass.h \ + ../src/libUnuk/Engine/MemManager.h \ + ../src/libUnuk/Sprite/ApplySurface.h \ + ../src/libUnuk/System/Debug.h \ + ../src/libUnuk/Sprite/ImageLoader.h \ + ../src/libUnuk/Engine/Collision.h \ + ../src/libUnuk/Map/Map.h \ + ../src/libUnuk/Map/MapTile.h \ + ../src/libUnuk/Map/MapElement.h \ + ../src/libUnuk/Sprite/TextureManager.h \ + ../src/libUnuk/Map/MapEntities.h \ + ../src/libUnuk/System/Timer.h \ + ../src/libUnuk/Ui/Text.h \ + ../src/libUnuk/Ui/Font.h \ + ../src/libUnuk/Engine/AStar.h \ + ../src/libUnuk/Engine/AStarBase.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o WorldManager.o ../src/libUnuk/Engine/WorldManager.cpp -Input.o: ../src/libUnuk/Input.cpp ../src/libUnuk/Input.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Input.o ../src/libUnuk/Input.cpp +ParticleEmitter.o: ../src/libUnuk/Engine/ParticleEmitter.cpp ../src/libUnuk/Engine/ParticleEmitter.h \ + ../src/Unuk/Globals.h \ + ../src/libUnuk/Sprite/ImageLoader.h \ + ../src/libUnuk/System/Debug.h \ + ../src/libUnuk/Sprite/ApplySurface.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ParticleEmitter.o ../src/libUnuk/Engine/ParticleEmitter.cpp -Timer.o: ../src/libUnuk/Timer.cpp ../src/libUnuk/Timer.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Timer.o ../src/libUnuk/Timer.cpp +NPC.o: ../src/libUnuk/Engine/NPC.cpp ../src/libUnuk/Engine/NPC.h \ + ../src/libUnuk/Engine/Character.h \ + ../src/Unuk/Globals.h \ + ../src/Unuk/Constants.h \ + ../src/libUnuk/Engine/MemClass.h \ + ../src/libUnuk/Engine/MemManager.h \ + ../src/libUnuk/Sprite/ApplySurface.h \ + ../src/libUnuk/System/Debug.h \ + ../src/libUnuk/Sprite/ImageLoader.h \ + ../src/libUnuk/Engine/Collision.h \ + ../src/libUnuk/Map/Map.h \ + ../src/libUnuk/Map/MapTile.h \ + ../src/libUnuk/Map/MapElement.h \ + ../src/libUnuk/Sprite/TextureManager.h \ + ../src/libUnuk/Map/MapEntities.h \ + ../src/libUnuk/Engine/WorldManager.h \ + ../src/libUnuk/System/Timer.h \ + ../src/libUnuk/Ui/Text.h \ + ../src/libUnuk/Ui/Font.h \ + ../src/libUnuk/Engine/AStar.h \ + ../src/libUnuk/Engine/AStarBase.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o NPC.o ../src/libUnuk/Engine/NPC.cpp -Font.o: ../src/libUnuk/Font.cpp ../src/libUnuk/Font.h \ - ../src/libUnuk/Debug.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Font.o ../src/libUnuk/Font.cpp +MemManager.o: ../src/libUnuk/Engine/MemManager.cpp ../src/libUnuk/Engine/MemClass.h \ + ../src/libUnuk/Engine/MemManager.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o MemManager.o ../src/libUnuk/Engine/MemManager.cpp -ApplySurface.o: ../src/libUnuk/ApplySurface.cpp ../src/libUnuk/ApplySurface.h \ - ../src/libUnuk/Debug.h \ +Collision.o: ../src/libUnuk/Engine/Collision.cpp ../src/libUnuk/Engine/Collision.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Collision.o ../src/libUnuk/Engine/Collision.cpp + +Character.o: ../src/libUnuk/Engine/Character.cpp ../src/libUnuk/Engine/Character.h \ + ../src/Unuk/Globals.h \ + ../src/Unuk/Constants.h \ + ../src/libUnuk/Engine/MemClass.h \ + ../src/libUnuk/Engine/MemManager.h \ + ../src/libUnuk/Sprite/ApplySurface.h \ + ../src/libUnuk/System/Debug.h \ + ../src/libUnuk/Sprite/ImageLoader.h \ + ../src/libUnuk/Engine/Collision.h \ + ../src/libUnuk/Map/Map.h \ + ../src/libUnuk/Map/MapTile.h \ + ../src/libUnuk/Map/MapElement.h \ + ../src/libUnuk/Sprite/TextureManager.h \ + ../src/libUnuk/Map/MapEntities.h \ + ../src/libUnuk/Engine/WorldManager.h \ + ../src/libUnuk/System/Timer.h \ + ../src/libUnuk/Ui/Text.h \ + ../src/libUnuk/Ui/Font.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Character.o ../src/libUnuk/Engine/Character.cpp + +AStar.o: ../src/libUnuk/Engine/AStar.cpp ../src/libUnuk/Engine/AStar.h \ + ../src/libUnuk/Engine/AStarBase.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o AStar.o ../src/libUnuk/Engine/AStar.cpp + +MapEntities.o: ../src/libUnuk/Map/MapEntities.cpp ../src/libUnuk/Map/MapEntities.h \ + ../src/libUnuk/Map/MapElement.h \ + ../src/Unuk/Globals.h \ + ../src/libUnuk/Sprite/ApplySurface.h \ + ../src/libUnuk/System/Debug.h \ + ../src/libUnuk/Sprite/TextureManager.h \ + ../src/libUnuk/Sprite/ImageLoader.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o MapEntities.o ../src/libUnuk/Map/MapEntities.cpp + +MapElement.o: ../src/libUnuk/Map/MapElement.cpp ../src/libUnuk/Map/MapElement.h \ + ../src/Unuk/Globals.h \ + ../src/libUnuk/Sprite/ApplySurface.h \ + ../src/libUnuk/System/Debug.h \ + ../src/libUnuk/Sprite/TextureManager.h \ + ../src/libUnuk/Sprite/ImageLoader.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o MapElement.o ../src/libUnuk/Map/MapElement.cpp + +Map.o: ../src/libUnuk/Map/Map.cpp ../src/libUnuk/Map/Map.h \ + ../src/Unuk/Globals.h \ + ../src/Unuk/Constants.h \ + ../src/libUnuk/Sprite/ImageLoader.h \ + ../src/libUnuk/System/Debug.h \ + ../src/libUnuk/Sprite/ApplySurface.h \ + ../src/libUnuk/Map/MapTile.h \ + ../src/libUnuk/Map/MapElement.h \ + ../src/libUnuk/Sprite/TextureManager.h \ + ../src/libUnuk/Map/MapEntities.h \ + ../src/libUnuk/Engine/WorldManager.h \ + ../src/libUnuk/Engine/NPC.h \ + ../src/libUnuk/Engine/Character.h \ + ../src/libUnuk/Engine/MemClass.h \ + ../src/libUnuk/Engine/MemManager.h \ + ../src/libUnuk/Engine/Collision.h \ + ../src/libUnuk/System/Timer.h \ + ../src/libUnuk/Ui/Text.h \ + ../src/libUnuk/Ui/Font.h \ + ../src/libUnuk/Engine/AStar.h \ + ../src/libUnuk/Engine/AStarBase.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Map.o ../src/libUnuk/Map/Map.cpp + +TextureManager.o: ../src/libUnuk/Sprite/TextureManager.cpp ../src/libUnuk/Sprite/TextureManager.h \ + ../src/libUnuk/Sprite/ImageLoader.h \ + ../src/Unuk/Globals.h \ + ../src/libUnuk/System/Debug.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o TextureManager.o ../src/libUnuk/Sprite/TextureManager.cpp + +Texture.o: ../src/libUnuk/Sprite/Texture.cpp ../src/libUnuk/Sprite/Texture.h \ + ../src/Unuk/Globals.h \ + ../src/libUnuk/Sprite/ImageLoader.h \ + ../src/libUnuk/System/Debug.h \ + ../src/libUnuk/Sprite/ApplySurface.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Texture.o ../src/libUnuk/Sprite/Texture.cpp + +ImageLoader.o: ../src/libUnuk/Sprite/ImageLoader.cpp ../src/libUnuk/Sprite/ImageLoader.h \ + ../src/Unuk/Globals.h \ + ../src/libUnuk/System/Debug.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ImageLoader.o ../src/libUnuk/Sprite/ImageLoader.cpp + +ApplySurface.o: ../src/libUnuk/Sprite/ApplySurface.cpp ../src/libUnuk/Sprite/ApplySurface.h \ + ../src/libUnuk/System/Debug.h \ ../src/Unuk/Globals.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ApplySurface.o ../src/libUnuk/ApplySurface.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ApplySurface.o ../src/libUnuk/Sprite/ApplySurface.cpp -Globals.o: ../src/Unuk/Globals.cpp ../src/Unuk/Globals.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Globals.o ../src/Unuk/Globals.cpp +Timer.o: ../src/libUnuk/System/Timer.cpp ../src/libUnuk/System/Timer.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Timer.o ../src/libUnuk/System/Timer.cpp -Rect.o: ../src/libUnuk/Rect.cpp ../src/libUnuk/Rect.h \ +Rect.o: ../src/libUnuk/System/Rect.cpp ../src/libUnuk/System/Rect.h \ ../src/Unuk/Globals.h \ - ../src/libUnuk/ApplySurface.h \ - ../src/libUnuk/Debug.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Rect.o ../src/libUnuk/Rect.cpp + ../src/libUnuk/Sprite/ApplySurface.h \ + ../src/libUnuk/System/Debug.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Rect.o ../src/libUnuk/System/Rect.cpp -ImageLoader.o: ../src/libUnuk/ImageLoader.cpp ../src/libUnuk/ImageLoader.h \ +Input.o: ../src/libUnuk/System/Input.cpp ../src/libUnuk/System/Input.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Input.o ../src/libUnuk/System/Input.cpp + +FPS.o: ../src/libUnuk/System/FPS.cpp ../src/libUnuk/System/FPS.h \ ../src/Unuk/Globals.h \ - ../src/libUnuk/Debug.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ImageLoader.o ../src/libUnuk/ImageLoader.cpp + ../src/libUnuk/System/Timer.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o FPS.o ../src/libUnuk/System/FPS.cpp -TextureManager.o: ../src/libUnuk/TextureManager.cpp ../src/libUnuk/TextureManager.h \ - ../src/libUnuk/ImageLoader.h \ +Debug.o: ../src/libUnuk/System/Debug.cpp ../src/libUnuk/System/Debug.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Debug.o ../src/libUnuk/System/Debug.cpp + +Text.o: ../src/libUnuk/Ui/Text.cpp ../src/libUnuk/Ui/Text.h \ ../src/Unuk/Globals.h \ - ../src/libUnuk/Debug.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o TextureManager.o ../src/libUnuk/TextureManager.cpp + ../src/libUnuk/Sprite/ApplySurface.h \ + ../src/libUnuk/System/Debug.h \ + ../src/libUnuk/Ui/Font.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Text.o ../src/libUnuk/Ui/Text.cpp -Texture.o: ../src/libUnuk/Texture.cpp ../src/libUnuk/Texture.h \ +MainMenu.o: ../src/libUnuk/Ui/MainMenu.cpp ../src/libUnuk/Ui/MainMenu.h \ + ../src/Unuk/Constants.h \ + ../src/libUnuk/System/FPS.h \ ../src/Unuk/Globals.h \ - ../src/libUnuk/ImageLoader.h \ - ../src/libUnuk/Debug.h \ - ../src/libUnuk/ApplySurface.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Texture.o ../src/libUnuk/Texture.cpp + ../src/libUnuk/System/Timer.h \ + ../src/libUnuk/Ui/ButtonGroup.h \ + ../src/libUnuk/Ui/Button.h \ + ../src/libUnuk/System/Input.h \ + ../src/libUnuk/Ui/Text.h \ + ../src/libUnuk/Sprite/ApplySurface.h \ + ../src/libUnuk/System/Debug.h \ + ../src/libUnuk/Ui/Font.h \ + ../src/libUnuk/System/Rect.h \ + ../src/libUnuk/Engine/MemClass.h \ + ../src/libUnuk/Engine/MemManager.h \ + ../src/libUnuk/Map/Map.h \ + ../src/libUnuk/Sprite/ImageLoader.h \ + ../src/libUnuk/Map/MapTile.h \ + ../src/libUnuk/Map/MapElement.h \ + ../src/libUnuk/Sprite/TextureManager.h \ + ../src/libUnuk/Map/MapEntities.h \ + ../src/libUnuk/Engine/WorldManager.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o MainMenu.o ../src/libUnuk/Ui/MainMenu.cpp -Text.o: ../src/libUnuk/Text.cpp ../src/libUnuk/Text.h \ - ../src/Unuk/Globals.h \ - ../src/libUnuk/ApplySurface.h \ - ../src/libUnuk/Debug.h \ - ../src/libUnuk/Font.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Text.o ../src/libUnuk/Text.cpp - -Map.o: ../src/libUnuk/Map.cpp ../src/libUnuk/Map.h \ +IngameMenu.o: ../src/libUnuk/Ui/IngameMenu.cpp ../src/libUnuk/Ui/IngameMenu.h \ ../src/Unuk/Globals.h \ ../src/Unuk/Constants.h \ - ../src/libUnuk/ImageLoader.h \ - ../src/libUnuk/Debug.h \ - ../src/libUnuk/ApplySurface.h \ - ../src/libUnuk/MapTile.h \ - ../src/libUnuk/MapElement.h \ - ../src/libUnuk/TextureManager.h \ - ../src/libUnuk/MapEntities.h \ - ../src/libUnuk/WorldManager.h \ - ../src/libUnuk/NPC.h \ - ../src/libUnuk/Character.h \ - ../src/libUnuk/MemClass.h \ - ../src/libUnuk/MemManager.h \ - ../src/libUnuk/Collision.h \ - ../src/libUnuk/Timer.h \ - ../src/libUnuk/Text.h \ - ../src/libUnuk/Font.h \ - ../src/libUnuk/AStar.h \ - ../src/libUnuk/AStarBase.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Map.o ../src/libUnuk/Map.cpp + ../src/libUnuk/Ui/ButtonGroup.h \ + ../src/libUnuk/Ui/Button.h \ + ../src/libUnuk/System/Input.h \ + ../src/libUnuk/Ui/Text.h \ + ../src/libUnuk/Sprite/ApplySurface.h \ + ../src/libUnuk/System/Debug.h \ + ../src/libUnuk/Ui/Font.h \ + ../src/libUnuk/System/Rect.h \ + ../src/libUnuk/Engine/MemClass.h \ + ../src/libUnuk/Engine/MemManager.h \ + ../src/libUnuk/Ui/ButtonToggle.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o IngameMenu.o ../src/libUnuk/Ui/IngameMenu.cpp -Button.o: ../src/libUnuk/Button.cpp ../src/libUnuk/Button.h \ +Font.o: ../src/libUnuk/Ui/Font.cpp ../src/libUnuk/Ui/Font.h \ + ../src/libUnuk/System/Debug.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Font.o ../src/libUnuk/Ui/Font.cpp + +ButtonToggle.o: ../src/libUnuk/Ui/ButtonToggle.cpp ../src/libUnuk/Ui/ButtonToggle.h \ + ../src/libUnuk/Ui/Button.h \ ../src/Unuk/Globals.h \ - ../src/libUnuk/Input.h \ - ../src/libUnuk/Text.h \ - ../src/libUnuk/ApplySurface.h \ - ../src/libUnuk/Debug.h \ - ../src/libUnuk/Font.h \ - ../src/libUnuk/Rect.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Button.o ../src/libUnuk/Button.cpp + ../src/libUnuk/System/Input.h \ + ../src/libUnuk/Ui/Text.h \ + ../src/libUnuk/Sprite/ApplySurface.h \ + ../src/libUnuk/System/Debug.h \ + ../src/libUnuk/Ui/Font.h \ + ../src/libUnuk/System/Rect.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ButtonToggle.o ../src/libUnuk/Ui/ButtonToggle.cpp -ButtonToggle.o: ../src/libUnuk/ButtonToggle.cpp ../src/libUnuk/ButtonToggle.h \ - ../src/libUnuk/Button.h \ +ButtonGroup.o: ../src/libUnuk/Ui/ButtonGroup.cpp ../src/libUnuk/Ui/ButtonGroup.h \ + ../src/libUnuk/Ui/Button.h \ ../src/Unuk/Globals.h \ - ../src/libUnuk/Input.h \ - ../src/libUnuk/Text.h \ - ../src/libUnuk/ApplySurface.h \ - ../src/libUnuk/Debug.h \ - ../src/libUnuk/Font.h \ - ../src/libUnuk/Rect.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ButtonToggle.o ../src/libUnuk/ButtonToggle.cpp + ../src/libUnuk/System/Input.h \ + ../src/libUnuk/Ui/Text.h \ + ../src/libUnuk/Sprite/ApplySurface.h \ + ../src/libUnuk/System/Debug.h \ + ../src/libUnuk/Ui/Font.h \ + ../src/libUnuk/System/Rect.h \ + ../src/libUnuk/Engine/MemClass.h \ + ../src/libUnuk/Engine/MemManager.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ButtonGroup.o ../src/libUnuk/Ui/ButtonGroup.cpp -ParticleEmitter.o: ../src/libUnuk/ParticleEmitter.cpp ../src/libUnuk/ParticleEmitter.h \ +Button.o: ../src/libUnuk/Ui/Button.cpp ../src/libUnuk/Ui/Button.h \ ../src/Unuk/Globals.h \ - ../src/libUnuk/ImageLoader.h \ - ../src/libUnuk/Debug.h \ - ../src/libUnuk/ApplySurface.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ParticleEmitter.o ../src/libUnuk/ParticleEmitter.cpp - -MainMenu.o: ../src/libUnuk/MainMenu.cpp ../src/libUnuk/MainMenu.h \ - ../src/Unuk/Constants.h \ - ../src/libUnuk/FPS.h \ - ../src/Unuk/Globals.h \ - ../src/libUnuk/Timer.h \ - ../src/libUnuk/ButtonGroup.h \ - ../src/libUnuk/Button.h \ - ../src/libUnuk/Input.h \ - ../src/libUnuk/Text.h \ - ../src/libUnuk/ApplySurface.h \ - ../src/libUnuk/Debug.h \ - ../src/libUnuk/Font.h \ - ../src/libUnuk/Rect.h \ - ../src/libUnuk/MemClass.h \ - ../src/libUnuk/MemManager.h \ - ../src/libUnuk/Map.h \ - ../src/libUnuk/ImageLoader.h \ - ../src/libUnuk/MapTile.h \ - ../src/libUnuk/MapElement.h \ - ../src/libUnuk/TextureManager.h \ - ../src/libUnuk/MapEntities.h \ - ../src/libUnuk/WorldManager.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o MainMenu.o ../src/libUnuk/MainMenu.cpp - -IngameMenu.o: ../src/libUnuk/IngameMenu.cpp ../src/libUnuk/IngameMenu.h \ - ../src/Unuk/Globals.h \ - ../src/Unuk/Constants.h \ - ../src/libUnuk/ButtonGroup.h \ - ../src/libUnuk/Button.h \ - ../src/libUnuk/Input.h \ - ../src/libUnuk/Text.h \ - ../src/libUnuk/ApplySurface.h \ - ../src/libUnuk/Debug.h \ - ../src/libUnuk/Font.h \ - ../src/libUnuk/Rect.h \ - ../src/libUnuk/MemClass.h \ - ../src/libUnuk/MemManager.h \ - ../src/libUnuk/ButtonToggle.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o IngameMenu.o ../src/libUnuk/IngameMenu.cpp - -Collision.o: ../src/libUnuk/Collision.cpp ../src/libUnuk/Collision.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Collision.o ../src/libUnuk/Collision.cpp - -Character.o: ../src/libUnuk/Character.cpp ../src/libUnuk/Character.h \ - ../src/Unuk/Globals.h \ - ../src/Unuk/Constants.h \ - ../src/libUnuk/MemClass.h \ - ../src/libUnuk/MemManager.h \ - ../src/libUnuk/ApplySurface.h \ - ../src/libUnuk/Debug.h \ - ../src/libUnuk/ImageLoader.h \ - ../src/libUnuk/Collision.h \ - ../src/libUnuk/Map.h \ - ../src/libUnuk/MapTile.h \ - ../src/libUnuk/MapElement.h \ - ../src/libUnuk/TextureManager.h \ - ../src/libUnuk/MapEntities.h \ - ../src/libUnuk/WorldManager.h \ - ../src/libUnuk/Timer.h \ - ../src/libUnuk/Text.h \ - ../src/libUnuk/Font.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Character.o ../src/libUnuk/Character.cpp - -NPC.o: ../src/libUnuk/NPC.cpp ../src/libUnuk/NPC.h \ - ../src/libUnuk/Character.h \ - ../src/Unuk/Globals.h \ - ../src/Unuk/Constants.h \ - ../src/libUnuk/MemClass.h \ - ../src/libUnuk/MemManager.h \ - ../src/libUnuk/ApplySurface.h \ - ../src/libUnuk/Debug.h \ - ../src/libUnuk/ImageLoader.h \ - ../src/libUnuk/Collision.h \ - ../src/libUnuk/Map.h \ - ../src/libUnuk/MapTile.h \ - ../src/libUnuk/MapElement.h \ - ../src/libUnuk/TextureManager.h \ - ../src/libUnuk/MapEntities.h \ - ../src/libUnuk/WorldManager.h \ - ../src/libUnuk/Timer.h \ - ../src/libUnuk/Text.h \ - ../src/libUnuk/Font.h \ - ../src/libUnuk/AStar.h \ - ../src/libUnuk/AStarBase.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o NPC.o ../src/libUnuk/NPC.cpp + ../src/libUnuk/System/Input.h \ + ../src/libUnuk/Ui/Text.h \ + ../src/libUnuk/Sprite/ApplySurface.h \ + ../src/libUnuk/System/Debug.h \ + ../src/libUnuk/Ui/Font.h \ + ../src/libUnuk/System/Rect.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Button.o ../src/libUnuk/Ui/Button.cpp Player.o: ../src/Unuk/Player.cpp ../src/Unuk/Player.h \ ../src/Unuk/Globals.h \ ../src/Unuk/Constants.h \ - ../src/libUnuk/Character.h \ - ../src/libUnuk/MemClass.h \ - ../src/libUnuk/MemManager.h \ - ../src/libUnuk/ApplySurface.h \ - ../src/libUnuk/Debug.h \ - ../src/libUnuk/ImageLoader.h \ - ../src/libUnuk/Collision.h \ - ../src/libUnuk/Map.h \ - ../src/libUnuk/MapTile.h \ - ../src/libUnuk/MapElement.h \ - ../src/libUnuk/TextureManager.h \ - ../src/libUnuk/MapEntities.h \ - ../src/libUnuk/WorldManager.h \ - ../src/libUnuk/Timer.h \ - ../src/libUnuk/Text.h \ - ../src/libUnuk/Font.h + ../src/libUnuk/Engine/Character.h \ + ../src/libUnuk/Engine/MemClass.h \ + ../src/libUnuk/Engine/MemManager.h \ + ../src/libUnuk/Sprite/ApplySurface.h \ + ../src/libUnuk/System/Debug.h \ + ../src/libUnuk/Sprite/ImageLoader.h \ + ../src/libUnuk/Engine/Collision.h \ + ../src/libUnuk/Map/Map.h \ + ../src/libUnuk/Map/MapTile.h \ + ../src/libUnuk/Map/MapElement.h \ + ../src/libUnuk/Sprite/TextureManager.h \ + ../src/libUnuk/Map/MapEntities.h \ + ../src/libUnuk/Engine/WorldManager.h \ + ../src/libUnuk/System/Timer.h \ + ../src/libUnuk/Ui/Text.h \ + ../src/libUnuk/Ui/Font.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Player.o ../src/Unuk/Player.cpp +main.o: ../src/Unuk/main.cpp ../src/libUnuk/Ui/MainMenu.h \ + ../src/Unuk/Constants.h \ + ../src/libUnuk/System/FPS.h \ + ../src/Unuk/Globals.h \ + ../src/libUnuk/System/Timer.h \ + ../src/libUnuk/Ui/ButtonGroup.h \ + ../src/libUnuk/Ui/Button.h \ + ../src/libUnuk/System/Input.h \ + ../src/libUnuk/Ui/Text.h \ + ../src/libUnuk/Sprite/ApplySurface.h \ + ../src/libUnuk/System/Debug.h \ + ../src/libUnuk/Ui/Font.h \ + ../src/libUnuk/System/Rect.h \ + ../src/libUnuk/Engine/MemClass.h \ + ../src/libUnuk/Engine/MemManager.h \ + ../src/libUnuk/Map/Map.h \ + ../src/libUnuk/Sprite/ImageLoader.h \ + ../src/libUnuk/Map/MapTile.h \ + ../src/libUnuk/Map/MapElement.h \ + ../src/libUnuk/Sprite/TextureManager.h \ + ../src/libUnuk/Map/MapEntities.h \ + ../src/libUnuk/Engine/WorldManager.h \ + ../src/libUnuk/Engine/NPC.h \ + ../src/libUnuk/Engine/Character.h \ + ../src/libUnuk/Engine/Collision.h \ + ../src/libUnuk/Engine/AStar.h \ + ../src/libUnuk/Engine/AStarBase.h \ + ../src/Unuk/Game.h \ + ../src/Unuk/Player.h \ + ../src/libUnuk/Ui/IngameMenu.h \ + ../src/libUnuk/Ui/ButtonToggle.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o main.o ../src/Unuk/main.cpp + +Globals.o: ../src/Unuk/Globals.cpp ../src/Unuk/Globals.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Globals.o ../src/Unuk/Globals.cpp + Game.o: ../src/Unuk/Game.cpp ../src/Unuk/Game.h \ ../src/Unuk/Constants.h \ ../src/Unuk/Globals.h \ ../src/Unuk/Player.h \ - ../src/libUnuk/Character.h \ - ../src/libUnuk/MemClass.h \ - ../src/libUnuk/MemManager.h \ - ../src/libUnuk/ApplySurface.h \ - ../src/libUnuk/Debug.h \ - ../src/libUnuk/ImageLoader.h \ - ../src/libUnuk/Collision.h \ - ../src/libUnuk/Map.h \ - ../src/libUnuk/MapTile.h \ - ../src/libUnuk/MapElement.h \ - ../src/libUnuk/TextureManager.h \ - ../src/libUnuk/MapEntities.h \ - ../src/libUnuk/WorldManager.h \ - ../src/libUnuk/Timer.h \ - ../src/libUnuk/Text.h \ - ../src/libUnuk/Font.h \ - ../src/libUnuk/IngameMenu.h \ - ../src/libUnuk/ButtonGroup.h \ - ../src/libUnuk/Button.h \ - ../src/libUnuk/Input.h \ - ../src/libUnuk/Rect.h \ - ../src/libUnuk/ButtonToggle.h \ - ../src/libUnuk/NPC.h \ - ../src/libUnuk/AStar.h \ - ../src/libUnuk/AStarBase.h + ../src/libUnuk/Engine/Character.h \ + ../src/libUnuk/Engine/MemClass.h \ + ../src/libUnuk/Engine/MemManager.h \ + ../src/libUnuk/Sprite/ApplySurface.h \ + ../src/libUnuk/System/Debug.h \ + ../src/libUnuk/Sprite/ImageLoader.h \ + ../src/libUnuk/Engine/Collision.h \ + ../src/libUnuk/Map/Map.h \ + ../src/libUnuk/Map/MapTile.h \ + ../src/libUnuk/Map/MapElement.h \ + ../src/libUnuk/Sprite/TextureManager.h \ + ../src/libUnuk/Map/MapEntities.h \ + ../src/libUnuk/Engine/WorldManager.h \ + ../src/libUnuk/System/Timer.h \ + ../src/libUnuk/Ui/Text.h \ + ../src/libUnuk/Ui/Font.h \ + ../src/libUnuk/Ui/IngameMenu.h \ + ../src/libUnuk/Ui/ButtonGroup.h \ + ../src/libUnuk/Ui/Button.h \ + ../src/libUnuk/System/Input.h \ + ../src/libUnuk/System/Rect.h \ + ../src/libUnuk/Ui/ButtonToggle.h \ + ../src/libUnuk/Engine/NPC.h \ + ../src/libUnuk/Engine/AStar.h \ + ../src/libUnuk/Engine/AStarBase.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Game.o ../src/Unuk/Game.cpp -MapElement.o: ../src/libUnuk/MapElement.cpp ../src/libUnuk/MapElement.h \ - ../src/Unuk/Globals.h \ - ../src/libUnuk/ApplySurface.h \ - ../src/libUnuk/Debug.h \ - ../src/libUnuk/TextureManager.h \ - ../src/libUnuk/ImageLoader.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o MapElement.o ../src/libUnuk/MapElement.cpp - -MapEntities.o: ../src/libUnuk/MapEntities.cpp ../src/libUnuk/MapEntities.h \ - ../src/libUnuk/MapElement.h \ - ../src/Unuk/Globals.h \ - ../src/libUnuk/ApplySurface.h \ - ../src/libUnuk/Debug.h \ - ../src/libUnuk/TextureManager.h \ - ../src/libUnuk/ImageLoader.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o MapEntities.o ../src/libUnuk/MapEntities.cpp - -FPS.o: ../src/libUnuk/FPS.cpp ../src/libUnuk/FPS.h \ - ../src/Unuk/Globals.h \ - ../src/libUnuk/Timer.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o FPS.o ../src/libUnuk/FPS.cpp - -MemManager.o: ../src/libUnuk/MemManager.cpp ../src/libUnuk/MemClass.h \ - ../src/libUnuk/MemManager.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o MemManager.o ../src/libUnuk/MemManager.cpp - -AStar.o: ../src/libUnuk/AStar.cpp ../src/libUnuk/AStar.h \ - ../src/libUnuk/AStarBase.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o AStar.o ../src/libUnuk/AStar.cpp - -ButtonGroup.o: ../src/libUnuk/ButtonGroup.cpp ../src/libUnuk/ButtonGroup.h \ - ../src/libUnuk/Button.h \ - ../src/Unuk/Globals.h \ - ../src/libUnuk/Input.h \ - ../src/libUnuk/Text.h \ - ../src/libUnuk/ApplySurface.h \ - ../src/libUnuk/Debug.h \ - ../src/libUnuk/Font.h \ - ../src/libUnuk/Rect.h \ - ../src/libUnuk/MemClass.h \ - ../src/libUnuk/MemManager.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ButtonGroup.o ../src/libUnuk/ButtonGroup.cpp - -WorldManager.o: ../src/libUnuk/WorldManager.cpp ../src/libUnuk/WorldManager.h \ - ../src/libUnuk/NPC.h \ - ../src/libUnuk/Character.h \ - ../src/Unuk/Globals.h \ - ../src/Unuk/Constants.h \ - ../src/libUnuk/MemClass.h \ - ../src/libUnuk/MemManager.h \ - ../src/libUnuk/ApplySurface.h \ - ../src/libUnuk/Debug.h \ - ../src/libUnuk/ImageLoader.h \ - ../src/libUnuk/Collision.h \ - ../src/libUnuk/Map.h \ - ../src/libUnuk/MapTile.h \ - ../src/libUnuk/MapElement.h \ - ../src/libUnuk/TextureManager.h \ - ../src/libUnuk/MapEntities.h \ - ../src/libUnuk/Timer.h \ - ../src/libUnuk/Text.h \ - ../src/libUnuk/Font.h \ - ../src/libUnuk/AStar.h \ - ../src/libUnuk/AStarBase.h - $(CXX) -c $(CXXFLAGS) $(INCPATH) -o WorldManager.o ../src/libUnuk/WorldManager.cpp - ####### Install install: FORCE diff --git a/Unuk-QT/Unuk-QT.pro b/Unuk-QT/Unuk-QT.pro index 0ef3066..be4aec7 100644 --- a/Unuk-QT/Unuk-QT.pro +++ b/Unuk-QT/Unuk-QT.pro @@ -5,73 +5,69 @@ LIBS += -lGL \ -lSDL_gfx \ -ltinyxml \ -lGLU -RESOURCES += -OTHER_FILES += ../src/libUnuk/Debug.o \ - ../Data/Media/Maps/map -HEADERS += ../src/libUnuk/Debug.h \ - ../src/Libs/wglext.h \ +HEADERS += ../src/Libs/wglext.h \ ../src/Libs/glxext.h \ - ../src/libUnuk/Input.h \ - ../src/libUnuk/Rect.h \ - ../src/libUnuk/Timer.h \ - ../src/libUnuk/Font.h \ - ../Constants.h \ - ../src/Unuk/Constants.h \ - ../src/libUnuk/ApplySurface.h \ + ../src/libUnuk/Engine/WorldManager.h \ + ../src/libUnuk/Engine/ParticleEmitter.h \ + ../src/libUnuk/Engine/NPC.h \ + ../src/libUnuk/Engine/MemManager.h \ + ../src/libUnuk/Engine/MemClass.h \ + ../src/libUnuk/Engine/Collision.h \ + ../src/libUnuk/Engine/Character.h \ + ../src/libUnuk/Engine/AStarBase.h \ + ../src/libUnuk/Engine/AStar.h \ + ../src/libUnuk/Map/MapTile.h \ + ../src/libUnuk/Map/MapEntities.h \ + ../src/libUnuk/Map/MapElement.h \ + ../src/libUnuk/Map/Map.h \ + ../src/libUnuk/Sprite/TextureManager.h \ + ../src/libUnuk/Sprite/Texture.h \ + ../src/libUnuk/Sprite/ImageLoader.h \ + ../src/libUnuk/Sprite/ApplySurface.h \ + ../src/libUnuk/System/Rect.h \ + ../src/libUnuk/System/Input.h \ + ../src/libUnuk/System/FPS.h \ + ../src/libUnuk/System/Debug.h \ + ../src/libUnuk/System/Timer.h \ + ../src/libUnuk/Ui/MainMenu.h \ + ../src/libUnuk/Ui/IngameMenu.h \ + ../src/libUnuk/Ui/Font.h \ + ../src/libUnuk/Ui/ButtonToggle.h \ + ../src/libUnuk/Ui/ButtonGroup.h \ + ../src/libUnuk/Ui/Button.h \ + ../src/libUnuk/Ui/Text.h \ ../src/Unuk/Globals.h \ - ../src/libUnuk/ImageLoader.h \ - ../src/libUnuk/TextureManager.h \ - ../src/libUnuk/Texture.h \ - ../src/libUnuk/Text.h \ - ../src/libUnuk/MapTile.h \ - ../src/libUnuk/Map.h \ - ../src/libUnuk/Button.h \ - ../src/libUnuk/ButtonToggle.h \ - ../src/libUnuk/MainMenu.h \ - ../src/libUnuk/ParticleEmitter.h \ - ../src/libUnuk/IngameMenu.h \ - ../src/libUnuk/Collision.h \ - ../src/libUnuk/Character.h \ - ../src/libUnuk/NPC.h \ - ../src/Unuk/Player.h \ ../src/Unuk/Game.h \ - ../src/libUnuk/MapElement.h \ - ../src/libUnuk/MapEntities.h \ - ../src/libUnuk/FPS.h \ - ../src/libUnuk/MemManager.h \ - ../src/libUnuk/MemClass.h \ - ../src/libUnuk/Node.h \ - ../src/libUnuk/AStarBase.h \ - ../src/libUnuk/AStar.h \ - ../src/libUnuk/ButtonGroup.h \ - ../src/libUnuk/WorldManager.h -SOURCES += ../src/libUnuk/Debug.cpp \ - ../src/Unuk/main.cpp \ - ../src/libUnuk/Input.cpp \ - ../src/libUnuk/Timer.cpp \ - ../src/libUnuk/Font.cpp \ - ../src/libUnuk/ApplySurface.cpp \ - ../src/Unuk/Globals.cpp \ - ../src/libUnuk/Rect.cpp \ - ../src/libUnuk/ImageLoader.cpp \ - ../src/libUnuk/TextureManager.cpp \ - ../src/libUnuk/Texture.cpp \ - ../src/libUnuk/Text.cpp \ - ../src/libUnuk/Map.cpp \ - ../src/libUnuk/Button.cpp \ - ../src/libUnuk/ButtonToggle.cpp \ - ../src/libUnuk/ParticleEmitter.cpp \ - ../src/libUnuk/MainMenu.cpp \ - ../src/libUnuk/IngameMenu.cpp \ - ../src/libUnuk/Collision.cpp \ - ../src/libUnuk/Character.cpp \ - ../src/libUnuk/NPC.cpp \ + ../src/Unuk/Constants.h \ + ../src/Unuk/Player.h +SOURCES += ../src/libUnuk/Engine/WorldManager.cpp \ + ../src/libUnuk/Engine/ParticleEmitter.cpp \ + ../src/libUnuk/Engine/NPC.cpp \ + ../src/libUnuk/Engine/MemManager.cpp \ + ../src/libUnuk/Engine/Collision.cpp \ + ../src/libUnuk/Engine/Character.cpp \ + ../src/libUnuk/Engine/AStar.cpp \ + ../src/libUnuk/Map/MapEntities.cpp \ + ../src/libUnuk/Map/MapElement.cpp \ + ../src/libUnuk/Map/Map.cpp \ + ../src/libUnuk/Sprite/TextureManager.cpp \ + ../src/libUnuk/Sprite/Texture.cpp \ + ../src/libUnuk/Sprite/ImageLoader.cpp \ + ../src/libUnuk/Sprite/ApplySurface.cpp \ + ../src/libUnuk/System/Timer.cpp \ + ../src/libUnuk/System/Rect.cpp \ + ../src/libUnuk/System/Input.cpp \ + ../src/libUnuk/System/FPS.cpp \ + ../src/libUnuk/System/Debug.cpp \ + ../src/libUnuk/Ui/Text.cpp \ + ../src/libUnuk/Ui/MainMenu.cpp \ + ../src/libUnuk/Ui/IngameMenu.cpp \ + ../src/libUnuk/Ui/Font.cpp \ + ../src/libUnuk/Ui/ButtonToggle.cpp \ + ../src/libUnuk/Ui/ButtonGroup.cpp \ + ../src/libUnuk/Ui/Button.cpp \ ../src/Unuk/Player.cpp \ - ../src/Unuk/Game.cpp \ - ../src/libUnuk/MapElement.cpp \ - ../src/libUnuk/MapEntities.cpp \ - ../src/libUnuk/FPS.cpp \ - ../src/libUnuk/MemManager.cpp \ - ../src/libUnuk/AStar.cpp \ - ../src/libUnuk/ButtonGroup.cpp \ - ../src/libUnuk/WorldManager.cpp + ../src/Unuk/main.cpp \ + ../src/Unuk/Globals.cpp \ + ../src/Unuk/Game.cpp +OTHER_FILES += ../src/Unuk/Makefile diff --git a/Unuk-QT/Unuk-QT.pro.user b/Unuk-QT/Unuk-QT.pro.user index 1139dc7..75fe81d 100644 --- a/Unuk-QT/Unuk-QT.pro.user +++ b/Unuk-QT/Unuk-QT.pro.user @@ -56,12 +56,21 @@ buildConfiguration-Debug Debug - 2 + 0 0 2 + + buildConfiguration-Release + + Release + 0 + + 0 + + buildconfiguration-Debug-buildstep0 @@ -71,6 +80,7 @@ DISPLAY=:0 HOME=/home/allanis HUSHLOGIN=FALSE + LANGUAGE= LD_LIBRARY_PATH=/usr/lib/qtcreator LOGNAME=allanis LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36: @@ -110,6 +120,7 @@ DISPLAY=:0 HOME=/home/allanis HUSHLOGIN=FALSE + LANGUAGE= LD_LIBRARY_PATH=/usr/lib/qtcreator LOGNAME=allanis LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36: @@ -178,10 +189,29 @@ + + buildconfiguration-Release-buildstep0 + + Release + + + + buildconfiguration-Release-buildstep1 + + Release + + + + buildconfiguration-Release-cleanstep0 + + Release + + buildconfigurations Debug + Release diff --git a/Unuk-QT/Unuk-QT.pro.user.1.3 b/Unuk-QT/Unuk-QT.pro.user.1.3 deleted file mode 100644 index 76a9ede..0000000 --- a/Unuk-QT/Unuk-QT.pro.user.1.3 +++ /dev/null @@ -1,228 +0,0 @@ - - - - RunConfiguration0-BaseEnvironmentBase - 2 - - - RunConfiguration0-CommandLineArguments - - - - RunConfiguration0-ProFile - Unuk-QT.pro - - - RunConfiguration0-RunConfiguration.name - Unuk-QT - - - RunConfiguration0-UseDyldImageSuffix - false - - - RunConfiguration0-UseTerminal - false - - - RunConfiguration0-UserEnvironmentChanges - - - - RunConfiguration0-UserSetName - false - - - RunConfiguration0-UserSetWorkingDirectory - false - - - RunConfiguration0-UserWorkingDirectory - - - - RunConfiguration0-type - Qt4ProjectManager.Qt4RunConfiguration - - - activeRunConfiguration - 0 - - - activebuildconfiguration - Debug - - - buildConfiguration-Debug - - Debug - 2 - 0 - - 2 - - - - buildconfiguration-Debug-buildstep0 - - Debug - - DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-ICZ0NvJNRS,guid=3b12f0647bd9cd4da4459e180000003d - DISPLAY=:0 - HOME=/home/allanis - HUSHLOGIN=FALSE - LD_LIBRARY_PATH=/usr/lib/qtcreator - LOGNAME=allanis - LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36: - MAIL=/var/mail/allanis - PATH=/usr/bin:/home/allanis/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/sbin:/sbin - PWD=/home/allanis - QTDIR=/usr/share/qt4 - SHELL=/bin/bash - SHLVL=1 - SSH_AGENT_PID=3260 - SSH_AUTH_SOCK=/tmp/ssh-lozFEJmg3235/agent.3235 - TERM=linux - USER=allanis - WINDOWPATH=7 - XAUTHORITY=/home/allanis/.Xauthority - XDG_SESSION_COOKIE=6de6dd7b78e791242262c6460000012e-1323089410.422893-1130065724 - _=/usr/bin/startx - - - /home/allanis/Unuk/Unuk-QT/Unuk-QT.pro - -spec - linux-g++ - -r - CONFIG+=debug - - /usr/bin/qmake-qt4 - false - /home/allanis/Unuk/Unuk-QT - - - - buildconfiguration-Debug-buildstep1 - - Debug - - DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-ICZ0NvJNRS,guid=3b12f0647bd9cd4da4459e180000003d - DISPLAY=:0 - HOME=/home/allanis - HUSHLOGIN=FALSE - LD_LIBRARY_PATH=/usr/lib/qtcreator - LOGNAME=allanis - LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36: - MAIL=/var/mail/allanis - PATH=/usr/bin:/home/allanis/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/sbin:/sbin - PWD=/home/allanis - QTDIR=/usr/share/qt4 - SHELL=/bin/bash - SHLVL=1 - SSH_AGENT_PID=3260 - SSH_AUTH_SOCK=/tmp/ssh-lozFEJmg3235/agent.3235 - TERM=linux - USER=allanis - WINDOWPATH=7 - XAUTHORITY=/home/allanis/.Xauthority - XDG_SESSION_COOKIE=6de6dd7b78e791242262c6460000012e-1323089410.422893-1130065724 - _=/usr/bin/startx - - false - - -w - - /usr/bin/make - true - /home/allanis/Unuk/Unuk-QT - - - - buildconfiguration-Debug-cleanstep0 - - Debug - - DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-ICZ0NvJNRS,guid=3b12f0647bd9cd4da4459e180000003d - DISPLAY=:0 - HOME=/home/allanis - HUSHLOGIN=FALSE - LD_LIBRARY_PATH=/usr/lib/qtcreator - LOGNAME=allanis - LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36: - MAIL=/var/mail/allanis - PATH=/usr/bin:/home/allanis/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/sbin:/sbin - PWD=/home/allanis - QTDIR=/usr/share/qt4 - SHELL=/bin/bash - SHLVL=1 - SSH_AGENT_PID=3260 - SSH_AUTH_SOCK=/tmp/ssh-lozFEJmg3235/agent.3235 - TERM=linux - USER=allanis - WINDOWPATH=7 - XAUTHORITY=/home/allanis/.Xauthority - XDG_SESSION_COOKIE=6de6dd7b78e791242262c6460000012e-1323089410.422893-1130065724 - _=/usr/bin/startx - - true - - clean - -w - - /usr/bin/make - true - /home/allanis/Unuk/Unuk-QT - true - - clean - - - - - buildconfigurations - - Debug - - - - buildstep0 - - - - - - - buildstep1 - - - - - - buildsteps - - trolltech.qt4projectmanager.qmake - trolltech.qt4projectmanager.make - - - - cleanstep0 - - - true - - - - cleansteps - - trolltech.qt4projectmanager.make - - - - defaultFileEncoding - System - - - project - - - diff --git a/Unuk-QT/Unuk.qrc b/Unuk-QT/Unuk.qrc deleted file mode 100644 index 2496c87..0000000 --- a/Unuk-QT/Unuk.qrc +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/Unuk/Game.cpp b/src/Unuk/Game.cpp index 0ae06ae..a77a186 100644 --- a/src/Unuk/Game.cpp +++ b/src/Unuk/Game.cpp @@ -1,6 +1,6 @@ #include "Game.h" -#include "../libUnuk/NPC.h" -#include "../libUnuk/WorldManager.h" +#include "../libUnuk/Engine/NPC.h" +#include "../libUnuk/Engine/WorldManager.h" Game::Game(void) { Debug::logger->message("Creating characters.."); diff --git a/src/Unuk/Game.h b/src/Unuk/Game.h index f83fd91..53980ed 100644 --- a/src/Unuk/Game.h +++ b/src/Unuk/Game.h @@ -10,12 +10,12 @@ #include "Constants.h" #include "Globals.h" #include "Player.h" -#include "../libUnuk/IngameMenu.h" -#include "../libUnuk/Map.h" -#include "../libUnuk/Timer.h" -#include "../libUnuk/Debug.h" -#include "../libUnuk/Text.h" -#include "../libUnuk/MemClass.h" +#include "../libUnuk/Ui/IngameMenu.h" +#include "../libUnuk/Map/Map.h" +#include "../libUnuk/System/Timer.h" +#include "../libUnuk/System/Debug.h" +#include "../libUnuk/Ui/Text.h" +#include "../libUnuk/Engine/MemClass.h" using namespace std; enum gameNavVal_t { gameMainMenu, gameQuitGame }; diff --git a/src/Unuk/Player.h b/src/Unuk/Player.h index 5bf75f2..5cd1148 100644 --- a/src/Unuk/Player.h +++ b/src/Unuk/Player.h @@ -3,8 +3,8 @@ #include "Globals.h" #include "Constants.h" -#include "../libUnuk/Character.h" -#include "../libUnuk/Debug.h" +#include "../libUnuk/Engine/Character.h" +#include "../libUnuk//System/Debug.h" class Player : public Character { public: diff --git a/src/Unuk/main.cpp b/src/Unuk/main.cpp index b1613c7..12a72c2 100644 --- a/src/Unuk/main.cpp +++ b/src/Unuk/main.cpp @@ -4,10 +4,10 @@ #include #include -#include "../libUnuk/MainMenu.h" -#include "../libUnuk/NPC.h" -#include "../libUnuk/Debug.h" -#include "../libUnuk/MemClass.h" +#include "../libUnuk/Ui/MainMenu.h" +#include "../libUnuk/Engine/NPC.h" +#include "../libUnuk/System/Debug.h" +#include "../libUnuk/Engine/MemClass.h" #include "Constants.h" #include "Globals.h" #include "Game.h" diff --git a/src/libUnuk/AStar.cpp b/src/libUnuk/AStar.cpp deleted file mode 100644 index a04f9e3..0000000 --- a/src/libUnuk/AStar.cpp +++ /dev/null @@ -1,92 +0,0 @@ -#include "AStar.h" - -AStar::AStar(void) { - while(_openList.size() > 0) { - _openList.pop(); - } - _closedList.clear(); - _solution.clear(); -} - -AStar::~AStar(void) { - AStarBase* best = 0; - while(_openList.size() > 0) { - best = _openList.top(); - _openList.pop(); - delete best; - } - _closedList.clear(); -} - -/* - * Solved the situation given by the initial state with AStar, - * and returns a vector of AStarBase that solves the problem. - */ -std::vector AStar::Solve(AStarBase* initState) { - AStarBase* best = 0; - while(_openList.size() > 0) { - best = _openList.top(); - _openList.pop(); - delete best; - } - _closedList.clear(); - - _openList.push(initState); - return GetSolutionSequence(Search()); -} - -// Search for the best path. -AStarBase* AStar::Search(void) { - AStarBase* best = 0; - long key = 0; - std::vector child; - - while(_openList.size() > 0) { - while(_closedList.find(key) != _closedList.end()) { - // Take the best state, and check if it is on the closed list. - if(_openList.size() > 0) { - best = _openList.top(); - _openList.pop(); - } else - return 0; - - key = best->CalculateKey(); - } - - // Put best on the closed list. - _closedList[key] = best; - - // Check if best is our goal. - if(best->isGoal()) - return best; - - // Generate the children. - child = best->GenerateChildren(); - for(unsigned int i = 0; i < child.size(); i++) { - _openList.push(child[i]); - } - } - return 0; -} - -// Generate a solution sequence for a given state. -std::vector AStar::GetSolutionSequence(AStarBase* node) { - _solution.clear(); - AStarBase* state = node; - - while(state != 0) { - _closedList.erase(state->_key); - _solution.insert(_solution.begin(), state); - state = state->_parent; - } - - // Delete the states which are not part of the solution. - while(_closedList.size() > 0) { - state = _closedList.begin()->second; - _closedList.erase(state->_key); - delete state; - } - - return _solution; -} - diff --git a/src/libUnuk/AStar.h b/src/libUnuk/AStar.h deleted file mode 100644 index 4e9e7d3..0000000 --- a/src/libUnuk/AStar.h +++ /dev/null @@ -1,30 +0,0 @@ -#pragma once -#include -#include -#include - -#include "AStarBase.h" - -class AStar { -public: - AStar(void); - ~AStar(void); - - std::vector Solve(AStarBase* initState); - -private: - // Comparison structure. - struct Cmp : public std::binary_function { - bool operator()(AStarBase* a1, AStarBase* a2) const { - return (a1->_totalEstimatedCost >= a2->_totalEstimatedCost); - } - }; - - std::priority_queue, Cmp > _openList; - std::map _closedList; - - AStarBase* Search(void); - - std::vector GetSolutionSequence(AStarBase* node); - std::vector _solution; -}; diff --git a/src/libUnuk/AStarBase.h b/src/libUnuk/AStarBase.h deleted file mode 100644 index 67f5c3c..0000000 --- a/src/libUnuk/AStarBase.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once -#include - -class AStarBase { -public: - AStarBase(void) { }; - virtual ~AStarBase(void) { }; - - // Generate a unique key. - virtual long CalculateKey(void) = 0; - - // Aproximate the heuristic cost to the goal. - virtual double Estimate(void) = 0; - - // Have we reached the goal? - virtual bool isGoal(void) = 0; - - virtual std::vector GenerateChildren(void) = 0; - - AStarBase* _parent; - - double _pastCost; - double _totalEstimatedCost; - - long _key; -}; diff --git a/src/libUnuk/ApplySurface.cpp b/src/libUnuk/ApplySurface.cpp deleted file mode 100644 index b6b88c8..0000000 --- a/src/libUnuk/ApplySurface.cpp +++ /dev/null @@ -1,23 +0,0 @@ -#include "ApplySurface.h" - -void ApplySurface(int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip) { - assert(source != NULL); - - SDL_Rect offset; - - offset.x = (Sint16)(x - camera.x); - offset.y = (Sint16)(y - camera.y); - - SDL_BlitSurface(source, clip, destination, &offset); -} - -void ApplySurfaceLiteral(int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip) { - assert(source != NULL); - - SDL_Rect offset; - - offset.x = (Sint16)x; - offset.y = (Sint16)y; - - SDL_BlitSurface(source, clip, destination, &offset); -} diff --git a/src/libUnuk/ApplySurface.h b/src/libUnuk/ApplySurface.h deleted file mode 100644 index bb23e32..0000000 --- a/src/libUnuk/ApplySurface.h +++ /dev/null @@ -1,16 +0,0 @@ -#pragma once -#include -#include -#include "Debug.h" -#include "../Unuk/Globals.h" - -/* Use for objects. - * Blit a surface to another surface. An - * optioanl clip argument can be given. The surface - * will be applied to the destination, taking into - * account the position of the camera. - */ -void ApplySurface(int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip = NULL); - -// This one won't take the camera into account, so we could use it for GUI stuff. -void ApplySurfaceLiteral(int x, int y, SDL_Surface* source, SDL_Surface* destination, SDL_Rect* clip = NULL); diff --git a/src/libUnuk/Button.cpp b/src/libUnuk/Button.cpp deleted file mode 100644 index 2c0bc20..0000000 --- a/src/libUnuk/Button.cpp +++ /dev/null @@ -1,120 +0,0 @@ -#include "Button.h" - -Button::Button(void) { - _highlighted = false; - _mouseOver = false; -} - -Button::~Button(void) { -} - -void Button::SetOutRGB(Uint8 r, Uint8 g, Uint8 b) { - _button.SetRGB(r, g, b); - _mouseOutColour.r = r; - _mouseOutColour.g = g; - _mouseOutColour.b = b; -} - -void Button::SetOutRGB(SDL_Color colour) { - _button.SetRGB(colour); - _mouseOutColour = colour; -} - -void Button::SetOverRGB(Uint8 r, Uint8 g, Uint8 b) { - _mouseOverColour.r = r; - _mouseOverColour.g = g; - _mouseOverColour.b = b; -} - -void Button::SetOverRGB(SDL_Color colour) { - _mouseOverColour = colour; -} - -void Button::SetHighlightRGB(Uint8 r, Uint8 g, Uint8 b) { - _highlightColour.r = r; - _highlightColour.g = g; - _highlightColour.b = b; -} - -void Button::SetHighlightRGB(SDL_Color colour) { - _highlightColour = colour; -} - -void Button::SetXY(int xArg, int yArg) { - x = xArg; - y = yArg; - _button.SetXY(x, y); - - _text.SetXY(x + 10, y + 10); -} - -void Button::SetTextRGB(Uint8 r, Uint8 g, Uint8 b) { - _textColour.r = r; - _textColour.g = g; - _textColour.b = b; - - _text.SetTextBlended(_text.GetText(), small, _textColour); -} - -void Button::SetTextRGB(SDL_Color colour) { - _textColour = colour; - _text.SetTextBlended(_text.GetText(), small, colour); -} - -void Button::SetText(string textArg) { - _text.SetTextBlended(textArg, small, _textColour); - - w = _text.GetWidth(); - h = _text.GetHeight(); - _button.SetWidthHeight(w + 20, h + 15); -} - -bool Button::CheckMouseOver(void) { - if(event.motion.x > _button.GetX() && event.motion.x < _button.GetX() + _button.GetWidth()) { - if(event.motion.y > _button.GetY() && event.motion.y < _button.GetY() + _button.GetHeight()) { - if(!_highlighted) { - _button.SetRGB(_mouseOverColour.r, _mouseOverColour.g, _mouseOverColour.b); - } - return true; - } - } - if(!_highlighted) { - _button.SetRGB(_mouseOutColour); - } - return false; -} - -void Button::SetHighlighted(bool highlighted) { - if(_highlighted != highlighted) { - if(highlighted) { - _button.SetRGB(_highlightColour); - } else { - if(!_mouseOver) { - _button.SetRGB(_mouseOverColour); - } else { - _button.SetRGB(_textColour); - } - } - } - _highlighted = highlighted; -} - -void Button::Render(void) { - _button.Draw(); - _text.Render(); -} - -void Button::Render(int xArg, int yArg) { - _button.Draw(xArg, yArg); - _text.Render(xArg, yArg); -} - -void Button::RenderLiteral(void) { - _button.DrawLiteral(); - _text.RenderLiteral(); -} - -void Button::RenderLiteral(int xArg, int yArg) { - _button.DrawLiteral(xArg, yArg); - _text.RenderLiteral(xArg, yArg); -} diff --git a/src/libUnuk/Button.h b/src/libUnuk/Button.h deleted file mode 100644 index 8c5f8a5..0000000 --- a/src/libUnuk/Button.h +++ /dev/null @@ -1,62 +0,0 @@ -#pragma once -#include -#include - -#include "../Unuk/Globals.h" -#include "Input.h" -#include "Text.h" -#include "Rect.h" - -class Button { -public: - Button(void); - ~Button(void); - - void SetOutRGB(Uint8 r, Uint8 g, Uint8 b); - void SetOutRGB(SDL_Color); - void SetOverRGB(Uint8 r, Uint8 g, Uint8 b); - void SetOverRGB(SDL_Color); - - void SetTextRGB(Uint8 r, Uint8 g, Uint8 b); - void SetTextRGB(SDL_Color); - void SetText(string textArg); - - void SetHighlightRGB(Uint8 r, Uint8 g, Uint8 b); - void SetHighlightRGB(SDL_Color); - - void SetHighlighted(bool highlighted); - - void SetXY(int xArg, int yArg); - - int GetX(void) const { return x; } - int GetY(void) const { return y; } - int GetWidth(void) const { return w; } - int GetHeight(void) const { return h; } - - bool GetHighlighted(void) { return _highlighted; } - - bool CheckMouseOver(void); - - void Render(void); - void Render(int xArg, int yArg); - void RenderLiteral(void); - void RenderLiteral(int xArg, int yArg); - -private: - SDL_Color _mouseOutColour; - SDL_Color _mouseOverColour; - SDL_Color _textColour; - SDL_Color _highlightColour; - - int x; - int y; - int w; - int h; - - Rect _button; - Text _text; - - bool _highlighted; - - bool _mouseOver; -}; diff --git a/src/libUnuk/ButtonGroup.cpp b/src/libUnuk/ButtonGroup.cpp deleted file mode 100644 index 4bdfd02..0000000 --- a/src/libUnuk/ButtonGroup.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include "ButtonGroup.h" - -ButtonGroup::ButtonGroup(void) { - _selectedButton = -1; -} - -ButtonGroup::~ButtonGroup(void) { - for(std::list::iterator i = _buttons.begin(); i != _buttons.end(); ++i) { - Button* btn = (*i); - delete btn; - } -} - -void ButtonGroup::CheckMouseOverDummy(void) { - for(std::list::iterator i = _buttons.begin(); i != _buttons.end(); ++i) { - (*i)->CheckMouseOver(); - } -} - -int ButtonGroup::CheckMouseOver(void) { - int buttonIndex = 0; - for(std::list::iterator i = _buttons.begin(); i != _buttons.end(); ++i) { - if((*i)->CheckMouseOver()) { - return buttonIndex; - } - buttonIndex++; - } - return -1; -} - -void ButtonGroup::RenderLiteral(void) { - for(std::list::iterator i = _buttons.begin(); i != _buttons.end(); ++i) { - (*i)->RenderLiteral(); - } -} - -void ButtonGroup::AddButton(Button* button) { - _buttons.push_back(button); -} - -void ButtonGroup::RemoveButton(int index) { - int buttonsIndex = 0; - for(std::list::iterator i = _buttons.begin(); i != _buttons.end(); ++i) { - if(buttonsIndex == index) { - _buttons.erase(i); - break; - } - buttonsIndex++; - } -} - -void ButtonGroup::SelectNext(void) { - if(_selectedButton == -1) { - HighlightNewSelection(0); - } else { - HighlightNewSelection(_selectedButton + 1); - } -} - -void ButtonGroup::SelectPrevious(void) { - if(_selectedButton == -1) { - HighlightNewSelection(0); - } else { - HighlightNewSelection(_selectedButton - 1); - } -} - -void ButtonGroup::SetSelectedButton(int button) { - HighlightNewSelection(button); -} - -void ButtonGroup::HighlightNewSelection(int newButton) { - if(_selectedButton != -1) { - // Turn off highlight for currently highlighted button - GetButton(_selectedButton)->SetHighlighted(false); - } - - _selectedButton = newButton; - - // If < 0 then up was pressed when first index was selected - // If >= _buttons.size() then down was pressed when last index was selected - if(_selectedButton < 0) { - _selectedButton = _buttons.size() - 1; - } else if(_selectedButton >= (int)_buttons.size()) { - _selectedButton = 0; - } - - // Highlight new selection - GetButton(_selectedButton)->SetHighlighted(true); -} - -Button* ButtonGroup::GetButton(int index) { - int buttonsIndex = 0; - for(std::list::iterator i = _buttons.begin(); i != _buttons.end(); ++i) { - if(buttonsIndex == index) { - return (*i); - } - buttonsIndex++; - } - return NULL; -} diff --git a/src/libUnuk/ButtonGroup.h b/src/libUnuk/ButtonGroup.h deleted file mode 100644 index d0b3dc5..0000000 --- a/src/libUnuk/ButtonGroup.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once -#include - -#include "Button.h" -#include "MemClass.h" - -class ButtonGroup { -public: - ButtonGroup(void); - ~ButtonGroup(void); - - void CheckMouseOverDummy(void); - int CheckMouseOver(void); - - void RenderLiteral(void); - - void AddButton(Button* button); - void RemoveButton(int index); - - void SelectNext(void); - void SelectPrevious(void); - - int GetSelectedButton(void) { return _selectedButton; } - void SetSelectedButton(int button); - - Button* GetButton(int index); - -private: - void HighlightNewSelection(int newButton); - - std::list _buttons; - int _selectedButton; -}; diff --git a/src/libUnuk/ButtonToggle.cpp b/src/libUnuk/ButtonToggle.cpp deleted file mode 100644 index 3451aca..0000000 --- a/src/libUnuk/ButtonToggle.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "ButtonToggle.h" - -ButtonToggle::ButtonToggle(void) { - -} - -ButtonToggle::~ButtonToggle(void) { - -} - -void ButtonToggle::SetOverRGB(Uint8 r, Uint8 g, Uint8 b) { - Button::SetOverRGB(r, g, b); -} - -void ButtonToggle::SetOverRGB(SDL_Color colour) { - Button::SetOverRGB(colour); -} - -void ButtonToggle::SetOffRGB(Uint8 r, Uint8 g, Uint8 b) { - ButtonToggle::SetOutRGB(r, g, b); -} - -void ButtonToggle::SetOffRGB(SDL_Color colour) { - Button::SetOutRGB(colour); -} - -void ButtonToggle::SetOnRGB(Uint8 r, Uint8 g, Uint8 b) { - _onColour.r = r; - _onColour.g = g; - _onColour.b = b; -} - -void ButtonToggle::SetOnRGB(SDL_Color colour) { - _onColour = colour; -} diff --git a/src/libUnuk/ButtonToggle.h b/src/libUnuk/ButtonToggle.h deleted file mode 100644 index 83c5362..0000000 --- a/src/libUnuk/ButtonToggle.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once -#include -#include - -#include "Button.h" - -class ButtonToggle : protected Button { -public: - ButtonToggle(void); - ~ButtonToggle(void); - - void SetOverRGB(Uint8 r, Uint8 g, Uint8 b); - void SetOverRGB(SDL_Color); - void SetOffRGB(Uint8 r, Uint8 g, Uint8 b); - void SetOffRGB(SDL_Color); - void SetOnRGB(Uint8 r, Uint8 g, Uint8 b); - void SetOnRGB(SDL_Color); - - void SetTextRGB(Uint8 r, Uint8 g, Uint8 b); - void SetOnText(string); - void SetOffText(string); - - void SetState(bool); - bool GetState(void) { return _state; } - - bool CheckMouseOver(void); - - void Render(void); - -private: - bool _state; - - SDL_Colour _onColour; - - Text _onText; -}; diff --git a/src/libUnuk/Character.cpp b/src/libUnuk/Character.cpp deleted file mode 100644 index 07271fe..0000000 --- a/src/libUnuk/Character.cpp +++ /dev/null @@ -1,204 +0,0 @@ -#include "Character.h" - -// Pixels * 60 / sec -const float Character::CHARACTER_SPEED = 3.5f; - -static listcollisionList; -static list::iterator collisionIter; - -Character::Character(Map* mapArg) { - map = mapArg; - attacking = false; - directionFacing = FACING_DOWN; - _animationStage = ANIM_NO_FOOT; - _animationTimer.Start(); - _leftFoot = false; - _health = 100; - - xVel = 0.0f; - yVel = 0.0f; - - _texture = NULL; - - collisionList.push_front(this); -} - -Character::~Character(void) { - SDL_FreeSurface(_texture); - for(collisionIter = collisionList.begin(); collisionIter != collisionList.end(); collisionIter++) { - if((*collisionIter) == this) { - collisionList.erase(collisionIter); - break; - } - } -} - -void Character::LoadSprites(string filename, int wArg, int hArg) { - if(_texture != NULL) - SDL_FreeSurface(_texture); - - _texture = LoadImageAlpha(filename.c_str()); - - w = (float)wArg; - h = (float)hArg; - - for(int m_direction = 0; m_direction < 4; m_direction++) { - for(int m_action = 0; m_action < 4; m_action++) { - _sprites[m_direction][m_action].x = (Sint16)(w * m_action); - _sprites[m_direction][m_action].y = (Sint16)(h * m_direction); - _sprites[m_direction][m_action].w = (Sint16)w; - _sprites[m_direction][m_action].h = (Sint16)h; - } - } -} - -void Character::AddSpeachBubble(string text) { - _speachBubble.push_back(text); - - _speachBubbleText.SetLineWidth(200); - _speachBubbleText.SetTextBlended(text, small, 0, 0, 0, true); - - if(_speachBubbleTimer.IsStarted() == false) - _speachBubbleTimer.Start(); -} - -void Character::Render(void) { - // Draw some fancy speach bubbles. It is a bit of a mess, I am playing. - if(_speachBubble.size() != 0) { - if(_speachBubbleTimer.GetTicks() < SPEACH_BUBBLE_DISPLAY_LENGTH) { - roundedBoxRGBA(screen, (Sint16)((x + w / 2) - 100 - camera.x), - (Sint16)(y - 100 - camera.y), - (Sint16)((x + w / 2) + 100 - camera.x), - (Sint16)(y - 35 - camera.y), - 5, 255, 255, 255, 255); - - filledTrigonRGBA(screen, (Sint16)((x + w / 2) - 100 - camera.x), - (Sint16)(y - 100 - camera.y), - (Sint16)((x + w / 2) - 10 - camera.x), - (Sint16)(y - 40 - camera.y), - (Sint16)((x + w / 2) + 10 - camera.x), - (Sint16)(y - 40 - camera.y), - 255, 255, 255, 255); - - _speachBubbleText.Render((int)((x + w / 2) - 90), (int)y - 90); - } - } - - if(attacking && attackTimer.GetTicks() < ATTACKING_DISPLAY_LEN) { - ApplySurface((int)x, (int)y, _texture, screen, &_sprites[directionFacing][ANIM_ATTACK]); - return; - } - else if(attacking) - attacking = false; - - if(xVel == 0.0f && yVel == 0.0f) - ApplySurface((int)x, (int)y, _texture, screen, &_sprites[directionFacing][ANIM_NO_FOOT]); - else { - if(_animationTimer.GetTicks() > ANIMATION_SPEED) { - if(_animationStage == ANIM_NO_FOOT) { - if(_leftFoot == true) - _animationStage = ANIM_RIGHT_FOOT; - else - _animationStage = ANIM_LEFT_FOOT; - } - else if(_animationStage == ANIM_LEFT_FOOT) { - _animationStage = ANIM_NO_FOOT; - _leftFoot = true; - } - else if(_animationStage == ANIM_RIGHT_FOOT) { - _animationStage = ANIM_NO_FOOT; - _leftFoot = false; - } - _animationTimer.Start(); - } - ApplySurface((int)x, (int)y, _texture, screen, &_sprites[directionFacing][_animationStage]); - } -} - -void Character::Update(void) { - Move(); - - if(_speachBubble.size() != 0) { - if(_speachBubbleTimer.GetTicks() > SPEACH_BUBBLE_DISPLAY_LENGTH) { - _speachBubble.pop_front(); - - if(_speachBubble.size() != 0) { - _speachBubbleTimer.Start(); - } - } else { - if(_speachBubble.front() != _speachBubbleText.GetText()) { - _speachBubbleText.SetTextBlended(_speachBubble.front(), small, 0, 0, 0); - } - } - } -} - -void Character::Move(void) { - x += xVel; - tileX = (int)(((x + (w / 2)) / TILE_WIDTH)); - tileY = (int)(((y + (h / 2)) / TILE_HEIGHT)); - - // Check collisions. - if((x < 0) || (x + w) > levelWidth || (x + w) > SCREEN_WIDTH) x -= xVel; - if(CheckTileCollisions()) x -= xVel; - if(CheckEntityCollisions()) x -= xVel; - if(CheckCharacterCollisions()) x -= xVel; - - y += yVel; - tileX = (int)(((x + (w / 2)) / TILE_WIDTH)); - tileY = (int)(((y + (h / 2)) / TILE_HEIGHT)); - - if((y < 0) || (y + h) > levelHeight || (y + h) > SCREEN_HEIGHT) y -= yVel; - if(CheckTileCollisions()) y -= yVel; - if(CheckEntityCollisions()) y -= yVel; - if(CheckCharacterCollisions()) y -= yVel; -} - -/* - * Bounds checking only included in map.GetTileSolidity() and - * map.GetEntitySolidity(). Remember to add bounds checking - * if any other map method is used in a similar manner. - */ -bool Character::CheckTileCollisions(void) { - for(int i = -1; i < 2; i++) { - for(int j = -1; j < 2; j++) { - if(map->GetTileSolidity(tileX + i, tileY + j)) - if(CheckCollisionXY((int)x, (int)y, (int)w, (int)h, map->GetTileX(tileX + i, tileY + j), - map->GetTileY(tileX + i, tileY + j), TILE_WIDTH, TILE_HEIGHT)) - return true; - } - } - return false; -} - -bool Character::CheckEntityCollisions(void) { - for(int i = -1; i < 2; i++) { - for(int j = -1; j < 2; j++) { - if(map->GetEntitySolidity(tileX + i, tileY + j)) { - if(CheckCollisionXY((int)x, (int)y, (int)w, (int)h, map->GetEntityX(tileX + i, tileY + j), - map->GetEntityY(tileX + i, tileY + j), - map->GetEntityWidth(tileX + i, tileY + j), - map->GetEntityHeight(tileX + i, tileY + j))) - return true; - } - } - } - return false; -} - -bool Character::CheckCharacterCollisions(void) { - for(collisionIter = collisionList.begin(); - collisionIter != collisionList.end(); - collisionIter++) { - if((*collisionIter) != this) { - if(CheckCollisionXY((int)x, (int)y, (int)w, (int)h, - (int)(*collisionIter)->GetX(), - (int)(*collisionIter)->GetY(), - (int)(*collisionIter)->GetWidth(), - (int)(*collisionIter)->GetHeight())) { - return true; - } - } - } - return false; -} diff --git a/src/libUnuk/Character.h b/src/libUnuk/Character.h deleted file mode 100644 index f6cf77d..0000000 --- a/src/libUnuk/Character.h +++ /dev/null @@ -1,117 +0,0 @@ -#pragma once -#include -#include -#include - -#include "../Unuk/Globals.h" -#include "../Unuk/Constants.h" -#include "MemClass.h" -#include "ApplySurface.h" -#include "ImageLoader.h" -#include "Collision.h" -#include "Map.h" -#include "Timer.h" -#include "Text.h" -#include "Debug.h" -using namespace std; - -class Map; - -class Character { -public: - Character(Map* mapArg); - ~Character(void); - - void LoadSprites(string filename, int wArg, int hArg); - - float GetX(void) { return x; } - float GetY(void) { return y; } - float GetWidth(void) { return w; } - float GetHeight(void) { return h; } - - void SetXY(float xArg, float yArg) { x = xArg, y = yArg; } - void SetXVelocity(float arg) { xVel = arg; } - void SetYVelocity(float arg) { yVel = arg; } - - void SetHealth(int health) { _health = health; } - int GetHealth(void) { return _health; } - - void AddSpeachBubble(string text); - - void Render(void); - void Update(void); - - inline void* operator new(size_t size) { - return gMemManager.Allocate(size); - } - - inline void operator delete(void* object) { - gMemManager.Free(object); - } - - inline void* operator new [](size_t size) { - return gMemManager.Allocate(size); - } - - inline void operator delete [](void* object) { - gMemManager.Free(object); - } - -protected: - void Move(void); - - bool CheckTileCollisions(void); - bool CheckEntityCollisions(void); - bool CheckCharacterCollisions(void); - - float x; - float y; - float w; - float h; - - float xVel; - float yVel; - - int tileX; - int tileY; - - Timer attackTimer; - bool attacking; - - int _health; - - Map* map; - - static const float CHARACTER_SPEED; - - int directionFacing; - static const int FACING_UP = 0; - static const int FACING_RIGHT = 1; - static const int FACING_DOWN = 2; - static const int FACING_LEFT = 3; - - static const int ANIM_LEFT_FOOT = 0; - static const int ANIM_NO_FOOT = 1; - static const int ANIM_RIGHT_FOOT = 2; - static const int ANIM_ATTACK = 3; - -private: - static const int ANIMATION_SPEED = 200; - static const int ATTACKING_DISPLAY_LEN = 150; - - static const int SPEACH_BUBBLE_DISPLAY_LENGTH = 6000; - - SDL_Surface* _texture; - - // [direction][action] - SDL_Rect _sprites[4][4]; - - Timer _animationTimer; - int _animationStage; - bool _leftFoot; - - list _speachBubble; - list::iterator _speachBubbleIter; - Timer _speachBubbleTimer; - Text _speachBubbleText; -}; diff --git a/src/libUnuk/Collision.cpp b/src/libUnuk/Collision.cpp deleted file mode 100644 index 8ca25be..0000000 --- a/src/libUnuk/Collision.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include "Collision.h" - -bool CheckCollisionRect(SDL_Rect a, SDL_Rect b) { - if(a.y + a.h <= b.y) - return false; - if(a.y >= b.y + b.h) - return false; - if(a.x + a.w <= b.x) - return false; - if(a.x >= b.x + b.w) - return false; - - return true; -} - -bool CheckCollisionXY(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2) { - if(y1 + h1 <= y2) - return false; - if(y1 >= y2 + h2) - return false; - if(x1 + w1 <= x2) - return false; - if(x1 >= x2 + w2) - return false; - - return true; -} diff --git a/src/libUnuk/Collision.h b/src/libUnuk/Collision.h deleted file mode 100644 index b477fd1..0000000 --- a/src/libUnuk/Collision.h +++ /dev/null @@ -1,6 +0,0 @@ -#pragma once -#define _COLLISION_H_ -#include - -bool CheckCollisionRect(SDL_Rect a, SDL_Rect b); -bool CheckCollisionXY(int x1, int y1, int w1, int h1, int x2, int y2, int w2, int h2); diff --git a/src/libUnuk/Debug.cpp b/src/libUnuk/Debug.cpp deleted file mode 100644 index db6a8b6..0000000 --- a/src/libUnuk/Debug.cpp +++ /dev/null @@ -1,101 +0,0 @@ -#include -#include -#include -#include -#include "Debug.h" -#include "string" - - -using namespace std; - -// =================================================================== -// The Debug log allows us to display ever piece of data that -// populates our class components, anything that is loaded, serialized, -// de-serialized etc will be printed out to a text file. -// (Running our program in a terminal, this debug log will print to it.) -// =================================================================== - -Debug *Debug::logger = NULL; - -Debug::Debug(bool logToFile) { - time_t timestamp; - if(logToFile) { - _logFile.open("../Bin/Debug.log", ios::out); - if(!logToFile) { - // We can not open our log. - cerr << "Warning: Can not open Debug.log to write, continueing without logging\n"; - } else { - // Log File is open, let us give it a nice time stamp. - timestamp = time(NULL); - _logFile << "Log Started: " << ctime(×tamp) << endl; - } - } -} - -Debug::~Debug(void) { - time_t timestamp; - - // We only need to close the log if it is open. - if(_logFile) { - // Give it a closing timestamp. - timestamp = time(NULL); - _logFile << endl << "Log Closed: " << ctime(×tamp) << endl; - - // Close the log file. - _logFile.close(); - } -} - -void Debug::message(std::string msg) { - if(_logFile) { - _logFile << msg << endl; - } - cerr << msg << endl << endl; -} - -void Debug::message(const char *msg, ...) { - va_list vargList; // This is to handlle the variable arguments - - char outBuf[1024]; - unsigned short outLen; - - // This takes the arguments and puts them into the character array. - va_start(vargList, msg); - -#if defined WIN32 - outLen = (unsigned short)_vsnprintf(outBuf, sizeof(outBuf), msg, vargList); -#else - outLen = vsnprintf(outBuf, sizeof(outBuf), msg, vargList); -#endif - - va_end(vargList); - - if(outLen >= sizeof(outBuf)) { - outLen = sizeof(outBuf); - } - - if(_logFile) { - _logFile << outBuf << endl; - } - - cerr << outBuf << endl; -} - -bool Debug::openLog(bool logToFile) { - // Make sure the logger has not already been initialized. - if(logger != NULL) { - logger->message("Warning: Multiple calls to openLog()."); - return false; - } - logger = new Debug(logToFile); - return true; -} - -void Debug::closeLog(void) { - if(logger == NULL) { - cerr << "Warning: Call to closeLog() with NULL logger pointer." << endl; - return; - } - delete logger; - logger = NULL; -} diff --git a/src/libUnuk/Debug.h b/src/libUnuk/Debug.h deleted file mode 100644 index 96e93f0..0000000 --- a/src/libUnuk/Debug.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once -#include -#include "string" - -class Debug { -public: - Debug(bool logToFile); - ~Debug(void); - - // Log an error message. - void message(std::string msg); - void message(const char *msg, ...); - static bool openLog(bool logToFile); - static void closeLog(void); - - static Debug *logger; - -private: - std::ofstream _logFile; -}; diff --git a/src/libUnuk/FPS.cpp b/src/libUnuk/FPS.cpp deleted file mode 100644 index b8608c3..0000000 --- a/src/libUnuk/FPS.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include "FPS.h" - -FPS::FPS(int maxFPSArg) { - _maxFPS = maxFPSArg; - - _fps = 0; - _frame = 0; - - _frameTimer.Start(); - _fpsCalc.Start(); -} - -FPS::~FPS(void) { - -} - -void FPS::LimitFPS(void) { - // Calculate the FPS. - if(_fpsCalc.GetTicks() > 1000) { - - _fps = _frame / (_fpsCalc.GetTicks() / 1000); - - _fpsCalc.Start(); - _frame = 0; - } - - // Put a limitation on the FPS. - if(1000 / _maxFPS > _frameTimer.GetTicks()) { - // SDL_Delay does not accept a float so for higher framerate - // limits there's an innacuracy. This is as much as 3fps - // at a limit of 60fps. - SDL_Delay((1000 / _maxFPS) - _frameTimer.GetTicks()); - } - - _frameTimer.Start(); - _frame++; -} - -void FPS::SetMaxFPS(int maxFPSArg) { - _maxFPS = maxFPSArg; -} diff --git a/src/libUnuk/FPS.h b/src/libUnuk/FPS.h deleted file mode 100644 index ffd3ce9..0000000 --- a/src/libUnuk/FPS.h +++ /dev/null @@ -1,25 +0,0 @@ -#pragma once -#include "../Unuk/Globals.h" -#include "Timer.h" - - -class FPS { -public: - FPS(int maxFPSArg); - ~FPS(void); - - void LimitFPS(void); - - void SetMaxFPS(int maxFPSArg); - int GetMaxFPS(void) { return _maxFPS; } - - int GetCurrentFPS(void) { return _fps; } - -private: - int _fps; - int _frame; - int _maxFPS; - - Timer _frameTimer; - Timer _fpsCalc; -}; diff --git a/src/libUnuk/Font.cpp b/src/libUnuk/Font.cpp deleted file mode 100644 index bee12a5..0000000 --- a/src/libUnuk/Font.cpp +++ /dev/null @@ -1,11 +0,0 @@ -#include "Font.h" - -TTF_Font* Font(const char* filename, const int size) { - ifstream font(filename); - - if(font.is_open() == false) { - Debug::logger->message("Font: %s cannot be found."); - exit(-1); - } - return TTF_OpenFont(filename, size); -} diff --git a/src/libUnuk/Font.h b/src/libUnuk/Font.h deleted file mode 100644 index 81cc96b..0000000 --- a/src/libUnuk/Font.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once -#include -#include -#include -#include "Debug.h" -using namespace std; - -TTF_Font* Font(const char* filename, const int size); diff --git a/src/libUnuk/ImageLoader.cpp b/src/libUnuk/ImageLoader.cpp deleted file mode 100644 index 68b3397..0000000 --- a/src/libUnuk/ImageLoader.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "ImageLoader.h" - -SDL_Surface* LoadImage(const char* filename) { - SDL_Surface* loadedImage = NULL; - SDL_Surface* optimizedImage = NULL; - - // Initialize loadedImage with the file. - loadedImage = IMG_Load(filename); - if(loadedImage != NULL) { - // Then copy the image to a surface for us to blit later. - optimizedImage = SDL_DisplayFormat(loadedImage); - SDL_FreeSurface(loadedImage); - return optimizedImage; - } else { - // Tell us what file is missing and do some stupid error texture thing. - Debug::logger->message("ImageLoader: %s cannot be found!"); - return errorTexture; - } -} - -SDL_Surface* LoadImageAlpha(const char* filename) { - SDL_Surface* loadedImage = NULL; - SDL_Surface* optimizedImage = NULL; - - // Initialize loadedImage with the file. - loadedImage = IMG_Load(filename); - if(loadedImage != NULL) { - // Then copy the image to a surface and give us an alpha channel. - optimizedImage = SDL_DisplayFormatAlpha(loadedImage); - SDL_FreeSurface(loadedImage); - return optimizedImage; - } else { - // Tell us what file is missing and do some stupid error texture thing. - Debug::logger->message("ImageLoader: %s cannot be found!"); - return errorTexture; - } -} diff --git a/src/libUnuk/ImageLoader.h b/src/libUnuk/ImageLoader.h deleted file mode 100644 index 0c021a4..0000000 --- a/src/libUnuk/ImageLoader.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once -#include -#include -#include "../Unuk/Globals.h" -#include "Debug.h" - -SDL_Surface* LoadImage(const char* filename); -SDL_Surface* LoadImageAlpha(const char* filename); diff --git a/src/libUnuk/IngameMenu.cpp b/src/libUnuk/IngameMenu.cpp deleted file mode 100644 index c67b91a..0000000 --- a/src/libUnuk/IngameMenu.cpp +++ /dev/null @@ -1,99 +0,0 @@ -#include "IngameMenu.h" - -IngameMenu::IngameMenu(void) { - _active = false; - - Button* btnResume = new Button(); - btnResume->SetOutRGB(200, 200, 200); - btnResume->SetOverRGB(255, 255, 255); - btnResume->SetTextRGB(0, 0, 0); - btnResume->SetText("Resume Game"); - btnResume->SetHighlightRGB(255, 128, 0); - btnResume->SetHighlighted(false); - btnResume->SetXY(SCREEN_WIDTH / 2 - btnResume->GetWidth() / 2, 50); - - Button* btnSaveGame = new Button(); - btnSaveGame->SetOutRGB(200, 200, 200); - btnSaveGame->SetOverRGB(255, 255, 255); - btnSaveGame->SetTextRGB(0, 0, 0); - btnSaveGame->SetText("SaveGame"); - btnSaveGame->SetHighlightRGB(255, 128, 0); - btnSaveGame->SetHighlighted(false); - btnSaveGame->SetXY(SCREEN_WIDTH / 2 - btnSaveGame->GetWidth() / 2, 100); - - Button* btnLoadGame = new Button(); - btnLoadGame->SetOutRGB(200, 200, 200); - btnLoadGame->SetOverRGB(255, 255, 255); - btnLoadGame->SetTextRGB(0, 0, 0); - btnLoadGame->SetText("LoadGame"); - btnLoadGame->SetHighlightRGB(255, 128, 0); - btnLoadGame->SetHighlighted(false); - btnLoadGame->SetXY(SCREEN_WIDTH / 2 - btnLoadGame->GetWidth() / 2, 150); - - Button* btnOptions = new Button(); - btnOptions->SetOutRGB(200, 200, 200); - btnOptions->SetOverRGB(255, 255, 255); - btnOptions->SetTextRGB(0, 0, 0); - btnOptions->SetText("Options"); - btnOptions->SetHighlightRGB(255, 128, 0); - btnOptions->SetHighlighted(false); - btnOptions->SetXY(SCREEN_WIDTH / 2 - btnOptions->GetWidth() / 2, 200); - - Button* btnExitToMenu = new Button(); - btnExitToMenu->SetOutRGB(200, 200, 200); - btnExitToMenu->SetOverRGB(255, 255, 255); - btnExitToMenu->SetTextRGB(0, 0, 0); - btnExitToMenu->SetText("Exit To Main Menu"); - btnExitToMenu->SetHighlightRGB(255, 128, 0); - btnExitToMenu->SetHighlighted(false); - btnExitToMenu->SetXY(SCREEN_WIDTH / 2 - btnExitToMenu->GetWidth() / 2, 250); - - _buttons.AddButton(btnResume); - _buttons.AddButton(btnSaveGame); - _buttons.AddButton(btnLoadGame); - _buttons.AddButton(btnOptions); - _buttons.AddButton(btnExitToMenu); -} - -IngameMenu::~IngameMenu(void) { -} - -ingameMenuNavVal_t IngameMenu::HandleInput(void) { - while(SDL_PollEvent(&event)) { - _buttons.CheckMouseOverDummy(); - - if(event.key.type == SDL_KEYDOWN) { - if(event.key.keysym.sym == SDLK_ESCAPE) { - return ingameMenuResume; - } else if(event.key.keysym.sym == SDLK_DOWN) { - _buttons.SelectNext(); - } else if(event.key.keysym.sym == SDLK_UP) { - _buttons.SelectPrevious(); - } else if(event.key.keysym.sym == SDLK_RETURN) { - switch(_buttons.GetSelectedButton()) { - case 0: return ingameMenuResume; - case 1: return ingameMenuSaveGame; - case 2: return ingameMenuLoadGame; - case 3: return ingameMenuOptions; - case 4: return ingameMenuMainMenu; - } - } - } - else if(event.type == SDL_MOUSEBUTTONUP) { - if(event.button.button == SDL_BUTTON_LEFT) { - switch(_buttons.CheckMouseOver()) { - case 0: return ingameMenuResume; - case 1: return ingameMenuSaveGame; - case 2: return ingameMenuLoadGame; - case 3: return ingameMenuOptions; - case 4: return ingameMenuMainMenu; - } - } - } - } - return ingameMenuNothing; -} - -void IngameMenu::Render(void) { - _buttons.RenderLiteral(); -} \ No newline at end of file diff --git a/src/libUnuk/IngameMenu.h b/src/libUnuk/IngameMenu.h deleted file mode 100644 index cac0ceb..0000000 --- a/src/libUnuk/IngameMenu.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once - -#include "../Unuk/Globals.h" -#include "../Unuk/Constants.h" -#include "ButtonGroup.h" -#include "ButtonToggle.h" - -enum ingameMenuNavVal_t { - ingameMenuNothing, - ingameMenuResume, - ingameMenuSaveGame, - ingameMenuLoadGame, - ingameMenuOptions, - ingameMenuMainMenu -}; - -class IngameMenu { -public: - IngameMenu(void); - ~IngameMenu(void); - - ingameMenuNavVal_t HandleInput(void); - void Render(void); - - void SetStatus(bool arg) { _active = arg; } - bool GetStatus(void) { return _active; } - -private: - bool _active; - - ButtonGroup _buttons; -}; diff --git a/src/libUnuk/Input.cpp b/src/libUnuk/Input.cpp deleted file mode 100644 index a99b5d3..0000000 --- a/src/libUnuk/Input.cpp +++ /dev/null @@ -1,82 +0,0 @@ -#include -#include "Input.h" - -static mouse_t mouse; -static keyboard_t keyboard; - -bool _curr_key(int index) { - return(keyboard.keys[index] != 0); -} - -bool _old_key(int index) { - return(keyboard.oldKeys[index] != 0); -} - -bool _curr_mouse(int button) { - return((mouse.buttons * SDL_BUTTON(button)) != 0); -} - -bool _old_mouse(int button) { - return((mouse.oldButtons & SDL_BUTTON(button)) != 0); -} - -bool CreateInput(void) { - memset(&keyboard, 0, sizeof(keyboard_t)); - memset(&mouse, 0, sizeof(mouse_t)); - SDL_PumpEvents(); - SDL_PumpEvents(); - unsigned char* tempKeys = SDL_GetKeyState(&keyboard.keycount); - keyboard.keys = (unsigned char*)malloc(sizeof(char) * keyboard.keycount); - keyboard.oldKeys = (unsigned char*)malloc(sizeof(char) * keyboard.keycount); - - memcpy(keyboard.keys, tempKeys, sizeof(char) * keyboard.keycount); - mouse.buttons = SDL_GetMouseState(&mouse.dx, &mouse.dy); - return true; -} - -void UpdateInput(void) { - SDL_PumpEvents(); - keyboard.lastChar = -1; - mouse.oldx = mouse.dx; - mouse.oldy = mouse.dy; - mouse.oldButtons = SDL_GetMouseState(&mouse.dx, &mouse.dy); - - memcpy(keyboard.oldKeys, keyboard.keys, sizeof(char) * keyboard.keycount); - - unsigned char *tmp = SDL_GetKeyState(&keyboard.keycount); - memcpy(keyboard.keys, tmp, sizeof(char) * keyboard.keycount); - - keyboard.mods = SDL_GetModState(); - - SDL_Event event; - while(SDL_PollEvent(&event)) { - if(event.type == SDL_KEYDOWN) { - keyboard.lastChar = event.key.keysym.sym; - } - } -} - -char GetKey(void) { - if(keyboard.lastChar != -1) - return (char)keyboard.lastChar; - return 0; -} - -unsigned int GetX(void) { return mouse.dx; } -unsigned int GetY(void) { return mouse.dy; } -unsigned int GetOldX(void) { return mouse.oldx; } -unsigned int GetOldY(void) { return mouse.oldy; } -unsigned int GetMods(void) { return keyboard.mods; } -bool KeyDown(int index) { return(_curr_key(index) && !_old_key(index)); } -bool KeyStillDown(int index) { return(_curr_key(index) && _old_key(index)); } -bool KeyUp(int index) { return(!_curr_key(index) && _old_key(index)); } -bool KeyStillUp(int index) { return(!_curr_key(index) && !_old_key(index)); } -bool MouseDown(int button) { return(_curr_mouse(button) && !_old_mouse(button)); } -bool MouseStillDown(int button) { return(_curr_mouse(button) && _old_mouse(button)); } -bool MouseUp(int button) { return(!_curr_mouse(button) && _old_mouse(button)); } -bool MouseStillUp(int button) { return(!_curr_mouse(button) && !_old_mouse(button)); } - -void DestroyInput(void) { - free(keyboard.keys); - free(keyboard.oldKeys); -} diff --git a/src/libUnuk/Input.h b/src/libUnuk/Input.h deleted file mode 100644 index 988dfee..0000000 --- a/src/libUnuk/Input.h +++ /dev/null @@ -1,43 +0,0 @@ -#pragma once -#include - -typedef struct mouse_s { - int dx, dy; - int oldx, oldy; - unsigned int buttons; - unsigned int oldButtons; -} mouse_t; - -typedef struct keyboard_s { - unsigned char *keys; - unsigned char *oldKeys; - int keycount; - int lastChar; - unsigned int mods; -} keyboard_t; - -typedef struct input_s { - mouse_t mouse; - keyboard_t keyboard; -} input_t; - - bool CreateInput(void); - void UpdateInput(void); - - char GetKey(void); - - unsigned int GetX(void); - unsigned int GetY(void); - unsigned int GetOldX(void); - unsigned int GetOldY(void); - unsigned int GetMods(void); - bool KeyDown(int index); - bool KeyStillDown(int index); - bool KeyUp(int index); - bool KeyStillUp(int index); - bool MouseDown(int button); - bool MouseStillDown(int button); - bool MouseUp(int button); - bool MouseStillUp(int button); - - void DestroyInput(void); diff --git a/src/libUnuk/MainMenu.cpp b/src/libUnuk/MainMenu.cpp deleted file mode 100644 index 3b75bcf..0000000 --- a/src/libUnuk/MainMenu.cpp +++ /dev/null @@ -1,171 +0,0 @@ -#include "MainMenu.h" - -MainMenu::MainMenu(void) { - Button* btnNewGame = new Button(); - btnNewGame->SetOutRGB(200, 200, 200); - btnNewGame->SetOverRGB(255, 255, 255); - btnNewGame->SetTextRGB(0, 0, 0); - btnNewGame->SetText("New Game"); - btnNewGame->SetXY(100, 150); - btnNewGame->SetHighlightRGB(255, 128, 0); - btnNewGame->SetHighlighted(false); - - Button* btnLoadGame = new Button(); - btnLoadGame->SetOutRGB(200, 200, 200); - btnLoadGame->SetOverRGB(255, 255, 255); - btnLoadGame->SetTextRGB(0, 0, 0); - btnLoadGame->SetText("Load Game"); - btnLoadGame->SetHighlightRGB(255, 128, 0); - btnLoadGame->SetHighlighted(false); - btnLoadGame->SetXY(100, 200); - - Button* btnOptions = new Button(); - btnOptions->SetOutRGB(200, 200, 200); - btnOptions->SetOverRGB(255, 255, 255); - btnOptions->SetTextRGB(0, 0, 0); - btnOptions->SetText("Options"); - btnOptions->SetHighlightRGB(255, 128, 0); - btnOptions->SetHighlighted(false); - btnOptions->SetXY(100, 250); - - Button* btnExit = new Button(); - btnExit->SetOutRGB(200, 200, 200); - btnExit->SetOverRGB(255, 255, 255); - btnExit->SetTextRGB(0, 0, 0); - btnExit->SetText("Exit"); - btnExit->SetHighlightRGB(255, 128, 0); - btnExit->SetHighlighted(false); - btnExit->SetXY(100, 300); - - grpMain.AddButton(btnNewGame); - grpMain.AddButton(btnLoadGame); - grpMain.AddButton(btnOptions); - grpMain.AddButton(btnExit); - - btnNewGameActive = false; - - lblNewGame.SetXY(275, 160); - lblNewGame.SetTextBlended("This will delete your current game, are you sure?", vsmall, 0, 0, 0); - - rectNewGame.SetRGB(200, 200, 200); - rectNewGame.SetXY(250, 150); - rectNewGame.SetWidthHeight(lblNewGame.GetWidth() + 50, 90); - - lblMenu.SetXY(100, 75); - lblMenu.SetTextBlended("Unuk", vlarge, 0, 0, 0); - - Button* btnNewGameYes = new Button(); - btnNewGameYes->SetOutRGB(20, 150, 20); - btnNewGameYes->SetOverRGB(20, 255, 20); - btnNewGameYes->SetTextRGB(0, 0, 0); - btnNewGameYes->SetText("Yes"); - btnNewGameYes->SetHighlightRGB(255, 128, 0); - btnNewGameYes->SetHighlighted(false); - btnNewGameYes->SetXY(rectNewGame.GetX() + rectNewGame.GetWidth() / 2 - 40 - btnNewGameYes->GetWidth(), 190); - - Button* btnNewGameNo = new Button(); - btnNewGameNo->SetOutRGB(150, 20, 20); - btnNewGameNo->SetOverRGB(255, 20, 20); - btnNewGameNo->SetTextRGB(0, 0, 0); - btnNewGameNo->SetText("No"); - btnNewGameNo->SetHighlightRGB(255, 128, 0); - btnNewGameNo->SetHighlighted(false); - btnNewGameNo->SetXY(rectNewGame.GetX() + rectNewGame.GetWidth() / 2 + 40 - btnNewGameNo->GetWidth(), 190); - - grpNewGame.AddButton(btnNewGameYes); - grpNewGame.AddButton(btnNewGameNo); - - //m_background.Load("MainMenu"); - - camera.x = 0; - camera.y = 0; -} - -MainMenu::~MainMenu(void) { - -} - -mainMenuNavVal_t MainMenu::Run(void) { - FPS fpsLimiter(20); - - bool running = true; - while(running) { - Render(); - SDL_Flip(screen); - - while(SDL_PollEvent(&event)) { - grpMain.CheckMouseOverDummy(); - - if(btnNewGameActive) { - grpNewGame.CheckMouseOverDummy(); - } - - if(event.key.type == SDL_KEYDOWN) { - if(event.key.keysym.sym == SDLK_DOWN) { - if(btnNewGameActive) { - grpNewGame.SelectNext(); - } else { - grpMain.SelectNext(); - } - } else if(event.key.keysym.sym == SDLK_UP) { - if(btnNewGameActive) { - grpNewGame.SelectPrevious(); - } else { - grpMain.SelectPrevious(); - } - } else if(event.key.keysym.sym == SDLK_RETURN) { - if(btnNewGameActive) { - switch(grpNewGame.GetSelectedButton()) { - case 0: return mainMenuNewGame; break; - case 1: btnNewGameActive = false; break; - } - } else { - switch(grpMain.GetSelectedButton()) { - case 0: btnNewGameActive = !btnNewGameActive; break; - case 1: return mainMenuLoadGame; - case 2: return mainMenuOptions; - case 3: return mainMenuExitGame; - } - } - } - } - else if(event.type == SDL_MOUSEBUTTONUP) { - if(event.button.button == SDL_BUTTON_LEFT) { - switch(grpMain.CheckMouseOver()) { - case 0: btnNewGameActive = !btnNewGameActive; break; - case 1: return mainMenuLoadGame; - case 2: return mainMenuOptions; - case 3: return mainMenuExitGame; - } - - if(btnNewGameActive) { - switch(grpNewGame.CheckMouseOver()) { - case 0: return mainMenuNewGame; break; - case 1: btnNewGameActive = false; break; - } - } - } - } - else if(event.type == SDL_QUIT) { - return mainMenuExitGame; - } - } - - fpsLimiter.LimitFPS(); - } - return mainMenuExitGame; -} - -void MainMenu::Render(void) { - //m_background.Render(); - - lblMenu.Render(); - - grpMain.RenderLiteral(); - - if(btnNewGameActive) { - rectNewGame.Draw(); - lblNewGame.Render(); - grpNewGame.RenderLiteral(); - } -} diff --git a/src/libUnuk/MainMenu.h b/src/libUnuk/MainMenu.h deleted file mode 100644 index 769fa86..0000000 --- a/src/libUnuk/MainMenu.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once - -#include "../Unuk/Constants.h" -#include "FPS.h" -#include "ButtonGroup.h" -#include "Map.h" -#include "Rect.h" -#include "Text.h" - -enum mainMenuNavVal_t { - mainMenuNewGame, - mainMenuLoadGame, - mainMenuOptions, - mainMenuExitGame -}; - -class MainMenu { -public: - MainMenu(void); - ~MainMenu(void); - - mainMenuNavVal_t Run(void); - -private: - void Render(void); - - Map _background; - - Text lblMenu; - - ButtonGroup grpMain; - - bool btnNewGameActive; - Rect rectNewGame; - Text lblNewGame; - ButtonGroup grpNewGame; -}; diff --git a/src/libUnuk/Map.cpp b/src/libUnuk/Map.cpp deleted file mode 100644 index f60b367..0000000 --- a/src/libUnuk/Map.cpp +++ /dev/null @@ -1,251 +0,0 @@ -#include "Map.h" -#include "NPC.h" - -Map::Map(void) { - -} - -Map::~Map(void) { - -} - -void Map::Load(const string filename) { - Unload(); - _currentMap = filename; - string fullMapPath = "../Data/Media/Maps/" + filename; - TiXmlDocument mapFile(fullMapPath.c_str()); - - assert(mapFile.LoadFile() == true); - - // Getting dirty with some XML. This seems like a nicer - // approach to loading maps, rather than parsing tet files. - TiXmlElement* rootElem = NULL; - TiXmlElement* lineElem = NULL; - TiXmlElement* tileElem = NULL; - TiXmlElement* dataElem = NULL; - - x = -1; - y = -1; - - // - Let's start parsing the map. - rootElem = mapFile.FirstChildElement("map"); - assert(rootElem != NULL); - if(rootElem) { - // - We want to tile one line at a time. line represents - // the row we are tiling. - lineElem = rootElem->FirstChildElement("line"); - assert(lineElem != NULL); - while(lineElem) { - y++; - x = -1; - - // - Then we will select the tile. and increment x to keep tiling that row. - tileElem = lineElem->FirstChildElement("tile"); - assert(tileElem != NULL); - while(tileElem) { - x++; - _tile[x][y].SetTileXY(x * TILE_WIDTH, y * TILE_HEIGHT); - - // - Apply a teture to the tile. - dataElem = tileElem->FirstChildElement("tileTexture"); - assert(dataElem != NULL); - stringstream tilePath; - tilePath << "../Data/Media/Images/Tiles/" << dataElem->GetText() << ".png"; - _tile[x][y].SetTileTexture(_tileTextures.Add(tilePath.str())); - // - Finished applying the texture, move to the next sibling. - - // - Check to see if the tile is solid or not. - dataElem = dataElem->NextSiblingElement("solidTile"); - assert(dataElem != NULL); - string tileSolidity = dataElem->GetText(); - assert(tileSolidity == "false" || tileSolidity == "true"); - if(tileSolidity == "false") - _tile[x][y].SetTileSolidity(false); - else - _tile[x][y].SetTileSolidity(true); - // - - // - dataElem = dataElem->NextSiblingElement("entityTexture"); - assert(dataElem != NULL); - string entityName = dataElem->GetText(); - if(entityName != "null") { - stringstream entityPath; - entityPath << "../Data/Media/Images/Entities/" << entityName << ".png"; - _tile[x][y].SetEntityTexture(_entityTextures.AddAlpha(entityPath.str())); - - _tile[x][y].SetEntityXY(_tile[x][y].GetTileX() + TILE_WIDTH / 2 - _tile[x][y].GetEntityWidth() / 2, - _tile[x][y].GetTileY() + TILE_HEIGHT / 2 - _tile[x][y].GetEntityHeight() / 2); - } - // - - // - dataElem = dataElem->NextSiblingElement("solidEntity"); - assert(dataElem != NULL); - string entitySolidity = dataElem->GetText(); - assert(entitySolidity == "false" || entitySolidity == "true"); - if(entitySolidity == "false") - _tile[x][y].SetEntitySolidity(false); - else - _tile[x][y].SetEntitySolidity(true); - // - - // - dataElem = dataElem->NextSiblingElement("zLevel"); - assert(dataElem != NULL); - _tile[x][y].SetZLevel(atoi(dataElem->GetText())); - // - - // - dataElem = dataElem->NextSiblingElement("mapTransition"); - assert(dataElem != NULL); - _tile[x][y].SetMapTransitionName(dataElem->GetText()); - // - - // - dataElem = dataElem->NextSiblingElement("mapTransX"); - assert(dataElem != NULL); - // int mapTransX = atoi(dataElem->GetText()); // not referenced - // - - // - dataElem = dataElem->NextSiblingElement("mapTransY"); - assert(dataElem != NULL); - // int mapTransY = atoi(dataElem->GetText()); // not referenced - // - - tileElem = tileElem->NextSiblingElement("tile"); - } - // - - lineElem = lineElem->NextSiblingElement("line"); - } - // - } - // - levelWidth = x * TILE_WIDTH; - levelHeight = y * TILE_HEIGHT; - - //character->Load(filename); - - NPC* npc = new NPC(this); - - npc->SetXY(300, 300); - npc->LoadSprites("../Data/Media/Images/Characters/template.png", 40,45); - _world.AddNPC(npc); - - npc = new NPC(this); - npc->SetXY(150, 350); - npc->LoadSprites("../Data/Media/Images/Characters/template.png", 40,45); - _world.AddNPC(npc); - - npc = new NPC(this); - npc->SetXY(100, 250); - npc->LoadSprites("../Data/Media/Images/Characters/template.png", 40,45); - _world.AddNPC(npc); -} - -void Map::Update(void) { - _world.Update(); - // Update the map so we can render when camera moves. -} - -void Map::Render(void) { - int xOrig = (camera.x / TILE_WIDTH) - 1; - int yOrig = (camera.y / TILE_HEIGHT) - 1; - - if (xOrig < 0) xOrig = 0; - if (yOrig < 0) yOrig = 0; - - int xEnd = xOrig + (SCREEN_WIDTH / TILE_WIDTH) + 3; - int yEnd = yOrig + (SCREEN_HEIGHT / TILE_HEIGHT) + 3; - - /* the fuck is this Allanis? --konom - if(xEnd < x) - xEnd++; - else - xEnd = x; - - if(yEnd < y) - yEnd++; - else - yEnd = y; - */ - - if (xEnd > x) xEnd = x; - if (yEnd > y) yEnd = y; - if (xEnd < 0) xEnd = 0; - if (yEnd < 0) yEnd = 0; - - if (xOrig > xEnd) xOrig = xEnd - 1; - if (yOrig > yEnd) yOrig = yEnd - 1; - - for(int i = xOrig; i < xEnd; i++) { - for(int j = yOrig; j < yEnd; j++) { - _tile[i][j].Render(); - } - } - - _world.Render(); -} - -void Map::Unload(void) { - _tileTextures.Unload(); - _entityTextures.Unload(); -} - -string Map::GetCurrentMap(void) { - return _currentMap; -} - -bool Map::GetTileSolidity(int xArg, int yArg) { - return _tile[xArg + 1][yArg + 1].GetTileSolidity(); -} - -int Map::GetTileX(int xArg, int yArg) { - return _tile[xArg + 1][yArg + 1].GetTileX(); -} - -int Map::GetTileY(int xArg, int yArg) { - return _tile[xArg + 1][yArg + 1].GetTileY(); -} - -bool Map::GetEntitySolidity(int xArg, int yArg) { - if(xArg > x || yArg > y || yArg < 0 || yArg < 0) { - return false; - } - - return _tile[xArg + 1][yArg + 1].GetEntitySolitity(); -} - -int Map::GetEntityX(int xArg, int yArg) { - return _tile[xArg + 1][yArg + 1].GetEntityX(); -} - -int Map::GetEntityY(int xArg, int yArg) { - return _tile[xArg + 1][yArg + 1].GetEntityY(); -} - -int Map::GetEntityWidth(int xArg, int yArg) { - return _tile[xArg + 1][yArg + 1].GetEntityWidth(); -} - -int Map::GetEntityHeight(int xArg, int yArg) { - return _tile[xArg + 1][yArg + 1].GetEntityHeight(); -} - -int Map::GetTileZLevel(int xArg, int yArg) { - return _tile[xArg + 1][yArg + 1].GetZLevel(); -} - -string Map::GetMapTransitionName(int xArg, int yArg) { - return _tile[xArg + 1][yArg + 1].GetMapTransitionName(); -} - -int Map::GetMapTransitionX(int xArg, int yArg) { - return _tile[xArg + 1][yArg + 1].GetMapTransitionX(); -} - -int Map::GetMapTransitionY(int xArg, int yArg) { - return _tile[xArg + 1][yArg + 1].GetMapTransitionY(); -} diff --git a/src/libUnuk/Map.h b/src/libUnuk/Map.h deleted file mode 100644 index c6466ca..0000000 --- a/src/libUnuk/Map.h +++ /dev/null @@ -1,64 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include -#include -#include - -#include "../Unuk/Globals.h" -#include "../Unuk/Constants.h" -#include "ImageLoader.h" -#include "ApplySurface.h" -#include "MapTile.h" -#include "Debug.h" -#include "WorldManager.h" -using namespace std; - -//class CharacterManager; - -class Map { -public: - Map(void); - ~Map(void); - - void Load(const string filename); - void Update(void); - void Render(void); - - bool GetTileSolidity(int xArg, int yArg); - int GetTileX(int xArg, int yArg); - int GetTileY(int xArg, int yArg); - - bool GetEntitySolidity(int xArg, int yArg); - int GetEntityX(int xArg, int yArg); - int GetEntityY(int xArg, int yArg); - int GetEntityWidth(int xArg, int yArg); - int GetEntityHeight(int xArg, int yArg); - - int GetTileZLevel(int xArg, int yArg); - - string GetMapTransitionName(int xArg, int yArg); - int GetMapTransitionX(int xArg, int yArg); - int GetMapTransitionY(int xArg, int yArg); - - string GetCurrentMap(void); - - WorldManager& GetWorld(void) { return _world; } - -private: - void Unload(void); - - string _currentMap; - int x; - int y; - - static const int TILE_ARRAY_SIZE = 150; - MapTile _tile[TILE_ARRAY_SIZE][TILE_ARRAY_SIZE]; - - TextureManager _tileTextures; - TextureManager _entityTextures; - - WorldManager _world; -}; diff --git a/src/libUnuk/MapElement.cpp b/src/libUnuk/MapElement.cpp deleted file mode 100644 index 102327a..0000000 --- a/src/libUnuk/MapElement.cpp +++ /dev/null @@ -1,39 +0,0 @@ -#include "MapElement.h" - -MapElement::MapElement(void) { - -} - -MapElement::~MapElement(void) { - -} - -void MapElement::SetTexture(SDL_Surface* arg) { - _texture = arg; -} - -void MapElement::Render(void) { - ApplySurface(x, y, _texture, screen); -} - -void MapElement::Update(void) { - -} - -void MapElement::SetSolidity(bool arg) { - _solid = arg; -} - -bool MapElement::GetSolidity(void) { - return _solid; -} - -void MapElement::SetXY(int xArg, int yArg) { - x = xArg, - y = yArg; -} - -int MapElement::GetX(void) { return x; } -int MapElement::GetY(void) { return y; } -int MapElement::GetWidth(void) { return _texture->w; } -int MapElement::GetHeight(void) { return _texture->h; } diff --git a/src/libUnuk/MapElement.h b/src/libUnuk/MapElement.h deleted file mode 100644 index 076f526..0000000 --- a/src/libUnuk/MapElement.h +++ /dev/null @@ -1,36 +0,0 @@ -#pragma once -#include -#include - -#include "../Unuk/Globals.h" -#include "ApplySurface.h" -#include "TextureManager.h" - -class MapElement { -public: - MapElement(void); - ~MapElement(void); - - static void SetTextureManager(TextureManager* arg); - - virtual void SetTexture(SDL_Surface* arg); - virtual void Render(void); - virtual void Update(void); - - void SetSolidity(bool arg); - bool GetSolidity(void); - - void SetXY(int xArg, int yArg); - int GetX(void); - int GetY(void); - int GetWidth(void); - int GetHeight(void); - -protected: - SDL_Surface* _texture; - - bool _solid; - - int x; - int y; -}; diff --git a/src/libUnuk/MapEntities.cpp b/src/libUnuk/MapEntities.cpp deleted file mode 100644 index a662269..0000000 --- a/src/libUnuk/MapEntities.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "MapEntities.h" - -MapEntityGeneric::MapEntityGeneric(void) { - _texture = NULL; - -} - -MapEntityGeneric::~MapEntityGeneric(void) { - -} - -void MapEntityGeneric::Render(void) { - if(_texture != NULL) { - MapElement::Render(); - } -} diff --git a/src/libUnuk/MapEntities.h b/src/libUnuk/MapEntities.h deleted file mode 100644 index 530eb62..0000000 --- a/src/libUnuk/MapEntities.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -/* - * Version of MapElement, that will check whether the SDL_Surface it - * owns is NULL or not and draws. - * - */ - -#include "MapElement.h" - -class MapEntityGeneric : public MapElement { -public: - MapEntityGeneric(void); - ~MapEntityGeneric(void); - - void Render(void); - -private: - -}; diff --git a/src/libUnuk/MapTile.h b/src/libUnuk/MapTile.h deleted file mode 100644 index 270af38..0000000 --- a/src/libUnuk/MapTile.h +++ /dev/null @@ -1,66 +0,0 @@ -#pragma once -#include -#include -#include - -#include "../Unuk/Constants.h" -#include "ApplySurface.h" -#include "MapElement.h" -#include "MapEntities.h" -using namespace std; - -class MapTile { -public: - MapTile(void) { } - ~MapTile(void) { } - - void Render(void) { _tile.Render(), _entity.Render(); } - - // Tile Mutators. - SDL_Surface* SetTileTexture(SDL_Surface* arg) { _tile.SetTexture(arg); return NULL; } - void SetTileSolidity(bool arg) { _tile.SetSolidity(arg); } - bool GetTileSolidity(void) { return _tile.GetSolidity(); } - // Well, it kinda helps if I lay the - // tiles rather than just get the - // return value right?? - void SetTileXY(int xArg, int yArg) { _tile.SetXY(xArg, yArg); } - int GetTileX(void) { return _tile.GetX(); } - int GetTileY(void) { return _tile.GetY(); } - - // Entity Mutators. - void SetEntityTexture(SDL_Surface* arg) { _entity.SetTexture(arg); } - void SetEntityXY(int xArg, int yArg) { _entity.SetXY(xArg, yArg); } - void SetEntitySolidity(bool arg) { _entity.SetSolidity(arg); } - bool GetEntitySolitity(void) { return _entity.GetSolidity(); } - - // Entity Mutators. - int GetEntityX(void) { return _entity.GetX(); } - int GetEntityY(void) { return _entity.GetY(); } - int GetEntityWidth(void) { return _entity.GetWidth(); } - int GetEntityHeight(void) { return _entity.GetHeight(); } - - // ZLevel Mutators. - void SetZLevel(int arg) { _zLevel = arg; } - int GetZLevel(void) { return _zLevel; } - - // Map Transition Mutators. - void SetMapTransitionName(string arg) { _mapTransitionName = arg; } - string GetMapTransitionName(void) { return _mapTransitionName; } - - void SetMapTransitionXY(int xArg, int yArg) { _mapTransitionX = xArg, _mapTransitionY = yArg; } - int GetMapTransitionX(void) { return _mapTransitionX; } - int GetMapTransitionY(void) { return _mapTransitionY; } - -private: - MapElement _tile; - MapEntityGeneric _entity; - - // -1 is a 'special' tile, the next tile that the player walks - // on is the players new zlevel. - int _zLevel; - - // If not 'null', switch map when the player walks on this tile. - string _mapTransitionName; - int _mapTransitionX; - int _mapTransitionY; -}; diff --git a/src/libUnuk/MemClass.h b/src/libUnuk/MemClass.h deleted file mode 100644 index 6e0ea71..0000000 --- a/src/libUnuk/MemClass.h +++ /dev/null @@ -1,32 +0,0 @@ -#pragma once -#include "MemManager.h" - -extern MemManager gMemManager; - -class MemClass { -public: - MemClass(void) : r(0), c(0) {} - MemClass(double a, double b): r(a), c(b) {} - - inline void* operator new(size_t size) { - return gMemManager.Allocate(size); - } - - inline void operator delete(void* object) { - gMemManager.Free(object); - } - - inline void* operator new [](size_t size) { - return gMemManager.Allocate(size); - } - - inline void operator delete [](void* object) { - gMemManager.Free(object); - } - -private: - // Real part. - double r; - // Complex part. - double c; -}; diff --git a/src/libUnuk/MemManager.cpp b/src/libUnuk/MemManager.cpp deleted file mode 100644 index afb317e..0000000 --- a/src/libUnuk/MemManager.cpp +++ /dev/null @@ -1,206 +0,0 @@ -#include "MemClass.h" -#include "MemManager.h" - -MemManager gMemManager; - -void BitMapEntry::SetBit(int position, bool flag) { - blocksAvailable += flag ? 1 : -1; - int elementNo = position / INT_SIZE; - int bitNo = position % INT_SIZE; - if(flag) - bitMap[elementNo] = bitMap[elementNo] | (1 << bitNo); - else - bitMap[elementNo] = bitMap[elementNo] & ~(1 << bitNo); -} - -void BitMapEntry::SetMultipleBits(int position, bool flag, int count) { - blocksAvailable += flag ? count : -count; - int elementNo = position / INT_SIZE; - int bitNo = position % INT_SIZE; - - int bitSize = (count <= INT_SIZE - bitNo) ? count : INT_SIZE - bitNo; - SetRangeOfInt(&bitMap[elementNo], bitNo + bitSize - 1, bitNo, flag); - count -= bitSize; - if(!count) return; - - int i = ++elementNo; - while(count >= 0) { - if(count <= INT_SIZE) { - SetRangeOfInt(&bitMap[i], count - 1, 0, flag); - return; - } else - bitMap[i] = flag ? unsigned (-1) : 0; - count -= 32; - i++; - } -} - -void BitMapEntry::SetRangeOfInt(int* element, int msb, int lsb, bool flag) { - if(flag) { - int mask = (unsigned(-1) << lsb) & (unsigned(-1) >> INT_SIZE - msb - 1); - *element |= mask; - } else { - int mask = (unsigned(-1) << lsb) & (unsigned(-1) >> INT_SIZE - msb - 1); - *element &= ~mask; - } -} - -MemClass* BitMapEntry::FirstFreeBlock(size_t size) { - for(int i = 0; i < BIT_MAP_ELEMENTS; i++) { - if(bitMap[i] == 0) - // There aint any bits free. - continue; - - // Yield the first bit position. This is a 1 - // in an int from the right. - int result = bitMap[i] & -(bitMap[i]); - void* address = 0; - int basePos = (INT_SIZE * i); - - switch(result) { - // Make the corresponfing bit 0 so block is no longer free. - case 0x00000001: return ComplexObjectAddress(basePos + 0); - case 0x00000002: return ComplexObjectAddress(basePos + 1); - case 0x00000004: return ComplexObjectAddress(basePos + 2); - case 0x00000008: return ComplexObjectAddress(basePos + 3); - case 0x00000010: return ComplexObjectAddress(basePos + 4); - case 0x00000020: return ComplexObjectAddress(basePos + 5); - case 0x00000040: return ComplexObjectAddress(basePos + 6); - case 0x00000080: return ComplexObjectAddress(basePos + 7); - case 0x00000100: return ComplexObjectAddress(basePos + 8); - case 0x00000200: return ComplexObjectAddress(basePos + 9); - case 0x00000400: return ComplexObjectAddress(basePos + 10); - case 0x00000800: return ComplexObjectAddress(basePos + 11); - case 0x00001000: return ComplexObjectAddress(basePos + 12); - case 0x00002000: return ComplexObjectAddress(basePos + 13); - case 0x00004000: return ComplexObjectAddress(basePos + 14); - case 0x00008000: return ComplexObjectAddress(basePos + 15); - case 0x00010000: return ComplexObjectAddress(basePos + 16); - case 0x00020000: return ComplexObjectAddress(basePos + 17); - case 0x00040000: return ComplexObjectAddress(basePos + 18); - case 0x00080000: return ComplexObjectAddress(basePos + 19); - case 0x00100000: return ComplexObjectAddress(basePos + 20); - case 0x00200000: return ComplexObjectAddress(basePos + 21); - case 0x00400000: return ComplexObjectAddress(basePos + 22); - case 0x00800000: return ComplexObjectAddress(basePos + 23); - case 0x01000000: return ComplexObjectAddress(basePos + 24); - case 0x02000000: return ComplexObjectAddress(basePos + 25); - case 0x04000000: return ComplexObjectAddress(basePos + 26); - case 0x08000000: return ComplexObjectAddress(basePos + 27); - case 0x10000000: return ComplexObjectAddress(basePos + 28); - case 0x20000000: return ComplexObjectAddress(basePos + 29); - case 0x40000000: return ComplexObjectAddress(basePos + 30); - case 0x80000000: return ComplexObjectAddress(basePos + 31); - default: break; - } - } - return 0; -} - -MemClass* BitMapEntry::ComplexObjectAddress(int pos) { - SetBit(pos, false); - return &((static_cast(Head()) + (pos / INT_SIZE)) [INT_SIZE - (pos % INT_SIZE + 1)]); -} - -void* BitMapEntry::Head(void) { - return gMemManager.GetMemoryPoolList()[index]; -} - -void* MemManager::Allocate(size_t size) { - // None array. - if(size == sizeof(MemClass)) { - set::iterator freeMapI = _freeMapEntries.begin(); - if(freeMapI != _freeMapEntries.end()) { - BitMapEntry* mapEntry = *freeMapI; - return mapEntry->FirstFreeBlock(size); - } else { - AllocateChunkAndInitBitMap(); - _freeMapEntries.insert(&(_bitMapEntryList[_bitMapEntryList.size() - 1])); - return _bitMapEntryList[_bitMapEntryList.size() - 1].FirstFreeBlock(size); - } - } else { - // Array. - if(_arrayMemoryList.empty()) { - return AllocateArrayMemory(size); - } else { - map::iterator infoI = _arrayMemoryList.begin(); - map::iterator infoEndI = _arrayMemoryList.end(); - - while(infoI != infoEndI) { - ArrayMemoryInfo info = (*infoI).second; - if(info.StartPosition != 0) - // Only search the memory blocks where allocation - // is done from first byte. - continue; - else { - BitMapEntry* entry = &_bitMapEntryList[info.memPoolListIndex]; - if(entry->blocksAvailable < (size / sizeof(MemClass))) - return AllocateArrayMemory(size); - else { - info.StartPosition = BIT_MAP_SIZE - entry->blocksAvailable; - info.Size = size / sizeof(MemClass); - MemClass* baseAddress = static_cast(_memoryPoolList[info.memPoolListIndex]) + info.StartPosition; - - _arrayMemoryList[baseAddress] = info; - SetMultipleBlockBits(&info, false); - - return baseAddress; - } - } - } - } - } - return 0; -} - -void* MemManager::AllocateArrayMemory(size_t size) { - void* chunkAddress = AllocateChunkAndInitBitMap(); - ArrayMemoryInfo info; - info.memPoolListIndex = _memoryPoolList.size() - 1; - info.StartPosition = 0; - info.Size = size / sizeof(MemClass); - _arrayMemoryList[chunkAddress] = info; - SetMultipleBlockBits(&info, false); - return chunkAddress; -} - -void* MemManager::AllocateChunkAndInitBitMap(void) { - BitMapEntry mapEntry; - MemClass* memoryBeginAddress = reinterpret_cast(new char[sizeof(MemClass) * BIT_MAP_SIZE]); - _memoryPoolList.push_back(memoryBeginAddress); - mapEntry.index = _memoryPoolList.size() - 1; - _bitMapEntryList.push_back(mapEntry); - return memoryBeginAddress; -} - -void MemManager::Free(void* object) { - if(_arrayMemoryList.find(object) == _arrayMemoryList.end()) - // Simple block deletion. - SetBlockBit(object, true); - else { - // Memory block deletion. - ArrayMemoryInfo *info = &_arrayMemoryList[object]; - SetMultipleBlockBits(info, true); - } -} - -void MemManager::SetBlockBit(void* object, bool flag) { - int i = _bitMapEntryList.size() - 1; - for(; i >= 0; i--) { - BitMapEntry* bitMap = &_bitMapEntryList[i]; - if((bitMap->Head() <= object) && (&(static_cast(bitMap->Head()))[BIT_MAP_SIZE - 1] >= object)) { - int position = static_cast(object)- static_cast(bitMap->Head()); - bitMap->SetBit(position, flag); - flag ? bitMap->blocksAvailable++ : bitMap->blocksAvailable--; - } - } -} - -void MemManager::SetMultipleBlockBits(ArrayMemoryInfo* info, bool flag) { - BitMapEntry* mapEntry = &_bitMapEntryList[info->memPoolListIndex]; - mapEntry->SetMultipleBits(info->StartPosition, flag, info->Size); -} - -vector& MemManager::GetMemoryPoolList(void) { - return _memoryPoolList; -} diff --git a/src/libUnuk/MemManager.h b/src/libUnuk/MemManager.h deleted file mode 100644 index 3ceee14..0000000 --- a/src/libUnuk/MemManager.h +++ /dev/null @@ -1,88 +0,0 @@ -#pragma once -#include -#include -#include -#include -#include -#include -#include -#include -using namespace std; - -const int BIT_MAP_SIZE = 1024; -const int INT_SIZE = sizeof(int) * 8; -const int BIT_MAP_ELEMENTS = BIT_MAP_SIZE / INT_SIZE; - -/* - * Memory Allocation Pattern. - * 11111111 11111111 11111111 - * 11111110 11111111 11111111 - * 11111100 11111111 11111111 - * - * If all bits for the first section becomes zero go to next section. - * - * 00000000 11111111 11111111 - * 00000000 11111110 11111111 - * 00000000 11111100 11111111 - * 00000000 11111000 11111111 - * - * The lookup inside the map becomes 0(1) for the first available free block. - */ - -class MemClass; - -typedef struct BitMapEntry { - int index; - int blocksAvailable; - int bitMap[BIT_MAP_SIZE]; - -public: - BitMapEntry():blocksAvailable(BIT_MAP_SIZE) { - // All blocks are free to begin with and bit value 1 - // in the map denotes available blocks. - memset(bitMap, 0xff, BIT_MAP_SIZE / sizeof(char)); - } - - void SetBit(int position, bool flag); - void SetMultipleBits(int position, bool flag, int count); - void SetRangeOfInt(int* element, int msb, int lsb, bool flag); - MemClass* FirstFreeBlock(size_t size); - MemClass* ComplexObjectAddress(int pos); - void* Head(void); -} BitMapEntry; - -typedef struct ArrayInfo { - int memPoolListIndex; - int StartPosition; - int Size; -} ArrayMemoryInfo; - -class IMemManager { -public: - virtual void* Allocate(size_t size) = 0; - virtual void Free(void* object) = 0; -}; - -class MemManager : public IMemManager { -public: - MemManager(void) {} - ~MemManager(void) {} - - void* Allocate(size_t size); - void Free(void* object); - vector& GetMemoryPoolList(void); - -private: - void* AllocateArrayMemory(size_t size); - void* AllocateChunkAndInitBitMap(void); - void SetBlockBit(void* object, bool flag); - void SetMultipleBlockBits(ArrayMemoryInfo* info, bool flag); - - // The following lists will maintain one to one correspondace - // and should be the same size. - vector _memoryPoolList; - vector _bitMapEntryList; - - set _freeMapEntries; - map _arrayMemoryList; -}; diff --git a/src/libUnuk/NPC.cpp b/src/libUnuk/NPC.cpp deleted file mode 100644 index 37fa4d7..0000000 --- a/src/libUnuk/NPC.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include "NPC.h" - -NPC::NPC(Map* mapArg) : Character(mapArg) { - _moveTimer.Start(); - - _moveChangeFrequency = 14000; - _moveDurationMax = 3000; - _moveDurationMin = 1000; -} - -NPC::~NPC(void) { - -} - -void NPC::Update(void) { - // Store the NPC's health. - // int health = GetHealth(); // not referenced - - Move(); - - if(xVel > 0) directionFacing = FACING_RIGHT; - else if(xVel < 0) directionFacing = FACING_LEFT; - else if(yVel > 0) directionFacing = FACING_DOWN; - else if(yVel < 0) directionFacing = FACING_UP; -} - -void NPC::Move(void) { - if(_moving && _moveTimer.GetTicks() > _moveDurationMax) { - xVel = 0.0f; - yVel = 0.0f; - _moving = false; - } - - if(_moving && _moveTimer.GetTicks() >= _moveDurationCurrent) { - xVel = 0.0f; - yVel = 0.0f; - _moving = false; - } - - if(_moveTimer.GetTicks() > _moveChangeFrequency) { - _moveTimer.Start(); - _moveDurationCurrent = _moveDurationMin + (rand() % (_moveDurationMax - _moveDurationMin)); - if(rand() % 2) { - yVel = 0.0f; - if(rand() % 2) - xVel = CHARACTER_SPEED; - else - xVel = -CHARACTER_SPEED; - } else { - xVel = 0.0f; - if(rand() % 2) - yVel = CHARACTER_SPEED; - else - yVel = -CHARACTER_SPEED; - } - _moving = true; - } - Character::Move(); -} diff --git a/src/libUnuk/NPC.h b/src/libUnuk/NPC.h deleted file mode 100644 index 5774690..0000000 --- a/src/libUnuk/NPC.h +++ /dev/null @@ -1,26 +0,0 @@ -#pragma once - -#include "Character.h" -#include "AStar.h" - -class NPC : public Character { -public: - NPC(Map* mapArg); - ~NPC(void); - - void Update(void); - -protected: - void Move(void); - -private: - int _moveChangeFrequency; - - int _moveDurationCurrent; - int _moveDurationMin; - int _moveDurationMax; - - bool _moving; - - Timer _moveTimer; -}; diff --git a/src/libUnuk/ParticleEmitter.cpp b/src/libUnuk/ParticleEmitter.cpp deleted file mode 100644 index b029fab..0000000 --- a/src/libUnuk/ParticleEmitter.cpp +++ /dev/null @@ -1,80 +0,0 @@ -#include "ParticleEmitter.h" - -ParticleEmitter::ParticleEmitter(void) { - -} - -ParticleEmitter::~ParticleEmitter(void) { - -} - -void ParticleEmitter::SetXY(int xArg, int yArg) { - x = xArg; - y = yArg; -} - -void ParticleEmitter::ForceXY(int xArg, int yArg) { - for(int i = 0; i < _particleCount; i++) { - m_particle[i].x = (float)xArg; - m_particle[i].y = (float)yArg; - } -} - -void ParticleEmitter::SetParticleCount(int countArg) { - _particleCount = countArg; - m_particle.resize(_particleCount); - - for(int i = 0; i < _particleCount; i++) { - m_particle[i].startTime = SDL_GetTicks(); - } -} - -void ParticleEmitter::SetParticleSpeed(float speedArg) { - _particleSpeed = speedArg; -} - -void ParticleEmitter::SetParticleType(string typeArg) { - if(!_particleTexture) { - SDL_FreeSurface(_particleTexture); - } - - string textureFilename = "../Data/Media/Images/Particles/" + typeArg + ".png"; - _particleTexture = LoadImageAlpha(textureFilename.c_str()); -} - -void ParticleEmitter::SetParticleLifetime(int lifetimeArg) { - _particleLifetime = lifetimeArg; - - for(int i = 0; i < _particleCount; i++) { - m_particle[i].lifetime = rand() % _particleLifetime + _particleLifetime / 4; - } -} - -void ParticleEmitter::Render(void) { - for(int i = 0; i < _particleCount; i++) { - ApplySurface((int)m_particle[i].x, (int)m_particle[i].y, _particleTexture, screen); - } -} - -void ParticleEmitter::Update(void) { - for(int i = 0; i < _particleCount; i++) { - if((int)SDL_GetTicks() - m_particle[i].startTime > m_particle[i].lifetime) { - // Reset the x and y coords. - m_particle[i].x = (float)x; - m_particle[i].y = (float)y; - - m_particle[i].xVel = (float)(rand() % 360); - m_particle[i].yVel = (float)(rand() % 360); - - if(rand() % 2) - m_particle[i].xVel = m_particle[i].xVel * -1.0f; - if(rand() % 2) - m_particle[i].yVel = m_particle[i].yVel * -1.0f; - - m_particle[i].startTime = SDL_GetTicks(); - } else { - m_particle[i].x += m_particle[i].xVel * _particleSpeed; - m_particle[i].y += m_particle[i].yVel * _particleSpeed; - } - } -} diff --git a/src/libUnuk/ParticleEmitter.h b/src/libUnuk/ParticleEmitter.h deleted file mode 100644 index d5813ba..0000000 --- a/src/libUnuk/ParticleEmitter.h +++ /dev/null @@ -1,52 +0,0 @@ -#pragma once -#include -#include -#include -#include - -#include "../Unuk/Globals.h" -#include "ImageLoader.h" -#include "ApplySurface.h" -using namespace std; - -struct Particle { - float x; - float y; - - float xVel; - float yVel; - - int lifetime; - int startTime; -}; - -class ParticleEmitter { -public: - ParticleEmitter(void); - ~ParticleEmitter(void); - - // distribute particles from the new x and y. - void SetXY(int xArg, int yArg); - // Move all the existing particles to the new x and y. - void ForceXY(int xArg, int yArg); - - void SetParticleCount(int countArg); - void SetParticleLifetime(int lifetimeArg); - void SetParticleSpeed(float speedArg); - void SetParticleType(string typeArg); - - void Render(void); - void Update(void); - -private: - vector m_particle; - - int x; - int y; - - int _particleCount; - int _particleLifetime; - float _particleSpeed; - - SDL_Surface* _particleTexture; -}; diff --git a/src/libUnuk/Rect.cpp b/src/libUnuk/Rect.cpp deleted file mode 100644 index d2b1d53..0000000 --- a/src/libUnuk/Rect.cpp +++ /dev/null @@ -1,66 +0,0 @@ -#include "Rect.h" - -Rect::Rect(void) { -} - -Rect::~Rect(void) { -} - -void Rect::SetXY(int xArg, int yArg) { - rect.x = (Sint16)xArg; - rect.y = (Sint16)yArg; -} - -void Rect::SetWidthHeight(int wArg, int hArg) { - rect.w = (Uint16)wArg; - rect.h = (Uint16)hArg; -} - -void Rect::SetRGB(Uint8 rArg, Uint8 gArg, Uint8 bArg) { - r = rArg; - g = gArg; - b = bArg; -} - -void Rect::SetRGB(SDL_Color colour) { - r = colour.r; - g = colour.g; - b = colour.b; -} - -void Rect::Draw(void) { - SDL_Rect offset; - - offset.x = rect.x - camera.x; - offset.y = rect.y - camera.y; - offset.w = rect.w; - offset.h = rect.h; - - SDL_FillRect(screen, &offset, SDL_MapRGB(screen->format, r, g, b)); -} - -void Rect::Draw(int xArg, int yArg) { - SDL_Rect offset; - - offset.x = (Sint16)(xArg - camera.x); - offset.y = (Sint16)(yArg - camera.y); - offset.w = (Sint16)rect.w; - offset.h = (Sint16)rect.h; - - SDL_FillRect(screen, &offset, SDL_MapRGB(screen->format, r, g, b)); -} - -void Rect::DrawLiteral(void) { - SDL_FillRect(screen, &rect, SDL_MapRGB(screen->format, r, g, b)); -} - -void Rect::DrawLiteral(int xArg, int yArg) { - SDL_Rect offset; - - offset.x = (Sint16)xArg; - offset.y = (Sint16)yArg; - offset.w = rect.w; - offset.h = rect.h; - - SDL_FillRect(screen, &offset, SDL_MapRGB(screen->format, r, g, b)); -} diff --git a/src/libUnuk/Rect.h b/src/libUnuk/Rect.h deleted file mode 100644 index a7689a6..0000000 --- a/src/libUnuk/Rect.h +++ /dev/null @@ -1,35 +0,0 @@ -#pragma once -#include -#include "../Unuk/Globals.h" -#include "ApplySurface.h" -using namespace std; - -class Rect { -public: - Rect(void); - ~Rect(void); - - int GetWidth(void) { return rect.w; } - int GetHeight(void) { return rect.h; } - int GetX(void) { return rect.x; } - int GetY(void) { return rect.y; } - - void SetXY(int xArg, int yArg); - void SetWidthHeight(int wArg, int hArg); - - void SetRGB(Uint8 rArg, Uint8 gArg, Uint8 bArg); - void SetRGB(SDL_Color); - - void Draw(void); - void Draw(int xArg, int yArg); - void DrawLiteral(void); - void DrawLiteral(int xArg, int yArg); - -protected: - Uint8 r; - Uint8 g; - Uint8 b; - -private: - SDL_Rect rect; -}; diff --git a/src/libUnuk/Text.cpp b/src/libUnuk/Text.cpp deleted file mode 100644 index f76861b..0000000 --- a/src/libUnuk/Text.cpp +++ /dev/null @@ -1,269 +0,0 @@ -#include "Text.h" - -TTF_Font* Text::vSmallFont = NULL; -TTF_Font* Text::smallFont = NULL; -TTF_Font* Text::mediumFont = NULL; -TTF_Font* Text::largeFont = NULL; -TTF_Font* Text::vLargeFont = NULL; - -const static int lineSpacing = 3; - -Text::Text(void) { - x = 0; - y = 0; - w = 0; - h = 0; - lineWidth=50; -} - -Text::~Text(void) { - if(!_lines.empty()) { - for(std::list::iterator it = _lines.begin(); it != _lines.end(); ++it) { - SDL_FreeSurface(*it); - } - _lines.clear(); - } -} - -void Text::LoadFonts(void) { - // Load the fonts if they are not already in memory. - assert(vSmallFont == NULL); - assert(smallFont == NULL); - assert(mediumFont == NULL); - assert(largeFont == NULL); - assert(vLargeFont == NULL); - - vSmallFont = Font("../Data/Media/Fonts/Enigma_2.ttf", 16); - smallFont = Font("../Data/Media/Fonts/Enigma_2.ttf", 23); - mediumFont = Font("../Data/Media/Fonts/Enigma_2.ttf", 27); - largeFont = Font("../Data/Media/Fonts/Enigma_2.ttf", 32); - vLargeFont = Font("../Data/Media/Fonts/Enigma_2.ttf", 48); -} - -void Text::FreeFonts(void) { - // If the fonts are loaded, then free them. - assert(vSmallFont != NULL); - assert(smallFont != NULL); - assert(mediumFont != NULL); - assert(largeFont != NULL); - assert(vLargeFont != NULL); - - TTF_CloseFont(vSmallFont); - TTF_CloseFont(smallFont); - TTF_CloseFont(mediumFont); - TTF_CloseFont(largeFont); - TTF_CloseFont(vLargeFont); -} - -void Text::SetXY(int xArg, int yArg) { - x = xArg; - y = yArg; -} - -int Text::SetTextBlended(string textArg, textSizes_t size, SDL_Color colour,bool wordWrap) { - _textContents = textArg; - - if(!_lines.empty()) { - for(std::list::iterator it = _lines.begin(); it != _lines.end(); ++it) { - SDL_FreeSurface(*it); - } - _lines.clear(); - } - - TTF_Font* font = NULL; - if(size == vsmall) { - font = vSmallFont; - } else if(size == small) { - font = smallFont; - } else if(size == medium) { - font = mediumFont; - } else if(size == large) { - font = largeFont; - } else { - font = vLargeFont; - } - - std::string finalTextContents = textArg; - - if(wordWrap) { - finalTextContents = DoWordWrap(font, finalTextContents); - } - - std::list lines; - std::string line; - for(int i = 0; i < (int)finalTextContents.size(); i++) { - char c = finalTextContents.at(i); - if(c == '\n') { - lines.push_back(line); - line.clear(); - } else { - line += c; - } - } - if (!line.empty()) { - lines.push_back(line); - } - - for(std::list::iterator it = lines.begin(); it != lines.end(); ++it) { - SDL_Surface* lineSurf = TTF_RenderText_Blended(font, it->c_str(), colour); - - int linePixelWidth; - int linePixelHeight; - TTF_SizeText(font, it->c_str(), &linePixelWidth, &linePixelHeight); - - if(linePixelWidth > w) { - w = linePixelWidth; - } - - h += linePixelHeight + lineSpacing; - - _lines.push_back(lineSurf); - } - - return 1; -} - -int Text::SetTextBlended(string textArg, textSizes_t size, Uint8 r, Uint8 g, Uint8 b, bool wordWrap) { - SDL_Color f = { r, g, b }; - return SetTextBlended(textArg, size, f, wordWrap); -} - -int Text::SetTextShaded(string textArg, textSizes_t size, SDL_Color colour, SDL_Color bgColour, bool wordWrap) { - _textContents = textArg; - - if(!_lines.empty()) { - for(std::list::iterator it = _lines.begin(); it != _lines.end(); ++it) { - SDL_FreeSurface(*it); - } - _lines.clear(); - } - - TTF_Font* font = NULL; - if(size == vsmall) { - font = vSmallFont; - } else if(size == small) { - font = smallFont; - } else if(size == medium) { - font = mediumFont; - } else if(size == large) { - font = largeFont; - } else { - font = vLargeFont; - } - - std::string finalTextContents = textArg; - - if(wordWrap) { - finalTextContents = DoWordWrap(font, finalTextContents); - } - - std::list lines; - std::string line; - for(int i = 0; i < (int)finalTextContents.size(); i++) { - char c = finalTextContents.at(i); - if(c == '\n') { - lines.push_back(line); - line.clear(); - } else { - line += c; - } - } - if (!line.empty()) { - lines.push_back(line); - } - - for(std::list::iterator it = lines.begin(); it != lines.end(); ++it) { - SDL_Surface* lineSurf = TTF_RenderText_Shaded(font, it->c_str(), colour, bgColour); - - int linePixelWidth; - int linePixelHeight; - TTF_SizeText(font, it->c_str(), &linePixelWidth, &linePixelHeight); - - if(linePixelWidth > w) { - w = linePixelWidth; - } - - h += linePixelHeight + lineSpacing; - - _lines.push_back(lineSurf); - } - - return 1; -} - -int Text::SetTextShaded(string textArg, textSizes_t size, Uint8 rF, Uint8 gF, Uint8 bF, Uint8 rB, Uint8 gB, Uint8 bB, bool wordWrap) { - SDL_Color f = { rF, gF, bF }; - SDL_Color b = { rB, gB, bB }; - return SetTextShaded(textArg, size, f, b, wordWrap); -} - -void Text::Render(void) { - int yOffset = 0; - for(std::list::iterator it = _lines.begin(); it != _lines.end(); ++it) { - SDL_Surface* lineSurf = *it; - ApplySurface(x, y + yOffset, lineSurf, screen); - yOffset += lineSurf->h + lineSpacing; - } -} - -void Text::Render(int xArg, int yArg) { - int yOffset = 0; - for(std::list::iterator it = _lines.begin(); it != _lines.end(); ++it) { - SDL_Surface* lineSurf = *it; - ApplySurface(x + xArg, y + yArg + yOffset, lineSurf, screen); - yOffset += lineSurf->h + lineSpacing; - } -} - -void Text::RenderLiteral(void) { - int yOffset = 0; - for(std::list::iterator it = _lines.begin(); it != _lines.end(); ++it) { - SDL_Surface* lineSurf = *it; - ApplySurfaceLiteral(x, y + yOffset, lineSurf, screen); - yOffset += lineSurf->h + lineSpacing; - } -} - -void Text::RenderLiteral(int xArg, int yArg) { - int yOffset = 0; - for(std::list::iterator it = _lines.begin(); it != _lines.end(); ++it) { - SDL_Surface* lineSurf = *it; - ApplySurfaceLiteral(x + xArg, y + yArg + yOffset, lineSurf, screen); - yOffset += lineSurf->h + lineSpacing; - } -} - -std::string Text::DoWordWrap(TTF_Font* fontArg, const std::string& textArg) { - int leftSpace = lineWidth; - - char* tokenizedText = strdup(textArg.c_str()); - char* tokenizedTextOrigin = tokenizedText; - - std::string wrappedText(textArg); - int offsetInWrappedText = 0; - - int spaceWidth; - TTF_SizeText(fontArg, " ", &spaceWidth, NULL); - - char* word = strtok(tokenizedText, " "); - - while(word) { - int wordWidth; - TTF_SizeText(fontArg, word, &wordWidth, NULL); - - if ((wordWidth + spaceWidth) > leftSpace) { - wrappedText.insert((word - tokenizedTextOrigin) + offsetInWrappedText, "\n"); - offsetInWrappedText++; - - leftSpace = lineWidth - wordWidth; - } else { - leftSpace -= wordWidth + spaceWidth; - } - - word = strtok(NULL, " "); - } - - // delete[] tokenizedText; - - return wrappedText; -} diff --git a/src/libUnuk/Text.h b/src/libUnuk/Text.h deleted file mode 100644 index 395de51..0000000 --- a/src/libUnuk/Text.h +++ /dev/null @@ -1,62 +0,0 @@ -#pragma once -#include -#include -#include -#include - -#include "../Unuk/Globals.h" -#include "ApplySurface.h" -#include "Font.h" -#include "Debug.h" -using namespace std; - -enum textSizes_t { vsmall, small, medium, large, vlarge }; - -class Text { -public: - Text(void); - ~Text(void); - - static void LoadFonts(void); - static void FreeFonts(void); - - int GetWidth(void) { return w; } - int GetHeight(void) { return h; } - int GetX(void) { return x; } - int GetY(void) { return y; } - - SDL_Color GetColour(void) { return _textColour; } - - void SetXY(int xArg, int yArg); - - int GetLineWidth() { return lineWidth; } - void SetLineWidth(int lineWidthArg) { lineWidth = lineWidthArg; } - - int SetTextBlended(string textArg, textSizes_t size, SDL_Color, bool wordWrap=false); - int SetTextBlended(string textArg, textSizes_t size, Uint8 r, Uint8 g, Uint8 b, bool wordWrap=false); - int SetTextShaded(string textArg, textSizes_t size, SDL_Color, SDL_Color, bool wordWrap=false); - int SetTextShaded(string textArg, textSizes_t size, Uint8 rF, Uint8 gF, Uint8 bF, Uint8 rB, Uint8 gB, Uint8 bB, bool wordWrap=false); - - string GetText(void) { return _textContents; } - - void Render(void); - void Render(int xArg, int yArg); - void RenderLiteral(void); - void RenderLiteral(int xArg, int yArg); - -private: - int x, y, w, h; - int lineWidth; - - string _textContents; - SDL_Color _textColour; - std::list _lines; - - std::string DoWordWrap(TTF_Font* fontArg, const std::string& textArg); - - static TTF_Font* vSmallFont; - static TTF_Font* smallFont; - static TTF_Font* mediumFont; - static TTF_Font* largeFont; - static TTF_Font* vLargeFont; -}; diff --git a/src/libUnuk/Texture.cpp b/src/libUnuk/Texture.cpp deleted file mode 100644 index 5a0a11c..0000000 --- a/src/libUnuk/Texture.cpp +++ /dev/null @@ -1,53 +0,0 @@ -#include "Texture.h" - -Texture::Texture(void) { - _texture = NULL; -} - -Texture::~Texture(void) { - assert(_texture != NULL); - SDL_FreeSurface(_texture); -} - -void Texture::SetXY(int xArg, int yArg) { - x = xArg; - y = yArg; -} - -void Texture::Render(void) { - ApplySurface(x, y, _texture, screen); -} - -void Texture::Render(int xArg, int yArg) { - ApplySurface(xArg, yArg, _texture, screen); -} - -void Texture::RenderLiteral(void) { - ApplySurfaceLiteral(x, y, _texture, screen); -} - -void Texture::RenderLiteral(int xArg, int yArg) { - ApplySurfaceLiteral(xArg, yArg,_texture, screen); -} - -void Texture::Load(const char* filename) { - if(_texture != NULL) { - // Free the texture. - SDL_FreeSurface(_texture); - } - // Load the texture. - _texture = LoadImage(filename); -} - -void Texture::LoadAlpha(const char* filename) { - if(_texture != NULL) { - // Free the texture. - SDL_FreeSurface(_texture); - } - // Load the texture with an alpha channel. - _texture = LoadImageAlpha(filename); -} - -void Texture::SetAlpha(int alphaArg) { - SDL_SetAlpha(_texture, SDL_SRCALPHA, (Uint8)alphaArg); -} diff --git a/src/libUnuk/Texture.h b/src/libUnuk/Texture.h deleted file mode 100644 index 7af9efe..0000000 --- a/src/libUnuk/Texture.h +++ /dev/null @@ -1,33 +0,0 @@ -#pragma once -#include "../Unuk/Globals.h" -#include "ImageLoader.h" -#include "ApplySurface.h" - -class Texture { -public: - Texture(void); - ~Texture(void); - - int GetWidth(void) { return _texture->w; } - int GetHeight(void) { return _texture->h; } - int GetX(void) { return x; } - int GetY(void) { return y; } - - void SetXY(int xArg, int yArg); - - void Render(void); - void Render(int xArg, int yArg); - - void RenderLiteral(void); - void RenderLiteral(int xArg, int yArg); - - void Load(const char* filename); - void LoadAlpha(const char* filename); - void SetAlpha(int alphaArg); - -protected: - int x, y; - -private: - SDL_Surface* _texture; -}; diff --git a/src/libUnuk/TextureManager.cpp b/src/libUnuk/TextureManager.cpp deleted file mode 100644 index 8089c1d..0000000 --- a/src/libUnuk/TextureManager.cpp +++ /dev/null @@ -1,55 +0,0 @@ -#include "TextureManager.h" - -TextureManager::TextureManager(void) { - _allocated = 0; -} - -TextureManager::~TextureManager(void) { - Unload(); -} - -void TextureManager::Unload(void) { - for(int i = 0; i < _allocated; i++) { - SDL_FreeSurface(_textures[i].texture); - _textures[i].name.clear(); - } - _allocated = 0; -} - -SDL_Surface* TextureManager::Add(string filename) { - assert(_allocated < TEXTURE_ARR_SIZE - 1); - - // Has the texture been loaded already? - for(int i = 0; i < _allocated; i++) { - if(_textures[i].name == filename) { - return _textures[i].texture; - } - } - // If not, then load it. - _textures[_allocated].name = filename; - _textures[_allocated].texture = LoadImage(filename.c_str()); - - _allocated++; - - return _textures[_allocated - 1].texture; -} - -SDL_Surface* TextureManager::AddAlpha(string filename) { - assert(_allocated < TEXTURE_ARR_SIZE - 1); - - // Has the texture been loaded already? - for(int i = 0; i < _allocated; i++) { - if(_textures[i].name == filename) { - return _textures[i].texture; - } - } - - // If not, then load it. - - _textures[_allocated].name = filename; - _textures[_allocated].texture = LoadImageAlpha(filename.c_str()); - - _allocated++; - - return _textures[_allocated -1].texture; -} diff --git a/src/libUnuk/TextureManager.h b/src/libUnuk/TextureManager.h deleted file mode 100644 index a12a96c..0000000 --- a/src/libUnuk/TextureManager.h +++ /dev/null @@ -1,39 +0,0 @@ -#pragma once - -/* - * The Texture Manager will keep a small "Database" - * of the name of the texture that is loaded and the - * actual texture so we can query it with the filename - * and it will return the teture if it is already in memory - * or load the tture if it is not. - */ - -#include -#include -#include -#include "ImageLoader.h" -using namespace std; - -class TextureManager { -public: - TextureManager(void); - ~TextureManager(void); - - void Unload(void); - - SDL_Surface* Add(string filename); - SDL_Surface* AddAlpha(string filename); - -private: - // The textureNode will hold the name and the texture. - struct textureNode { - SDL_Surface* texture; - string name; - }; - - // We should not need more than a hundred.. - static const int TEXTURE_ARR_SIZE = 100; - textureNode _textures[TEXTURE_ARR_SIZE]; - - int _allocated; -}; diff --git a/src/libUnuk/Timer.cpp b/src/libUnuk/Timer.cpp deleted file mode 100644 index 6b4f383..0000000 --- a/src/libUnuk/Timer.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "Timer.h" - -Timer::Timer(void) { - _startTicks = 0; - _pausedTicks = 0; - _paused = false; - _started = false; -} - -Timer::~Timer(void) { -} - -void Timer::Start(void) { - _paused = false; - _started = true; - _startTicks = SDL_GetTicks(); -} - -void Timer::Stop(void) { - _paused = false; - _started = true; -} - -void Timer::Pause(void) { - assert(_paused == false); - _paused = true; - - _pausedTicks = SDL_GetTicks() - _startTicks; -} - -void Timer::Unpause(void) { - assert(_paused == true); - _paused = false; - - _startTicks = SDL_GetTicks() - _pausedTicks; - - _pausedTicks = 0; -} - -int Timer::GetTicks(void) { - if(_paused == true) - return _pausedTicks; - else if(_started == true) - return SDL_GetTicks() - _startTicks; - else - return 0; -} - -string Timer::GetTicksStr(void) { - stringstream str; - str << GetTicks() << "ms"; - - return str.str(); -} diff --git a/src/libUnuk/Timer.h b/src/libUnuk/Timer.h deleted file mode 100644 index d0d51b1..0000000 --- a/src/libUnuk/Timer.h +++ /dev/null @@ -1,31 +0,0 @@ -#pragma once -#include -#include -#include -#include -using namespace std; - -class Timer { -public: - Timer(void); - ~Timer(void); - - void Pause(void); - void Unpause(void); - void Start(void); - void Stop(void); - - bool IsPaused(void) { return _paused; } - bool IsStarted(void) { return _started; } - - int GetTicks(void); - - string GetTicksStr(void); - -private: - bool _paused; - bool _started; - - int _startTicks; - int _pausedTicks; -}; diff --git a/src/libUnuk/WorldManager.cpp b/src/libUnuk/WorldManager.cpp deleted file mode 100644 index af23a6b..0000000 --- a/src/libUnuk/WorldManager.cpp +++ /dev/null @@ -1,54 +0,0 @@ -#include "WorldManager.h" -#include "NPC.h" - -WorldManager::WorldManager(void) { -} - -WorldManager::~WorldManager(void) { - for(std::list::iterator i = _npcs.begin(); i != _npcs.end(); ++i) { - NPC* npc = (*i); - delete npc; - } -} - -void WorldManager::Update(void) { - for(std::list::iterator i = _npcs.begin(); i != _npcs.end(); ++i) { - NPC* npc = (*i); - npc->Update(); - } -} - -void WorldManager::Render(void) { - for(std::list::iterator i = _npcs.begin(); i != _npcs.end(); ++i) { - NPC* npc = (*i); - npc->Render(); - } -} - -void WorldManager::AddNPC(NPC* npc) { - _npcs.push_back(npc); -} - -void WorldManager::RemoveNPC(int index) { - int npcsIndex = 0; - for(std::list::iterator i = _npcs.begin(); i != _npcs.end(); ++i) { - NPC* npc = (*i); - if(npcsIndex == index) { - _npcs.erase(i); - delete npc; - } - npcsIndex++; - } -} - -NPC* WorldManager::GetNPC(int index) { - int npcsIndex = 0; - for(std::list::iterator i = _npcs.begin(); i != _npcs.end(); ++i) { - NPC* npc = (*i); - if(npcsIndex == index) { - return npc; - } - npcsIndex++; - } - return NULL; -} diff --git a/src/libUnuk/WorldManager.h b/src/libUnuk/WorldManager.h deleted file mode 100644 index 466571c..0000000 --- a/src/libUnuk/WorldManager.h +++ /dev/null @@ -1,20 +0,0 @@ -#pragma once -#include - -class NPC; - -class WorldManager { -public: - WorldManager(void); - ~WorldManager(void); - - void Update(void); - void Render(void); - - void AddNPC(NPC* npc); - void RemoveNPC(int index); - NPC* GetNPC(int index); - -private: - std::list _npcs; -};