20 #include "ShaderDraw.h" 26 template<
typename Pixel>
38 _move_x(s->
getX()), _move_y(s->
getY())
45 _move_x(move_x), _move_y(move_y)
52 _move_x(f._move_x), _move_y(f._move_y)
57 inline ShaderMove(std::vector<Pixel>& f,
int max_x,
int max_y):
58 _base(f, max_x, max_y),
64 inline ShaderMove(std::vector<Pixel>& f,
int max_x,
int max_y,
int move_x,
int move_y):
65 _base(f, max_x, max_y),
66 _move_x(move_x), _move_y(move_y)
73 return _base::_range_domain.offset(_move_x, _move_y);
76 inline void setMove(
int x,
int y)
81 inline void addMove(
int x,
int y)
93 template<
typename Pixel>
96 typedef typename ShaderMove<Pixel>::PixelPtr PixelPtr;
97 typedef typename ShaderMove<Pixel>::PixelRef PixelRef;
127 inline ShaderMove<Uint8> ShaderSurface(Surface* s,
int x,
int y)
129 return ShaderMove<Uint8>(s, x, y);
139 inline ShaderMove<Uint8> ShaderCrop(Surface* s,
int x,
int y)
141 ShaderMove<Uint8> ret(s, x, y);
142 SDL_Rect* s_crop = s->getCrop();
143 if (s_crop->w && s_crop->h)
145 GraphSubset crop(std::make_pair(s_crop->x, s_crop->x + s_crop->w), std::make_pair(s_crop->y, s_crop->y + s_crop->h));
147 ret.addMove(-s_crop->x, -s_crop->y);
157 inline ShaderMove<Uint8> ShaderCrop(Surface* s)
159 return ShaderCrop(s, s->getX(), s->getY());
Definition: ShaderMove.h:27
helper class for handling implementation differences in different surfaces types Used in function Sha...
Definition: ShaderDrawHelper.h:416
int getY() const
Returns the position of the surface in the Y axis.
Definition: Surface.h:130
Element that is blit (rendered) onto the screen.
Definition: Surface.h:38
int getX() const
Returns the position of the surface in the X axis.
Definition: Surface.h:120
Definition: GraphSubset.h:32
This is surface argument to ShaderDraw.
Definition: ShaderDrawHelper.h:60
Definition: ShaderDrawHelper.h:562
Definition: BaseInfoState.cpp:40