diff --git a/.gitignore b/.gitignore index 556537f..3fb8cc8 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,7 @@ Win32/Unuk/Unuk/*.user Win32/Unuk/Unuk.ncb Win32/Unuk/Unuk.suo Bin/*.dll +*.swp *.o *.exe *log diff --git a/Unuk-QT/Unuk-QT b/Unuk-QT/Unuk-QT deleted file mode 100755 index c6c0b85..0000000 Binary files a/Unuk-QT/Unuk-QT and /dev/null differ diff --git a/Unuk-QT/Unuk-QT.pro b/Unuk-QT/Unuk-QT.pro index 2449f2b..799c48b 100644 --- a/Unuk-QT/Unuk-QT.pro +++ b/Unuk-QT/Unuk-QT.pro @@ -39,7 +39,8 @@ HEADERS += ../src/libUnuk/Debug.h \ ../src/libUnuk/MapEntities.h \ ../src/libUnuk/FPS.h \ ../src/libUnuk/MemManager.h \ - ../src/libUnuk/MemClass.h + ../src/libUnuk/MemClass.h \ + ../src/libUnuk/Node.h SOURCES += ../src/libUnuk/Debug.cpp \ ../src/Unuk/main.cpp \ ../src/libUnuk/Input.cpp \ diff --git a/Unuk-QT/Unuk-QT.pro.user b/Unuk-QT/Unuk-QT.pro.user index 76a9ede..bd1c449 100644 --- a/Unuk-QT/Unuk-QT.pro.user +++ b/Unuk-QT/Unuk-QT.pro.user @@ -67,7 +67,7 @@ Debug - DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-ICZ0NvJNRS,guid=3b12f0647bd9cd4da4459e180000003d + DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-nnryLpuskH,guid=b1dc32eb5ce3f37b1b9bd14200000047 DISPLAY=:0 HOME=/home/allanis HUSHLOGIN=FALSE @@ -80,13 +80,13 @@ QTDIR=/usr/share/qt4 SHELL=/bin/bash SHLVL=1 - SSH_AGENT_PID=3260 - SSH_AUTH_SOCK=/tmp/ssh-lozFEJmg3235/agent.3235 + SSH_AGENT_PID=3398 + SSH_AUTH_SOCK=/tmp/ssh-LnbIeWkr3373/agent.3373 TERM=linux USER=allanis WINDOWPATH=7 XAUTHORITY=/home/allanis/.Xauthority - XDG_SESSION_COOKIE=6de6dd7b78e791242262c6460000012e-1323089410.422893-1130065724 + XDG_SESSION_COOKIE=6de6dd7b78e791242262c6460000012e-1325788236.314939-282202860 _=/usr/bin/startx @@ -106,7 +106,7 @@ Debug - DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-ICZ0NvJNRS,guid=3b12f0647bd9cd4da4459e180000003d + DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-nnryLpuskH,guid=b1dc32eb5ce3f37b1b9bd14200000047 DISPLAY=:0 HOME=/home/allanis HUSHLOGIN=FALSE @@ -119,13 +119,13 @@ QTDIR=/usr/share/qt4 SHELL=/bin/bash SHLVL=1 - SSH_AGENT_PID=3260 - SSH_AUTH_SOCK=/tmp/ssh-lozFEJmg3235/agent.3235 + SSH_AGENT_PID=3398 + SSH_AUTH_SOCK=/tmp/ssh-LnbIeWkr3373/agent.3373 TERM=linux USER=allanis WINDOWPATH=7 XAUTHORITY=/home/allanis/.Xauthority - XDG_SESSION_COOKIE=6de6dd7b78e791242262c6460000012e-1323089410.422893-1130065724 + XDG_SESSION_COOKIE=6de6dd7b78e791242262c6460000012e-1325788236.314939-282202860 _=/usr/bin/startx false diff --git a/src/Unuk/Game.cpp b/src/Unuk/Game.cpp index d33ca6a..9f86787 100644 --- a/src/Unuk/Game.cpp +++ b/src/Unuk/Game.cpp @@ -8,7 +8,8 @@ Game::Game(void) { } Game::~Game(void) { - delete _player; + // cleaning _player up caused a nice seg fault. I'll look later. + //delete _player; delete _npc; } diff --git a/src/libUnuk/AStar.cpp b/src/libUnuk/AStar.cpp new file mode 100644 index 0000000..085e4bc --- /dev/null +++ b/src/libUnuk/AStar.cpp @@ -0,0 +1,9 @@ +#include "AStar.h" + +AStar::AStar(void) { + +} + +AStar::~AStar(void) { + +} diff --git a/src/libUnuk/AStar.h b/src/libUnuk/AStar.h new file mode 100644 index 0000000..56099d0 --- /dev/null +++ b/src/libUnuk/AStar.h @@ -0,0 +1,10 @@ +#include + +class AStar { +public: + AStar(void); + ~AStar(void); + +private: + +}; diff --git a/src/libUnuk/Makefile b/src/libUnuk/Makefile index 04590cc..f93ea2d 100644 --- a/src/libUnuk/Makefile +++ b/src/libUnuk/Makefile @@ -4,7 +4,8 @@ LDADD = -lGL -lGLU -lSDL -lSDL_ttf -lSDL_gfx -lSDL_image -ltinyxml objects = ApplySurface.o Button.o ButtonToggle.o Character.o Collision.o \ Debug.o Font.o FPS.o ImageLoader.o IngameMenu.o Input.o MainMenu.o \ Map.o MapElement.o MapEntities.o NPC.o ParticleEmitter.o \ - Rect.o Text.o Texture.o TextureManager.o Timer.o \ + Rect.o Text.o Texture.o TextureManager.o Timer.o MemManager.o\ + AStar.o \ .PHONY: default all clean diff --git a/src/libUnuk/Node.h b/src/libUnuk/Node.h new file mode 100644 index 0000000..b3876ce --- /dev/null +++ b/src/libUnuk/Node.h @@ -0,0 +1,20 @@ +#ifndef _NODE_H_ +#define _NODE_H_ +#include +#include + +class Node { +public: + Node(int xArg, int yArg); + virtual ~Node(void); + + inline int GetX(void) const { return x; } + inline int GetY(void) const { return y; } + inline float GetCost(void) { return _cost; } + +private: + int x, y; + float _cost; +}; + +#endif diff --git a/src/libUnuk/Text.cpp b/src/libUnuk/Text.cpp index 08dc92b..f76861b 100644 --- a/src/libUnuk/Text.cpp +++ b/src/libUnuk/Text.cpp @@ -9,10 +9,10 @@ TTF_Font* Text::vLargeFont = NULL; const static int lineSpacing = 3; Text::Text(void) { - x=0; - y=0; - w=0; - h=0; + x = 0; + y = 0; + w = 0; + h = 0; lineWidth=50; } @@ -28,9 +28,9 @@ Text::~Text(void) { void Text::LoadFonts(void) { // Load the fonts if they are not already in memory. assert(vSmallFont == NULL); - assert(smallFont == NULL); + assert(smallFont == NULL); assert(mediumFont == NULL); - assert(largeFont == NULL); + assert(largeFont == NULL); assert(vLargeFont == NULL); vSmallFont = Font("../Data/Media/Fonts/Enigma_2.ttf", 16); @@ -43,9 +43,9 @@ void Text::LoadFonts(void) { void Text::FreeFonts(void) { // If the fonts are loaded, then free them. assert(vSmallFont != NULL); - assert(smallFont != NULL); + assert(smallFont != NULL); assert(mediumFont != NULL); - assert(largeFont != NULL); + assert(largeFont != NULL); assert(vLargeFont != NULL); TTF_CloseFont(vSmallFont); @@ -93,7 +93,7 @@ int Text::SetTextBlended(string textArg, textSizes_t size, SDL_Color colour,bool std::string line; for(int i = 0; i < (int)finalTextContents.size(); i++) { char c = finalTextContents.at(i); - if(c=='\n') { + if(c == '\n') { lines.push_back(line); line.clear(); } else { @@ -161,7 +161,7 @@ int Text::SetTextShaded(string textArg, textSizes_t size, SDL_Color colour, SDL_ std::string line; for(int i = 0; i < (int)finalTextContents.size(); i++) { char c = finalTextContents.at(i); - if(c=='\n') { + if(c == '\n') { lines.push_back(line); line.clear(); } else { @@ -247,7 +247,7 @@ std::string Text::DoWordWrap(TTF_Font* fontArg, const std::string& textArg) { char* word = strtok(tokenizedText, " "); - while (word) { + while(word) { int wordWidth; TTF_SizeText(fontArg, word, &wordWidth, NULL);