From 9c3e9dccdbb5804b47a3ecd5ca50ca3d424dab21 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Fri, 22 Jan 2016 07:48:11 -0500 Subject: [PATCH] more settings.xml --- config/settings.xml | 4 ---- include/common.h | 4 +++- main.cpp | 14 ++++++++++---- 3 files changed, 13 insertions(+), 9 deletions(-) delete mode 100644 config/settings.xml diff --git a/config/settings.xml b/config/settings.xml deleted file mode 100644 index d981664..0000000 --- a/config/settings.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/include/common.h b/include/common.h index 0df6533..8e08d1d 100644 --- a/include/common.h +++ b/include/common.h @@ -99,6 +99,7 @@ extern unsigned int SCREEN_WIDTH; extern unsigned int SCREEN_HEIGHT; //#define FULLSCREEN +extern bool FULLSCREEN; /** * Define the length of a single HLINE. @@ -110,7 +111,8 @@ extern unsigned int SCREEN_HEIGHT; * */ -#define HLINE 3 +//#define HLINE 3 +extern unsigned int HLINE; /** * A 'wrapper' for libc's srand(), as we hope to eventually have our own random number diff --git a/main.cpp b/main.cpp index cfcf7ec..dcfc722 100644 --- a/main.cpp +++ b/main.cpp @@ -174,8 +174,10 @@ extern bool fadeWhite; extern bool fadeFast; extern int fadeIntensity; -unsigned int SCREEN_WIDTH; -unsigned int SCREEN_HEIGHT; +unsigned int HLINE = 3; +unsigned int SCREEN_WIDTH = 720; +unsigned int SCREEN_HEIGHT = 1080; +bool FULLSCREEN = false; /******************************************************************************* * MAIN ************************************************************************ @@ -186,9 +188,13 @@ int main(/*int argc, char *argv[]*/){ gameRunning=false; XMLDocument xml; + XMLElement *scr; xml.LoadFile("config/settings.xml"); - SCREEN_WIDTH = xml.FirstChildElement("screen")->UnsignedAttribute("width"); - SCREEN_HEIGHT = xml.FirstChildElement("screen")->UnsignedAttribute("height"); + scr = xml.FirstChildElement("screen"); + SCREEN_WIDTH = scr->UnsignedAttribute("width"); + SCREEN_HEIGHT = scr->UnsignedAttribute("height"); + FULLSCREEN = scr->BoolAttribute("fullscreen"); + HLINE = xml.FirstChildElement("hline")->UnsignedAttribute("size"); /*! * (Attempt to) Initialize SDL libraries so that we can use SDL facilities and eventually -- 2.39.5