]> code.bitgloo.com Git - clyne/gamedev.git/commitdiff
more settings.xml
authorClyne Sullivan <tullivan99@gmail.com>
Fri, 22 Jan 2016 12:48:11 +0000 (07:48 -0500)
committerClyne Sullivan <tullivan99@gmail.com>
Fri, 22 Jan 2016 12:48:11 +0000 (07:48 -0500)
config/settings.xml [deleted file]
include/common.h
main.cpp

diff --git a/config/settings.xml b/config/settings.xml
deleted file mode 100644 (file)
index d981664..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-
-<screen width="1280" height="720" />
-<hline value="3" />
\ No newline at end of file
index 0df6533e99c2a03a926c6fb20e78b8110a1f7f63..8e08d1dea985c5b274cf6b34a55c61860670a1da 100644 (file)
@@ -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
index cfcf7ece6c3f63913c1e5aff1ce013d14398bca2..dcfc72227d572f695729bb7e6a2e69c29ed96076 100644 (file)
--- 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