render_map: select and deselect bitmap screen object each iteration from DC

The wx docs say that,

   ...before performing any other operations on the bitmap data, the
   bitmap must be selected out of the memory DC

which we immediately do right after when we fetch the raw pixel data.
So it therefore seems more semantically correct to deselect the bitmap
before running other non-DC operations, and re-selecting it again
before drawing a new room into it.

(Thanks Brad for the insight.)
1 files changed, 4 insertions(+), 3 deletions(-)

M tool_map.cpp
M tool_map.cpp +4 -3
@@ 264,6 264,8 @@ void MapPicker::OnClose(wxCloseEvent& ev
 
 bool MapPicker::render_map(Data* data, int phase, unsigned char render[MAP_RENDER_SIZE], wxProgressDialog& progress)
 {
+	wxBitmap screen(256*4,240*2,24);
+	wxMemoryDC dc(screen);
 	wxColour background(0x000000UL);
 
 	// clear render

          
@@ 301,13 303,12 @@ bool MapPicker::render_map(Data* data, i
 			}
 
 			bool second = x != room->coord_x; // second half of scrolling room
-			wxBitmap screen(256*4,240*2,24);
-			wxMemoryDC dc(screen);
-
+			dc.SelectObject(screen);
 			dc.SetBackground(background);
 			dc.Clear();
 
 			EditRoom::render_room(data,room,phase,dc);
+			dc.SelectObject(wxNullBitmap);
 			wxNativePixelData raw_bmp(screen);
 			if (!raw_bmp) return false;