HMENU CreateMyMenu (HINSTANCE hInstance) { HBITMAP hBitmap ; HMENU hMenu, hMenuPopup ; int i ; hMenu = CreateMenu () ; hMenuPopup = LoadMenu (hInstance, TEXT ("MenuFile")) ; hBitmap = StretchBitmap (LoadBitmap (hInstance, TEXT ("BitmapFile"))) ; AppendMenu (hMenu, MF_BITMAP | MF_POPUP, (int) hMenuPopup, (PTSTR) (LONG) hBitmap) ; hMenuPopup = LoadMenu (hInstance, TEXT ("MenuEdit")) ; hBitmap = StretchBitmap (LoadBitmap (hInstance, TEXT ("BitmapEdit"))) ; AppendMenu (hMenu, MF_BITMAP | MF_POPUP, (int) hMenuPopup, (PTSTR) (LONG) hBitmap) ; hMenuPopup = CreateMenu () ; for (i = 0 ; i < 3 ; i++) { hBitmap = GetBitmapFont (i) ; AppendMenu (hMenuPopup, MF_BITMAP, IDM_FONT_COUR + i, (PTSTR) (LONG) hBitmap) ; } hBitmap = StretchBitmap (LoadBitmap (hInstance, TEXT ("BitmapFont"))) ; AppendMenu (hMenu, MF_BITMAP | MF_POPUP, (int) hMenuPopup, (PTSTR) (LONG) hBitmap) ; return hMenu ; }
void ZOMBIE::Render(BUFFER &pBuffer, POINT mappos) { if (!dead) { //if unit on screen draw unit if ((pos.x + size.x > mappos.x) && (pos.x < mappos.x + WIDTH) && (pos.y + size.y > mappos.y) && (pos.y < mappos.y + HEIGHT)) { //draw unit TransparentStretchBitmap(pBuffer, pic, pos.x - mappos.x, pos.y - mappos.y, size.x, size.y, 0, 0, imagesize.x, imagesize.y); //if unit selected if (selected) { //draw area around unit (works in the same way as mouse drag area) StretchBitmap(pBuffer, 3, pos.x - mappos.x, pos.y - mappos.y, size.x, 1, 0, 0, 1, 1); StretchBitmap(pBuffer, 3, pos.x - mappos.x, pos.y + size.y - mappos.y - 1, size.x, 1, 0, 0, 1, 1); StretchBitmap(pBuffer, 3, pos.x - mappos.x, pos.y - mappos.y, 1, size.y, 0, 0, 1, 1); StretchBitmap(pBuffer, 3, pos.x + size.x - mappos.x - 1, pos.y - mappos.y, 1, size.y, 0, 0, 1, 1); StretchBitmap(pBuffer, 0, pos.x - mappos.x + 1, pos.y + size.y - mappos.y - 3, (size.x - 2) * ((float)health/(float)maxHealth), 3, 0, 0, 1, 1); } } } }
void AddHelpToSys (HINSTANCE hInstance, HWND hwnd) { HBITMAP hBitmap ; HMENU hMenu ; hMenu = GetSystemMenu (hwnd, FALSE); hBitmap = StretchBitmap (LoadBitmap (hInstance, TEXT ("BitmapHelp"))) ; AppendMenu (hMenu, MF_SEPARATOR, 0, NULL) ; AppendMenu (hMenu, MF_BITMAP, IDM_HELP, (PTSTR) (LONG) hBitmap) ; }