Now that is exactly what I meant with "fucking things up later on".

The reason for your two "distinct" bitmaps is the order you're doing your calls in. You copy the memory area while the DirectX Texture of the bitmap has not yet been allocated. Hence the engine will find NULL when inspecting the bitmaps and will hence allocate two textures for the same image data located in the BMAP.pixel member. The pixel_to_bmap instruction will now operate on the texture rather than on the original image data. As long as both bitmaps will remain in the video memory it will look as if there are two bitmaps because there are two textures. You're lucky in this case that the DirectX Texture was not yet allocated. Still don't believe it? Place a "bmap_preload(bmp_original);" right after the wait in your main function. You'll get a very "surprising" result.

Seriously: Several experienced forum members warned you not to mess up with internal engine data and you did it anyways and got results you we're not able to understand. Does that ring a bell for you?


Always learn from history, to be sure you make the same mistakes again...