mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-06-23 01:28:33 +00:00
Entities: Removed Tag attribute; it is taken from the filename instead. Made entity XML files be loaded on demand. Probably stopped crash when maps contain non-existent entities. Fixed a few bugs in entity definitions.
Maps: Stored non-entity objects in XML instead of PMP, for easier manual editing. Updated existing maps to newest format, so that they can still work. Added undocumented _rewriteMaps() JS function. Also renamed _mem to vmem, and reclassified its undocumentedness as unintentional, since it's reasonably useful. Loader: added NonprogressiveLoad function, for ScEd/_rewriteMaps/etc which don't care about progressiveness. main.cpp: re-enabled vfs_display, since it doesn't crash now Vector3D: stopped warning This was SVN commit r2078.
This commit is contained in:
@@ -17,11 +17,14 @@ bool CObjectBase::Load(const char* filename)
|
||||
{
|
||||
m_Variants.clear();
|
||||
|
||||
CStr filePath ("art/actors/");
|
||||
filePath += filename;
|
||||
|
||||
CXeromyces XeroFile;
|
||||
if (XeroFile.Load(filename) != PSRETURN_OK)
|
||||
if (XeroFile.Load(filePath) != PSRETURN_OK)
|
||||
return false;
|
||||
|
||||
m_FileName = filename;
|
||||
m_Name = filename;
|
||||
|
||||
XMBElement root = XeroFile.getRoot();
|
||||
|
||||
@@ -59,7 +62,7 @@ bool CObjectBase::Load(const char* filename)
|
||||
CStr element_value (child.getText());
|
||||
|
||||
if (element_name == el_name)
|
||||
m_Name = element_value;
|
||||
m_ShortName = element_value;
|
||||
|
||||
else if (element_name == el_modelname)
|
||||
m_Variants.back().back().m_ModelFilename = element_value;
|
||||
@@ -136,7 +139,7 @@ bool CObjectBase::Load(const char* filename)
|
||||
//// New-format actor file ////
|
||||
|
||||
// Use the filename for the model's name
|
||||
m_Name = CStr(filename).AfterLast("/").BeforeLast(".xml");
|
||||
m_ShortName = CStr(filename).AfterLast("/").BeforeLast(".xml");
|
||||
|
||||
// Define all the elements used in the XML file
|
||||
#define EL(x) int el_##x = XeroFile.getElementID(#x)
|
||||
|
||||
Reference in New Issue
Block a user