make sure shaders are loaded in-between Load and PostLoad calls + call PostLoad for loading

This commit is contained in:
Sebastian Krzyszkowiak 2019-02-13 22:59:11 +01:00
parent 886034e596
commit d9dd73bfc8
No known key found for this signature in database
GPG key ID: E8F235CF3BDBC3FF
2 changed files with 6 additions and 2 deletions

View file

@ -330,7 +330,6 @@ SYMBOL_EXPORT int libsuperderpy_start(struct Game* game) {
al_clear_to_color(al_map_rgb(0, 0, 0));
ReloadShaders(game, false);
al_flip_display();
{
@ -353,6 +352,10 @@ SYMBOL_EXPORT int libsuperderpy_start(struct Game* game) {
ReloadShaders(game, false);
if (game->_priv.loading.gamestate->api->post_load) {
(*game->_priv.loading.gamestate->api->post_load)(game, game->_priv.loading.gamestate->data);
}
game->_priv.timestamp = al_get_time();
game->_priv.paused = false;

View file

@ -365,6 +365,8 @@ static inline bool MainloopTick(struct Game* game) {
al_set_new_bitmap_flags(data.bitmap_flags);
ReloadShaders(game, false);
if (tmp->api->post_load) {
PrintConsole(game, "[%s] Post-loading...", tmp->name);
tmp->api->post_load(game, tmp->data);
@ -400,7 +402,6 @@ static inline bool MainloopTick(struct Game* game) {
}
if (game->_priv.loading.loaded) {
ReloadShaders(game, false);
MainloopEvents(game); // consume queued events
#ifdef __EMSCRIPTEN__
DrawGamestates(game);