Geez, I'm sorry, I'll just go and read the doco....
btw in the interest of code sharing:
these can be handy.... if your not using them to animate a bg there ok (bit slow), not the best method, but there good for just shifting stuff around!
- Code:
void move_buffer_down(int x, int y,int size, PIXEL* source)
{
if (size < y)
{
PIXEL* screen_temp_p = new PIXEL[x * y]; // a temp screen
int xs = x * size;
int xy = x * y;
memcpy(screen_temp_p + xs,source, (xy - xs) * 2);
memcpy(screen_temp_p,source + xy - xs, xs * 2);
memcpy(source,screen_temp_p, xy * 2);
delete [] screen_temp_p;
}
}
void move_buffer_up(int x, int y,int size, PIXEL* source)
{
if (size < y)
{
PIXEL* screen_temp_p = new PIXEL[x * y]; // a temp screen
int xs = x * size;
int xy = x * y;
memcpy(screen_temp_p,source + xs, (xy - xs) * 2);
memcpy(screen_temp_p + xy - xs,source, xs * 2);
memcpy(source,screen_temp_p, xy * 2);
delete [] screen_temp_p;
}
}
void move_buffer_left(int x, int y,int size, PIXEL* source)
{
if (size < x)
{
PIXEL* screen_temp_p = new PIXEL[x * y]; // a temp screen
int xy2 = x * y * 2;
memcpy(screen_temp_p,source + size, xy2 - (size * 2));
memcpy(source,screen_temp_p, xy2);
delete [] screen_temp_p;
}
}
void move_buffer_right(int x, int y,int size, PIXEL* source)
{
if (size < x)
{
PIXEL* screen_temp_p = new PIXEL[x * y]; // a temp screen
int xy2 = x * y * 2;
memcpy(screen_temp_p,source - size, xy2 + (size * 2));
memcpy(source,screen_temp_p, xy2);
delete [] screen_temp_p;
}
}
(the PIXEL is just a unsigned short (16 bit graphics)
-B