no mouse flickering
This commit is contained in:
parent
2fea1c1347
commit
5a8ed04ed7
|
@ -1510,7 +1510,6 @@ int game_highlight(int x, int y, int on)
|
|||
static xref_t hxref = NULL;
|
||||
xref_t xref = NULL;
|
||||
int up = 0;
|
||||
|
||||
if (on) {
|
||||
xref = look_xref(x, y, &elem);
|
||||
if (xref && opt_hl) {
|
||||
|
@ -2257,6 +2256,7 @@ int game_loop(void)
|
|||
}
|
||||
// game_highlight(ev.x, ev.y, 1);
|
||||
}
|
||||
|
||||
if (old_xref)
|
||||
game_highlight(x, y, 1);
|
||||
else {
|
||||
|
|
|
@ -54,19 +54,19 @@ int input(struct inp_event *inp, int wait)
|
|||
inp->type = 0;
|
||||
inp->count = 1;
|
||||
switch(event.type){
|
||||
case SDL_USEREVENT: {
|
||||
void (*p) (void*) = event.user.data1;
|
||||
p(event.user.data2);
|
||||
return AGAIN;
|
||||
}
|
||||
case SDL_ACTIVEEVENT:
|
||||
if (event.active.state & (SDL_APPMOUSEFOCUS | SDL_APPINPUTFOCUS)) {
|
||||
if (event.active.gain)
|
||||
m_focus = 1;
|
||||
else if (event.active.state & SDL_APPMOUSEFOCUS)
|
||||
m_focus = 0;
|
||||
m_focus = !!(SDL_GetAppState() & SDL_APPMOUSEFOCUS);
|
||||
}
|
||||
return 0;
|
||||
case SDL_USEREVENT: {
|
||||
void (*p) (void*) = event.user.data1;
|
||||
p(event.user.data2);
|
||||
return AGAIN;
|
||||
}
|
||||
case SDL_QUIT:
|
||||
game_running = 0;
|
||||
return -1;
|
||||
|
|
Reference in a new issue