[Maps] Added dvar 'r_specularCustomMaps'

+ dvar 'r_specularCustomMaps' (Allows shaders to use phong specular lighting on custom maps)
This commit is contained in:
Joelrau 2020-07-23 06:36:14 +03:00 committed by Maurice Heumann
parent e8a9dc56b4
commit 7a85eb9c9c

View File

@ -682,12 +682,16 @@ namespace Components
Game::dvar_t* Maps::GetSpecularDvar() Game::dvar_t* Maps::GetSpecularDvar()
{ {
Game::dvar_t*& r_specular = *reinterpret_cast<Game::dvar_t**>(0x69F0D94); Game::dvar_t*& r_specular = *reinterpret_cast<Game::dvar_t**>(0x69F0D94);
static Game::dvar_t* r_specularCustomMaps = Game::Dvar_RegisterBool("r_specularCustomMaps", true, Game::DVAR_FLAG_SAVED, "Allows shaders to use phong specular lighting on custom maps");
if (Maps::IsCustomMap()) if (Maps::IsCustomMap())
{ {
static Game::dvar_t noSpecular; if (!r_specularCustomMaps->current.enabled)
ZeroMemory(&noSpecular, sizeof noSpecular); {
return &noSpecular; static Game::dvar_t noSpecular;
ZeroMemory(&noSpecular, sizeof noSpecular);
return &noSpecular;
}
} }
return r_specular; return r_specular;