mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-20 22:26:54 +01:00
use new mem_stream_make_sized
This commit is contained in:
parent
5c683f173a
commit
761f93dd7e
2 changed files with 6 additions and 4 deletions
|
@ -248,15 +248,16 @@ saveGame( CommonGlobals* cGlobals )
|
||||||
if ( doSave ) {
|
if ( doSave ) {
|
||||||
XWStreamCtxt* outStream;
|
XWStreamCtxt* outStream;
|
||||||
|
|
||||||
outStream = mem_stream_make( cGlobals->params->util->mpool,
|
outStream = mem_stream_make_sized( cGlobals->params->util->mpool,
|
||||||
cGlobals->params->vtMgr,
|
cGlobals->params->vtMgr,
|
||||||
cGlobals, 0, writeToFile );
|
cGlobals->lastStreamSize,
|
||||||
|
cGlobals, 0, writeToFile );
|
||||||
stream_open( outStream );
|
stream_open( outStream );
|
||||||
|
|
||||||
game_saveToStream( &cGlobals->game,
|
game_saveToStream( &cGlobals->game,
|
||||||
&cGlobals->params->gi,
|
&cGlobals->params->gi,
|
||||||
outStream, ++cGlobals->curSaveToken );
|
outStream, ++cGlobals->curSaveToken );
|
||||||
|
cGlobals->lastStreamSize = stream_getSize( outStream );
|
||||||
stream_destroy( outStream );
|
stream_destroy( outStream );
|
||||||
|
|
||||||
game_saveSucceeded( &cGlobals->game, cGlobals->curSaveToken );
|
game_saveSucceeded( &cGlobals->game, cGlobals->curSaveToken );
|
||||||
|
|
|
@ -163,6 +163,7 @@ struct CommonGlobals {
|
||||||
|
|
||||||
XWGame game;
|
XWGame game;
|
||||||
XP_U16 lastNTilesToUse;
|
XP_U16 lastNTilesToUse;
|
||||||
|
XP_U16 lastStreamSize;
|
||||||
|
|
||||||
SocketChangedFunc socketChanged;
|
SocketChangedFunc socketChanged;
|
||||||
void* socketChangedClosure;
|
void* socketChangedClosure;
|
||||||
|
|
Loading…
Reference in a new issue