From 060d7402755ab06601608f50220e85216f45ebbd Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Wed, 2 Feb 2011 02:07:36 +0000 Subject: [PATCH] - Fixed: Fake floor's validcounts were not initialized. - Fixed: When loading non-UDMF maps, things did not have their conversation field zero'ed. - Added an assert for the FAKE3D_REFRESHCLIP case at the end of R_RenderMaskedSegRange(), because Valgrind indicates this is being run without ds->bkup being set to something valid. I do not immediately know how this should be fixed. SVN r3130 (trunk) --- src/CMakeLists.txt | 2 ++ src/p_3dfloors.cpp | 7 ++++--- src/p_setup.cpp | 2 ++ src/r_segs.cpp | 12 ++++++++---- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 940e375ee..33465a1fd 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -57,6 +57,8 @@ foreach( majver ${MAJOR_VERSIONS} ) endforeach( dir ${FMOD_DIR_VERSIONS} ) endforeach( majver ${MAJOR_VERSIONS} ) +message( STATUS "${FMOD_DIR_VERSIONS}" ) + if( WIN32 ) if( X64 ) set( WIN_TYPE Win64 ) diff --git a/src/p_3dfloors.cpp b/src/p_3dfloors.cpp index 558fb874c..15e372aca 100644 --- a/src/p_3dfloors.cpp +++ b/src/p_3dfloors.cpp @@ -123,8 +123,9 @@ static void P_Add3DFloor(sector_t* sec, sector_t* sec2, line_t* master, int flag ffloor->top.model = ffloor->bottom.model = ffloor->model = sec2; ffloor->target = sec; ffloor->ceilingclip = ffloor->floorclip = NULL; - - if (!(flags&FF_THINFLOOR)) + ffloor->validcount = 0; + + if (!(flags&FF_THINFLOOR)) { ffloor->bottom.plane = &sec2->floorplane; ffloor->bottom.texture = &sec2->planes[sector_t::floor].Texture; @@ -898,4 +899,4 @@ int P_Find3DFloor(sector_t * sec, fixed_t x, fixed_t y, fixed_t z, bool above, b return -1; } -#endif \ No newline at end of file +#endif diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 1d20a6f7a..1b691cfee 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -1653,6 +1653,7 @@ void P_LoadThings (MapData * map) memset (&mti[i], 0, sizeof(mti[i])); + mti[i].Conversation = 0; mti[i].SkillFilter = MakeSkill(flags); mti[i].ClassFilter = 0xffff; // Doom map format doesn't have class flags so spawn for all player classes flags &= ~MTF_SKILLMASK; @@ -1726,6 +1727,7 @@ void P_LoadThings2 (MapData * map) mti[i].SkillFilter = MakeSkill(mti[i].flags); mti[i].ClassFilter = (mti[i].flags & MTF_CLASS_MASK) >> MTF_CLASS_SHIFT; mti[i].flags &= ~(MTF_SKILLMASK|MTF_CLASS_MASK); + mti[i].Conversation = 0; } delete[] mtp; } diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 22ae404fb..0f1eec676 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -279,7 +279,10 @@ void R_RenderMaskedSegRange (drawseg_t *ds, int x1, int x2) goto clearfog; } } - if(ds->bFakeBoundary && !(ds->bFakeBoundary & 4) || drawmode == DontDraw) goto clearfog; + if ((ds->bFakeBoundary && !(ds->bFakeBoundary & 4)) || drawmode == DontDraw) + { + goto clearfog; + } MaskedSWall = (fixed_t *)(openings + ds->swall) - ds->x1; MaskedScaleY = ds->yrepeat; @@ -478,6 +481,7 @@ clearfog: } if (fake3D & FAKE3D_REFRESHCLIP) { + assert(ds->bkup >= 0); memcpy(openings + ds->sprtopclip, openings + ds->bkup, (ds->x2-ds->x1+1) * 2); } else @@ -814,7 +818,7 @@ void R_RenderFakeWallRange (drawseg_t *ds, int x1, int x2) rover->bottom.plane->Zat0() >= sclipTop || rover->top.plane->Zat0() <= floorheight) { - if (i == backsector->e->XFloor.ffloors.Size() - 1) + if ((unsigned)i == backsector->e->XFloor.ffloors.Size() - 1) { passed = 1; } @@ -855,7 +859,7 @@ void R_RenderFakeWallRange (drawseg_t *ds, int x1, int x2) break; } // nothing - if (!fover || j == frontsector->e->XFloor.ffloors.Size()) + if (!fover || (unsigned)j == frontsector->e->XFloor.ffloors.Size()) { break; } @@ -912,7 +916,7 @@ void R_RenderFakeWallRange (drawseg_t *ds, int x1, int x2) fover = NULL; // visible break; } - if (fover && j != frontsector->e->XFloor.ffloors.Size()) + if (fover && (unsigned)j != frontsector->e->XFloor.ffloors.Size()) { // not visible break; }