TilemapVX: Clean up the horrible map viewport calculation code
Also rename "offset" to "origin" which makes a lot more sense for ox/oy attributes.
This commit is contained in:
parent
5aaeb0206c
commit
dd7545fcf2
3 changed files with 36 additions and 47 deletions
|
@ -46,6 +46,13 @@ wrap(int value, int range)
|
|||
return res < 0 ? res + range : res;
|
||||
}
|
||||
|
||||
static inline Vec2i
|
||||
wrap(const Vec2i &value, int range)
|
||||
{
|
||||
return Vec2i(wrap(value.x, range),
|
||||
wrap(value.y, range));
|
||||
}
|
||||
|
||||
static inline int16_t
|
||||
tableGetWrapped(const Table &t, int x, int y, int z = 0)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue