#define PAUSE_RESTART 2
#define PAUSE_EXIT 3
-/*---------------------------------------------------------------------------*/
-
static struct state *st_continue;
-static int paused;
-
-int goto_pause(void)
-{
- st_continue = curr_state();
- paused = 1;
- return goto_state(&st_pause);
-}
-
-int is_paused(void)
-{
- return paused;
-}
-
-void clear_pause(void)
-{
- paused = 0;
-}
/*---------------------------------------------------------------------------*/
case PAUSE_RESTART:
if (progress_same())
{
- clear_pause();
SDL_PauseAudio(0);
video_set_grab(1);
return goto_state(&st_play_ready);
case PAUSE_EXIT:
progress_stat(GAME_NONE);
progress_stop();
- clear_pause();
SDL_PauseAudio(0);
audio_music_stop();
return goto_state(&st_over);
{
int id, jd, title_id;
+ st_continue = prev;
+
video_clr_grab();
SDL_PauseAudio(1);
{
if (config_tst_d(CONFIG_KEY_PAUSE, SDLK_ESCAPE))
{
- return goto_pause();
+ return goto_state(&st_pause);
}
else
{
keybd_camera(c);
if (config_tst_d(CONFIG_KEY_PAUSE, c))
- goto_pause();
+ goto_state(&st_pause);
}
return 1;
}
audio_play(AUD_SET, 1.f);
- clear_pause();
-
return id;
}
keybd_camera(c);
if (config_tst_d(CONFIG_KEY_PAUSE, c))
- goto_pause();
+ goto_state(&st_pause);
}
return 1;
}
VIEWR_SET_L(0);
fast_rotate = 0;
- if (is_paused())
- {
- clear_pause();
+ if (prev == &st_pause)
return 0;
- }
if ((id = gui_label(0, _("GO!"), GUI_LRG, GUI_ALL, gui_blu, gui_grn)))
{
goto_state(&st_play_ready);
}
if (config_tst_d(CONFIG_KEY_PAUSE, c))
- goto_pause();
+ goto_state(&st_pause);
}
else
{