|
|
@ -194,11 +194,11 @@ bool SettingsLoader::save(SurfaceManager & surfaceManager, string fileName){ |
|
|
|
|
|
|
|
xmlSettings->addTag("texCoords"); |
|
|
|
xmlSettings->pushTag("texCoords"); |
|
|
|
vector <ofVec2f> * texCoords = &surface->getTexCoords(); |
|
|
|
vector <Vec2> * texCoords = &surface->getTexCoords(); |
|
|
|
for(int j = 0; j < texCoords->size(); j++){ |
|
|
|
xmlSettings->addTag("texCoord"); |
|
|
|
xmlSettings->pushTag("texCoord", j); |
|
|
|
ofVec2f * texCoord = &(*texCoords)[j]; |
|
|
|
Vec2 * texCoord = &(*texCoords)[j]; |
|
|
|
xmlSettings->addValue("x", texCoord->x); |
|
|
|
xmlSettings->addValue("y", texCoord->y); |
|
|
|
xmlSettings->popTag(); // texCoord
|
|
|
@ -252,28 +252,28 @@ bool SettingsLoader::create(string fileName){ |
|
|
|
} |
|
|
|
|
|
|
|
BaseSurface * SettingsLoader::getTriangleSurface(ofxXmlSettings * xmlSettings){ |
|
|
|
vector <ofVec2f> vertices; |
|
|
|
vector <Vec2> vertices; |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("vertices")){ |
|
|
|
xmlSettings->pushTag("vertices"); |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("vertex", 0)){ |
|
|
|
xmlSettings->pushTag("vertex", 0); |
|
|
|
vertices.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), |
|
|
|
vertices.push_back(Vec2(xmlSettings->getValue("x", 0.0f), |
|
|
|
xmlSettings->getValue("y", 0.0f))); |
|
|
|
xmlSettings->popTag(); |
|
|
|
} |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("vertex", 1)){ |
|
|
|
xmlSettings->pushTag("vertex", 1); |
|
|
|
vertices.push_back(ofVec2f(xmlSettings->getValue("x", 100.0f), |
|
|
|
vertices.push_back(Vec2(xmlSettings->getValue("x", 100.0f), |
|
|
|
xmlSettings->getValue("y", 0.0f))); |
|
|
|
xmlSettings->popTag(); |
|
|
|
} |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("vertex", 2)){ |
|
|
|
xmlSettings->pushTag("vertex", 2); |
|
|
|
vertices.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), |
|
|
|
vertices.push_back(Vec2(xmlSettings->getValue("x", 0.0f), |
|
|
|
xmlSettings->getValue("y", 100.0f))); |
|
|
|
xmlSettings->popTag(); |
|
|
|
} |
|
|
@ -281,28 +281,28 @@ BaseSurface * SettingsLoader::getTriangleSurface(ofxXmlSettings * xmlSettings){ |
|
|
|
xmlSettings->popTag(); // vertices
|
|
|
|
} |
|
|
|
|
|
|
|
vector <ofVec2f> texCoords; |
|
|
|
vector <Vec2> texCoords; |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("texCoords")){ |
|
|
|
xmlSettings->pushTag("texCoords"); |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("texCoord", 0)){ |
|
|
|
xmlSettings->pushTag("texCoord", 0); |
|
|
|
texCoords.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), |
|
|
|
texCoords.push_back(Vec2(xmlSettings->getValue("x", 0.0f), |
|
|
|
xmlSettings->getValue("y", 0.0f))); |
|
|
|
xmlSettings->popTag(); |
|
|
|
} |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("texCoord", 1)){ |
|
|
|
xmlSettings->pushTag("texCoord", 1); |
|
|
|
texCoords.push_back(ofVec2f(xmlSettings->getValue("x", 1.0f), |
|
|
|
texCoords.push_back(Vec2(xmlSettings->getValue("x", 1.0f), |
|
|
|
xmlSettings->getValue("y", 0.0f))); |
|
|
|
xmlSettings->popTag(); |
|
|
|
} |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("texCoord", 2)){ |
|
|
|
xmlSettings->pushTag("texCoord", 2); |
|
|
|
texCoords.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), |
|
|
|
texCoords.push_back(Vec2(xmlSettings->getValue("x", 0.0f), |
|
|
|
xmlSettings->getValue("y", 1.0f))); |
|
|
|
xmlSettings->popTag(); |
|
|
|
} |
|
|
@ -321,35 +321,35 @@ BaseSurface * SettingsLoader::getTriangleSurface(ofxXmlSettings * xmlSettings){ |
|
|
|
} |
|
|
|
|
|
|
|
BaseSurface * SettingsLoader::getQuadSurface(ofxXmlSettings * xmlSettings){ |
|
|
|
vector <ofVec2f> vertices; |
|
|
|
vector <Vec2> vertices; |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("vertices")){ |
|
|
|
xmlSettings->pushTag("vertices"); |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("vertex", 0)){ |
|
|
|
xmlSettings->pushTag("vertex", 0); |
|
|
|
vertices.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), |
|
|
|
vertices.push_back(Vec2(xmlSettings->getValue("x", 0.0f), |
|
|
|
xmlSettings->getValue("y", 0.0f))); |
|
|
|
xmlSettings->popTag(); |
|
|
|
} |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("vertex", 1)){ |
|
|
|
xmlSettings->pushTag("vertex", 1); |
|
|
|
vertices.push_back(ofVec2f(xmlSettings->getValue("x", 100.0f), |
|
|
|
vertices.push_back(Vec2(xmlSettings->getValue("x", 100.0f), |
|
|
|
xmlSettings->getValue("y", 0.0f))); |
|
|
|
xmlSettings->popTag(); |
|
|
|
} |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("vertex", 2)){ |
|
|
|
xmlSettings->pushTag("vertex", 2); |
|
|
|
vertices.push_back(ofVec2f(xmlSettings->getValue("x", 100.0f), |
|
|
|
vertices.push_back(Vec2(xmlSettings->getValue("x", 100.0f), |
|
|
|
xmlSettings->getValue("y", 100.0f))); |
|
|
|
xmlSettings->popTag(); |
|
|
|
} |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("vertex", 3)){ |
|
|
|
xmlSettings->pushTag("vertex", 3); |
|
|
|
vertices.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), |
|
|
|
vertices.push_back(Vec2(xmlSettings->getValue("x", 0.0f), |
|
|
|
xmlSettings->getValue("y", 100.0f))); |
|
|
|
xmlSettings->popTag(); |
|
|
|
} |
|
|
@ -357,35 +357,35 @@ BaseSurface * SettingsLoader::getQuadSurface(ofxXmlSettings * xmlSettings){ |
|
|
|
xmlSettings->popTag(); // vertices
|
|
|
|
} |
|
|
|
|
|
|
|
vector <ofVec2f> texCoords; |
|
|
|
vector <Vec2> texCoords; |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("texCoords")){ |
|
|
|
xmlSettings->pushTag("texCoords"); |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("texCoord", 0)){ |
|
|
|
xmlSettings->pushTag("texCoord", 0); |
|
|
|
texCoords.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), |
|
|
|
texCoords.push_back(Vec2(xmlSettings->getValue("x", 0.0f), |
|
|
|
xmlSettings->getValue("y", 0.0f))); |
|
|
|
xmlSettings->popTag(); |
|
|
|
} |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("texCoord", 1)){ |
|
|
|
xmlSettings->pushTag("texCoord", 1); |
|
|
|
texCoords.push_back(ofVec2f(xmlSettings->getValue("x", 1.0f), |
|
|
|
texCoords.push_back(Vec2(xmlSettings->getValue("x", 1.0f), |
|
|
|
xmlSettings->getValue("y", 0.0f))); |
|
|
|
xmlSettings->popTag(); |
|
|
|
} |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("texCoord", 2)){ |
|
|
|
xmlSettings->pushTag("texCoord", 2); |
|
|
|
texCoords.push_back(ofVec2f(xmlSettings->getValue("x", 1.0f), |
|
|
|
texCoords.push_back(Vec2(xmlSettings->getValue("x", 1.0f), |
|
|
|
xmlSettings->getValue("y", 1.0f))); |
|
|
|
xmlSettings->popTag(); |
|
|
|
} |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("texCoord", 3)){ |
|
|
|
xmlSettings->pushTag("texCoord", 3); |
|
|
|
texCoords.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), |
|
|
|
texCoords.push_back(Vec2(xmlSettings->getValue("x", 0.0f), |
|
|
|
xmlSettings->getValue("y", 1.0f))); |
|
|
|
xmlSettings->popTag(); |
|
|
|
} |
|
|
@ -415,7 +415,7 @@ BaseSurface * SettingsLoader::getQuadSurface(ofxXmlSettings * xmlSettings){ |
|
|
|
} |
|
|
|
|
|
|
|
BaseSurface * SettingsLoader::getGridWarpSurface(ofxXmlSettings * xmlSettings){ |
|
|
|
vector <ofVec2f> vertices; |
|
|
|
vector <Vec2> vertices; |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("vertices")){ |
|
|
|
xmlSettings->pushTag("vertices"); |
|
|
@ -424,7 +424,7 @@ BaseSurface * SettingsLoader::getGridWarpSurface(ofxXmlSettings * xmlSettings){ |
|
|
|
|
|
|
|
while(xmlSettings->tagExists("vertex", iv)){ |
|
|
|
xmlSettings->pushTag("vertex", iv); |
|
|
|
vertices.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), |
|
|
|
vertices.push_back(Vec2(xmlSettings->getValue("x", 0.0f), |
|
|
|
xmlSettings->getValue("y", 0.0f))); |
|
|
|
xmlSettings->popTag(); |
|
|
|
++iv; |
|
|
@ -433,7 +433,7 @@ BaseSurface * SettingsLoader::getGridWarpSurface(ofxXmlSettings * xmlSettings){ |
|
|
|
xmlSettings->popTag(); // vertices
|
|
|
|
} |
|
|
|
|
|
|
|
vector <ofVec2f> texCoords; |
|
|
|
vector <Vec2> texCoords; |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("texCoords")){ |
|
|
|
xmlSettings->pushTag("texCoords"); |
|
|
@ -442,7 +442,7 @@ BaseSurface * SettingsLoader::getGridWarpSurface(ofxXmlSettings * xmlSettings){ |
|
|
|
|
|
|
|
while(xmlSettings->tagExists("texCoord", it)){ |
|
|
|
xmlSettings->pushTag("texCoord", it); |
|
|
|
texCoords.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), |
|
|
|
texCoords.push_back(Vec2(xmlSettings->getValue("x", 0.0f), |
|
|
|
xmlSettings->getValue("y", 0.0f))); |
|
|
|
xmlSettings->popTag(); |
|
|
|
++it; |
|
|
@ -476,7 +476,7 @@ BaseSurface * SettingsLoader::getGridWarpSurface(ofxXmlSettings * xmlSettings){ |
|
|
|
} |
|
|
|
|
|
|
|
BaseSurface * SettingsLoader::getHexagonSurface(ofxXmlSettings * xmlSettings){ |
|
|
|
vector <ofVec2f> vertices; |
|
|
|
vector <Vec2> vertices; |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("vertices")){ |
|
|
|
xmlSettings->pushTag("vertices"); |
|
|
@ -484,7 +484,7 @@ BaseSurface * SettingsLoader::getHexagonSurface(ofxXmlSettings * xmlSettings){ |
|
|
|
unsigned int v = 0; |
|
|
|
while(xmlSettings->tagExists("vertex", v)){ |
|
|
|
xmlSettings->pushTag("vertex", v); |
|
|
|
vertices.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), |
|
|
|
vertices.push_back(Vec2(xmlSettings->getValue("x", 0.0f), |
|
|
|
xmlSettings->getValue("y", 0.0f))); |
|
|
|
xmlSettings->popTag(); // vertex
|
|
|
|
v += 1; |
|
|
@ -493,7 +493,7 @@ BaseSurface * SettingsLoader::getHexagonSurface(ofxXmlSettings * xmlSettings){ |
|
|
|
xmlSettings->popTag(); // vertices
|
|
|
|
} |
|
|
|
|
|
|
|
vector <ofVec2f> texCoords; |
|
|
|
vector <Vec2> texCoords; |
|
|
|
|
|
|
|
if(xmlSettings->tagExists("texCoords")){ |
|
|
|
xmlSettings->pushTag("texCoords"); |
|
|
@ -501,7 +501,7 @@ BaseSurface * SettingsLoader::getHexagonSurface(ofxXmlSettings * xmlSettings){ |
|
|
|
unsigned int t = 0; |
|
|
|
while(xmlSettings->tagExists("texCoord", t)){ |
|
|
|
xmlSettings->pushTag("texCoord", t); |
|
|
|
texCoords.push_back(ofVec2f(xmlSettings->getValue("x", 0.0f), |
|
|
|
texCoords.push_back(Vec2(xmlSettings->getValue("x", 0.0f), |
|
|
|
xmlSettings->getValue("y", 0.0f))); |
|
|
|
xmlSettings->popTag(); // texCoord
|
|
|
|
t += 1; |
|
|
|