* 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:
prefect
2006-02-15 00:45:16 +00:00
parent 1560a17dfb
commit 36fa5ec2bf
18 changed files with 649 additions and 191 deletions
+8 -3
View File
@@ -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");
}