From 3e7e3eb3edc351c1c85bb7a7160c8099abeddfd2 Mon Sep 17 00:00:00 2001
From: Krisjanis Rijnieks <krisjanis.rijnieks@gmail.com>
Date: Sun, 2 Oct 2016 12:15:27 +0200
Subject: [PATCH] Add multiple <surfaces> tag test

---
 example/bin/data/defaultSurfaces.xml | 4 ++++
 src/Application/SettingsLoader.cpp   | 4 ++++
 2 files changed, 8 insertions(+)

diff --git a/example/bin/data/defaultSurfaces.xml b/example/bin/data/defaultSurfaces.xml
index 6b2391a..2d90507 100755
--- a/example/bin/data/defaultSurfaces.xml
+++ b/example/bin/data/defaultSurfaces.xml
@@ -33,6 +33,8 @@
             <source-name>Custom FBO Source</source-name>
         </source>
     </surface>
+</surfaces>
+<surfaces>
     <surface type="1">
         <vertices>
             <vertex>
@@ -78,6 +80,8 @@
             <perspectiveWarping>1</perspectiveWarping>
         </properties>
     </surface>
+</surfaces>
+<surfaces>
     <surface type="2">
         <vertices>
             <vertex>
diff --git a/src/Application/SettingsLoader.cpp b/src/Application/SettingsLoader.cpp
index 4fcbd2f..2f77f12 100644
--- a/src/Application/SettingsLoader.cpp
+++ b/src/Application/SettingsLoader.cpp
@@ -39,6 +39,10 @@ bool SettingsLoader::load(SurfaceStack & surfaces, MediaServer & mediaServer, st
 		ofLogWarning("SettingsLoader::load()") << "XML settings is empty or has wrong markup";
 		return false;
 	}else{
+		// Count <surfaces> tags.
+		unsigned int numPresets = xmlSettings->getNumTags("surfaces");
+		cout << "numPresets: " << numPresets << endl;
+	
 		xmlSettings->pushTag("surfaces");
 
 		int numSurfaces = xmlSettings->getNumTags("surface");