- Fixed: The sign in Eternall.wad, map25 on line 2236 rendered at the wrong height because Doom

ignored the Y locations of patches drawn on two-sided midtextures and always drew them at the
  top of the texture. Added a compatibility flag.

SVN r3205 (trunk)
This commit is contained in:
Randy Heit 2011-05-13 03:29:48 +00:00
parent 4264b05e79
commit 29e486495b
10 changed files with 43 additions and 8 deletions

View file

@ -120,6 +120,7 @@ static FCompatOption Options[] =
{ "hitscan", COMPATF_HITSCAN, 0 },
{ "lightlevel", COMPATF_LIGHT, 0 },
{ "polyobj", COMPATF_POLYOBJ, 0 },
{ "maskedmidtex", COMPATF_MASKEDMIDTEX, 0 },
{ NULL, 0, 0 }
};

View file

@ -546,7 +546,7 @@ CUSTOM_CVAR(Int, compatmode, 0, CVAR_ARCHIVE|CVAR_NOINITCALL)
v = COMPATF_SHORTTEX|COMPATF_STAIRINDEX|COMPATF_USEBLOCKING|COMPATF_NODOORLIGHT|COMPATF_SPRITESORT|
COMPATF_TRACE|COMPATF_MISSILECLIP|COMPATF_SOUNDTARGET|COMPATF_NO_PASSMOBJ|COMPATF_LIMITPAIN|
COMPATF_DEHHEALTH|COMPATF_INVISIBILITY|COMPATF_CROSSDROPOFF|COMPATF_CORPSEGIBS|COMPATF_HITSCAN|
COMPATF_WALLRUN|COMPATF_NOTOSSDROPS|COMPATF_LIGHT;
COMPATF_WALLRUN|COMPATF_NOTOSSDROPS|COMPATF_LIGHT|COMPATF_MASKEDMIDTEX;
break;
case 3: // Boom compat mode
@ -602,6 +602,7 @@ CVAR (Flag, compat_spritesort, compatflags,COMPATF_SPRITESORT);
CVAR (Flag, compat_hitscan, compatflags,COMPATF_HITSCAN);
CVAR (Flag, compat_light, compatflags,COMPATF_LIGHT);
CVAR (Flag, compat_polyobj, compatflags,COMPATF_POLYOBJ);
CVAR (Flag, compat_maskedmidtex,compatflags,COMPATF_MASKEDMIDTEX);
//==========================================================================
//

View file

@ -332,6 +332,7 @@ enum
COMPATF_HITSCAN = 1 << 28, // Hitscans use original blockmap anf hit check code.
COMPATF_LIGHT = 1 << 29, // Find neighboring light level like Doom
COMPATF_POLYOBJ = 1 << 30, // Draw polyobjects the old fashioned way
COMPATF_MASKEDMIDTEX = 1 << 31, // Ignore compositing when drawing masked midtextures
};
// Emulate old bugs for select maps. These are not exposed by a cvar

View file

@ -1271,6 +1271,7 @@ MapFlagHandlers[] =
{ "compat_spritesort", MITYPE_COMPATFLAG, COMPATF_SPRITESORT, 0 },
{ "compat_light", MITYPE_COMPATFLAG, COMPATF_LIGHT, 0 },
{ "compat_polyobj", MITYPE_COMPATFLAG, COMPATF_POLYOBJ, 0 },
{ "compat_maskedmidtex", MITYPE_COMPATFLAG, COMPATF_MASKEDMIDTEX, 0 },
{ "cd_start_track", MITYPE_EATNEXT, 0, 0 },
{ "cd_end1_track", MITYPE_EATNEXT, 0, 0 },
{ "cd_end2_track", MITYPE_EATNEXT, 0, 0 },

View file

