Gorgon Game Engine
Pointer.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Drawables.h"
4 #include "../Utils/Assert.h"
5 #include "../Geometry/Point.h"
6 #include "../Containers/Hashmap.h"
7 #include "Animations.h"
8 #include "TextureAnimation.h"
9 
10 
11 namespace Gorgon { namespace Graphics {
12 
18  class Pointer : virtual public Drawable {
19  public:
20 
21  virtual ~Pointer() {
22  }
23 
24  protected:
25  };
26 
28  class DrawablePointer : public Pointer {
29  public:
30  DrawablePointer() = default;
31 
34  DrawablePointer(const Drawable &image, int x, int y) : DrawablePointer(image, {x, y}) {}
35 
38  DrawablePointer(const Drawable &image, Geometry::Point hotspot) :
39  image(&image), hotspot(hotspot) {}
40 
43  DrawablePointer(const AssumeOwnershipTag &tag, const Drawable &image, int x, int y) : DrawablePointer(tag, image, {x, y}) {}
44 
47  DrawablePointer(const AssumeOwnershipTag &, const Drawable &image, Geometry::Point hotspot) :
48  image(&image), hotspot(hotspot) { owner = true; }
49 
50  DrawablePointer(const DrawablePointer &other) = delete;
51 
53  image(other.image), hotspot(other.hotspot), owner(other.owner) {
54  other.image = nullptr;
55  other.owner = false;
56  }
57 
59 
61  RemoveImage();
62  image = other.image;
63  owner = other.owner;
64  hotspot = other.hotspot;
65 
66  other.image = nullptr;
67  other.owner = false;
68 
69  return *this;
70  }
71 
72  //Pointer(Resource::Pointer &pointer);
73 
75  RemoveImage();
76  }
77 
78 
80  bool HasImage() const {
81  return image != nullptr;
82  }
83 
86  const Drawable &GetImage() const {
87  ASSERT(image, "Pointer image is not set");
88 
89  return *image;
90  }
91 
93  void SetImage(const Drawable &value) {
94  RemoveImage();
95 
96  image = &value;
97  }
98 
101  void Assume(const Drawable &value) {
102  RemoveImage();
103 
104  image = &value;
105  owner = true;
106  }
107 
110  void Assume(const Drawable &value, Geometry::Point hotspot) {
111  RemoveImage();
112 
113  image = &value;
114  owner = true;
115  this->hotspot = hotspot;
116  }
117 
120  void Assume(const Drawable &value, int x, int y) {
121  RemoveImage();
122 
123  image = &value;
124  owner = true;
125  this->hotspot = {x, y};
126  }
127 
129  void RemoveImage() {
130  if(owner) {
131  delete image;
132  owner = false;
133  }
134 
135  image = nullptr;
136  }
137 
139  const Drawable &Release() {
140  auto img = image;
141 
142  owner = false;
143  image = nullptr;
144 
145  return *img;
146  }
147 
148 
149  protected:
150  void draw(Gorgon::Graphics::TextureTarget &target, const Geometry::Pointf &p, Gorgon::Graphics::RGBAf color) const override {
151  if(!image) return;
152 
153  image->Draw(target, p-hotspot, color);
154  }
155 
156  private:
157  const Drawable *image = nullptr;
158  Geometry::Point hotspot ={0, 0};
159 
160  bool owner = false;
161  };
162 
163  template<class A_>
164  class basic_PointerProvider;
165 
167  template<class A_>
168  class basic_AnimatedPointer : public virtual Pointer, public virtual A_::AnimationType {
169  public:
170  basic_AnimatedPointer(const basic_PointerProvider<A_> &parent, typename A_::AnimationType &anim) :
171  A_::AnimationType(parent, false), anim(&anim), parent(parent)
172  { }
173 
175 
176  basic_AnimatedPointer(basic_AnimatedPointer &&other) : A_::AnimationType(other.parent, false), anim(other.anim), parent(other.parent) {
177  other.anim = nullptr;
178  }
179 
181  if(anim)
182  anim->DeleteAnimation();
183  }
184 
186  ASSERT(anim, "Trying to use a moved out pointer");
187 
188  anim->SetController(controller);
189  }
190 
191  bool HasController() const override {
192  ASSERT(anim, "Trying to use a moved out pointer");
193 
194  return anim->HasController();
195  }
196 
198  ASSERT(anim, "Trying to use a moved out pointer");
199 
200  return anim->GetController();
201  }
202 
203  void RemoveController() const {
204  ASSERT(anim, "Trying to use a moved out pointer");
205 
206  anim->RemoveController();
207  }
208 
209  protected:
210  void draw(Gorgon::Graphics::TextureTarget &target, const Geometry::Pointf &p, Gorgon::Graphics::RGBAf color) const override;
211 
213  typename A_::AnimationType *anim;
214  };
215 
217  template<class A_>
218  class basic_PointerProvider : public A_ {
219  public:
221 
223  hotspot(hotspot) {
224  }
225 
228  hotspot(other.hotspot), owned(other.owned) {
229  other.owned = false;
230  }
231 
233 
235  }
236 
239  return AnimationType(*this, A_::CreateAnimation(timer));
240  }
241 
243  AnimationType CreatePointer(bool create = true) const {
244  return AnimationType(*this, A_::CreateAnimation(create));
245  }
246 
249  return *new basic_AnimatedPointer<A_>(*this, A_::CreateAnimation(timer));
250  }
251 
253  AnimationType &CreateAnimation(bool create = true) const override {
254  return *new basic_AnimatedPointer<A_>(*this, A_::CreateAnimation(create));
255  }
256 
259  return hotspot;
260  }
261 
264  hotspot = value;
265  }
266 
267  protected:
270 
272  bool owned;
273  };
274 
278 
280  enum class PointerType {
282  None=0,
283 
285  Arrow=1,
286 
288  Wait=2,
289 
291  No=3,
292 
294  Text=4,
295 
297  Hand=5,
298 
300  Drag=6
301  };
302 
303 
309  class PointerStack {
310  public:
311 
313  class Token {
314  friend class PointerStack;
315  public:
316  Token() { }
317 
318  Token(Token &&other) {
319  parent = other.parent;
320  ind = other.ind;
321 
322  other.parent = nullptr;
323  other.ind = 0;
324  }
325 
326  ~Token() {
327  if(parent)
328  parent->Reset(*this);
329  }
330 
332  if(parent)
333  parent->Reset(*this);
334 
335  parent = tok.parent;
336  ind = tok.ind;
337 
338  tok.parent = nullptr;
339  tok.ind = 0;
340 
341  return *this;
342  }
343 
345  bool IsNull() const { return parent == nullptr; }
346 
348  explicit operator bool() const { return !IsNull(); }
349 
351  bool operator !() const { return IsNull(); }
352 
353  private:
354  Token(PointerStack *parent, int ind) : parent(parent), ind(ind) { }
355 
356  PointerStack *parent = nullptr;
357  int ind = 0;
358  };
359 
360  PointerStack() = default;
361 
362  PointerStack(const PointerStack &) = delete;
363 
365  Swap(other);
366  }
367 
368  void Swap(PointerStack &other) {
369  using std::swap;
370 
371  swap(lastind, other.lastind);
372  swap(stack, other.stack);
373  swap(pointers, other.pointers);
374  }
375 
377  for(auto &w : pointers) {
378  if(w.owned)
379  delete w.ptr;
380  }
381  }
382 
386  void Add(PointerType type, const Pointer &pointer);
387 
389  void Add(PointerType type, const Pointer &&pointer) {
390  Assume(type, pointer);
391  }
392 
396  void Assume(PointerType type, const Pointer &pointer);
397 
402  void Add(PointerType type, const Drawable &image, Geometry::Point hotspot);
403 
404  void Add(PointerType type, const Drawable &&image, Geometry::Point hotspot) = delete;
405 
407  bool Exists(PointerType type) {
408  if((int)type <= 0 || (int)type > (int)PointerType::Drag) return false;
409 
410  return pointers[(int)type].ptr != nullptr;
411  }
412 
416  Token Set(PointerType type);
417 
421  Token Set(const Pointer &pointer);
422 
425  void Reset(Token &token);
426 
430  const Pointer &Current() const;
431 
434  bool IsValid() const;
435 
436  private:
437  struct Wrapper {
438  const Pointer *ptr = nullptr;
439  bool owned = false;
440  };
441 
442  int lastind = 0;
443 
445 
446  std::array<Wrapper, (int)PointerType::Drag+1> pointers = {};
447  };
448 
449 
450  template<class A_>
452  ASSERT(anim, "Try to use a moved out pointer");
453 
454  anim->Draw(target, p-parent.GetHotspot(), color);
455  }
456 
457 } }
Gorgon::Graphics::DrawablePointer::SetImage
void SetImage(const Drawable &value)
Changes the image of this pointer.
Definition: Pointer.h:93
Gorgon::Graphics::PointerStack::Token::~Token
~Token()
Definition: Pointer.h:326
Gorgon::swap
void swap(Event< Source_, Args_... > &l, Event< Source_, Args_... > &r)
Swaps two events.
Definition: Event.h:351
Gorgon::Animation::basic_Storage
This class stores animations as a part of itself so that it can be moved around as a value rather tha...
Definition: Storage.h:21
Gorgon::Graphics::basic_AnimatedPointer::SetController
void SetController(Gorgon::Animation::ControllerBase &controller) override
Definition: Pointer.h:185
Gorgon::String::From
std::enable_if< decltype(gorgon__enum_tr_loc(T_()))::isupgradedenum, std::string >::type From(const T_ &e)
Definition: Enum.h:303
Gorgon::Graphics::DrawablePointer::DrawablePointer
DrawablePointer(const AssumeOwnershipTag &, const Drawable &image, Geometry::Point hotspot)
Initializes a pointer.
Definition: Pointer.h:47
Gorgon::Graphics::basic_PointerProvider::AnimationType
basic_AnimatedPointer< A_ > AnimationType
Definition: Pointer.h:220
Gorgon::Graphics::PointerStack::Current
const Pointer & Current() const
Returns the pointer on top of the stack, if no pointer is on the stack, first pointer in the order of...
Definition: Pointer.cpp:53
Gorgon::Graphics::DrawablePointer::Release
const Drawable & Release()
Releases the ownership of the drawable and removes it from the pointer.
Definition: Pointer.h:139
File.h
Gorgon::Resource::Pointer::Prepare
void Prepare() override
This function shall prepare this resource to be used after resource is loaded.
Definition: Pointer.cpp:63
Gorgon::Graphics::PointerStack::Token::operator!
bool operator!() const
Checks if the token is invalid.
Definition: Pointer.h:351
Gorgon::Graphics::basic_TextureAnimationProvider
Definition: TextureAnimation.h:137
Gorgon::Graphics::DrawablePointer::DrawablePointer
DrawablePointer()=default
Gorgon::Graphics::PointerType::None
@ None
No pointer is selected or using default.
Gorgon::Resource::Reader::ReadEnum32
E_ ReadEnum32()
Reads an enumeration as 32-bit integer from the stream.
Definition: Reader.h:208
Gorgon::Graphics::PointerStack::Assume
void Assume(PointerType type, const Pointer &pointer)
Adds the given pointer to the stack.
Definition: Pointer.cpp:16
Gorgon::Graphics::PointerStack::~PointerStack
~PointerStack()
Definition: Pointer.h:376
Gorgon::Containers::Hashmap
This class is a reference based hashmap.
Definition: Hashmap.h:35
Gorgon::Graphics::DrawablePointer::DrawablePointer
DrawablePointer(const Drawable &image, Geometry::Point hotspot)
Initializes a pointer.
Definition: Pointer.h:38
Gorgon::Graphics::DrawablePointer::Assume
void Assume(const Drawable &value, Geometry::Point hotspot)
Changes the image of the pointer by assuming the ownership of the given image.
Definition: Pointer.h:110
Gorgon::Animation::ControllerBase
Controllers are required to progress animations.
Definition: Animation.h:65
Gorgon::Graphics::basic_AnimatedPointer::basic_AnimatedPointer
basic_AnimatedPointer(const basic_AnimatedPointer &)=delete
Gorgon::Resource::Writer::WriteChunkHeader
void WriteChunkHeader(GID::Type type, unsigned long size)
Writes the header of a chunk.
Definition: Writer.h:364
Gorgon::Graphics::PointerStack::PointerStack
PointerStack(PointerStack &&other)
Definition: Pointer.h:364
Gorgon::Graphics::DrawablePointer::~DrawablePointer
~DrawablePointer()
Definition: Pointer.h:74
Drawables.h
Gorgon::Resource::Animation::SaveThis
static void SaveThis(Writer &writer, const Graphics::BitmapAnimationProvider &anim, GID::Type type=GID::Animation, std::function< void(Writer &writer)> extra={})
Saves the given animation as a resource.
Definition: Animation.cpp:100
Gorgon::Graphics::basic_PointerProvider::basic_PointerProvider
basic_PointerProvider(Geometry::Point hotspot={0, 0})
Definition: Pointer.h:222
Gorgon::Graphics::DrawablePointer::operator=
DrawablePointer & operator=(const DrawablePointer &)=delete
Gorgon::Resource::Pointer::type
Graphics::PointerType type
Definition: Pointer.h:71
Gorgon::Graphics::RGBAf
Represents a four channel 32 bit float per channel color information.
Definition: Color.h:373
Gorgon::Resource::Writer::WriteObjectStart
Marker WriteObjectStart(const Base &base)
Writes the start of an object. Should have a matching WriteEnd with the returned marker.
Definition: File.cpp:211
Gorgon::Graphics::DrawablePointer::Assume
void Assume(const Drawable &value)
Changes the image of the pointer by assuming the ownership of the given image.
Definition: Pointer.h:101
Gorgon::Resource::Pointer::LoadResource
static Resource::Pointer * LoadResource(std::weak_ptr< Gorgon::Resource::File > file, std::shared_ptr< Gorgon::Resource::Reader > reader, long unsigned int size)
This function loads a bitmap font resource from the given file.
Definition: Pointer.cpp:6
Gorgon::Graphics::DrawablePointer::GetImage
const Drawable & GetImage() const
Returns the image contained in this pointer.
Definition: Pointer.h:86
Gorgon::Utils::ASSERT_FALSE
void ASSERT_FALSE(const std::string &message, int skip=1, int depth=4)
Definition: Assert.h:192
Pointer.h
Gorgon::Graphics::PointerStack::PointerStack
PointerStack()=default
Gorgon::Graphics::DrawablePointer::DrawablePointer
DrawablePointer(DrawablePointer &&other)
Definition: Pointer.h:52
Gorgon::Graphics::PointerStack::IsValid
bool IsValid() const
Returns if the stack is valid to be used.
Definition: Pointer.cpp:67
Gorgon::Graphics::basic_PointerProvider::hotspot
Geometry::Point hotspot
Hotspot will be transferred to newly created pointers.
Definition: Pointer.h:269
Gorgon::Graphics::basic_AnimatedPointer::GetController
Gorgon::Animation::ControllerBase & GetController() const
Definition: Pointer.h:197
Gorgon::Graphics::PointerType
PointerType
Pointer types.
Definition: Pointer.h:280
Gorgon::Graphics::BitmapPointerProvider
basic_PointerProvider< BitmapAnimationProvider > BitmapPointerProvider
Definition: Pointer.h:276
Gorgon
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
Gorgon::Graphics::DrawablePointer
This class turns a drawable into a pointer.
Definition: Pointer.h:28
Gorgon::Graphics::PointerStack::Reset
void Reset(Token &token)
Removes a pointer shape from the stack.
Definition: Pointer.cpp:44
Gorgon::Graphics::DrawablePointer::DrawablePointer
DrawablePointer(const DrawablePointer &other)=delete
Gorgon::Resource::Pointer::animmoveout
virtual Graphics::RectangularAnimationStorage animmoveout() override
Definition: Pointer.cpp:69
Gorgon::Graphics::basic_AnimatedPointer::draw
void draw(Gorgon::Graphics::TextureTarget &target, const Geometry::Pointf &p, Gorgon::Graphics::RGBAf color) const override
This is the only function that needs to implemented for a drawable.
Definition: Pointer.h:451
Gorgon::Graphics::PointerStack::Token::operator=
Token & operator=(Token &&tok)
Definition: Pointer.h:331
ASSERT
#define ASSERT(expression, message,...)
Replaces regular assert to allow messages and backtrace.
Definition: Assert.h:161
Gorgon::Resource::Reader::ReadChunkSize
unsigned long ReadChunkSize()
Reads chunk size from a stream.
Definition: Reader.h:381
Gorgon::Graphics::basic_PointerProvider::CreateAnimation
AnimationType & CreateAnimation(bool create=true) const override
Creates a pointer from this provider.
Definition: Pointer.h:253
Gorgon::Graphics::PointerStack::Token::Token
Token()
Definition: Pointer.h:316
Gorgon::Graphics::basic_PointerProvider::CreatePointer
AnimationType CreatePointer(Gorgon::Animation::Timer &timer) const
Creates a pointer from this provider.
Definition: Pointer.h:238
Gorgon::Resource::Pointer
Pointer resource that can be used to create a new pointer to be displayed.
Definition: Pointer.h:25
Gorgon::Graphics::Pointer
Represents a pointer.
Definition: Pointer.h:18
Gorgon::Graphics::basic_PointerProvider::basic_PointerProvider
basic_PointerProvider(const basic_PointerProvider &)=delete
Gorgon::Graphics::DrawablePointer::HasImage
bool HasImage() const
Returns if the pointer has an image.
Definition: Pointer.h:80
Gorgon::Resource::GID::Animation
constexpr Type Animation
Definition: GID.h:187
Gorgon::Resource::Base
This class is the base for all Gorgon Resources.
Definition: Base.h:20
Gorgon::Graphics::basic_PointerProvider::CreatePointer
AnimationType CreatePointer(bool create=true) const
Creates a pointer from this provider, just a rename for CreateAnimation.
Definition: Pointer.h:243
Gorgon::Graphics::DrawablePointer::draw
void draw(Gorgon::Graphics::TextureTarget &target, const Geometry::Pointf &p, Gorgon::Graphics::RGBAf color) const override
This is the only function that needs to implemented for a drawable.
Definition: Pointer.h:150
Gorgon::Graphics::basic_PointerProvider::SetHotspot
void SetHotspot(Geometry::Point value)
Sets the hotspot of the pointer.
Definition: Pointer.h:263
Gorgon::Graphics::DrawablePointer::RemoveImage
void RemoveImage()
Removes the image from the pointer.
Definition: Pointer.h:129
Gorgon::Graphics::Drawable::Draw
void Draw(TextureTarget &target, int x, int y, RGBAf color=RGBAf(1.f)) const
Draw to the given coordinates.
Definition: Drawables.h:22
Gorgon::Resource::Pointer::MoveOut
Graphics::BitmapPointerProvider MoveOut()
Moves the pointer provider out of resource system.
Definition: Pointer.cpp:47
Gorgon::Graphics::basic_PointerProvider::~basic_PointerProvider
virtual ~basic_PointerProvider()
Definition: Pointer.h:234
Gorgon::Resource::Reader::Target
Mark Target(unsigned long delta)
Creates mark to the the target that is delta distance from current point in file.
Definition: Reader.h:193
Gorgon::Resource::Reader::EatChunk
void EatChunk(long size)
Removes a chunk of data with the given size from the stream.
Definition: Reader.h:389
Gorgon::Graphics::basic_PointerProvider::GetHotspot
Geometry::Point GetHotspot() const
Returns the hotspot of the provider.
Definition: Pointer.h:258
Gorgon::Graphics::basic_AnimatedPointer::anim
A_::AnimationType * anim
Definition: Pointer.h:213
Gorgon::Graphics::TextureTarget
This interface defines a class that can be used as a common target for texture based drawing.
Definition: TextureTargets.h:12
Gorgon::Graphics::Pointer::~Pointer
virtual ~Pointer()
Definition: Pointer.h:21
Gorgon::Graphics::PointerStack::Token::Token
Token(Token &&other)
Definition: Pointer.h:318
Gorgon::Graphics::basic_PointerProvider
This class stores information that allows an animated pointer to be created.
Definition: Pointer.h:218
Gorgon::Graphics::PointerStack
This class manages a pointer stack that allows multiple pointers to be registered and switched.
Definition: Pointer.h:309
Gorgon::Graphics::DrawablePointer::Assume
void Assume(const Drawable &value, int x, int y)
Changes the image of the pointer by assuming the ownership of the given image.
Definition: Pointer.h:120
Gorgon::Graphics::PointerStack::Token::IsNull
bool IsNull() const
Checks if the token is null.
Definition: Pointer.h:345
Gorgon::Geometry::basic_Point
This class represents a 2D point.
Definition: Point.h:32
Gorgon::Resource::Writer
This class allows resource objects to save their data to a stream.
Definition: Writer.h:59
Gorgon::Animation::Timer
This class is the most basic controller and does not support any operations.
Definition: Animation.h:126
Writer.h
Gorgon::Graphics::basic_PointerProvider::CreateAnimation
AnimationType & CreateAnimation(Gorgon::Animation::ControllerBase &timer) const override
Creates a pointer from this provider.
Definition: Pointer.h:248
Gorgon::Resource::Reader::ReadGID
GID::Type ReadGID()
Reads a GID from the given stream.
Definition: Reader.h:341
Gorgon::Graphics::DrawablePointer::DrawablePointer
DrawablePointer(const AssumeOwnershipTag &tag, const Drawable &image, int x, int y)
Initializes a pointer.
Definition: Pointer.h:43
Gorgon::Graphics::PointerStack::Swap
void Swap(PointerStack &other)
Definition: Pointer.h:368
Gorgon::Resource::Reader::ReadPoint
Geometry::Point ReadPoint()
Reads a Point from the given stream.
Definition: Reader.h:357
Gorgon::Resource::Writer::WriteEnd
void WriteEnd(Marker &marker)
This function performs writes necessary to end a chunk that is represented by the marker.
Definition: Writer.h:373
Animations.h
Gorgon::UI::Graphics
@ Graphics
Definition: Template.h:164
Gorgon::Graphics::basic_AnimatedPointer::basic_AnimatedPointer
basic_AnimatedPointer(basic_AnimatedPointer &&other)
Definition: Pointer.h:176
Gorgon::Graphics::basic_AnimatedPointer::HasController
bool HasController() const override
Definition: Pointer.h:191
Gorgon::Graphics::RectangularAnimationStorage
Gorgon::Animation::basic_Storage< RectangularAnimationProvider > RectangularAnimationStorage
Definition: Animations.h:374
Gorgon::Graphics::PointerStack::PointerStack
PointerStack(const PointerStack &)=delete
Gorgon::Graphics::PointerStack::Token
Token type, automatically pops pointer stack when goes out of scope.
Definition: Pointer.h:313
Gorgon::Graphics::PointerStack::Add
void Add(PointerType type, const Pointer &&pointer)
Move variant that maps to assume.
Definition: Pointer.h:389
Gorgon::Resource::Pointer::Pointer
Pointer(Graphics::Bitmap &bmp, Geometry::Point hotspot, Graphics::PointerType type)
Definition: Pointer.h:27
Gorgon::Graphics::Drawable
Represents a drawable object, that can be drawn to the given point.
Definition: Drawables.h:17
Gorgon::Graphics::basic_PointerProvider::basic_PointerProvider
basic_PointerProvider(basic_PointerProvider &&other)
Move constructor.
Definition: Pointer.h:227
Gorgon::Resource::Base::children
Containers::Collection< Base > children
Child objects that this resource object have.
Definition: Base.h:162
Gorgon::Graphics::PointerStack::Set
Token Set(PointerType type)
Set the current pointer to the given type.
Definition: Pointer.cpp:28
Gorgon::Resource::Writer::WriteEnum32
void WriteEnum32(E_ value)
Writes an enumeration as 32-bit integer to the stream.
Definition: Writer.h:140
Gorgon::Resource::GID::Pointer_Props
constexpr Type Pointer_Props
Definition: GID.h:197
Gorgon::Graphics::PointerStack::Exists
bool Exists(PointerType type)
Checks if the given pointer exists.
Definition: Pointer.h:407
Gorgon::Graphics::basic_AnimatedPointer::basic_AnimatedPointer
basic_AnimatedPointer(const basic_PointerProvider< A_ > &parent, typename A_::AnimationType &anim)
Definition: Pointer.h:170
TextureAnimation.h
Gorgon::Resource::Animation::LoadResource
static Animation * LoadResource(std::weak_ptr< File > file, std::shared_ptr< Reader > reader, unsigned long size)
This function loads an animation resource from the given file.
Definition: Animation.h:51
Gorgon::Graphics::DrawablePointer::DrawablePointer
DrawablePointer(const Drawable &image, int x, int y)
Initializes a pointer.
Definition: Pointer.h:34
Gorgon::Resource::Reader::ReadCommonChunk
bool ReadCommonChunk(Base &self, GID::Type gid, unsigned long size)
Definition: File.cpp:41
Gorgon::Graphics::basic_AnimatedPointer::~basic_AnimatedPointer
~basic_AnimatedPointer()
Definition: Pointer.h:180
Gorgon::AssumeOwnershipTag
Where acceptable, denotes that the object will assume the ownership.
Definition: Types.h:136
Gorgon::Resource::Animation
This class represents an animation resource.
Definition: Animation.h:19
Gorgon::Graphics::basic_AnimatedPointer
Represents animated pointer.
Definition: Pointer.h:168
Gorgon::Graphics::PointerType::Text
@ Text
Text / Beam pointer.
Gorgon::Graphics::basic_AnimatedPointer::RemoveController
void RemoveController() const
Definition: Pointer.h:203
Gorgon::Graphics::basic_PointerProvider::owned
bool owned
Whether the animation is owned by this object.
Definition: Pointer.h:272
Gorgon::Resource::Writer::WritePoint
void WritePoint(Geometry::Point value)
Writes a point to the stream, point takes 2 x 4 bytes.
Definition: Writer.h:244
Gorgon::Graphics::PointerStack::Add
void Add(PointerType type, const Pointer &pointer)
Adds the given pointer to the stack.
Definition: Pointer.cpp:5
Gorgon::Graphics::PointerStack::Add
void Add(PointerType type, const Drawable &&image, Geometry::Point hotspot)=delete
Gorgon::Resource::Pointer::save
void save(Writer &writer) const override
Definition: Pointer.cpp:51
Gorgon::Graphics::basic_AnimatedPointer::parent
const basic_PointerProvider< A_ > & parent
Definition: Pointer.h:212