2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-10 22:27:42 +00:00

CParticleElectricDataFactory: Make GetGeneratorDesc() return a unique_ptr

Same behavior, but with safer memory management.
This commit is contained in:
Lioncash
2020-03-12 14:20:15 -04:00
parent 59bbbdf41c
commit 1f42b9be93
2 changed files with 18 additions and 13 deletions

View File

@@ -1,5 +1,7 @@
#pragma once
#include <memory>
#include "Runtime/CFactoryMgr.hpp"
#include "Runtime/CToken.hpp"
#include "Runtime/IOStreams.hpp"
@@ -10,12 +12,12 @@ namespace urde {
class CElectricDescription;
class CSimplePool;
class CParticleElectricDataFactory {
static CElectricDescription* CreateElectricDescription(CInputStream& in, CSimplePool* resPool);
static std::unique_ptr<CElectricDescription> CreateElectricDescription(CInputStream& in, CSimplePool* resPool);
static bool CreateELSM(CElectricDescription* desc, CInputStream& in, CSimplePool* resPool);
static void LoadELSMTokens(CElectricDescription* desc);
public:
static CElectricDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool);
static std::unique_ptr<CElectricDescription> GetGeneratorDesc(CInputStream& in, CSimplePool* resPool);
};
CFactoryFnReturn FParticleElectricDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,