EgtGeomKernel 1.5f5 :

- gestione salvataggio in modalità testo compresso
- aggiunto controlli in scritture per salvataggio.
This commit is contained in:
Dario Sassi
2014-06-18 07:27:03 +00:00
parent 26c2ad702a
commit 4097bcd178
23 changed files with 359 additions and 261 deletions
+18 -9
View File
@@ -49,22 +49,31 @@ bool
GdbMaterialMgr::Save( NgeWriter& ngeOut) const
{
// intestazione libreria
ngeOut.WriteKey( NGE_MAT_LIB) ;
if ( ! ngeOut.WriteKey( NGE_MAT_LIB))
return false ;
// numero di materiali custom
int nCustNum = int( m_GdbMats.size()) - m_nStdNum ;
ngeOut.WriteInt( nCustNum, ";", true) ;
if ( ! ngeOut.WriteInt( nCustNum, ";", true))
return false ;
// scrittura dei materiali custom
for ( int i = m_nStdNum ; i < int( m_GdbMats.size()) ; ++ i) {
// Nome, Id, Tipo (1=materiale senza texture)
string sMatName = ( m_GdbMats[i].sName.empty() ? "$$" : m_GdbMats[i].sName) ;
ngeOut.WriteString( sMatName, ",") ;
ngeOut.WriteInt( i + 1, ",") ;
ngeOut.WriteInt( 1, ";", true) ;
if ( ! ngeOut.WriteString( sMatName, ","))
return false ;
if ( ! ngeOut.WriteInt( i + 1, ","))
return false ;
if ( ! ngeOut.WriteInt( 1, ";", true))
return false ;
// dati del materiale
ngeOut.WriteCol( m_GdbMats[i].matM.GetAmbient(), ";") ;
ngeOut.WriteCol( m_GdbMats[i].matM.GetDiffuse(), ";") ;
ngeOut.WriteCol( m_GdbMats[i].matM.GetSpecular(), ";") ;
ngeOut.WriteDouble( m_GdbMats[i].matM.GetShininess(), ";", true, 1) ;
if ( ! ngeOut.WriteCol( m_GdbMats[i].matM.GetAmbient(), ";"))
return false ;
if ( ! ngeOut.WriteCol( m_GdbMats[i].matM.GetDiffuse(), ";"))
return false ;
if ( ! ngeOut.WriteCol( m_GdbMats[i].matM.GetSpecular(), ";"))
return false ;
if ( ! ngeOut.WriteDouble( m_GdbMats[i].matM.GetShininess(), ";", true, 1))
return false ;
}
return true ;