mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-03-23 03:12:38 +00:00
Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2.git into snake
This commit is contained in:
commit
614f45b380
49 changed files with 2478 additions and 3054 deletions
|
@ -760,6 +760,7 @@ linedeftypes
|
|||
{
|
||||
title = "Parameters";
|
||||
prefix = "(22)";
|
||||
flags8text = "[3] Set translucency by X offset";
|
||||
flags32text = "[5] Render outer sides only";
|
||||
flags64text = "[6] Trigger linedef executor";
|
||||
flags128text = "[7] Intangible";
|
||||
|
@ -1908,6 +1909,27 @@ linedeftypes
|
|||
prefix = "(333)";
|
||||
}
|
||||
|
||||
334
|
||||
{
|
||||
title = "Object Dye - Continuous";
|
||||
flags64text = "[6] Disable for this color";
|
||||
prefix = "(334)";
|
||||
}
|
||||
|
||||
335
|
||||
{
|
||||
title = "Object Dye - Each Time";
|
||||
flags64text = "[6] Disable for this color";
|
||||
prefix = "(335)";
|
||||
}
|
||||
|
||||
336
|
||||
{
|
||||
title = "Object Dye - Once";
|
||||
flags64text = "[6] Disable for this color";
|
||||
prefix = "(336)";
|
||||
}
|
||||
|
||||
399
|
||||
{
|
||||
title = "Level Load";
|
||||
|
@ -2218,6 +2240,19 @@ linedeftypes
|
|||
prefix = "(462)";
|
||||
flags8text = "[3] Set delay by backside sector";
|
||||
}
|
||||
|
||||
463
|
||||
{
|
||||
title = "Dye Object";
|
||||
prefix = "(463)";
|
||||
}
|
||||
|
||||
464
|
||||
{
|
||||
title = "Trigger Egg Capsule";
|
||||
prefix = "(464)";
|
||||
flags64text = "[6] Don't end level";
|
||||
}
|
||||
}
|
||||
|
||||
linedefexecmisc
|
||||
|
@ -3704,6 +3739,7 @@ thingtypes
|
|||
width = 8;
|
||||
height = 16;
|
||||
sprite = "internal:capsule";
|
||||
angletext = "Tag";
|
||||
}
|
||||
292
|
||||
{
|
||||
|
|
|
@ -85,6 +85,10 @@ tic_t jointimeout = (10*TICRATE);
|
|||
static boolean sendingsavegame[MAXNETNODES]; // Are we sending the savegame?
|
||||
static tic_t freezetimeout[MAXNETNODES]; // Until when can this node freeze the server before getting a timeout?
|
||||
|
||||
// Incremented by cv_joindelay when a client joins, decremented each tic.
|
||||
// If higher than cv_joindelay * 2 (3 joins in a short timespan), joins are temporarily disabled.
|
||||
static tic_t joindelay = 0;
|
||||
|
||||
UINT16 pingmeasurecount = 1;
|
||||
UINT32 realpingtable[MAXPLAYERS]; //the base table of ping where an average will be sent to everyone.
|
||||
UINT32 playerpingtable[MAXPLAYERS]; //table of player latency values.
|
||||
|
@ -3594,6 +3598,8 @@ consvar_t cv_allownewplayer = {"allowjoin", "On", CV_NETVAR, CV_OnOff, NULL, 0,
|
|||
consvar_t cv_joinnextround = {"joinnextround", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done
|
||||
static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {32, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_maxplayers = {"maxplayers", "8", CV_SAVE, maxplayers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
static CV_PossibleValue_t joindelay_cons_t[] = {{1, "MIN"}, {3600, "MAX"}, {0, "Off"}, {0, NULL}};
|
||||
consvar_t cv_joindelay = {"joindelay", "10", CV_SAVE, joindelay_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
static CV_PossibleValue_t rejointimeout_cons_t[] = {{1, "MIN"}, {60 * FRACUNIT, "MAX"}, {0, "Off"}, {0, NULL}};
|
||||
consvar_t cv_rejointimeout = {"rejointimeout", "Off", CV_SAVE|CV_FLOAT, rejointimeout_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
|
@ -3681,6 +3687,8 @@ void SV_ResetServer(void)
|
|||
neededtic = maketic;
|
||||
tictoclear = maketic;
|
||||
|
||||
joindelay = 0;
|
||||
|
||||
for (i = 0; i < MAXNETNODES; i++)
|
||||
ResetNode(i);
|
||||
|
||||
|
@ -4130,6 +4138,9 @@ static void HandleConnect(SINT8 node)
|
|||
SV_SendRefuse(node, M_GetText("No players from\nthis node."));
|
||||
else if (luafiletransfers)
|
||||
SV_SendRefuse(node, M_GetText("The server is broadcasting a file\nrequested by a Lua script.\nPlease wait a bit and then\ntry rejoining."));
|
||||
else if (netgame && joindelay > 2 * (tic_t)cv_joindelay.value * TICRATE)
|
||||
SV_SendRefuse(node, va(M_GetText("Too many people are connecting.\nPlease wait %d seconds and then\ntry rejoining."),
|
||||
(joindelay - 2 * cv_joindelay.value * TICRATE) / TICRATE));
|
||||
else
|
||||
{
|
||||
#ifndef NONET
|
||||
|
@ -4187,6 +4198,7 @@ static void HandleConnect(SINT8 node)
|
|||
DEBFILE("send savegame\n");
|
||||
}
|
||||
SV_AddWaitingPlayers(names[0], names[1]);
|
||||
joindelay += cv_joindelay.value * TICRATE;
|
||||
player_joining = true;
|
||||
}
|
||||
#else
|
||||
|
@ -5555,12 +5567,21 @@ void NetUpdate(void)
|
|||
hu_resynching = true;
|
||||
}
|
||||
}
|
||||
|
||||
Net_AckTicker();
|
||||
|
||||
// Handle timeouts to prevent definitive freezes from happenning
|
||||
if (server)
|
||||
{
|
||||
for (i = 1; i < MAXNETNODES; i++)
|
||||
if (nodeingame[i] && freezetimeout[i] < I_GetTime())
|
||||
Net_ConnectionTimeout(i);
|
||||
|
||||
// In case the cvar value was lowered
|
||||
if (joindelay)
|
||||
joindelay = min(joindelay - 1, 3 * (tic_t)cv_joindelay.value * TICRATE);
|
||||
}
|
||||
|
||||
nowtime /= NEWTICRATERATIO;
|
||||
if (nowtime > resptime)
|
||||
{
|
||||
|
@ -5568,6 +5589,7 @@ void NetUpdate(void)
|
|||
M_Ticker();
|
||||
CON_Ticker();
|
||||
}
|
||||
|
||||
SV_FileSendTicker();
|
||||
}
|
||||
|
||||
|
|
|
@ -515,7 +515,7 @@ extern UINT32 realpingtable[MAXPLAYERS];
|
|||
extern UINT32 playerpingtable[MAXPLAYERS];
|
||||
extern tic_t servermaxping;
|
||||
|
||||
extern consvar_t cv_allownewplayer, cv_joinnextround, cv_maxplayers, cv_rejointimeout;
|
||||
extern consvar_t cv_allownewplayer, cv_joinnextround, cv_maxplayers, cv_joindelay, cv_rejointimeout;
|
||||
extern consvar_t cv_resynchattempts, cv_blamecfail;
|
||||
extern consvar_t cv_maxsend, cv_noticedownload, cv_downloadspeed;
|
||||
|
||||
|
|
|
@ -573,6 +573,7 @@ void D_RegisterServerCommands(void)
|
|||
|
||||
// d_clisrv
|
||||
CV_RegisterVar(&cv_maxplayers);
|
||||
CV_RegisterVar(&cv_joindelay);
|
||||
CV_RegisterVar(&cv_rejointimeout);
|
||||
CV_RegisterVar(&cv_resynchattempts);
|
||||
CV_RegisterVar(&cv_maxsend);
|
||||
|
|
|
@ -1863,6 +1863,12 @@ static void readlevelheader(MYFILE *f, INT32 num)
|
|||
}
|
||||
else if (fastcmp(word, "STARTRINGS"))
|
||||
mapheaderinfo[num-1]->startrings = (UINT16)i;
|
||||
else if (fastcmp(word, "SPECIALSTAGETIME"))
|
||||
mapheaderinfo[num-1]->sstimer = i;
|
||||
else if (fastcmp(word, "SPECIALSTAGESPHERES"))
|
||||
mapheaderinfo[num-1]->ssspheres = i;
|
||||
else if (fastcmp(word, "GRAVITY"))
|
||||
mapheaderinfo[num-1]->gravity = FLOAT_TO_FIXED(atof(word2));
|
||||
else
|
||||
deh_warning("Level header %d: unknown word '%s'", num, word);
|
||||
}
|
||||
|
@ -3027,6 +3033,7 @@ static actionpointer_t actionpointers[] =
|
|||
{{A_DragonbomberSpawn}, "A_DRAGONBOMERSPAWN"},
|
||||
{{A_DragonWing}, "A_DRAGONWING"},
|
||||
{{A_DragonSegment}, "A_DRAGONSEGMENT"},
|
||||
{{A_ChangeHeight}, "A_CHANGEHEIGHT"},
|
||||
{{NULL}, "NONE"},
|
||||
|
||||
// This NULL entry must be the last in the list
|
||||
|
@ -6225,6 +6232,14 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit
|
|||
"S_ROCKET",
|
||||
|
||||
"S_LASER",
|
||||
"S_LASER2",
|
||||
"S_LASERFLASH",
|
||||
|
||||
"S_LASERFLAME1",
|
||||
"S_LASERFLAME2",
|
||||
"S_LASERFLAME3",
|
||||
"S_LASERFLAME4",
|
||||
"S_LASERFLAME5",
|
||||
|
||||
"S_TORPEDO",
|
||||
|
||||
|
|
|
@ -578,9 +578,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch;
|
|||
/// Dumps the contents of a network save game upon consistency failure for debugging.
|
||||
//#define DUMPCONSISTENCY
|
||||
|
||||
/// Polyobject fake flat code
|
||||
#define POLYOBJECTS_PLANES
|
||||
|
||||
/// See name of player in your crosshair
|
||||
#define SEENAMES
|
||||
|
||||
|
|
|
@ -319,6 +319,9 @@ typedef struct
|
|||
|
||||
char selectheading[22]; ///< Level select heading. Allows for controllable grouping.
|
||||
UINT16 startrings; ///< Number of rings players start with.
|
||||
INT32 sstimer; ///< Timer for special stages.
|
||||
UINT32 ssspheres; ///< Sphere requirement in special stages.
|
||||
fixed_t gravity; ///< Map-wide gravity.
|
||||
|
||||
// Title card.
|
||||
char ltzzpatch[8]; ///< Zig zag patch.
|
||||
|
|
|
@ -887,12 +887,10 @@ static void AdjustSegs(void)
|
|||
float distv1,distv2,tmp;
|
||||
nearv1 = nearv2 = MYMAX;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// Don't touch polyobject segs. We'll compensate
|
||||
// for this when we go about drawing them.
|
||||
if (lseg->polyseg)
|
||||
continue;
|
||||
#endif
|
||||
|
||||
if (p) {
|
||||
for (j = 0; j < p->numpts; j++)
|
||||
|
|
|
@ -298,6 +298,8 @@ light_t *t_lspr[NUMSPRITES] =
|
|||
|
||||
// Projectiles
|
||||
&lspr[NOLIGHT], // SPR_MISL
|
||||
&lspr[SMALLREDBALL_L], // SPR_LASR
|
||||
&lspr[REDSHINE_L], // SPR_LASF
|
||||
&lspr[NOLIGHT], // SPR_TORP
|
||||
&lspr[NOLIGHT], // SPR_ENRG
|
||||
&lspr[NOLIGHT], // SPR_MINE
|
||||
|
|
|
@ -1602,7 +1602,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
// heights of the polygon, and h & l, are the final (clipped)
|
||||
// poly coords.
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// NOTE: With polyobjects, whenever you need to check the properties of the polyobject sector it belongs to,
|
||||
// you must use the linedef's backsector to be correct
|
||||
// From CB
|
||||
|
@ -1612,7 +1611,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
popenbottom = back->floorheight;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
popentop = min(worldtop, worldhigh);
|
||||
popenbottom = max(worldbottom, worldlow);
|
||||
|
@ -1642,7 +1640,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
polybottom = polytop - textureheight[gr_midtexture]*repeats;
|
||||
}
|
||||
// CB
|
||||
#ifdef POLYOBJECTS
|
||||
// NOTE: With polyobjects, whenever you need to check the properties of the polyobject sector it belongs to,
|
||||
// you must use the linedef's backsector to be correct
|
||||
if (gr_curline->polyseg)
|
||||
|
@ -1650,7 +1647,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
lowcut = polybottom;
|
||||
highcut = polytop;
|
||||
}
|
||||
#endif
|
||||
else
|
||||
{
|
||||
// The cut-off values of a linedef can always be constant, since every line has an absoulute front and or back sector
|
||||
|
@ -1780,7 +1776,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
break;
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
if (gr_curline->polyseg && gr_curline->polyseg->translucency > 0)
|
||||
{
|
||||
if (gr_curline->polyseg->translucency >= NUMTRANSMAPS) // wall not drawn
|
||||
|
@ -1791,7 +1786,6 @@ static void HWR_StoreWallRange(double startfrac, double endfrac)
|
|||
else
|
||||
blendmode = HWR_TranstableToAlpha(gr_curline->polyseg->translucency, &Surf);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (gr_frontsector->numlights)
|
||||
{
|
||||
|
@ -2587,10 +2581,8 @@ static void HWR_AddLine(seg_t * line)
|
|||
static sector_t tempsec;
|
||||
|
||||
fixed_t v1x, v1y, v2x, v2y; // the seg's vertexes as fixed_t
|
||||
#ifdef POLYOBJECTS
|
||||
if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES))
|
||||
return;
|
||||
#endif
|
||||
|
||||
gr_curline = line;
|
||||
|
||||
|
@ -2717,13 +2709,10 @@ static void HWR_AddLine(seg_t * line)
|
|||
|
||||
if (bothceilingssky && bothfloorssky) // everything's sky? let's save us a bit of time then
|
||||
{
|
||||
if (
|
||||
#ifdef POLYOBJECTS
|
||||
!line->polyseg &&
|
||||
#endif
|
||||
!line->sidedef->midtexture
|
||||
&& ((!gr_frontsector->ffloors && !gr_backsector->ffloors)
|
||||
|| (gr_frontsector->tag == gr_backsector->tag)))
|
||||
if (!line->polyseg &&
|
||||
!line->sidedef->midtexture
|
||||
&& ((!gr_frontsector->ffloors && !gr_backsector->ffloors)
|
||||
|| (gr_frontsector->tag == gr_backsector->tag)))
|
||||
return; // line is empty, don't even bother
|
||||
// treat like wide open window instead
|
||||
HWR_ProcessSeg(); // Doesn't need arguments because they're defined globally :D
|
||||
|
@ -2759,13 +2748,10 @@ static void HWR_AddLine(seg_t * line)
|
|||
|
||||
if (bothceilingssky && bothfloorssky) // everything's sky? let's save us a bit of time then
|
||||
{
|
||||
if (
|
||||
#ifdef POLYOBJECTS
|
||||
!line->polyseg &&
|
||||
#endif
|
||||
!line->sidedef->midtexture
|
||||
&& ((!gr_frontsector->ffloors && !gr_backsector->ffloors)
|
||||
|| (gr_frontsector->tag == gr_backsector->tag)))
|
||||
if (!line->polyseg &&
|
||||
!line->sidedef->midtexture
|
||||
&& ((!gr_frontsector->ffloors && !gr_backsector->ffloors)
|
||||
|| (gr_frontsector->tag == gr_backsector->tag)))
|
||||
return; // line is empty, don't even bother
|
||||
|
||||
goto clippass; // treat like wide open window instead
|
||||
|
@ -2957,8 +2943,6 @@ static boolean HWR_CheckBBox(fixed_t *bspcoord)
|
|||
#endif
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
|
||||
//
|
||||
// HWR_AddPolyObjectSegs
|
||||
//
|
||||
|
@ -3001,7 +2985,6 @@ static inline void HWR_AddPolyObjectSegs(void)
|
|||
Z_Free(gr_fakeline);
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
static void HWR_RenderPolyObjectPlane(polyobj_t *polysector, boolean isceiling, fixed_t fixedheight,
|
||||
FBITFIELD blendmode, UINT8 lightlevel, levelflat_t *levelflat, sector_t *FOFsector,
|
||||
UINT8 alpha, extracolormap_t *planecolormap)
|
||||
|
@ -3256,8 +3239,6 @@ static void HWR_AddPolyObjectPlanes(void)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
||||
// -----------------+
|
||||
// HWR_Subsector : Determine floor/ceiling planes.
|
||||
|
@ -3585,7 +3566,6 @@ static void HWR_Subsector(size_t num)
|
|||
#endif
|
||||
#endif //doplanes
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// Draw all the polyobjects in this subsector
|
||||
if (sub->polyList)
|
||||
{
|
||||
|
@ -3606,15 +3586,12 @@ static void HWR_Subsector(size_t num)
|
|||
// Draw polyobject lines.
|
||||
HWR_AddPolyObjectSegs();
|
||||
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
if (sub->validcount != validcount) // This validcount situation seems to let us know that the floors have already been drawn.
|
||||
{
|
||||
// Draw polyobject planes
|
||||
HWR_AddPolyObjectPlanes();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
// Hurder ici se passe les choses INT32<33>essantes!
|
||||
// on vient de tracer le sol et le plafond
|
||||
|
@ -3637,14 +3614,8 @@ static void HWR_Subsector(size_t num)
|
|||
while (count--)
|
||||
{
|
||||
|
||||
if (!line->glseg
|
||||
#ifdef POLYOBJECTS
|
||||
&& !line->polyseg // ignore segs that belong to polyobjects
|
||||
#endif
|
||||
)
|
||||
{
|
||||
if (!line->glseg && !line->polyseg) // ignore segs that belong to polyobjects
|
||||
HWR_AddLine(line);
|
||||
}
|
||||
line++;
|
||||
}
|
||||
}
|
||||
|
@ -3959,7 +3930,7 @@ static void HWR_DrawDropShadow(mobj_t *thing, gr_vissprite_t *spr, fixed_t scale
|
|||
HWR_GetPatch(gpatch);
|
||||
|
||||
scalemul = FixedMul(FRACUNIT - floordiff/640, scale);
|
||||
scalemul = FixedMul(scalemul, (thing->radius*2) / gpatch->height);
|
||||
scalemul = FixedMul(scalemul, (thing->radius*2) / SHORT(gpatch->height));
|
||||
|
||||
fscale = FIXED_TO_FLOAT(scalemul);
|
||||
fx = FIXED_TO_FLOAT(thing->x);
|
||||
|
@ -3971,9 +3942,9 @@ static void HWR_DrawDropShadow(mobj_t *thing, gr_vissprite_t *spr, fixed_t scale
|
|||
// 0--1
|
||||
|
||||
if (thing && fabsf(fscale - 1.0f) > 1.0E-36f)
|
||||
offset = (gpatch->height/2) * fscale;
|
||||
offset = (SHORT(gpatch->height)/2) * fscale;
|
||||
else
|
||||
offset = (float)(gpatch->height/2);
|
||||
offset = (float)(SHORT(gpatch->height)/2);
|
||||
|
||||
shadowVerts[0].x = shadowVerts[3].x = fx - offset;
|
||||
shadowVerts[2].x = shadowVerts[1].x = fx + offset;
|
||||
|
@ -5282,10 +5253,10 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
rotsprite = sprframe->rotsprite.patch[rot][rollangle];
|
||||
if (rotsprite != NULL)
|
||||
{
|
||||
spr_width = rotsprite->width << FRACBITS;
|
||||
spr_height = rotsprite->height << FRACBITS;
|
||||
spr_offset = rotsprite->leftoffset << FRACBITS;
|
||||
spr_topoffset = rotsprite->topoffset << FRACBITS;
|
||||
spr_width = SHORT(rotsprite->width) << FRACBITS;
|
||||
spr_height = SHORT(rotsprite->height) << FRACBITS;
|
||||
spr_offset = SHORT(rotsprite->leftoffset) << FRACBITS;
|
||||
spr_topoffset = SHORT(rotsprite->topoffset) << FRACBITS;
|
||||
// flip -> rotate, not rotate -> flip
|
||||
flip = 0;
|
||||
}
|
||||
|
|
30
src/info.c
30
src/info.c
|
@ -187,6 +187,8 @@ char sprnames[NUMSPRITES + 1][5] =
|
|||
|
||||
// Projectiles
|
||||
"MISL",
|
||||
"LASR", // GFZ3 laser
|
||||
"LASF", // GFZ3 laser flames
|
||||
"TORP", // Torpedo
|
||||
"ENRG", // Energy ball
|
||||
"MINE", // Skim mine
|
||||
|
@ -2058,7 +2060,15 @@ state_t states[NUMSTATES] =
|
|||
|
||||
{SPR_MISL, FF_FULLBRIGHT, 1, {A_SmokeTrailer}, MT_SMOKE, 0, S_ROCKET}, // S_ROCKET
|
||||
|
||||
{SPR_MISL, FF_FULLBRIGHT, 2, {NULL}, 0, 0, S_NULL}, // S_LASER
|
||||
{SPR_LASR, FF_FULLBRIGHT|0, 2, {NULL}, 0, 0, S_NULL}, // S_LASER
|
||||
{SPR_LASR, FF_FULLBRIGHT|1, 2, {NULL}, 0, 0, S_NULL}, // S_LASER2
|
||||
{SPR_LASR, FF_FULLBRIGHT|2, 2, {NULL}, 0, 0, S_NULL}, // S_LASERFLASH
|
||||
|
||||
{SPR_LASF, FF_FULLBRIGHT|0, 2, {NULL}, 0, 0, S_LASERFLAME2}, // S_LASERFLAME1
|
||||
{SPR_LASF, FF_FULLBRIGHT|1, 1, {A_ChangeHeight}, 156*FRACUNIT, 3, S_LASERFLAME3}, // S_LASERFLAME2
|
||||
{SPR_LASF, FF_FULLBRIGHT|2, 0, {A_ChangeHeight}, 32*FRACUNIT, 3, S_LASERFLAME4}, // S_LASERFLAME3
|
||||
{SPR_LASF, FF_ANIMATE|FF_PAPERSPRITE|FF_FULLBRIGHT|2, 4, {NULL}, 1, 2, S_LASERFLAME5}, // S_LASERFLAME4
|
||||
{SPR_LASF, FF_ANIMATE|FF_PAPERSPRITE|FF_FULLBRIGHT|4, 28, {NULL}, 2, 2, S_NULL}, // S_LASERFLAME5
|
||||
|
||||
{SPR_TORP, 0, 1, {A_SmokeTrailer}, MT_SMOKE, 0, S_TORPEDO}, // S_TORPEDO
|
||||
|
||||
|
@ -5665,28 +5675,28 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
|
||||
{ // MT_EGGMOBILE_FIRE
|
||||
-1, // doomednum
|
||||
S_SPINFIRE1, // spawnstate
|
||||
S_LASERFLAME1, // spawnstate
|
||||
1, // spawnhealth
|
||||
S_NULL, // seestate
|
||||
sfx_None, // seesound
|
||||
sfx_s3kc2s, // seesound
|
||||
8, // reactiontime
|
||||
sfx_None, // attacksound
|
||||
S_NULL, // painstate
|
||||
0, // painchance
|
||||
sfx_None, // painsound
|
||||
sfx_s3k8d, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
0, // speed
|
||||
8*FRACUNIT, // radius
|
||||
14*FRACUNIT, // height
|
||||
24*FRACUNIT, // radius
|
||||
84*FRACUNIT, // height
|
||||
0, // display offset
|
||||
DMG_FIRE, // mass
|
||||
1, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_MISSILE|MF_NOGRAVITY|MF_FIRE, // flags
|
||||
MF_NOGRAVITY|MF_FIRE|MF_PAIN, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
@ -9637,8 +9647,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
S_NULL, // painstate
|
||||
0, // painchance
|
||||
sfx_None, // painsound
|
||||
S_NULL, // meleestate
|
||||
S_NULL, // missilestate
|
||||
S_LASERFLASH, // meleestate
|
||||
S_LASER2, // missilestate
|
||||
S_NULL, // deathstate
|
||||
S_NULL, // xdeathstate
|
||||
sfx_None, // deathsound
|
||||
|
@ -9649,7 +9659,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] =
|
|||
0, // mass
|
||||
20, // damage
|
||||
sfx_None, // activesound
|
||||
MF_NOBLOCKMAP|MF_MISSILE|MF_NOGRAVITY, // flags
|
||||
MF_MISSILE|MF_NOGRAVITY, // flags
|
||||
S_NULL // raisestate
|
||||
},
|
||||
|
||||
|
|
11
src/info.h
11
src/info.h
|
@ -284,6 +284,7 @@ void A_RolloutRock();
|
|||
void A_DragonbomberSpawn();
|
||||
void A_DragonWing();
|
||||
void A_DragonSegment();
|
||||
void A_ChangeHeight();
|
||||
|
||||
// ratio of states to sprites to mobj types is roughly 6 : 1 : 1
|
||||
#define NUMMOBJFREESLOTS 512
|
||||
|
@ -451,6 +452,8 @@ typedef enum sprite
|
|||
|
||||
// Projectiles
|
||||
SPR_MISL,
|
||||
SPR_LASR, // GFZ3 laser
|
||||
SPR_LASF, // GFZ3 laser flames
|
||||
SPR_TORP, // Torpedo
|
||||
SPR_ENRG, // Energy ball
|
||||
SPR_MINE, // Skim mine
|
||||
|
@ -2220,6 +2223,14 @@ typedef enum state
|
|||
S_ROCKET,
|
||||
|
||||
S_LASER,
|
||||
S_LASER2,
|
||||
S_LASERFLASH,
|
||||
|
||||
S_LASERFLAME1,
|
||||
S_LASERFLAME2,
|
||||
S_LASERFLAME3,
|
||||
S_LASERFLAME4,
|
||||
S_LASERFLAME5,
|
||||
|
||||
S_TORPEDO,
|
||||
|
||||
|
|
|
@ -80,9 +80,7 @@ static UINT8 lib_searchBlockmap_Lines(lua_State *L, INT32 x, INT32 y, mobj_t *th
|
|||
{
|
||||
INT32 offset;
|
||||
const INT32 *list; // Big blockmap
|
||||
#ifdef POLYOBJECTS
|
||||
polymaplink_t *plink; // haleyjd 02/22/06
|
||||
#endif
|
||||
line_t *ld;
|
||||
|
||||
if (x < 0 || y < 0 || x >= bmapwidth || y >= bmapheight)
|
||||
|
@ -90,7 +88,6 @@ static UINT8 lib_searchBlockmap_Lines(lua_State *L, INT32 x, INT32 y, mobj_t *th
|
|||
|
||||
offset = y*bmapwidth + x;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// haleyjd 02/22/06: consider polyobject lines
|
||||
plink = polyblocklinks[offset];
|
||||
|
||||
|
@ -133,7 +130,6 @@ static UINT8 lib_searchBlockmap_Lines(lua_State *L, INT32 x, INT32 y, mobj_t *th
|
|||
}
|
||||
plink = (polymaplink_t *)(plink->link.next);
|
||||
}
|
||||
#endif
|
||||
|
||||
offset = *(blockmap + offset); // offset = blockmap[y*bmapwidth+x];
|
||||
|
||||
|
|
|
@ -412,9 +412,9 @@ static int libd_cachePatch(lua_State *L)
|
|||
HUDONLY
|
||||
|
||||
luapat = patchinfohead;
|
||||
lumpnum = W_CheckNumForName(luaL_checkstring(L, 1));
|
||||
lumpnum = W_CheckNumForLongName(luaL_checkstring(L, 1));
|
||||
if (lumpnum == LUMPERROR)
|
||||
lumpnum = W_GetNumForName("MISSING");
|
||||
lumpnum = W_GetNumForLongName("MISSING");
|
||||
|
||||
for (i = 0; i < numluapatches; i++)
|
||||
{
|
||||
|
@ -454,7 +454,7 @@ static int libd_cachePatch(lua_State *L)
|
|||
numluapatches++;
|
||||
#else
|
||||
HUDONLY
|
||||
LUA_PushUserdata(L, W_CachePatchName(luaL_checkstring(L, 1), PU_PATCH), META_PATCH);
|
||||
LUA_PushUserdata(L, W_CachePatchLongName(luaL_checkstring(L, 1), PU_PATCH), META_PATCH);
|
||||
#endif
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -2082,6 +2082,12 @@ static int mapheaderinfo_get(lua_State *L)
|
|||
lua_pushinteger(L, header->menuflags);
|
||||
else if (fastcmp(field,"startrings"))
|
||||
lua_pushinteger(L, header->startrings);
|
||||
else if (fastcmp(field, "sstimer"))
|
||||
lua_pushinteger(L, header->sstimer);
|
||||
else if (fastcmp(field, "ssspheres"))
|
||||
lua_pushinteger(L, header->ssspheres);
|
||||
else if (fastcmp(field, "gravity"))
|
||||
lua_pushfixed(L, header->gravity);
|
||||
// TODO add support for reading numGradedMares and grades
|
||||
else {
|
||||
// Read custom vars now
|
||||
|
|
|
@ -730,9 +730,13 @@ void LUA_InvalidatePlayer(player_t *player)
|
|||
enum
|
||||
{
|
||||
ARCH_NULL=0,
|
||||
ARCH_BOOLEAN,
|
||||
ARCH_SIGNED,
|
||||
ARCH_STRING,
|
||||
ARCH_TRUE,
|
||||
ARCH_FALSE,
|
||||
ARCH_INT8,
|
||||
ARCH_INT16,
|
||||
ARCH_INT32,
|
||||
ARCH_SMALLSTRING,
|
||||
ARCH_LARGESTRING,
|
||||
ARCH_TABLE,
|
||||
|
||||
ARCH_MOBJINFO,
|
||||
|
@ -817,22 +821,33 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
|
|||
WRITEUINT8(save_p, ARCH_NULL);
|
||||
return 2;
|
||||
case LUA_TBOOLEAN:
|
||||
WRITEUINT8(save_p, ARCH_BOOLEAN);
|
||||
WRITEUINT8(save_p, lua_toboolean(gL, myindex));
|
||||
WRITEUINT8(save_p, lua_toboolean(gL, myindex) ? ARCH_TRUE : ARCH_FALSE);
|
||||
break;
|
||||
case LUA_TNUMBER:
|
||||
{
|
||||
lua_Integer number = lua_tointeger(gL, myindex);
|
||||
WRITEUINT8(save_p, ARCH_SIGNED);
|
||||
WRITEFIXED(save_p, number);
|
||||
if (number >= INT8_MIN && number <= INT8_MAX)
|
||||
{
|
||||
WRITEUINT8(save_p, ARCH_INT8);
|
||||
WRITESINT8(save_p, number);
|
||||
}
|
||||
else if (number >= INT16_MIN && number <= INT16_MAX)
|
||||
{
|
||||
WRITEUINT8(save_p, ARCH_INT16);
|
||||
WRITEINT16(save_p, number);
|
||||
}
|
||||
else
|
||||
{
|
||||
WRITEUINT8(save_p, ARCH_INT32);
|
||||
WRITEFIXED(save_p, number);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case LUA_TSTRING:
|
||||
{
|
||||
UINT16 len = (UINT16)lua_objlen(gL, myindex); // get length of string, including embedded zeros
|
||||
UINT32 len = (UINT32)lua_objlen(gL, myindex); // get length of string, including embedded zeros
|
||||
const char *s = lua_tostring(gL, myindex);
|
||||
UINT16 i = 0;
|
||||
WRITEUINT8(save_p, ARCH_STRING);
|
||||
UINT32 i = 0;
|
||||
// if you're wondering why we're writing a string to save_p this way,
|
||||
// it turns out that Lua can have embedded zeros ('\0') in the strings,
|
||||
// so we can't use WRITESTRING as that cuts off when it finds a '\0'.
|
||||
|
@ -840,7 +855,16 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
|
|||
// fixing the awful crashes previously encountered for reading strings longer than 1024
|
||||
// (yes I know that's kind of a stupid thing to care about, but it'd be evil to trim or ignore them?)
|
||||
// -- Monster Iestyn 05/08/18
|
||||
WRITEUINT16(save_p, len); // save size of string
|
||||
if (len < 255)
|
||||
{
|
||||
WRITEUINT8(save_p, ARCH_SMALLSTRING);
|
||||
WRITEUINT8(save_p, len); // save size of string
|
||||
}
|
||||
else
|
||||
{
|
||||
WRITEUINT8(save_p, ARCH_LARGESTRING);
|
||||
WRITEUINT32(save_p, len); // save size of string
|
||||
}
|
||||
while (i < len)
|
||||
WRITECHAR(save_p, s[i++]); // write chars individually, including the embedded zeros
|
||||
break;
|
||||
|
@ -1010,16 +1034,8 @@ static UINT8 ArchiveValue(int TABLESINDEX, int myindex)
|
|||
if (!rover)
|
||||
WRITEUINT8(save_p, ARCH_NULL);
|
||||
else {
|
||||
ffloor_t *r2;
|
||||
UINT16 i = 0;
|
||||
// search for id
|
||||
for (r2 = rover->target->ffloors; r2; r2 = r2->next)
|
||||
{
|
||||
if (r2 == rover)
|
||||
break;
|
||||
i++;
|
||||
}
|
||||
if (!r2)
|
||||
UINT16 i = P_GetFFloorID(rover);
|
||||
if (i == UINT16_MAX) // invalid ID
|
||||
WRITEUINT8(save_p, ARCH_NULL);
|
||||
else
|
||||
{
|
||||
|
@ -1178,21 +1194,36 @@ static UINT8 UnArchiveValue(int TABLESINDEX)
|
|||
case ARCH_NULL:
|
||||
lua_pushnil(gL);
|
||||
break;
|
||||
case ARCH_BOOLEAN:
|
||||
lua_pushboolean(gL, READUINT8(save_p));
|
||||
case ARCH_TRUE:
|
||||
lua_pushboolean(gL, true);
|
||||
break;
|
||||
case ARCH_SIGNED:
|
||||
case ARCH_FALSE:
|
||||
lua_pushboolean(gL, false);
|
||||
break;
|
||||
case ARCH_INT8:
|
||||
lua_pushinteger(gL, READSINT8(save_p));
|
||||
break;
|
||||
case ARCH_INT16:
|
||||
lua_pushinteger(gL, READINT16(save_p));
|
||||
break;
|
||||
case ARCH_INT32:
|
||||
lua_pushinteger(gL, READFIXED(save_p));
|
||||
break;
|
||||
case ARCH_STRING:
|
||||
case ARCH_SMALLSTRING:
|
||||
case ARCH_LARGESTRING:
|
||||
{
|
||||
UINT16 len = READUINT16(save_p); // length of string, including embedded zeros
|
||||
UINT32 len;
|
||||
char *value;
|
||||
UINT16 i = 0;
|
||||
UINT32 i = 0;
|
||||
|
||||
// See my comments in the ArchiveValue function;
|
||||
// it's much the same for reading strings as writing them!
|
||||
// (i.e. we can't use READSTRING either)
|
||||
// -- Monster Iestyn 05/08/18
|
||||
if (type == ARCH_SMALLSTRING)
|
||||
len = READUINT8(save_p); // length of string, including embedded zeros
|
||||
else
|
||||
len = READUINT32(save_p); // length of string, including embedded zeros
|
||||
value = malloc(len); // make temp buffer of size len
|
||||
// now read the actual string
|
||||
while (i < len)
|
||||
|
|
11
src/m_menu.c
11
src/m_menu.c
|
@ -1583,7 +1583,7 @@ static menuitem_t OP_ServerOptionsMenu[] =
|
|||
{IT_HEADER, NULL, "General", NULL, 0},
|
||||
#ifndef NONET
|
||||
{IT_STRING | IT_CVAR | IT_CV_STRING,
|
||||
NULL, "Server name", &cv_servername, 7},
|
||||
NULL, "Server name", &cv_servername, 7},
|
||||
{IT_STRING | IT_CVAR, NULL, "Max Players", &cv_maxplayers, 21},
|
||||
{IT_STRING | IT_CVAR, NULL, "Allow Add-on Downloading", &cv_downloading, 26},
|
||||
{IT_STRING | IT_CVAR, NULL, "Allow players to join", &cv_allownewplayer, 31},
|
||||
|
@ -1628,8 +1628,9 @@ static menuitem_t OP_ServerOptionsMenu[] =
|
|||
|
||||
#ifndef NONET
|
||||
{IT_HEADER, NULL, "Advanced", NULL, 225},
|
||||
{IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "Master server", &cv_masterserver, 231},
|
||||
{IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 245},
|
||||
{IT_STRING | IT_CVAR | IT_CV_STRING, NULL, "Master server", &cv_masterserver, 231},
|
||||
{IT_STRING | IT_CVAR, NULL, "Join delay", &cv_joindelay, 246},
|
||||
{IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 251},
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -10822,7 +10823,8 @@ static void M_ServerOptions(INT32 choice)
|
|||
OP_ServerOptionsMenu[ 3].status = IT_GRAYEDOUT; // Allow add-on downloading
|
||||
OP_ServerOptionsMenu[ 4].status = IT_GRAYEDOUT; // Allow players to join
|
||||
OP_ServerOptionsMenu[35].status = IT_GRAYEDOUT; // Master server
|
||||
OP_ServerOptionsMenu[36].status = IT_GRAYEDOUT; // Attempts to resynchronise
|
||||
OP_ServerOptionsMenu[36].status = IT_GRAYEDOUT; // Minimum delay between joins
|
||||
OP_ServerOptionsMenu[37].status = IT_GRAYEDOUT; // Attempts to resynchronise
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -10834,6 +10836,7 @@ static void M_ServerOptions(INT32 choice)
|
|||
? IT_GRAYEDOUT
|
||||
: (IT_STRING | IT_CVAR | IT_CV_STRING));
|
||||
OP_ServerOptionsMenu[36].status = IT_STRING | IT_CVAR;
|
||||
OP_ServerOptionsMenu[37].status = IT_STRING | IT_CVAR;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -47,8 +47,7 @@ void T_MoveCeiling(ceiling_t *ceiling)
|
|||
case 0: // IN STASIS
|
||||
break;
|
||||
case 1: // UP
|
||||
res = T_MovePlane(ceiling->sector, ceiling->speed, ceiling->topheight, false,
|
||||
1, ceiling->direction);
|
||||
res = T_MovePlane(ceiling->sector, ceiling->speed, ceiling->topheight, false, true, ceiling->direction);
|
||||
|
||||
if (ceiling->type == bounceCeiling)
|
||||
{
|
||||
|
@ -159,8 +158,7 @@ void T_MoveCeiling(ceiling_t *ceiling)
|
|||
break;
|
||||
|
||||
case -1: // DOWN
|
||||
res = T_MovePlane(ceiling->sector, ceiling->speed, ceiling->bottomheight,
|
||||
ceiling->crush, 1, ceiling->direction);
|
||||
res = T_MovePlane(ceiling->sector, ceiling->speed, ceiling->bottomheight, ceiling->crush, true, ceiling->direction);
|
||||
|
||||
if (ceiling->type == bounceCeiling)
|
||||
{
|
||||
|
@ -314,11 +312,10 @@ void T_CrushCeiling(ceiling_t *ceiling)
|
|||
if (ceiling->type == crushBothOnce)
|
||||
{
|
||||
// Move the floor
|
||||
T_MovePlane(ceiling->sector, ceiling->speed, ceiling->bottomheight-(ceiling->topheight-ceiling->bottomheight), false, 0, -ceiling->direction);
|
||||
T_MovePlane(ceiling->sector, ceiling->speed, ceiling->bottomheight-(ceiling->topheight-ceiling->bottomheight), false, false, -ceiling->direction);
|
||||
}
|
||||
|
||||
res = T_MovePlane(ceiling->sector, ceiling->speed, ceiling->topheight,
|
||||
false, 1, ceiling->direction);
|
||||
res = T_MovePlane(ceiling->sector, ceiling->speed, ceiling->topheight, false, true, ceiling->direction);
|
||||
|
||||
if (res == pastdest)
|
||||
{
|
||||
|
@ -357,11 +354,10 @@ void T_CrushCeiling(ceiling_t *ceiling)
|
|||
if (ceiling->type == crushBothOnce)
|
||||
{
|
||||
// Move the floor
|
||||
T_MovePlane(ceiling->sector, ceiling->speed, ceiling->bottomheight, ceiling->crush, 0, -ceiling->direction);
|
||||
T_MovePlane(ceiling->sector, ceiling->speed, ceiling->bottomheight, ceiling->crush, false, -ceiling->direction);
|
||||
}
|
||||
|
||||
res = T_MovePlane(ceiling->sector, ceiling->speed, ceiling->bottomheight,
|
||||
ceiling->crush, 1, ceiling->direction);
|
||||
res = T_MovePlane(ceiling->sector, ceiling->speed, ceiling->bottomheight, ceiling->crush, true, ceiling->direction);
|
||||
|
||||
if (res == pastdest)
|
||||
{
|
||||
|
@ -399,7 +395,7 @@ INT32 EV_DoCeiling(line_t *line, ceiling_e type)
|
|||
sector_t *sec;
|
||||
ceiling_t *ceiling;
|
||||
|
||||
while ((secnum = P_FindSectorFromLineTag(line,secnum)) >= 0)
|
||||
while ((secnum = P_FindSectorFromTag(line->tag,secnum)) >= 0)
|
||||
{
|
||||
sec = §ors[secnum];
|
||||
|
||||
|
@ -619,7 +615,7 @@ INT32 EV_DoCrush(line_t *line, ceiling_e type)
|
|||
sector_t *sec;
|
||||
ceiling_t *ceiling;
|
||||
|
||||
while ((secnum = P_FindSectorFromLineTag(line,secnum)) >= 0)
|
||||
while ((secnum = P_FindSectorFromTag(line->tag,secnum)) >= 0)
|
||||
{
|
||||
sec = §ors[secnum];
|
||||
|
||||
|
|
114
src/p_enemy.c
114
src/p_enemy.c
|
@ -312,6 +312,7 @@ void A_RolloutRock(mobj_t *actor);
|
|||
void A_DragonbomberSpawn(mobj_t *actor);
|
||||
void A_DragonWing(mobj_t *actor);
|
||||
void A_DragonSegment(mobj_t *actor);
|
||||
void A_ChangeHeight(mobj_t *actor);
|
||||
|
||||
//for p_enemy.c
|
||||
|
||||
|
@ -2990,6 +2991,19 @@ void A_Boss1Laser(mobj_t *actor)
|
|||
angle_t angle;
|
||||
mobj_t *point;
|
||||
tic_t dur;
|
||||
static const UINT8 LASERCOLORS[] =
|
||||
{
|
||||
SKINCOLOR_SUPERRED3,
|
||||
SKINCOLOR_SUPERRED4,
|
||||
SKINCOLOR_SUPERRED5,
|
||||
SKINCOLOR_FLAME,
|
||||
SKINCOLOR_RED,
|
||||
SKINCOLOR_RED,
|
||||
SKINCOLOR_FLAME,
|
||||
SKINCOLOR_SUPERRED5,
|
||||
SKINCOLOR_SUPERRED4,
|
||||
SKINCOLOR_SUPERRED3,
|
||||
};
|
||||
|
||||
if (LUA_CallAction("A_Boss1Laser", actor))
|
||||
return;
|
||||
|
@ -3064,7 +3078,7 @@ void A_Boss1Laser(mobj_t *actor)
|
|||
point = P_SpawnMobj(x, y, z, locvar1);
|
||||
P_SetTarget(&point->target, actor);
|
||||
point->angle = actor->angle;
|
||||
speed = point->radius*2;
|
||||
speed = point->radius;
|
||||
point->momz = FixedMul(FINECOSINE(angle>>ANGLETOFINESHIFT), speed);
|
||||
point->momx = FixedMul(FINESINE(angle>>ANGLETOFINESHIFT), FixedMul(FINECOSINE(point->angle>>ANGLETOFINESHIFT), speed));
|
||||
point->momy = FixedMul(FINESINE(angle>>ANGLETOFINESHIFT), FixedMul(FINESINE(point->angle>>ANGLETOFINESHIFT), speed));
|
||||
|
@ -3073,23 +3087,69 @@ void A_Boss1Laser(mobj_t *actor)
|
|||
{
|
||||
mobj_t *mo = P_SpawnMobj(point->x, point->y, point->z, point->type);
|
||||
mo->angle = point->angle;
|
||||
mo->color = LASERCOLORS[((UINT8)(i + 3*dur) >> 2) % sizeof(LASERCOLORS)]; // codeing
|
||||
P_UnsetThingPosition(mo);
|
||||
mo->flags = MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY;
|
||||
mo->flags = MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY|MF_SCENERY;
|
||||
P_SetThingPosition(mo);
|
||||
|
||||
if (dur & 1 && mo->info->missilestate)
|
||||
{
|
||||
P_SetMobjState(mo, mo->info->missilestate);
|
||||
if (mo->info->meleestate)
|
||||
{
|
||||
mobj_t *mo2 = P_SpawnMobjFromMobj(mo, 0, 0, 0, MT_PARTICLE);
|
||||
mo2->flags2 |= MF2_LINKDRAW;
|
||||
P_SetTarget(&mo2->tracer, actor);
|
||||
P_SetMobjState(mo2, mo->info->meleestate);
|
||||
}
|
||||
}
|
||||
|
||||
if (dur == 1)
|
||||
P_SpawnGhostMobj(mo);
|
||||
|
||||
x = point->x, y = point->y, z = point->z;
|
||||
if (P_RailThinker(point))
|
||||
break;
|
||||
}
|
||||
|
||||
x += point->momx;
|
||||
y += point->momy;
|
||||
floorz = P_FloorzAtPos(x, y, z, mobjinfo[MT_EGGMOBILE_FIRE].height);
|
||||
if (z - floorz < mobjinfo[MT_EGGMOBILE_FIRE].height>>1)
|
||||
if (z - floorz < mobjinfo[MT_EGGMOBILE_FIRE].height>>1 && dur & 1)
|
||||
{
|
||||
point = P_SpawnMobj(x, y, floorz+1, MT_EGGMOBILE_FIRE);
|
||||
point = P_SpawnMobj(x, y, floorz, MT_EGGMOBILE_FIRE);
|
||||
point->angle = actor->angle;
|
||||
point->destscale = actor->scale;
|
||||
P_SetScale(point, point->destscale);
|
||||
P_SetTarget(&point->target, actor);
|
||||
point->destscale = 3*FRACUNIT;
|
||||
point->scalespeed = FRACUNIT>>2;
|
||||
point->fuse = TICRATE;
|
||||
P_MobjCheckWater(point);
|
||||
if (point->eflags & (MFE_UNDERWATER|MFE_TOUCHWATER))
|
||||
{
|
||||
for (i = 0; i < 2; i++)
|
||||
{
|
||||
UINT8 size = 3;
|
||||
mobj_t *steam = P_SpawnMobj(x, y, point->watertop - size*mobjinfo[MT_DUST].height, MT_DUST);
|
||||
P_SetScale(steam, size*actor->scale);
|
||||
P_SetObjectMomZ(steam, FRACUNIT + 2*P_RandomFixed(), true);
|
||||
P_InstaThrust(steam, FixedAngle(P_RandomKey(360)*FRACUNIT), 2*P_RandomFixed());
|
||||
if (point->info->painsound)
|
||||
S_StartSound(steam, point->info->painsound);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fixed_t distx = P_ReturnThrustX(point, point->angle, point->radius);
|
||||
fixed_t disty = P_ReturnThrustY(point, point->angle, point->radius);
|
||||
if (P_TryMove(point, point->x + distx, point->y + disty, false) // prevents the sprite from clipping into the wall or dangling off ledges
|
||||
&& P_TryMove(point, point->x - 2*distx, point->y - 2*disty, false)
|
||||
&& P_TryMove(point, point->x + distx, point->y + disty, false))
|
||||
{
|
||||
if (point->info->seesound)
|
||||
S_StartSound(point, point->info->seesound);
|
||||
}
|
||||
else
|
||||
P_RemoveMobj(point);
|
||||
}
|
||||
}
|
||||
|
||||
if (dur > 1)
|
||||
|
@ -14409,3 +14469,43 @@ void A_DragonSegment(mobj_t *actor)
|
|||
actor->angle = hangle;
|
||||
P_TeleportMove(actor, target->x + xdist, target->y + ydist, target->z + zdist);
|
||||
}
|
||||
|
||||
// Function: A_ChangeHeight
|
||||
//
|
||||
// Description: Changes the actor's height by var1
|
||||
//
|
||||
// var1 = height
|
||||
// var2 =
|
||||
// &1: height is absolute
|
||||
// &2: scale with actor's scale
|
||||
//
|
||||
void A_ChangeHeight(mobj_t *actor)
|
||||
{
|
||||
INT32 locvar1 = var1;
|
||||
INT32 locvar2 = var2;
|
||||
fixed_t height = locvar1;
|
||||
boolean reverse;
|
||||
|
||||
if (LUA_CallAction("A_ChangeHeight", actor))
|
||||
return;
|
||||
|
||||
reverse = (actor->eflags & MFE_VERTICALFLIP) || (actor->flags2 & MF2_OBJECTFLIP);
|
||||
|
||||
if (locvar2 & 2)
|
||||
height = FixedMul(height, actor->scale);
|
||||
|
||||
P_UnsetThingPosition(actor);
|
||||
if (locvar2 & 1)
|
||||
{
|
||||
if (reverse)
|
||||
actor->z += actor->height - locvar1;
|
||||
actor->height = locvar1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (reverse)
|
||||
actor->z -= locvar1;
|
||||
actor->height += locvar1;
|
||||
}
|
||||
P_SetThingPosition(actor);
|
||||
}
|
1591
src/p_floor.c
1591
src/p_floor.c
File diff suppressed because it is too large
Load diff
12
src/p_map.c
12
src/p_map.c
|
@ -2157,7 +2157,6 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
|||
|
||||
BMBOUNDFIX(xl, xh, yl, yh);
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// Check polyobjects and see if tmfloorz/tmceilingz need to be altered
|
||||
{
|
||||
validcount++;
|
||||
|
@ -2229,7 +2228,6 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// tmfloorthing is set when tmfloorz comes from a thing's top
|
||||
tmfloorthing = NULL;
|
||||
|
@ -2387,7 +2385,6 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
|
|||
|
||||
BMBOUNDFIX(xl, xh, yl, yh);
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// Check polyobjects and see if tmfloorz/tmceilingz need to be altered
|
||||
{
|
||||
validcount++;
|
||||
|
@ -2458,7 +2455,6 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// check lines
|
||||
for (bx = xl; bx <= xh; bx++)
|
||||
|
@ -4223,21 +4219,19 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush)
|
|||
{
|
||||
//If the thing was crushed by a crumbling FOF, reward the player who made it crumble!
|
||||
thinker_t *think;
|
||||
elevator_t *crumbler;
|
||||
crumble_t *crumbler;
|
||||
|
||||
for (think = thlist[THINK_MAIN].next; think != &thlist[THINK_MAIN]; think = think->next)
|
||||
{
|
||||
if (think->function.acp1 != (actionf_p1)T_StartCrumble)
|
||||
continue;
|
||||
|
||||
crumbler = (elevator_t *)think;
|
||||
crumbler = (crumble_t *)think;
|
||||
|
||||
if (crumbler->player && crumbler->player->mo
|
||||
&& crumbler->player->mo != thing
|
||||
&& crumbler->actionsector == thing->subsector->sector
|
||||
&& crumbler->sector == rover->master->frontsector
|
||||
&& (crumbler->type == elevateBounce
|
||||
|| crumbler->type == elevateContinuous))
|
||||
&& crumbler->sector == rover->master->frontsector)
|
||||
{
|
||||
killer = crumbler->player->mo;
|
||||
}
|
||||
|
|
164
src/p_maputl.c
164
src/p_maputl.c
|
@ -451,7 +451,6 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
I_Assert(back != NULL);
|
||||
|
||||
openfloorrover = openceilingrover = NULL;
|
||||
#ifdef POLYOBJECTS
|
||||
if (linedef->polyobj)
|
||||
{
|
||||
// set these defaults so that polyobjects don't interfere with collision above or below them
|
||||
|
@ -462,7 +461,6 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
opentopslope = openbottomslope = NULL;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{ // Set open and high/low values here
|
||||
fixed_t frontheight, backheight;
|
||||
|
||||
|
@ -517,7 +515,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
texheight = textures[texnum]->height << FRACBITS;
|
||||
|
||||
// Set texbottom and textop to the Z coordinates of the texture's boundaries
|
||||
#if 0 // #ifdef POLYOBJECTS
|
||||
#if 0
|
||||
// don't remove this code unless solid midtextures
|
||||
// on non-solid polyobjects should NEVER happen in the future
|
||||
if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT)) {
|
||||
|
@ -560,7 +558,6 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
}
|
||||
}
|
||||
}
|
||||
#ifdef POLYOBJECTS
|
||||
if (linedef->polyobj)
|
||||
{
|
||||
// Treat polyobj's backsector like a 3D Floor
|
||||
|
@ -597,94 +594,95 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
|
|||
// otherwise don't do anything special, pretend there's nothing else there
|
||||
}
|
||||
else
|
||||
#endif
|
||||
// Check for fake floors in the sector.
|
||||
if (front->ffloors || back->ffloors)
|
||||
{
|
||||
ffloor_t *rover;
|
||||
fixed_t delta1, delta2;
|
||||
|
||||
// Check for frontsector's fake floors
|
||||
for (rover = front->ffloors; rover; rover = rover->next)
|
||||
// Check for fake floors in the sector.
|
||||
if (front->ffloors || back->ffloors)
|
||||
{
|
||||
fixed_t topheight, bottomheight;
|
||||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
ffloor_t *rover;
|
||||
fixed_t delta1, delta2;
|
||||
|
||||
if (mobj->player && (P_CheckSolidLava(rover) || P_CanRunOnWater(mobj->player, rover)))
|
||||
;
|
||||
else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player)
|
||||
|| (rover->flags & FF_BLOCKOTHERS && !mobj->player)))
|
||||
continue;
|
||||
|
||||
topheight = P_GetFOFTopZ(mobj, front, rover, tmx, tmy, linedef);
|
||||
bottomheight = P_GetFOFBottomZ(mobj, front, rover, tmx, tmy, linedef);
|
||||
|
||||
delta1 = abs(mobj->z - (bottomheight + ((topheight - bottomheight)/2)));
|
||||
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
|
||||
|
||||
if (delta1 >= delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_PLATFORM) // thing is below FOF
|
||||
// Check for frontsector's fake floors
|
||||
for (rover = front->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (bottomheight < opentop) {
|
||||
opentop = bottomheight;
|
||||
opentopslope = *rover->b_slope;
|
||||
openceilingrover = rover;
|
||||
fixed_t topheight, bottomheight;
|
||||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
|
||||
if (mobj->player && (P_CheckSolidLava(rover) || P_CanRunOnWater(mobj->player, rover)))
|
||||
;
|
||||
else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player)
|
||||
|| (rover->flags & FF_BLOCKOTHERS && !mobj->player)))
|
||||
continue;
|
||||
|
||||
topheight = P_GetFOFTopZ(mobj, front, rover, tmx, tmy, linedef);
|
||||
bottomheight = P_GetFOFBottomZ(mobj, front, rover, tmx, tmy, linedef);
|
||||
|
||||
delta1 = abs(mobj->z - (bottomheight + ((topheight - bottomheight)/2)));
|
||||
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
|
||||
|
||||
if (delta1 >= delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_PLATFORM) // thing is below FOF
|
||||
{
|
||||
if (bottomheight < opentop) {
|
||||
opentop = bottomheight;
|
||||
opentopslope = *rover->b_slope;
|
||||
openceilingrover = rover;
|
||||
}
|
||||
else if (bottomheight < highceiling)
|
||||
highceiling = bottomheight;
|
||||
}
|
||||
|
||||
if (delta1 < delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_REVERSEPLATFORM) // thing is above FOF
|
||||
{
|
||||
if (topheight > openbottom) {
|
||||
openbottom = topheight;
|
||||
openbottomslope = *rover->t_slope;
|
||||
openfloorrover = rover;
|
||||
}
|
||||
else if (topheight > lowfloor)
|
||||
lowfloor = topheight;
|
||||
}
|
||||
else if (bottomheight < highceiling)
|
||||
highceiling = bottomheight;
|
||||
}
|
||||
|
||||
if (delta1 < delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_REVERSEPLATFORM) // thing is above FOF
|
||||
// Check for backsectors fake floors
|
||||
for (rover = back->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (topheight > openbottom) {
|
||||
openbottom = topheight;
|
||||
openbottomslope = *rover->t_slope;
|
||||
openfloorrover = rover;
|
||||
fixed_t topheight, bottomheight;
|
||||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
|
||||
if (mobj->player && (P_CheckSolidLava(rover) || P_CanRunOnWater(mobj->player, rover)))
|
||||
;
|
||||
else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player)
|
||||
|| (rover->flags & FF_BLOCKOTHERS && !mobj->player)))
|
||||
continue;
|
||||
|
||||
topheight = P_GetFOFTopZ(mobj, back, rover, tmx, tmy, linedef);
|
||||
bottomheight = P_GetFOFBottomZ(mobj, back, rover, tmx, tmy, linedef);
|
||||
|
||||
delta1 = abs(mobj->z - (bottomheight + ((topheight - bottomheight)/2)));
|
||||
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
|
||||
|
||||
if (delta1 >= delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_PLATFORM) // thing is below FOF
|
||||
{
|
||||
if (bottomheight < opentop) {
|
||||
opentop = bottomheight;
|
||||
opentopslope = *rover->b_slope;
|
||||
openceilingrover = rover;
|
||||
}
|
||||
else if (bottomheight < highceiling)
|
||||
highceiling = bottomheight;
|
||||
}
|
||||
else if (topheight > lowfloor)
|
||||
lowfloor = topheight;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for backsectors fake floors
|
||||
for (rover = back->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
fixed_t topheight, bottomheight;
|
||||
if (!(rover->flags & FF_EXISTS))
|
||||
continue;
|
||||
|
||||
if (mobj->player && (P_CheckSolidLava(rover) || P_CanRunOnWater(mobj->player, rover)))
|
||||
;
|
||||
else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player)
|
||||
|| (rover->flags & FF_BLOCKOTHERS && !mobj->player)))
|
||||
continue;
|
||||
|
||||
topheight = P_GetFOFTopZ(mobj, back, rover, tmx, tmy, linedef);
|
||||
bottomheight = P_GetFOFBottomZ(mobj, back, rover, tmx, tmy, linedef);
|
||||
|
||||
delta1 = abs(mobj->z - (bottomheight + ((topheight - bottomheight)/2)));
|
||||
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
|
||||
|
||||
if (delta1 >= delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_PLATFORM) // thing is below FOF
|
||||
{
|
||||
if (bottomheight < opentop) {
|
||||
opentop = bottomheight;
|
||||
opentopslope = *rover->b_slope;
|
||||
openceilingrover = rover;
|
||||
if (delta1 < delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_REVERSEPLATFORM) // thing is above FOF
|
||||
{
|
||||
if (topheight > openbottom) {
|
||||
openbottom = topheight;
|
||||
openbottomslope = *rover->t_slope;
|
||||
openfloorrover = rover;
|
||||
}
|
||||
else if (topheight > lowfloor)
|
||||
lowfloor = topheight;
|
||||
}
|
||||
else if (bottomheight < highceiling)
|
||||
highceiling = bottomheight;
|
||||
}
|
||||
|
||||
if (delta1 < delta2 && (rover->flags & FF_INTANGIBLEFLATS) != FF_REVERSEPLATFORM) // thing is above FOF
|
||||
{
|
||||
if (topheight > openbottom) {
|
||||
openbottom = topheight;
|
||||
openbottomslope = *rover->t_slope;
|
||||
openfloorrover = rover;
|
||||
}
|
||||
else if (topheight > lowfloor)
|
||||
lowfloor = topheight;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -934,9 +932,7 @@ boolean P_BlockLinesIterator(INT32 x, INT32 y, boolean (*func)(line_t *))
|
|||
{
|
||||
INT32 offset;
|
||||
const INT32 *list; // Big blockmap
|
||||
#ifdef POLYOBJECTS
|
||||
polymaplink_t *plink; // haleyjd 02/22/06
|
||||
#endif
|
||||
line_t *ld;
|
||||
|
||||
if (x < 0 || y < 0 || x >= bmapwidth || y >= bmapheight)
|
||||
|
@ -944,7 +940,6 @@ boolean P_BlockLinesIterator(INT32 x, INT32 y, boolean (*func)(line_t *))
|
|||
|
||||
offset = y*bmapwidth + x;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// haleyjd 02/22/06: consider polyobject lines
|
||||
plink = polyblocklinks[offset];
|
||||
|
||||
|
@ -968,7 +963,6 @@ boolean P_BlockLinesIterator(INT32 x, INT32 y, boolean (*func)(line_t *))
|
|||
}
|
||||
plink = (polymaplink_t *)(plink->link.next);
|
||||
}
|
||||
#endif
|
||||
|
||||
offset = *(blockmap + offset); // offset = blockmap[y*bmapwidth+x];
|
||||
|
||||
|
|
12
src/p_mobj.c
12
src/p_mobj.c
|
@ -1691,7 +1691,7 @@ static void P_PushableCheckBustables(mobj_t *mo)
|
|||
// Needs ML_EFFECT4 flag for pushables to break it
|
||||
if (!(rover->master->flags & ML_EFFECT4)) continue;
|
||||
|
||||
if (!rover->master->frontsector->crumblestate)
|
||||
if (rover->master->frontsector->crumblestate == CRUMBLE_NONE)
|
||||
{
|
||||
topheight = P_GetFOFTopZ(mo, node->m_sector, rover, mo->x, mo->y, NULL);
|
||||
bottomheight = P_GetFOFBottomZ(mo, node->m_sector, rover, mo->x, mo->y, NULL);
|
||||
|
@ -2895,7 +2895,6 @@ static void P_PlayerZMovement(mobj_t *mo)
|
|||
mo->eflags |= MFE_JUSTHITFLOOR; // Spin Attack
|
||||
|
||||
{
|
||||
#ifdef POLYOBJECTS
|
||||
// Check if we're on a polyobject
|
||||
// that triggers a linedef executor.
|
||||
msecnode_t *node;
|
||||
|
@ -2955,8 +2954,6 @@ static void P_PlayerZMovement(mobj_t *mo)
|
|||
}
|
||||
|
||||
if (!stopmovecut)
|
||||
#endif
|
||||
|
||||
// Cut momentum in half when you hit the ground and
|
||||
// aren't pressing any controls.
|
||||
if (!(mo->player->cmd.forwardmove || mo->player->cmd.sidemove) && !mo->player->cmomx && !mo->player->cmomy && !(mo->player->pflags & PF_SPINNING))
|
||||
|
@ -7059,8 +7056,7 @@ static void P_MobjScaleThink(mobj_t *mobj)
|
|||
fixed_t oldheight = mobj->height;
|
||||
UINT8 correctionType = 0; // Don't correct Z position, just gain height
|
||||
|
||||
if ((mobj->flags & MF_NOCLIPHEIGHT || (mobj->z > mobj->floorz && mobj->z + mobj->height < mobj->ceilingz))
|
||||
&& mobj->type != MT_EGGMOBILE_FIRE)
|
||||
if (mobj->flags & MF_NOCLIPHEIGHT || (mobj->z > mobj->floorz && mobj->z + mobj->height < mobj->ceilingz))
|
||||
correctionType = 1; // Correct Z position by centering
|
||||
else if (mobj->eflags & MFE_VERTICALFLIP)
|
||||
correctionType = 2; // Correct Z position by moving down
|
||||
|
@ -7081,10 +7077,6 @@ static void P_MobjScaleThink(mobj_t *mobj)
|
|||
/// \todo Lua hook for "reached destscale"?
|
||||
switch (mobj->type)
|
||||
{
|
||||
case MT_EGGMOBILE_FIRE:
|
||||
mobj->destscale = FRACUNIT;
|
||||
mobj->scalespeed = FRACUNIT>>4;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
527
src/p_polyobj.c
527
src/p_polyobj.c
File diff suppressed because it is too large
Load diff
|
@ -18,8 +18,6 @@
|
|||
#include "p_mobj.h"
|
||||
#include "r_defs.h"
|
||||
|
||||
// haleyjd: temporary define
|
||||
#ifdef POLYOBJECTS
|
||||
//
|
||||
// Defines
|
||||
//
|
||||
|
@ -31,7 +29,6 @@
|
|||
#define POLYOBJ_SPAWNCRUSH_DOOMEDNUM 762 // todo: REMOVE
|
||||
|
||||
#define POLYOBJ_START_LINE 20
|
||||
#define POLYOBJ_EXPLICIT_LINE 21
|
||||
#define POLYINFO_SPECIALNUM 22
|
||||
|
||||
typedef enum
|
||||
|
@ -301,6 +298,14 @@ typedef struct polyrotdisplacedata_s
|
|||
UINT8 turnobjs;
|
||||
} polyrotdisplacedata_t;
|
||||
|
||||
typedef struct polyflagdata_s
|
||||
{
|
||||
INT32 polyObjNum;
|
||||
INT32 speed;
|
||||
UINT32 angle;
|
||||
fixed_t momx;
|
||||
} polyflagdata_t;
|
||||
|
||||
typedef struct polyfadedata_s
|
||||
{
|
||||
INT32 polyObjNum;
|
||||
|
@ -322,7 +327,6 @@ boolean P_PointInsidePolyobj(polyobj_t *po, fixed_t x, fixed_t y);
|
|||
boolean P_MobjTouchingPolyobj(polyobj_t *po, mobj_t *mo);
|
||||
boolean P_MobjInsidePolyobj(polyobj_t *po, mobj_t *mo);
|
||||
boolean P_BBoxInsidePolyobj(polyobj_t *po, fixed_t *bbox);
|
||||
void Polyobj_GetInfo(INT16 poid, INT32 *poflags, INT32 *parentID, INT32 *potrans);
|
||||
|
||||
// thinkers (needed in p_saveg.c)
|
||||
void T_PolyObjRotate(polyrotate_t *);
|
||||
|
@ -335,14 +339,14 @@ void T_PolyObjRotDisplace (polyrotdisplace_t *);
|
|||
void T_PolyObjFlag (polymove_t *);
|
||||
void T_PolyObjFade (polyfade_t *);
|
||||
|
||||
INT32 EV_DoPolyDoor(polydoordata_t *);
|
||||
INT32 EV_DoPolyObjMove(polymovedata_t *);
|
||||
INT32 EV_DoPolyObjWaypoint(polywaypointdata_t *);
|
||||
INT32 EV_DoPolyObjRotate(polyrotdata_t *);
|
||||
INT32 EV_DoPolyObjDisplace(polydisplacedata_t *);
|
||||
INT32 EV_DoPolyObjRotDisplace(polyrotdisplacedata_t *);
|
||||
INT32 EV_DoPolyObjFlag(struct line_s *);
|
||||
INT32 EV_DoPolyObjFade(polyfadedata_t *);
|
||||
boolean EV_DoPolyDoor(polydoordata_t *);
|
||||
boolean EV_DoPolyObjMove(polymovedata_t *);
|
||||
boolean EV_DoPolyObjWaypoint(polywaypointdata_t *);
|
||||
boolean EV_DoPolyObjRotate(polyrotdata_t *);
|
||||
boolean EV_DoPolyObjDisplace(polydisplacedata_t *);
|
||||
boolean EV_DoPolyObjRotDisplace(polyrotdisplacedata_t *);
|
||||
boolean EV_DoPolyObjFlag(polyflagdata_t *);
|
||||
boolean EV_DoPolyObjFade(polyfadedata_t *);
|
||||
|
||||
|
||||
//
|
||||
|
@ -353,8 +357,6 @@ extern polyobj_t *PolyObjects;
|
|||
extern INT32 numPolyObjects;
|
||||
extern polymaplink_t **polyblocklinks; // polyobject blockmap
|
||||
|
||||
#endif // ifdef POLYOBJECTS
|
||||
|
||||
#endif
|
||||
|
||||
// EOF
|
||||
|
|
1300
src/p_saveg.c
1300
src/p_saveg.c
File diff suppressed because it is too large
Load diff
|
@ -218,6 +218,9 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
|
|||
mapheaderinfo[num]->typeoflevel = 0;
|
||||
mapheaderinfo[num]->nextlevel = (INT16)(i + 1);
|
||||
mapheaderinfo[num]->startrings = 0;
|
||||
mapheaderinfo[num]->sstimer = 90;
|
||||
mapheaderinfo[num]->ssspheres = 1;
|
||||
mapheaderinfo[num]->gravity = FRACUNIT/2;
|
||||
mapheaderinfo[num]->keywords[0] = '\0';
|
||||
snprintf(mapheaderinfo[num]->musname, 7, "%sM", G_BuildMapName(i));
|
||||
mapheaderinfo[num]->musname[6] = 0;
|
||||
|
@ -846,7 +849,7 @@ static void P_InitializeSector(sector_t *ss)
|
|||
ss->camsec = -1;
|
||||
|
||||
ss->floorlightsec = ss->ceilinglightsec = -1;
|
||||
ss->crumblestate = 0;
|
||||
ss->crumblestate = CRUMBLE_NONE;
|
||||
|
||||
ss->touching_thinglist = NULL;
|
||||
|
||||
|
@ -953,9 +956,7 @@ static void P_InitializeLinedef(line_t *ld)
|
|||
ld->splats = NULL;
|
||||
#endif
|
||||
ld->firsttag = ld->nexttag = -1;
|
||||
#ifdef POLYOBJECTS
|
||||
ld->polyobj = NULL;
|
||||
#endif
|
||||
|
||||
ld->text = NULL;
|
||||
ld->callcount = 0;
|
||||
|
@ -1869,10 +1870,8 @@ static void P_InitializeSeg(seg_t *seg)
|
|||
|
||||
seg->numlights = 0;
|
||||
seg->rlights = NULL;
|
||||
#ifdef POLYOBJECTS
|
||||
seg->polyseg = NULL;
|
||||
seg->dontrenderme = false;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void P_LoadSegs(UINT8 *data)
|
||||
|
@ -2235,11 +2234,9 @@ static boolean P_LoadBlockMap(UINT8 *data, size_t count)
|
|||
blocklinks = Z_Calloc(count, PU_LEVEL, NULL);
|
||||
blockmap = blockmaplump+4;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// haleyjd 2/22/06: setup polyobject blockmap
|
||||
count = sizeof(*polyblocklinks) * bmapwidth * bmapheight;
|
||||
polyblocklinks = Z_Calloc(count, PU_LEVEL, NULL);
|
||||
#endif
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -2490,11 +2487,9 @@ static void P_CreateBlockMap(void)
|
|||
blocklinks = Z_Calloc(count, PU_LEVEL, NULL);
|
||||
blockmap = blockmaplump + 4;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// haleyjd 2/22/06: setup polyobject blockmap
|
||||
count = sizeof(*polyblocklinks) * bmapwidth * bmapheight;
|
||||
polyblocklinks = Z_Calloc(count, PU_LEVEL, NULL);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -100,7 +100,6 @@ static fixed_t P_InterceptVector2(divline_t *v2, divline_t *v1)
|
|||
return frac;
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
static boolean P_CrossSubsecPolyObj(polyobj_t *po, register los_t *los)
|
||||
{
|
||||
size_t i;
|
||||
|
@ -169,7 +168,6 @@ static boolean P_CrossSubsecPolyObj(polyobj_t *po, register los_t *los)
|
|||
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// P_CrossSubsector
|
||||
|
@ -180,9 +178,7 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
|
|||
{
|
||||
seg_t *seg;
|
||||
INT32 count;
|
||||
#ifdef POLYOBJECTS
|
||||
polyobj_t *po; // haleyjd 02/23/06
|
||||
#endif
|
||||
|
||||
#ifdef RANGECHECK
|
||||
if (num >= numsubsectors)
|
||||
|
@ -192,7 +188,6 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
|
|||
// haleyjd 02/23/06: this assignment should be after the above check
|
||||
seg = segs + subsectors[num].firstline;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// haleyjd 02/23/06: check polyobject lines
|
||||
if ((po = subsectors[num].polyList))
|
||||
{
|
||||
|
@ -207,7 +202,6 @@ static boolean P_CrossSubsector(size_t num, register los_t *los)
|
|||
po = (polyobj_t *)(po->link.next);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
for (count = subsectors[num].numlines; --count >= 0; seg++) // check lines
|
||||
{
|
||||
|
@ -413,15 +407,10 @@ boolean P_CheckSight(mobj_t *t1, mobj_t *t2)
|
|||
|
||||
// killough 11/98: shortcut for melee situations
|
||||
// same subsector? obviously visible
|
||||
#ifndef POLYOBJECTS
|
||||
if (t1->subsector == t2->subsector)
|
||||
return true;
|
||||
#else
|
||||
// haleyjd 02/23/06: can't do this if there are polyobjects in the subsec
|
||||
if (!t1->subsector->polyList &&
|
||||
t1->subsector == t2->subsector)
|
||||
return true;
|
||||
#endif
|
||||
|
||||
// An unobstructed LOS is possible.
|
||||
// Now look from eyes of t1 to any part of t2.
|
||||
|
|
|
@ -566,7 +566,7 @@ void P_CopySectorSlope(line_t *line)
|
|||
int i, special = line->special;
|
||||
|
||||
// Check for copy linedefs
|
||||
for (i = -1; (i = P_FindSectorFromLineTag(line, i)) >= 0;)
|
||||
for (i = -1; (i = P_FindSectorFromTag(line->tag, i)) >= 0;)
|
||||
{
|
||||
sector_t *srcsec = sectors + i;
|
||||
|
||||
|
|
659
src/p_spec.c
659
src/p_spec.c
File diff suppressed because it is too large
Load diff
158
src/p_spec.h
158
src/p_spec.h
|
@ -55,7 +55,6 @@ fixed_t P_FindNextLowestFloor(sector_t *sec, fixed_t currentheight);
|
|||
fixed_t P_FindLowestCeilingSurrounding(sector_t *sec);
|
||||
fixed_t P_FindHighestCeilingSurrounding(sector_t *sec);
|
||||
|
||||
INT32 P_FindSectorFromLineTag(line_t *line, INT32 start);
|
||||
INT32 P_FindSectorFromTag(INT16 tag, INT32 start);
|
||||
INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start);
|
||||
|
||||
|
@ -74,6 +73,7 @@ void P_RunDeNightserizeExecutors(mobj_t *actor);
|
|||
void P_RunNightsLapExecutors(mobj_t *actor);
|
||||
void P_RunNightsCapsuleTouchExecutors(mobj_t *actor, boolean entering, boolean enoughspheres);
|
||||
|
||||
UINT16 P_GetFFloorID(ffloor_t *fflr);
|
||||
ffloor_t *P_GetFFloorByID(sector_t *sec, UINT16 id);
|
||||
|
||||
//
|
||||
|
@ -108,6 +108,7 @@ typedef struct
|
|||
sector_t *sector; ///< Sector in which the effect takes place.
|
||||
sector_t *sec;
|
||||
line_t *sourceline;
|
||||
UINT8 nobosses;
|
||||
} laserthink_t;
|
||||
|
||||
/** Strobe light action structure..
|
||||
|
@ -307,18 +308,130 @@ typedef struct
|
|||
fixed_t delaytimer;
|
||||
fixed_t floorwasheight; // Height the floor WAS at
|
||||
fixed_t ceilingwasheight; // Height the ceiling WAS at
|
||||
player_t *player; // Player who initiated the thinker (used for airbob)
|
||||
line_t *sourceline;
|
||||
} elevator_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CF_RETURN = 1, // Return after crumbling
|
||||
CF_FLOATBOB = 1<<1, // Float on water
|
||||
CF_REVERSE = 1<<2, // Reverse gravity
|
||||
} crumbleflag_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
thinker_t thinker;
|
||||
line_t *sourceline;
|
||||
sector_t *sector;
|
||||
sector_t *actionsector; // The sector the rover action is taking place in.
|
||||
player_t *player; // Player who initiated the thinker (used for airbob)
|
||||
INT32 direction;
|
||||
INT32 origalpha;
|
||||
INT32 timer;
|
||||
fixed_t speed;
|
||||
fixed_t floorwasheight; // Height the floor WAS at
|
||||
fixed_t ceilingwasheight; // Height the ceiling WAS at
|
||||
UINT8 flags;
|
||||
} crumble_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
thinker_t thinker;
|
||||
fixed_t vars[16]; // Misc. variables
|
||||
fixed_t var2s[16]; // Second misc variables buffer.
|
||||
line_t *sourceline; // Source line of the thinker
|
||||
sector_t *sector; // Sector the thinker is from
|
||||
} levelspecthink_t;
|
||||
} noenemies_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
thinker_t thinker;
|
||||
sector_t *sector;
|
||||
fixed_t speed;
|
||||
INT32 direction;
|
||||
fixed_t floorstartheight;
|
||||
fixed_t ceilingstartheight;
|
||||
fixed_t destheight;
|
||||
} continuousfall_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
thinker_t thinker;
|
||||
line_t *sourceline;
|
||||
sector_t *sector;
|
||||
fixed_t speed;
|
||||
fixed_t distance;
|
||||
fixed_t floorwasheight;
|
||||
fixed_t ceilingwasheight;
|
||||
boolean low;
|
||||
} bouncecheese_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
thinker_t thinker;
|
||||
sector_t *sector;
|
||||
fixed_t speed;
|
||||
INT32 direction;
|
||||
fixed_t floorstartheight;
|
||||
fixed_t ceilingstartheight;
|
||||
INT16 tag;
|
||||
} mariothink_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
thinker_t thinker;
|
||||
line_t *sourceline;
|
||||
sector_t *sector;
|
||||
} mariocheck_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
thinker_t thinker;
|
||||
line_t *sourceline;
|
||||
sector_t *sector;
|
||||
fixed_t crushspeed;
|
||||
fixed_t retractspeed;
|
||||
INT32 direction;
|
||||
fixed_t floorstartheight;
|
||||
fixed_t ceilingstartheight;
|
||||
INT32 delay;
|
||||
INT16 tag;
|
||||
UINT16 sound;
|
||||
} thwomp_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
thinker_t thinker;
|
||||
line_t *sourceline;
|
||||
sector_t *sector;
|
||||
INT16 tag;
|
||||
} floatthink_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
thinker_t thinker;
|
||||
line_t *sourceline; // Source line of the thinker
|
||||
boolean playersInArea[MAXPLAYERS];
|
||||
boolean playersOnArea[MAXPLAYERS];
|
||||
boolean triggerOnExit;
|
||||
} eachtime_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
RF_REVERSE = 1, //Lower when stood on
|
||||
RF_SPINDASH = 1<<1, //Require spindash to move
|
||||
RF_DYNAMIC = 1<<2, //Dynamically sinking platform
|
||||
} raiseflag_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
thinker_t thinker;
|
||||
INT16 tag;
|
||||
sector_t *sector;
|
||||
fixed_t ceilingbottom;
|
||||
fixed_t ceilingtop;
|
||||
fixed_t basespeed;
|
||||
fixed_t extraspeed; //For dynamically sinking platform
|
||||
UINT8 shaketimer; //For dynamically sinking platform
|
||||
UINT8 flags;
|
||||
} raise_t;
|
||||
|
||||
#define ELEVATORSPEED (FRACUNIT*4)
|
||||
#define FLOORSPEED (FRACUNIT)
|
||||
|
@ -331,35 +444,34 @@ typedef enum
|
|||
} result_e;
|
||||
|
||||
result_e T_MovePlane(sector_t *sector, fixed_t speed, fixed_t dest, boolean crush,
|
||||
INT32 floorOrCeiling, INT32 direction);
|
||||
INT32 EV_DoFloor(line_t *line, floor_e floortype);
|
||||
INT32 EV_DoElevator(line_t *line, elevator_e elevtype, boolean customspeed);
|
||||
boolean ceiling, INT32 direction);
|
||||
void EV_DoFloor(line_t *line, floor_e floortype);
|
||||
void EV_DoElevator(line_t *line, elevator_e elevtype, boolean customspeed);
|
||||
void EV_CrumbleChain(sector_t *sec, ffloor_t *rover);
|
||||
INT32 EV_BounceSector(sector_t *sector, fixed_t momz, line_t *sourceline);
|
||||
void EV_BounceSector(sector_t *sector, fixed_t momz, line_t *sourceline);
|
||||
|
||||
// Some other special 3dfloor types
|
||||
INT32 EV_StartCrumble(sector_t *sector, ffloor_t *rover,
|
||||
boolean floating, player_t *player, fixed_t origalpha, boolean crumblereturn);
|
||||
|
||||
INT32 EV_DoContinuousFall(sector_t *sec, sector_t *pbacksector, fixed_t spd, boolean backwards);
|
||||
void EV_DoContinuousFall(sector_t *sec, sector_t *backsector, fixed_t spd, boolean backwards);
|
||||
|
||||
INT32 EV_MarioBlock(ffloor_t *rover, sector_t *sector, mobj_t *puncher);
|
||||
void EV_MarioBlock(ffloor_t *rover, sector_t *sector, mobj_t *puncher);
|
||||
|
||||
void T_MoveFloor(floormove_t *movefloor);
|
||||
|
||||
void T_MoveElevator(elevator_t *elevator);
|
||||
void T_ContinuousFalling(levelspecthink_t *faller);
|
||||
void T_BounceCheese(levelspecthink_t *bouncer);
|
||||
void T_StartCrumble(elevator_t *elevator);
|
||||
void T_MarioBlock(levelspecthink_t *block);
|
||||
void T_SpikeSector(levelspecthink_t *spikes);
|
||||
void T_FloatSector(levelspecthink_t *floater);
|
||||
void T_MarioBlockChecker(levelspecthink_t *block);
|
||||
void T_ThwompSector(levelspecthink_t *thwomp);
|
||||
void T_NoEnemiesSector(levelspecthink_t *nobaddies);
|
||||
void T_EachTimeThinker(levelspecthink_t *eachtime);
|
||||
void T_ContinuousFalling(continuousfall_t *faller);
|
||||
void T_BounceCheese(bouncecheese_t *bouncer);
|
||||
void T_StartCrumble(crumble_t *crumble);
|
||||
void T_MarioBlock(mariothink_t *block);
|
||||
void T_FloatSector(floatthink_t *floater);
|
||||
void T_MarioBlockChecker(mariocheck_t *block);
|
||||
void T_ThwompSector(thwomp_t *thwomp);
|
||||
void T_NoEnemiesSector(noenemies_t *nobaddies);
|
||||
void T_EachTimeThinker(eachtime_t *eachtime);
|
||||
void T_CameraScanner(elevator_t *elevator);
|
||||
void T_RaiseSector(levelspecthink_t *sraise);
|
||||
void T_RaiseSector(raise_t *raise);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
|
53
src/p_user.c
53
src/p_user.c
|
@ -2566,7 +2566,7 @@ static void P_CheckBustableBlocks(player_t *player)
|
|||
{
|
||||
if (!(rover->flags & FF_EXISTS)) continue;
|
||||
|
||||
if ((rover->flags & FF_BUSTUP)/* && !rover->master->frontsector->crumblestate*/)
|
||||
if ((rover->flags & FF_BUSTUP)/* && rover->master->frontsector->crumblestate == CRUMBLE_NONE*/)
|
||||
{
|
||||
// If it's an FF_SHATTER, you can break it just by touching it.
|
||||
if (rover->flags & FF_SHATTER)
|
||||
|
@ -3847,7 +3847,6 @@ static void P_DoTeeter(player_t *player)
|
|||
BMBOUNDFIX(xl, xh, yl, yh);
|
||||
|
||||
// Polyobjects
|
||||
#ifdef POLYOBJECTS
|
||||
validcount++;
|
||||
|
||||
for (by = yl; by <= yh; by++)
|
||||
|
@ -3941,7 +3940,6 @@ static void P_DoTeeter(player_t *player)
|
|||
plink = (polymaplink_t *)(plink->link.next);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
if (teeter) // only bother with objects as a last resort if you were already teetering
|
||||
{
|
||||
mobj_t *oldtmthing = tmthing;
|
||||
|
@ -5006,6 +5004,15 @@ void P_Telekinesis(player_t *player, fixed_t thrust, fixed_t range)
|
|||
player->pflags |= PF_THOKKED;
|
||||
}
|
||||
|
||||
static void P_DoTwinSpin(player_t *player)
|
||||
{
|
||||
player->pflags &= ~PF_NOJUMPDAMAGE;
|
||||
player->pflags |= P_GetJumpFlags(player) | PF_THOKKED;
|
||||
S_StartSound(player->mo, sfx_s3k42);
|
||||
player->mo->frame = 0;
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_TWINSPIN);
|
||||
}
|
||||
|
||||
//
|
||||
// P_DoJumpStuff
|
||||
//
|
||||
|
@ -5176,12 +5183,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
|
|||
break;
|
||||
case CA_TWINSPIN:
|
||||
if ((player->charability2 == CA2_MELEE) && (!(player->pflags & (PF_THOKKED|PF_USEDOWN)) || player->charflags & SF_MULTIABILITY))
|
||||
{
|
||||
player->pflags |= PF_THOKKED;
|
||||
S_StartSound(player->mo, sfx_s3k42);
|
||||
player->mo->frame = 0;
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_TWINSPIN);
|
||||
}
|
||||
P_DoTwinSpin(player);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -5438,12 +5440,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd)
|
|||
break;
|
||||
case CA_TWINSPIN:
|
||||
if (!(player->pflags & PF_THOKKED) || player->charflags & SF_MULTIABILITY)
|
||||
{
|
||||
player->pflags |= PF_THOKKED;
|
||||
S_StartSound(player->mo, sfx_s3k42);
|
||||
player->mo->frame = 0;
|
||||
P_SetPlayerMobjState(player->mo, S_PLAY_TWINSPIN);
|
||||
}
|
||||
P_DoTwinSpin(player);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
@ -5702,11 +5699,7 @@ static void P_2dMovement(player_t *player)
|
|||
}
|
||||
else if (player->onconveyor == 4 && !P_IsObjectOnGround(player->mo)) // Actual conveyor belt
|
||||
player->cmomx = player->cmomy = 0;
|
||||
else if (player->onconveyor != 2 && player->onconveyor != 4
|
||||
#ifdef POLYOBJECTS
|
||||
&& player->onconveyor != 1
|
||||
#endif
|
||||
)
|
||||
else if (player->onconveyor != 2 && player->onconveyor != 4 && player->onconveyor != 1)
|
||||
player->cmomx = player->cmomy = 0;
|
||||
|
||||
player->rmomx = player->mo->momx - player->cmomx;
|
||||
|
@ -5901,11 +5894,7 @@ static void P_3dMovement(player_t *player)
|
|||
}
|
||||
else if (player->onconveyor == 4 && !P_IsObjectOnGround(player->mo)) // Actual conveyor belt
|
||||
player->cmomx = player->cmomy = 0;
|
||||
else if (player->onconveyor != 2 && player->onconveyor != 4
|
||||
#ifdef POLYOBJECTS
|
||||
&& player->onconveyor != 1
|
||||
#endif
|
||||
)
|
||||
else if (player->onconveyor != 2 && player->onconveyor != 4 && player->onconveyor != 1)
|
||||
player->cmomx = player->cmomy = 0;
|
||||
|
||||
player->rmomx = player->mo->momx - player->cmomx;
|
||||
|
@ -10235,7 +10224,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// Check polyobjects and see if floorz/ceilingz need to be altered
|
||||
{
|
||||
INT32 xl, xh, yl, yh, bx, by;
|
||||
|
@ -10314,7 +10302,6 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
|||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// crushed camera
|
||||
if (myceilingz <= myfloorz + thiscam->height && !resetcalled && !cameranoclip)
|
||||
|
@ -11725,10 +11712,8 @@ void P_PlayerThink(player_t *player)
|
|||
P_MobjCheckWater(player->mo);
|
||||
|
||||
#ifndef SECTORSPECIALSAFTERTHINK
|
||||
#ifdef POLYOBJECTS
|
||||
if (player->onconveyor != 1 || !P_IsObjectOnGround(player->mo))
|
||||
#endif
|
||||
player->onconveyor = 0;
|
||||
player->onconveyor = 0;
|
||||
// check special sectors : damage & secrets
|
||||
|
||||
if (!player->spectator)
|
||||
|
@ -12086,12 +12071,10 @@ void P_PlayerThink(player_t *player)
|
|||
// it lasts for one tic.
|
||||
player->pflags &= ~PF_FULLSTASIS;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
if (player->onconveyor == 1)
|
||||
player->onconveyor = 3;
|
||||
else if (player->onconveyor == 3)
|
||||
player->cmomy = player->cmomx = 0;
|
||||
#endif
|
||||
|
||||
P_DoSuperStuff(player);
|
||||
P_CheckSneakerAndLivesTimer(player);
|
||||
|
@ -12213,7 +12196,7 @@ void P_PlayerThink(player_t *player)
|
|||
player->powers[pw_nocontrol]--;
|
||||
else
|
||||
player->powers[pw_nocontrol] = 0;
|
||||
|
||||
|
||||
//pw_super acts as a timer now
|
||||
if (player->powers[pw_super]
|
||||
&& (player->mo->state < &states[S_PLAY_SUPER_TRANS1]
|
||||
|
@ -12424,10 +12407,8 @@ void P_PlayerAfterThink(player_t *player)
|
|||
cmd = &player->cmd;
|
||||
|
||||
#ifdef SECTORSPECIALSAFTERTHINK
|
||||
#ifdef POLYOBJECTS
|
||||
if (player->onconveyor != 1 || !P_IsObjectOnGround(player->mo))
|
||||
#endif
|
||||
player->onconveyor = 0;
|
||||
player->onconveyor = 0;
|
||||
// check special sectors : damage & secrets
|
||||
|
||||
if (!player->spectator)
|
||||
|
|
52
src/r_bsp.c
52
src/r_bsp.c
|
@ -354,9 +354,7 @@ sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel,
|
|||
boolean R_IsEmptyLine(seg_t *line, sector_t *front, sector_t *back)
|
||||
{
|
||||
return (
|
||||
#ifdef POLYOBJECTS
|
||||
!line->polyseg &&
|
||||
#endif
|
||||
back->ceilingpic == front->ceilingpic
|
||||
&& back->floorpic == front->floorpic
|
||||
&& back->f_slope == front->f_slope
|
||||
|
@ -482,13 +480,10 @@ static void R_AddLine(seg_t *line)
|
|||
|
||||
if (bothceilingssky && bothfloorssky) // everything's sky? let's save us a bit of time then
|
||||
{
|
||||
if (
|
||||
#ifdef POLYOBJECTS
|
||||
!line->polyseg &&
|
||||
#endif
|
||||
!line->sidedef->midtexture
|
||||
&& ((!frontsector->ffloors && !backsector->ffloors)
|
||||
|| (frontsector->tag == backsector->tag)))
|
||||
if (!line->polyseg &&
|
||||
!line->sidedef->midtexture
|
||||
&& ((!frontsector->ffloors && !backsector->ffloors)
|
||||
|| (frontsector->tag == backsector->tag)))
|
||||
return; // line is empty, don't even bother
|
||||
|
||||
goto clippass; // treat like wide open window instead
|
||||
|
@ -654,8 +649,6 @@ static boolean R_CheckBBox(const fixed_t *bspcoord)
|
|||
return true;
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
|
||||
size_t numpolys; // number of polyobjects in current subsector
|
||||
size_t num_po_ptrs; // number of polyobject pointers allocated
|
||||
polyobj_t **po_ptrs; // temp ptr array to sort polyobject pointers
|
||||
|
@ -819,7 +812,6 @@ static void R_AddPolyObjects(subsector_t *sub)
|
|||
R_AddLine(po_ptrs[i]->segs[j]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// R_Subsector
|
||||
|
@ -896,11 +888,7 @@ static void R_Subsector(size_t num)
|
|||
|| (frontsector->heightsec != -1 && sectors[frontsector->heightsec].ceilingpic == skyflatnum))
|
||||
{
|
||||
floorplane = R_FindPlane(frontsector->floorheight, frontsector->floorpic, floorlightlevel,
|
||||
frontsector->floor_xoffs, frontsector->floor_yoffs, frontsector->floorpic_angle, floorcolormap, NULL
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
, NULL
|
||||
#endif
|
||||
, frontsector->f_slope);
|
||||
frontsector->floor_xoffs, frontsector->floor_yoffs, frontsector->floorpic_angle, floorcolormap, NULL, NULL, frontsector->f_slope);
|
||||
}
|
||||
else
|
||||
floorplane = NULL;
|
||||
|
@ -911,11 +899,7 @@ static void R_Subsector(size_t num)
|
|||
{
|
||||
ceilingplane = R_FindPlane(frontsector->ceilingheight, frontsector->ceilingpic,
|
||||
ceilinglightlevel, frontsector->ceiling_xoffs, frontsector->ceiling_yoffs, frontsector->ceilingpic_angle,
|
||||
ceilingcolormap, NULL
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
, NULL
|
||||
#endif
|
||||
, frontsector->c_slope);
|
||||
ceilingcolormap, NULL, NULL, frontsector->c_slope);
|
||||
}
|
||||
else
|
||||
ceilingplane = NULL;
|
||||
|
@ -963,11 +947,7 @@ static void R_Subsector(size_t num)
|
|||
|
||||
ffloor[numffloors].plane = R_FindPlane(*rover->bottomheight, *rover->bottompic,
|
||||
*frontsector->lightlist[light].lightlevel, *rover->bottomxoffs,
|
||||
*rover->bottomyoffs, *rover->bottomangle, *frontsector->lightlist[light].extra_colormap, rover
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
, NULL
|
||||
#endif
|
||||
, *rover->b_slope);
|
||||
*rover->bottomyoffs, *rover->bottomangle, *frontsector->lightlist[light].extra_colormap, rover, NULL, *rover->b_slope);
|
||||
|
||||
ffloor[numffloors].slope = *rover->b_slope;
|
||||
|
||||
|
@ -1000,11 +980,7 @@ static void R_Subsector(size_t num)
|
|||
|
||||
ffloor[numffloors].plane = R_FindPlane(*rover->topheight, *rover->toppic,
|
||||
*frontsector->lightlist[light].lightlevel, *rover->topxoffs, *rover->topyoffs, *rover->topangle,
|
||||
*frontsector->lightlist[light].extra_colormap, rover
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
, NULL
|
||||
#endif
|
||||
, *rover->t_slope);
|
||||
*frontsector->lightlist[light].extra_colormap, rover, NULL, *rover->t_slope);
|
||||
|
||||
ffloor[numffloors].slope = *rover->t_slope;
|
||||
|
||||
|
@ -1019,7 +995,6 @@ static void R_Subsector(size_t num)
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
// Polyobjects have planes, too!
|
||||
if (sub->polyList)
|
||||
{
|
||||
|
@ -1085,7 +1060,6 @@ static void R_Subsector(size_t num)
|
|||
po = (polyobj_t *)(po->link.next);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FLOORSPLATS
|
||||
if (sub->splats)
|
||||
|
@ -1108,21 +1082,15 @@ static void R_Subsector(size_t num)
|
|||
|
||||
firstseg = NULL;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
// haleyjd 02/19/06: draw polyobjects before static lines
|
||||
if (sub->polyList)
|
||||
R_AddPolyObjects(sub);
|
||||
#endif
|
||||
|
||||
while (count--)
|
||||
{
|
||||
// CONS_Debug(DBG_GAMELOGIC, "Adding normal line %d...(%d)\n", line->linedef-lines, leveltime);
|
||||
if (!line->glseg
|
||||
#ifdef POLYOBJECTS
|
||||
&& !line->polyseg // ignore segs that belong to polyobjects
|
||||
#endif
|
||||
)
|
||||
R_AddLine(line);
|
||||
if (!line->glseg && !line->polyseg) // ignore segs that belong to polyobjects
|
||||
R_AddLine(line);
|
||||
line++;
|
||||
curline = NULL; /* cph 2001/11/18 - must clear curline now we're done with it, so stuff doesn't try using it for other things */
|
||||
}
|
||||
|
|
|
@ -40,13 +40,11 @@ void R_PortalClearClipSegs(INT32 start, INT32 end);
|
|||
void R_ClearDrawSegs(void);
|
||||
void R_RenderBSPNode(INT32 bspnum);
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
void R_SortPolyObjects(subsector_t *sub);
|
||||
|
||||
extern size_t numpolys; // number of polyobjects in current subsector
|
||||
extern size_t num_po_ptrs; // number of polyobject pointers allocated
|
||||
extern polyobj_t **po_ptrs; // temp ptr array to sort polyobject pointers
|
||||
#endif
|
||||
|
||||
sector_t *R_FakeFlat(sector_t *sec, sector_t *tempsec, INT32 *floorlightlevel,
|
||||
INT32 *ceilinglightlevel, boolean back);
|
||||
|
|
20
src/r_defs.h
20
src/r_defs.h
|
@ -28,8 +28,6 @@
|
|||
#include "m_aatree.h"
|
||||
#endif
|
||||
|
||||
#define POLYOBJECTS
|
||||
|
||||
//
|
||||
// ClipWallSegment
|
||||
// Clips the given range of columns
|
||||
|
@ -107,9 +105,7 @@ typedef struct
|
|||
fixed_t z; ///< Z coordinate.
|
||||
} degenmobj_t;
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
#include "p_polyobj.h"
|
||||
#endif
|
||||
|
||||
// Store fake planes in a resizable array insted of just by
|
||||
// heightsec. Allows for multiple fake planes.
|
||||
|
@ -277,6 +273,16 @@ typedef enum
|
|||
SF_INVERTPRECIP = 1<<4,
|
||||
} sectorflags_t;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CRUMBLE_NONE, // No crumble thinker
|
||||
CRUMBLE_WAIT, // Don't float on water because this is supposed to wait for a crumble
|
||||
CRUMBLE_ACTIVATED, // Crumble thinker activated, but hasn't fallen yet
|
||||
CRUMBLE_FALL, // Crumble thinker is falling
|
||||
CRUMBLE_RESTORE, // Crumble thinker is about to restore to original position
|
||||
} crumblestate_t;
|
||||
|
||||
//
|
||||
// The SECTORS record, at runtime.
|
||||
// Stores things/mobjs.
|
||||
|
@ -424,9 +430,7 @@ typedef struct line_s
|
|||
void *splats; // wallsplat_t list
|
||||
#endif
|
||||
INT32 firsttag, nexttag; // improves searches for tags.
|
||||
#ifdef POLYOBJECTS
|
||||
polyobj_t *polyobj; // Belongs to a polyobject?
|
||||
#endif
|
||||
|
||||
char *text; // a concatenation of all front and back texture names, for linedef specials that require a string.
|
||||
INT16 callcount; // no. of calls left before triggering, for the "X calls" linedef specials, defaults to 0
|
||||
|
@ -469,9 +473,7 @@ typedef struct subsector_s
|
|||
sector_t *sector;
|
||||
INT16 numlines;
|
||||
UINT16 firstline;
|
||||
#ifdef POLYOBJECTS
|
||||
struct polyobj_s *polyList; // haleyjd 02/19/06: list of polyobjects
|
||||
#endif
|
||||
#if 1//#ifdef FLOORSPLATS
|
||||
void *splats; // floorsplat_t list
|
||||
#endif
|
||||
|
@ -574,10 +576,8 @@ typedef struct seg_s
|
|||
// Why slow things down by calculating lightlists for every thick side?
|
||||
size_t numlights;
|
||||
r_lightlist_t *rlights;
|
||||
#ifdef POLYOBJECTS
|
||||
polyobj_t *polyseg;
|
||||
boolean dontrenderme;
|
||||
#endif
|
||||
boolean glseg;
|
||||
} seg_t;
|
||||
|
||||
|
|
|
@ -1231,9 +1231,9 @@ void R_CacheRotSprite(spritenum_t sprnum, UINT8 frame, spriteinfo_t *sprinfo, sp
|
|||
if (!R_CheckIfPatch(lump))
|
||||
return;
|
||||
|
||||
width = patch->width;
|
||||
height = patch->height;
|
||||
leftoffset = patch->leftoffset;
|
||||
width = SHORT(patch->width);
|
||||
height = SHORT(patch->height);
|
||||
leftoffset = SHORT(patch->leftoffset);
|
||||
|
||||
// rotation pivot
|
||||
px = SPRITE_XCENTER;
|
||||
|
@ -1348,7 +1348,7 @@ void R_CacheRotSprite(spritenum_t sprnum, UINT8 frame, spriteinfo_t *sprinfo, sp
|
|||
newpatch = R_MaskedFlatToPatch(rawdst, newwidth, newheight, 0, 0, &size);
|
||||
{
|
||||
newpatch->leftoffset = (newpatch->width / 2) + (leftoffset - px);
|
||||
newpatch->topoffset = (newpatch->height / 2) + (patch->topoffset - py);
|
||||
newpatch->topoffset = (newpatch->height / 2) + (SHORT(patch->topoffset) - py);
|
||||
}
|
||||
|
||||
//BP: we cannot use special tric in hardware mode because feet in ground caused by z-buffer
|
||||
|
@ -1358,6 +1358,12 @@ void R_CacheRotSprite(spritenum_t sprnum, UINT8 frame, spriteinfo_t *sprinfo, sp
|
|||
// P_PrecacheLevel
|
||||
if (devparm) spritememory += size;
|
||||
|
||||
// convert everything to little-endian, for big-endian support
|
||||
newpatch->width = SHORT(newpatch->width);
|
||||
newpatch->height = SHORT(newpatch->height);
|
||||
newpatch->leftoffset = SHORT(newpatch->leftoffset);
|
||||
newpatch->topoffset = SHORT(newpatch->topoffset);
|
||||
|
||||
#ifdef HWRENDER
|
||||
if (rendermode == render_opengl)
|
||||
{
|
||||
|
|
178
src/r_plane.c
178
src/r_plane.c
|
@ -337,11 +337,7 @@ static visplane_t *new_visplane(unsigned hash)
|
|||
//
|
||||
visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
||||
fixed_t xoff, fixed_t yoff, angle_t plangle, extracolormap_t *planecolormap,
|
||||
ffloor_t *pfloor
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
, polyobj_t *polyobj
|
||||
#endif
|
||||
, pslope_t *slope)
|
||||
ffloor_t *pfloor, polyobj_t *polyobj, pslope_t *slope)
|
||||
{
|
||||
visplane_t *check;
|
||||
unsigned hash;
|
||||
|
@ -361,7 +357,6 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
if (polyobj)
|
||||
{
|
||||
if (polyobj->angle != 0)
|
||||
|
@ -376,7 +371,6 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
|||
yoff += polyobj->centerPt.y;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// This appears to fix the Nimbus Ruins sky bug.
|
||||
if (picnum == skyflatnum && pfloor)
|
||||
|
@ -390,12 +384,10 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
|||
|
||||
for (check = visplanes[hash]; check; check = check->next)
|
||||
{
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
if (check->polyobj && pfloor)
|
||||
continue;
|
||||
if (polyobj != check->polyobj)
|
||||
continue;
|
||||
#endif
|
||||
if (height == check->height && picnum == check->picnum
|
||||
&& lightlevel == check->lightlevel
|
||||
&& xoff == check->xoffs && yoff == check->yoffs
|
||||
|
@ -426,9 +418,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel,
|
|||
check->viewz = viewz;
|
||||
check->viewangle = viewangle;
|
||||
check->plangle = plangle;
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
check->polyobj = polyobj;
|
||||
#endif
|
||||
check->slope = slope;
|
||||
|
||||
memset(check->top, 0xff, sizeof (check->top));
|
||||
|
@ -496,9 +486,7 @@ visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop)
|
|||
new_pl->viewz = pl->viewz;
|
||||
new_pl->viewangle = pl->viewangle;
|
||||
new_pl->plangle = pl->plangle;
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
new_pl->polyobj = pl->polyobj;
|
||||
#endif
|
||||
new_pl->slope = pl->slope;
|
||||
pl = new_pl;
|
||||
pl->minx = start;
|
||||
|
@ -523,11 +511,9 @@ void R_ExpandPlane(visplane_t *pl, INT32 start, INT32 stop)
|
|||
// INT32 unionl, unionh;
|
||||
// INT32 x;
|
||||
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
// Don't expand polyobject planes here - we do that on our own.
|
||||
if (pl->polyobj)
|
||||
return;
|
||||
#endif
|
||||
|
||||
if (pl->minx > start) pl->minx = start;
|
||||
if (pl->maxx < stop) pl->maxx = stop;
|
||||
|
@ -603,11 +589,7 @@ void R_DrawPlanes(void)
|
|||
{
|
||||
for (pl = visplanes[i]; pl; pl = pl->next)
|
||||
{
|
||||
if (pl->ffloor != NULL
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
|| pl->polyobj != NULL
|
||||
#endif
|
||||
)
|
||||
if (pl->ffloor != NULL || pl->polyobj != NULL)
|
||||
continue;
|
||||
|
||||
R_DrawSinglePlane(pl);
|
||||
|
@ -961,7 +943,6 @@ void R_DrawSinglePlane(visplane_t *pl)
|
|||
#endif
|
||||
spanfunc = spanfuncs[BASEDRAWFUNC];
|
||||
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
if (pl->polyobj && pl->polyobj->translucency != 0)
|
||||
{
|
||||
spanfunctype = SPANDRAWFUNC_TRANS;
|
||||
|
@ -979,95 +960,98 @@ void R_DrawSinglePlane(visplane_t *pl)
|
|||
else
|
||||
light = LIGHTLEVELS-1;
|
||||
|
||||
} else
|
||||
#endif
|
||||
if (pl->ffloor)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Don't draw planes that shouldn't be drawn.
|
||||
for (rover = pl->ffloor->target->ffloors; rover; rover = rover->next)
|
||||
if (pl->ffloor)
|
||||
{
|
||||
if ((pl->ffloor->flags & FF_CUTEXTRA) && (rover->flags & FF_EXTRA))
|
||||
// Don't draw planes that shouldn't be drawn.
|
||||
for (rover = pl->ffloor->target->ffloors; rover; rover = rover->next)
|
||||
{
|
||||
if (pl->ffloor->flags & FF_EXTRA)
|
||||
if ((pl->ffloor->flags & FF_CUTEXTRA) && (rover->flags & FF_EXTRA))
|
||||
{
|
||||
// The plane is from an extra 3D floor... Check the flags so
|
||||
// there are no undesired cuts.
|
||||
if (((pl->ffloor->flags & (FF_FOG|FF_SWIMMABLE)) == (rover->flags & (FF_FOG|FF_SWIMMABLE)))
|
||||
&& pl->height < *rover->topheight
|
||||
&& pl->height > *rover->bottomheight)
|
||||
return;
|
||||
if (pl->ffloor->flags & FF_EXTRA)
|
||||
{
|
||||
// The plane is from an extra 3D floor... Check the flags so
|
||||
// there are no undesired cuts.
|
||||
if (((pl->ffloor->flags & (FF_FOG|FF_SWIMMABLE)) == (rover->flags & (FF_FOG|FF_SWIMMABLE)))
|
||||
&& pl->height < *rover->topheight
|
||||
&& pl->height > *rover->bottomheight)
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pl->ffloor->flags & FF_TRANSLUCENT)
|
||||
{
|
||||
spanfunctype = SPANDRAWFUNC_TRANS;
|
||||
|
||||
// Hacked up support for alpha value in software mode Tails 09-24-2002
|
||||
if (pl->ffloor->alpha < 12)
|
||||
return; // Don't even draw it
|
||||
else if (pl->ffloor->alpha < 38)
|
||||
ds_transmap = transtables + ((tr_trans90-1)<<FF_TRANSSHIFT);
|
||||
else if (pl->ffloor->alpha < 64)
|
||||
ds_transmap = transtables + ((tr_trans80-1)<<FF_TRANSSHIFT);
|
||||
else if (pl->ffloor->alpha < 89)
|
||||
ds_transmap = transtables + ((tr_trans70-1)<<FF_TRANSSHIFT);
|
||||
else if (pl->ffloor->alpha < 115)
|
||||
ds_transmap = transtables + ((tr_trans60-1)<<FF_TRANSSHIFT);
|
||||
else if (pl->ffloor->alpha < 140)
|
||||
ds_transmap = transtables + ((tr_trans50-1)<<FF_TRANSSHIFT);
|
||||
else if (pl->ffloor->alpha < 166)
|
||||
ds_transmap = transtables + ((tr_trans40-1)<<FF_TRANSSHIFT);
|
||||
else if (pl->ffloor->alpha < 192)
|
||||
ds_transmap = transtables + ((tr_trans30-1)<<FF_TRANSSHIFT);
|
||||
else if (pl->ffloor->alpha < 217)
|
||||
ds_transmap = transtables + ((tr_trans20-1)<<FF_TRANSSHIFT);
|
||||
else if (pl->ffloor->alpha < 243)
|
||||
ds_transmap = transtables + ((tr_trans10-1)<<FF_TRANSSHIFT);
|
||||
else // Opaque, but allow transparent flat pixels
|
||||
spanfunctype = SPANDRAWFUNC_SPLAT;
|
||||
|
||||
if ((spanfunctype == SPANDRAWFUNC_SPLAT) || (pl->extra_colormap && (pl->extra_colormap->flags & CMF_FOG)))
|
||||
light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||
else
|
||||
light = LIGHTLEVELS-1;
|
||||
}
|
||||
else if (pl->ffloor->flags & FF_FOG)
|
||||
{
|
||||
spanfunctype = SPANDRAWFUNC_FOG;
|
||||
light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||
}
|
||||
else light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||
|
||||
#ifndef NOWATER
|
||||
if (pl->ffloor->flags & FF_RIPPLE)
|
||||
{
|
||||
INT32 top, bottom;
|
||||
|
||||
itswater = true;
|
||||
if (spanfunctype == SPANDRAWFUNC_TRANS)
|
||||
if (pl->ffloor->flags & FF_TRANSLUCENT)
|
||||
{
|
||||
spanfunctype = SPANDRAWFUNC_WATER;
|
||||
spanfunctype = SPANDRAWFUNC_TRANS;
|
||||
|
||||
// Copy the current scene, ugh
|
||||
top = pl->high-8;
|
||||
bottom = pl->low+8;
|
||||
// Hacked up support for alpha value in software mode Tails 09-24-2002
|
||||
if (pl->ffloor->alpha < 12)
|
||||
return; // Don't even draw it
|
||||
else if (pl->ffloor->alpha < 38)
|
||||
ds_transmap = transtables + ((tr_trans90-1)<<FF_TRANSSHIFT);
|
||||
else if (pl->ffloor->alpha < 64)
|
||||
ds_transmap = transtables + ((tr_trans80-1)<<FF_TRANSSHIFT);
|
||||
else if (pl->ffloor->alpha < 89)
|
||||
ds_transmap = transtables + ((tr_trans70-1)<<FF_TRANSSHIFT);
|
||||
else if (pl->ffloor->alpha < 115)
|
||||
ds_transmap = transtables + ((tr_trans60-1)<<FF_TRANSSHIFT);
|
||||
else if (pl->ffloor->alpha < 140)
|
||||
ds_transmap = transtables + ((tr_trans50-1)<<FF_TRANSSHIFT);
|
||||
else if (pl->ffloor->alpha < 166)
|
||||
ds_transmap = transtables + ((tr_trans40-1)<<FF_TRANSSHIFT);
|
||||
else if (pl->ffloor->alpha < 192)
|
||||
ds_transmap = transtables + ((tr_trans30-1)<<FF_TRANSSHIFT);
|
||||
else if (pl->ffloor->alpha < 217)
|
||||
ds_transmap = transtables + ((tr_trans20-1)<<FF_TRANSSHIFT);
|
||||
else if (pl->ffloor->alpha < 243)
|
||||
ds_transmap = transtables + ((tr_trans10-1)<<FF_TRANSSHIFT);
|
||||
else // Opaque, but allow transparent flat pixels
|
||||
spanfunctype = SPANDRAWFUNC_SPLAT;
|
||||
|
||||
if (top < 0)
|
||||
top = 0;
|
||||
if (bottom > vid.height)
|
||||
bottom = vid.height;
|
||||
|
||||
// Only copy the part of the screen we need
|
||||
VID_BlitLinearScreen((splitscreen && viewplayer == &players[secondarydisplayplayer]) ? screens[0] + (top+(vid.height>>1))*vid.width : screens[0]+((top)*vid.width), screens[1]+((top)*vid.width),
|
||||
vid.width, bottom-top,
|
||||
vid.width, vid.width);
|
||||
if ((spanfunctype == SPANDRAWFUNC_SPLAT) || (pl->extra_colormap && (pl->extra_colormap->flags & CMF_FOG)))
|
||||
light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||
else
|
||||
light = LIGHTLEVELS-1;
|
||||
}
|
||||
else if (pl->ffloor->flags & FF_FOG)
|
||||
{
|
||||
spanfunctype = SPANDRAWFUNC_FOG;
|
||||
light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||
}
|
||||
else light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||
|
||||
#ifndef NOWATER
|
||||
if (pl->ffloor->flags & FF_RIPPLE)
|
||||
{
|
||||
INT32 top, bottom;
|
||||
|
||||
itswater = true;
|
||||
if (spanfunctype == SPANDRAWFUNC_TRANS)
|
||||
{
|
||||
spanfunctype = SPANDRAWFUNC_WATER;
|
||||
|
||||
// Copy the current scene, ugh
|
||||
top = pl->high-8;
|
||||
bottom = pl->low+8;
|
||||
|
||||
if (top < 0)
|
||||
top = 0;
|
||||
if (bottom > vid.height)
|
||||
bottom = vid.height;
|
||||
|
||||
// Only copy the part of the screen we need
|
||||
VID_BlitLinearScreen((splitscreen && viewplayer == &players[secondarydisplayplayer]) ? screens[0] + (top+(vid.height>>1))*vid.width : screens[0]+((top)*vid.width), screens[1]+((top)*vid.width),
|
||||
vid.width, bottom-top,
|
||||
vid.width, vid.width);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
else
|
||||
light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||
}
|
||||
else light = (pl->lightlevel >> LIGHTSEGSHIFT);
|
||||
|
||||
if (!pl->slope // Don't mess with angle on slopes! We'll handle this ourselves later
|
||||
&& viewangle != pl->viewangle+pl->plangle)
|
||||
|
|
|
@ -47,9 +47,7 @@ typedef struct visplane_s
|
|||
fixed_t xoffs, yoffs; // Scrolling flats.
|
||||
|
||||
struct ffloor_s *ffloor;
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
polyobj_t *polyobj;
|
||||
#endif
|
||||
pslope_t *slope;
|
||||
} visplane_t;
|
||||
|
||||
|
@ -80,11 +78,7 @@ void R_MapPlane(INT32 y, INT32 x1, INT32 x2);
|
|||
void R_MakeSpans(INT32 x, INT32 t1, INT32 b1, INT32 t2, INT32 b2);
|
||||
void R_DrawPlanes(void);
|
||||
visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, fixed_t xoff, fixed_t yoff, angle_t plangle,
|
||||
extracolormap_t *planecolormap, ffloor_t *ffloor
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
, polyobj_t *polyobj
|
||||
#endif
|
||||
, pslope_t *slope);
|
||||
extracolormap_t *planecolormap, ffloor_t *ffloor, polyobj_t *polyobj, pslope_t *slope);
|
||||
visplane_t *R_CheckPlane(visplane_t *pl, INT32 start, INT32 stop);
|
||||
void R_ExpandPlane(visplane_t *pl, INT32 start, INT32 stop);
|
||||
void R_PlaneBounds(visplane_t *plane);
|
||||
|
@ -112,9 +106,7 @@ typedef struct planemgr_s
|
|||
struct pslope_s *slope;
|
||||
|
||||
struct ffloor_s *ffloor;
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
polyobj_t *polyobj;
|
||||
#endif
|
||||
} visffloor_t;
|
||||
|
||||
extern visffloor_t ffloor[MAXFFLOORS];
|
||||
|
|
92
src/r_segs.c
92
src/r_segs.c
|
@ -610,7 +610,6 @@ void R_RenderMaskedSegRange(drawseg_t *ds, INT32 x1, INT32 x2)
|
|||
// draw the texture
|
||||
col = (column_t *)((UINT8 *)R_GetColumn(texnum, maskedtexturecol[dc_x]) - 3);
|
||||
|
||||
//#ifdef POLYOBJECTS_PLANES
|
||||
#if 0 // Disabling this allows inside edges to render below the planes, for until the clipping is fixed to work right when POs are near the camera. -Red
|
||||
if (curline->dontrenderme && curline->polyseg && (curline->polyseg->flags & POF_RENDERPLANES))
|
||||
{
|
||||
|
@ -1309,10 +1308,8 @@ static void R_RenderSegLoop (void)
|
|||
|
||||
for (i = 0; i < numffloors; i++)
|
||||
{
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
if (ffloor[i].polyobj && (!curline->polyseg || ffloor[i].polyobj != curline->polyseg))
|
||||
continue;
|
||||
#endif
|
||||
|
||||
if (ffloor[i].height < viewz)
|
||||
{
|
||||
|
@ -1325,18 +1322,19 @@ static void R_RenderSegLoop (void)
|
|||
if (bottom_w > bottom)
|
||||
bottom_w = bottom;
|
||||
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
// Polyobject-specific hack to fix plane leaking -Red
|
||||
if (ffloor[i].polyobj && top_w >= bottom_w) {
|
||||
if (ffloor[i].polyobj && top_w >= bottom_w)
|
||||
{
|
||||
ffloor[i].plane->top[rw_x] = 0xFFFF;
|
||||
ffloor[i].plane->bottom[rw_x] = 0x0000; // fix for sky plane drawing crashes - Monster Iestyn 25/05/18
|
||||
} else
|
||||
#endif
|
||||
|
||||
if (top_w <= bottom_w)
|
||||
}
|
||||
else
|
||||
{
|
||||
ffloor[i].plane->top[rw_x] = (INT16)top_w;
|
||||
ffloor[i].plane->bottom[rw_x] = (INT16)bottom_w;
|
||||
if (top_w <= bottom_w)
|
||||
{
|
||||
ffloor[i].plane->top[rw_x] = (INT16)top_w;
|
||||
ffloor[i].plane->bottom[rw_x] = (INT16)bottom_w;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (ffloor[i].height > viewz)
|
||||
|
@ -1350,18 +1348,19 @@ static void R_RenderSegLoop (void)
|
|||
if (bottom_w > bottom)
|
||||
bottom_w = bottom;
|
||||
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
// Polyobject-specific hack to fix plane leaking -Red
|
||||
if (ffloor[i].polyobj && top_w >= bottom_w) {
|
||||
if (ffloor[i].polyobj && top_w >= bottom_w)
|
||||
{
|
||||
ffloor[i].plane->top[rw_x] = 0xFFFF;
|
||||
ffloor[i].plane->bottom[rw_x] = 0x0000; // fix for sky plane drawing crashes - Monster Iestyn 25/05/18
|
||||
} else
|
||||
#endif
|
||||
|
||||
if (top_w <= bottom_w)
|
||||
}
|
||||
else
|
||||
{
|
||||
ffloor[i].plane->top[rw_x] = (INT16)top_w;
|
||||
ffloor[i].plane->bottom[rw_x] = (INT16)bottom_w;
|
||||
if (top_w <= bottom_w)
|
||||
{
|
||||
ffloor[i].plane->top[rw_x] = (INT16)top_w;
|
||||
ffloor[i].plane->bottom[rw_x] = (INT16)bottom_w;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1818,10 +1817,8 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||
{
|
||||
for (i = 0; i < numffloors; i++)
|
||||
{
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
if (ffloor[i].polyobj && (!ds_p->curline->polyseg || ffloor[i].polyobj != ds_p->curline->polyseg))
|
||||
continue;
|
||||
#endif
|
||||
|
||||
if (ffloor[i].slope) {
|
||||
ffloor[i].f_pos = P_GetZAt(ffloor[i].slope, segleft.x, segleft.y) - viewz;
|
||||
|
@ -2328,33 +2325,40 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||
|
||||
maskedtextureheight = ds_p->maskedtextureheight; // note to red, this == &(ds_p->maskedtextureheight[0])
|
||||
|
||||
#ifdef POLYOBJECTS
|
||||
if (curline->polyseg) { // use REAL front and back floors please, so midtexture rendering isn't mucked up
|
||||
if (curline->polyseg)
|
||||
{ // use REAL front and back floors please, so midtexture rendering isn't mucked up
|
||||
rw_midtextureslide = rw_midtexturebackslide = 0;
|
||||
if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3))
|
||||
rw_midtexturemid = rw_midtextureback = max(curline->frontsector->floorheight, curline->backsector->floorheight) - viewz;
|
||||
else
|
||||
rw_midtexturemid = rw_midtextureback = min(curline->frontsector->ceilingheight, curline->backsector->ceilingheight) - viewz;
|
||||
} else
|
||||
#endif
|
||||
// Set midtexture starting height
|
||||
if (linedef->flags & ML_EFFECT2) { // Ignore slopes when texturing
|
||||
rw_midtextureslide = rw_midtexturebackslide = 0;
|
||||
if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3))
|
||||
rw_midtexturemid = rw_midtextureback = max(frontsector->floorheight, backsector->floorheight) - viewz;
|
||||
else
|
||||
rw_midtexturemid = rw_midtextureback = min(frontsector->ceilingheight, backsector->ceilingheight) - viewz;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Set midtexture starting height
|
||||
if (linedef->flags & ML_EFFECT2)
|
||||
{ // Ignore slopes when texturing
|
||||
rw_midtextureslide = rw_midtexturebackslide = 0;
|
||||
if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3))
|
||||
rw_midtexturemid = rw_midtextureback = max(frontsector->floorheight, backsector->floorheight) - viewz;
|
||||
else
|
||||
rw_midtexturemid = rw_midtextureback = min(frontsector->ceilingheight, backsector->ceilingheight) - viewz;
|
||||
|
||||
} else if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3)) {
|
||||
rw_midtexturemid = worldbottom;
|
||||
rw_midtextureslide = floorfrontslide;
|
||||
rw_midtextureback = worldlow;
|
||||
rw_midtexturebackslide = floorbackslide;
|
||||
} else {
|
||||
rw_midtexturemid = worldtop;
|
||||
rw_midtextureslide = ceilingfrontslide;
|
||||
rw_midtextureback = worldhigh;
|
||||
rw_midtexturebackslide = ceilingbackslide;
|
||||
}
|
||||
else if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3))
|
||||
{
|
||||
rw_midtexturemid = worldbottom;
|
||||
rw_midtextureslide = floorfrontslide;
|
||||
rw_midtextureback = worldlow;
|
||||
rw_midtexturebackslide = floorbackslide;
|
||||
}
|
||||
else
|
||||
{
|
||||
rw_midtexturemid = worldtop;
|
||||
rw_midtextureslide = ceilingfrontslide;
|
||||
rw_midtextureback = worldhigh;
|
||||
rw_midtexturebackslide = ceilingbackslide;
|
||||
}
|
||||
}
|
||||
rw_midtexturemid += sidedef->rowoffset;
|
||||
rw_midtextureback += sidedef->rowoffset;
|
||||
|
@ -2711,7 +2715,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||
}
|
||||
}
|
||||
}
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
if (curline->polyseg && frontsector && (curline->polyseg->flags & POF_RENDERPLANES))
|
||||
{
|
||||
while (i < numffloors && ffloor[i].polyobj != curline->polyseg) i++;
|
||||
|
@ -2750,7 +2753,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||
i++;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
numbackffloors = i;
|
||||
}
|
||||
|
@ -2804,7 +2806,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||
for (i = 0; i < numffloors; i++)
|
||||
R_ExpandPlane(ffloor[i].plane, rw_x, rw_stopx - 1);
|
||||
}
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
// FIXME hack to fix planes disappearing when a seg goes behind the camera. This NEEDS to be changed to be done properly. -Red
|
||||
if (curline->polyseg)
|
||||
{
|
||||
|
@ -2819,7 +2820,6 @@ void R_StoreWallRange(INT32 start, INT32 stop)
|
|||
ffloor[i].plane->maxx = rw_stopx - 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef WALLSPLATS
|
||||
|
|
|
@ -888,7 +888,7 @@ static void R_DrawVisSprite(vissprite_t *vis)
|
|||
vis->x2 = vid.width-1;
|
||||
|
||||
localcolfunc = (vis->cut & SC_VFLIP) ? R_DrawFlippedMaskedColumn : R_DrawMaskedColumn;
|
||||
lengthcol = patch->height;
|
||||
lengthcol = SHORT(patch->height);
|
||||
|
||||
// Split drawing loops for paper and non-paper to reduce conditional checks per sprite
|
||||
if (vis->scalestep)
|
||||
|
@ -1140,7 +1140,6 @@ fixed_t R_GetShadowZ(mobj_t *thing, pslope_t **shadowslope)
|
|||
}
|
||||
|
||||
#if 0 // Unfortunately, this drops CEZ2 down to sub-17 FPS on my i7.
|
||||
//#ifdef POLYOBJECTS
|
||||
// Check polyobjects and see if floorz needs to be altered, for rings only because they don't update floorz
|
||||
if (thing->type == MT_RING)
|
||||
{
|
||||
|
@ -1231,8 +1230,8 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
|
|||
yscale = FixedDiv(projectiony, tz);
|
||||
shadowxscale = FixedMul(thing->radius*2, scalemul);
|
||||
shadowyscale = FixedMul(FixedMul(thing->radius*2, scalemul), FixedDiv(abs(floorz - viewz), tz));
|
||||
shadowyscale = min(shadowyscale, shadowxscale) / patch->height;
|
||||
shadowxscale /= patch->width;
|
||||
shadowyscale = min(shadowyscale, shadowxscale) / SHORT(patch->height);
|
||||
shadowxscale /= SHORT(patch->width);
|
||||
shadowskew = 0;
|
||||
|
||||
if (floorslope)
|
||||
|
@ -1247,24 +1246,24 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
|
|||
//CONS_Printf("Shadow is sloped by %d %d\n", xslope, zslope);
|
||||
|
||||
if (viewz < floorz)
|
||||
shadowyscale += FixedMul(FixedMul(thing->radius*2 / patch->height, scalemul), zslope);
|
||||
shadowyscale += FixedMul(FixedMul(thing->radius*2 / SHORT(patch->height), scalemul), zslope);
|
||||
else
|
||||
shadowyscale -= FixedMul(FixedMul(thing->radius*2 / patch->height, scalemul), zslope);
|
||||
shadowyscale -= FixedMul(FixedMul(thing->radius*2 / SHORT(patch->height), scalemul), zslope);
|
||||
|
||||
shadowyscale = abs(shadowyscale);
|
||||
|
||||
shadowskew = xslope;
|
||||
}
|
||||
|
||||
tx -= patch->width * shadowxscale/2;
|
||||
tx -= SHORT(patch->width) * shadowxscale/2;
|
||||
x1 = (centerxfrac + FixedMul(tx,xscale))>>FRACBITS;
|
||||
if (x1 >= viewwidth) return;
|
||||
|
||||
tx += patch->width * shadowxscale;
|
||||
tx += SHORT(patch->width) * shadowxscale;
|
||||
x2 = ((centerxfrac + FixedMul(tx,xscale))>>FRACBITS); x2--;
|
||||
if (x2 < 0 || x2 <= x1) return;
|
||||
|
||||
if (shadowyscale < FRACUNIT/patch->height) return; // fix some crashes?
|
||||
if (shadowyscale < FRACUNIT/SHORT(patch->height)) return; // fix some crashes?
|
||||
|
||||
shadow = R_NewVisSprite();
|
||||
shadow->patch = patch;
|
||||
|
@ -1279,8 +1278,8 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
|
|||
shadow->dispoffset = vis->dispoffset - 5;
|
||||
shadow->gx = thing->x;
|
||||
shadow->gy = thing->y;
|
||||
shadow->gzt = shadow->pz + shadow->patch->height * shadowyscale / 2;
|
||||
shadow->gz = shadow->gzt - shadow->patch->height * shadowyscale;
|
||||
shadow->gzt = shadow->pz + SHORT(patch->height) * shadowyscale / 2;
|
||||
shadow->gz = shadow->gzt - SHORT(patch->height) * shadowyscale;
|
||||
shadow->texturemid = FixedMul(thing->scale, FixedDiv(shadow->gzt - viewz, shadowyscale));
|
||||
if (thing->skin && ((skin_t *)thing->skin)->flags & SF_HIRES)
|
||||
shadow->texturemid = FixedMul(shadow->texturemid, ((skin_t *)thing->skin)->highresscale);
|
||||
|
@ -1301,7 +1300,7 @@ static void R_ProjectDropShadow(mobj_t *thing, vissprite_t *vis, fixed_t scale,
|
|||
|
||||
shadow->startfrac = 0;
|
||||
//shadow->xiscale = 0x7ffffff0 / (shadow->xscale/2);
|
||||
shadow->xiscale = (patch->width<<FRACBITS)/(x2-x1+1); // fuck it
|
||||
shadow->xiscale = (SHORT(patch->width)<<FRACBITS)/(x2-x1+1); // fuck it
|
||||
|
||||
if (shadow->x1 > x1)
|
||||
shadow->startfrac += shadow->xiscale*(shadow->x1-x1);
|
||||
|
@ -1528,10 +1527,10 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
rotsprite = sprframe->rotsprite.patch[rot][rollangle];
|
||||
if (rotsprite != NULL)
|
||||
{
|
||||
spr_width = rotsprite->width << FRACBITS;
|
||||
spr_height = rotsprite->height << FRACBITS;
|
||||
spr_offset = rotsprite->leftoffset << FRACBITS;
|
||||
spr_topoffset = rotsprite->topoffset << FRACBITS;
|
||||
spr_width = SHORT(rotsprite->width) << FRACBITS;
|
||||
spr_height = SHORT(rotsprite->height) << FRACBITS;
|
||||
spr_offset = SHORT(rotsprite->leftoffset) << FRACBITS;
|
||||
spr_topoffset = SHORT(rotsprite->topoffset) << FRACBITS;
|
||||
// flip -> rotate, not rotate -> flip
|
||||
flip = 0;
|
||||
}
|
||||
|
@ -2271,7 +2270,6 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
|
|||
entry->ffloor = ds->thicksides[i];
|
||||
}
|
||||
}
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
// Check for a polyobject plane, but only if this is a front line
|
||||
if (ds->curline->polyseg && ds->curline->polyseg->visplane && !ds->curline->side) {
|
||||
plane = ds->curline->polyseg->visplane;
|
||||
|
@ -2287,7 +2285,6 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
|
|||
}
|
||||
ds->curline->polyseg->visplane = NULL;
|
||||
}
|
||||
#endif
|
||||
if (ds->maskedtexturecol)
|
||||
{
|
||||
entry = R_CreateDrawNode(head);
|
||||
|
@ -2335,7 +2332,6 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
|
|||
if (tempskip)
|
||||
return;
|
||||
|
||||
#ifdef POLYOBJECTS_PLANES
|
||||
// find all the remaining polyobject planes and add them on the end of the list
|
||||
// probably this is a terrible idea if we wanted them to be sorted properly
|
||||
// but it works getting them in for now
|
||||
|
@ -2356,7 +2352,6 @@ static void R_CreateDrawNodes(maskcount_t* mask, drawnode_t* head, boolean temps
|
|||
// note: no seg is set, for what should be obvious reasons
|
||||
PolyObjects[i].visplane = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
// No vissprites in this mask?
|
||||
if (mask->vissprites[1] - mask->vissprites[0] == 0)
|
||||
|
|
|
@ -1675,7 +1675,7 @@ void S_LoadMusicDefs(UINT16 wadnum)
|
|||
char *lf;
|
||||
char *stoken;
|
||||
|
||||
size_t nlf;
|
||||
size_t nlf = 0xFFFFFFFF;
|
||||
size_t ncr;
|
||||
|
||||
musicdef_t *def = NULL;
|
||||
|
|
14
src/screen.c
14
src/screen.c
|
@ -538,10 +538,16 @@ void SCR_DisplayTicRate(void)
|
|||
if (totaltics <= TICRATE/2) ticcntcolor = V_REDMAP;
|
||||
else if (totaltics == TICRATE) ticcntcolor = V_GREENMAP;
|
||||
|
||||
V_DrawString(vid.width-(72*vid.dupx), h,
|
||||
V_YELLOWMAP|V_NOSCALESTART|V_USERHUDTRANS, "FPS:");
|
||||
V_DrawString(vid.width-(40*vid.dupx), h,
|
||||
ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%02d/%02u", totaltics, TICRATE));
|
||||
if (cv_ticrate.value == 2) // compact counter
|
||||
V_DrawString(vid.width-(16*vid.dupx), h,
|
||||
ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%02d", totaltics));
|
||||
else if (cv_ticrate.value == 1) // full counter
|
||||
{
|
||||
V_DrawString(vid.width-(72*vid.dupx), h,
|
||||
V_YELLOWMAP|V_NOSCALESTART|V_USERHUDTRANS, "FPS:");
|
||||
V_DrawString(vid.width-(40*vid.dupx), h,
|
||||
ticcntcolor|V_NOSCALESTART|V_USERHUDTRANS, va("%02d/%02u", totaltics, TICRATE));
|
||||
}
|
||||
|
||||
lasttic = ontic;
|
||||
}
|
||||
|
|
|
@ -372,7 +372,9 @@ static boolean IgnoreMouse(void)
|
|||
return false;
|
||||
if (menuactive)
|
||||
return !M_MouseNeeded();
|
||||
if (paused || con_destlines || chat_on || gamestate != GS_LEVEL)
|
||||
if (paused || con_destlines || chat_on)
|
||||
return true;
|
||||
if (gamestate != GS_LEVEL && gamestate != GS_INTERMISSION && gamestate != GS_CUTSCENE)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -527,7 +527,7 @@ sfxinfo_t S_sfx[NUMSFX] =
|
|||
{"s3k8a", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Boing"},
|
||||
{"s3k8b", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Powerful hit"},
|
||||
{"s3k8c", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Humming power"},
|
||||
{"s3k8d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, ""},
|
||||
{"s3k8d", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "/"},
|
||||
{"s3k8e", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Accelerating"},
|
||||
{"s3k8f", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Opening"},
|
||||
{"s3k90", false, 64, 0, -1, NULL, 0, -1, -1, LUMPERROR, "Impact"},
|
||||
|
|
|
@ -42,7 +42,8 @@ UINT8 *screens[5];
|
|||
// screens[3] = fade screen start
|
||||
// screens[4] = fade screen end, postimage tempoarary buffer
|
||||
|
||||
consvar_t cv_ticrate = {"showfps", "No", 0, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
static CV_PossibleValue_t ticrate_cons_t[] = {{0, "No"}, {1, "Full"}, {2, "Compact"}, {0, NULL}};
|
||||
consvar_t cv_ticrate = {"showfps", "No", CV_SAVE, ticrate_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
static void CV_palette_OnChange(void);
|
||||
|
||||
|
|
124
src/w_wad.c
124
src/w_wad.c
|
@ -76,6 +76,10 @@ int snprintf(char *str, size_t n, const char *fmt, ...);
|
|||
//int vsnprintf(char *str, size_t n, const char *fmt, va_list ap);
|
||||
#endif
|
||||
|
||||
#ifdef _DEBUG
|
||||
#include "console.h"
|
||||
#endif
|
||||
|
||||
#ifndef O_BINARY
|
||||
#define O_BINARY 0
|
||||
#endif
|
||||
|
@ -920,6 +924,40 @@ const char *W_CheckNameForNum(lumpnum_t lumpnum)
|
|||
// 'startlump' is the lump number to start the search
|
||||
//
|
||||
UINT16 W_CheckNumForNamePwad(const char *name, UINT16 wad, UINT16 startlump)
|
||||
{
|
||||
UINT16 i;
|
||||
static char uname[8 + 1];
|
||||
|
||||
if (!TestValidLump(wad,0))
|
||||
return INT16_MAX;
|
||||
|
||||
strlcpy(uname, name, sizeof uname);
|
||||
strupr(uname);
|
||||
|
||||
//
|
||||
// scan forward
|
||||
// start at 'startlump', useful parameter when there are multiple
|
||||
// resources with the same name
|
||||
//
|
||||
if (startlump < wadfiles[wad]->numlumps)
|
||||
{
|
||||
lumpinfo_t *lump_p = wadfiles[wad]->lumpinfo + startlump;
|
||||
for (i = startlump; i < wadfiles[wad]->numlumps; i++, lump_p++)
|
||||
if (!strncmp(lump_p->name, uname, sizeof(uname) - 1))
|
||||
return i;
|
||||
}
|
||||
|
||||
// not found.
|
||||
return INT16_MAX;
|
||||
}
|
||||
|
||||
//
|
||||
// Like W_CheckNumForNamePwad, but can find entries with long names
|
||||
//
|
||||
// Should be the only version, but that's not possible until we fix
|
||||
// all the instances of non null-terminated strings in the codebase...
|
||||
//
|
||||
UINT16 W_CheckNumForLongNamePwad(const char *name, UINT16 wad, UINT16 startlump)
|
||||
{
|
||||
UINT16 i;
|
||||
static char uname[256 + 1];
|
||||
|
@ -1025,7 +1063,8 @@ lumpnum_t W_CheckNumForName(const char *name)
|
|||
// most recent entries first
|
||||
for (i = lumpnumcacheindex + LUMPNUMCACHESIZE; i > lumpnumcacheindex; i--)
|
||||
{
|
||||
if (strcmp(lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].lumpname, name) == 0)
|
||||
if (!lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].lumpname[8]
|
||||
&& strncmp(lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].lumpname, name, 8) == 0)
|
||||
{
|
||||
lumpnumcacheindex = i & (LUMPNUMCACHESIZE - 1);
|
||||
return lumpnumcache[lumpnumcacheindex].lumpnum;
|
||||
|
@ -1045,13 +1084,63 @@ lumpnum_t W_CheckNumForName(const char *name)
|
|||
{
|
||||
// Update the cache.
|
||||
lumpnumcacheindex = (lumpnumcacheindex + 1) & (LUMPNUMCACHESIZE - 1);
|
||||
strlcpy(lumpnumcache[lumpnumcacheindex].lumpname, name, 32);
|
||||
memset(lumpnumcache[lumpnumcacheindex].lumpname, '\0', 32);
|
||||
strncpy(lumpnumcache[lumpnumcacheindex].lumpname, name, 8);
|
||||
lumpnumcache[lumpnumcacheindex].lumpnum = (i<<16)+check;
|
||||
|
||||
return lumpnumcache[lumpnumcacheindex].lumpnum;
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Like W_CheckNumForName, but can find entries with long names
|
||||
//
|
||||
// Should be the only version, but that's not possible until we fix
|
||||
// all the instances of non null-terminated strings in the codebase...
|
||||
//
|
||||
lumpnum_t W_CheckNumForLongName(const char *name)
|
||||
{
|
||||
INT32 i;
|
||||
lumpnum_t check = INT16_MAX;
|
||||
|
||||
if (!*name) // some doofus gave us an empty string?
|
||||
return LUMPERROR;
|
||||
|
||||
// Check the lumpnumcache first. Loop backwards so that we check
|
||||
// most recent entries first
|
||||
for (i = lumpnumcacheindex + LUMPNUMCACHESIZE; i > lumpnumcacheindex; i--)
|
||||
{
|
||||
if (strcmp(lumpnumcache[i & (LUMPNUMCACHESIZE - 1)].lumpname, name) == 0)
|
||||
{
|
||||
lumpnumcacheindex = i & (LUMPNUMCACHESIZE - 1);
|
||||
return lumpnumcache[lumpnumcacheindex].lumpnum;
|
||||
}
|
||||
}
|
||||
|
||||
// scan wad files backwards so patch lump files take precedence
|
||||
for (i = numwadfiles - 1; i >= 0; i--)
|
||||
{
|
||||
check = W_CheckNumForLongNamePwad(name,(UINT16)i,0);
|
||||
if (check != INT16_MAX)
|
||||
break; //found it
|
||||
}
|
||||
|
||||
if (check == INT16_MAX) return LUMPERROR;
|
||||
else
|
||||
{
|
||||
if (strlen(name) < 32)
|
||||
{
|
||||
// Update the cache.
|
||||
lumpnumcacheindex = (lumpnumcacheindex + 1) & (LUMPNUMCACHESIZE - 1);
|
||||
memset(lumpnumcache[lumpnumcacheindex].lumpname, '\0', 32);
|
||||
strlcpy(lumpnumcache[lumpnumcacheindex].lumpname, name, 32);
|
||||
lumpnumcache[lumpnumcacheindex].lumpnum = (i << 16) + check;
|
||||
}
|
||||
|
||||
return (i << 16) + check;
|
||||
}
|
||||
}
|
||||
|
||||
// Look for valid map data through all added files in descendant order.
|
||||
// Get a map marker for WADs, and a standalone WAD file lump inside PK3s.
|
||||
// TODO: Make it search through cache first, maybe...?
|
||||
|
@ -1100,6 +1189,24 @@ lumpnum_t W_GetNumForName(const char *name)
|
|||
return i;
|
||||
}
|
||||
|
||||
//
|
||||
// Like W_GetNumForName, but can find entries with long names
|
||||
//
|
||||
// Should be the only version, but that's not possible until we fix
|
||||
// all the instances of non null-terminated strings in the codebase...
|
||||
//
|
||||
lumpnum_t W_GetNumForLongName(const char *name)
|
||||
{
|
||||
lumpnum_t i;
|
||||
|
||||
i = W_CheckNumForLongName(name);
|
||||
|
||||
if (i == LUMPERROR)
|
||||
I_Error("W_GetNumForLongName: %s not found!\n", name);
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
//
|
||||
// W_CheckNumForNameInBlock
|
||||
// Checks only in blocks from blockstart lump to blockend lump
|
||||
|
@ -1139,7 +1246,7 @@ UINT8 W_LumpExists(const char *name)
|
|||
{
|
||||
lumpinfo_t *lump_p = wadfiles[i]->lumpinfo;
|
||||
for (j = 0; j < wadfiles[i]->numlumps; ++j, ++lump_p)
|
||||
if (fastcmp(lump_p->name,name))
|
||||
if (fastcmp(lump_p->longname, name))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -1680,6 +1787,17 @@ void *W_CachePatchName(const char *name, INT32 tag)
|
|||
return W_CachePatchNum(W_GetNumForName("MISSING"), tag);
|
||||
return W_CachePatchNum(num, tag);
|
||||
}
|
||||
|
||||
void *W_CachePatchLongName(const char *name, INT32 tag)
|
||||
{
|
||||
lumpnum_t num;
|
||||
|
||||
num = W_CheckNumForLongName(name);
|
||||
|
||||
if (num == LUMPERROR)
|
||||
return W_CachePatchNum(W_GetNumForLongName("MISSING"), tag);
|
||||
return W_CachePatchNum(num, tag);
|
||||
}
|
||||
#ifndef NOMD5
|
||||
#define MD5_LEN 16
|
||||
|
||||
|
|
|
@ -156,6 +156,7 @@ const char *W_CheckNameForNumPwad(UINT16 wad, UINT16 lump);
|
|||
const char *W_CheckNameForNum(lumpnum_t lumpnum);
|
||||
|
||||
UINT16 W_CheckNumForNamePwad(const char *name, UINT16 wad, UINT16 startlump); // checks only in one pwad
|
||||
UINT16 W_CheckNumForLongNamePwad(const char *name, UINT16 wad, UINT16 startlump);
|
||||
|
||||
/* Find the first lump after F_START for instance. */
|
||||
UINT16 W_CheckNumForMarkerStartPwad(const char *name, UINT16 wad, UINT16 startlump);
|
||||
|
@ -166,7 +167,9 @@ UINT16 W_CheckNumForFolderEndPK3(const char *name, UINT16 wad, UINT16 startlump)
|
|||
|
||||
lumpnum_t W_CheckNumForMap(const char *name);
|
||||
lumpnum_t W_CheckNumForName(const char *name);
|
||||
lumpnum_t W_CheckNumForLongName(const char *name);
|
||||
lumpnum_t W_GetNumForName(const char *name); // like W_CheckNumForName but I_Error on LUMPERROR
|
||||
lumpnum_t W_GetNumForLongName(const char *name);
|
||||
lumpnum_t W_CheckNumForNameInBlock(const char *name, const char *blockstart, const char *blockend);
|
||||
UINT8 W_LumpExists(const char *name); // Lua uses this.
|
||||
|
||||
|
@ -194,6 +197,7 @@ boolean W_IsPatchCached(lumpnum_t lump, void *ptr);
|
|||
|
||||
void *W_CacheLumpName(const char *name, INT32 tag);
|
||||
void *W_CachePatchName(const char *name, INT32 tag);
|
||||
void *W_CachePatchLongName(const char *name, INT32 tag);
|
||||
|
||||
// Returns either a Software patch, or an OpenGL patch.
|
||||
// Performs any necessary conversions from PNG images.
|
||||
|
|
|
@ -3199,7 +3199,7 @@ INT32 I_GetKey(void)
|
|||
// -----------------
|
||||
#define DI_KEYBOARD_BUFFERSIZE 32 // number of data elements in keyboard buffer
|
||||
|
||||
void I_StartupKeyboard(void)
|
||||
static void I_StartupKeyboard(void)
|
||||
{
|
||||
DIPROPDWORD dip;
|
||||
|
||||
|
@ -3435,6 +3435,8 @@ INT32 I_StartupSystem(void)
|
|||
// some 'more global than globals' things to initialize here ?
|
||||
graphics_started = keyboard_started = sound_started = cdaudio_started = false;
|
||||
|
||||
I_StartupKeyboard();
|
||||
|
||||
#ifdef NDEBUG
|
||||
|
||||
#ifdef BUGTRAP
|
||||
|
|
|
@ -56,6 +56,7 @@ static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff,
|
|||
static consvar_t cv_ontop = {"ontop", "Never", 0, CV_NeverOnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
boolean highcolor;
|
||||
int vid_opengl_state = 0;
|
||||
|
||||
static BOOL bDIBMode; // means we are using DIB instead of DirectDraw surfaces
|
||||
static LPBITMAPINFO bmiMain = NULL;
|
||||
|
@ -949,7 +950,10 @@ INT32 VID_SetMode(INT32 modenum)
|
|||
}
|
||||
|
||||
void VID_CheckRenderer(void) {}
|
||||
void VID_CheckGLLoaded(rendermode_t oldrender) {}
|
||||
void VID_CheckGLLoaded(rendermode_t oldrender)
|
||||
{
|
||||
(void)oldrender;
|
||||
}
|
||||
|
||||
// ========================================================================
|
||||
// Free the video buffer of the last video mode,
|
||||
|
|
Loading…
Reference in a new issue