From 0b3730392c4caa9d4d12afabe1992d42f0ee2797 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 11 Jul 2006 04:48:10 +0000 Subject: [PATCH] - Fixed closed doors between the front sector's floor and ceiling the right way. I was just missing a non-null texture check. - Removed references to texturewidthmask. What was that? SVN r244 (trunk) --- docs/rh-log.txt | 5 +++++ src/dobjtype.cpp | 1 + src/r_bsp.cpp | 14 +++----------- src/r_plane.cpp | 3 +++ src/r_segs.cpp | 38 ++++++-------------------------------- src/r_sky.cpp | 2 -- 6 files changed, 18 insertions(+), 45 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 8ac129f6f..82ecd2a47 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,8 @@ +July 10, 2006 +- Fixed closed doors between the front sector's floor and ceiling the right way. + I was just missing a non-null texture check. +- Removed references to texturewidthmask. What was that? + July 10, 2006 (Changes by Graf Zahl) - Fixed: The earthquake code needs to check whether a quake's spot is still valid. Super Sonic Doom crashed due to this. diff --git a/src/dobjtype.cpp b/src/dobjtype.cpp index f4e9c2a57..f4b6b138f 100644 --- a/src/dobjtype.cpp +++ b/src/dobjtype.cpp @@ -161,6 +161,7 @@ const PClass *PClass::FindClass (FName zaname) DObject *PClass::CreateNew () const { BYTE *mem = (BYTE *)M_Malloc (Size); + assert (mem != NULL); // Set this object's defaults before constructing it. if (Defaults!=NULL) diff --git a/src/r_bsp.cpp b/src/r_bsp.cpp index 7445be7f7..47b1956a5 100644 --- a/src/r_bsp.cpp +++ b/src/r_bsp.cpp @@ -748,23 +748,15 @@ void R_AddLine (seg_t *line) { solid = true; } - // [RH] Check for completely closed back sector. This worked in - // 1.22, so I assume I accidentally broke it when I added slopes. - else if (rw_backcz1 <= rw_backfz1 && rw_backcz2 <= rw_backfz2) - { - solid = true; - doorclosed = true; - } else if ( - (backsector->ceilingpic != skyflatnum || - frontsector->ceilingpic != skyflatnum) + // properly render skies (consider door "open" if both ceilings are sky): + (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum) // if door is closed because back is shut: && rw_backcz1 <= rw_backfz1 && rw_backcz2 <= rw_backfz2 // preserve a kind of transparent door/lift special effect: - && rw_backcz1 >= rw_frontcz1 && rw_backcz2 >= rw_frontcz2 - + && ((rw_backcz1 >= rw_frontcz1 && rw_backcz2 >= rw_frontcz2) || line->sidedef->toptexture != 0) && ((rw_backfz1 <= rw_frontfz1 && rw_backfz2 <= rw_frontfz2) || line->sidedef->bottomtexture != 0)) { // killough 1/18/98 -- This function is used to fix the automap bug which diff --git a/src/r_plane.cpp b/src/r_plane.cpp index 655b0fdcd..f02aff714 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -632,6 +632,9 @@ visplane_t *R_CheckPlane (visplane_t *pl, int start, int stop) int unionl, unionh; int x; + assert (start >= 0 && start < viewwidth); + assert (stop >= start && stop < viewwidth); + if (start < pl->minx) { intrl = pl->minx; diff --git a/src/r_segs.cpp b/src/r_segs.cpp index c7e74c1f7..03d4ca715 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -384,8 +384,6 @@ clearfog: return; } -extern int *texturewidthmask; - // prevlineasm1 is like vlineasm1 but skips the loop if only drawing one pixel inline fixed_t prevline1 (fixed_t vince, byte *colormap, int count, fixed_t vplce, const byte *bufplce, byte *dest) { @@ -398,36 +396,6 @@ inline fixed_t prevline1 (fixed_t vince, byte *colormap, int count, fixed_t vplc return doprevline1 (); } -/* -esp+00 = edi -esp+04 = ebx -esp+08 = esi -esp+0c = ebp -esp+13 = bad -esp+14 = light -esp+18 = &uwal[x] -esp+1c = &lwal[x] -esp+20 = x2 -esp+24 = &dwal[x] -esp+28 = -esp+2c = xoffset -esp+30 = yrepeat -esp+34 = texturemid -esp+40 = y1ve[] -esp+50 = y2ve[] -esp+54 = -esp+58 = -esp+5c = -esp+60 = -esp+64 = uwal -esp+68 = dwal -esp+6c = swal -esp+70 = lwal -esp+74 = getcol -esi = x -ebp = x2 -*/ - void wallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t *lwal, const BYTE *(*getcol)(FTexture *tex, int x)) { @@ -474,6 +442,8 @@ void wallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t y1ve[0] = uwal[x];//max(uwal[x],umost[x]); y2ve[0] = dwal[x];//min(dwal[x],dmost[x]); if (y2ve[0] <= y1ve[0]) continue; + assert (y1ve[0] < viewheight); + assert (y2ve[0] <= viewheight); if (!fixedcolormap) { // calculate lighting @@ -497,6 +467,8 @@ void wallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t y1ve[z] = uwal[x+z];//max(uwal[x+z],umost[x+z]); y2ve[z] = dwal[x+z];//min(dwal[x+z],dmost[x+z])-1; if (y2ve[z] <= y1ve[z]) { bad += 1<> FRACBITS); vince[z] = swal[x+z] * yrepeat; @@ -563,6 +535,8 @@ void wallscan (int x1, int x2, short *uwal, short *dwal, fixed_t *swal, fixed_t y1ve[0] = uwal[x];//max(uwal[x],umost[x]); y2ve[0] = dwal[x];//min(dwal[x],dmost[x]); if (y2ve[0] <= y1ve[0]) continue; + assert (y1ve[0] < viewheight); + assert (y2ve[0] <= viewheight); if (!fixedcolormap) { // calculate lighting diff --git a/src/r_sky.cpp b/src/r_sky.cpp index e77d99592..64179ea69 100644 --- a/src/r_sky.cpp +++ b/src/r_sky.cpp @@ -36,8 +36,6 @@ #include "v_text.h" #include "gi.h" -extern int *texturewidthmask; - // // sky mapping //