From bbda4622e70ebcd44683f2ff0f62a9dcdd88cfaa Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 18 Jan 2009 09:31:49 +0000 Subject: [PATCH] - Added a CopyInfo function to FTexture that contains all code required to clone a texture. Used for creating warping textures. - Fixed: P_FindFloorCeiling should not be called before setting the actor's z- coordinate. For testing 3D Midtex lines and 3D floors the proper position needs to be set first. - Fixed the autoaim fix from Jan 10. SVN r1358 (trunk) --- docs/rh-log.txt | 8 ++++++++ src/d_player.h | 2 +- src/p_3dfloors.cpp | 8 +++----- src/p_lnspec.cpp | 2 +- src/p_mobj.cpp | 23 +++++++++++++++++------ src/textures/textures.h | 6 ++++++ src/textures/warptexture.cpp | 4 +--- 7 files changed, 37 insertions(+), 16 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index e85041a64..92bdaf8e5 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,11 @@ +January 18, 2009 (Changes by Graf Zahl) +- Added a CopyInfo function to FTexture that contains all code required to + clone a texture. Used for creating warping textures. +- Fixed: P_FindFloorCeiling should not be called before setting the actor's z- + coordinate. For testing 3D Midtex lines and 3D floors the proper position + needs to be set first. +- Fixed the autoaim fix from Jan 10. + January 11, 2009 (Changes by Graf Zahl) - Added option to specify the amount of ammo to be given by a WeaponGiver. diff --git a/src/d_player.h b/src/d_player.h index b8fec8173..e43c0f18c 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -204,7 +204,7 @@ struct userinfo_t fixed_t MoveBob, StillBob; int PlayerClass; - int GetAimDist() const { return (dmflags2 & DF2_NOAUTOAIM)? aimdist : 0; } + int GetAimDist() const { return (dmflags2 & DF2_NOAUTOAIM)? 0 : aimdist; } }; FArchive &operator<< (FArchive &arc, userinfo_t &info); diff --git a/src/p_3dfloors.cpp b/src/p_3dfloors.cpp index 68e9e1883..f66aed72c 100644 --- a/src/p_3dfloors.cpp +++ b/src/p_3dfloors.cpp @@ -558,7 +558,7 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li fixed_t thingbot, thingtop; thingbot = thing->z; - thingtop = thingbot + thing->height; + thingtop = thingbot + (thing->height==0? 1:thing->height); extsector_t::xfloor *xf[2] = {&linedef->frontsector->e->XFloor, &linedef->backsector->e->XFloor}; @@ -575,16 +575,14 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li highestfloorpic.SetInvalid(); lowestceilingpic.SetInvalid(); - thingtop = thing->z + (thing->height==0? 1:thing->height); for(int j=0;j<2;j++) { - // Check for frontsector's 3D-floors for(unsigned i=0;iffloors.Size();i++) { F3DFloor *rover = xf[j]->ffloors[i]; - if (!(rover->flags&FF_EXISTS)) continue; + if (!(rover->flags & FF_EXISTS)) continue; if (!(rover->flags & FF_SOLID)) continue; fixed_t ff_bottom=rover->bottom.plane->ZatPoint(x, y); @@ -604,7 +602,7 @@ void P_LineOpening_XFloors (FLineOpening &open, AActor * thing, const line_t *li highestfloor = ff_top; highestfloorpic = *rover->top.texture; } - if(ff_top > lowestfloor[j] && ff_top <= thing->z) lowestfloor[j] = ff_top; + if(ff_top > lowestfloor[j] && ff_top <= thing->z + thing->MaxStepHeight) lowestfloor[j] = ff_top; } } diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 313de4424..112053435 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -782,7 +782,7 @@ FUNC(LS_Teleport_NewMap) FUNC(LS_Teleport) // Teleport (tid, sectortag, bNoSourceFog) - { +{ return EV_Teleport (arg0, arg1, ln, backSide, it, true, !arg2, false); } diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 666c70b60..2ffa74e7d 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -3214,13 +3214,27 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t if (G_SkillProperty(SKILLP_FastMonsters)) actor->Speed = actor->GetClass()->Meta.GetMetaFixed(AMETA_FastSpeed, actor->Speed); + // set subsector and/or block links actor->LinkToWorld (SpawningMapThing); + + actor->dropoffz = // killough 11/98: for tracking dropoffs + actor->floorz = actor->Sector->floorplane.ZatPoint (ix, iy); + actor->ceilingz = actor->Sector->ceilingplane.ZatPoint (ix, iy); + + // The z-coordinate needs to be set once before calling P_FindFloorCeiling + // For FLOATRANDZ just use the floor here. + if (iz == ONFLOORZ || iz == FLOATRANDZ) + { + actor->z = actor->floorz; + } + else if (iz == ONCEILINGZ) + { + actor->z = actor->ceilingz - actor->height; + } + if (SpawningMapThing || !type->IsDescendantOf (RUNTIME_CLASS(APlayerPawn))) { - actor->dropoffz = // killough 11/98: for tracking dropoffs - actor->floorz = actor->Sector->floorplane.ZatPoint (ix, iy); - actor->ceilingz = actor->Sector->ceilingplane.ZatPoint (ix, iy); actor->floorsector = actor->Sector; actor->floorpic = actor->floorsector->GetTexture(sector_t::floor); actor->ceilingsector = actor->Sector; @@ -3236,9 +3250,6 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t } else { - actor->floorz = FIXED_MIN; - actor->dropoffz = FIXED_MIN; - actor->ceilingz = FIXED_MAX; actor->floorpic = actor->Sector->GetTexture(sector_t::floor); actor->floorsector = actor->Sector; actor->ceilingpic = actor->Sector->GetTexture(sector_t::ceiling); diff --git a/src/textures/textures.h b/src/textures/textures.h index b69e89226..af6fe7268 100644 --- a/src/textures/textures.h +++ b/src/textures/textures.h @@ -219,6 +219,12 @@ protected: Span **CreateSpans (const BYTE *pixels) const; void FreeSpans (Span **spans) const; void CalcBitSize (); + void CopyInfo(FTexture *other) + { + CopySize(other); + bNoDecals = other->bNoDecals; + Rotations = other->Rotations; + } static void FlipSquareBlock (BYTE *block, int x, int y); static void FlipSquareBlockRemap (BYTE *block, int x, int y, const BYTE *remap); diff --git a/src/textures/warptexture.cpp b/src/textures/warptexture.cpp index 6e30e0365..f87688ea1 100644 --- a/src/textures/warptexture.cpp +++ b/src/textures/warptexture.cpp @@ -43,9 +43,7 @@ FWarpTexture::FWarpTexture (FTexture *source) : GenTime (0), SourcePic (source), Pixels (0), Spans (0), Speed (1.f) { - CopySize(source); - bNoDecals = source->bNoDecals; - Rotations = source->Rotations; + CopyInfo(source); bWarped = 1; }