mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-10-14 06:58:07 +00:00
huge cleanup and conversion of most string handling (especially paths) to unicode
please note: format strings must be %hs for char* arguments and %ls for wchar_t* This was SVN commit r7161.
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
#include "ps/XML/Xeromyces.h"
|
||||
|
||||
#include "ps/CLogger.h"
|
||||
#define LOG_CATEGORY "particleSystem"
|
||||
#define LOG_CATEGORY L"particleSystem"
|
||||
|
||||
//forward declaration
|
||||
void GetValueAndVariation(CXeromyces XeroFile, XMBElement parent, CStr& value, CStr& variation);
|
||||
@@ -61,10 +61,10 @@ CEmitter::~CEmitter(void)
|
||||
delete [] m_heap;
|
||||
}
|
||||
|
||||
bool CEmitter::LoadFromXML(const CStr& filename)
|
||||
bool CEmitter::LoadXml(const VfsPath& pathname)
|
||||
{
|
||||
CXeromyces XeroFile;
|
||||
if (XeroFile.Load(filename) != PSRETURN_OK)
|
||||
if (XeroFile.Load(pathname) != PSRETURN_OK)
|
||||
// Fail
|
||||
return false;
|
||||
|
||||
@@ -107,11 +107,11 @@ bool CEmitter::LoadFromXML(const CStr& filename)
|
||||
|
||||
if( root.GetNodeName() != el_Emitter )
|
||||
{
|
||||
LOG(CLogger::Error, LOG_CATEGORY, "CEmitter::LoadEmitterXML: XML root was not \"Emitter\" in file %s. Load failed.", filename.c_str() );
|
||||
LOG(CLogger::Error, LOG_CATEGORY, L"CEmitter::LoadEmitterXML: XML root was not \"Emitter\" in file %ls. Load failed.", pathname.string().c_str() );
|
||||
return( false );
|
||||
}
|
||||
|
||||
m_tag = CStr(filename).AfterLast("/").BeforeLast(".xml");
|
||||
m_tag = fs::basename(pathname);
|
||||
|
||||
//TODO figure out if we need to use Type attribute to construct different emitter types,
|
||||
// probably have to move some of this code into a static factory method or out into ParticleEngine class
|
||||
@@ -152,7 +152,7 @@ bool CEmitter::LoadFromXML(const CStr& filename)
|
||||
else if( settingName == el_Texture )
|
||||
{
|
||||
stringValue = settingElement.GetText();
|
||||
m_texture = new CTexture(stringValue);
|
||||
m_texture = new CTexture(CStrW(stringValue));
|
||||
u32 flags = 0;
|
||||
if(!(CRenderer::GetSingletonPtr()->LoadTexture(m_texture, flags)))
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user