Merge branch 'playground'
Conflicts: src/libUnuk/Makefile
This commit is contained in:
commit
9173235610
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,6 +9,7 @@ Win32/Unuk/Unuk/*.user
|
|||||||
Win32/Unuk/Unuk.ncb
|
Win32/Unuk/Unuk.ncb
|
||||||
Win32/Unuk/Unuk.suo
|
Win32/Unuk/Unuk.suo
|
||||||
Bin/*.dll
|
Bin/*.dll
|
||||||
|
*.swp
|
||||||
*.o
|
*.o
|
||||||
*.exe
|
*.exe
|
||||||
*log
|
*log
|
||||||
|
@ -39,7 +39,8 @@ HEADERS += ../src/libUnuk/Debug.h \
|
|||||||
../src/libUnuk/MapEntities.h \
|
../src/libUnuk/MapEntities.h \
|
||||||
../src/libUnuk/FPS.h \
|
../src/libUnuk/FPS.h \
|
||||||
../src/libUnuk/MemManager.h \
|
../src/libUnuk/MemManager.h \
|
||||||
../src/libUnuk/MemClass.h
|
../src/libUnuk/MemClass.h \
|
||||||
|
../src/libUnuk/Node.h
|
||||||
SOURCES += ../src/libUnuk/Debug.cpp \
|
SOURCES += ../src/libUnuk/Debug.cpp \
|
||||||
../src/Unuk/main.cpp \
|
../src/Unuk/main.cpp \
|
||||||
../src/libUnuk/Input.cpp \
|
../src/libUnuk/Input.cpp \
|
||||||
|
@ -67,7 +67,7 @@
|
|||||||
<valuemap type="QVariantMap">
|
<valuemap type="QVariantMap">
|
||||||
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
|
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
|
||||||
<valuelist key="abstractProcess.Environment" type="QVariantList">
|
<valuelist key="abstractProcess.Environment" type="QVariantList">
|
||||||
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-ICZ0NvJNRS,guid=3b12f0647bd9cd4da4459e180000003d</value>
|
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-nnryLpuskH,guid=b1dc32eb5ce3f37b1b9bd14200000047</value>
|
||||||
<value type="QString">DISPLAY=:0</value>
|
<value type="QString">DISPLAY=:0</value>
|
||||||
<value type="QString">HOME=/home/allanis</value>
|
<value type="QString">HOME=/home/allanis</value>
|
||||||
<value type="QString">HUSHLOGIN=FALSE</value>
|
<value type="QString">HUSHLOGIN=FALSE</value>
|
||||||
@ -80,13 +80,13 @@
|
|||||||
<value type="QString">QTDIR=/usr/share/qt4</value>
|
<value type="QString">QTDIR=/usr/share/qt4</value>
|
||||||
<value type="QString">SHELL=/bin/bash</value>
|
<value type="QString">SHELL=/bin/bash</value>
|
||||||
<value type="QString">SHLVL=1</value>
|
<value type="QString">SHLVL=1</value>
|
||||||
<value type="QString">SSH_AGENT_PID=3260</value>
|
<value type="QString">SSH_AGENT_PID=3398</value>
|
||||||
<value type="QString">SSH_AUTH_SOCK=/tmp/ssh-lozFEJmg3235/agent.3235</value>
|
<value type="QString">SSH_AUTH_SOCK=/tmp/ssh-LnbIeWkr3373/agent.3373</value>
|
||||||
<value type="QString">TERM=linux</value>
|
<value type="QString">TERM=linux</value>
|
||||||
<value type="QString">USER=allanis</value>
|
<value type="QString">USER=allanis</value>
|
||||||
<value type="QString">WINDOWPATH=7</value>
|
<value type="QString">WINDOWPATH=7</value>
|
||||||
<value type="QString">XAUTHORITY=/home/allanis/.Xauthority</value>
|
<value type="QString">XAUTHORITY=/home/allanis/.Xauthority</value>
|
||||||
<value type="QString">XDG_SESSION_COOKIE=6de6dd7b78e791242262c6460000012e-1323089410.422893-1130065724</value>
|
<value type="QString">XDG_SESSION_COOKIE=6de6dd7b78e791242262c6460000012e-1325788236.314939-282202860</value>
|
||||||
<value type="QString">_=/usr/bin/startx</value>
|
<value type="QString">_=/usr/bin/startx</value>
|
||||||
</valuelist>
|
</valuelist>
|
||||||
<valuelist key="abstractProcess.arguments" type="QVariantList">
|
<valuelist key="abstractProcess.arguments" type="QVariantList">
|
||||||
@ -106,7 +106,7 @@
|
|||||||
<valuemap type="QVariantMap">
|
<valuemap type="QVariantMap">
|
||||||
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
|
<value key="ProjectExplorer.BuildConfiguration.DisplayName" type="QString">Debug</value>
|
||||||
<valuelist key="abstractProcess.Environment" type="QVariantList">
|
<valuelist key="abstractProcess.Environment" type="QVariantList">
|
||||||
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-ICZ0NvJNRS,guid=3b12f0647bd9cd4da4459e180000003d</value>
|
<value type="QString">DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-nnryLpuskH,guid=b1dc32eb5ce3f37b1b9bd14200000047</value>
|
||||||
<value type="QString">DISPLAY=:0</value>
|
<value type="QString">DISPLAY=:0</value>
|
||||||
<value type="QString">HOME=/home/allanis</value>
|
<value type="QString">HOME=/home/allanis</value>
|
||||||
<value type="QString">HUSHLOGIN=FALSE</value>
|
<value type="QString">HUSHLOGIN=FALSE</value>
|
||||||
@ -119,13 +119,13 @@
|
|||||||
<value type="QString">QTDIR=/usr/share/qt4</value>
|
<value type="QString">QTDIR=/usr/share/qt4</value>
|
||||||
<value type="QString">SHELL=/bin/bash</value>
|
<value type="QString">SHELL=/bin/bash</value>
|
||||||
<value type="QString">SHLVL=1</value>
|
<value type="QString">SHLVL=1</value>
|
||||||
<value type="QString">SSH_AGENT_PID=3260</value>
|
<value type="QString">SSH_AGENT_PID=3398</value>
|
||||||
<value type="QString">SSH_AUTH_SOCK=/tmp/ssh-lozFEJmg3235/agent.3235</value>
|
<value type="QString">SSH_AUTH_SOCK=/tmp/ssh-LnbIeWkr3373/agent.3373</value>
|
||||||
<value type="QString">TERM=linux</value>
|
<value type="QString">TERM=linux</value>
|
||||||
<value type="QString">USER=allanis</value>
|
<value type="QString">USER=allanis</value>
|
||||||
<value type="QString">WINDOWPATH=7</value>
|
<value type="QString">WINDOWPATH=7</value>
|
||||||
<value type="QString">XAUTHORITY=/home/allanis/.Xauthority</value>
|
<value type="QString">XAUTHORITY=/home/allanis/.Xauthority</value>
|
||||||
<value type="QString">XDG_SESSION_COOKIE=6de6dd7b78e791242262c6460000012e-1323089410.422893-1130065724</value>
|
<value type="QString">XDG_SESSION_COOKIE=6de6dd7b78e791242262c6460000012e-1325788236.314939-282202860</value>
|
||||||
<value type="QString">_=/usr/bin/startx</value>
|
<value type="QString">_=/usr/bin/startx</value>
|
||||||
</valuelist>
|
</valuelist>
|
||||||
<value key="abstractProcess.IgnoreReturnValue" type="bool">false</value>
|
<value key="abstractProcess.IgnoreReturnValue" type="bool">false</value>
|
||||||
|
@ -8,7 +8,8 @@ Game::Game(void) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Game::~Game(void) {
|
Game::~Game(void) {
|
||||||
delete _player;
|
// cleaning _player up caused a nice seg fault. I'll look later.
|
||||||
|
//delete _player;
|
||||||
delete _npc;
|
delete _npc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
9
src/libUnuk/AStar.cpp
Normal file
9
src/libUnuk/AStar.cpp
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include "AStar.h"
|
||||||
|
|
||||||
|
AStar::AStar(void) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
AStar::~AStar(void) {
|
||||||
|
|
||||||
|
}
|
10
src/libUnuk/AStar.h
Normal file
10
src/libUnuk/AStar.h
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#include <list>
|
||||||
|
|
||||||
|
class AStar {
|
||||||
|
public:
|
||||||
|
AStar(void);
|
||||||
|
~AStar(void);
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
};
|
@ -4,7 +4,11 @@ LDADD = -lGL -lGLU -lSDL -lSDL_ttf -lSDL_gfx -lSDL_image -ltinyxml
|
|||||||
objects = ApplySurface.o Button.o ButtonToggle.o Character.o Collision.o \
|
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 \
|
Debug.o Font.o FPS.o ImageLoader.o IngameMenu.o Input.o MainMenu.o \
|
||||||
Map.o MapElement.o MapEntities.o NPC.o ParticleEmitter.o \
|
Map.o MapElement.o MapEntities.o NPC.o ParticleEmitter.o \
|
||||||
Rect.o Text.o Texture.o TextureManager.o Timer.o MemManager.o\
|
Rect.o Text.o Texture.o TextureManager.o Timer.o \
|
||||||
|
<<<<<<< HEAD
|
||||||
|
=======
|
||||||
|
AStar.o \
|
||||||
|
>>>>>>> playground
|
||||||
|
|
||||||
.PHONY: default all clean
|
.PHONY: default all clean
|
||||||
|
|
||||||
|
20
src/libUnuk/Node.h
Normal file
20
src/libUnuk/Node.h
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
#ifndef _NODE_H_
|
||||||
|
#define _NODE_H_
|
||||||
|
#include <vector>
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
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
|
@ -9,10 +9,10 @@ TTF_Font* Text::vLargeFont = NULL;
|
|||||||
const static int lineSpacing = 3;
|
const static int lineSpacing = 3;
|
||||||
|
|
||||||
Text::Text(void) {
|
Text::Text(void) {
|
||||||
x=0;
|
x = 0;
|
||||||
y=0;
|
y = 0;
|
||||||
w=0;
|
w = 0;
|
||||||
h=0;
|
h = 0;
|
||||||
lineWidth=50;
|
lineWidth=50;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -28,9 +28,9 @@ Text::~Text(void) {
|
|||||||
void Text::LoadFonts(void) {
|
void Text::LoadFonts(void) {
|
||||||
// Load the fonts if they are not already in memory.
|
// Load the fonts if they are not already in memory.
|
||||||
assert(vSmallFont == NULL);
|
assert(vSmallFont == NULL);
|
||||||
assert(smallFont == NULL);
|
assert(smallFont == NULL);
|
||||||
assert(mediumFont == NULL);
|
assert(mediumFont == NULL);
|
||||||
assert(largeFont == NULL);
|
assert(largeFont == NULL);
|
||||||
assert(vLargeFont == NULL);
|
assert(vLargeFont == NULL);
|
||||||
|
|
||||||
vSmallFont = Font("../Data/Media/Fonts/Enigma_2.ttf", 16);
|
vSmallFont = Font("../Data/Media/Fonts/Enigma_2.ttf", 16);
|
||||||
@ -43,9 +43,9 @@ void Text::LoadFonts(void) {
|
|||||||
void Text::FreeFonts(void) {
|
void Text::FreeFonts(void) {
|
||||||
// If the fonts are loaded, then free them.
|
// If the fonts are loaded, then free them.
|
||||||
assert(vSmallFont != NULL);
|
assert(vSmallFont != NULL);
|
||||||
assert(smallFont != NULL);
|
assert(smallFont != NULL);
|
||||||
assert(mediumFont != NULL);
|
assert(mediumFont != NULL);
|
||||||
assert(largeFont != NULL);
|
assert(largeFont != NULL);
|
||||||
assert(vLargeFont != NULL);
|
assert(vLargeFont != NULL);
|
||||||
|
|
||||||
TTF_CloseFont(vSmallFont);
|
TTF_CloseFont(vSmallFont);
|
||||||
@ -93,7 +93,7 @@ int Text::SetTextBlended(string textArg, textSizes_t size, SDL_Color colour,bool
|
|||||||
std::string line;
|
std::string line;
|
||||||
for(int i = 0; i < (int)finalTextContents.size(); i++) {
|
for(int i = 0; i < (int)finalTextContents.size(); i++) {
|
||||||
char c = finalTextContents.at(i);
|
char c = finalTextContents.at(i);
|
||||||
if(c=='\n') {
|
if(c == '\n') {
|
||||||
lines.push_back(line);
|
lines.push_back(line);
|
||||||
line.clear();
|
line.clear();
|
||||||
} else {
|
} else {
|
||||||
@ -161,7 +161,7 @@ int Text::SetTextShaded(string textArg, textSizes_t size, SDL_Color colour, SDL_
|
|||||||
std::string line;
|
std::string line;
|
||||||
for(int i = 0; i < (int)finalTextContents.size(); i++) {
|
for(int i = 0; i < (int)finalTextContents.size(); i++) {
|
||||||
char c = finalTextContents.at(i);
|
char c = finalTextContents.at(i);
|
||||||
if(c=='\n') {
|
if(c == '\n') {
|
||||||
lines.push_back(line);
|
lines.push_back(line);
|
||||||
line.clear();
|
line.clear();
|
||||||
} else {
|
} else {
|
||||||
@ -247,7 +247,7 @@ std::string Text::DoWordWrap(TTF_Font* fontArg, const std::string& textArg) {
|
|||||||
|
|
||||||
char* word = strtok(tokenizedText, " ");
|
char* word = strtok(tokenizedText, " ");
|
||||||
|
|
||||||
while (word) {
|
while(word) {
|
||||||
int wordWidth;
|
int wordWidth;
|
||||||
TTF_SizeText(fontArg, word, &wordWidth, NULL);
|
TTF_SizeText(fontArg, word, &wordWidth, NULL);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user