mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-26 18:06:03 +00:00
* clean up CLightEnv a bit
* add CLightEnv::m_TerrainShadowTransparency * shadows will let a fraction of diffuse light through * added JS LightEnv objects, so the lighting environment can be changed from the console * new element TerrainShadowTransparency supported in the scenario .xml format, changed cantabrian_generated with an example This was SVN commit r3513.
This commit is contained in:
@@ -41,7 +41,7 @@ void CMapReader::LoadMap(const char* filename, CTerrain *pTerrain_, CUnitManager
|
||||
// [25ms]
|
||||
unpacker.Read(filename,"PSMP");
|
||||
|
||||
// check version
|
||||
// check version
|
||||
if (unpacker.GetVersion() < FILE_READ_VERSION) {
|
||||
throw CFileUnpacker::CFileVersionError();
|
||||
}
|
||||
@@ -174,8 +174,8 @@ int CMapReader::UnpackTerrain()
|
||||
// ApplyData: take all the input data, and rebuild the scene from it
|
||||
int CMapReader::ApplyData()
|
||||
{
|
||||
// initialise the terrain
|
||||
pTerrain->Initialize(m_MapSize, &m_Heightmap[0]);
|
||||
// initialise the terrain
|
||||
pTerrain->Initialize(m_MapSize, &m_Heightmap[0]);
|
||||
|
||||
// setup the textures on the minipatches
|
||||
STileDesc* tileptr = &m_Tiles[0];
|
||||
@@ -323,6 +323,7 @@ void CXMLReader::ReadEnvironment(XMBElement parent)
|
||||
EL(sunrotation);
|
||||
EL(terrainambientcolour);
|
||||
EL(unitsambientcolour);
|
||||
EL(terrainshadowtransparency);
|
||||
AT(r); AT(g); AT(b);
|
||||
#undef AT
|
||||
#undef EL
|
||||
@@ -361,6 +362,10 @@ void CXMLReader::ReadEnvironment(XMBElement parent)
|
||||
CStr(attrs.getNamedItem(at_g)).ToFloat(),
|
||||
CStr(attrs.getNamedItem(at_b)).ToFloat());
|
||||
}
|
||||
else if (element_name == el_terrainshadowtransparency)
|
||||
{
|
||||
m_MapReader.m_LightEnv.SetTerrainShadowTransparency(CStr(element.getText()).ToFloat());
|
||||
}
|
||||
else
|
||||
debug_warn("Invalid XML data - DTD shouldn't allow this");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user