int vid_allowhwgamma = false;
// we don't know until we try it!
-int vid_hardwaregammasupported = true;
+cvar_t vid_hardwaregammasupported = {CVAR_READONLY,"vid_hardwaregammasupported","1"};
// whether hardware gamma ramps are currently in effect
int vid_usinghwgamma = false;
CL_AdjustAngles();
}
+/*
+===========
+IN_DoMove
+===========
+*/
+void IN_ProcessMove(usercmd_t *cmd)
+{
+ // get basic movement from keyboard
+ CL_BaseMove(cmd);
+
+ // OS independent code
+ IN_PreMove();
+
+ // allow mice or other external controllers to add to the move
+ IN_Move(cmd);
+
+ // OS independent code
+ IN_PostMove();
+}
+
+
void IN_Mouse(usercmd_t *cmd, float mx, float my)
{
int mouselook = (in_mlook.state & 1) || freelook.integer;
old_mouse_x = mx;
old_mouse_y = my;
- in_mouse_x = mouse_x;
- in_mouse_y = mouse_y;
+ in_mouse_x = (float) mouse_x * vid.conwidth / vid.realwidth;
+ in_mouse_y = (float) mouse_y * vid.conheight / vid.realheight;
- // AK: eveything else is client stuff
+ // AK: eveything else is client stuff
// BTW, this should be seperated somewhen
- if(!in_client_mouse)
+ if(!in_client_mouse)
return;
// LordHavoc: viewzoom affects mouse sensitivity for sniping
if (!vid_usinghwgamma)
{
vid_usinghwgamma = true;
- vid_hardwaregammasupported = VID_GetGamma(vid_systemgammaramps);
+ Cvar_SetValueQuick(&vid_hardwaregammasupported, VID_GetGamma(vid_systemgammaramps));
}
BOUNDCVAR(v_gamma, 0.1, 5);cachegamma = v_gamma.value;
BuildGammaTable16(1.0f, cachegamma, cachecontrast, cachebrightness, vid_gammaramps + 512);
}
- vid_hardwaregammasupported = VID_SetGamma(vid_gammaramps);
+ Cvar_SetValueQuick(&vid_hardwaregammasupported, VID_SetGamma(vid_gammaramps));
}
else
{
if (vid_usinghwgamma)
{
vid_usinghwgamma = false;
- vid_hardwaregammasupported = VID_SetGamma(vid_systemgammaramps);
+ Cvar_SetValueQuick(&vid_hardwaregammasupported, VID_SetGamma(vid_systemgammaramps));
}
}
}
void VID_Shared_Init(void)
{
+ Cvar_RegisterVariable(&vid_hardwaregammasupported);
Cvar_RegisterVariable(&v_gamma);
Cvar_RegisterVariable(&v_brightness);
Cvar_RegisterVariable(&v_contrast);
R_Modules_Shutdown();
}
+int vid_commandlinecheck = true;
+
void VID_Restart_f(void)
{
+ // don't crash if video hasn't started yet
+ if (vid_commandlinecheck)
+ return;
+
Con_Printf("VID_Restart: changing from %s %dx%dx%dbpp, to %s %dx%dx%dbpp.\n",
current_vid_fullscreen ? "fullscreen" : "window", current_vid_width, current_vid_height, current_vid_bitsperpixel,
vid_fullscreen.integer ? "fullscreen" : "window", vid_width.integer, vid_height.integer, vid_bitsperpixel.integer);
VID_OpenSystems();
}
-int vid_commandlinecheck = true;
void VID_Open(void)
{
int i, width, height;