mirror of https://gitlab.com/nakst/essence
new text cursor
This commit is contained in:
parent
a60f0cea09
commit
c84b5aa60b
|
@ -6851,13 +6851,12 @@ bool UISetCursor(EsWindow *window) {
|
||||||
CURSOR(default, 23, 18, 1, 1, 15, 24);
|
CURSOR(default, 23, 18, 1, 1, 15, 24);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool _xor = cursorStyle == ES_CURSOR_TEXT;
|
bool shadow = cursorStyle != ES_CURSOR_TEXT && api.global->showCursorShadow;
|
||||||
bool shadow = !_xor && api.global->showCursorShadow;
|
|
||||||
|
|
||||||
return EsSyscall(ES_SYSCALL_WINDOW_SET_CURSOR, window->handle,
|
return EsSyscall(ES_SYSCALL_WINDOW_SET_CURSOR, window->handle,
|
||||||
(uintptr_t) theming.cursors.bits + x * 4 + y * theming.cursors.stride,
|
(uintptr_t) theming.cursors.bits + x * 4 + y * theming.cursors.stride,
|
||||||
((0xFF & ox) << 0) | ((0xFF & oy) << 8) | ((0xFF & w) << 16) | ((0xFF & h) << 24),
|
((0xFF & ox) << 0) | ((0xFF & oy) << 8) | ((0xFF & w) << 16) | ((0xFF & h) << 24),
|
||||||
theming.cursors.stride | ((uint32_t) _xor << 31) | ((uint32_t) shadow << 30));
|
theming.cursors.stride | ((uint32_t) shadow << 30));
|
||||||
}
|
}
|
||||||
|
|
||||||
void UIProcessWindowManagerMessage(EsWindow *window, EsMessage *message, ProcessMessageTiming *timing) {
|
void UIProcessWindowManagerMessage(EsWindow *window, EsMessage *message, ProcessMessageTiming *timing) {
|
||||||
|
|
|
@ -68,8 +68,7 @@ void GraphicsUpdateScreen(K_USER_BUFFER void *bits, EsRectangle *bounds, uintptr
|
||||||
windowManager.changedCursorImage = false;
|
windowManager.changedCursorImage = false;
|
||||||
|
|
||||||
int cursorImageWidth = windowManager.cursorSurface.width, cursorImageHeight = windowManager.cursorSurface.height;
|
int cursorImageWidth = windowManager.cursorSurface.width, cursorImageHeight = windowManager.cursorSurface.height;
|
||||||
sourceSurface->Draw(&windowManager.cursorSurface, ES_RECT_4(cursorX, cursorX + cursorImageWidth, cursorY, cursorY + cursorImageHeight), 0, 0,
|
sourceSurface->Draw(&windowManager.cursorSurface, ES_RECT_4(cursorX, cursorX + cursorImageWidth, cursorY, cursorY + cursorImageHeight), 0, 0, 0xFF);
|
||||||
windowManager.cursorXOR ? ES_DRAW_BITMAP_XOR : 0xFF);
|
|
||||||
|
|
||||||
if (bits) {
|
if (bits) {
|
||||||
graphics.target->updateScreen((K_USER_BUFFER const uint8_t *) bits,
|
graphics.target->updateScreen((K_USER_BUFFER const uint8_t *) bits,
|
||||||
|
|
|
@ -1039,7 +1039,6 @@ SYSCALL_IMPLEMENT(ES_SYSCALL_WINDOW_SET_CURSOR) {
|
||||||
windowManager.cursorID = argument1;
|
windowManager.cursorID = argument1;
|
||||||
windowManager.cursorImageOffsetX = (int8_t) ((argument2 >> 0) & 0xFF);
|
windowManager.cursorImageOffsetX = (int8_t) ((argument2 >> 0) & 0xFF);
|
||||||
windowManager.cursorImageOffsetY = (int8_t) ((argument2 >> 8) & 0xFF);
|
windowManager.cursorImageOffsetY = (int8_t) ((argument2 >> 8) & 0xFF);
|
||||||
windowManager.cursorXOR = argument3 & (1 << 31);
|
|
||||||
windowManager.cursorShadow = argument3 & (1 << 30);
|
windowManager.cursorShadow = argument3 & (1 << 30);
|
||||||
|
|
||||||
int width = imageWidth + CURSOR_SHADOW_OFFSET;
|
int width = imageWidth + CURSOR_SHADOW_OFFSET;
|
||||||
|
|
|
@ -103,7 +103,7 @@ struct WindowManager {
|
||||||
Surface cursorSurface, cursorSwap, cursorTemporary;
|
Surface cursorSurface, cursorSwap, cursorTemporary;
|
||||||
int cursorImageOffsetX, cursorImageOffsetY;
|
int cursorImageOffsetX, cursorImageOffsetY;
|
||||||
uintptr_t cursorID;
|
uintptr_t cursorID;
|
||||||
bool cursorXOR, cursorShadow;
|
bool cursorShadow;
|
||||||
bool changedCursorImage;
|
bool changedCursorImage;
|
||||||
|
|
||||||
uint32_t cursorProperties;
|
uint32_t cursorProperties;
|
||||||
|
|
BIN
res/Cursors.png
BIN
res/Cursors.png
Binary file not shown.
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
Binary file not shown.
Loading…
Reference in New Issue