[Renderer]: Fixed FOV calculate issue
This commit is contained in:
parent
dab6e351fa
commit
69cc9aa283
@ -388,8 +388,10 @@ namespace Components
|
||||
// Saved flag dvar register test (works on one map only)
|
||||
Dvars::test_dvar_bool_savedflag = Dvars::Register::Dvar_RegisterBool("test_dvar_savedbool", "Test Saved Bool Dvar", false, Game::saved_flag);
|
||||
// New fov control dvars
|
||||
Dvars::cg_fov = Dvars::Register::Dvar_RegisterFloat("cg_fov", "The field of view angle in degrees", 65.0f, 1.0f, 160.0f, Game::saved_flag);
|
||||
Dvars::cg_fovScale = Dvars::Register::Dvar_RegisterFloat("cg_fovScale", "Scale applied to the field of view", 1.0f, 0.2f, 2.0f, Game::saved);
|
||||
Dvars::cg_fovMin = Dvars::Register::Dvar_RegisterFloat("cg_fovMin", "The minimum possible field of view", 10.0f, 1.0f, 160.0f, Game::saved);
|
||||
|
||||
// UI Debug without (developer 1 and CTRL+F11)
|
||||
Dvars::ui_debugMode = Dvars::Register::Dvar_RegisterBool("ui_debugMode", "Shows ui debug information on screen.", 0, 4u);
|
||||
// Misc
|
||||
|
@ -55,18 +55,16 @@ namespace Components
|
||||
}
|
||||
}
|
||||
|
||||
double CG_GetViewFov(int localClientNum)
|
||||
float Renderer::CG_GetViewFov(int localClientNum)
|
||||
{
|
||||
float calc_fov;
|
||||
|
||||
calc_fov = Dvars::Functions::Dvar_FindVar("cg_fov")->current.value;
|
||||
float calc_fov = Dvars::cg_fov->current.value;
|
||||
unsigned int offhand_index = Game::ps->offHandIndex;
|
||||
if ((Game::ps->weapFlags & 2) == 0)
|
||||
{
|
||||
offhand_index = Game::ps->weapon;
|
||||
}
|
||||
|
||||
const auto weapon = Game::bg_weaponDefs[offhand_index];
|
||||
Game::WeaponDef_s* weapon = Game::bg_weaponDefs[offhand_index];
|
||||
|
||||
auto check_flags_and_fovmin = [&]() -> float
|
||||
{
|
||||
@ -147,30 +145,30 @@ namespace Components
|
||||
Utils::Hook(0x5DA0A0, []
|
||||
{
|
||||
Game::DB_BeginRecoverLostDevice();
|
||||
Renderer::BeginRecoverDeviceSignal();
|
||||
BeginRecoverDeviceSignal();
|
||||
}, HOOK_CALL).install()->quick();
|
||||
|
||||
// End device recovery (not D3D9Ex)
|
||||
Utils::Hook(0x5DA1A3, []
|
||||
{
|
||||
Renderer::EndRecoverDeviceSignal();
|
||||
EndRecoverDeviceSignal();
|
||||
Game::DB_EndRecoverLostDevice();
|
||||
}, HOOK_CALL).install()->quick();
|
||||
|
||||
// Begin vid_restart
|
||||
Utils::Hook(0x444FCF, Renderer::PostPreVidRestart, HOOK_CALL).install()->quick();
|
||||
Utils::Hook(0x444FCF, PostPreVidRestart, HOOK_CALL).install()->quick();
|
||||
// End vid_restart
|
||||
Utils::Hook(0x4450CD, Renderer::PostVidRestartStub, HOOK_CALL).install()->quick();
|
||||
Utils::Hook(0x4450CD, PostVidRestartStub, HOOK_CALL).install()->quick();
|
||||
|
||||
Utils::Hook(0x42E1D1, CG_GetViewFov, HOOK_CALL).install()->quick();
|
||||
}
|
||||
|
||||
Renderer::~Renderer()
|
||||
{
|
||||
Renderer::BackendFrameSignal.clear();
|
||||
Renderer::SingleBackendFrameSignal.clear();
|
||||
BackendFrameSignal.clear();
|
||||
SingleBackendFrameSignal.clear();
|
||||
|
||||
Renderer::EndRecoverDeviceSignal.clear();
|
||||
Renderer::BeginRecoverDeviceSignal.clear();
|
||||
EndRecoverDeviceSignal.clear();
|
||||
BeginRecoverDeviceSignal.clear();
|
||||
}
|
||||
}
|
@ -11,6 +11,8 @@ namespace Components
|
||||
static int Width();
|
||||
static int Height();
|
||||
|
||||
static float CG_GetViewFov(int localClientNum);
|
||||
|
||||
Renderer();
|
||||
~Renderer();
|
||||
private:
|
||||
|
Loading…
x
Reference in New Issue
Block a user