From 84d1c946805e3659a648f101acf696713ba3e948 Mon Sep 17 00:00:00 2001 From: mpohoreski Date: Sat, 8 Jan 2011 04:21:36 +0000 Subject: [PATCH] Code Cleanup --- AppleWin/source/Video.cpp | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/AppleWin/source/Video.cpp b/AppleWin/source/Video.cpp index a090f448..358e7884 100644 --- a/AppleWin/source/Video.cpp +++ b/AppleWin/source/Video.cpp @@ -563,22 +563,25 @@ void CreateDIBSections () } g_hDeviceDC = CreateCompatibleDC(dc); - // CREATE THE FRAME BUFFER DIB SECTION - if (g_hDeviceBitmap) - DeleteObject(g_hDeviceBitmap); - g_hDeviceBitmap = CreateDIBSection(dc,g_pFramebufferinfo,DIB_RGB_COLORS, - (LPVOID *)&g_pFramebufferbits,0,0); - SelectObject(g_hDeviceDC,g_hDeviceBitmap); + // CREATE THE FRAME BUFFER DIB SECTION + if (g_hDeviceBitmap) + DeleteObject(g_hDeviceBitmap); + g_hDeviceBitmap = CreateDIBSection( + dc,g_pFramebufferinfo,DIB_RGB_COLORS, + (LPVOID *)&g_pFramebufferbits,0,0 + ); + SelectObject(g_hDeviceDC,g_hDeviceBitmap); - // CREATE THE SOURCE IMAGE DIB SECTION - HDC sourcedc = CreateCompatibleDC(dc); - ReleaseDC(window,dc); - if (g_hSourceBitmap) - DeleteObject(g_hSourceBitmap); - g_hSourceBitmap = CreateDIBSection( - sourcedc,g_pSourceHeader,DIB_RGB_COLORS, - (LPVOID *)&g_pSourcePixels,0,0); - SelectObject(sourcedc,g_hSourceBitmap); + // CREATE THE SOURCE IMAGE DIB SECTION + HDC sourcedc = CreateCompatibleDC(dc); + ReleaseDC(window,dc); + if (g_hSourceBitmap) + DeleteObject(g_hSourceBitmap); + g_hSourceBitmap = CreateDIBSection( + sourcedc,g_pSourceHeader,DIB_RGB_COLORS, + (LPVOID *)&g_pSourcePixels,0,0 + ); + SelectObject(sourcedc,g_hSourceBitmap); // CREATE THE OFFSET TABLE FOR EACH SCAN LINE IN THE SOURCE IMAGE for (int y = 0; y < MAX_SOURCE_Y; y++)