projects
/
neverball
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
locales: Improved words-fr.png texture
[neverball]
/
ball
/
st_pause.c
diff --git
a/ball/st_pause.c
b/ball/st_pause.c
index
c522641
..
fd8c03b
100644
(file)
--- a/
ball/st_pause.c
+++ b/
ball/st_pause.c
@@
-12,12
+12,10
@@
* General Public License for more details.
*/
* General Public License for more details.
*/
-#include <SDL_mixer.h>
-
#include "gui.h"
#include "config.h"
#include "game.h"
#include "gui.h"
#include "config.h"
#include "game.h"
-#include "levels.h"
+#include "progress.h"
#include "level.h"
#include "audio.h"
#include "hud.h"
#include "level.h"
#include "audio.h"
#include "hud.h"
@@
-62,35
+60,40
@@
static int pause_action(int i)
switch(i)
{
case PAUSE_CONTINUE:
switch(i)
{
case PAUSE_CONTINUE:
- Mix_ResumeMusic();
+ SDL_PauseAudio(0);
config_set_grab(0);
return goto_state(st_continue);
case PAUSE_RESTART:
config_set_grab(0);
return goto_state(st_continue);
case PAUSE_RESTART:
- level_same();
- clear_pause();
- Mix_ResumeMusic();
- config_set_grab(1);
- return goto_state(&st_play_ready);
+ if (progress_same())
+ {
+ clear_pause();
+ SDL_PauseAudio(0);
+ config_set_grab(1);
+ return goto_state(&st_play_ready);
+ }
+ break;
case PAUSE_EXIT:
case PAUSE_EXIT:
- level_stat(GAME_NONE, curr_clock(), curr_coins());
- level_stop();
+ progress_stat(GAME_NONE);
+ progress_stop();
clear_pause();
clear_pause();
+ SDL_PauseAudio(0);
+ audio_music_stop();
return goto_state(&st_over);
}
return 1;
}
return goto_state(&st_over);
}
return 1;
}
+/*---------------------------------------------------------------------------*/
static int pause_enter(void)
{
int id, jd, title_id;
config_clr_grab();
static int pause_enter(void)
{
int id, jd, title_id;
config_clr_grab();
-
- Mix_PauseMusic();
+ SDL_PauseAudio(1);
/* Build the pause GUI. */
/* Build the pause GUI. */
@@
-104,13
+107,8
@@
static int pause_enter(void)
{
gui_state(jd, _("Quit"), GUI_SML, PAUSE_EXIT, 0);
{
gui_state(jd, _("Quit"), GUI_SML, PAUSE_EXIT, 0);
- if (curr_lg()->mode != MODE_CHALLENGE)
+ if (progress_same_avail())
gui_state(jd, _("Restart"), GUI_SML, PAUSE_RESTART, 0);
gui_state(jd, _("Restart"), GUI_SML, PAUSE_RESTART, 0);
- else
- {
- int ld = gui_state(jd, _("Restart"), GUI_SML, 0, 0);
- gui_set_color(ld, gui_gry, gui_gry);
- }
gui_start(jd, _("Continue"), GUI_SML, PAUSE_CONTINUE, 1);
}
gui_start(jd, _("Continue"), GUI_SML, PAUSE_CONTINUE, 1);
}
@@
-124,13
+122,13
@@
static int pause_enter(void)
return id;
}
return id;
}
-void pause_paint(int id, float st)
+static void pause_paint(int id, float t)
{
{
- shared_paint(id, st);
+ shared_paint(id, t);
hud_paint();
}
hud_paint();
}
-void pause_timer(int id, float dt)
+static void pause_timer(int id, float dt)
{
gui_timer(id, dt);
hud_timer (dt);
{
gui_timer(id, dt);
hud_timer (dt);
@@
-143,8
+141,7
@@
static int pause_keybd(int c, int d)
if (config_tst_d(CONFIG_KEY_PAUSE, c))
return pause_action(PAUSE_CONTINUE);
if (config_tst_d(CONFIG_KEY_PAUSE, c))
return pause_action(PAUSE_CONTINUE);
- if (config_tst_d(CONFIG_KEY_RESTART, c)
- && curr_lg()->mode != MODE_CHALLENGE)
+ if (config_tst_d(CONFIG_KEY_RESTART, c) && progress_same_avail())
return pause_action(PAUSE_RESTART);
}
return 1;
return pause_action(PAUSE_RESTART);
}
return 1;
@@
-158,12
+155,7
@@
static int pause_buttn(int b, int d)
return pause_action(gui_token(gui_click()));
if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
return pause_action(gui_token(gui_click()));
if (config_tst_d(CONFIG_JOYSTICK_BUTTON_EXIT, b))
- {
- if (SDL_GetModState() & (KMOD_SHIFT | KMOD_CTRL | KMOD_ALT | KMOD_META))
- return pause_action(PAUSE_EXIT);
- else
- return pause_action(PAUSE_CONTINUE);
- }
+ return pause_action(PAUSE_CONTINUE);
}
return 1;
}
}
return 1;
}
@@
-177,6
+169,7
@@
struct state st_pause = {
pause_timer,
shared_point,
shared_stick,
pause_timer,
shared_point,
shared_stick,
+ shared_angle,
shared_click,
pause_keybd,
pause_buttn,
shared_click,
pause_keybd,
pause_buttn,