summaryrefslogtreecommitdiff
path: root/src/testApp.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/testApp.cpp')
-rw-r--r--src/testApp.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/testApp.cpp b/src/testApp.cpp
index 37717fa..f8078fb 100644
--- a/src/testApp.cpp
+++ b/src/testApp.cpp
@@ -1,7 +1,7 @@
#include "testApp.h"
//--------------------------------------------------------------
testApp::~testApp(){
- saveSettings();
+ saveSettings("settings.xml");
}
//--------------------------------------------------------------
void testApp::setup(){
@@ -23,12 +23,12 @@ void testApp::setup(){
//ofDisableArbTex();
- texture.loadMovie("gradblend01.mov");
+ texture.loadMovie("stripey2.mov");
texture.play();
mode=CALIBRATE;
- loadSettings();
+ loadSettings("settings.xml");
light=true;
}
@@ -99,8 +99,10 @@ void testApp::keyPressed(int key){
activeView=1;
break;
case 'p':
- saveSettings();
- printf("saved settings.xml\n");
+ saveSettings("settings.xml");
+ break;
+ case 'z':
+ loadSettings("defaults.xml");
break;
case '/':
light=!light;
@@ -110,10 +112,10 @@ void testApp::keyPressed(int key){
}
}
-void testApp::loadSettings(){
+void testApp::loadSettings(string filename){
//viewport settings are float/ normalised to 0..1
- if( !XML.loadFile("settings.xml") ){
- printf("unable to load settings.xml check data/ folder\n");
+ if( !XML.loadFile(filename) ){
+ printf("unable to load %s check data/ folder\n",filename.c_str());
}else{
if(XML.pushTag("map4")) {
numViews=XML.getNumTags("view");
@@ -142,7 +144,7 @@ void testApp::loadSettings(){
//activeView=0;
}
//--------------------------------------------------------------
-void testApp::saveSettings(){
+void testApp::saveSettings(string filename){
//either re-navigate the whole thing OR
//save the number to the vp OR
//send a pointer to the vp
@@ -160,7 +162,8 @@ void testApp::saveSettings(){
}
XML.popTag();
}
- XML.saveFile("settings.xml");
+ XML.saveFile(filename);
+ printf("saved %s\n",filename.c_str());
}
//--------------------------------------------------------------
void testApp::keyReleased(int key){