@ -240,6 +240,10 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2)
backsector = curline->backsector;
tex = TexMan(curline->sidedef->GetTexture(side_t::mid));
if (i_compatflags & COMPATF_MASKEDMIDTEX)
{
tex = tex->GetRawTexture();
}
// killough 4/13/98: get correct lightlevel for 2s normal textures
sec = R_FakeFlat (frontsector, &tempsec, NULL, NULL, false);
@ -621,9 +625,9 @@ void R_RenderFakeWallRange (drawseg_t *ds, int x1, int x2)
if (!(fake3D & FAKE3D_CLIPBOTTOM)) sclipBottom = floorheight;
if (!(fake3D & FAKE3D_CLIPTOP)) sclipTop = ceilingheight;
// maybe not visible
if (sclipBottom >= frontsector->CenterCeiling()) return;
if (sclipTop <= frontsector->CenterFloor()) return;
// maybe not visible
if (sclipBottom >= frontsector->CenterCeiling()) return;
if (sclipTop <= frontsector->CenterFloor()) return;
if (fake3D & FAKE3D_DOWN2UP)
{ // bottom to viewz

View file

@ -160,6 +160,8 @@ public:
int CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rotate, FCopyInfo *inf = NULL);
int GetSourceLump() { return DefinitionLump; }
FTexture *GetRedirect(bool wantwarped);
FTexture *GetRawTexture();
protected:
BYTE *Pixels;
@ -185,7 +187,6 @@ protected:
bool bTranslucentPatches:1;
void MakeTexture ();
FTexture *GetRedirect(bool wantwarped);
private:
void CheckForHacks ();
@ -766,14 +767,32 @@ void FMultiPatchTexture::CheckForHacks ()
//==========================================================================
//
// FMultiPatchTexture :: TexPart :: TexPart
// FMultiPatchTexture :: GetRedirect
//
//==========================================================================
FTexture *FMultiPatchTexture::GetRedirect(bool wantwarped)
{
if (bRedirect) return Parts->Texture;
else return this;
return bRedirect ? Parts->Texture : this;
}
//==========================================================================
//
// FMultiPatchTexture :: GetRawTexture
//
// Doom ignored all compositing of mid-sided textures on two-sided lines.
// Since these textures had to be single-patch in Doom, that essentially
// means it ignores their Y offsets.
//
// If this texture is composed of only one patch, return that patch.
// Otherwise, return this texture, since Doom wouldn't have been able to
// draw it anyway.
//
//==========================================================================
FTexture *FMultiPatchTexture::GetRawTexture()
{
return NumParts == 1 ? Parts->Texture : this;
}
//==========================================================================

View file

@ -547,6 +547,11 @@ FTexture *FTexture::GetRedirect(bool wantwarped)
return this;
}
FTexture *FTexture::GetRawTexture()
{
return this;
}
void FTexture::SetScaledSize(int fitwidth, int fitheight)
{
xScale = FLOAT2FIXED(float(Width) / fitwidth);

View file

@ -215,6 +215,7 @@ public:
virtual bool UseBasePalette();
virtual int GetSourceLump() { return SourceLump; }
virtual FTexture *GetRedirect(bool wantwarped);
virtual FTexture *GetRawTexture(); // for FMultiPatchTexture to override
FTextureID GetID() const { return id; }
virtual void Unload () = 0;

View file

@ -28,6 +28,7 @@ A80E7EE40E0D0C76A6FBD242BE29FE27 // map15
6DA6FCBA8089161BDEC6A1D3F6C8D60F // Eternal Doom MAP25
{
stairs
maskedmidtex
}
10E1E2B36302D31AC4AE68C84B5DC457 // Eternal Doom MAP28

View file

@ -1192,6 +1192,7 @@ OptionMenu "CompatibilityOptions"
Option "Use Doom code for hitscan checks", "compat_HITSCAN", "YesNo"
Option "Cripple sound for silent BFG trick", "compat_soundslots", "YesNo"
Option "Draw polyobjects like Hexen", "compat_POLYOBJ", "YesNo"
Option "Ignore Y offsets on masked midtextures", "compat_MASKEDMIDTEX", "YesNo"
Class "CompatibilityMenu"
}