-/*
+/*
* Copyright (C) 2003 Robert Kooima
*
* NEVERBALL is free software; you can redistribute it and/or modify
#include "game.h"
#include "audio.h"
#include "config.h"
+#include "st_shared.h"
#include "st_conf.h"
#include "st_title.h"
r = config_mode(0, w, h);
goto_state(&st_conf);
break;
-
+
case CONF_TEXHI:
goto_state(&st_null);
config_set_d(CONFIG_TEXTURES, 1);
case CONF_BACK:
goto_state(&st_title);
break;
-
+
case CONF_LANG:
goto_state(&st_lang);
break;
-
+
case CONF_RESOL:
goto_state(&st_resol);
break;
case CONF_PLAYER:
- goto_name(&st_conf);
- break;
+ goto_name(&st_conf, &st_conf);
+ break;
default:
if (100 <= i && i <= 110)
/* Add mode selectors only for existing modes. */
- if ((kd = gui_harray(jd)))
+ if ((kd = gui_harray(jd)))
{
gui_state(kd, _("No"), GUI_SML, CONF_WIN, (f == 0));
gui_state(kd, _("Yes"), GUI_SML, CONF_FULL, (f == 1));
}
-
- {
- static char msg[20];
- sprintf(msg, "%d x %d", config_get_d(CONFIG_WIDTH), config_get_d(CONFIG_HEIGHT));
- gui_state(jd, msg, GUI_SML, CONF_RESOL, 0);
- }
+
+ {
+ static char msg[20];
+ sprintf(msg, "%d x %d", config_get_d(CONFIG_WIDTH),
+ config_get_d(CONFIG_HEIGHT));
+ gui_state(jd, msg, GUI_SML, CONF_RESOL, 0);
+ }
if ((kd = gui_harray(jd)))
{
if ((kd = gui_harray(jd)))
{
/* A series of empty buttons forms the music volume control. */
-
+
music_id[10] = gui_state(kd, NULL, GUI_SML, 210, (m == 10));
music_id[ 9] = gui_state(kd, NULL, GUI_SML, 209, (m == 9));
music_id[ 8] = gui_state(kd, NULL, GUI_SML, 208, (m == 8));
music_id[ 1] = gui_state(kd, NULL, GUI_SML, 201, (m == 1));
music_id[ 0] = gui_state(kd, NULL, GUI_SML, 200, (m == 0));
}
- gui_state(jd, _(language_get_name(language_from_code(config_simple_get_s(CONFIG_LANG)))), GUI_SML, CONF_LANG, 0);
- gui_state(jd, config_simple_get_s(CONFIG_PLAYER), GUI_SML, CONF_PLAYER, 0);
+ gui_state(jd, _(language_get_name(language_from_code(config_simple_get_s(CONFIG_LANG)))), GUI_SML, CONF_LANG, 0);
+ gui_state(jd, config_simple_get_s(CONFIG_PLAYER), GUI_SML,
+ CONF_PLAYER, 0);
}
if ((jd = gui_vstack(id)))
{
gui_paint(id);
}
-static void conf_timer(int id, float dt)
-{
- gui_timer(id, dt);
- audio_timer(dt);
-}
-
-static void conf_point(int id, int x, int y, int dx, int dy)
-{
- gui_pulse(gui_point(id, x, y), 1.2f);
-}
-
-static void conf_stick(int id, int a, int v)
-{
- if (config_tst_d(CONFIG_JOYSTICK_AXIS_X, a))
- gui_pulse(gui_stick(id, v, 0), 1.2f);
- if (config_tst_d(CONFIG_JOYSTICK_AXIS_Y, a))
- gui_pulse(gui_stick(id, 0, v), 1.2f);
-}
-
-static int conf_click(int b, int d)
-{
- if (b < 0 && d == 1)
- return conf_action(gui_token(gui_click()));
- return 1;
-}
-
static int conf_buttn(int b, int d)
{
if (d)
conf_enter,
conf_leave,
conf_paint,
- conf_timer,
- conf_point,
- conf_stick,
- conf_click,
+ shared_timer,
+ shared_point,
+ shared_stick,
+ shared_click,
NULL,
conf_buttn,
1, 0