FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
renderitem.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2017 by the FIFE team *
3  * http://www.fifengine.net *
4  * This file is part of FIFE. *
5  * *
6  * FIFE is free software; you can redistribute it and/or *
7  * modify it under the terms of the GNU Lesser General Public *
8  * License as published by the Free Software Foundation; either *
9  * version 2.1 of the License, or (at your option) any later version. *
10  * *
11  * This library is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * Lesser General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU Lesser General Public *
17  * License along with this library; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
20  ***************************************************************************/
21 
22 #ifndef FIFE_VIEW_RENDERITEM_H
23 #define FIFE_VIEW_RENDERITEM_H
24 
25 // Standard C++ library includes
26 #include <vector>
27 
28 // 3rd party library includes
29 
30 // FIFE includes
31 // These includes are split up in two parts, separated by one empty line
32 // First block: files included from the FIFE root src directory
33 // Second block: files included from the same folder
34 
35 #include "visual.h"
36 
37 namespace FIFE {
38 
39  class Instance;
40 
41  class OverlayData {
42  public:
43  OverlayData();
44  ~OverlayData();
45 
46  // pointer to single color overlay
48  // pointer to vector that holds animation overlay images
49  std::vector<ImagePtr>* animationOverlayImages;
50  // pointer to vector that holds color overlays for animation overlay
51  std::vector<OverlayColors*>* animationColorOverlays;
52  };
53 
54  class RenderItem {
55  public:
56  RenderItem(Instance* parent);
57  ~RenderItem();
59 
64  int32_t getStaticImageIndexByAngle(uint32_t angle, Instance* instance);
65 
69  void setAnimationOverlay(std::vector<ImagePtr>* ao, std::vector<OverlayColors*>* aco);
70 
74  std::vector<ImagePtr>* getAnimationOverlay() const;
75 
79  std::vector<OverlayColors*>* getAnimationColorOverlay() const;
80 
84  void setColorOverlay(OverlayColors* co);
85 
89  OverlayColors* getColorOverlay() const;
90 
93  void deleteOverlayData();
94 
97  void reset();
98 
99  // point where instance was drawn during the previous render
101 
102  // dimensions of this visual on the virtual screen
104 
105  // dimensions of this visual during the previous render
107 
108  // z value for sorting or depth buffer rendering
109  float vertexZ;
110 
111  // image used during previous render
113 
114  // current facing angle
115  int32_t facingAngle;
116 
117  // current transparency
119 
120  // current frame index (e.g. needed for action frame)
121  int32_t currentFrame;
122 
123  // pointer to overlay data class
125  private:
128  };
129 
130  typedef std::vector<RenderItem*> RenderList;
131 }
132 
133 #endif
std::vector< RenderItem * > RenderList
Definition: renderitem.h:130
std::vector< ImagePtr > * animationOverlayImages
Definition: renderitem.h:49
DoublePoint3D screenpoint
Definition: renderitem.h:100
Instance * instance
Definition: renderitem.h:58
OverlayColors * colorOverlay
Definition: renderitem.h:47
int32_t facingAngle
Definition: renderitem.h:115
unsigned char uint8_t
Definition: core.h:38
int32_t m_cachedStaticImgAngle
Definition: renderitem.h:127
ImagePtr image
Definition: renderitem.h:112
std::vector< OverlayColors * > * animationColorOverlays
Definition: renderitem.h:51
unsigned int uint32_t
Definition: core.h:40
int32_t m_cachedStaticImgId
Definition: renderitem.h:126
OverlayData * m_overlay
Definition: renderitem.h:124
uint8_t transparency
Definition: renderitem.h:118
An Instance is an "instantiation" of an Object at a Location.
Definition: instance.h:101
int32_t currentFrame
Definition: renderitem.h:121