show game-over details

This commit is contained in:
Eric House 2021-02-13 12:16:09 -08:00
parent 5a061f5786
commit d53ab92af3
3 changed files with 14 additions and 1 deletions

View file

@ -395,6 +395,18 @@ main_playerScoreHeld( Globals* globals, XP_U16 player )
}
}
void
main_showGameOver( Globals* globals )
{
XWStreamCtxt* stream = mem_stream_make_raw( MPPARM(globals->mpool)
globals->vtMgr );
server_writeFinalScores( globals->game.server, NULL, stream );
stream_putU8( stream, 0 );
call_alert( (const XP_UCHAR*)stream_getPtr( stream ) );
stream_destroy( stream, NULL );
}
static time_t
getCurMS()
{

View file

@ -74,5 +74,6 @@ void main_onGameMessage( Globals* globals, XP_U32 gameID,
void main_sendOnClose( XWStreamCtxt* stream, XWEnv env, void* closure );
void main_playerScoreHeld( Globals* globals, XP_U16 player );
void main_showGameOver( Globals* globals );
#endif

View file

@ -350,7 +350,7 @@ wasm_util_notifyGameOver( XW_UtilCtxt* uc, XWEnv xwe, XP_S16 quitter )
{
WasmUtilCtx* wuctxt = (WasmUtilCtx*)uc;
Globals* globals = (Globals*)wuctxt->closure;
main_alert( globals, "Game over" );
main_showGameOver( globals );
}
static XP_Bool