summaryrefslogtreecommitdiff
path: root/src/JSystem/JStudio/JStudio_JParticle/control.cpp
blob: 4eb6186ffcc8c41fadb9ffe7af4a6061647bc8ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// Generated by dtk
// Translation Unit: control.cpp
//

#include "JSystem/JSystem.h" // IWYU pragma: keep

#include "JSystem/JStudio/JStudio_JParticle/control.h"

namespace JStudio_JParticle {

namespace {
// Fake inline.
// TODO: supposed to use JStudio::TObject::createFromAdaptor instead of this somehow
static inline JStudio::TObject_particle* create(const JStudio::stb::data::TParse_TBlock_object& data, TAdaptor_particle* adaptor)
{
    JStudio::TObject_particle* object = new JStudio::TObject_particle(data, adaptor);
    if (object == NULL) {
        // TODO: This should probably delete the adaptor in NONMATCHING builds, if the object couldn't get created.
        return NULL;
    } else {
        if (object->mpAdaptor != NULL) {
            object->mpAdaptor->adaptor_do_prepare(object);
        }
    }
    return object;
}

/* 802796E4-802797A0       .text createObject_PARTICLE_JPA___Q217JStudio_JParticle21@unnamed@control_cpp@FRCQ47JStudio3stb4data20TParse_TBlock_objectP17JPAEmitterManagerPCQ26JStage7TSystem */
JStudio::TObject_particle* createObject_PARTICLE_JPA_(const JStudio::stb::data::TParse_TBlock_object& data, JPAEmitterManager* manager,
                                                      const JStage::TSystem* system)
{
    TAdaptor_particle* adaptor = new TAdaptor_particle(manager, system);
    if (adaptor == NULL) {
        return NULL;
    }
    JStudio::TObject_particle* object = create(data, adaptor);
    return object;
}
} // namespace

/* 802797A0-80279800       .text __dt__Q217JStudio_JParticle13TCreateObjectFv */
TCreateObject::~TCreateObject() {}

/* 80279800-80279878       .text create__Q217JStudio_JParticle13TCreateObjectFPPQ27JStudio7TObjectRCQ47JStudio3stb4data20TParse_TBlock_object */
bool TCreateObject::create(JStudio::TObject** newObject, const JStudio::stb::data::TParse_TBlock_object& data) {
    JStudio::TObject_particle* (*func)(const JStudio::stb::data::TParse_TBlock_object&, JPAEmitterManager*, const JStage::TSystem*);
    switch (data.get()->type) {
    case 'JPTC': {
        func = &createObject_PARTICLE_JPA_;
        break;
    }
    default:
        return false;
    }
    *newObject = func(data, mEmitterMgr, mSystem);
    return true;
}

} // namespace JStudio_JParticle