mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-02-01 02:34:41 +03:00
Refactor tiles to use setter and getter functions
This makes it easier to add bounds checks to all accesses of ed.contents. To do this, I've added editorclass::gettile(), editorclass::settile(), and editorclass::getabstile() (with a helper function of editorclass::gettileidx() that really shouldn't be used directly), and replaced all raw accesses of ed.contents with those functions appropriately. This also makes the code more readable, as a side effect.
This commit is contained in:
@@ -120,6 +120,27 @@ class editorclass{
|
||||
void getlin(const enum textmode mode, const std::string& prompt, std::string* ptr);
|
||||
const short* loadlevel(int rxi, int ryi);
|
||||
|
||||
int gettileidx(
|
||||
const int rx,
|
||||
const int ry,
|
||||
const int x,
|
||||
const int y
|
||||
);
|
||||
void settile(
|
||||
const int rx,
|
||||
const int ry,
|
||||
const int x,
|
||||
const int y,
|
||||
const int t
|
||||
);
|
||||
int gettile(
|
||||
const int rx,
|
||||
const int ry,
|
||||
const int x,
|
||||
const int y
|
||||
);
|
||||
int getabstile(const int x, const int y);
|
||||
|
||||
void placetilelocal(int x, int y, int t);
|
||||
|
||||
int getenemyframe(int t);
|
||||
|
||||
Reference in New Issue
Block a user