]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_main.c
Windows: opt out of DPI scaling
[xonotic/darkplaces.git] / cl_main.c
index fe1840aff42db97cb43db2ec931f381da739312b..b7d4f148d50101eb38da70369c95044f2d358032 100644 (file)
--- a/cl_main.c
+++ b/cl_main.c
@@ -454,9 +454,9 @@ void CL_DisconnectEx(qbool kicked, const char *fmt, ... )
        }
        cls.state = ca_disconnected;
        cl.islocalgame = false;
-
-       cls.demoplayback = cls.timedemo = host.restless = false;
        cls.signon = 0;
+       cls.demoplayback = cls.timedemo = host.restless = false;
+       Cvar_Callback(&vid_vsync); // might need to re-enable vsync
 
        Cvar_Callback(&cl_netport);
 
@@ -2813,11 +2813,6 @@ double CL_Frame (double time)
 
        CL_VM_PreventInformationLeaks();
 
-       // get new key events
-       Key_EventQueue_Unblock();
-       SndSys_SendKeyEvents();
-       Sys_SendKeyEvents();
-
        /*
         * If the accumulator hasn't become positive, don't
         * run the frame. Everything that happens before this
@@ -3112,7 +3107,8 @@ void CL_Init (void)
 
                // for QW connections
                Cvar_RegisterVariable(&qport);
-               Cvar_SetValueQuick(&qport, (rand() * RAND_MAX + rand()) & 0xffff);
+               // multiplying by RAND_MAX necessary for Windows, for which RAND_MAX is only 32767.
+               Cvar_SetValueQuick(&qport, ((unsigned int)rand() * RAND_MAX + (unsigned int)rand()) & 0xffff);
 
                Cmd_AddCommand(CF_CLIENT, "timerefresh", CL_TimeRefresh_f, "turn quickly and print rendering statistcs");