This one goes in the d'oh files: I was drawing the bitmap elements to layer 7 but the bitmap itself was being drawn on layer 6. When I pointed Screen->DrawBitmap() to layer 7 the warning went away.
Bitmaps don't have physical layers. In fact, there are no real layers in ZC. The layer system is just a way of sorting internal drawing orders, so, what might be happening, is that when you set up the bitmap and draw to it on layer 7, the actual draw isn't enqueued until after your layer 6 draws.
You can just draw to layer 0 on your bitmaps, and then blit the bitmap to any layer of the screen. It doesn't matter that your bitmap draws at done on layer 0 in this case. What does matter, is how ZC enqueues all of your layer draws. Until you have drawn something to a bitmap, or set it up by calling SetRendertarget(), it doesn't exist as a valid pointer.
You can do this, to initialise all of your system bitmaps:
void InitBitmaps()
{
for ( int q = RT_BITMAP1; q <= RT_BITMAP6; ++q )
{
Screen->SetRenderTarget(q);
Screen->PutPixel(0,0,0,0,0,0,0,128);
}
Screen->SetRanderTarget(RT_SCREEN);
}
Call that in your init script, and our onContinue script, and you should never encounter this issue again; however, be aware that script draws happen in layer order.
I typically draw only to layer 0 on bitmaps anyway, and I manually set up by draw ordering.