no mouse flickering

This commit is contained in:
p.kosyh 2009-11-29 16:00:22 +00:00
parent 2fea1c1347
commit 5a8ed04ed7
2 changed files with 7 additions and 7 deletions

View file

@ -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 {

View file

@ -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;