I have two child classes which are calling the same parent function.
One works fine, but the second call of it can't get past the al_convert_mask_to_alpha
line.
I'm bamboozled once again.
Does anyone know why this may be happening?
The function below is what they both call. With the declarations of both above it.
Monster* the_monster = new Monster("chard", 10, 10, "assets/monstertrans.bmp");
Hero* the_hero = new Hero(1, "Player", 20, 20, "assets/hero.bmp");
the_monster->Display();
the_hero->Display();
void Creature::Display(void)
{
//creating the bitmap
al_init_image_addon(); //allegro image addon
//FORGETTING THIS LINE WAS A SILLY IDEA!!!!
creature_bit = al_load_bitmap(m_filename.c_str());
al_convert_mask_to_alpha(creature_bit, al_map_rgb(255,0,255));
al_draw_bitmap(creature_bit, m_xpos, m_ypos, 0);
if (!creature_bit)
{
cout << "creature creation failed!" << endl;
cout << "Any key to exit" << endl;
_getch();
}
}