Allow custom levels to use 2 billion tile numbers once again

Ever since tilesheets got expanded, custom levels could use as many
tiles as they wanted, as long as it fit under the 32-bit signed integer
limit.

Until 6c85fae339 happened and they were
reduced to 32,767 tiles.

So I'm being generous again and changing the type of the contents array
(in mapclass and editorclass) back to int. This won't affect the
existing tilemaps of the main game, they'll still stay short arrays. But
it means level makers can use 2 billion tiles once again.
This commit is contained in:
Misa
2021-08-22 21:30:53 -07:00
parent 92aace50f6
commit 01ae5c6c70
4 changed files with 21 additions and 12 deletions

View File

@@ -132,7 +132,7 @@ class editorclass{
void reset(void);
void getlin(const enum textmode mode, const std::string& prompt, std::string* ptr);
const short* loadlevel(int rxi, int ryi);
const int* loadlevel(int rxi, int ryi);
int gettileidx(
const int rx,
@@ -217,7 +217,7 @@ class editorclass{
std::vector<std::string> getLevelDirFileNames( );
static const int maxwidth = 20, maxheight = 20; //Special; the physical max the engine allows
static const int numrooms = maxwidth * maxheight;
short contents[40 * 30 * numrooms];
int contents[40 * 30 * numrooms];
int vmult[30 * maxheight];
int numtrinkets(void);
int numcrewmates(void);