[teagba] Add set and scroll background offset functions
All checks were successful
Build / build (push) Successful in 1m15s
All checks were successful
Build / build (push) Successful in 1m15s
This commit is contained in:
14
deps/teagba/src/gfx.cpp
vendored
14
deps/teagba/src/gfx.cpp
vendored
@@ -12,7 +12,7 @@ namespace teagba {
|
||||
|
||||
static ox::Array<GbaSpriteAttrUpdate, 128> g_spriteBuffer;
|
||||
|
||||
GbaSpriteAttrUpdate &spriteAttr(size_t i) noexcept {
|
||||
GbaSpriteAttrUpdate &spriteAttr(size_t const i) noexcept {
|
||||
return g_spriteBuffer[i];
|
||||
}
|
||||
|
||||
@@ -29,4 +29,16 @@ void applySpriteUpdates() noexcept {
|
||||
}
|
||||
}
|
||||
|
||||
void setBgOffset(uint16_t const bg, int16_t const x, int16_t const y) noexcept {
|
||||
auto &o = regBgOfs(bg);
|
||||
o.x = x;
|
||||
o.y = y;
|
||||
}
|
||||
|
||||
void scrollBgOffset(uint16_t const bg, int16_t const x, int16_t const y) noexcept {
|
||||
auto &o = regBgOfs(bg);
|
||||
o.x = o.x + x;
|
||||
o.y = o.y + y;
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user