X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=share%2Fstate.c;h=a4073af4462690543761a8181d20796517087e92;hb=1745b6a90dfd9e626e5c40d20c6aa595ec41d888;hp=d65b7c9d72991376fd5d7e36ea814008fc26b8c7;hpb=70a7d71562ecf00d04102ff6da28350910f1995a;p=neverball diff --git a/share/state.c b/share/state.c index d65b7c9..a4073af 100644 --- a/share/state.c +++ b/share/state.c @@ -21,6 +21,11 @@ static float state_time; static struct state *state; +struct state *curr_state(void) +{ + return state; +} + 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) { @@ -57,16 +62,16 @@ void st_paint(void) { 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(); - state->paint(state->gui_id, (float) (-stereo)); + state->paint(state->gui_id, t); } 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); } +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)