Permalink
Browse files

Moved gameScreen constructor to init, since data path was not set cor…

…rectly in the constructor on mac os. Should not affect win
  • Loading branch information...
1 parent b5b47f7 commit 0473dbe04cf7ca7a7d27e4c3ac0aa4c9c98f24eb @HalfdanJ HalfdanJ committed Apr 23, 2012
Showing with 18 additions and 16 deletions.
  1. +18 −16 code/gameScreen.cpp
View
34 code/gameScreen.cpp
@@ -2,42 +2,44 @@
gameScreen::gameScreen()
{
- blockWidth = ofGetWidth()/GAMEBLOCK_COLS;
- blockHeight = ofGetHeight()/GAMEBLOCK_ROWS;
+ //Moved to init
+}
+gameScreen::~gameScreen()
+{
+ //dtor
+}
+void gameScreen::init(Tracker& initTracker)
+{
+ blockWidth = ofGetWidth()/GAMEBLOCK_COLS;
+ blockHeight = ofGetHeight()/GAMEBLOCK_ROWS;
+
+
if(XML.loadFile("../../../settings/settings.xml") ){
printf("settings.xml loaded!");
XML.pushTag("root");
}else{
printf("unable to load settings.xml check data/ folder");
}
-
+
//read the colors from XML
//if the settings file doesn't exist we assigns default values (170, 190, 240)
printf("\n red: %i \n",XML.getValue("BACKGROUND:COLOR:RED", 170));
/*green = XML.getValue("BACKGROUND:COLOR:GREEN", 190);
- blue = XML.getValue("BACKGROUND:COLOR:BLUE", 240);
- */
-
+ blue = XML.getValue("BACKGROUND:COLOR:BLUE", 240);
+ */
+
loadBackgrounds();
currentBackgroundIndex = 0;
backgrounds[currentBackgroundIndex]->show();
-
+
for(int i=0;i<GAMEBLOCK_COLS*GAMEBLOCK_ROWS;i++)
{
blocks[i].Set(blockWidth,blockHeight,i%GAMEBLOCK_COLS,i/GAMEBLOCK_COLS);
}
-}
-
-gameScreen::~gameScreen()
-{
- //dtor
-}
-
-void gameScreen::init(Tracker& initTracker)
-{
+
tracker = &initTracker;
}

0 comments on commit 0473dbe

Please sign in to comment.