Пример #1
0
Game::~Game()
{
	DestroyViews();

	// XXX this shutdown sequence is critical:
	// 1- RemoveBody marks the Player for removal from Space,
	// 2- Space is destroyed, which actually goes through its removal list,
	//    removes the Player from Space and calls SetFrame(0) on it, which unlinks
	//    any references it has to other Space items
	// 3- Player is destroyed
	//
	// note that because of the declaration order of m_space and m_player in Game,
	// without these explicit Reset() calls, m_player would be deleted before m_space is,
	// which causes problems because then when Space is destroyed it tries to reference
	// the deleted Player object (to call SetFrame(0))
	//
	// ideally we'd split Player out into two objects, the physics part that
	// is owned by the space, and the game part that holds all the player
	// attributes and whatever else

	m_space->RemoveBody(m_player.get());
	m_space.reset();
	m_player.reset();
	m_galaxy->FlushCaches();
}
Пример #2
0
bool wxFrameManager::ReloadViews()
{
    return false;

    // TBD: ????
#if 0
    if ( mSettingsFile == "" || !wxFileExists( mSettingsFile ) ) 
        return false;

    DestroyViews();

    wxIOStreamWrapper stm;
    stm.CreateForInput( mSettingsFile );

    mStore.SetDataStream( stm );
    DoSerialize( mStore );

    return true;
#endif
}
Пример #3
0
wxFrameManager::~wxFrameManager()
{
    SaveViewsNow();
    DestroyViews();
}