Make useractor's <actortype> bit 4 mean 'this actor will not move by itself' to make it possible to have it in a rotating sector with full rounding correction. No token name is provided because the three others come from CON and I don't want to clutter the namespace; fix the editor issue where the box wasn't shown on occasion in the tile selector (8-bit)

git-svn-id: https://svn.eduke32.com/eduke32@1934 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2011-07-20 22:08:05 +00:00
parent 8b6857b360
commit a9290a0d29
5 changed files with 50 additions and 21 deletions

View File

@ -1290,6 +1290,12 @@ int32_t clipmapinfo_load(const char *filename)
if (pn<=0 || pn>=MAXTILES || k<0 || k>=numsectors || (sectoidx[k]&CM_OUTER)) if (pn<=0 || pn>=MAXTILES || k<0 || k>=numsectors || (sectoidx[k]&CM_OUTER))
continue; continue;
if (numclipmaps >= CM_MAX)
{
initprintf("warning: reached max clip map number %d, not processing any more\n", CM_MAX);
break;
}
// chain // chain
if (pictoidx[pn]>=0) if (pictoidx[pn]>=0)
{ {
@ -9310,6 +9316,8 @@ int32_t loadmaphack(const char *filename)
static char fn[BMAX_PATH]; static char fn[BMAX_PATH];
#ifdef POLYMER #ifdef POLYMER
int32_t toomanylights = 0;
for (i=0; i<PR_MAXLIGHTS; i++) for (i=0; i<PR_MAXLIGHTS; i++)
maphacklight[i] = -1; maphacklight[i] = -1;
#endif #endif
@ -9492,6 +9500,9 @@ int32_t loadmaphack(const char *filename)
#pragma pack(push,1) #pragma pack(push,1)
_prlight light; _prlight light;
#pragma pack(pop) #pragma pack(pop)
if (toomanylights)
break; // ignore further light defs
scriptfile_getnumber(script, &value); scriptfile_getnumber(script, &value);
light.sector = value; light.sector = value;
scriptfile_getnumber(script, &value); scriptfile_getnumber(script, &value);
@ -9526,11 +9537,19 @@ int32_t loadmaphack(const char *filename)
light.tilenum = value; light.tilenum = value;
if (rendmode == 4) if (rendmode == 4)
{ {
lightid = polymer_addlight(&light); if (maphacklightcnt == PR_MAXLIGHTS)
if (lightid>=0) {
maphacklight[maphacklightcnt++] = lightid; initprintf("warning: max light count %d exceeded, "
} "ignoring further light defs\n", PR_MAXLIGHTS);
toomanylights = 1;
break;
}
lightid = polymer_addlight(&light);
if (lightid>=0)
maphacklight[maphacklightcnt++] = lightid;
}
break; break;
} }

View File

