-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathconsole.cpp
More file actions
47 lines (37 loc) · 1.18 KB
/
console.cpp
File metadata and controls
47 lines (37 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "shared.h"
#include "resource.h"
static HBITMAP hBitmap = NULL;
extern HINSTANCE hInstance;
extern HMODULE hModule;
LRESULT CALLBACK ConsoleWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
int wmId, wmEvent;
switch (message) {
case WM_CREATE:
hBitmap = (HBITMAP)LoadImageA((HINSTANCE)hModule, MAKEINTRESOURCE(IDB_BITMAP1), IMAGE_BITMAP, 0, 0, LR_SHARED | LR_COPYFROMRESOURCE);
break;
case WM_PAINT:
PAINTSTRUCT ps;
HDC hdc;
BITMAP bitmap;
HDC hdcMem;
HGDIOBJ oldBitmap;
hdc = BeginPaint(hWnd, &ps);
hdcMem = CreateCompatibleDC(hdc);
oldBitmap = SelectObject(hdcMem, hBitmap);
GetObject(hBitmap, sizeof(bitmap), &bitmap);
BitBlt(hdc, 0, 0, bitmap.bmWidth, bitmap.bmHeight, hdcMem, 0, 0, SRCCOPY);
SelectObject(hdcMem, oldBitmap);
DeleteDC(hdcMem);
EndPaint(hWnd, &ps);
break;
case WM_DESTROY:
DeleteObject(hBitmap);
break;
}
LRESULT CALLBACK ret = ((LRESULT(CALLBACK *)(HWND, UINT, WPARAM, LPARAM))0x465E80)(hWnd, message, wParam, lParam);
return ret;
}
void Con_DrawSolidConsole(float frac) {
extern cvar_t *cl_console_fraction;
((void(*)(float))0x409F30)(frac * cl_console_fraction->value);
}