06 May 2013, 8:28
The .murlres package can easily be used to host any type of custom files. Simply specify your resource inside the package.xml file using the type="BINARY" attribute:
You can then access that file from e.g. a logic class' OnInit() method like this:
<?xml version="1.0" ?>
<Package id="Main">
<Resource type="BINARY" id="MyXmlFile" fileName="my_fancy_file.xml"/>
</Package>
You can then access that file from e.g. a logic class' OnInit() method like this:
Bool App::MyLogic::OnInit(const Logic::IState* state)
{
const Resource::ICollection* resourceCollection = state->GetResourceCollection();
const Resource::IBinary* myXmlFile = resourceCollection->GetBinary("Main:MyXmlFile");
const ConstData& myXmlFileDataObject = myXmlFile->GetData();
const UInt8* data = myXmlFileDataObject.GetData();
UInt32 byteSize = myXmlFileDataObject.GetByteSize();
// Do something useful...
return true;
}