20 #ifndef OPENXCOM_SHADERREPEAT_H
21 #define OPENXCOM_SHADERREPEAT_H
24 #include "ShaderDraw.h"
30 template<
typename Pixel>
40 inline ShaderRepeat(
const Surface* s):
45 inline ShaderRepeat(
const std::vector<Pixel>& f,
int max_x,
int max_y):
46 _base(f, max_x, max_y)
51 inline void setOffset(
int x,
int y)
56 inline void addOffset(
int x,
int y)
67 template<
typename Pixel>
70 typedef typename ShaderRepeat<Pixel>::PixelPtr PixelPtr;
71 typedef typename ShaderRepeat<Pixel>::PixelRef PixelRef;
94 _range_domain(f.getDomain()),
98 _size_x(_range_domain.size_x()),
99 _size_y(_range_domain.size_y()),
121 inline void mod_y(
int&,
int&)
123 _curr_y = ( _range_image.beg_y - _off_y)%_size_y;
128 inline void set_y(
const int& begin,
const int&)
130 _curr_y = (_curr_y + begin)%_size_y;
131 _ptr_curr_y += (_range_domain.beg_y+_curr_y)*_pitch;
136 _ptr_curr_y += _pitch;
137 if(_curr_y == _size_y)
140 _ptr_curr_y -= _size_y*_pitch;
145 inline void mod_x(
int&,
int&)
147 _curr_x = ( _range_image.beg_x - _off_x)%_size_x;
150 _ptr_curr_x = _ptr_curr_y;
152 inline void set_x(
const int& begin,
const int&)
154 _curr_x = (_curr_x + begin)%_size_x;
155 _ptr_curr_x += _range_domain.beg_x +_curr_x;
161 if(_curr_x == _size_x)
164 _ptr_curr_x -= _size_x;
168 inline PixelRef get_ref()
helper class for handling implementation differences in different surfaces types Used in function Sha...
Definition: ShaderDrawHelper.h:419
This is surface argument to ShaderDraw.
Definition: ShaderDrawHelper.h:139
Definition: ShaderRepeat.h:31
void set_range(const GraphSubset &g)
set final drawing range.
Element that is blit (rendered) onto the screen.
Definition: Surface.h:39
Definition: GraphSubset.h:31
This is surface argument to ShaderDraw.
Definition: ShaderDrawHelper.h:63
void mod_range(GraphSubset &g)
function used only when SurfaceType is used as source surface.