Skip to content

Commit 3ebcf21

Browse files
committed
Updated some methods still using DBPF and not Database
1 parent c6f083f commit 3ebcf21

File tree

8 files changed

+26
-24
lines changed

8 files changed

+26
-24
lines changed

Spore ModAPI/SourceCode/App/App.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ namespace App
1414
Args(uint32_t instanceID, eastl::string16& dst, uint32_t tableID), Args(instanceID, dst, tableID));
1515

1616
auto_METHOD(Thumbnail_cImportExport, bool, SavePNG,
17-
Args(Resource::ResourceObject* pResource, RenderWare::Raster* pImage, Resource::DBPF* pDBPF,
17+
Args(Resource::ResourceObject* pResource, RenderWare::Raster* pImage, Resource::Database* pDBPF,
1818
bool forceReplace, bool disableSteganography),
1919
Args(pResource, pImage, pDBPF, forceReplace, disableSteganography));
2020

Spore ModAPI/Spore/Anim/IAnimManager.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
#include <Spore\Anim\IAnimWorld.h>
44
#include <Spore\Anim\TLSA.h>
5-
#include <Spore\Resource\DatabasePackedFile.h>
5+
#include <Spore\Resource\Database.h>
66

77
#define AnimManager (*Anim::IAnimManager::Get())
88

@@ -34,10 +34,10 @@ namespace Anim
3434
/* 44h */ virtual void LoadRequiredAnimations(uint32_t animID) = 0; // reads .animation
3535
/* 48h */ virtual int func48h() = 0;
3636
/* 4Ch */ virtual int func4Ch() = 0;
37-
/* 50h */ virtual bool SaveTlsa(Resource::DBPF* pDBPF) = 0;
38-
/* 54h */ virtual bool SavePctp(Resource::DBPF* pDBPF) = 0;
39-
/* 58h */ virtual bool SaveGait(Resource::DBPF* pDBPF) = 0;
40-
/* 58h */ virtual bool SaveAnimation(Resource::DBPF* pDBPF, int) = 0;
37+
/* 50h */ virtual bool SaveTlsa(Resource::Database* database) = 0;
38+
/* 54h */ virtual bool SavePctp(Resource::Database* database) = 0;
39+
/* 58h */ virtual bool SaveGait(Resource::Database* database) = 0;
40+
/* 58h */ virtual bool SaveAnimation(Resource::Database* database, int) = 0;
4141
/* 5Ch */ virtual int func5Ch(int, int) = 0;
4242

4343
static IAnimManager* Get();

Spore ModAPI/Spore/App/Thumbnail_cImportExport.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <Spore\Internal.h>
44
#include <Spore\App\IMessageListener.h>
55
#include <Spore\Resource\ResourceObject.h>
6-
#include <Spore\Resource\DatabasePackedFile.h>
6+
#include <Spore\Resource\Database.h>
77
#include <Spore\RenderWare\Raster.h>
88
#include <EASTL\hash_map.h>
99
#include <EASTL\string.h>
@@ -44,11 +44,11 @@ namespace App
4444
///
4545
/// @param pResource The resource object to encode inside the PNG. It will be encoded using the appropriate Resource::IResourceFactory
4646
/// @param pImage The raster that is written as the image
47-
/// @param pDBPF The DBPF taht contains the pollen metadata, and where the PNG will be saved
47+
/// @param database The Database taht contains the pollen metadata, and where the PNG will be saved
4848
/// @param forceReplace [Optional] If false (by default), if the `.png` already exists in the folder, it will try writing variants like `(1)`, `(2)`,...
4949
/// @param disableSteganography [Optional] If false (by default), the data in the `.png` will be stored in a special way meant to save space.
5050
/// @returns `true` on success, `false` if something failed.
51-
bool SavePNG(Resource::ResourceObject* pResource, RenderWare::Raster* pImage, Resource::DBPF* pDBPF,
51+
bool SavePNG(Resource::ResourceObject* pResource, RenderWare::Raster* pImage, Resource::Database* database,
5252
bool forceReplace = false, bool disableSteganography = false);
5353

5454
static Thumbnail_cImportExport* Get();

Spore ModAPI/Spore/Resource/IResourceManager.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ namespace Resource
4646
/// for example, `.raster` and `.rw4` are assigned to the same resource type.
4747
///
4848
/// You can assign your own factories or delete existing ones, but if that is not an option, ResourceManager provides a method to find
49-
/// the DatabasePackedFile that contains a certain file. This way, ResourceManager can always be used to get files, either via the GetResource
50-
/// method or the GetDBPF one. The DBPFs are stored in the resource manager according to their priority.
49+
/// the Database that contains a certain file. This way, ResourceManager can always be used to get files, either via the GetResource
50+
/// method or the FindDatabase one. The databases are stored in the resource manager according to their priority.
5151
///
5252
/// The manager contains a list of ICache instances that is used to avoid repeteadly creating new instances of a resource that
5353
/// already exists. The IResourceManager::GetPrivateResource() method can be used instead of IResourceManager::GetResource() to forcibly create a new resource even if it's already
@@ -84,7 +84,7 @@ namespace Resource
8484
/// Gets the resource that has the given ResourceKey name.
8585
/// If the resource is contained in the cache, that will be used.
8686
/// The name will be modified to use the correct types, according to the mappings in this manager.
87-
/// The resource will be seached in all the DBPF files in this manager, unless a specific one is specified.
87+
/// The resource will be seached in all the databases in this manager, unless a specific one is specified.
8888
/// Once the file is found, the correct factory will be used to generate the appropiate resource, unless
8989
/// a specific IResourceFactory is specified.
9090
///
@@ -155,10 +155,10 @@ namespace Resource
155155
IResourceFactory* pFactory = nullptr,
156156
const ResourceKey* pCacheName = nullptr) = 0;
157157

158-
/// Writes the given resource to a package file. If the DBPF is specified in this method, a new file will
159-
/// always be created on it even if it does not exist yet; however, if no DBPF is specified, the resource
160-
/// will be written in the first DBPF that contains a file with the given name.
161-
/// If there is a problem while writing the resource, the file on the DBPF will be deleted.
158+
/// Writes the given resource to a package file. If the database is specified in this method, a new file will
159+
/// always be created on it even if it does not exist yet; however, if no database is specified, the resource
160+
/// will be written in the first database that contains a file with the given name.
161+
/// If there is a problem while writing the resource, the file on the database will be deleted.
162162
///
163163
/// @param pResource[in] The ResourceObject to write. It will be written according to the IResourceFactory specified or the one that corresponds to the typeID.
164164
/// @param pFactoryData[in] [Optional] Additional data that is passed to the resource factory, usually null.
@@ -243,7 +243,7 @@ namespace Resource
243243
/* 4Ch */ virtual size_t GetFactoryList(eastl::list<IResourceFactory*>& dst, uint32_t resourceTypeID = ResourceKey::kWildcardID) = 0;
244244

245245
/// Adds/removes the given DatabasePackedFile to this manager, using the priority specified.
246-
/// The priority of a DBPF is used when getting files from the resource manager;
246+
/// The priority of a database is used when getting files from the resource manager;
247247
/// since a certain file name can be contained in multiple packages, the one with the
248248
/// most priority will be chosen.
249249
/// The usage of the first argument is unknown, but it is usually 'true'.
@@ -256,7 +256,7 @@ namespace Resource
256256
/// Checks if a database is already registered in this manager, and optionally gets its priority.
257257
/// @param[in] pDatabase The database
258258
/// @param[out] dstPriority [Optional] A pointer to an integer that will contain the priority. This parameter can be nullptr.
259-
/// @returns True if the manager contained the DBPF, false otherwise.
259+
/// @returns True if the manager contained the database, false otherwise.
260260
///
261261
/* 54h */ virtual bool IsDatabaseRegistered(Database* pDatabase, int* dstPriority = nullptr) = 0;
262262

Spore ModAPI/Spore/Resource/RecordInfo.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Resource
66
{
77
///
8-
/// A structure that contains the metadata of a file stored in a DBPF, such as the offset in the package file and the size.
8+
/// A structure that contains the metadata of a file stored in a database, such as the offset in the package file and the size.
99
///
1010
struct RecordInfo
1111
{

Spore ModAPI/Spore/Resources.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,7 @@
3737
///
3838
/// This namespace contains all the necessary classes needed for working with file resources stored in .package files.
3939
/// The main class is the IResourceManager, which can be used to get resources from the file system.
40-
/// The DatabasePackedFile represents a .package file that contains resources.
40+
/// The resource manager contains a list of Database objects, which can be one of these two:
41+
/// - The DatabasePackedFile represents a .package file that contains resources.
42+
/// - The DatabaseDirectoryFiles represents a plain disk folder, such as the `Games/Game0` folder
4143
///

Spore ModAPI/Spore/Simulator/SubSystem/StarManager.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
#include <Spore\Simulator\SubSystem\cRelationshipManager.h>
2525
#include <Spore\Simulator\cStarRecord.h>
2626
#include <Spore\Simulator\cPlanet.h>
27-
#include <Spore\Resource\DatabasePackedFile.h>
27+
#include <Spore\Resource\Database.h>
2828
#include <Spore\Swarm\Components\DistributeEffect.h>
2929
#include <Spore\App\IMessageListener.h>
3030
#include <Spore\App\MessageListenerData.h>
@@ -315,9 +315,9 @@ namespace Simulator
315315
/* 21Ch */ bool field_21C; // true
316316
/* 220h */ ObjectPtr mpGlobalCLGItems; //TODO cCollectableItems
317317
/// `planetRecords.pkt`
318-
/* 224h */ DatabasePackedFilePtr mpPlanetRecordsTempDBPF;
318+
/* 224h */ DatabasePtr mpPlanetRecordsTempDatabase;
319319
/// `planetRecords.pkp`
320-
/* 228h */ DatabasePackedFilePtr mpPlanetRecordsDBPF;
320+
/* 228h */ DatabasePtr mpPlanetRecordsDatabase;
321321

322322
public:
323323
/// Returns the active Simulator star manager, used for most things in space stage.

Spore ModAPI/Spore/Terrain/ITerrainResourceManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ namespace Terrain
2121

2222
/// Creates a property list and saves it to a file with key `outputKey`,
2323
/// copying to it the terrain script identified with `groupID!instanceID`.
24-
/// This will also rewrite the DBPF that stores the planet property lists.
24+
/// This will also rewrite the database that stores the planet property lists.
2525
/// @param outputKey
2626
/// @param instanceID
2727
/// @param groupID

0 commit comments

Comments
 (0)