mirror of
https://gitlab.com/dosowisko.net/libsuperderpy.git
synced 2025-02-08 06:06:43 +01:00
gamestate: move loading time counter to main thread to include PostLoad
This commit is contained in:
parent
521e6bf431
commit
c4ceb188f5
2 changed files with 3 additions and 4 deletions
|
@ -221,9 +221,7 @@ SYMBOL_INTERNAL void* GamestateLoadingThread(void* arg) {
|
|||
struct GamestateLoadingThreadData* data = arg;
|
||||
data->game->_priv.loading.inProgress = true;
|
||||
al_set_new_bitmap_flags(data->bitmap_flags);
|
||||
double time = al_get_time();
|
||||
data->gamestate->data = (*data->gamestate->api->Gamestate_Load)(data->game, &GamestateProgress);
|
||||
PrintConsole(data->game, "[%s] Loading took %f seconds.", data->gamestate->name, al_get_time() - time);
|
||||
if (data->game->_priv.loading.progress != data->gamestate->progressCount) {
|
||||
PrintConsole(data->game, "[%s] WARNING: Gamestate_ProgressCount does not match the number of progress invokations (%d)!", data->gamestate->name, data->game->_priv.loading.progress);
|
||||
if (data->game->config.debug) {
|
||||
|
|
|
@ -415,7 +415,8 @@ SYMBOL_INTERNAL void libsuperderpy_mainloop(void* g) {
|
|||
|
||||
struct GamestateLoadingThreadData data = {.game = game, .gamestate = tmp, .bitmap_flags = al_get_new_bitmap_flags()};
|
||||
game->_priv.loading.inProgress = true;
|
||||
game->_priv.loading.time = al_get_time();
|
||||
double time = al_get_time();
|
||||
game->_priv.loading.time = time;
|
||||
|
||||
CalculateProgress(game);
|
||||
#ifndef LIBSUPERDERPY_SINGLE_THREAD
|
||||
|
@ -451,7 +452,7 @@ SYMBOL_INTERNAL void libsuperderpy_mainloop(void* g) {
|
|||
|
||||
game->_priv.loading.progress++;
|
||||
CalculateProgress(game);
|
||||
PrintConsole(game, "Gamestate \"%s\" loaded successfully.", tmp->name);
|
||||
PrintConsole(game, "Gamestate \"%s\" loaded successfully in %f seconds.", tmp->name, al_get_time() - time);
|
||||
game->_priv.loading.loaded++;
|
||||
|
||||
tmp->loaded = true;
|
||||
|
|
Loading…
Reference in a new issue