cursor out of window, more contrast
This commit is contained in:
parent
df72a929d5
commit
ce2cb7a5db
|
@ -14,8 +14,8 @@ LUA_LFLAGS=$(shell pkg-config --libs lua5.1)
|
|||
|
||||
# for arch linux (may be others) use this
|
||||
#
|
||||
LUA_CFLAGS=$(shell pkg-config --cflags lua)
|
||||
LUA_LFLAGS=$(shell pkg-config --libs lua)
|
||||
# LUA_CFLAGS=$(shell pkg-config --cflags lua)
|
||||
# LUA_LFLAGS=$(shell pkg-config --libs lua)
|
||||
#
|
||||
|
||||
SDL_CFLAGS=$(shell sdl-config --cflags)
|
||||
|
|
|
@ -1474,15 +1474,15 @@ void game_cursor(int on)
|
|||
gfx_draw(grab, xc, yc);
|
||||
gfx_free_image(grab);
|
||||
grab = NULL;
|
||||
if (on == CURSOR_OFF) {
|
||||
gfx_update(xc, yc, w, h);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (on == CURSOR_OFF) {
|
||||
gfx_update(xc, yc, w, h);
|
||||
return;
|
||||
}
|
||||
|
||||
if (on == CURSOR_CLEAR || on == CURSOR_OFF)
|
||||
return;
|
||||
|
||||
if (on != CURSOR_DRAW)
|
||||
cur = (inv_xref) ? game_theme.use:game_theme.cursor;
|
||||
|
||||
|
@ -1939,7 +1939,10 @@ int game_loop(void)
|
|||
gfx_cursor(&x, &y, NULL, NULL);
|
||||
game_highlight(x, y, 1);
|
||||
}
|
||||
game_cursor(CURSOR_ON);
|
||||
if (!mouse_focus()) {
|
||||
game_cursor(CURSOR_OFF);
|
||||
} else
|
||||
game_cursor(CURSOR_ON);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -3,6 +3,11 @@
|
|||
|
||||
#include <SDL.h>
|
||||
|
||||
int mouse_focus(void)
|
||||
{
|
||||
return !!(SDL_GetAppState() & SDL_APPMOUSEFOCUS);
|
||||
}
|
||||
|
||||
void push_user_event(void (*p) (void*), void *data)
|
||||
{
|
||||
SDL_Event event;
|
||||
|
|
|
@ -24,5 +24,6 @@ int input(struct inp_event *ev, int wait);
|
|||
int input_init(void);
|
||||
void input_clear(void);
|
||||
void push_user_event(void (*p) (void*), void *data);
|
||||
int mouse_focus(void);
|
||||
|
||||
#endif
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2 KiB |
Binary file not shown.
Before Width: | Height: | Size: 722 B After Width: | Height: | Size: 684 B |
Loading…
Reference in a new issue