mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 18:01:15 +00:00
minor cleanups preparing for an overhaul
This commit is contained in:
parent
142127f89d
commit
9099baeb6d
2 changed files with 28 additions and 32 deletions
|
@ -51,7 +51,6 @@ extern qboolean x_have_focus;
|
|||
|
||||
void GetEvent (void);
|
||||
|
||||
vec3_t *X11_GetGamma (void);
|
||||
qboolean X11_AddEvent (int event, void (*event_handler)(XEvent *));
|
||||
qboolean X11_RemoveEvent (int event, void (*event_handler)(XEvent *));
|
||||
qboolean X11_SetGamma (double);
|
||||
|
|
|
@ -93,7 +93,6 @@ Time x_time;
|
|||
qboolean x_have_focus = false;
|
||||
|
||||
#define X_MASK (VisibilityChangeMask | StructureNotifyMask | ExposureMask | FocusChangeMask | EnterWindowMask)
|
||||
#define MOUSE_MASK (ButtonPressMask | ButtonReleaseMask | PointerMotionMask)
|
||||
|
||||
#ifdef HAVE_VIDMODE
|
||||
static XF86VidModeModeInfo **vidmodes;
|
||||
|
@ -147,7 +146,7 @@ X11_RemoveEvent (int event, void (*event_handler) (XEvent *))
|
|||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
static inline void
|
||||
X11_ProcessEventProxy(XEvent *x_event)
|
||||
{
|
||||
if (x_event->type >= LASTEvent) {
|
||||
|
@ -174,7 +173,7 @@ X11_WaitForEvent (int event)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
inline void
|
||||
X11_ProcessEvent (void)
|
||||
{
|
||||
XEvent x_event;
|
||||
|
@ -186,10 +185,8 @@ X11_ProcessEvent (void)
|
|||
void
|
||||
X11_ProcessEvents (void)
|
||||
{
|
||||
// Get events from X server.
|
||||
while (XPending (x_disp)) {
|
||||
while (XPending (x_disp))
|
||||
X11_ProcessEvent ();
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -295,6 +292,31 @@ X11_ForceMove (int x, int y)
|
|||
X11_WaitForEvent (ConfigureNotify);
|
||||
}
|
||||
|
||||
static vec3_t *
|
||||
X11_GetGamma (void)
|
||||
{
|
||||
#ifdef HAVE_VIDMODE
|
||||
# ifdef X_XF86VidModeGetGamma
|
||||
XF86VidModeGamma xgamma;
|
||||
vec3_t *temp;
|
||||
|
||||
if (vid_gamma_avail && vid_system_gamma->int_val) {
|
||||
if (XF86VidModeGetGamma (x_disp, x_screen, &xgamma)) {
|
||||
if ((temp = malloc (sizeof (vec3_t)))) {
|
||||
(*temp)[0] = xgamma.red;
|
||||
(*temp)[1] = xgamma.green;
|
||||
(*temp)[2] = xgamma.blue;
|
||||
return temp;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
vid_gamma_avail = false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void
|
||||
X11_SetVidMode (int width, int height)
|
||||
{
|
||||
|
@ -545,31 +567,6 @@ X11_ForceViewPort (void)
|
|||
#endif
|
||||
}
|
||||
|
||||
vec3_t *
|
||||
X11_GetGamma (void)
|
||||
{
|
||||
#ifdef HAVE_VIDMODE
|
||||
# ifdef X_XF86VidModeGetGamma
|
||||
XF86VidModeGamma xgamma;
|
||||
vec3_t *temp;
|
||||
|
||||
if (vid_gamma_avail && vid_system_gamma->int_val) {
|
||||
if (XF86VidModeGetGamma (x_disp, x_screen, &xgamma)) {
|
||||
if ((temp = malloc (sizeof (vec3_t)))) {
|
||||
(*temp)[0] = xgamma.red;
|
||||
(*temp)[1] = xgamma.green;
|
||||
(*temp)[2] = xgamma.blue;
|
||||
return temp;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
vid_gamma_avail = false;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
qboolean
|
||||
X11_SetGamma (double gamma)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue