Commit cc515196 authored by Gerhard Stein's avatar Gerhard Stein

now Saving and loading should be fine! Only better fonts in the menus are missing

parent 050a9a13
......@@ -447,6 +447,7 @@ void CMap::drawAll()
}
}
}
}
// draw a horizontal stripe, for vertical scrolling
......
......@@ -190,8 +190,6 @@ void CMapPlayGalaxy::operator>>(CSaveGameController &savedGame)
savedGame.encodeData( (*it)->m_ActionNumber );
}
savedGame.encodeData( mActive );
// Save the map_data as it is left
savedGame.encodeData(mMap.m_width);
savedGame.encodeData(mMap.m_height);
......@@ -202,6 +200,8 @@ void CMapPlayGalaxy::operator>>(CSaveGameController &savedGame)
savedGame.addData( reinterpret_cast<byte*>(mMap.getForegroundData()), mapSize );
}
// This is for loading the game
bool CMapPlayGalaxy::operator<<(CSaveGameController &savedGame)
{
......@@ -267,9 +267,8 @@ bool CMapPlayGalaxy::operator<<(CSaveGameController &savedGame)
if(!obj.exists)
mObjectPtr.pop_back();
}
savedGame.decodeData( mActive );
}
// Save the map_data as it is left
savedGame.decodeData(mMap.m_width);
......@@ -278,8 +277,6 @@ bool CMapPlayGalaxy::operator<<(CSaveGameController &savedGame)
savedGame.readDataBlock( reinterpret_cast<byte*>(mMap.getBackgroundData()) );
savedGame.readDataBlock( reinterpret_cast<byte*>(mMap.getForegroundData()) );
if( mMap.m_width * mMap.m_height > 0 )
mMap.drawAll();
return true;
}
......@@ -55,10 +55,16 @@ bool CPlayGameGalaxy::loadGameState()
// We need to load both Levels first, before we do the writing from the saved state.
m_Inventory << savedGame;
m_WorldMap << savedGame;
m_LevelPlay << savedGame;
bool active;
savedGame.decodeData( active );
m_WorldMap.setActive(active);
m_WorldMap << savedGame;
savedGame.decodeData( active );
m_LevelPlay.setActive(active);
if(active)
m_LevelPlay << savedGame;
// Create the special merge effect (Fadeout)
g_pGfxEngine->setupEffect(pColorMergeFX);
......@@ -79,8 +85,17 @@ bool CPlayGameGalaxy::saveGameState()
savedGame.encodeData(m_NumPlayers);
m_Inventory >> savedGame;
bool active = m_WorldMap.isActive();
savedGame.encodeData( active );
m_WorldMap >> savedGame;
m_LevelPlay >> savedGame;
active = m_LevelPlay.isActive();
savedGame.encodeData( active );
if( active )
m_LevelPlay >> savedGame;
return savedGame.save();
}
......
......@@ -101,7 +101,6 @@ protected:
Sint16 m_playcontrol[PA_MAX_ACTIONS];
int m_timer;
//CCamera m_camera;
bool m_dying;
stCheat& m_Cheatmode;
......
......@@ -56,6 +56,9 @@ public:
inline void UpdateScrollBufY(const Sint16 SBufferY)
{ mSbuffery = SBufferY&511; }
void readScrollBuffer(Sint16 &x, Sint16 &y)
{ x = mSbufferx; y = mSbuffery;}
protected:
SDL_Surface *BlitSurface;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment