I tried looking in the source for things . Its a bit complicated for me . No real blaring straight-forward heres where you save the .ml . There are a couple references to the .ml file and they are associated with the mission filename .
In addition to the couple of files referenced below ,you might also find scenePersist.cpp of interest .
//-------------------------------
gameConnesction.cpp
//-------------------------------
line#
995
stream->writeString(Con::getVariable("$Client::MissionFile"));
1078
Con::setVariable("$Client::MissionFile",buf);
2160
DefineEngineMethod( GameConnection, setMissionCRC, void, (S32 CRC),,
"@brief On the server, transmits the mission file's CRC value to the client.\n\n"
"Typically, during the standard mission start phase 1, the mission file's CRC value "
"on the server is send to the client. This allows the client to determine if the mission "
"has changed since the last time it downloaded this mission and act appropriately, such as "
"rebuilt cached lightmaps.\n\n"
2299
// After demo has loaded, execute the scene re-light the scene
//SceneLighting::lightScene(0, 0);
GameConnection::smPlayingDemo.trigger();
//-----------------------------------------------------------------------------
/
//-----------------------------------------------------------------------------
/
//----------------------
sceneLighting.cpp
//----------------------
461
void SceneLighting::getMLName(const char* misName, const U32 missionCRC, const U32 buffSize, char* filenameBuffer)
{
dSprintf(filenameBuffer, buffSize, "%s_%x.ml", misName, missionCRC);
}
927
void SceneLighting::processCache()
{
// get size in kb
S32 quota = Con::getIntVariable("$sceneLighting::cacheSize", -1);
Vector<CacheEntry> files;
Vector<String> fileNames;
Torque::FS::FindByPattern(Torque::Path(Platform::getMainDotCsDir()), "*.ml", true, fileNames);
S32 curCacheSize = 0;
for(S32 i = 0;i < fileNames.size();++i)
{
if(! Torque::FS::IsFile(fileNames))
continue;
Torque::FS::FileNodeRef fileNode = Torque::FS::GetFileNode(fileNames);
if(fileNode == NULL)
continue;
if(dStrstr(fileNames, mFileName) == 0)
{
// Don't allow the current file to be removed
CacheEntry entry;
entry.mFileObject = fileNode;
entry.mFileName = StringTable->insert(fileNames);
files.push_back(entry);
}
else
curCacheSize += fileNode->getSize();
}
// remove old files
for(S32 i = files.size() - 1; i >= 0; i--)
{
FileStream *stream;
if((stream = FileStream::createAndOpen( files.mFileObject->getName(), Torque::FS::File::Read )) == NULL)
continue;
// read in the version
U32 version;
bool ok = (stream->read(&version) && (version == PersistInfo::smFileVersion));
delete stream;
// ok?
if(ok)
continue;
// no sneaky names
if(!dStrstr(files.mFileName, ".."))
{
Con::warnf("Removing old lighting file '%s'.", files.mFileName);
dFileDelete(files.mFileName);
}
files.pop_back();
}
// no size restriction?
if(quota == -1 || !files.size())
return;
for(U32 i = 0; i < files.size(); i++)
curCacheSize += files.mFileObject->getSize();
// need to remove?
if(quota > (curCacheSize >> 10))
return;
// sort the entries by the correct method
const char * purgeMethod = Con::getVariable("$sceneLighting::purgeMethod");
if(!purgeMethod)
purgeMethod = "";
// determine the method (default to least recently used)
if(!dStricmp(purgeMethod, "minSize"))
dQsort(files.address(), files.size(), sizeof(CacheEntry), minSizeSort);
else if(!dStricmp(purgeMethod, "maxSize"))
dQsort(files.address(), files.size(), sizeof(CacheEntry), maxSizeSort);
else if(!dStricmp(purgeMethod, "lastCreated"))
dQsort(files.address(), files.size(), sizeof(CacheEntry), lastCreatedSort);
else
dQsort(files.address(), files.size(), sizeof(CacheEntry), lastModifiedSort);
// go through and remove the best candidate first (sorted reverse)
while(((curCacheSize >> 10) > quota) && files.size())
{
CacheEntry& lastFile = files.last();
curCacheSize -= lastFile.mFileObject->getSize();
// no sneaky names
if (!dStrstr(lastFile.mFileName, ".."))
{
Con::warnf("Removing lighting file '%s'.", lastFile.mFileName);
dFileDelete(lastFile.mFileName);
}
files.pop_back();
}
}