@ -650,7 +650,9 @@ void Sect_ClearInterpolation(int32_t sectnum)
static int32_t move_fixed_sprite(int32_t j, int32_t pivotspr, int32_t daang) static int32_t move_fixed_sprite(int32_t j, int32_t pivotspr, int32_t daang)
{ {
if ((FIXSPR_STATNUMP(sprite[j].statnum) || (sprite[j].picnum==SECTOREFFECTOR && (sprite[j].lotag==49||sprite[j].lotag==50))) if ((FIXSPR_STATNUMP(sprite[j].statnum) ||
(sprite[j].picnum==SECTOREFFECTOR && (sprite[j].lotag==49||sprite[j].lotag==50)) ||
((sprite[j].statnum==1 || sprite[j].statnum==2) && (ActorType[sprite[j].picnum]&4)))
&& actor[j].t_data[7]==(0x18190000|pivotspr)) && actor[j].t_data[7]==(0x18190000|pivotspr))
{ {
rotatepoint(0,0, actor[j].t_data[8],actor[j].t_data[9], daang&2047, &sprite[j].x,&sprite[j].y); rotatepoint(0,0, actor[j].t_data[8],actor[j].t_data[9], daang&2047, &sprite[j].x,&sprite[j].y);

View File

@ -4091,7 +4091,7 @@ static void tilescreen_drawbox(int32_t iTopLeft, int32_t iSelected, int32_t nXTi
int32_t x1 = ((iTile-iTopLeft) % nXTiles)*TileDim; int32_t x1 = ((iTile-iTopLeft) % nXTiles)*TileDim;
int32_t y1 = ((iTile - ((iTile-iTopLeft) % nXTiles) - iTopLeft)/nXTiles)*TileDim + offset; int32_t y1 = ((iTile - ((iTile-iTopLeft) % nXTiles) - iTopLeft)/nXTiles)*TileDim + offset;
int32_t x2 = x1+TileDim-1; int32_t x2 = x1+TileDim-1;
int32_t y2 = y1+TileDim-1; int32_t y2 = y1+TileDim-1, oydim16=ydim16;
char markedcol = editorcolors[14]; char markedcol = editorcolors[14];
@ -4100,6 +4100,9 @@ static void tilescreen_drawbox(int32_t iTopLeft, int32_t iSelected, int32_t nXTi
y1=max(y1, 0); y1=max(y1, 0);
y2=min(y2, ydim-1); y2=min(y2, ydim-1);
// plotlines2d uses drawline16, which clips against ydim16...
ydim16 = ydim;
{ {
// box // box
int32_t xx[] = {x1, x1, x2, x2, x1}; int32_t xx[] = {x1, x1, x2, x2, x1};
@ -4117,6 +4120,8 @@ static void tilescreen_drawbox(int32_t iTopLeft, int32_t iSelected, int32_t nXTi
swaplong(&yy[0], &yy[1]); swaplong(&yy[0], &yy[1]);
plotlines2d(xx, yy, 2, markedcol); plotlines2d(xx, yy, 2, markedcol);
} }
ydim16 = oydim16;
} }
} }

View File

@ -2646,15 +2646,17 @@ static int32_t C_ParseCommand(int32_t loop)
if (tw == CON_USERACTOR) if (tw == CON_USERACTOR)
{ {
j = *g_scriptPtr; j = *g_scriptPtr;
if (j > 2) if (j > 6 || (j&3)==3)
{ {
C_ReportError(-1); C_ReportError(-1);
initprintf("%s:%d: warning: invalid useractor type.\n",g_szScriptFileName,g_lineNumber); initprintf("%s:%d: warning: invalid useractor type. Must be 0, 1, 2"
g_numCompilerWarnings++; " (notenemy, enemy, enemystayput) or have 4 added ('doesn't move').\n",
j = 0; g_szScriptFileName,g_lineNumber);
} g_numCompilerWarnings++;
j = 0;
}
} }
C_GetNextValue(LABEL_DEFINE); C_GetNextValue(LABEL_DEFINE);
@ -2662,9 +2664,9 @@ static int32_t C_ParseCommand(int32_t loop)
if (tw == CON_EVENTLOADACTOR) if (tw == CON_EVENTLOADACTOR)
{ {
actorLoadEventScrptr[*g_scriptPtr] = g_parsingActorPtr; actorLoadEventScrptr[*g_scriptPtr] = g_parsingActorPtr;
g_checkingIfElse = 0; g_checkingIfElse = 0;
continue; continue;
} }
actorscrptr[*g_scriptPtr] = g_parsingActorPtr; actorscrptr[*g_scriptPtr] = g_parsingActorPtr;

View File

@ -1016,7 +1016,7 @@ static inline void G_SetupBackdrop(int16_t sky)
pskybits=3; pskybits=3;
} }
// tweak moving sectors with these SE lotags (bitmap) // tweak moving sectors with these SE lotags
#define FIXSPR_SELOTAGP(k) ((k==0) || (k==6) || (k==14)) #define FIXSPR_SELOTAGP(k) ((k==0) || (k==6) || (k==14))
// setup sprites in moving sectors that are to be fixed wrt a certain pivot // setup sprites in moving sectors that are to be fixed wrt a certain pivot
@ -1039,7 +1039,8 @@ static void premap_setup_fixed_sprites(void)
// TRIPBOMB uses t_data[7] for its own purposes. Wouldn't be // TRIPBOMB uses t_data[7] for its own purposes. Wouldn't be
// too useful with moving sectors anyway // too useful with moving sectors anyway
if ((FIXSPR_STATNUMP(sprite[j].statnum) && sprite[j].picnum!=TRIPBOMB) || if ((FIXSPR_STATNUMP(sprite[j].statnum) && sprite[j].picnum!=TRIPBOMB) ||
(sprite[j].picnum==SECTOREFFECTOR && (sprite[j].lotag==49||sprite[j].lotag==50))) (sprite[j].picnum==SECTOREFFECTOR && (sprite[j].lotag==49||sprite[j].lotag==50)) ||
((sprite[j].statnum==1 || sprite[j].statnum==2) && (ActorType[sprite[j].picnum]&4)))
{ {
pivot = i; pivot = i;
if (sprite[i].lotag==0) if (sprite[i].lotag==0)