projects
/
neverball
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Correct logic of BSP back/front tests
[neverball]
/
share
/
state.c
diff --git
a/share/state.c
b/share/state.c
index
d65b7c9
..
a4073af
100644
(file)
--- a/
share/state.c
+++ b/
share/state.c
@@
-21,6
+21,11
@@
static float state_time;
static struct state *state;
static float state_time;
static struct state *state;
+struct state *curr_state(void)
+{
+ return state;
+}
+
float time_state(void)
{
return state_time;
float time_state(void)
{
return state_time;
@@
-47,9
+52,9
@@
int goto_state(struct state *st)
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
-void st_paint(void)
+void st_paint(float t)
{
{
- int stereo = config_get_d(CONFIG_STEREO);
+ int stereo = config_get_d(CONFIG_STEREO);
if (state && state->paint)
{
if (state && state->paint)
{
@@
-57,16
+62,16
@@
void st_paint(void)
{
glDrawBuffer(GL_BACK_LEFT);
config_clear();
{
glDrawBuffer(GL_BACK_LEFT);
config_clear();
- state->paint(state->gui_id, (float) (+stereo));
+ state->paint(state->gui_id, t);
glDrawBuffer(GL_BACK_RIGHT);
config_clear();
glDrawBuffer(GL_BACK_RIGHT);
config_clear();
- state->paint(state->gui_id, (float) (-stereo));
+ state->paint(state->gui_id, t);
}
else
{
config_clear();
}
else
{
config_clear();
- state->paint(state->gui_id, 0.0f);
+ state->paint(state->gui_id, t);
}
}
}
}
}
}
@@
-91,6
+96,12
@@
void st_stick(int a, int k)
state->stick(state->gui_id, a, k);
}
state->stick(state->gui_id, a, k);
}
+void st_angle(int x, int z)
+{
+ if (state && state->angle)
+ state->angle(state->gui_id, x, z);
+}
+
/*---------------------------------------------------------------------------*/
int st_click(int b, int d)
/*---------------------------------------------------------------------------*/
int st_click(int b, int d)