]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_agl.c
Travis changes for Xonotic:
[xonotic/darkplaces.git] / vid_agl.c
index b0afdcf98126dfe3f99be8ffc4b12066e2facb3f..bacbb5ffd4d23a47fa49765cc489711257aa097c 100644 (file)
--- a/vid_agl.c
+++ b/vid_agl.c
@@ -312,7 +312,7 @@ int VID_GetGamma(unsigned short *ramps, int rampsize)
 
 void signal_handler(int sig)
 {
-       printf("Received signal %d, exiting...\n", sig);
+       Sys_PrintfToTerminal("Received signal %d, exiting...\n", sig);
        VID_RestoreSystemGamma();
        Sys_Quit(1);
 }
@@ -396,6 +396,7 @@ void VID_Shutdown(void)
        if (context == NULL && window == NULL)
                return;
 
+       VID_EnableJoystick(false);
        VID_SetMouse(false, false, false);
        VID_RestoreSystemGamma();
 
@@ -1110,8 +1111,34 @@ void Sys_SendKeyEvents(void)
        }
 }
 
+void VID_BuildJoyState(vid_joystate_t *joystate)
+{
+       VID_Shared_BuildJoyState_Begin(joystate);
+       VID_Shared_BuildJoyState_Finish(joystate);
+}
+
+void VID_EnableJoystick(qboolean enable)
+{
+       int index = joy_enable.integer > 0 ? joy_index.integer : -1;
+       qboolean success = false;
+       int sharedcount = 0;
+       sharedcount = VID_Shared_SetJoystick(index);
+       if (index >= 0 && index < sharedcount)
+               success = true;
+
+       // update cvar containing count of XInput joysticks
+       if (joy_detected.integer != sharedcount)
+               Cvar_SetValueQuick(&joy_detected, sharedcount);
+
+       Cvar_SetValueQuick(&joy_active, success ? 1 : 0);
+}
+
 void IN_Move (void)
 {
+       vid_joystate_t joystate;
+       VID_EnableJoystick(true);
+       VID_BuildJoyState(&joystate);
+       VID_ApplyJoyState(&joystate);
 }
 
 static bool GetDictionaryBoolean(CFDictionaryRef d, const void *key)
@@ -1131,6 +1158,11 @@ long GetDictionaryLong(CFDictionaryRef d, const void *key)
     return value;
 }
 
+vid_mode_t *VID_GetDesktopMode(void)
+{
+       return NULL; // FIXME add desktopfullscreen
+}
+
 size_t VID_ListModes(vid_mode_t *modes, size_t maxcount)
 {
        CGDirectDisplayID mainDisplay = CGMainDisplayID();