Add relative scroll to backgrounds
This commit is contained in:
parent
454c5f7db7
commit
f353c89172
|
@ -25,6 +25,7 @@ public:
|
||||||
const int getCharBlock() { return charBlockIndex; }
|
const int getCharBlock() { return charBlockIndex; }
|
||||||
void useMapScreenBlock(int block) { screenBlockIndex = block; }
|
void useMapScreenBlock(int block) { screenBlockIndex = block; }
|
||||||
void scroll(int x, int y);
|
void scroll(int x, int y);
|
||||||
|
void scrollSpeed(int dx, int dy);
|
||||||
|
|
||||||
Background(int bgIndex, const void *data, int size, const void* map, int mapSize) : data(data), bgIndex(bgIndex), size(size), map(map),
|
Background(int bgIndex, const void *data, int size, const void* map, int mapSize) : data(data), bgIndex(bgIndex), size(size), map(map),
|
||||||
screenBlockIndex(0), charBlockIndex(0), mapSize(mapSize) {}
|
screenBlockIndex(0), charBlockIndex(0), mapSize(mapSize) {}
|
||||||
|
|
|
@ -79,3 +79,8 @@ void Background::scroll(int x, int y) {
|
||||||
REG_BG_OFS[bgIndex].x = x;
|
REG_BG_OFS[bgIndex].x = x;
|
||||||
REG_BG_OFS[bgIndex].y = y;
|
REG_BG_OFS[bgIndex].y = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Background::scrollSpeed(int dx, int dy) {
|
||||||
|
REG_BG_OFS[bgIndex].x += dx;
|
||||||
|
REG_BG_OFS[bgIndex].y += dy;
|
||||||
|
}
|
Loading…
Reference in New Issue