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

@@ -539,7 +539,7 @@ void editorclass::getlin(const enum textmode mode, const std::string& prompt, st
oldenttext = key.keybuffer;
}
const short* editorclass::loadlevel( int rxi, int ryi )
const int* editorclass::loadlevel( int rxi, int ryi )
{
//Set up our buffer array to be picked up by mapclass
rxi -= 100;
@@ -549,7 +549,7 @@ const short* editorclass::loadlevel( int rxi, int ryi )
if(rxi>=mapwidth)rxi-=mapwidth;
if(ryi>=mapheight)ryi-=mapheight;
static short result[1200];
static int result[1200];
for (int j = 0; j < 30; j++)
{