Make smostcnt an int32 to prevent overflow (and subsequent crash) with too many saved positions; In Mapster, make it possible to bunch-join an extended with a non-extended floor inner to the first one, so that inner sectors created out of loops can be deleted by joining the sectors then.

git-svn-id: https://svn.eduke32.com/eduke32@1932 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2011-07-13 16:42:29 +00:00
parent a15d8bfb98
commit 24dcfc6633
4 changed files with 70 additions and 13 deletions

View file

@ -5012,6 +5012,37 @@ end_point_dragging:
}
if ((uneqbn&2)==0)
{
if (whybad==1+8 && jbn[0][cf]>=0 && jbn[1][cf]<0)
{
// 1st join sector extended, 2nd not... let's see
// if the latter is inner to the former one
m = 1;
for (WALLS_OF_SECTOR(joinsector[1], k))
if (wall[k].nextsector != joinsector[0])
{
m = 0;
break;
}
if (m==1)
{
yax_setbunch(joinsector[1], YAX_FLOOR, jbn[0][cf]);
yax_update(0);
yax_updategrays(pos.z);
asksave = 1;
printmessage16("Added sector %d's floor to bunch %d",
joinsector[1], jbn[0][cf]);
}
else
{
printmessage16("Can't add sector %d's floor to bunch %d: not inner to sector %d",
joinsector[1], jbn[0][cf], joinsector[0]);
}
}
else
{
if (whybad&1)
message("Can't make floor bunchnums equal: both floors must be extended");
@ -5024,6 +5055,7 @@ end_point_dragging:
else if (whybad&16)
message("Can't make floor bunchnums equal: lower neighbors must be linked");
}
}
else
{
int32_t vcf, newbn, ynw;

View file

@ -1999,7 +1999,8 @@ int16_t thewall[MAXWALLSB];
int16_t bunchfirst[MAXWALLSB], bunchlast[MAXWALLSB];
static int16_t smost[MAXYSAVES], smostcnt;
static int32_t smostcnt;
static int16_t smost[MAXYSAVES];
static int16_t smoststart[MAXWALLSB];
static char smostwalltype[MAXWALLSB];
static int32_t smostwall[MAXWALLSB], smostwallcnt = -1L;

View file

@ -4,6 +4,7 @@
#define MAXCLIPNUM 1024
#define MAXPERMS 512
#define MAXTILEFILES 256
// MAXYSAVES is 983040 (!) right now:
#define MAXYSAVES ((MAXXDIM*MAXSPRITES)>>7)
#define MAXNODESPERLINE 42 //Warning: This depends on MAXYSAVES & MAXYDIM!
#define MAXCLIPDIST 1024

View file

@ -40,7 +40,30 @@ Modifications for JonoF's port by Jonathon Fowler (jonof@edgenetwk.com)
need to be in the header because there are no exposed functions
that use any of this directly */
typedef struct lpfileheaderstruct { uint32_t id; /* 4 uint8_tacter ID == "LPF " */ uint16_t maxLps; /* max # largePages allowed. 256 FOR NOW. */ uint16_t nLps; /* # largePages in this file. */ uint32_t nRecords; /* # records in this file. 65534 is current limit + ring */ uint16_t maxRecsPerLp; /* # records permitted in an lp. 256 FOR NOW. */ uint16_t lpfTableOffset; /* Absolute Seek position of lpfTable. 1280 FOR NOW. */ uint32_t contentType; /* 4 character ID == "ANIM" */ uint16_t width; /* Width of screen in pixels. */ uint16_t height; /* Height of screen in pixels. */ uint8_t variant; /* 0==ANIM. */ uint8_t version; /* 0==frame rate in 18/sec, 1= 70/sec */ uint8_t hasLastDelta; /* 1==Last record is a delta from last-to-first frame. */ uint8_t lastDeltaValid; /* 0==Ignore ring frame. */ uint8_t pixelType; /* 0==256 color. */ uint8_t CompressionType; /* 1==(RunSkipDump) Only one used FOR NOW. */ uint8_t otherRecsPerFrm; /* 0 FOR NOW. */ uint8_t bitmaptype; /* 1==320x200, 256-color. Only one implemented so far. */ uint8_t recordTypes[32]; /* Not yet implemented. */ uint32_t nFrames; /* Number of actual frames in the file, includes ring frame. */ uint16_t framesPerSecond; /* Number of frames to play per second. */ uint16_t pad2[29]; /* 58 bytes of filler to round up to 128 bytes total. */ }
typedef struct lpfileheaderstruct
{
uint32_t id; /* 4 uint8_tacter ID == "LPF " */
uint16_t maxLps; /* max # largePages allowed. 256 FOR NOW. */
uint16_t nLps; /* # largePages in this file. */
uint32_t nRecords; /* # records in this file. 65534 is current limit + ring */
uint16_t maxRecsPerLp; /* # records permitted in an lp. 256 FOR NOW. */
uint16_t lpfTableOffset; /* Absolute Seek position of lpfTable. 1280 FOR NOW. */
uint32_t contentType; /* 4 character ID == "ANIM" */
uint16_t width; /* Width of screen in pixels. */
uint16_t height; /* Height of screen in pixels. */
uint8_t variant; /* 0==ANIM. */
uint8_t version; /* 0==frame rate in 18/sec, 1= 70/sec */
uint8_t hasLastDelta; /* 1==Last record is a delta from last-to-first frame. */
uint8_t lastDeltaValid; /* 0==Ignore ring frame. */
uint8_t pixelType; /* 0==256 color. */
uint8_t CompressionType; /* 1==(RunSkipDump) Only one used FOR NOW. */
uint8_t otherRecsPerFrm; /* 0 FOR NOW. */
uint8_t bitmaptype; /* 1==320x200, 256-color. Only one implemented so far. */
uint8_t recordTypes[32]; /* Not yet implemented. */
uint32_t nFrames; /* Number of actual frames in the file, includes ring frame. */
uint16_t framesPerSecond; /* Number of frames to play per second. */
uint16_t pad2[29]; /* 58 bytes of filler to round up to 128 bytes total. */
}
lpfileheader; /* (comments from original source) */
// this is the format of a large page structure