#include "demo.h"
#include "progress.h"
#include "audio.h"
-#include "solid.h"
#include "config.h"
-#include "st_shared.h"
#include "util.h"
#include "common.h"
#include "demo_dir.h"
+#include "speed.h"
#include "game_common.h"
#include "game_server.h"
#include "st_demo.h"
#include "st_title.h"
+#include "st_shared.h"
/*---------------------------------------------------------------------------*/
gui_demo_update_status(i);
}
-static void demo_stick(int id, int a, float v)
+static void demo_stick(int id, int a, float v, int bump)
{
- int jd = shared_stick_basic(id, a, v);
+ int jd = shared_stick_basic(id, a, v, bump);
int i = gui_token(jd);
if (jd && i >= 0 && !GUI_ISMSK(i))
static int demo_paused;
static int show_hud;
static int check_compat;
+static int speed;
static float prelude;
prelude = 1.0f;
+ speed = SPEED_NORMAL;
+ demo_speed_set(speed);
+
show_hud = 1;
hud_update(0);
static void demo_play_paint(int id, float t)
{
- game_client_draw(0, t);
+ game_client_draw(0, t, demo_play_blend());
if (show_hud)
hud_paint();
progress_step();
}
+static void set_speed(int d)
+{
+ if (d > 0) speed = SPEED_UP(speed);
+ if (d < 0) speed = SPEED_DN(speed);
+
+ demo_speed_set(speed);
+ hud_speed_pulse(speed);
+}
+
+static void demo_play_stick(int id, int a, float v, int bump)
+{
+ if (!bump)
+ return;
+
+ if (config_tst_d(CONFIG_JOYSTICK_AXIS_Y, a))
+ {
+ if (v < 0) set_speed(+1);
+ if (v > 0) set_speed(-1);
+ }
+}
+
+static int demo_play_click(int b, int d)
+{
+ if (d)
+ {
+ if (b == SDL_BUTTON_WHEELUP) set_speed(+1);
+ if (b == SDL_BUTTON_WHEELDOWN) set_speed(-1);
+ }
+
+ return 1;
+}
+
static int demo_play_keybd(int c, int d)
{
if (d)
static void demo_end_paint(int id, float t)
{
- game_client_draw(0, t);
+ game_client_draw(0, t, demo_play_blend());
gui_paint(id);
if (demo_paused)
shared_angle,
shared_click,
NULL,
- demo_buttn,
- 1, 0
+ demo_buttn
};
struct state st_demo_play = {
demo_play_paint,
demo_play_timer,
NULL,
+ demo_play_stick,
NULL,
- NULL,
- NULL,
+ demo_play_click,
demo_play_keybd,
- demo_play_buttn,
- 1, 0
+ demo_play_buttn
};
struct state st_demo_end = {
shared_angle,
shared_click,
demo_end_keybd,
- demo_end_buttn,
- 1, 0
+ demo_end_buttn
};
struct state st_demo_del = {
shared_angle,
shared_click,
NULL,
- demo_del_buttn,
- 1, 0
+ demo_del_buttn
};
struct state st_demo_compat = {
shared_angle,
shared_click,
NULL,
- demo_compat_buttn,
- 1, 0
+ demo_compat_buttn
};