From 1afc57eb7ba5c63ec21797f0dd178ca03dab1b77 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Sat, 17 May 2014 13:20:25 +0200 Subject: [PATCH] Add defaultSurfaces.xml to avoid saved surface.xml conflicts when pulling new versions later --- example/bin/.gitignore | 1 + example/bin/data/{surfaces.xml => defaultSurfaces.xml} | 0 example/src/ofApp.cpp | 9 ++++++++- 3 files changed, 9 insertions(+), 1 deletion(-) rename example/bin/data/{surfaces.xml => defaultSurfaces.xml} (100%) diff --git a/example/bin/.gitignore b/example/bin/.gitignore index e2b3e9d..44fbbc9 100644 --- a/example/bin/.gitignore +++ b/example/bin/.gitignore @@ -1,3 +1,4 @@ *.app data/*.jpg data/settings.xml +data/surfaces.xml diff --git a/example/bin/data/surfaces.xml b/example/bin/data/defaultSurfaces.xml similarity index 100% rename from example/bin/data/surfaces.xml rename to example/bin/data/defaultSurfaces.xml diff --git a/example/src/ofApp.cpp b/example/src/ofApp.cpp index dd3132e..fc1fc8f 100644 --- a/example/src/ofApp.cpp +++ b/example/src/ofApp.cpp @@ -14,7 +14,14 @@ void ofApp::setup() surfaceManager.getSurface(1)->setVertex(2, ofVec2f(300, 400)); */ - surfaceManager.loadXmlSettings("surfaces.xml"); + // check if the surfaces.xml file is there + // if not - load defaultSurfaces.xml + + if ( ofFile::doesFileExist("surfaces.xml") ) { + surfaceManager.loadXmlSettings("surfaces.xml"); + } else { + surfaceManager.loadXmlSettings("defaultSurfaces.xml"); + } gui.setSurfaceManager( &surfaceManager ); }