Changeset View
Changeset View
Standalone View
Standalone View
source/lib/sysdep/os/win/wcursor.cpp
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
Status sys_cursor_create(int w, int h, void* bgra_img, int hx, int hy, sys_cursor* cursor) | Status sys_cursor_create(int w, int h, void* bgra_img, int hx, int hy, sys_cursor* cursor) | ||||
{ | { | ||||
// alpha-blended cursors do not work on a 16-bit display | // alpha-blended cursors do not work on a 16-bit display | ||||
// (they get drawn as a black square), so refuse to load the | // (they get drawn as a black square), so refuse to load the | ||||
// cursor in that case | // cursor in that case | ||||
int bpp = 0; | int bpp = 0; | ||||
RETURN_STATUS_IF_ERR(gfx::GetVideoMode(NULL, NULL, &bpp, NULL)); | RETURN_STATUS_IF_ERR(gfx::GetVideoMode(nullptr, nullptr, &bpp, nullptr)); | ||||
if (bpp <= 16) | if (bpp <= 16) | ||||
return ERR::FAIL; | return ERR::FAIL; | ||||
return sys_cursor_create_common(w, h, bgra_img, NULL, hx, hy, cursor); | return sys_cursor_create_common(w, h, bgra_img, nullptr, hx, hy, cursor); | ||||
} | } | ||||
Status sys_cursor_create_empty(sys_cursor* cursor) | Status sys_cursor_create_empty(sys_cursor* cursor) | ||||
{ | { | ||||
// the mask gets ignored on 32-bit displays, but is used on 16-bit displays; | // the mask gets ignored on 32-bit displays, but is used on 16-bit displays; | ||||
// setting it to 0xFF makes the cursor invisible (though I'm not quite | // setting it to 0xFF makes the cursor invisible (though I'm not quite | ||||
// sure why it's that way round) | // sure why it's that way round) | ||||
u8 bgra_img[] = {0, 0, 0, 0}; | u8 bgra_img[] = {0, 0, 0, 0}; | ||||
Show All 38 Lines |
Wildfire Games · Phabricator