Skip to content

Commit

Permalink
[*] UKNCBTL: keyboard mask in KeyboardView.
Browse files Browse the repository at this point in the history
  • Loading branch information
nzeemin committed Feb 5, 2013
1 parent 8d9e700 commit 091e25e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion KeyboardView.cpp
Expand Up @@ -238,6 +238,8 @@ LRESULT CALLBACK KeyboardViewWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
void KeyboardView_OnDraw(HDC hdc)
{
HBITMAP hBmp = ::LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_KEYBOARD));
HBITMAP hBmpMask = ::LoadBitmap(g_hInst, MAKEINTRESOURCE(IDB_KEYBOARDMASK));

HDC hdcMem = ::CreateCompatibleDC(hdc);
HGDIOBJ hOldBitmap = ::SelectObject(hdcMem, hBmp);

Expand All @@ -249,7 +251,8 @@ void KeyboardView_OnDraw(HDC hdc)
int cyBitmap = (int) bitmap.bmHeight;
m_nKeyboardBitmapLeft = (rc.right - cxBitmap) / 2;
m_nKeyboardBitmapTop = (rc.bottom - cyBitmap) / 2;
::BitBlt(hdc, m_nKeyboardBitmapLeft, m_nKeyboardBitmapTop, cxBitmap,cyBitmap, hdcMem, 0,0, SRCCOPY);
::MaskBlt(hdc, m_nKeyboardBitmapLeft, m_nKeyboardBitmapTop, cxBitmap,cyBitmap, hdcMem, 0,0,
hBmpMask, 0, 0, MAKEROP4(SRCCOPY, SRCAND));

::SelectObject(hdcMem, hOldBitmap);
::DeleteDC(hdcMem);
Expand Down
3 changes: 2 additions & 1 deletion Resource.h
Expand Up @@ -23,6 +23,7 @@
#define IDD_SETTINGS 145
#define IDR_UKNC_ROM 147
#define IDD_DCB_EDITOR 148
#define IDB_KEYBOARDMASK 149
#define IDC_EDIT1 1000
#define IDC_BUILDDATE 1001
#define IDC_TRACKS40 1002
Expand Down Expand Up @@ -88,7 +89,7 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_NEXT_RESOURCE_VALUE 149
#define _APS_NEXT_RESOURCE_VALUE 150
#define _APS_NEXT_COMMAND_VALUE 32824
#define _APS_NEXT_CONTROL_VALUE 1026
#define _APS_NEXT_SYMED_VALUE 110
Expand Down
3 changes: 2 additions & 1 deletion UKNCBTL.rc
Expand Up @@ -311,6 +311,7 @@ END
IDB_UKNC BITMAP "UKNC.bmp"
IDB_KEYBOARD BITMAP "keyboard.bmp"
IDB_TOOLBAR BITMAP "Toolbar.bmp"
IDB_KEYBOARDMASK BITMAP "keyboardmask.bmp"

/////////////////////////////////////////////////////////////////////////////
//
Expand All @@ -327,7 +328,7 @@ IDR_UKNC_ROM BIN "uknc_rom.bin"
STRINGTABLE
BEGIN
IDS_APP_TITLE "UKNC Back to Life"
IDS_WELCOME "UKNC Back to Life emulator - Beta 38"
IDS_WELCOME "UKNC Back to Life emulator - Beta 39"
IDC_UKNCBTL "UKNCBTL"
END

Expand Down
4 changes: 4 additions & 0 deletions UKNCBTL.vcproj
Expand Up @@ -554,6 +554,10 @@
RelativePath=".\keyboard.bmp"
>
</File>
<File
RelativePath=".\keyboardmask.bmp"
>
</File>
<File
RelativePath=".\manifest.xml"
>
Expand Down
Binary file modified keyboard.bmp
Binary file not shown.
Binary file added keyboardmask.bmp
Binary file not shown.

0 comments on commit 091e25e

Please sign in to comment.