Code Cleanup

This commit is contained in:
mpohoreski
2011-01-08 04:21:36 +00:00
parent cbb3612837
commit 84d1c94680

View File

@@ -563,22 +563,25 @@ void CreateDIBSections ()
} }
g_hDeviceDC = CreateCompatibleDC(dc); g_hDeviceDC = CreateCompatibleDC(dc);
// CREATE THE FRAME BUFFER DIB SECTION // CREATE THE FRAME BUFFER DIB SECTION
if (g_hDeviceBitmap) if (g_hDeviceBitmap)
DeleteObject(g_hDeviceBitmap); DeleteObject(g_hDeviceBitmap);
g_hDeviceBitmap = CreateDIBSection(dc,g_pFramebufferinfo,DIB_RGB_COLORS, g_hDeviceBitmap = CreateDIBSection(
(LPVOID *)&g_pFramebufferbits,0,0); dc,g_pFramebufferinfo,DIB_RGB_COLORS,
SelectObject(g_hDeviceDC,g_hDeviceBitmap); (LPVOID *)&g_pFramebufferbits,0,0
);
SelectObject(g_hDeviceDC,g_hDeviceBitmap);
// CREATE THE SOURCE IMAGE DIB SECTION // CREATE THE SOURCE IMAGE DIB SECTION
HDC sourcedc = CreateCompatibleDC(dc); HDC sourcedc = CreateCompatibleDC(dc);
ReleaseDC(window,dc); ReleaseDC(window,dc);
if (g_hSourceBitmap) if (g_hSourceBitmap)
DeleteObject(g_hSourceBitmap); DeleteObject(g_hSourceBitmap);
g_hSourceBitmap = CreateDIBSection( g_hSourceBitmap = CreateDIBSection(
sourcedc,g_pSourceHeader,DIB_RGB_COLORS, sourcedc,g_pSourceHeader,DIB_RGB_COLORS,
(LPVOID *)&g_pSourcePixels,0,0); (LPVOID *)&g_pSourcePixels,0,0
SelectObject(sourcedc,g_hSourceBitmap); );
SelectObject(sourcedc,g_hSourceBitmap);
// CREATE THE OFFSET TABLE FOR EACH SCAN LINE IN THE SOURCE IMAGE // CREATE THE OFFSET TABLE FOR EACH SCAN LINE IN THE SOURCE IMAGE
for (int y = 0; y < MAX_SOURCE_Y; y++) for (int y = 0; y < MAX_SOURCE_Y; y++)