mouse_cursor added
This commit is contained in:
parent
7438761822
commit
ccd4f3d267
|
@ -2395,8 +2395,9 @@ int game_from_disk(void)
|
|||
if (old_menu != -1)
|
||||
game_menu(old_menu);
|
||||
}
|
||||
|
||||
mouse_cursor(1);
|
||||
g = p = open_file_dialog();
|
||||
mouse_cursor(0);
|
||||
if (!p)
|
||||
return -1;
|
||||
strcpy(dir, p);
|
||||
|
|
|
@ -18,6 +18,15 @@ int mouse_focus(void)
|
|||
return m_focus;
|
||||
}
|
||||
|
||||
int mouse_cursor(int on)
|
||||
{
|
||||
if (on)
|
||||
SDL_ShowCursor(SDL_ENABLE);
|
||||
else
|
||||
SDL_ShowCursor(SDL_ENABLE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
void push_user_event(void (*p) (void*), void *data)
|
||||
{
|
||||
SDL_Event event;
|
||||
|
@ -72,11 +81,11 @@ int input(struct inp_event *inp, int wait)
|
|||
if (event.active.gain) {
|
||||
m_focus = 1;
|
||||
if (opt_fs)
|
||||
SDL_ShowCursor(SDL_DISABLE);
|
||||
mouse_cursor(0);
|
||||
} else if (event.active.state & SDL_APPMOUSEFOCUS) {
|
||||
m_focus = 0;
|
||||
if (opt_fs)
|
||||
SDL_ShowCursor(SDL_ENABLE); /* is it hack?*/
|
||||
mouse_cursor(1); /* is it hack?*/
|
||||
}
|
||||
}
|
||||
if (SDL_PeepEvents(&peek, 1, SDL_PEEKEVENT, SDL_EVENTMASK(SDL_ACTIVEEVENT)) > 0)
|
||||
|
|
|
@ -26,5 +26,6 @@ void input_clear(void);
|
|||
void push_user_event(void (*p) (void*), void *data);
|
||||
int mouse_focus(void);
|
||||
extern int minimized(void);
|
||||
extern int mouse_cursor(int on);
|
||||
|
||||
#endif
|
||||
|
|
Reference in a new issue