Thank you for your reply. I'll post what should be the relevant code.
This is an excerpt from my Load Map function that loads a Tree object from tree.bmp:
else if(choice==TREE){ tree[count]=DDLoadBitmap(pDD,"tree.BMP",0,0); top_frame[TREE][0]=1; bot_frame[TREE][0]=40; left_frame[TREE][0]=1; right_frame[TREE][0]=40; DDSetColorKey(tree[count], RGB(0, 0, 64)); curr_frame[TREE][count]=0; }
And this is an excerpt from the Draw function that draws each tree object. The count increment section does have 2 plus signs but they don't show up in my preview for some reason:
for(count=0; count<max_instant[TREE]; count++){ r.left = left_frame[TREE][curr_frame[TREE][count]];r.top = top_frame[TREE][curr_frame[TREE][count]];r.right = right_frame[TREE][curr_frame[TREE][count]];r.bottom = bot_frame[TREE][curr_frame[TREE][count]];lpBackBuffer->BltFast(unsigned long(position_x[TREE][count])-bit_offset, unsigned long(position_y[TREE][count])-bit_offset,tree[count], &r, DDBLTFAST_SRCCOLORKEY | DDBLTFAST_WAIT);
Maybe I should cast position_x[][]-bit_offset as an unsigned long instead of casting position_x[][] as an unsigned long and then subtracting bit_offset. position_x[][] is a float and bit_offset is an int. I never really paid attention to it before, but is my casting method poor here?
Also, it is inefficient to declare top_frame, bot_frame, etc for each Tree object, but that shouldn't be a problem.
If curr_frame[TREE][count] was something other than 0, an Invalid Rectangle would make sense. I am almost positive that this is not what happened, but I will make sure to verify.
Thanks