Gorgon Game Engine
MaskedObject.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "EmptyImage.h"
4 #include "Animations.h"
5 #include "TextureAnimation.h"
6 
7 namespace Gorgon { namespace Graphics {
8 
11  public:
12  virtual RectangularAnimation &CreateBase() const = 0;
13  virtual RectangularAnimation &CreateMask() const = 0;
14 
15  virtual IMaskedObjectProvider &MoveOutProvider() override = 0;
16  };
17 
18  template<class A_>
20 
21  template<class A_>
22  class basic_MaskedObject : public virtual RectangularAnimation {
23  public:
24  basic_MaskedObject(const basic_MaskedObjectProvider<A_> &parent, bool create = true);
25 
27 
31  basic_MaskedObject(RectangularAnimation &base, RectangularAnimation &mask, bool create = true) :
32  Gorgon::Animation::Base(create), base(base), mask(mask)
33  {
34  if(this->HasController()) {
35  base.SetController(this->GetController());
36  mask.SetController(this->GetController());
37  }
38  else {
39  base.RemoveController();
40  mask.RemoveController();
41  }
42  }
43 
48  Gorgon::Animation::Base(timer), base(base), mask(mask)
49  {
50  if(this->HasController()) {
51  base.SetController(this->GetController());
52  mask.SetController(this->GetController());
53  }
54  else {
55  base.RemoveController();
56  mask.RemoveController();
57  }
58  }
59 
61  base.DeleteAnimation();
62  mask.DeleteAnimation();
63  }
64 
65  virtual bool Progress(unsigned &) override {
66  return true; //individual parts will work automatically
67  }
68 
69  int GetDuration() const override {
70  return base.GetDuration();
71  }
72 
73  protected:
74  virtual void drawin(TextureTarget &target, const Geometry::Rectanglef &r, RGBAf color) const override;
75 
76  virtual void drawin(TextureTarget &target, const SizeController &controller, const Geometry::Rectanglef &r, RGBAf color) const override;
77 
78  virtual Geometry::Size calculatesize(const Geometry::Size &area) const override {
79  return base.CalculateSize(area);
80  }
81 
82  virtual Geometry::Size calculatesize(const SizeController &controller, const Geometry::Size &s) const override {
83  return base.CalculateSize(controller, s);
84  }
85 
87 
88  virtual void draw(TextureTarget &target, const Geometry::Pointf &p1, const Geometry::Pointf &p2,
89  const Geometry::Pointf &p3, const Geometry::Pointf &p4,
90  const Geometry::Pointf &tex1, const Geometry::Pointf &tex2,
91  const Geometry::Pointf &tex3, const Geometry::Pointf &tex4, RGBAf color) const override;
92 
93 
94  virtual void draw(TextureTarget &target, const Geometry::Pointf &p1, const Geometry::Pointf &p2,
95  const Geometry::Pointf &p3, const Geometry::Pointf &p4, RGBAf color) const override;
96 
97 
98  virtual Geometry::Size getsize() const override;
99 
100  private:
101  const basic_MaskedObjectProvider<A_> &parent;
102  RectangularAnimation &base, &mask;
103  };
104 
108  template<class A_>
110  public:
111  using AnimationType = typename A_::AnimationType;
112 
115 
117  basic_MaskedObjectProvider(A_ &base, A_ &mask) :
118  base(&base), mask(&mask)
119  { }
120 
122  basic_MaskedObjectProvider(A_ *base, A_ *mask) :
123  base(base), mask(mask)
124  { }
125 
126  basic_MaskedObjectProvider(A_ &&base, A_ &&mask) :
127  base(new A_(std::move(base))), mask(new A_(std::move(mask))), own(true)
128  { }
129 
131  base(other.base), mask(other.mask)
132  {
133  other.base = nullptr;
134  other.mask = nullptr;
135  }
136 
138  if(own) {
139  delete this->base;
140  delete this->mask;
141  }
142  }
143 
144  //types are derived not to type the same code for every class
145  virtual auto MoveOutProvider() -> decltype(*this) override {
146  auto ret = new typename std::remove_reference<decltype(*this)>::type(std::move(*this));
147 
148  return *ret;
149  }
150 
151  basic_MaskedObject<A_> &CreateAnimation(bool create = true) const override {
152  return *new basic_MaskedObject<A_>(*this, create);
153  }
154 
156  return *new basic_MaskedObject<A_>(*this, timer);
157  }
158 
160  RectangularAnimation &CreateBase() const override {
161  if(base) {
162  return base->CreateAnimation(false);
163  }
164  else {
165  return EmptyImage::Instance();
166  }
167  }
168 
170  RectangularAnimation &CreateMask() const override {
171  if(mask) {
172  return mask->CreateAnimation(false);
173  }
174  else {
175  return EmptyImage::Instance();
176  }
177  }
178 
180  A_ *GetBase() const {
181  return base;
182  }
183 
185  A_ *GetMask() const {
186  return mask;
187  }
188 
190  void SetBase(A_ *value) {
191  if(own)
192  delete base;
193 
194  base = value;
195  }
196 
198  void SetMask(A_ *value) {
199  if(own)
200  delete mask;
201 
202  mask = value;
203  }
204 
206  void SetProviders(A_ &base, A_ &mask) {
207  if(own) {
208  delete this->base;
209  delete this->mask;
210  }
211  this->base = &base;
212  this->mask = &mask;
213  }
214 
216  void OwnProviders() {
217  own = true;
218  }
219 
222  void Prepare() {
223  if(base) base->Prepare();
224  if(mask) mask->Prepare();
225  }
226 
227  Geometry::Size GetSize() const override {
228  return base ? base->GetSize() : Geometry::Size{0, 0};
229  }
230 
231  private:
232  A_ *base = nullptr;
233  A_ *mask = nullptr;
234 
235  bool own = false;
236  };
237 
238  template<class A_>
240  Gorgon::Animation::Base(create), parent(parent),
241  base(parent.CreateBase()), mask(parent.CreateMask())
242  {
243  if(this->HasController()) {
244  base.SetController(this->GetController());
245  mask.SetController(this->GetController());
246  }
247  }
248 
249  template<class A_>
251  Gorgon::Animation::Base(timer), parent(parent),
252  base(parent.CreateBase()), mask(parent.CreateMask())
253  {
254  if(this->HasController()) {
255  base.SetController(this->GetController());
256  mask.SetController(this->GetController());
257  }
258  }
259 
260  template<class A_>
262  auto prev = target.GetDrawMode();
263 
264  if(prev != target.ToMask)
265  target.NewMask();
266 
267  target.SetDrawMode(target.ToMask);
268  mask.DrawIn(target, r);
269 
270  if(prev != target.ToMask)
271  target.SetDrawMode(target.UseMask);
272 
273  base.DrawIn(target, r, color);
274  target.SetDrawMode(prev);
275  }
276 
277  template<class A_>
278  void basic_MaskedObject<A_>::drawin(TextureTarget &target, const SizeController &controller, const Geometry::Rectanglef &r, RGBAf color) const {
279  auto prev = target.GetDrawMode();
280 
281  if(prev != target.ToMask)
282  target.NewMask();
283 
284  target.SetDrawMode(target.ToMask);
285  mask.DrawIn(target, controller, r);
286 
287  if(prev != target.ToMask)
288  target.SetDrawMode(target.UseMask);
289 
290  base.DrawIn(target, controller, r, color);
291  target.SetDrawMode(prev);
292  }
293 
294 
295 
296  template<class A_>
298  const Geometry::Pointf &p3, const Geometry::Pointf &p4,
299  const Geometry::Pointf &tex1, const Geometry::Pointf &tex2,
300  const Geometry::Pointf &tex3, const Geometry::Pointf &tex4, RGBAf color) const
301  {
302  auto prev = target.GetDrawMode();
303 
304  if(prev != target.ToMask)
305  target.NewMask();
306 
307  target.SetDrawMode(target.ToMask);
308  mask.Draw(target, p1, p2, p3, p4, tex1, tex2, tex3, tex4);
309 
310  if(prev != target.ToMask)
311  target.SetDrawMode(target.UseMask);
312 
313  base.Draw(target, p1, p2, p3, p4, tex1, tex2, tex3, tex4, color);
314  target.SetDrawMode(prev);
315  }
316 
317 
318  template<class A_>
319  void basic_MaskedObject<A_>::draw(TextureTarget &target, const Geometry::Pointf &p1, const Geometry::Pointf &p2, const Geometry::Pointf &p3, const Geometry::Pointf &p4, RGBAf color) const {
320  auto prev = target.GetDrawMode();
321 
322  if(prev != target.ToMask)
323  target.NewMask();
324 
325  target.SetDrawMode(target.ToMask);
326  mask.Draw(target, p1, p2, p3, p4);
327 
328  if(prev != target.ToMask)
329  target.SetDrawMode(target.UseMask);
330 
331  base.Draw(target, p1, p2, p3, p4, color);
332  target.SetDrawMode(prev);
333  }
334 
335 
336  template<class A_>
338  return base.GetSize();
339  }
340 
343 
346 
349 
350 } }
Gorgon::Graphics::basic_MaskedObject::drawin
virtual void drawin(TextureTarget &target, const Geometry::Rectanglef &r, RGBAf color) const override
This function should draw the object to the target area.
Definition: MaskedObject.h:261
Gorgon::Animation::Base::GetDuration
virtual int GetDuration() const =0
Returns the duration of the animation if it is a known apriori.
Gorgon::Geometry::basic_Rectangle::TopLeft
basic_Point< T_ > TopLeft() const
Returns the top left coordinates of the rectangle.
Definition: Rectangle.h:198
Gorgon::Graphics::Orientation
Orientation
2D orientation constants
Definition: Graphics.h:39
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::Animation::Base::Base
Base(ControllerBase &controller)
Sets the controller for this animation to the given controller.
Definition: Animation.h:310
Gorgon::Graphics::basic_MaskedObjectProvider::SetMask
void SetMask(A_ *value)
Sets the mask provider, ownership semantics will not be changed.
Definition: MaskedObject.h:198
Gorgon::Graphics::SizeController
This class allows control over a sizable object.
Definition: Graphics.h:161
Gorgon::Graphics::Line::draw
virtual void draw(TextureTarget &target, const Geometry::Pointf &p1, const Geometry::Pointf &p2, const Geometry::Pointf &p3, const Geometry::Pointf &p4, const Geometry::Pointf &tex1, const Geometry::Pointf &tex2, const Geometry::Pointf &tex3, const Geometry::Pointf &tex4, RGBAf color) const override
This method should draw to object inside the given quad with the given texture coordinates.
Definition: Line.cpp:65
Gorgon::Graphics::EmptyImage::Instance
static EmptyImage & Instance()
Returns the instance for empty image. Only one instance is enough.
Definition: EmptyImage.h:50
Gorgon::Graphics::Tiling::Horizontal
@ Horizontal
File.h
Gorgon::Graphics::BitmapAnimationProvider
basic_TextureAnimationProvider< Bitmap, basic_TextureAnimation, basic_AnimationFrame< Bitmap > > BitmapAnimationProvider
Definition: TextureAnimation.h:520
Gorgon::Resource::GID::Null
constexpr Type Null
Null resource.
Definition: GID.h:105
Gorgon::Graphics::basic_MaskedObjectProvider::GetBase
A_ * GetBase() const
Returns the base component. Could return nullptr.
Definition: MaskedObject.h:180
Gorgon::Geometry::basic_Rectangle::Right
T_ Right() const
Calculates and returns the rightmost coordinate.
Definition: Rectangle.h:143
Gorgon::Graphics::basic_MaskedObject::GetDuration
int GetDuration() const override
Returns the duration of the animation if it is a known apriori.
Definition: MaskedObject.h:69
Gorgon::Graphics::basic_MaskedObjectProvider::CreateAnimation
basic_MaskedObject< A_ > & CreateAnimation(bool create=true) const override
Definition: MaskedObject.h:151
Gorgon::Graphics::IMaskedObjectProvider::CreateMask
virtual RectangularAnimation & CreateMask() const =0
Gorgon::Resource::SaveAnimation
void SaveAnimation(Writer &writer, const Graphics::RectangularAnimationProvider &object)
Saves a given generic rectangular animation as resource.
Definition: Resource.cpp:22
Gorgon::Graphics::LineProvider
basic_LineProvider< RectangularAnimationProvider > LineProvider
Definition: Line.h:362
Gorgon::Animation::ControllerBase
Controllers are required to progress animations.
Definition: Animation.h:65
Reader.h
Gorgon::Geometry::basic_Rectangle::X
T_ X
X coordinate of the top left corner of this rectangle.
Definition: Rectangle.h:354
Gorgon::Resource::Writer::WriteChunkHeader
void WriteChunkHeader(GID::Type type, unsigned long size)
Writes the header of a chunk.
Definition: Writer.h:364
Gorgon::Graphics::basic_MaskedObject::basic_MaskedObject
basic_MaskedObject(RectangularAnimation &base, RectangularAnimation &mask, Gorgon::Animation::ControllerBase &timer)
Creates a masked object from two animations, these animations should not have controllers attached to...
Definition: MaskedObject.h:47
Gorgon::Resource::Line::SaveThis
static void SaveThis(Writer &writer, const Graphics::ILineProvider &provider)
Definition: Line.cpp:175
Gorgon::Resource::Line
This is a line resource, it stores a Graphics::LineProvider.
Definition: Line.h:16
Gorgon::Graphics::basic_MaskedObject::Progress
virtual bool Progress(unsigned &) override
This function should progress the animation.
Definition: MaskedObject.h:65
Gorgon::Graphics::basic_MaskedObjectProvider::OwnProviders
void OwnProviders()
Assumes the ownership of the providers.
Definition: MaskedObject.h:216
Image.h
Gorgon::Graphics::IMaskedObjectProvider::CreateBase
virtual RectangularAnimation & CreateBase() const =0
Gorgon::Float
float Float
Represents floating point data type.
Definition: Types.h:16
Gorgon::Resource::GID::Line
constexpr Type Line
Definition: GID.h:234
Gorgon::Graphics::basic_MaskedObjectProvider::basic_MaskedObjectProvider
basic_MaskedObjectProvider(A_ &base, A_ &mask)
Filling constructor.
Definition: MaskedObject.h:117
Gorgon::Graphics::RGBAf
Represents a four channel 32 bit float per channel color information.
Definition: Color.h:373
Gorgon::Resource::GID::Image
constexpr Type Image
Image resource.
Definition: GID.h:149
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::Geometry::basic_Rectangle::Width
T_ Width
Width of the rectangle.
Definition: Rectangle.h:360
EmptyImage.h
Gorgon::Graphics::basic_MaskedObjectProvider::basic_MaskedObjectProvider
basic_MaskedObjectProvider(basic_MaskedObjectProvider &&other)
Definition: MaskedObject.h:130
Gorgon::Graphics::Line::getsize
virtual Geometry::Size getsize() const override
Should return the exact size of this object.
Definition: Line.h:105
Gorgon::Utils::ASSERT_FALSE
void ASSERT_FALSE(const std::string &message, int skip=1, int depth=4)
Definition: Assert.h:192
Gorgon::Graphics::basic_LineProvider::SetEnd
void SetEnd(A_ *value)
Changes the end animation, ownership semantics will not change.
Definition: Line.h:274
Gorgon::Graphics::SizeController::Stretch
@ Stretch
The drawing is stretched along this axis to cover the given size.
Definition: Graphics.h:171
Null.h
Gorgon::Graphics::basic_MaskedObject::calculatesize
virtual Geometry::Size calculatesize(const SizeController &controller, const Geometry::Size &s) const override
This function should return the size of the object when it is requested to be drawn in the given area...
Definition: MaskedObject.h:82
Gorgon::Resource::Line::save
void save(Writer &writer) const override
Definition: Line.cpp:156
Gorgon
Root namespace for Gorgon Game Engine.
Definition: Any.h:19
Gorgon::Geometry::basic_Size
This class represents a 2D geometric size.
Definition: Size.h:23
Gorgon::Graphics::TextureTarget::UseMask
@ UseMask
Definition: TextureTargets.h:18
Gorgon::Resource::Line::MoveOutProvider
ILineProvider & MoveOutProvider() override
This function moves this animation provider into a new provider.
Definition: Line.cpp:236
Gorgon::Resource::Writer::WriteChunkStart
Marker WriteChunkStart(GID::Type type)
Writes the start of a chunk. Should have a matching WriteEnd.
Definition: Writer.h:351
Gorgon::Graphics::basic_MaskedObjectProvider::MoveOutProvider
virtual auto MoveOutProvider() -> decltype(*this) override
Definition: MaskedObject.h:145
Gorgon::Graphics::basic_MaskedObject::basic_MaskedObject
basic_MaskedObject(RectangularAnimation &base, RectangularAnimation &mask, bool create=true)
Creates a masked object from two animations, these animations should not have controllers attached to...
Definition: MaskedObject.h:31
Gorgon::Graphics::basic_MaskedObject::~basic_MaskedObject
~basic_MaskedObject()
Definition: MaskedObject.h:60
Gorgon::Resource::Line::Line
Line()
Creates a new empty line.
Definition: Line.h:43
Gorgon::Graphics::RectangularAnimation
Rectangular drawable animation.
Definition: Animations.h:19
Gorgon::Graphics::Tiling::Vertical
@ Vertical
Gorgon::Graphics::RectangularDrawable::DrawIn
void DrawIn(TextureTarget &target, Tiling tiling, int x, int y, int w, int h, RGBAf color=RGBAf(1.f)) const
Draws the object to the target using the given tiling information.
Definition: Drawables.h:157
Gorgon::Containers::Collection
Collection is a container for reference typed objects.
Definition: Collection.h:21
Gorgon::Resource::GID::Line_Props_II
constexpr Type Line_Props_II
Definition: GID.h:236
Gorgon::Geometry::basic_Rectangle::Bottom
T_ Bottom() const
Calculates and returns the bottommost coordinate.
Definition: Rectangle.h:146
Gorgon::Graphics::ILineProvider
Interface for LineProviders.
Definition: Line.h:12
Gorgon::Graphics::Bitmap
This object contains an bitmap image.
Definition: Bitmap.h:25
Gorgon::Graphics::basic_MaskedObjectProvider::CreateMask
RectangularAnimation & CreateMask() const override
Creates a mask animation without controller.
Definition: MaskedObject.h:170
Gorgon::Graphics::basic_LineProvider
This class allows instancing of a line like image that is made out of three parts.
Definition: Line.h:162
Gorgon::Resource::GID::Animation
constexpr Type Animation
Definition: GID.h:187
Gorgon::Resource::GID::Line_Props
constexpr Type Line_Props
Definition: GID.h:235
Gorgon::Graphics::basic_MaskedObjectProvider
This object creates a masked object from two graphics object.
Definition: MaskedObject.h:109
Gorgon::Graphics::basic_MaskedObjectProvider::CreateBase
RectangularAnimation & CreateBase() const override
Creates a base animation without controller.
Definition: MaskedObject.h:160
Gorgon::Graphics::basic_MaskedObjectProvider::SetProviders
void SetProviders(A_ &base, A_ &mask)
Sets the providers in this object.
Definition: MaskedObject.h:206
Gorgon::Graphics::basic_MaskedObject::basic_MaskedObject
basic_MaskedObject(const basic_MaskedObjectProvider< A_ > &parent, bool create=true)
Definition: MaskedObject.h:239
Gorgon::Graphics::SizeController::Horizontal
Tiling Horizontal
Horizontal tiling mode.
Definition: Graphics.h:470
Gorgon::Graphics::ILineProvider::GetTiling
virtual bool GetTiling() const
Returns if the middle part will be tiled.
Definition: Line.h:47
Gorgon::Geometry::Sizef
basic_Size< Float > Sizef
Definition: Size.h:388
Gorgon::Graphics::basic_MaskedObjectProvider::AnimationType
typename A_::AnimationType AnimationType
Definition: MaskedObject.h:111
Gorgon::Graphics::Line::Line
Line(const ILineProvider &prov, Gorgon::Animation::ControllerBase &timer)
Definition: Line.cpp:17
Gorgon::Graphics::Tiling::None
@ None
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::Containers::Collection::GetCount
long GetCount() const
Returns number of elements.
Definition: Collection.h:236
Gorgon::Graphics::basic_MaskedObjectProvider::Prepare
void Prepare()
Prepares the providers.
Definition: MaskedObject.h:222
Gorgon::Graphics::basic_MaskedObjectProvider::basic_MaskedObjectProvider
basic_MaskedObjectProvider()=default
Empty constructor.
Gorgon::Geometry::basic_Point
This class represents a 2D point.
Definition: Point.h:32
Gorgon::Graphics::basic_LineProvider::GetEnd
A_ * GetEnd() const
Returns the end animation, might return nullptr.
Definition: Line.h:253
Gorgon::Graphics::Line::drawin
virtual void drawin(TextureTarget &target, const Geometry::Rectanglef &r, RGBAf color) const override
This function should draw the object to the target area.
Definition: Line.cpp:29
Gorgon::Resource::Line::LoadResource
static Line * LoadResource(std::weak_ptr< File > file, std::shared_ptr< Reader > reader, unsigned long size)
This function loads a line resource from the file.
Definition: Line.cpp:44
Gorgon::Resource::Writer
This class allows resource objects to save their data to a stream.
Definition: Writer.h:59
Gorgon::Graphics::basic_MaskedObjectProvider::GetSize
Geometry::Size GetSize() const override
Definition: MaskedObject.h:227
Gorgon::Graphics::basic_MaskedObjectProvider::~basic_MaskedObjectProvider
~basic_MaskedObjectProvider()
Definition: MaskedObject.h:137
Gorgon::Animation::Base::DeleteAnimation
virtual void DeleteAnimation() const
Deletes this animation.
Definition: Animation.h:379
Gorgon::Graphics::AnimatedBitmapLineProvider
basic_LineProvider< BitmapAnimationProvider > AnimatedBitmapLineProvider
Definition: Line.h:364
Gorgon::Graphics::IMaskedObjectProvider::MoveOutProvider
virtual IMaskedObjectProvider & MoveOutProvider() override=0
This function moves this animation provider into a new provider.
Gorgon::Graphics::Orientation::Horizontal
@ Horizontal
Gorgon::Graphics::basic_MaskedObjectProvider::GetMask
A_ * GetMask() const
Returns the mask component. Could return nullptr.
Definition: MaskedObject.h:185
Gorgon::Graphics::basic_MaskedObjectProvider::CreateAnimation
basic_MaskedObject< A_ > & CreateAnimation(Gorgon::Animation::ControllerBase &timer) const override
Definition: MaskedObject.h:155
Gorgon::Graphics::basic_LineProvider::SetMiddle
void SetMiddle(A_ *value)
Changes the middle animation, ownership semantics will not change.
Definition: Line.h:266
Gorgon::Graphics::basic_LineProvider::GetStart
A_ * GetStart() const
Returns the start animation, might return nullptr.
Definition: Line.h:243
Gorgon::Graphics::Animation
A regular drawable animation.
Definition: Animations.h:14
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
Gorgon::Geometry::basic_Rectangle::Y
T_ Y
Y coordinate of the top left corner of this rectangle.
Definition: Rectangle.h:357
Animations.h
Gorgon::Graphics::basic_MaskedObjectProvider::basic_MaskedObjectProvider
basic_MaskedObjectProvider(A_ &&base, A_ &&mask)
Definition: MaskedObject.h:126
Gorgon::Graphics::RectangularAnimationProvider
This class provides rectangular animations.
Definition: Animations.h:48
Gorgon::Animation::Base::HasController
virtual bool HasController() const
Returns whether this animation has a controller.
Definition: Animation.h:344
Gorgon::UI::Graphics
@ Graphics
Definition: Template.h:164
Gorgon::Animation::Base::RemoveController
virtual void RemoveController()
Removes the controller of this animation.
Definition: Animation.h:357
Gorgon::Geometry::basic_Rectangle::Height
T_ Height
Height of the rectangle.
Definition: Rectangle.h:363
Gorgon::Graphics::ILineProvider::GetOrientation
virtual Orientation GetOrientation() const
Returns the orientation of the line provider.
Definition: Line.h:35
Gorgon::Graphics::RectangularAnimationStorage
Gorgon::Animation::basic_Storage< RectangularAnimationProvider > RectangularAnimationStorage
Definition: Animations.h:374
Gorgon::Graphics::RectangularDrawable::GetHeight
int GetHeight() const
Returns the height of the drawable.
Definition: Drawables.h:451
Gorgon::Graphics::IMaskedObjectProvider
For ease of use in resource system.
Definition: MaskedObject.h:10
Gorgon::Graphics::basic_MaskedObject::calculatesize
virtual Geometry::Size calculatesize(const Geometry::Size &area) const override
This function should return the size of the object when it is requested to be drawn in the given area...
Definition: MaskedObject.h:78
Gorgon::Graphics::RectangularDrawable::draw
virtual void draw(TextureTarget &target, const Geometry::Pointf &p, RGBAf color) const override
This function should draw the object to the given point.
Definition: Drawables.h:456
Line.h
Gorgon::end
std::vector< T_ >::const_iterator end(enum_type_id< T_ >)
Definition: Enum.h:288
Gorgon::Resource::Writer::WriteBool
void WriteBool(bool value)
Writes a boolean value. In resource 1.0, booleans are stored as 32bit integers.
Definition: Writer.h:220
Gorgon::Animation::Base::SetController
virtual void SetController(ControllerBase &controller)
Sets the controller to the given controller.
Definition: Animation.h:334
Gorgon::Graphics::basic_MaskedObject::draw
virtual void draw(TextureTarget &target, const Geometry::Pointf &p1, const Geometry::Pointf &p2, const Geometry::Pointf &p3, const Geometry::Pointf &p4, const Geometry::Pointf &tex1, const Geometry::Pointf &tex2, const Geometry::Pointf &tex3, const Geometry::Pointf &tex4, RGBAf color) const override
This method should draw to object inside the given quad with the given texture coordinates.
Definition: MaskedObject.h:297
Gorgon::Graphics::RectangularDrawable::GetWidth
int GetWidth() const
Returns the width of the drawable.
Definition: Drawables.h:448
Gorgon::Resource::Base::children
Containers::Collection< Base > children
Child objects that this resource object have.
Definition: Base.h:162
Gorgon::Graphics::TextureTarget::NewMask
virtual void NewMask()=0
Should queue the start of a new mask. Only one mask buffer exists and it will be cleared and reused.
Gorgon::Graphics::TextureTarget::GetDrawMode
virtual DrawMode GetDrawMode() const =0
Returns current draw mode.
Gorgon::Resource::Writer::WriteEnum32
void WriteEnum32(E_ value)
Writes an enumeration as 32-bit integer to the stream.
Definition: Writer.h:140
Gorgon::Graphics::basic_MaskedObjectProvider::SetBase
void SetBase(A_ *value)
Sets the base provider, ownership semantics will not be changed.
Definition: MaskedObject.h:190
Gorgon::Resource::Line::animmoveout
virtual Graphics::RectangularAnimationStorage animmoveout() override
Definition: Line.cpp:232
Gorgon::Input::Mouse::Horizontal
@ Horizontal
Definition: Mouse.h:76
Gorgon::Graphics::RectangularDrawable::CalculateSize
const Geometry::Size CalculateSize(const Geometry::Size &area) const
Calculates the adjusted size of this drawable depending on the given area.
Definition: Drawables.h:322
Gorgon::Geometry::basic_Rectangle
Represents a rectangle in a 2D space.
Definition: Rectangle.h:19
Gorgon::Animation::Base::controller
ControllerBase * controller
Controller of this animation.
Definition: Animation.h:388
Gorgon::Graphics::basic_MaskedObjectProvider::basic_MaskedObjectProvider
basic_MaskedObjectProvider(A_ *base, A_ *mask)
Filling constructor, nullptr is allowed but not recommended.
Definition: MaskedObject.h:122
TextureAnimation.h
Gorgon::Graphics::ILineProvider::ILineProvider
ILineProvider(Orientation orientation)
Definition: Line.h:14
Gorgon::Graphics::basic_MaskedObject::getsize
virtual Geometry::Size getsize() const override
Should return the exact size of this object.
Definition: MaskedObject.h:337
Gorgon::Graphics::basic_MaskedObject
Definition: MaskedObject.h:22
Gorgon::Graphics::TextureTarget::SetDrawMode
virtual void SetDrawMode(DrawMode mode)=0
Sets current draw mode.
Gorgon::Graphics::SizeController::Vertical
Tiling Vertical
Vertical tiling mode.
Definition: Graphics.h:473
Gorgon::Utils::NotImplemented
void NotImplemented(const std::string &what="This feature")
Definition: Assert.h:187
Animation.h
Gorgon::Graphics::RectangularDrawable::Draw
void Draw(TextureTarget &target, float x1, float y1, float x2, float y2, float x3, float y3, float x4, float y4, RGBAf color=RGBAf(1.f)) const
Draw the object to the target by specifying coordinates for four corners.
Definition: Drawables.h:132
Gorgon::Animation::Base::GetController
virtual ControllerBase & GetController() const
Returns the controller of this animation.
Definition: Animation.h:347
Gorgon::Graphics::TextureTarget::ToMask
@ ToMask
Definition: TextureTargets.h:17
Gorgon::Graphics::basic_LineProvider::SetStart
void SetStart(A_ *value)
Changes the start animation, ownership semantics will not change.
Definition: Line.h:258
Gorgon::Graphics::basic_LineProvider::GetMiddle
A_ * GetMiddle() const
Returns the middle animation, might return nullptr.
Definition: Line.h:248