[Add] New character sheets from Moosader - Not final.
[Change] Re-structured Map stuff a little.
This commit is contained in:
parent
1aa2c4246e
commit
a7e2891d89
10
Bin/Makefile
10
Bin/Makefile
@ -9,13 +9,13 @@ default: all
|
||||
|
||||
all:
|
||||
$(MAKE) -C ../src/libUnuk/Engine
|
||||
$(MAKE) -C ../src/libUnuk/Map
|
||||
$(MAKE) -C ../src/libUnuk/LevelGen
|
||||
$(MAKE) -C ../src/libUnuk/Sprite
|
||||
$(MAKE) -C ../src/libUnuk/System
|
||||
$(MAKE) -C ../src/libUnuk/UI
|
||||
$(MAKE) -C ../src/Unuk
|
||||
|
||||
$(CC) $(CFLAGS) -o Unuk ../src/Unuk/main.cpp ../src/libUnuk/Engine/*.o ../src/libUnuk/Map/*.o \
|
||||
$(CC) $(CFLAGS) -o Unuk ../src/Unuk/main.cpp ../src/libUnuk/Engine/*.o ../src/libUnuk/LevelGen/*.o \
|
||||
../src/libUnuk/Sprite/*.o ../src/libUnuk/System/*.o ../src/libUnuk/UI/*.o \
|
||||
../src/Unuk/*.o $(LDADD)
|
||||
|
||||
@ -23,19 +23,19 @@ static:
|
||||
@echo -e "\033[1;31mThis is an experimental build, if it does not work, don't complain...\033[0m"
|
||||
@sleep 1
|
||||
$(MAKE) -C ../src/libUnuk/Engine
|
||||
$(MAKE) -C ../src/libUnuk/Map
|
||||
$(MAKE) -C ../src/libUnuk/LevelGen
|
||||
$(MAKE) -C ../src/libUnuk/Sprite
|
||||
$(MAKE) -C ../src/libUnuk/System
|
||||
$(MAKE) -C ../src/libUnuk/UI
|
||||
$(MAKE) -C ../src/Unuk
|
||||
|
||||
$(CC) $(CFLAGS) -o build/Unuk-static ../src/Unuk/main.cpp ../src/libUnuk/Engine/*.o ..src/libUnuk/Map/*.o \
|
||||
$(CC) $(CFLAGS) -o build/Unuk-static ../src/Unuk/main.cpp ../src/libUnuk/Engine/*.o ..src/libUnuk/LevelGen/*.o \
|
||||
../src/libUnuk/Sprite/*.o ../src/libUnuk/System/*.o ../src/libUnuk/UI/*.o \
|
||||
../src/Unuk/*.o $(LDADDSTATIC)
|
||||
|
||||
clean:
|
||||
$(MAKE) -C ../src/libUnuk/Engine clean
|
||||
$(MAKE) -C ../src/libUnuk/Map clean
|
||||
$(MAKE) -C ../src/libUnuk/LevelGen clean
|
||||
$(MAKE) -C ../src/libUnuk/Sprite clean
|
||||
$(MAKE) -C ../src/libUnuk/System clean
|
||||
$(MAKE) -C ../src/libUnuk/UI clean
|
||||
|
BIN
Data/Media/Images/Characters/Player.png
Normal file
BIN
Data/Media/Images/Characters/Player.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.9 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 3.9 KiB |
152
Unuk-QT/Makefile
152
Unuk-QT/Makefile
@ -1,6 +1,6 @@
|
||||
#############################################################################
|
||||
# Makefile for building: Unuk-QT
|
||||
# Generated by qmake (2.01a) (Qt 4.7.3) on: Sat Jan 14 13:52:16 2012
|
||||
# Generated by qmake (2.01a) (Qt 4.7.3) on: Sat Jan 14 18:40:02 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
|
||||
@ -50,9 +50,6 @@ SOURCES = ../src/libUnuk/Engine/WorldManager.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 \
|
||||
@ -74,7 +71,8 @@ SOURCES = ../src/libUnuk/Engine/WorldManager.cpp \
|
||||
../src/Unuk/Globals.cpp \
|
||||
../src/Unuk/Game.cpp \
|
||||
../src/libUnuk/LevelGen/LevelGen.cpp \
|
||||
../src/libUnuk/LevelGen/Level.cpp
|
||||
../src/libUnuk/LevelGen/MapEntities.cpp \
|
||||
../src/libUnuk/LevelGen/MapElement.cpp
|
||||
OBJECTS = WorldManager.o \
|
||||
ParticleEmitter.o \
|
||||
NPC.o \
|
||||
@ -82,9 +80,6 @@ OBJECTS = WorldManager.o \
|
||||
Collision.o \
|
||||
Character.o \
|
||||
AStar.o \
|
||||
MapEntities.o \
|
||||
MapElement.o \
|
||||
Map.o \
|
||||
TextureManager.o \
|
||||
Texture.o \
|
||||
ImageLoader.o \
|
||||
@ -106,7 +101,8 @@ OBJECTS = WorldManager.o \
|
||||
Globals.o \
|
||||
Game.o \
|
||||
LevelGen.o \
|
||||
Level.o
|
||||
MapEntities.o \
|
||||
MapElement.o
|
||||
DIST = /usr/share/qt4/mkspecs/common/g++.conf \
|
||||
/usr/share/qt4/mkspecs/common/unix.conf \
|
||||
/usr/share/qt4/mkspecs/common/linux.conf \
|
||||
@ -206,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/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 ../src/libUnuk/LevelGen/LevelGen.h ../src/libUnuk/LevelGen/Level.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 ../src/libUnuk/LevelGen/LevelGen.cpp ../src/libUnuk/LevelGen/Level.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/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 ../src/libUnuk/LevelGen/LevelGen.h ../src/libUnuk/LevelGen/MapEntities.h ../src/libUnuk/LevelGen/MapElement.h ../src/libUnuk/LevelGen/MapTile.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/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 ../src/libUnuk/LevelGen/LevelGen.cpp ../src/libUnuk/LevelGen/MapEntities.cpp ../src/libUnuk/LevelGen/MapElement.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
|
||||
@ -259,11 +255,11 @@ WorldManager.o: ../src/libUnuk/Engine/WorldManager.cpp ../src/libUnuk/Engine/Wor
|
||||
../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/LevelGen/LevelGen.h \
|
||||
../src/libUnuk/LevelGen/MapTile.h \
|
||||
../src/libUnuk/LevelGen/MapElement.h \
|
||||
../src/libUnuk/Sprite/TextureManager.h \
|
||||
../src/libUnuk/Map/MapEntities.h \
|
||||
../src/libUnuk/LevelGen/MapEntities.h \
|
||||
../src/libUnuk/System/Timer.h \
|
||||
../src/libUnuk/UI/Text.h \
|
||||
../src/libUnuk/UI/Font.h \
|
||||
@ -288,11 +284,11 @@ NPC.o: ../src/libUnuk/Engine/NPC.cpp ../src/libUnuk/Engine/NPC.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/LevelGen/LevelGen.h \
|
||||
../src/libUnuk/LevelGen/MapTile.h \
|
||||
../src/libUnuk/LevelGen/MapElement.h \
|
||||
../src/libUnuk/Sprite/TextureManager.h \
|
||||
../src/libUnuk/Map/MapEntities.h \
|
||||
../src/libUnuk/LevelGen/MapEntities.h \
|
||||
../src/libUnuk/Engine/WorldManager.h \
|
||||
../src/libUnuk/System/Timer.h \
|
||||
../src/libUnuk/UI/Text.h \
|
||||
@ -317,11 +313,11 @@ Character.o: ../src/libUnuk/Engine/Character.cpp ../src/libUnuk/Engine/Character
|
||||
../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/LevelGen/LevelGen.h \
|
||||
../src/libUnuk/LevelGen/MapTile.h \
|
||||
../src/libUnuk/LevelGen/MapElement.h \
|
||||
../src/libUnuk/Sprite/TextureManager.h \
|
||||
../src/libUnuk/Map/MapEntities.h \
|
||||
../src/libUnuk/LevelGen/MapEntities.h \
|
||||
../src/libUnuk/Engine/WorldManager.h \
|
||||
../src/libUnuk/System/Timer.h \
|
||||
../src/libUnuk/UI/Text.h \
|
||||
@ -332,46 +328,6 @@ 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 \
|
||||
@ -437,12 +393,12 @@ MainMenu.o: ../src/libUnuk/UI/MainMenu.cpp ../src/libUnuk/UI/MainMenu.h \
|
||||
../src/libUnuk/System/Rect.h \
|
||||
../src/libUnuk/Engine/MemClass.h \
|
||||
../src/libUnuk/Engine/MemManager.h \
|
||||
../src/libUnuk/Map/Map.h \
|
||||
../src/libUnuk/LevelGen/LevelGen.h \
|
||||
../src/libUnuk/Sprite/ImageLoader.h \
|
||||
../src/libUnuk/Map/MapTile.h \
|
||||
../src/libUnuk/Map/MapElement.h \
|
||||
../src/libUnuk/LevelGen/MapTile.h \
|
||||
../src/libUnuk/LevelGen/MapElement.h \
|
||||
../src/libUnuk/Sprite/TextureManager.h \
|
||||
../src/libUnuk/Map/MapEntities.h \
|
||||
../src/libUnuk/LevelGen/MapEntities.h \
|
||||
../src/libUnuk/Engine/WorldManager.h
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o MainMenu.o ../src/libUnuk/UI/MainMenu.cpp
|
||||
|
||||
@ -510,11 +466,11 @@ Player.o: ../src/Unuk/Player.cpp ../src/Unuk/Player.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/LevelGen/LevelGen.h \
|
||||
../src/libUnuk/LevelGen/MapTile.h \
|
||||
../src/libUnuk/LevelGen/MapElement.h \
|
||||
../src/libUnuk/Sprite/TextureManager.h \
|
||||
../src/libUnuk/Map/MapEntities.h \
|
||||
../src/libUnuk/LevelGen/MapEntities.h \
|
||||
../src/libUnuk/Engine/WorldManager.h \
|
||||
../src/libUnuk/System/Timer.h \
|
||||
../src/libUnuk/UI/Text.h \
|
||||
@ -536,12 +492,12 @@ main.o: ../src/Unuk/main.cpp ../src/libUnuk/UI/MainMenu.h \
|
||||
../src/libUnuk/System/Rect.h \
|
||||
../src/libUnuk/Engine/MemClass.h \
|
||||
../src/libUnuk/Engine/MemManager.h \
|
||||
../src/libUnuk/Map/Map.h \
|
||||
../src/libUnuk/LevelGen/LevelGen.h \
|
||||
../src/libUnuk/Sprite/ImageLoader.h \
|
||||
../src/libUnuk/Map/MapTile.h \
|
||||
../src/libUnuk/Map/MapElement.h \
|
||||
../src/libUnuk/LevelGen/MapTile.h \
|
||||
../src/libUnuk/LevelGen/MapElement.h \
|
||||
../src/libUnuk/Sprite/TextureManager.h \
|
||||
../src/libUnuk/Map/MapEntities.h \
|
||||
../src/libUnuk/LevelGen/MapEntities.h \
|
||||
../src/libUnuk/Engine/WorldManager.h \
|
||||
../src/libUnuk/Engine/NPC.h \
|
||||
../src/libUnuk/Engine/Character.h \
|
||||
@ -568,11 +524,11 @@ Game.o: ../src/Unuk/Game.cpp ../src/Unuk/Game.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/LevelGen/LevelGen.h \
|
||||
../src/libUnuk/LevelGen/MapTile.h \
|
||||
../src/libUnuk/LevelGen/MapElement.h \
|
||||
../src/libUnuk/Sprite/TextureManager.h \
|
||||
../src/libUnuk/Map/MapEntities.h \
|
||||
../src/libUnuk/LevelGen/MapEntities.h \
|
||||
../src/libUnuk/Engine/WorldManager.h \
|
||||
../src/libUnuk/System/Timer.h \
|
||||
../src/libUnuk/UI/Text.h \
|
||||
@ -588,11 +544,45 @@ Game.o: ../src/Unuk/Game.cpp ../src/Unuk/Game.h \
|
||||
../src/libUnuk/Engine/AStarBase.h
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o Game.o ../src/Unuk/Game.cpp
|
||||
|
||||
LevelGen.o: ../src/libUnuk/LevelGen/LevelGen.cpp ../src/libUnuk/LevelGen/LevelGen.h
|
||||
LevelGen.o: ../src/libUnuk/LevelGen/LevelGen.cpp ../src/libUnuk/LevelGen/LevelGen.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/LevelGen/MapTile.h \
|
||||
../src/libUnuk/LevelGen/MapElement.h \
|
||||
../src/libUnuk/Sprite/TextureManager.h \
|
||||
../src/libUnuk/LevelGen/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 LevelGen.o ../src/libUnuk/LevelGen/LevelGen.cpp
|
||||
|
||||
Level.o: ../src/libUnuk/LevelGen/Level.cpp ../src/libUnuk/LevelGen/Level.h
|
||||
$(CXX) -c $(CXXFLAGS) $(INCPATH) -o Level.o ../src/libUnuk/LevelGen/Level.cpp
|
||||
MapEntities.o: ../src/libUnuk/LevelGen/MapEntities.cpp ../src/libUnuk/LevelGen/MapEntities.h \
|
||||
../src/libUnuk/LevelGen/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/LevelGen/MapEntities.cpp
|
||||
|
||||
MapElement.o: ../src/libUnuk/LevelGen/MapElement.cpp ../src/libUnuk/LevelGen/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/LevelGen/MapElement.cpp
|
||||
|
||||
####### Install
|
||||
|
||||
|
@ -16,10 +16,6 @@ HEADERS += ../src/Libs/wglext.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 \
|
||||
@ -41,7 +37,9 @@ HEADERS += ../src/Libs/wglext.h \
|
||||
../src/Unuk/Constants.h \
|
||||
../src/Unuk/Player.h \
|
||||
../src/libUnuk/LevelGen/LevelGen.h \
|
||||
../src/libUnuk/LevelGen/Level.h
|
||||
../src/libUnuk/LevelGen/MapEntities.h \
|
||||
../src/libUnuk/LevelGen/MapElement.h \
|
||||
../src/libUnuk/LevelGen/MapTile.h
|
||||
SOURCES += ../src/libUnuk/Engine/WorldManager.cpp \
|
||||
../src/libUnuk/Engine/ParticleEmitter.cpp \
|
||||
../src/libUnuk/Engine/NPC.cpp \
|
||||
@ -49,9 +47,6 @@ SOURCES += ../src/libUnuk/Engine/WorldManager.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 \
|
||||
@ -73,5 +68,6 @@ SOURCES += ../src/libUnuk/Engine/WorldManager.cpp \
|
||||
../src/Unuk/Globals.cpp \
|
||||
../src/Unuk/Game.cpp \
|
||||
../src/libUnuk/LevelGen/LevelGen.cpp \
|
||||
../src/libUnuk/LevelGen/Level.cpp
|
||||
../src/libUnuk/LevelGen/MapEntities.cpp \
|
||||
../src/libUnuk/LevelGen/MapElement.cpp
|
||||
OTHER_FILES +=
|
||||
|
@ -17,7 +17,7 @@ Game::~Game(void) {
|
||||
|
||||
gameNavVal_t Game::Run(const string savegameIDArg) {
|
||||
_player->SetXY(50, 50);
|
||||
_player->LoadSprites("../Data/Media/Images/Characters/template.png", 40, 45);
|
||||
_player->LoadSprites("../Data/Media/Images/Characters/Player.png", 40, 45);
|
||||
|
||||
LoadSavegame(savegameIDArg);
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "Globals.h"
|
||||
#include "Player.h"
|
||||
#include "../libUnuk/UI/IngameMenu.h"
|
||||
#include "../libUnuk/Map/Map.h"
|
||||
#include "../libUnuk/LevelGen/LevelGen.h"
|
||||
#include "../libUnuk/System/Timer.h"
|
||||
#include "../libUnuk/System/Debug.h"
|
||||
#include "../libUnuk/UI/Text.h"
|
||||
@ -53,7 +53,7 @@ private:
|
||||
Text _npcHealth;
|
||||
|
||||
IngameMenu _ingameMenu;
|
||||
Map _map;
|
||||
LevelGen _map;
|
||||
|
||||
Player* _player;
|
||||
};
|
||||
|
@ -3,7 +3,7 @@
|
||||
// Pixels * 60 / sec.
|
||||
const float Player::PLAYER_SPEED = Character::CHARACTER_SPEED + 0.5f;
|
||||
|
||||
Player::Player(Map *mapArg) : Character(mapArg) {
|
||||
Player::Player(LevelGen *mapArg) : Character(mapArg) {
|
||||
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
class Player : public Character {
|
||||
public:
|
||||
Player(Map* mapArg);
|
||||
Player(LevelGen* mapArg);
|
||||
~Player(void);
|
||||
|
||||
void HandleInput(void);
|
||||
|
@ -6,7 +6,7 @@ const float Character::CHARACTER_SPEED = 3.5f;
|
||||
static list<Character*>collisionList;
|
||||
static list<Character*>::iterator collisionIter;
|
||||
|
||||
Character::Character(Map* mapArg) {
|
||||
Character::Character(LevelGen* mapArg) {
|
||||
map = mapArg;
|
||||
attacking = false;
|
||||
directionFacing = FACING_DOWN;
|
||||
|
@ -9,17 +9,17 @@
|
||||
#include "../Sprite/ApplySurface.h"
|
||||
#include "../Sprite/ImageLoader.h"
|
||||
#include "../Engine/Collision.h"
|
||||
#include "../Map/Map.h"
|
||||
#include "../LevelGen/LevelGen.h"
|
||||
#include "../System/Timer.h"
|
||||
#include "../UI/Text.h"
|
||||
#include "../System/Debug.h"
|
||||
using namespace std;
|
||||
|
||||
class Map;
|
||||
class LevelGen;
|
||||
|
||||
class Character {
|
||||
public:
|
||||
Character(Map* mapArg);
|
||||
Character(LevelGen* mapArg);
|
||||
~Character(void);
|
||||
|
||||
void LoadSprites(string filename, int wArg, int hArg);
|
||||
@ -88,7 +88,7 @@ protected:
|
||||
|
||||
int _health;
|
||||
|
||||
Map* map;
|
||||
LevelGen* map;
|
||||
|
||||
static const float CHARACTER_SPEED;
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
#include "NPC.h"
|
||||
|
||||
NPC::NPC(Map* mapArg) : Character(mapArg) {
|
||||
NPC::NPC(LevelGen* mapArg) : Character(mapArg) {
|
||||
_moveTimer.Start();
|
||||
|
||||
_moveChangeFrequency = 14000;
|
||||
|
@ -5,7 +5,7 @@
|
||||
|
||||
class NPC : public Character {
|
||||
public:
|
||||
NPC(Map* mapArg);
|
||||
NPC(LevelGen* mapArg);
|
||||
~NPC(void);
|
||||
|
||||
void Update(void);
|
||||
|
@ -1,9 +0,0 @@
|
||||
#include "Level.h"
|
||||
|
||||
Level::Level(void) {
|
||||
|
||||
}
|
||||
|
||||
Level::~Level(void) {
|
||||
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
class Level {
|
||||
public:
|
||||
Level(void);
|
||||
~Level(void);
|
||||
|
||||
private:
|
||||
|
||||
};
|
@ -1,4 +1,5 @@
|
||||
#include "LevelGen.h"
|
||||
#include "../Engine/NPC.h"
|
||||
|
||||
LevelGen::LevelGen(void) {
|
||||
|
||||
@ -7,3 +8,244 @@ LevelGen::LevelGen(void) {
|
||||
LevelGen::~LevelGen(void) {
|
||||
|
||||
}
|
||||
|
||||
void LevelGen::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 text files.
|
||||
TiXmlElement* rootElem = NULL;
|
||||
TiXmlElement* lineElem = NULL;
|
||||
TiXmlElement* tileElem = NULL;
|
||||
TiXmlElement* dataElem = NULL;
|
||||
|
||||
x = -1;
|
||||
y = -1;
|
||||
|
||||
// <map> - Let's start parsing the map.
|
||||
rootElem = mapFile.FirstChildElement("map");
|
||||
assert(rootElem != NULL);
|
||||
if(rootElem) {
|
||||
// <line> - 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;
|
||||
|
||||
// <tile> - 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);
|
||||
|
||||
// <tileTexture> - 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()));
|
||||
// <tileTexture> - Finished applying the texture, move to the next sibling.
|
||||
|
||||
// <solidTile> - 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);
|
||||
// </solidTile>
|
||||
|
||||
// <entityTexture>
|
||||
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);
|
||||
}
|
||||
// </entityTexture>
|
||||
|
||||
// <SolidEntity>
|
||||
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);
|
||||
// </solidEntity>
|
||||
|
||||
// <zlevel>
|
||||
dataElem = dataElem->NextSiblingElement("zLevel");
|
||||
assert(dataElem != NULL);
|
||||
_tile[x][y].SetZLevel(atoi(dataElem->GetText()));
|
||||
// </zlevel>
|
||||
|
||||
// <mapTransition>
|
||||
dataElem = dataElem->NextSiblingElement("mapTransition");
|
||||
assert(dataElem != NULL);
|
||||
_tile[x][y].SetMapTransitionName(dataElem->GetText());
|
||||
// </mapTransition>
|
||||
|
||||
// <mapTransX>
|
||||
dataElem = dataElem->NextSiblingElement("mapTransX");
|
||||
assert(dataElem != NULL);
|
||||
// int mapTransX = atoi(dataElem->GetText()); // not referenced
|
||||
// </mapTransX>
|
||||
|
||||
// <mapTransY>
|
||||
dataElem = dataElem->NextSiblingElement("mapTransY");
|
||||
assert(dataElem != NULL);
|
||||
// int mapTransY = atoi(dataElem->GetText()); // not referenced
|
||||
// </mapTransY>
|
||||
|
||||
tileElem = tileElem->NextSiblingElement("tile");
|
||||
}
|
||||
//</tile>
|
||||
|
||||
lineElem = lineElem->NextSiblingElement("line");
|
||||
}
|
||||
// </line>
|
||||
}
|
||||
// </map>
|
||||
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 LevelGen::Update(void) {
|
||||
_world.Update();
|
||||
// Update the map so we can render when camera moves.
|
||||
}
|
||||
|
||||
void LevelGen::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 LevelGen::Unload(void) {
|
||||
_tileTextures.Unload();
|
||||
_entityTextures.Unload();
|
||||
}
|
||||
|
||||
string LevelGen::GetCurrentMap(void) {
|
||||
return _currentMap;
|
||||
}
|
||||
|
||||
bool LevelGen::GetTileSolidity(int xArg, int yArg) {
|
||||
return _tile[xArg + 1][yArg + 1].GetTileSolidity();
|
||||
}
|
||||
|
||||
int LevelGen::GetTileX(int xArg, int yArg) {
|
||||
return _tile[xArg + 1][yArg + 1].GetTileX();
|
||||
}
|
||||
|
||||
int LevelGen::GetTileY(int xArg, int yArg) {
|
||||
return _tile[xArg + 1][yArg + 1].GetTileY();
|
||||
}
|
||||
|
||||
bool LevelGen::GetEntitySolidity(int xArg, int yArg) {
|
||||
if(xArg > x || yArg > y || yArg < 0 || yArg < 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return _tile[xArg + 1][yArg + 1].GetEntitySolitity();
|
||||
}
|
||||
|
||||
int LevelGen::GetEntityX(int xArg, int yArg) {
|
||||
return _tile[xArg + 1][yArg + 1].GetEntityX();
|
||||
}
|
||||
|
||||
int LevelGen::GetEntityY(int xArg, int yArg) {
|
||||
return _tile[xArg + 1][yArg + 1].GetEntityY();
|
||||
}
|
||||
|
||||
int LevelGen::GetEntityWidth(int xArg, int yArg) {
|
||||
return _tile[xArg + 1][yArg + 1].GetEntityWidth();
|
||||
}
|
||||
|
||||
int LevelGen::GetEntityHeight(int xArg, int yArg) {
|
||||
return _tile[xArg + 1][yArg + 1].GetEntityHeight();
|
||||
}
|
||||
|
||||
int LevelGen::GetTileZLevel(int xArg, int yArg) {
|
||||
return _tile[xArg + 1][yArg + 1].GetZLevel();
|
||||
}
|
||||
|
||||
string LevelGen::GetMapTransitionName(int xArg, int yArg) {
|
||||
return _tile[xArg + 1][yArg + 1].GetMapTransitionName();
|
||||
}
|
||||
|
||||
int LevelGen::GetMapTransitionX(int xArg, int yArg) {
|
||||
return _tile[xArg + 1][yArg + 1].GetMapTransitionX();
|
||||
}
|
||||
|
||||
int LevelGen::GetMapTransitionY(int xArg, int yArg) {
|
||||
return _tile[xArg + 1][yArg + 1].GetMapTransitionY();
|
||||
}
|
||||
|
@ -1,10 +1,62 @@
|
||||
#pragma once
|
||||
#include <SDL/SDL.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <assert.h>
|
||||
#include <tinyxml.h>
|
||||
|
||||
#include "../../Unuk/Globals.h"
|
||||
#include "../../Unuk/Constants.h"
|
||||
#include "../Sprite/ImageLoader.h"
|
||||
#include "../Sprite/ApplySurface.h"
|
||||
#include "../LevelGen/MapTile.h"
|
||||
#include "../System/Debug.h"
|
||||
#include "../Engine/WorldManager.h"
|
||||
using namespace std;
|
||||
|
||||
class LevelGen {
|
||||
public:
|
||||
LevelGen(void);
|
||||
~LevelGen(void);
|
||||
|
||||
private:
|
||||
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;
|
||||
};
|
||||
|
@ -5,8 +5,8 @@
|
||||
|
||||
#include "../../Unuk/Constants.h"
|
||||
#include "../Sprite/ApplySurface.h"
|
||||
#include "../Map/MapElement.h"
|
||||
#include "../Map/MapEntities.h"
|
||||
#include "../LevelGen/MapElement.h"
|
||||
#include "../LevelGen/MapEntities.h"
|
||||
using namespace std;
|
||||
|
||||
class MapTile {
|
@ -1,251 +0,0 @@
|
||||
#include "Map.h"
|
||||
#include "../Engine/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;
|
||||
|
||||
// <map> - Let's start parsing the map.
|
||||
rootElem = mapFile.FirstChildElement("map");
|
||||
assert(rootElem != NULL);
|
||||
if(rootElem) {
|
||||
// <line> - 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;
|
||||
|
||||
// <tile> - 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);
|
||||
|
||||
// <tileTexture> - 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()));
|
||||
// <tileTexture> - Finished applying the texture, move to the next sibling.
|
||||
|
||||
// <solidTile> - 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);
|
||||
// </solidTile>
|
||||
|
||||
// <entityTexture>
|
||||
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);
|
||||
}
|
||||
// </entityTexture>
|
||||
|
||||
// <SolidEntity>
|
||||
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);
|
||||
// </solidEntity>
|
||||
|
||||
// <zlevel>
|
||||
dataElem = dataElem->NextSiblingElement("zLevel");
|
||||
assert(dataElem != NULL);
|
||||
_tile[x][y].SetZLevel(atoi(dataElem->GetText()));
|
||||
// </zlevel>
|
||||
|
||||
// <mapTransition>
|
||||
dataElem = dataElem->NextSiblingElement("mapTransition");
|
||||
assert(dataElem != NULL);
|
||||
_tile[x][y].SetMapTransitionName(dataElem->GetText());
|
||||
// </mapTransition>
|
||||
|
||||
// <mapTransX>
|
||||
dataElem = dataElem->NextSiblingElement("mapTransX");
|
||||
assert(dataElem != NULL);
|
||||
// int mapTransX = atoi(dataElem->GetText()); // not referenced
|
||||
// </mapTransX>
|
||||
|
||||
// <mapTransY>
|
||||
dataElem = dataElem->NextSiblingElement("mapTransY");
|
||||
assert(dataElem != NULL);
|
||||
// int mapTransY = atoi(dataElem->GetText()); // not referenced
|
||||
// </mapTransY>
|
||||
|
||||
tileElem = tileElem->NextSiblingElement("tile");
|
||||
}
|
||||
//</tile>
|
||||
|
||||
lineElem = lineElem->NextSiblingElement("line");
|
||||
}
|
||||
// </line>
|
||||
}
|
||||
// </map>
|
||||
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();
|
||||
}
|
@ -1,64 +0,0 @@
|
||||
#pragma once
|
||||
#include <SDL/SDL.h>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <assert.h>
|
||||
#include <tinyxml.h>
|
||||
|
||||
#include "../../Unuk/Globals.h"
|
||||
#include "../../Unuk/Constants.h"
|
||||
#include "../Sprite/ImageLoader.h"
|
||||
#include "../Sprite/ApplySurface.h"
|
||||
#include "../Map/MapTile.h"
|
||||
#include "../System/Debug.h"
|
||||
#include "../Engine/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;
|
||||
};
|
@ -3,7 +3,7 @@
|
||||
#include "../../Unuk/Constants.h"
|
||||
#include "../System/FPS.h"
|
||||
#include "../UI/ButtonGroup.h"
|
||||
#include "../Map/Map.h"
|
||||
#include "../LevelGen/LevelGen.h"
|
||||
#include "../System/Rect.h"
|
||||
#include "../UI/Text.h"
|
||||
|
||||
@ -24,7 +24,7 @@ public:
|
||||
private:
|
||||
void Render(void);
|
||||
|
||||
Map _background;
|
||||
LevelGen _background;
|
||||
|
||||
Text lblMenu;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user