20 #ifndef OPENXCOM_SHADERMOVE_H
21 #define OPENXCOM_SHADERMOVE_H
23 #include "ShaderDraw.h"
29 template<
typename Pixel>
41 _move_x(s->
getX()), _move_y(s->
getY())
46 inline ShaderMove(
Surface* s,
int move_x,
int move_y):
48 _move_x(move_x), _move_y(move_y)
53 inline ShaderMove(
const ShaderMove& f):
55 _move_x(f._move_x), _move_y(f._move_y)
60 inline ShaderMove(std::vector<Pixel>& f,
int max_x,
int max_y):
61 _base(f, max_x, max_y),
67 inline ShaderMove(std::vector<Pixel>& f,
int max_x,
int max_y,
int move_x,
int move_y):
68 _base(f, max_x, max_y),
69 _move_x(move_x), _move_y(move_y)
76 return _base::_range_domain.offset(_move_x, _move_y);
79 inline void setMove(
int x,
int y)
84 inline void addMove(
int x,
int y)
96 template<
typename Pixel>
99 typedef typename ShaderMove<Pixel>::PixelPtr PixelPtr;
100 typedef typename ShaderMove<Pixel>::PixelRef PixelRef;
145 SDL_Rect* s_crop = s->
getCrop();
146 if(s_crop->w && s_crop->h)
148 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));
150 ret.addMove(-s_crop->x, -s_crop->y);
Definition: ShaderMove.h:30
helper class for handling implementation differences in different surfaces types Used in function Sha...
Definition: ShaderDrawHelper.h:419
ShaderMove< Uint8 > ShaderSurface(Surface *s)
Create warper from Surface.
Definition: ShaderMove.h:118
int getY() const
Returns the position of the surface in the Y axis.
Definition: Surface.h:121
SDL_Rect * getCrop()
Gets the cropping rectangle for the surface.
Definition: Surface.cpp:685
Element that is blit (rendered) onto the screen.
Definition: Surface.h:39
Definition: GraphSubset.h:31
int getX() const
Returns the position of the surface in the X axis.
Definition: Surface.h:111
This is surface argument to ShaderDraw.
Definition: ShaderDrawHelper.h:63
ShaderMove< Uint8 > ShaderCrop(Surface *s, int x, int y)
Create warper from cropped Surface and provided offset.
Definition: ShaderMove.h:142
Definition: ShaderDrawHelper.h:565