update reader with skybox valid

This commit is contained in:
Liam 2015-08-26 10:22:20 +08:00
parent c998639c30
commit 5a997cec1c
2 changed files with 16 additions and 0 deletions

View File

@ -84,6 +84,7 @@ namespace cocostudio
std::string name = "";
int skyBoxMask = 1;
bool skyBoxEnabled = false;
bool skyBoxValid = true;
std::string leftPath = "";
std::string leftPlistFile = "";
@ -127,6 +128,10 @@ namespace cocostudio
{
skyBoxEnabled = (value == "True") ? true : false;
}
else if (attriname == "SkyBoxValid")
{
skyBoxValid = (value == "True") ? true : false;
}
else if (attriname == "skyBoxMask")
{
skyBoxMask = atoi(value.c_str());
@ -143,6 +148,9 @@ namespace cocostudio
attribute = attribute->Next();
}
if (!skyBoxValid)
skyBoxEnabled = false;
const tinyxml2::XMLElement* child = objectData->FirstChildElement();
while (child)
{

View File

@ -109,6 +109,7 @@ namespace cocostudio
float fov = 60.f;
unsigned int cameraFlag = 0;
bool skyBoxEnabled = false;
bool skyBoxValid = true;
std::string attriname;
const tinyxml2::XMLAttribute* attribute = objectData->FirstAttribute();
@ -142,10 +143,17 @@ namespace cocostudio
{
skyBoxEnabled = (value == "True") ? true : false;
}
else if (attriname == "SkyBoxValid")
{
skyBoxValid = (value == "True") ? true : false;
}
attribute = attribute->Next();
}
if (!skyBoxValid)
skyBoxEnabled = false;
Vec2 clipPlane(1, 1000);
std::string leftPath = "";