aboutsummaryrefslogtreecommitdiffstats
path: root/main.cpp
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2016-01-13 08:38:39 -0500
committerdrumsetmonkey <abelleisle@roadrunner.com>2016-01-13 08:38:39 -0500
commit058c06659632597c78704ef7d971284576b11ddf (patch)
tree2be14741b797e89775ce916a33d396b27938da74 /main.cpp
parentda4aedc85adc5e8350492a84ec17d470d1eb0a33 (diff)
parent2058d60354e62f84ef915c7409bba445ad934dba (diff)
Added Fire
Diffstat (limited to 'main.cpp')
-rw-r--r--main.cpp14
1 files changed, 13 insertions, 1 deletions
diff --git a/main.cpp b/main.cpp
index bff283d..62204e1 100644
--- a/main.cpp
+++ b/main.cpp
@@ -11,6 +11,9 @@
#include <world.h>
#include <ui.h>
#include <entities.h>
+#include <tinyxml2.h>
+
+using namespace tinyxml2;
/*
* TICKS_PER_SEC & MSEC_PER_TICK
@@ -196,12 +199,21 @@ extern bool fadeWhite;
extern bool fadeFast;
extern int fadeIntensity;
+unsigned int SCREEN_WIDTH;
+unsigned int SCREEN_HEIGHT;
+
/*******************************************************************************
* MAIN ************************************************************************
*******************************************************************************/
int main(/*int argc, char *argv[]*/){
//*argv = (char *)argc;
+
gameRunning=false;
+
+ XMLDocument xml;
+ xml.LoadFile("config/settings.xml");
+ SCREEN_WIDTH = xml.FirstChildElement("screen")->UnsignedAttribute("width");
+ SCREEN_HEIGHT = xml.FirstChildElement("screen")->UnsignedAttribute("height");
/*!
* (Attempt to) Initialize SDL libraries so that we can use SDL facilities and eventually
@@ -529,7 +541,7 @@ void render(){
* see past the world render
*/
- if(currentWorld->getTheWidth() < SCREEN_WIDTH){
+ if(currentWorld->getTheWidth() < (int)SCREEN_WIDTH){
offset.x = 0;
}else if(!worldInside){
if(player->loc.x - SCREEN_WIDTH/2 < currentWorld->getTheWidth() * -0.5f)