1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-11-03 07:13:20 +00:00

ads:: split initialization functions into multiple, so that they are available in presentations

This commit is contained in:
Zeno Rogue
2024-06-25 17:11:06 +02:00
parent f6ce5a81e4
commit a8ade534b9
4 changed files with 49 additions and 13 deletions

View File

@@ -719,6 +719,14 @@ void ds_restart() {
init_rsrc();
}
void run_ds_game_hooks() {
rogueviz::rv_hook(hooks_frame, 100, view_ds_game);
rogueviz::rv_hook(shmup::hooks_turn, 0, ds_turn);
rogueviz::rv_hook(hooks_prestats, 100, display_rsrc);
rogueviz::rv_hook(hooks_handleKey, 150, handleKey);
rogueviz::rv_hook(anims::hooks_anim, 100, replay_animation);
}
void run_ds_game() {
stop_game();
@@ -730,12 +738,10 @@ void run_ds_game() {
ds_restart();
rogueviz::rv_hook(hooks_frame, 100, view_ds_game);
rogueviz::rv_hook(shmup::hooks_turn, 0, ds_turn);
rogueviz::rv_hook(hooks_prestats, 100, display_rsrc);
rogueviz::rv_hook(hooks_handleKey, 0, handleKey);
rogueviz::rv_hook(anims::hooks_anim, 100, replay_animation);
run_ds_game_hooks();
}
void add_ds_cleanup() {
rogueviz::on_cleanup_or_next([] {
main_rock = nullptr;
});