Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (engine->IsInGame() && engine->IsConnected())// && !engine->IsTransitioningToLoad())
- {//Asus walls test
- float fAsusPower = (float)((float)g_Ikaros.m_pConvars->GetConVar(XOR2("asus_walls"))->GetInt() / 100.0f);
- static float fAsusPower2 = 0.0f;
- bool bNoSky = g_Ikaros.m_pConvars->GetConVar(XOR2("no_sky"))->GetBool();
- static bool bNoSky2 = false;
- if (fAsusPower != fAsusPower2)
- {
- fAsusPower2 = fAsusPower;
- bMaterials = false;
- }
- if (bNoSky != bNoSky2)
- {
- bNoSky2 = bNoSky;
- bMaterials = false;
- }
- static std::vector<IMaterial*> bTranscluent;
- if (!bMaterials)
- {
- bTranscluent.clear();
- bMaterials = true;
- for (MaterialHandle_t handle = materials->FirstMaterial(); handle != materials->InvalidMaterial(); handle = materials->NextMaterial(handle))
- {
- IMaterial* Mat = materials->GetMaterial(handle);
- if (!Mat || Mat->IsErrorMaterial())
- continue;
- if (strstr(Mat->GetTextureGroupName(), TEXTURE_GROUP_WORLD))
- {
- Mat->AlphaModulate(fAsusPower);
- if (fAsusPower < 1.0f)
- {
- if (Mat->IsTranslucent())
- bTranscluent.push_back(Mat);
- Mat->SetMaterialVarFlag(MATERIAL_VAR_TRANSLUCENT, true);
- }
- else
- {
- Mat->SetMaterialVarFlag(MATERIAL_VAR_TRANSLUCENT, false);
- }
- }
- else if (strstr(Mat->GetTextureGroupName(), TEXTURE_GROUP_SKYBOX) || strstr(Mat->GetTextureGroupName(), TEXTURE_GROUP_CUBE_MAP))
- {
- if (bNoSky)
- Mat->ColorModulate(0.0f, 0.0f, 0.0f);
- else
- Mat->ColorModulate(1.0f, 1.0f, 1.0f);
- }
- }
- if (fAsusPower == 1.0f)
- {
- for (int i = 0; i < bTranscluent.size(); i++)
- {
- bTranscluent[i]->SetMaterialVarFlag(MATERIAL_VAR_TRANSLUCENT, true);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement