|
From: Charles L. <cn...@us...> - 2009-02-08 23:24:55
|
Update of /cvsroot/hgengine/Mercury/src In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv25031/src Modified Files: MercuryODE.cpp ScreenMapEditor.cpp Log Message: add support for primary worlds, to allow world aggregation Index: MercuryODE.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/MercuryODE.cpp,v retrieving revision 1.99 retrieving revision 1.100 diff -C2 -d -r1.99 -r1.100 *** MercuryODE.cpp 8 Feb 2009 20:38:56 -0000 1.99 --- MercuryODE.cpp 8 Feb 2009 23:24:51 -0000 1.100 *************** *** 514,517 **** --- 514,522 ---- bool MercuryODEWorld::LoadFromINI( MercuryINI & pINI, const MString & sWorldName ) { + //First see if there are any fallbacks... + MString sPrimary = pINI.GetValueS( sWorldName, "Primary" ); + if( sPrimary.length() ) + LoadFromINI( pINI, sPrimary ); + //Set this the world's name SetName( sWorldName ); Index: ScreenMapEditor.cpp =================================================================== RCS file: /cvsroot/hgengine/Mercury/src/ScreenMapEditor.cpp,v retrieving revision 1.48 retrieving revision 1.49 diff -C2 -d -r1.48 -r1.49 *** ScreenMapEditor.cpp 29 Dec 2008 06:27:29 -0000 1.48 --- ScreenMapEditor.cpp 8 Feb 2009 23:24:51 -0000 1.49 *************** *** 377,380 **** --- 377,396 ---- } + MString sPrimary = m_iWorldFile.GetValueS( sWorldname, "Primary" ); + + if( sPrimary.length() ) + { + ClearOutArea(); + + for ( unsigned i = 0; i < (unsigned int)m_iWorldFile.GetValueI( sPrimary, "NumElements", 0 ); i++ ) + { + MakeWorldPiece( i, sPrimary ); + } + + m_vODEObjs.resize( 0 ); + m_vVisObjs.resize( 0 ); + + } + ClearOutArea(); for ( unsigned i = 0; i < (unsigned int)m_iTightFile.GetValueI( sWorldname, "NumElements", 0 ); i++ ) *************** *** 392,396 **** { MString sPieceName = ssprintf( "Piece%d", i+1 ); ! int iObjNum = GenerateObject( m_iTightFile.GetValueS( sWorldname, sPieceName ), iTempSelect ); if ( iTempSelect >= 0 ) iObjNum = iTempSelect; --- 408,412 ---- { MString sPieceName = ssprintf( "Piece%d", i+1 ); ! int iObjNum = GenerateObject( m_iWorldFile.GetValueS( sWorldname, sPieceName ), iTempSelect ); if ( iTempSelect >= 0 ) iObjNum = iTempSelect; *************** *** 398,407 **** MercuryObject * oVis = m_vVisObjs[iObjNum]; ! float fX = m_iTightFile.GetValueF( sWorldname, sPieceName+"X" ); ! float fY = m_iTightFile.GetValueF( sWorldname, sPieceName+"Y" ); ! float fZ = m_iTightFile.GetValueF( sWorldname, sPieceName+"Z" ); ! float fRX = m_iTightFile.GetValueF( sWorldname, sPieceName+"RotX" ); ! float fRY = m_iTightFile.GetValueF( sWorldname, sPieceName+"RotY" ); ! float fRZ = m_iTightFile.GetValueF( sWorldname, sPieceName+"RotZ" ); if ( oODE ) { --- 414,423 ---- MercuryObject * oVis = m_vVisObjs[iObjNum]; ! float fX = m_iWorldFile.GetValueF( sWorldname, sPieceName+"X" ); ! float fY = m_iWorldFile.GetValueF( sWorldname, sPieceName+"Y" ); ! float fZ = m_iWorldFile.GetValueF( sWorldname, sPieceName+"Z" ); ! float fRX = m_iWorldFile.GetValueF( sWorldname, sPieceName+"RotX" ); ! float fRY = m_iWorldFile.GetValueF( sWorldname, sPieceName+"RotY" ); ! float fRZ = m_iWorldFile.GetValueF( sWorldname, sPieceName+"RotZ" ); if ( oODE ) { *************** *** 463,466 **** --- 479,488 ---- unsigned int iPieces = m_iWorldFile.GetValueI( sObjectIn, "NumPieces", 0, true ); + if ( iPieces == 0 ) + { + NotifyMessage( ssprintf( "No pieces found for item of type '%s'.", sObjectIn.c_str() ) ); + return -1; + } + if ( iPieceToReplace != -1 ) { |