Ok, here's what I see...
First off, the following code makes no sense to me:
for ( i =0; i < MAX_SIZE; i++ )
{
for ( j = 0; j < MAX_SIZE; j++ )
{
dbDeleteImage( Cell::EMPTY );
}
}
Are you trying to erase the image from the screen?
Second, you really don't need to dbLoadImage() every-time you call DrawField(). Call the dbLoadImage() once (before your first call to LocateShips() to save some CPU cycles - and possibly [not quite sure on this] some memory thrashing)...
And finally, to answer your question:
dbPasteImage() will paste the current image to the current bitmap; that is, whatever bitmap was set with the last call to dbSetBitmap(). So, my suggestion is to add the following lines:
int cur_bmp = dbCurrentBitmap();
dbSetBitmap(0); /* Set to update the screen (back-buffer) */
before the switch() statement in the DrawField() function...
and then after the switch() statement, add the following line:
dbSetCurrentBitmap(cur_bmp);
to restore the "current bitmap" to its original state.
Beyond that, I really don't see anything wrong with the code...
Hope this helps,
JTK
EDIT: Note - If you call dbCreateBitmap() at any point, the newly created bitmap becomes the return value of dbCurrentBitmap() - so, even if you haven't specifically called dbSetCurrentBitmap() you may still lose the *default* current-bitmap value of 0...