Skip to content

Commit

Permalink
Added: New sidedef flag "sdf_middle_stretch". Normally, height of the…
Browse files Browse the repository at this point in the history
… middle surface on twosided linedefs is clipped to that of the material used on it. If this flag is set, this behaviour is disabled (instead, the surface will stretch from floor to ceiling). This flag can be set via DMU and subsequently XG, using the ltc_wall_texture/ltc_wall_material class.

Implemented for jDoom64. When loading a DOOM64 format map, this flag will be set for all sidedefs automatically in line with the original game behavior.
  • Loading branch information
danij committed Dec 3, 2008
1 parent 7d78858 commit 4ad26d5
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions doomsday/engine/api/dd_share.h
Expand Up @@ -613,6 +613,7 @@ enum /* Do not change the numerical values of the constants! */
#define SDF_BLENDMIDTOTOP 0x0002
#define SDF_BLENDMIDTOBOTTOM 0x0004
#define SDF_BLENDBOTTOMTOMID 0x0008
#define SDF_MIDDLE_STRETCH 0x0010 // Stretch the middle surface to reach from floor to ceiling.

// Surface flags:
// For use with P_Set/Get(DMU_SURFACE, n, DMU_FLAGS).
Expand Down
1 change: 1 addition & 0 deletions doomsday/engine/defs/flags.ded
Expand Up @@ -85,6 +85,7 @@ Flag { ID = "sdf_fade_top_mid"; Value = 0x1; }
Flag { ID = "sdf_fade_mid_top"; Value = 0x2; }
Flag { ID = "sdf_fade_mid_bottom"; Value = 0x4; }
Flag { ID = "sdf_fade_bottom_mid"; Value = 0x8; }
Flag { ID = "sdf_middle_stretch"; Value = 0x10; }

# Models
Flag { ID = "df_fullbright"; Value = 0x1; }
Expand Down
8 changes: 6 additions & 2 deletions doomsday/engine/portable/src/rend_main.c
Expand Up @@ -417,6 +417,9 @@ boolean Rend_DoesMidTextureFillGap(linedef_t *line, int backside)
float openTop[2], matTop[2];
float openBottom[2], matBottom[2];

if(side->flags & SDF_MIDDLE_STRETCH)
return true;

openTop[0] = openTop[1] = matTop[0] = matTop[1] =
MIN_OF(back->SP_ceilvisheight, front->SP_ceilvisheight);
openBottom[0] = openBottom[1] = matBottom[0] = matBottom[1] =
Expand Down Expand Up @@ -1651,7 +1654,7 @@ static boolean renderWorldPoly(rvertex_t* rvertices, uint numVertices,
rvertex_t origVerts[4];
rcolor_t origColors[4];
rtexcoord_t origTexCoords[4];

/**
* Need to swap indices around into fans set the position
* of the division vertices, interpolate texcoords and
Expand Down Expand Up @@ -2479,7 +2482,8 @@ static boolean Rend_RenderWallSeg(subsector_t* ssec, seg_t* seg)
}

mat = surface->material->current;
if(Rend_MidMaterialPos
if((side->flags & SDF_MIDDLE_STRETCH) ||
Rend_MidMaterialPos
(&vL_ZBottom, &vR_ZBottom, &vL_ZTop, &vR_ZTop,
&texOffset[VY], surface->visOffset[VY], mat->height,
(ldef->flags & DDLF_DONTPEGBOTTOM)? true : false))
Expand Down
4 changes: 2 additions & 2 deletions doomsday/plugins/wadmapconverter/src/load.c
Expand Up @@ -1426,7 +1426,7 @@ boolean TransferMap(void)
{
frontIdx =
MPE_SidedefCreate(front->sector,
(map->format == MF_DOOM64? SDF_MIDDLE_MATERIAL_TILED : 0),
(map->format == MF_DOOM64? SDF_MIDDLE_STRETCH : 0),
front->topMaterial->num,
front->offset[VX], front->offset[VY], 1, 1, 1,
front->middleMaterial->num,
Expand All @@ -1440,7 +1440,7 @@ boolean TransferMap(void)
{
backIdx =
MPE_SidedefCreate(back->sector,
(map->format == MF_DOOM64? SDF_MIDDLE_MATERIAL_TILED : 0),
(map->format == MF_DOOM64? SDF_MIDDLE_STRETCH : 0),
back->topMaterial->num,
back->offset[VX], back->offset[VY], 1, 1, 1,
back->middleMaterial->num,
Expand Down

0 comments on commit 4ad26d5

Please sign in to comment.