SDL_Surface *icon;
#endif
- int t1, t0;
+ int t1, t0, uniform;
lang_init("neverball", CONFIG_LOCALE);
/* Run the main game loop. */
+ uniform = config_get_d(CONFIG_UNIFORM);
t0 = SDL_GetTicks();
while (loop())
{
t1 = SDL_GetTicks();
- /* Step the game state at least up to the current time. */
+ if (uniform)
+ {
+ /* Step the game uniformly, as configured. */
+
+ int u;
- while (t1 > t0)
+ for (u = 0; u < abs(uniform); ++u)
+ st_timer(DT);
+ }
+ else
{
- st_timer(DT);
- t0 += (int) (DT * 1000);
+ /* Step the game state at least up to the current time. */
+
+ while (t1 > t0)
+ {
+ st_timer(DT);
+ t0 += (int) (DT * 1000);
+ }
}
/* Render. */
st_paint();
config_swap();
+ if (uniform < 0)
+ shot();
+
if (config_get_d(CONFIG_NICE))
SDL_Delay(1);
}
+++ /dev/null
-
-// entity 0
-{
-"classname" "worldspawn"
-"depthmask" "1"
-"alphatest" "0.5"
-"pendulum" "1"
-}
-// entity 1
-{
-"classname" "info_null"
-"origin" "24 0 0"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/proton"
-}
-// entity 2
-{
-"classname" "info_null"
-"origin" "-20 -20 0"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/proton"
-}
-// entity 3
-{
-"classname" "info_null"
-"origin" "-20 20 0"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/neutron"
-}
-// entity 4
-{
-"classname" "info_null"
-"origin" "8 16 -16"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/neutron"
-}
-// entity 5
-{
-"classname" "info_null"
-"origin" "0 0 -24"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/proton"
-}
-// entity 6
-{
-"classname" "info_null"
-"origin" "20 -20 0"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/neutron"
-}
-// entity 7
-{
-"classname" "info_null"
-"origin" "-8 -16 -16"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/neutron"
-}
-// entity 8
-{
-"classname" "info_null"
-"origin" "0 -24 0"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/neutron"
-}
-// entity 9
-{
-"classname" "info_null"
-"origin" "-24 0 0"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/neutron"
-}
-// entity 10
-{
-"classname" "info_null"
-"origin" "16 -8 -16"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/proton"
-}
-// entity 11
-{
-"classname" "info_null"
-"origin" "20 20 0"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/proton"
-}
-// entity 12
-{
-"classname" "info_null"
-"origin" "0 24 0"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/neutron"
-}
-// entity 13
-{
-"classname" "info_null"
-"origin" "0 0 24"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/neutron"
-}
-// entity 14
-{
-"classname" "info_null"
-"origin" "-16 8 -16"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/proton"
-}
-// entity 15
-{
-"classname" "info_null"
-"origin" "-8 16 0"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/neutron"
-}
-// entity 16
-{
-"classname" "info_null"
-"origin" "8 -16 0"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/neutron"
-}
-// entity 17
-{
-"classname" "info_null"
-"origin" "16 8 0"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/proton"
-}
-// entity 18
-{
-"classname" "info_null"
-"origin" "-16 -8 0"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/proton"
-}
-// entity 19
-{
-"classname" "info_null"
-"origin" "8 16 16"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/neutron"
-}
-// entity 20
-{
-"classname" "info_null"
-"origin" "-8 -16 16"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/neutron"
-}
-// entity 21
-{
-"classname" "info_null"
-"origin" "-16 8 16"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/proton"
-}
-// entity 22
-{
-"classname" "info_null"
-"origin" "16 -8 16"
-"height" "0.4 0.0 0.0"
-"width" "0.4 0.0 0.0"
-"image" "ball/atom/proton"
-}
config_set_s(CONFIG_WIIMOTE_ADDR, DEFAULT_WIIMOTE_ADDR);
config_set_d(CONFIG_CHEAT, DEFAULT_CHEAT);
config_set_d(CONFIG_STATS, DEFAULT_STATS);
+ config_set_d(CONFIG_UNIFORM, DEFAULT_UNIFORM);
config_set_d(CONFIG_KEY_FORWARD, DEFAULT_KEY_FORWARD);
config_set_d(CONFIG_KEY_BACKWARD, DEFAULT_KEY_BACKWARD);
config_set_d(CONFIG_KEY_LEFT, DEFAULT_KEY_LEFT);
else if (strcmp(key, "wiimote_addr") == 0)
config_set_s(CONFIG_WIIMOTE_ADDR, val);
- else if (strcmp(key, "cheat") == 0)
+ else if (strcmp(key, "cheat") == 0)
config_set_d(CONFIG_CHEAT, atoi(val));
- else if (strcmp(key, "stats") == 0)
+ else if (strcmp(key, "stats") == 0)
config_set_d(CONFIG_STATS, atoi(val));
+ else if (strcmp(key, "uniform") == 0)
+ config_set_d(CONFIG_UNIFORM, atoi(val));
else if (strcmp(key, "contrib") == 0)
config_set_d(CONFIG_SHOW_CONTRIBUTIONS, atoi(val));
fprintf(fp, "stats %d\n",
option_d[CONFIG_STATS]);
+ fprintf(fp, "uniform %d\n",
+ option_d[CONFIG_UNIFORM]);
if (config_cheat())
fprintf(fp, "cheat %d\n", option_d[CONFIG_CHEAT]);
CONFIG_KEY_RESTART,
CONFIG_CHEAT,
CONFIG_STATS,
+ CONFIG_UNIFORM,
CONFIG_SHOW_CONTRIBUTIONS,
CONFIG_OPTION_D_COUNT
#define DEFAULT_KEY_PAUSE SDLK_SPACE
#define DEFAULT_KEY_RESTART SDLK_r
#define DEFAULT_STATS 0
+#define DEFAULT_UNIFORM 0
#define DEFAULT_SHOW_CONTRIBUTIONS 0
/*---------------------------------------------------------------------------*/