From aece000bc2990106d32e01fb680eb42a4998b1f9 Mon Sep 17 00:00:00 2001 From: Krisjanis Rijnieks Date: Tue, 19 Jan 2016 21:14:40 +0100 Subject: [PATCH] Read per surface perspective warping setting from xml --- src/Application/SettingsLoader.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Application/SettingsLoader.cpp b/src/Application/SettingsLoader.cpp index 7a17adf..7a9386b 100644 --- a/src/Application/SettingsLoader.cpp +++ b/src/Application/SettingsLoader.cpp @@ -255,7 +255,7 @@ BaseSurface * SettingsLoader::getQuadSurface(ofxXmlSettings * xmlSettings){ xmlSettings->popTag(); xmlSettings->popTag(); // texCoords - + // Create and add quad surface BaseSurface * quadSurface = SurfaceFactory::instance()->createSurface( @@ -263,6 +263,17 @@ BaseSurface * SettingsLoader::getQuadSurface(ofxXmlSettings * xmlSettings){ quadSurface->setVertices(vertices); quadSurface->setTexCoords(texCoords); + // Read properties + // Only perspective warping for now + bool perspectiveWarping = false; + if(xmlSettings->tagExists("properties")){ + xmlSettings->pushTag("properties"); + perspectiveWarping = xmlSettings->getValue("perspectiveWarping", false); + xmlSettings->popTag(); // properties + } + QuadSurface * qs = (QuadSurface *)quadSurface; + qs->setPerspectiveWarping(perspectiveWarping); + return quadSurface; }