resonance 1.0.1
Loading...
Searching...
No Matches
view.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstddef>
4
5#include "os/hxstr.h"
6#include "rnd/animatable.h"
7#include "rnd/collideable.h"
8#include "rnd/drawable.h"
9#include "rnd/transformable.h"
10
11namespace Rnd {
12class Dbg;
13class Object;
14class Stream;
15} // namespace Rnd
16
17namespace Rnd {
18
47class View : public Animatable, public Drawable, public Transformable, public Collideable {
48public:
57 void *operator new(size_t nSize);
58
66 void operator delete(void *pBlock);
67
78 explicit View(const HxStr &name);
79
84 virtual ~View();
85
90 virtual void DumpText(Dbg &sink);
91
96 virtual void Save(Stream &stream);
97
102 virtual void Replace(Object *pFrom, Object *pTo);
103
108 virtual const HxStr &ClassName() const;
109
114 virtual void Copy(const Object *pSource, unsigned nFlags);
115
120 virtual void Load(Stream &stream);
121
130 static View *NewView(const HxStr &name);
131
141 static void Init();
142
154 void AddView(View *pChild);
155
167 void RemoveView(View *pChild);
168
169 // Declared in recovered offset order. Each flag is named after the class key of the factory
170 // that sets it. Every writer is one of those factories and no reader was located, so the four
171 // are public because nothing in the image constrains them further.
172
177
178private:
188 void RemoveObjectRefs();
189};
190
198
199} // namespace Rnd
Heap-allocated NUL-terminated string.
Definition hxstr.h:41
Animatable()
Construct an animatable with no children, no filters, and a zero frame.
Collideable()
Construct a collideable with no children.
Sink that the engine formats its diagnostic and failure text into.
Definition dbg.h:33
Drawable()
Construct a visible drawable with no children.
Base of every object the renderer can load, resolve by name, and serialise.
Definition object.h:43
Byte stream that every renderer object serialises itself through.
Definition stream.h:31
Transformable()
Construct a dirty transformable with identity transforms and no children.
virtual void Copy(const Object *pSource, unsigned nFlags)
void AddView(View *pChild)
Add another view as a child in all three roles.
void RemoveView(View *pChild)
Remove another view from all four child roles.
virtual void Load(Stream &stream)
virtual ~View()
virtual void Save(Stream &stream)
virtual void Replace(Object *pFrom, Object *pTo)
static void Init()
Register the five class keys this class answers to with Rnd::TheManager.
int mAnimatable
Definition view.h:173
static View * NewView(const HxStr &name)
Build a view the class registry vends.
virtual const HxStr & ClassName() const
int mCollideable
Definition view.h:176
View(const HxStr &name)
Construct an empty scene root.
virtual void DumpText(Dbg &sink)
int mTransformable
Definition view.h:174
int mDrawable
Definition view.h:175
The rendering engine.
Definition animhelper.h:3
HxStr g_viewClassName
Class key a .rnd file writes for a view.