Initial round of particle factories

This commit is contained in:
Jack Andersen 2016-02-01 18:29:58 -10:00
parent 3f21eae617
commit dd75a37b66
14 changed files with 1129 additions and 14 deletions

View File

@ -1,7 +1,8 @@
make_dnalist(liblist
CMDL
MAPA
EGMC)
EGMC
ParticleCommon)
add_library(DNACommon
DNACommon.hpp DNACommon.cpp
@ -14,6 +15,10 @@ add_library(DNACommon
TXTR.hpp TXTR.cpp
ANCS.hpp
ANIM.hpp ANIM.cpp
PART.hpp
SWHC.hpp
ELSC.hpp
ParticleCommon.cpp
DeafBabe.hpp
BabeDead.hpp
Tweaks/ITweakGame.hpp

View File

@ -0,0 +1,6 @@
#ifndef __COMMON_ELSC_HPP__
#define __COMMON_ELSC_HPP__
#include "ParticleCommon.hpp"
#endif // __COMMON_ELSC_HPP__

323
DataSpec/DNACommon/PART.hpp Normal file
View File

@ -0,0 +1,323 @@
#ifndef __COMMON_PART_HPP__
#define __COMMON_PART_HPP__
#include "ParticleCommon.hpp"
namespace Retro
{
namespace DNAParticle
{
template <class IDType>
struct GPSM : BigYAML
{
static const char* DNAType() {return "Retro::GPSM";}
const char* DNATypeV() const {return DNAType();}
RealElement x118_LFOR;
ChildGeneratorDesc<IDType> xa4_IDTS;
void read(Athena::io::YAMLDocReader& r)
{
if (r.enterSubRecord("LFOR"))
{
x118_LFOR.read(r);
r.leaveSubRecord();
}
if (r.enterSubRecord("IDTS"))
{
xa4_IDTS.read(r);
r.leaveSubRecord();
}
if (r.enterSubRecord("EMTR"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("COLR"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("CIND"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("AAPH"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("CSSD"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("GRTE"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("COLR"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("FXLL"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("ICTS"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("KSSM"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("ILOC"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("IITS"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("IVEC"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("LDIR"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("COLR"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("LCLR"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("LENG"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("MAXP"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("LOFF"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("LINT"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("LINE"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("LFOT"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("LIT_"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("LTME"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("LSLA"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("LTYP"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("NDSY"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("MBSP"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("MBLR"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("NCSY"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("PISY"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("OPTS"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("PMAB"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("SESD"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("PSLT"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("PMSC"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("PMOP"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("PMDL"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("PMOO"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("PMRT"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("POFS"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("PMUS"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("PSIV"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("ROTA"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("PSVM"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("PSTS"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("PSOV"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("PSWT"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("PMLC"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("PMED"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("PMOO"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("VEL1"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("SSSD"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("SORT"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("SIZE"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("SISY"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("SSPO"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("TEXR"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("SSWH"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("TIND"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("VMD4"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("VMD1"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("VEL4"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("VEL3"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("VMD3"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("ZBUF"))
{
r.leaveSubRecord();
}
if (r.enterSubRecord("WIDT"))
{
r.leaveSubRecord();
}
}
void write(Athena::io::YAMLDocWriter& w) const
{
}
size_t binarySize(size_t __isz) const
{
}
void read(Athena::io::IStreamReader& r)
{
}
void write(Athena::io::IStreamWriter& w) const
{
}
};
}
}
#endif // __COMMON_PART_HPP__

View File

@ -0,0 +1,367 @@
#include "ParticleCommon.hpp"
namespace Retro
{
namespace DNAParticle
{
void RealElementFactory::read(Athena::io::YAMLDocReader& r)
{
if (r.enterSubRecord("LFTW"))
{
m_elem.reset(new struct RELifetimeTween);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("CNST"))
{
m_elem.reset(new struct REConstant);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("CHAN"))
{
m_elem.reset(new struct RETimeChain);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("ADD_"))
{
m_elem.reset(new struct REAdd);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("CLMP"))
{
m_elem.reset(new struct REClamp);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("KEYE"))
{
m_elem.reset(new struct REKeyframeEmitter);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("IRND"))
{
m_elem.reset(new struct REInitialRandom);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("KEYP"))
{
m_elem.reset(new struct REKeyframeEmitterP);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("RAND"))
{
m_elem.reset(new struct RERandom);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("MULT"))
{
m_elem.reset(new struct REMultiply);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("PULS"))
{
m_elem.reset(new struct REPulse);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("SCAL"))
{
m_elem.reset(new struct RETimeScale);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("RLPT"))
{
m_elem.reset(new struct RELifetimePercent);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("SINE"))
{
m_elem.reset(new struct RESineWave);
m_elem->read(r);
r.leaveSubRecord();
}
else
m_elem.reset();
}
void RealElementFactory::write(Athena::io::YAMLDocWriter& w) const
{
if (m_elem)
{
w.enterSubRecord(m_elem->ClassName());
m_elem->write(w);
w.leaveSubRecord();
}
}
size_t RealElementFactory::binarySize(size_t __isz) const
{
if (m_elem)
return m_elem->binarySize(__isz + 4);
else
return __isz + 4;
}
void RealElementFactory::read(Athena::io::IStreamReader& r)
{
uint32_t clsId;
r.readBytesToBuf(&clsId, 4);
switch (clsId)
{
case SBIG('LFTW'):
m_elem.reset(new struct RELifetimeTween);
break;
case SBIG('CNST'):
m_elem.reset(new struct REConstant);
break;
case SBIG('CHAN'):
m_elem.reset(new struct RETimeChain);
break;
case SBIG('ADD_'):
m_elem.reset(new struct REAdd);
break;
case SBIG('CLMP'):
m_elem.reset(new struct REClamp);
break;
case SBIG('KEYE'):
m_elem.reset(new struct REKeyframeEmitter);
break;
case SBIG('IRND'):
m_elem.reset(new struct REInitialRandom);
break;
case SBIG('KEYP'):
m_elem.reset(new struct REKeyframeEmitterP);
break;
case SBIG('RAND'):
m_elem.reset(new struct RERandom);
break;
case SBIG('MULT'):
m_elem.reset(new struct REMultiply);
break;
case SBIG('PULS'):
m_elem.reset(new struct REPulse);
break;
case SBIG('SCAL'):
m_elem.reset(new struct RETimeScale);
break;
case SBIG('RLPT'):
m_elem.reset(new struct RELifetimePercent);
break;
case SBIG('SINE'):
m_elem.reset(new struct RESineWave);
break;
default:
m_elem.reset();
return;
}
m_elem->read(r);
}
void RealElementFactory::write(Athena::io::IStreamWriter& w) const
{
if (m_elem)
{
w.writeBytes((atInt8*)m_elem->ClassName(), 4);
m_elem->write(w);
}
else
w.writeBytes((atInt8*)"NONE", 4);
}
void IntElementFactory::read(Athena::io::YAMLDocReader& r)
{
if (r.enterSubRecord("KEYE"))
{
m_elem.reset(new struct IEKeyframeEmitter);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("DETH"))
{
m_elem.reset(new struct IEDeath);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("CLMP"))
{
m_elem.reset(new struct IEClamp);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("CHAN"))
{
m_elem.reset(new struct IETimeChain);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("ADD_"))
{
m_elem.reset(new struct IEAdd);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("CNST"))
{
m_elem.reset(new struct IEConstant);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("IMPL"))
{
m_elem.reset(new struct IEImpulse);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("ILPT"))
{
m_elem.reset(new struct IELifetimePercent);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("IRND"))
{
m_elem.reset(new struct IEInitialRandom);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("PULS"))
{
m_elem.reset(new struct IEPulse);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("MULT"))
{
m_elem.reset(new struct IEMultiply);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("KEYP"))
{
m_elem.reset(new struct IEKeyframeEmitterP);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("SPAH"))
{
m_elem.reset(new struct IESampleAndHold);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("RAND"))
{
m_elem.reset(new struct IERandom);
m_elem->read(r);
r.leaveSubRecord();
}
else if (r.enterSubRecord("TSCL"))
{
m_elem.reset(new struct IETimeScale);
m_elem->read(r);
r.leaveSubRecord();
}
else
m_elem.reset();
}
void IntElementFactory::write(Athena::io::YAMLDocWriter& w) const
{
if (m_elem)
{
w.enterSubRecord(m_elem->ClassName());
m_elem->write(w);
w.leaveSubRecord();
}
}
size_t IntElementFactory::binarySize(size_t __isz) const
{
if (m_elem)
return m_elem->binarySize(__isz + 4);
else
return __isz + 4;
}
void IntElementFactory::read(Athena::io::IStreamReader& r)
{
uint32_t clsId;
r.readBytesToBuf(&clsId, 4);
switch (clsId)
{
case SBIG('KEYE'):
m_elem.reset(new struct IEKeyframeEmitter);
break;
case SBIG('DETH'):
m_elem.reset(new struct IEDeath);
break;
case SBIG('CLMP'):
m_elem.reset(new struct IEClamp);
break;
case SBIG('CHAN'):
m_elem.reset(new struct IETimeChain);
break;
case SBIG('ADD_'):
m_elem.reset(new struct IEAdd);
break;
case SBIG('CNST'):
m_elem.reset(new struct IEConstant);
break;
case SBIG('IMPL'):
m_elem.reset(new struct IEImpulse);
break;
case SBIG('ILPT'):
m_elem.reset(new struct IELifetimePercent);
break;
case SBIG('IRND'):
m_elem.reset(new struct IEInitialRandom);
break;
case SBIG('PULS'):
m_elem.reset(new struct IEPulse);
break;
case SBIG('MULT'):
m_elem.reset(new struct IEMultiply);
break;
case SBIG('KEYP'):
m_elem.reset(new struct IEKeyframeEmitterP);
break;
case SBIG('SPAH'):
m_elem.reset(new struct IESampleAndHold);
break;
case SBIG('RAND'):
m_elem.reset(new struct IERandom);
break;
case SBIG('TSCL'):
m_elem.reset(new struct IETimeScale);
break;
default:
m_elem.reset();
return;
}
m_elem->read(r);
}
void IntElementFactory::write(Athena::io::IStreamWriter& w) const
{
if (m_elem)
{
w.writeBytes((atInt8*)m_elem->ClassName(), 4);
m_elem->write(w);
}
else
w.writeBytes((atInt8*)"NONE", 4);
}
}
}

View File

@ -0,0 +1,339 @@
#ifndef __COMMON_PARTICLECOMMON_HPP__
#define __COMMON_PARTICLECOMMON_HPP__
#include "DNACommon.hpp"
namespace Retro
{
namespace DNAParticle
{
struct IElement : BigYAML
{
Delete _d;
virtual ~IElement() = default;
virtual const char* ClassName() const=0;
};
struct IRealElement : IElement {Delete _d;};
struct RealElementFactory : BigYAML
{
Delete _d;
std::unique_ptr<IRealElement> m_elem;
void read(Athena::io::YAMLDocReader& r);
void write(Athena::io::YAMLDocWriter& w) const;
size_t binarySize(size_t __isz) const;
void read(Athena::io::IStreamReader& r);
void write(Athena::io::IStreamWriter& w) const;
};
struct IIntElement : IElement {Delete _d;};
struct IntElementFactory : BigYAML
{
Delete _d;
std::unique_ptr<IIntElement> m_elem;
void read(Athena::io::YAMLDocReader& r);
void write(Athena::io::YAMLDocWriter& w) const;
size_t binarySize(size_t __isz) const;
void read(Athena::io::IStreamReader& r);
void write(Athena::io::IStreamWriter& w) const;
};
struct RELifetimeTween : IRealElement
{
DECL_YAML
RealElementFactory a;
RealElementFactory b;
const char* ClassName() const {return "LFTW";}
};
struct REConstant : IRealElement
{
DECL_YAML
Value<float> val;
const char* ClassName() const {return "CNST";}
};
struct RETimeChain : IRealElement
{
DECL_YAML
RealElementFactory a;
RealElementFactory b;
IntElementFactory c;
const char* ClassName() const {return "CHAN";}
};
struct REAdd : IRealElement
{
DECL_YAML
RealElementFactory a;
RealElementFactory b;
const char* ClassName() const {return "ADD_";}
};
struct REClamp : IRealElement
{
DECL_YAML
RealElementFactory a;
RealElementFactory b;
RealElementFactory c;
const char* ClassName() const {return "CLMP";}
};
struct REKeyframeEmitter : IRealElement
{
DECL_YAML
Value<atUint32> a;
Value<atUint32> b;
Value<atUint8> c;
Value<atUint8> d;
Value<atUint32> e;
Value<atUint32> f;
Value<atUint32> count;
Vector<float, DNA_COUNT(count)> keys;
const char* ClassName() const {return "KEYE";}
};
struct REInitialRandom : IRealElement
{
DECL_YAML
RealElementFactory a;
RealElementFactory b;
const char* ClassName() const {return "IRND";}
};
struct REKeyframeEmitterP : REKeyframeEmitter
{
Delete _d;
const char* ClassName() const {return "KEYP";}
};
struct RERandom : IRealElement
{
DECL_YAML
RealElementFactory a;
RealElementFactory b;
const char* ClassName() const {return "RAND";}
};
struct REMultiply : IRealElement
{
DECL_YAML
RealElementFactory a;
RealElementFactory b;
const char* ClassName() const {return "MULT";}
};
struct REPulse : IRealElement
{
DECL_YAML
IntElementFactory a;
IntElementFactory b;
RealElementFactory c;
RealElementFactory d;
const char* ClassName() const {return "PULS";}
};
struct RETimeScale : IRealElement
{
DECL_YAML
RealElementFactory a;
const char* ClassName() const {return "SCAL";}
};
struct RELifetimePercent : IRealElement
{
DECL_YAML
RealElementFactory a;
const char* ClassName() const {return "RLPT";}
};
struct RESineWave : IRealElement
{
DECL_YAML
RealElementFactory a;
RealElementFactory b;
RealElementFactory c;
const char* ClassName() const {return "SINE";}
};
struct IEKeyframeEmitter : IIntElement
{
DECL_YAML
Value<atUint32> a;
Value<atUint32> b;
Value<atUint8> c;
Value<atUint8> d;
Value<atUint32> e;
Value<atUint32> f;
Value<atUint32> count;
Vector<atUint32, DNA_COUNT(count)> keys;
const char* ClassName() const {return "KEYE";}
};
struct IEDeath : IIntElement
{
DECL_YAML
IntElementFactory a;
IntElementFactory b;
const char* ClassName() const {return "DETH";}
};
struct IEClamp : IIntElement
{
DECL_YAML
IntElementFactory a;
IntElementFactory b;
IntElementFactory c;
const char* ClassName() const {return "CLMP";}
};
struct IETimeChain : IIntElement
{
DECL_YAML
IntElementFactory a;
IntElementFactory b;
IntElementFactory c;
const char* ClassName() const {return "CHAN";}
};
struct IEAdd : IIntElement
{
DECL_YAML
IntElementFactory a;
IntElementFactory b;
const char* ClassName() const {return "ADD_";}
};
struct IEConstant : IIntElement
{
DECL_YAML
Value<atUint32> val;
const char* ClassName() const {return "CNST";}
};
struct IEImpulse : IIntElement
{
DECL_YAML
IntElementFactory a;
const char* ClassName() const {return "IMPL";}
};
struct IELifetimePercent : IIntElement
{
DECL_YAML
IntElementFactory a;
const char* ClassName() const {return "ILPT";}
};
struct IEInitialRandom : IIntElement
{
DECL_YAML
IntElementFactory a;
IntElementFactory b;
const char* ClassName() const {return "IRND";}
};
struct IEPulse : IIntElement
{
DECL_YAML
IntElementFactory a;
IntElementFactory b;
IntElementFactory c;
IntElementFactory d;
const char* ClassName() const {return "PULS";}
};
struct IEMultiply : IIntElement
{
DECL_YAML
IntElementFactory a;
IntElementFactory b;
const char* ClassName() const {return "MULT";}
};
struct IEKeyframeEmitterP : IEKeyframeEmitter
{
Delete _d;
const char* ClassName() const {return "KEYP";}
};
struct IESampleAndHold : IIntElement
{
DECL_YAML
IntElementFactory a;
IntElementFactory b;
IntElementFactory c;
const char* ClassName() const {return "SPAH";}
};
struct IERandom : IIntElement
{
DECL_YAML
IntElementFactory a;
IntElementFactory b;
const char* ClassName() const {return "RAND";}
};
struct IETimeScale : IIntElement
{
DECL_YAML
RealElementFactory a;
const char* ClassName() const {return "TSCL";}
};
template <class IDType>
struct ChildGeneratorDesc : BigYAML
{
Delete _d;
IDType id;
void read(Athena::io::YAMLDocReader& r)
{
id.clear();
if (r.enterSubRecord("CNST"))
{
id.read(r);
r.leaveSubRecord();
}
}
void write(Athena::io::YAMLDocWriter& w) const
{
if (id)
{
w.enterSubRecord("CNST");
id.write(w);
w.leaveSubRecord();
}
}
size_t binarySize(size_t __isz) const
{
if (id)
return __isz + 8;
else
return __isz + 4;
}
void read(Athena::io::IStreamReader& r)
{
id.clear();
if (r.readUint32Big() == 'CNST')
id.read(r);
}
void write(Athena::io::IStreamWriter& w) const
{
if (id)
{
w.writeUint32Big('CNST');
id.write(w);
}
else
w.writeUint32Big('NONE');
}
};
}
}
#endif // __COMMON_PARTICLECOMMON_HPP__

View File

@ -0,0 +1,4 @@
#ifndef __COMMON_SWHC_HPP__
#define __COMMON_SWHC_HPP__
#endif // __COMMON_SWHC_HPP__

View File

@ -19,7 +19,7 @@ endif()
atdna(atdna_Space.cpp Space.hpp)
atdna(atdna_ResourceBrowser.cpp ResourceBrowser.hpp)
atdna(atdna_ModelViewer.cpp ModelViewer.hpp)
atdna(atdna_EffectEditor.cpp EffectEditor.hpp)
atdna(atdna_ParticleEditor.cpp ParticleEditor.hpp)
if(WIN32)
set(PLAT_SRCS platforms/win/urde.rc)
@ -39,9 +39,10 @@ add_executable(urde WIN32 MACOSX_BUNDLE
SplashScreen.hpp SplashScreen.cpp
ResourceBrowser.hpp ResourceBrowser.cpp atdna_ResourceBrowser.cpp
ModelViewer.hpp ModelViewer.cpp atdna_ModelViewer.cpp
EffectEditor.hpp EffectEditor.cpp atdna_EffectEditor.cpp
ParticleEditor.hpp ParticleEditor.cpp atdna_ParticleEditor.cpp
ProjectManager.hpp ProjectManager.cpp
ViewManager.hpp ViewManager.cpp
Resource.hpp Resource.cpp
Camera.hpp Camera.cpp)
target_link_libraries(urde

View File

@ -1,6 +0,0 @@
#include "EffectEditor.hpp"
namespace URDE
{
}

View File

@ -0,0 +1,6 @@
#include "ParticleEditor.hpp"
namespace URDE
{
}

View File

@ -1,5 +1,5 @@
#ifndef URDE_EFFECT_EDITOR_HPP
#define URDE_EFFECT_EDITOR_HPP
#ifndef URDE_PARTICLE_EDITOR_HPP
#define URDE_PARTICLE_EDITOR_HPP
#include "Space.hpp"
@ -15,6 +15,12 @@ class EffectEditor : public EditorSpace
} m_state;
const Space::State& spaceState() const {return m_state;}
struct View : Specter::View
{
View(Specter::ViewResources& res, Specter::View& parent)
: Specter::View(res, parent) {}
};
Specter::View* buildContentView(Specter::ViewResources& res)
{
return nullptr;
@ -36,4 +42,4 @@ public:
}
#endif // URDE_EFFECT_EDITOR_HPP
#endif // URDE_PARTICLE_EDITOR_HPP

14
Editor/Resource.cpp Normal file
View File

@ -0,0 +1,14 @@
#include "Resource.hpp"
namespace URDE
{
Space::Class Resource::DeduceDefaultSpaceClass(const HECL::ProjectPath& path)
{
Athena::io::FileReader r(path.getAbsolutePath(), 32*1024, false);
if (r.hasError())
return Space::Class::None;
return Space::Class::None;
}
}

50
Editor/Resource.hpp Normal file
View File

@ -0,0 +1,50 @@
#ifndef URDE_RESOURCE_HPP
#define URDE_RESOURCE_HPP
#include <HECL/Database.hpp>
#include "Space.hpp"
namespace URDE
{
/** Combines a ProjectPath with actively used Space references
*
* This class is intended to be heap-allocated in a hierarchical mapping, so the entire tree
* of resources is available in-memory to systems that need it. Refreshes of the index will
* continue to use existing allocations that haven't been deleted.
*
* The key purpose of this class is to centrally register observer-nodes for resources that
* are updated via editing, or external file changes.
*/
class Resource
{
public:
using ProjectDataSpec = HECL::Database::Project::ProjectDataSpec;
private:
HECL::ProjectPath m_path;
Space::Class m_defaultClass = Space::Class::None;
EditorSpace* m_editingSpace = nullptr;
std::vector<ViewerSpace*> m_viewingSpaces;
public:
static Space::Class DeduceDefaultSpaceClass(const HECL::ProjectPath& path);
explicit Resource(HECL::ProjectPath&& path)
: m_path(std::move(path)), m_defaultClass(DeduceDefaultSpaceClass(m_path)) {}
const HECL::ProjectPath& path() const {return m_path;}
};
/** Provides centralized hierarchical lookup and ownership of Resource nodes */
class ResourceTree
{
public:
struct Node
{
std::map<HECL::ProjectPath, std::unique_ptr<Node>> m_subnodes;
std::map<HECL::ProjectPath, std::unique_ptr<Resource>> m_resources;
};
private:
std::unique_ptr<Node> m_rootNode;
};
}
#endif // URDE_RESOURCE_HPP

View File

@ -1,7 +1,7 @@
#include "Space.hpp"
#include "ViewManager.hpp"
#include "ResourceBrowser.hpp"
#include "EffectEditor.hpp"
#include "ParticleEditor.hpp"
#include "icons/icons.hpp"
namespace URDE

2
hecl

@ -1 +1 @@
Subproject commit 3a8130b8609cf91cd9f75a951f0eed16037d2618
Subproject commit af0acd9fe8a7678e052697db2b7ff175d1f91abc