Fixed bug: ambient intensity RGB not correctly written/read

This commit is contained in:
Cirilo Bernardo 2016-02-07 08:52:42 +11:00
parent 99aba8f261
commit 4edce46764
1 changed files with 2 additions and 2 deletions

View File

@ -389,7 +389,7 @@ bool SGAPPEARANCE::WriteCache( std::ofstream& aFile, SGNODE* parentNode )
}
aFile << "[" << GetName() << "]";
aFile.write( (char*)&ambient, sizeof(ambient) );
S3D::WriteColor( aFile, ambient );
aFile.write( (char*)&shininess, sizeof(shininess) );
aFile.write( (char*)&transparency, sizeof(transparency) );
S3D::WriteColor( aFile, diffuse );
@ -405,7 +405,7 @@ bool SGAPPEARANCE::WriteCache( std::ofstream& aFile, SGNODE* parentNode )
bool SGAPPEARANCE::ReadCache( std::ifstream& aFile, SGNODE* parentNode )
{
aFile.read( (char*)&ambient, sizeof(ambient) );
S3D::ReadColor( aFile, ambient );
aFile.read( (char*)&shininess, sizeof(shininess) );
aFile.read( (char*)&transparency, sizeof(transparency) );
S3D::ReadColor( aFile, diffuse );