the problem is that in the set of if-statements (not the one in the function), the second two situations never are true. the code in them is never executed. but, i know that i am actually checking for the right things because if i put an exit(0) in the one that checks for page1, it exits. if i put exit(0) in the others, it never exits. in the beginning i set active_page to page 1 with: active_page = page1;
now, will that make things actually go to page1, not active_page when i blit like this:
masked_blit(ship, active_page, 0,0, x, y,640,480);
???? (because thats what i want to happen)
get what i mean? i want things to always blit to either page1 2 or 3, not actually onto active_page. active_page is used for telling what page to blit to.
Code:
BITMAP *ship, *page1, *page2, *page3, *active_page, *title;
flip_page(&wPage, &page1, &page2, &page3, &active_page);
if(active_page == page1) //this statement WORKS OK
{
clean_bitmap(page3);
}
if(active_page == page2) //statement never becomes TRUE
{
clean_bitmap(page1);
}
if(active_page == page3)
{
clean_bitmap(page2);
}
void flip_page(int *wPage, BITMAP** page1, BITMAP** page2, BITMAP** page3, BITMAP** active_page)
{
if(*active_page == *page1)
{
active_page = page2;
*wPage = 2;
}
if(*active_page == *page2)
{
active_page = page3;
*wPage = 3;
}
if(*active_page == *page3)
{
active_page = page1;
*wPage = 1;
}
}
END_OF_FUNCTION(flip_page);