2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-09 09:47:43 +00:00

CDecalDataFactory: Make GetGeneratorDesc() return a unique_ptr

Same behavior, but with safer memory management.
This commit is contained in:
Lioncash
2020-03-12 14:45:20 -04:00
parent 1f42b9be93
commit 05bccae70e
2 changed files with 14 additions and 11 deletions

View File

@@ -1,5 +1,7 @@
#pragma once
#include <memory>
#include "Runtime/CFactoryMgr.hpp"
#include "Runtime/CToken.hpp"
#include "Runtime/IObj.hpp"
@@ -12,11 +14,11 @@ class CSimplePool;
class CDecalDataFactory {
static bool CreateDPSM(CDecalDescription* desc, CInputStream& in, CSimplePool* resPool);
static CDecalDescription* CreateGeneratorDescription(CInputStream& in, CSimplePool* resPool);
static std::unique_ptr<CDecalDescription> CreateGeneratorDescription(CInputStream& in, CSimplePool* resPool);
static void GetQuadDecalInfo(CInputStream& in, CSimplePool* resPool, FourCC clsId, SQuadDescr& quad);
public:
static CDecalDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool);
static std::unique_ptr<CDecalDescription> GetGeneratorDesc(CInputStream& in, CSimplePool* resPool);
};
CFactoryFnReturn FDecalDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,