diff --git a/src/about.c b/src/about.c index f4b07c6..f0357d7 100644 --- a/src/about.c +++ b/src/about.c @@ -7,7 +7,7 @@ void About_Draw(struct Game *game) { al_draw_scaled_bitmap(game->about.image,0,0,al_get_bitmap_width(game->about.image),al_get_bitmap_height(game->about.image),0,0,al_get_display_width(game->display), al_get_display_height(game->display),0); - al_draw_scaled_bitmap(game->about.letter,0,0,al_get_bitmap_width(game->about.letter),al_get_bitmap_height(game->about.letter),0,0,al_get_display_width(game->display), al_get_display_height(game->display),0); + al_draw_scaled_bitmap(game->about.letter_bitmap,0,0,al_get_bitmap_width(game->about.letter_bitmap),al_get_bitmap_height(game->about.letter_bitmap),0,0,al_get_display_width(game->display), al_get_display_height(game->display),0); float x = game->about.x; if (x<0) x=0; al_draw_bitmap_region(game->about.text_bitmap, 0, x*al_get_bitmap_height(game->about.text_bitmap), al_get_bitmap_width(game->about.text_bitmap), al_get_display_height(game->display)*0.8, al_get_display_width(game->display)*0.5, al_get_display_height(game->display)*0.1, 0); @@ -45,7 +45,10 @@ int About_Keydown(struct Game *game, ALLEGRO_EVENT *ev) { void About_Preload(struct Game *game) { game->about.image =LoadFromCache(game, "table.png", al_get_display_width(game->display), al_get_display_height(game->display)); //game->about.image = al_load_bitmap( "data/table.png" ); + al_set_new_bitmap_flags(ALLEGRO_MEMORY_BITMAP); game->about.letter = al_load_bitmap( "data/letter.png" ); + al_set_new_bitmap_flags(ALLEGRO_MAG_LINEAR | ALLEGRO_MIN_LINEAR); + game->about.sample = al_load_sample( "data/about.flac" ); game->about.font = al_load_ttf_font("data/ShadowsIntoLight.ttf",al_get_display_height(game->display)*0.035,0 ); game->about.x = -0.1; @@ -110,11 +113,18 @@ void About_Preload(struct Game *game) { draw_text("or its associates."); game->about.fade_bitmap = al_create_bitmap(al_get_display_width(game->display), al_get_display_height(game->display)); + game->about.letter_bitmap = al_create_bitmap(al_get_display_width(game->display), al_get_display_height(game->display)); + al_set_target_bitmap(game->about.letter_bitmap); + ScaleBitmap(game->about.letter, al_get_display_width(game->display), al_get_display_height(game->display), 0.75); + al_destroy_bitmap(game->about.letter); + al_set_target_bitmap(game->about.fade_bitmap); al_draw_bitmap(game->about.image, 0, 0, 0); + al_draw_bitmap(game->about.letter_bitmap, 0, 0, 0); //al_draw_scaled_bitmap(game->about.image,0,0,al_get_bitmap_width(game->about.image),al_get_bitmap_height(game->about.image),0,0,al_get_display_width(game->display), al_get_display_height(game->display),0); - al_draw_scaled_bitmap(game->about.letter,0,0,al_get_bitmap_width(game->about.letter),al_get_bitmap_height(game->about.letter),0,0,al_get_display_width(game->display), al_get_display_height(game->display),0); + //ScaleBitmap(game->about.letter, al_get_display_width(game->display), al_get_display_height(game->display), 0.75); + //al_draw_scaled_bitmap(game->about.letter,0,0,al_get_bitmap_width(game->about.letter),al_get_bitmap_height(game->about.letter),0,0,al_get_display_width(game->display), al_get_display_height(game->display),0); al_draw_bitmap_region(game->about.text_bitmap, 0, 0, al_get_bitmap_width(game->about.text_bitmap), al_get_display_height(game->display)*0.8, al_get_display_width(game->display)*0.5, al_get_display_height(game->display)*0.1, 0); al_set_target_bitmap(al_get_backbuffer(game->display)); @@ -126,7 +136,7 @@ void About_Unload(struct Game *game) { game->about.fade_bitmap = al_create_bitmap(al_get_display_width(game->display), al_get_display_height(game->display)); al_set_target_bitmap(game->about.fade_bitmap); al_draw_scaled_bitmap(game->about.image,0,0,al_get_bitmap_width(game->about.image),al_get_bitmap_height(game->about.image),0,0,al_get_display_width(game->display), al_get_display_height(game->display),0); - al_draw_scaled_bitmap(game->about.letter,0,0,al_get_bitmap_width(game->about.letter),al_get_bitmap_height(game->about.letter),0,0,al_get_display_width(game->display), al_get_display_height(game->display),0); + al_draw_scaled_bitmap(game->about.letter_bitmap,0,0,al_get_bitmap_width(game->about.letter_bitmap),al_get_bitmap_height(game->about.letter_bitmap),0,0,al_get_display_width(game->display), al_get_display_height(game->display),0); al_draw_bitmap_region(game->about.text_bitmap, 0, game->about.x*al_get_bitmap_height(game->about.text_bitmap), al_get_bitmap_width(game->about.text_bitmap), al_get_display_height(game->display)*0.8, al_get_display_width(game->display)*0.5, al_get_display_height(game->display)*0.1, 0); al_set_target_bitmap(al_get_backbuffer(game->display)); int fadeloop; @@ -137,7 +147,7 @@ void About_Unload(struct Game *game) { al_flip_display(); } al_destroy_bitmap(game->about.image); - al_destroy_bitmap(game->about.letter); + al_destroy_bitmap(game->about.letter_bitmap); al_destroy_bitmap(game->about.fade_bitmap); al_destroy_bitmap(game->about.text_bitmap); al_destroy_sample(game->about.sample); diff --git a/src/main.h b/src/main.h index 9f89eb2..596f2e4 100644 --- a/src/main.h +++ b/src/main.h @@ -84,6 +84,7 @@ struct About { ALLEGRO_BITMAP *image; ALLEGRO_BITMAP *text_bitmap; ALLEGRO_BITMAP *letter; + ALLEGRO_BITMAP *letter_bitmap; ALLEGRO_SAMPLE *sample; ALLEGRO_FONT *font; float x;