Resource namespace
The system for accessing file resources stored in .package files.
This namespace contains all the necessary classes needed for working with file resources stored in .package files. The main class is the IResourceManager, which can be used to get resources from the file system. The resource manager contains a list of Database objects, which can be one of these two:
- The DatabasePackedFile represents a .package file that contains resources.
- The DatabaseDirectoryFiles represents a plain disk folder, such as the
Games/Game0
folder
Namespaces
- namespace Paths
Classes
- class CachedResourceObject
- class cIReleaseCallback
- class cResourceManager
- The implementation of IResourceManager; this should only be used for extending and detouring.
- class Database
- class DatabaseDirectoryFiles
- class DatabasePackedFile
- A DatabasePackedFile is a type of file used in Spore to store and index multiple files inside a single container (usually in the .package extension).
- class FakeRecord
- class IAsyncRequest
- class ICache
- An interface that is used to cache loaded resources for fast access.
- class IKeyFilter
- A generic interface used to filter ResourceKey objects.
- class IRecord
- Represents a file in a Database; records are identified by a ResourceKey (which specifies group, instance and type IDs), and have an underlying IO::
IStream that is used to read/write data. - class IResourceFactory
- An interface that can be used to create resources of certain types.
- class IResourceManager
- IResourceManager is a singleton class used to access resources in Spore's file system.
- struct PFHoleTable
- class PFIndexModifiable
- This class stores the metadata of all the files contained in a DBPF file.
- class PFRecordBase
- Base implementation for records in a
.package
file (DatabasePackedFile). - class PFRecordRead
- This class is used to read the data of a file contained inside a DBPF.
- class PFRecordWrite
- This class is used to write data to a file contained inside a DBPF.
- struct RecordInfo
- A structure that contains the metadata of a file stored in a database, such as the offset in the package file and the size.
- class ResourceObject
- A type of object that is used as a resource.
- class StandardFileFilter
- The standard file filter which filters resources depending on the ResourceKey.
- class ThreadedObject
Enums
-
enum class PathID: uint32_
t { Data = 0xa02149, App = 0xa0214a, Debug = 0xa02150, Locale = 0x45962CC, Config = 0xA0214F, Creations = 0xA0214B, AppData = 0xA02151, BaseData = 0x6CBED39, BaseDataLocale = 0x6CBED3A, Temp = 0x60BA02F } -
enum class SaveAreaID: uint32_
t { Pictures = 0x11AC196, Movies = 0x11AC197, Animations = 0x11AC198, GamesGame0 = 0x4729A47, Preferences = 0x11AC192, Creatures = 0x11AC199, Buildings = 0x11AC19A, Vehicles = 0x11AC19B, Cells = 0x90368EA3, UFOs = 0x90368EA2, Plants = 0x90368EA0, Adventures = 0x86CA01C9, CityMusic = 0x500EFC6, Cache = 0x11AC19C, Server = 0x11AC19D, Planets = 0x31389B5, RigblockInfo = 0x49A3D83, GraphicsCache = 0x11AC1AC }
Typedefs
- using FileNameToKeyConverter_t = bool(*)(const char16_t*, const char16_t*, const char16_t*, ResourceKey&)
- using DBPF = DatabasePackedFile
- A short name for DatabasePackedFile.
Functions
- ASSERT_SIZE(cResourceManager, 0x178)
- auto Addresses(cResourceManager) -> namespace
- ASSERT_SIZE(Database, 0xC)
- ASSERT_SIZE(DatabaseDirectoryFiles, 0x168)
-
auto ReadExtensionMappingsFromPropFile(uint32_
t instanceID, DatabaseDirectoryFiles* database) -> void - Reads an extension mapping
.prop
file from the0x1C7AC81
folder, and adds those type names to the given database; the instance ID is usually also0x1C7AC81
. - auto Addresses(DatabaseDirectoryFiles) -> namespace
- ASSERT_SIZE(DatabasePackedFile, 0x388)
- auto Addresses(DatabasePackedFile) -> namespace
- ASSERT_SIZE(FakeRecord, 0x24)
- auto Addresses(FakeRecord) -> namespace
- auto Addresses(StandardFileFilter) -> namespace
- auto_METHOD(StandardFileFilter, bool, IsValid, Args(const ResourceKey&name), Args(name))
- auto Addresses(IResourceManager) -> namespace
- auto Addresses(Paths) -> namespace
-
auto SaveNamedResource(ResourceObject* resource,
const char16_
t* fileName, Database* database) -> bool - ASSERT_SIZE(PFIndexModifiable, 0x4C)
- auto Addresses(PFIndexModifiable) -> namespace
- ASSERT_SIZE(PFRecordRead, 0x70)
- auto Addresses(PFRecordRead) -> namespace
- ASSERT_SIZE(PFRecordWrite, 0x27C)
- auto Addresses(PFRecordWrite) -> namespace
- ASSERT_SIZE(RecordInfo, 0x10)
- ASSERT_SIZE(ResourceObject, 0x14)
- ASSERT_SIZE(CachedResourceObject, 0x18)
Enum documentation
enum class Resource:: PathID: uint32_ t
Enumerators | |
---|---|
Data |
Core Spore - Data. |
App |
Spore Galactic Adventures - SporebinEP1. |
Debug |
|
Locale |
Core Spore - Data/Locale. |
Config |
Spore Galactic Adventures - Data/Config. |
Creations |
My Spore Creations. |
AppData |
APPDATA%/Spore |
BaseData |
|
BaseDataLocale |
|
Temp |
APPDATA%/Spore/Temp |
enum class Resource:: SaveAreaID: uint32_ t
Enumerators | |
---|---|
Pictures |
My Spore Creations/Pictures. |
Movies |
My Spore Creations/Movies. |
Animations |
My Spore Creations/AnimatedAvatars. |
GamesGame0 |
APPDATA%/Spore/Games/Game0 |
Preferences |
APPDATA%/Spore/Preferences |
Creatures |
APPDATA%/Spore/EditorSaves.package |
Buildings |
APPDATA%/Spore/EditorSaves.package |
Vehicles |
APPDATA%/Spore/EditorSaves.package |
Cells |
APPDATA%/Spore/EditorSaves.package |
UFOs |
APPDATA%/Spore/EditorSaves.package |
Plants |
APPDATA%/Spore/EditorSaves.package |
Adventures |
APPDATA%/Spore/EditorSaves.package |
CityMusic |
APPDATA%/Spore/CityMusic |
Cache |
APPDATA%/Spore/Pollination.package |
Server |
APPDATA%/Spore/Pollination.package |
Planets |
APPDATA%/Spore/Planets.package |
RigblockInfo |
APPDATA%/Spore/RigblockInfo.package |
GraphicsCache |
APPDATA%/Spore/GraphicsCache.package |
Typedef documentation
typedef bool(*Resource:: FileNameToKeyConverter_t)(const char16_t*, const char16_t*, const char16_t*, ResourceKey&)
typedef DatabasePackedFile Resource:: DBPF
A short name for DatabasePackedFile.
Function documentation
Resource:: ASSERT_SIZE(cResourceManager,
0x178)
namespace Resource:: Addresses(cResourceManager)
Resource:: ASSERT_SIZE(Database,
0xC)
Resource:: ASSERT_SIZE(DatabaseDirectoryFiles,
0x168)
void Resource:: ReadExtensionMappingsFromPropFile(uint32_ t instanceID,
DatabaseDirectoryFiles* database)
Reads an extension mapping .prop
file from the 0x1C7AC81
folder, and adds those type names to the given database; the instance ID is usually also 0x1C7AC81
.
Parameters | |
---|---|
instanceID | |
database |
Resource:: ASSERT_SIZE(DatabasePackedFile,
0x388)
namespace Resource:: Addresses(DatabasePackedFile)
Resource:: ASSERT_SIZE(FakeRecord,
0x24)
namespace Resource:: Addresses(FakeRecord)
namespace Resource:: Addresses(StandardFileFilter)
Resource:: auto_METHOD(StandardFileFilter,
bool,
IsValid,
Args(const ResourceKey&name),
Args(name))
namespace Resource:: Addresses(IResourceManager)
bool Resource:: SaveNamedResource(ResourceObject* resource,
const char16_ t* fileName,
Database* database)
Resource:: ASSERT_SIZE(PFIndexModifiable,
0x4C)
namespace Resource:: Addresses(PFIndexModifiable)
Resource:: ASSERT_SIZE(PFRecordRead,
0x70)
namespace Resource:: Addresses(PFRecordRead)
Resource:: ASSERT_SIZE(PFRecordWrite,
0x27C)
namespace Resource:: Addresses(PFRecordWrite)
Resource:: ASSERT_SIZE(RecordInfo,
0x10)
Resource:: ASSERT_SIZE(ResourceObject,
0x14)
Resource:: ASSERT_SIZE(CachedResourceObject,
0x18)