use new mem_stream_make_sized

This commit is contained in:
Eric House 2012-09-11 19:07:00 -07:00
parent 5c683f173a
commit 761f93dd7e
2 changed files with 6 additions and 4 deletions

View file

@ -248,15 +248,16 @@ saveGame( CommonGlobals* cGlobals )
if ( doSave ) {
XWStreamCtxt* outStream;
outStream = mem_stream_make( cGlobals->params->util->mpool,
cGlobals->params->vtMgr,
cGlobals, 0, writeToFile );
outStream = mem_stream_make_sized( cGlobals->params->util->mpool,
cGlobals->params->vtMgr,
cGlobals->lastStreamSize,
cGlobals, 0, writeToFile );
stream_open( outStream );
game_saveToStream( &cGlobals->game,
&cGlobals->params->gi,
outStream, ++cGlobals->curSaveToken );
cGlobals->lastStreamSize = stream_getSize( outStream );
stream_destroy( outStream );
game_saveSucceeded( &cGlobals->game, cGlobals->curSaveToken );

View file

@ -163,6 +163,7 @@ struct CommonGlobals {
XWGame game;
XP_U16 lastNTilesToUse;
XP_U16 lastStreamSize;
SocketChangedFunc socketChanged;
void* socketChangedClosure;