void CMapInfo::ReadSplats() { const LuaTable splatsTable = parser->GetRoot().SubTable("splats"); splats.texScales = splatsTable.GetFloat4("texScales", float4(0.02f, 0.02f, 0.02f, 0.02f)); splats.texMults = splatsTable.GetFloat4("texMults", float4(1.0f, 1.0f, 1.0f, 1.0f)); }
void CMapInfo::ReadLight() { const LuaTable lightTable = parser->GetRoot().SubTable("lighting"); light.sunStartAngle = lightTable.GetFloat("sunStartAngle", 0.0f); light.sunOrbitTime = lightTable.GetFloat("sunOrbitTime", 1440.0f); light.sunDir = lightTable.GetFloat4("sunDir", float4(0.0f, 1.0f, 2.0f, FLT_MAX)); if (light.sunDir.w == FLT_MAX) { // if four params are not specified for sundir, fallback to the old three param format light.sunDir = lightTable.GetFloat3("sunDir", float3(0.0f, 1.0f, 2.0f)); light.sunDir.w = FLT_MAX; } light.sunDir.ANormalize(); light.groundAmbientColor = lightTable.GetFloat3("groundAmbientColor", float3(0.5f, 0.5f, 0.5f)); light.groundSunColor = lightTable.GetFloat3("groundDiffuseColor", float3(0.5f, 0.5f, 0.5f)); light.groundSpecularColor = lightTable.GetFloat3("groundSpecularColor", float3(0.1f, 0.1f, 0.1f)); light.groundShadowDensity = lightTable.GetFloat("groundShadowDensity", 0.8f); light.unitAmbientColor = lightTable.GetFloat3("unitAmbientColor", float3(0.4f, 0.4f, 0.4f)); light.unitSunColor = lightTable.GetFloat3("unitDiffuseColor", float3(0.7f, 0.7f, 0.7f)); light.unitSpecularColor = lightTable.GetFloat3("unitSpecularColor", light.unitSunColor); light.unitShadowDensity = lightTable.GetFloat("unitShadowDensity", 0.8f); }