]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - vid_sdl.c
Reimplement the ability to override engine commands with QC commands
[xonotic/darkplaces.git] / vid_sdl.c
index 97e54735ed4c8a291af8ade55a46e3153741b650..5845e07356c1a3342641b5ccef32be31d4cb86d2 100644 (file)
--- a/vid_sdl.c
+++ b/vid_sdl.c
@@ -30,17 +30,20 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #include <IOKit/hidsystem/IOHIDLib.h>
 #include <IOKit/hidsystem/IOHIDParameter.h>
 #include <IOKit/hidsystem/event_status_driver.h>
+#if (MAC_OS_X_VERSION_MIN_REQUIRED < 120000)
+       #define IOMainPort IOMasterPort
+#endif
 static cvar_t apple_mouse_noaccel = {CF_CLIENT | CF_ARCHIVE, "apple_mouse_noaccel", "1", "disables mouse acceleration while DarkPlaces is active"};
 static qbool vid_usingnoaccel;
 static double originalMouseSpeed = -1.0;
-io_connect_t IN_GetIOHandle(void)
+static io_connect_t IN_GetIOHandle(void)
 {
        io_connect_t iohandle = MACH_PORT_NULL;
        kern_return_t status;
        io_service_t iohidsystem = MACH_PORT_NULL;
        mach_port_t masterport;
 
-       status = IOMasterPort(MACH_PORT_NULL, &masterport);
+       status = IOMainPort(MACH_PORT_NULL, &masterport);
        if(status != KERN_SUCCESS)
                return 0;
 
@@ -894,7 +897,7 @@ static void IN_Move_TouchScreen_Quake(void)
                if (!VID_ShowingKeyboard())
                {
                        // user entered a command, close the console now
-                       Con_ToggleConsole_f(&cmd_client);
+                       Con_ToggleConsole_f(cmd_local);
                }
                VID_TouchscreenArea( 0,   0,   0,   0,   0, NULL                         , 0.0f, NULL, NULL, &buttons[15], (keynum_t)0, NULL, 0, 0, 0, true);
                VID_TouchscreenArea( 0,   0,   0,   0,   0, NULL                         , 0.0f, NULL, move, &buttons[0], K_MOUSE4, NULL, 0, 0, 0, true);
@@ -1179,7 +1182,7 @@ void Sys_SendKeyEvents( void )
                                                        // so, let's better queue it for next frame
                                                        if(!sdl_needs_restart)
                                                        {
-                                                               Cbuf_AddText(&cmd_client, "\nr_restart\n");
+                                                               Cbuf_AddText(cmd_local, "\nr_restart\n");
                                                                sdl_needs_restart = true;
                                                        }
 #endif