use ANSI C gcc mode

This commit is contained in:
Sebastian Krzyszkowiak 2012-04-14 22:26:33 +02:00
parent 35a6a328bf
commit 555cc0b9e0
13 changed files with 60 additions and 78 deletions

View file

@ -1,6 +1,6 @@
IDIR =.
CC=gcc
CFLAGS=-I$(IDIR) -Wall -g
CFLAGS=-I$(IDIR) -Wall -ansi -g
SRCDIR=src
ODIR=obj

View file

@ -22,7 +22,7 @@
#include "about.h"
void About_Draw(struct Game *game) {
//PrintConsole(game, "%d", al_get_sample_instance_position(game->about.music));
/*PrintConsole(game, "%d", al_get_sample_instance_position(game->about.music));*/
if (al_get_sample_instance_position(game->about.music)<700000) { al_clear_to_color(al_map_rgba(0,0,0,0)); return; }
if (game->about.fadeloop>=0) {
al_draw_tinted_bitmap(game->about.fade_bitmap,al_map_rgba_f(game->about.fadeloop/255.0,game->about.fadeloop/255.0,game->about.fadeloop/255.0,1),0,0,0);

View file

@ -38,7 +38,6 @@ void FillPage(struct Game *game, int page) {
char filename[30] = { };
sprintf(filename, "data/intro/%d.flac", page);
//if (game->intro.audiostream) al_destroy_audio_stream(game->intro.audiostream);
game->intro.audiostream = al_load_audio_stream(filename, 4, 1024);
al_attach_audio_stream_to_mixer(game->intro.audiostream, game->audio.voice);
al_set_audio_stream_playing(game->intro.audiostream, false);
@ -118,24 +117,24 @@ void Intro_Draw(struct Game *game) {
al_clear_to_color(al_map_rgb(0,0,0));
if (game->intro.in_animation) {
AnimPage(game, game->intro.page);
al_draw_bitmap(game->intro.table, -1*al_get_display_width(game->display) + (cos(((-1*((game->intro.position)%al_get_display_width(game->display)))/(float)al_get_display_width(game->display))*(ALLEGRO_PI))/2.0)*al_get_display_width(game->display) + al_get_display_width(game->display)/2.0, 0, 0);//al_get_display_height(game->display)*((game->intro.position/3.0)/(float)al_get_display_width(game->display)), 0);
al_draw_bitmap(game->intro.animation, -1*al_get_display_width(game->display) + (cos(((-1*((game->intro.position)%al_get_display_width(game->display)))/(float)al_get_display_width(game->display))*(ALLEGRO_PI))/2.0)*al_get_display_width(game->display) + al_get_display_width(game->display)/2.0, 0, 0);//al_get_display_height(game->display)*((game->intro.position/3.0)/(float)al_get_display_width(game->display)), 0);
al_draw_bitmap(game->intro.table, -1*al_get_display_width(game->display) + (cos(((-1*((game->intro.position)%al_get_display_width(game->display)))/(float)al_get_display_width(game->display))*(ALLEGRO_PI))/2.0)*al_get_display_width(game->display) + al_get_display_width(game->display)/2.0, 0, 0);
al_draw_bitmap(game->intro.animation, -1*al_get_display_width(game->display) + (cos(((-1*((game->intro.position)%al_get_display_width(game->display)))/(float)al_get_display_width(game->display))*(ALLEGRO_PI))/2.0)*al_get_display_width(game->display) + al_get_display_width(game->display)/2.0, 0, 0);
}
else {
AnimPage(game, game->intro.page+1);
al_draw_bitmap(game->intro.table, 0, 0, 0); //al_get_display_height(game->display)*((game->intro.position/3.0)/(float)al_get_display_width(game->display)), 0);
al_draw_bitmap(game->intro.animation, 0, 0, 0); //al_get_display_height(game->display)*((game->intro.position/3.0)/(float)al_get_display_width(game->display)), 0);
al_draw_bitmap(game->intro.table, 0, 0, 0);
al_draw_bitmap(game->intro.animation, 0, 0, 0);
}
al_draw_text_with_shadow(game->intro.font, al_map_rgb(255,255,255), al_get_display_width(game->display)/2, al_get_display_height(game->display)*0.90, ALLEGRO_ALIGN_CENTRE, "Press any key to continue or escape to skip...");
//PrintConsole(game, "drawing");
/*PrintConsole(game, "drawing");*/
if (game->intro.in_animation) {
//PrintConsole(game, "animating");
/*PrintConsole(game, "animating");*/
int old = game->intro.position%al_get_display_width(game->display);
game->intro.position -= tps(game, 600);
//PrintConsole(game, "%d", game->intro.position%al_get_display_width(game->display));
/*PrintConsole(game, "%d", game->intro.position%al_get_display_width(game->display));*/
if (game->intro.position%al_get_display_width(game->display)>old) {
//DrawConsole(game);
//al_flip_display();
/*DrawConsole(game);
al_flip_display();*/
game->intro.in_animation = false;
FillPage(game, game->intro.page+1);
PrintConsole(game, "Animation finished.");
@ -233,12 +232,12 @@ void Intro_Unload(struct Game *game) {
for(fadeloop=255; fadeloop>=0; fadeloop-=tps(game, 600)){
al_wait_for_event(game->event_queue, &ev);
if (game->intro.in_animation) {
al_draw_tinted_bitmap(game->intro.table, al_map_rgba_f(fadeloop/255.0,fadeloop/255.0,fadeloop/255.0,1), -1*al_get_display_width(game->display) + (cos(((-1*((game->intro.position)%al_get_display_width(game->display)))/(float)al_get_display_width(game->display))*(3.1415))/2.0)*al_get_display_width(game->display) + al_get_display_width(game->display)/2.0, 0, 0); //al_get_display_height(game->display)*((game->intro.position/3.0)/(float)al_get_display_width(game->display)), 0);
al_draw_tinted_bitmap(game->intro.animation, al_map_rgba_f(fadeloop/255.0,fadeloop/255.0,fadeloop/255.0,1), -1*al_get_display_width(game->display) + (cos(((-1*((game->intro.position)%al_get_display_width(game->display)))/(float)al_get_display_width(game->display))*(3.1415))/2.0)*al_get_display_width(game->display) + al_get_display_width(game->display)/2.0, 0, 0); //al_get_display_height(game->display)*((game->intro.position/3.0)/(float)al_get_display_width(game->display)), 0);
al_draw_tinted_bitmap(game->intro.table, al_map_rgba_f(fadeloop/255.0,fadeloop/255.0,fadeloop/255.0,1), -1*al_get_display_width(game->display) + (cos(((-1*((game->intro.position)%al_get_display_width(game->display)))/(float)al_get_display_width(game->display))*(3.1415))/2.0)*al_get_display_width(game->display) + al_get_display_width(game->display)/2.0, 0, 0);
al_draw_tinted_bitmap(game->intro.animation, al_map_rgba_f(fadeloop/255.0,fadeloop/255.0,fadeloop/255.0,1), -1*al_get_display_width(game->display) + (cos(((-1*((game->intro.position)%al_get_display_width(game->display)))/(float)al_get_display_width(game->display))*(3.1415))/2.0)*al_get_display_width(game->display) + al_get_display_width(game->display)/2.0, 0, 0);
}
else {
al_draw_tinted_bitmap(game->intro.table, al_map_rgba_f(fadeloop/255.0,fadeloop/255.0,fadeloop/255.0,1), 0, 0, 0); //al_get_display_height(game->display)*((game->intro.position/3.0)/(float)al_get_display_width(game->display)), 0);
al_draw_tinted_bitmap(game->intro.animation, al_map_rgba_f(fadeloop/255.0,fadeloop/255.0,fadeloop/255.0,1), 0, 0, 0); //al_get_display_height(game->display)*((game->intro.position/3.0)/(float)al_get_display_width(game->display)), 0);
al_draw_tinted_bitmap(game->intro.table, al_map_rgba_f(fadeloop/255.0,fadeloop/255.0,fadeloop/255.0,1), 0, 0, 0);
al_draw_tinted_bitmap(game->intro.animation, al_map_rgba_f(fadeloop/255.0,fadeloop/255.0,fadeloop/255.0,1), 0, 0, 0);
}
DrawConsole(game);
al_flip_display();

View file

@ -25,7 +25,7 @@
#include "level.h"
#include "timeline.h"
// TODO: fix spritesheet speed to not depend on FPS
/* TODO: check if spritesheet speed still depends on FPS */
void Level_Passed(struct Game *game) {
if (game->level.current_level<6) {
@ -77,7 +77,6 @@ bool Stop(struct Game *game, struct TM_Action *action, enum TM_ActionState state
if (state != TM_ACTIONSTATE_RUNNING) return false;
game->level.speed=0;
game->level.sheet_speed = 0;
//game->level.sheet_pos = 0;
return true;
}
@ -105,11 +104,11 @@ void Level_Draw(struct Game *game) {
if (game->level.handle_input) {
if (al_key_down(&keyboard, ALLEGRO_KEY_UP)) {
game->level.derpy_y -= 0.005;
//PrintConsole(game, "Derpy Y position: %f", game->level.derpy_y);
/*PrintConsole(game, "Derpy Y position: %f", game->level.derpy_y);*/
}
if (al_key_down(&keyboard, ALLEGRO_KEY_DOWN)) {
game->level.derpy_y += 0.005;
//PrintConsole(game, "Derpy Y position: %f", game->level.derpy_y);
/*PrintConsole(game, "Derpy Y position: %f", game->level.derpy_y);*/
}
if (game->level.derpy_y > 0.5) game->level.sheet_speed = 0.0020/game->level.speed;
else game->level.sheet_speed=0;
@ -129,17 +128,12 @@ void Level_Draw(struct Game *game) {
al_clear_to_color(al_map_rgba(0,0,0,0));
al_draw_bitmap_region(game->level.derpy_walkcycle,al_get_bitmap_width(game->level.derpy)*(game->level.sheet_pos%game->level.sheet_cols),al_get_bitmap_height(game->level.derpy)*(game->level.sheet_pos/game->level.sheet_cols),al_get_bitmap_width(game->level.derpy), al_get_bitmap_height(game->level.derpy),0,0,0);
if (game->level.sheet_speed) {
//int i;
//for (i = 0; i < tps(game, 60); i++ ) {
game->level.sheet_tmp+=tps(game, 60);
//if (game->level.sheet_speed==1) game->level.sheet_pos++;
if (game->level.sheet_tmp >= game->level.sheet_speed) {
game->level.sheet_pos++;
game->level.sheet_tmp = 0;
//game->level.sheet_tmp -= game->level.sheet_speed;
}
if (game->level.sheet_pos>=game->level.sheet_cols*game->level.sheet_rows) game->level.sheet_pos=0;
//}
}
al_set_target_bitmap(al_get_backbuffer(game->display));
@ -231,18 +225,16 @@ bool Welcome(struct Game *game, struct TM_Action *action, enum TM_ActionState st
if (state == TM_ACTIONSTATE_INIT) {
*tmp = 0;
*in = true;
//PrintConsole(game, "WELCOME INIT");
/*PrintConsole(game, "WELCOME INIT");*/
}
else if (state == TM_ACTIONSTATE_RUNNING) {
//al_draw_text_with_shadow(game->font, al_map_rgb(255,255,255), *tmp, 20, 0, "Level 1");
//PrintConsole(game, "WELCOME RUNNING FADE=%f, IN=%d", *in);
/*PrintConsole(game, "WELCOME RUNNING FADE=%f, IN=%d", *in); */
int fade = *tmp;
if (fade>255) fade=255;
if (*tmp > 2048) { *tmp=255; *in=false; }
al_draw_tinted_bitmap(game->level.welcome, al_map_rgba_f(fade/255.0,fade/255.0,fade/255.0,fade/255.0), 0, 0, 0);
if (*in) {
*tmp+=tps(game, 600);
//if (*tmp>=256) { return false; }
} else {
*tmp-=tps(game, 600);
if (*tmp<=0) { return true; }
@ -294,14 +286,17 @@ void Level_Load(struct Game *game) {
TM_AddDelay(500);
TM_AddQueuedBackgroundAction(&Accelerate, NULL, 0, "accelerate");
TM_AddAction(&Fly, NULL, "fly");
/*
// Derpy walks in... (background - owl)
// Derpy reads a letter
// Letter on screen
// Derpy: fly! (background - accelerate)
*/
// first part gameplay goes here
/* first part gameplay goes here */
TM_AddDelay(60*1000);
/*
// wings disappear, deccelerate, fall down
// run
// show Fluttershy's house
@ -311,6 +306,7 @@ void Level_Load(struct Game *game) {
// cutscene goes here
//
*/
TM_AddAction(&PassLevel, NULL, "passlevel");
}
@ -381,7 +377,7 @@ void Level_PreloadBitmaps(struct Game *game) {
game->level.derpy = al_create_bitmap(al_get_display_width(game->display)*0.1953125, al_get_display_height(game->display)*0.25);
if (game->level.current_level!=1) Moonwalk_PreloadBitmaps(game);
else {
// TODO: handle strange display aspects
/* TODO: handle strange display aspects */
game->level.clouds = LoadScaledBitmap("levels/1/clouds.png", al_get_display_height(game->display)*4.73307291666666666667, al_get_display_height(game->display));
game->level.foreground = LoadScaledBitmap("levels/1/foreground.png", al_get_display_height(game->display)*4.73307291666666666667, al_get_display_height(game->display));
game->level.background = LoadScaledBitmap("levels/1/background.png", al_get_display_height(game->display)*4.73307291666666666667, al_get_display_height(game->display));

View file

@ -47,15 +47,11 @@ void Loading_Draw(struct Game *game) {
al_clear_to_color(al_map_rgb(0,0,0));
DrawConsole(game);
al_flip_display();
//al_rest(0.2);
LoadGameState(game);
}
void Loading_Load(struct Game *game) {
al_clear_to_color(al_map_rgb(0,0,0));
//al_draw_text_with_shadow(game->font, al_map_rgb(255,255,255), al_get_display_width(game->display)*0.0234, al_get_display_height(game->display)*0.85, ALLEGRO_ALIGN_LEFT, "Loading...");
//DrawConsole(game);
//al_flip_display();
game->loading.loading_bitmap = al_create_bitmap(al_get_display_width(game->display), al_get_display_height(game->display));

View file

@ -75,7 +75,6 @@ void PrintConsole(struct Game *game, char* format, ...) {
al_draw_text(game->font_console, al_map_rgb(255,255,255), al_get_display_width(game->display)*0.005, al_get_bitmap_height(game->console)*0.81, ALLEGRO_ALIGN_LEFT, text);
al_set_target_bitmap(game->console);
al_clear_to_color(al_map_rgba(0,0,0,0));
//al_draw_bitmap_region(game->console, 0, al_get_bitmap_height(game->console)*0.2, al_get_bitmap_width(game->console), al_get_bitmap_height(game->console)*0.8, 0, 0, 0);
al_draw_bitmap(con, 0, 0, 0);
al_set_target_bitmap(al_get_backbuffer(game->display));
al_destroy_bitmap(con);
@ -173,7 +172,7 @@ void ScaleBitmap(ALLEGRO_BITMAP* source, int width, int height) {
al_lock_bitmap(al_get_target_bitmap(), ALLEGRO_PIXEL_FORMAT_ANY, ALLEGRO_LOCK_WRITEONLY);
al_lock_bitmap(source, ALLEGRO_PIXEL_FORMAT_ANY, ALLEGRO_LOCK_READONLY);
//linear filtering code written by SiegeLord
/* linear filtering code written by SiegeLord */
ALLEGRO_COLOR interpolate(ALLEGRO_COLOR c1, ALLEGRO_COLOR c2, float frac) {
return al_map_rgba_f(c1.r + frac * (c2.r - c1.r),
@ -210,9 +209,9 @@ ALLEGRO_BITMAP* LoadScaledBitmap(char* filename, int width, int height) {
al_set_target_bitmap(target);
al_clear_to_color(al_map_rgba(0,0,0,0));
char origfn[255] = "data/";
//char cachefn[255] = "data/cache/";
/*char cachefn[255] = "data/cache/";*/
strcat(origfn, filename);
//strcat(cachefn, filename);
/*strcat(cachefn, filename);*/
void GenerateBitmap() {
al_set_new_bitmap_flags(ALLEGRO_MEMORY_BITMAP);
@ -220,21 +219,21 @@ ALLEGRO_BITMAP* LoadScaledBitmap(char* filename, int width, int height) {
al_set_new_bitmap_flags(ALLEGRO_MAG_LINEAR | ALLEGRO_MIN_LINEAR);
ScaleBitmap(source, width, height);
//al_save_bitmap(cachefn, target);
//PrintConsole(game, "Cache bitmap %s generated.", filename);
/*al_save_bitmap(cachefn, target);
PrintConsole(game, "Cache bitmap %s generated.", filename);*/
al_destroy_bitmap(source);
}
//source = al_load_bitmap( cachefn );
//if (source) {
// if ((al_get_bitmap_width(source)!=width) || (al_get_bitmap_height(source)!=height)) {
// al_destroy_bitmap(source);
/*source = al_load_bitmap( cachefn );
if (source) {
if ((al_get_bitmap_width(source)!=width) || (al_get_bitmap_height(source)!=height)) {
al_destroy_bitmap(source);*/
GenerateBitmap();
return target;
// }
// return source;
//} else GenerateBitmap();
//return target;
/* }
return source;
} else GenerateBitmap();
return target;*/
}
float tps(struct Game *game, float t) {
@ -299,8 +298,8 @@ int main(int argc, char **argv){
if(!al_init_image_addon()) {
fprintf(stderr, "failed to initialize image addon!\n");
//al_show_native_message_box(display, "Error", "Error", "Failed to initialize al_init_image_addon!",
// NULL, ALLEGRO_MESSAGEBOX_ERROR);
/*al_show_native_message_box(display, "Error", "Error", "Failed to initialize al_init_image_addon!",
NULL, ALLEGRO_MESSAGEBOX_ERROR);*/
return 0;
}
@ -334,7 +333,7 @@ int main(int argc, char **argv){
if (game.fullscreen) al_set_new_display_flags(ALLEGRO_FULLSCREEN_WINDOW);
else al_set_new_display_flags(ALLEGRO_WINDOWED);
al_set_new_display_option(ALLEGRO_VSYNC, 1, ALLEGRO_SUGGEST);
//al_set_new_display_option(ALLEGRO_OPENGL, 1, ALLEGRO_SUGGEST);
/*al_set_new_display_option(ALLEGRO_OPENGL, 1, ALLEGRO_SUGGEST);*/
game.display = al_create_display(game.width, game.height);
if(!game.display) {
fprintf(stderr, "failed to create display!\n");
@ -345,7 +344,6 @@ int main(int argc, char **argv){
al_inhibit_screensaver(true);
al_set_new_bitmap_flags(ALLEGRO_MAG_LINEAR | ALLEGRO_MIN_LINEAR);
//al_set_new_bitmap_format(ALLEGRO_PIXEL_FORMAT_ANY_32_WITH_ALPHA);
int ret = Shared_Load(&game);
if (ret!=0) return ret;

View file

@ -238,7 +238,6 @@ void PrintConsole(struct Game *game, char* format, ...);
/*! \brief Draws console bitmap on screen. */
void DrawConsole(struct Game *game);
//void ScaleBitmap(ALLEGRO_BITMAP* source, int width, int height);
ALLEGRO_BITMAP* LoadScaledBitmap(char* filename, int width, int height);
float tps(struct Game *game, float t);

View file

@ -148,7 +148,6 @@ void Map_Unload(struct Game *game) {
al_flip_display();
}
al_destroy_bitmap(game->map.map);
//al_destroy_bitmap(game->map.background);
al_destroy_bitmap(game->map.map_bg);
al_destroy_bitmap(game->map.highlight);
al_destroy_bitmap(game->map.arrow);

View file

@ -110,13 +110,12 @@ void Menu_Draw(struct Game *game) {
al_set_target_bitmap(game->menu.pinkcloud_bitmap);
al_clear_to_color(al_map_rgba(0,0,0,0));
float x = 1.5;//*(rand() / (float)RAND_MAX);
float x = 1.5;
int minus;
if (game->menu.cloud_position>0) minus=1; else minus=-1;
al_draw_bitmap(game->menu.rain_bitmap, fmod(minus*game->menu.cloud_position,3)*x*5+al_get_bitmap_width(game->menu.pinkcloud_bitmap)/2.7, al_get_bitmap_height(game->menu.pinkcloud_bitmap)*(0.88+(fmod(-1.8*(game->menu.cloud_position+80), 6))/20.0), 0);
al_draw_bitmap(game->menu.rain_bitmap, fmod(minus*game->menu.cloud_position,3)*x*3+al_get_bitmap_width(game->menu.pinkcloud_bitmap)/3.1, al_get_bitmap_height(game->menu.pinkcloud_bitmap)*(0.78+(fmod(-2.8*(game->menu.cloud_position+80), 4))/18.0), 0);
al_draw_scaled_bitmap(game->menu.rain_bitmap, 0, 0, al_get_bitmap_width(game->menu.rain_bitmap), al_get_bitmap_height(game->menu.rain_bitmap), fmod(minus*game->menu.cloud_position,3)*x*6+al_get_bitmap_width(game->menu.pinkcloud_bitmap)/2.1, al_get_bitmap_height(game->menu.pinkcloud_bitmap)*(0.87+(fmod(-4.9*(game->menu.cloud_position+80), 8))/26.0), al_get_bitmap_width(game->menu.pinkcloud_bitmap)*0.4, al_get_bitmap_height(game->menu.pinkcloud_bitmap)*0.08, 0);
//al_draw_scaled_bitmap(game->menu.rain, 0, 0, al_get_bitmap_width(game->menu.rain), al_get_bitmap_height(game->menu.rain), fmod(minus*game->menu.cloud_position,3)*x*6+al_get_bitmap_width(game->menu.pinkcloud_bitmap)/2.4, al_get_bitmap_height(game->menu.pinkcloud_bitmap)*(0.9+(fmod(-5*(game->menu.cloud_position+86), 8))/20.0), al_get_bitmap_width(game->menu.pinkcloud_bitmap)*0.35, al_get_bitmap_height(game->menu.pinkcloud_bitmap)*0.07, 0);
al_draw_bitmap(game->menu.pinkcloud, 0, 0, 0);
al_set_target_bitmap(al_get_backbuffer(game->display));
@ -196,9 +195,9 @@ void Menu_Preload(struct Game *game) {
exit(-1);
}
game->menu.pinkcloud_bitmap = al_create_bitmap(al_get_display_width(game->display)*0.33125, al_get_display_height(game->display)); // *0.8122);
game->menu.pinkcloud_bitmap = al_create_bitmap(al_get_display_width(game->display)*0.33125, al_get_display_height(game->display));
game->menu.pie_bitmap = al_create_bitmap(al_get_display_width(game->display)/2, al_get_display_height(game->display)); //*0.8122);
game->menu.pie_bitmap = al_create_bitmap(al_get_display_width(game->display)/2, al_get_display_height(game->display));
al_set_target_bitmap(game->menu.pie_bitmap);
al_clear_to_color(al_map_rgba(0,0,0,0));
al_draw_scaled_bitmap(game->menu.pie, 0, 0, al_get_bitmap_width(game->menu.pie), al_get_bitmap_height(game->menu.pie), al_get_bitmap_width(game->menu.pie_bitmap)*0.5, 0, al_get_display_width(game->display)*0.11875, al_get_display_height(game->display)*0.0825, 0);
@ -223,7 +222,6 @@ void Menu_Stop(struct Game* game) {
ALLEGRO_EVENT ev;
float fadeloop;
for(fadeloop=0; fadeloop<256; fadeloop+=tps(game, 600)){
//if ((game->menu.draw_while_fading) || (fadeloop==255)) {
al_wait_for_event(game->event_queue, &ev);
Menu_Draw(game);
al_draw_tinted_bitmap(game->menu.menu_fade_bitmap,al_map_rgba_f(1,1,1,fadeloop/255.0),0,0,0);

View file

@ -35,11 +35,9 @@ void Moonwalk_Draw(struct Game *game) {
if (game->level.current_level<6) {
game->gamestate = GAMESTATE_LOADING;
game->loadstate = GAMESTATE_MAP;
//LoadGameState(game);
} else {
game->gamestate = GAMESTATE_LOADING;
game->loadstate = GAMESTATE_ABOUT;
//LoadGameState(game);
}
return; }
int i;

View file

@ -79,7 +79,6 @@ void Pause_Load(struct Game* game) {
al_clear_to_color(al_map_rgb(0,0,0));
al_set_target_bitmap(al_get_backbuffer(game->display));
al_draw_tinted_bitmap(fade,al_map_rgba_f(1,1,1,0.75),0,0,0);
//al_draw_text_with_shadow(game->font, al_map_rgb(255,255,255), al_get_display_width(game->display)*0.5, al_get_display_height(game->display)*0.5, ALLEGRO_ALIGN_CENTRE,"Game paused!");
game->pause.bitmap = al_create_bitmap(al_get_display_width(game->display), al_get_display_height(game->display));
al_set_target_bitmap(game->pause.bitmap);
al_draw_bitmap(al_get_backbuffer(game->display), 0, 0, 0);

View file

@ -39,8 +39,10 @@ void TM_Init(struct Game* g) {
void TM_Process() {
if (!game) return;
if (paused) return;
// process first element from queue
// if returns true, then delete it
/*
process first element from queue
if returns true, then delete it
*/
if (queue) {
if (*queue->function) {
queue->active = true;
@ -55,7 +57,7 @@ void TM_Process() {
if (queue) PrintConsole(game, "Timeline Manager: queue: run action (%d - %s)", queue->id, queue->name);
}
} else {
// delay
/* delay handling */
if (queue->active) {
struct TM_Action *tmp = queue;
queue = queue->next;
@ -67,7 +69,7 @@ void TM_Process() {
}
}
}
// process all elements from background marked as active
/* process all elements from background marked as active */
struct TM_Action *tmp, *tmp2, *pom = background;
tmp = NULL;
while (pom!=NULL) {
@ -84,7 +86,7 @@ void TM_Process() {
}
}
} else {
// delay
/* delay handling */
if (tmp) {
tmp->next = pom->next;
} else {

View file

@ -30,7 +30,6 @@ enum TM_ActionState {
struct TM_Arguments {
void *value;
struct TM_Arguments *next;
//*prev;
};
struct TM_Action {
@ -42,7 +41,6 @@ struct TM_Action {
struct TM_Action *next;
unsigned int id;
char* name;
//*prev;
};
void TM_Init(struct Game* game);