cosmetics and docs

This commit is contained in:
Sebastian Krzyszkowiak 2012-09-29 03:44:36 +02:00
parent 986378ec53
commit bedba9deb5
2 changed files with 6 additions and 14 deletions

View file

@ -180,32 +180,25 @@ bool Letter(struct Game *game, struct TM_Action *action, enum TM_ActionState sta
al_set_audio_stream_playing(*stream, false); al_set_audio_stream_playing(*stream, false);
al_set_audio_stream_gain(*stream, 2.00); al_set_audio_stream_gain(*stream, 2.00);
action->arguments->next->next = NULL; action->arguments->next->next = NULL;
} } else if (state == TM_ACTIONSTATE_DESTROY) {
else if (state == TM_ACTIONSTATE_DESTROY) {
ALLEGRO_AUDIO_STREAM** stream = (ALLEGRO_AUDIO_STREAM**)action->arguments->next->value; ALLEGRO_AUDIO_STREAM** stream = (ALLEGRO_AUDIO_STREAM**)action->arguments->next->value;
al_set_audio_stream_playing(*stream, false); al_set_audio_stream_playing(*stream, false);
al_destroy_audio_stream(*stream); al_destroy_audio_stream(*stream);
free(action->arguments->next->value); free(action->arguments->next->value);
free(action->arguments->value); free(action->arguments->value);
TM_DestroyArgs(action->arguments); TM_DestroyArgs(action->arguments);
} } else if (state == TM_ACTIONSTATE_DRAW) {
else if (state == TM_ACTIONSTATE_DRAW) {
float* f = (float*)action->arguments->value; float* f = (float*)action->arguments->value;
al_draw_tinted_bitmap(game->level.letter, al_map_rgba(*f,*f,*f,*f), (game->viewportWidth-al_get_bitmap_width(game->level.letter))/2.0, al_get_bitmap_height(game->level.letter)*-0.05, 0); al_draw_tinted_bitmap(game->level.letter, al_map_rgba(*f,*f,*f,*f), (game->viewportWidth-al_get_bitmap_width(game->level.letter))/2.0, al_get_bitmap_height(game->level.letter)*-0.05, 0);
return false; return false;
} } else if (state == TM_ACTIONSTATE_PAUSE) {
else if (state == TM_ACTIONSTATE_PAUSE) {
ALLEGRO_AUDIO_STREAM** stream = (ALLEGRO_AUDIO_STREAM**)action->arguments->next->value; ALLEGRO_AUDIO_STREAM** stream = (ALLEGRO_AUDIO_STREAM**)action->arguments->next->value;
al_set_audio_stream_playing(*stream, false); al_set_audio_stream_playing(*stream, false);
} else if (state == TM_ACTIONSTATE_RESUME) { } else if ((state == TM_ACTIONSTATE_RESUME) || (state == TM_ACTIONSTATE_START)) {
ALLEGRO_AUDIO_STREAM** stream = (ALLEGRO_AUDIO_STREAM**)action->arguments->next->value; ALLEGRO_AUDIO_STREAM** stream = (ALLEGRO_AUDIO_STREAM**)action->arguments->next->value;
al_set_audio_stream_playing(*stream, true); al_set_audio_stream_playing(*stream, true);
} } else if (state != TM_ACTIONSTATE_RUNNING) return false;
else if (state == TM_ACTIONSTATE_START) {
ALLEGRO_AUDIO_STREAM** stream = (ALLEGRO_AUDIO_STREAM**)action->arguments->next->value;
al_set_audio_stream_playing(*stream, true);
}
else if (state != TM_ACTIONSTATE_RUNNING) return false;
float* f = (float*)action->arguments->value; float* f = (float*)action->arguments->value;
*f+=5; *f+=5;
if (*f>255) *f=255; if (*f>255) *f=255;

View file

@ -25,7 +25,6 @@
unsigned int lastid; unsigned int lastid;
struct Game* game = NULL; struct Game* game = NULL;
struct TM_Action *queue, *background; struct TM_Action *queue, *background;
// TODO: consider moving globals to some structure
void TM_Init(struct Game* g) { void TM_Init(struct Game* g) {
PrintConsole(g, "Timeline Manager: init"); PrintConsole(g, "Timeline Manager: init");