From 6d9b897681f096c0d417e56a63d3447eb638bdbe Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 20 Jul 2008 08:34:24 +0000 Subject: [PATCH] - fixed: Textures marked as complex must not redirect to the base patch. - fixed: Alpha for composite textures was not applied. - fixed: The CentaurMash didn't inherit from the Centaur. - added some NULL pointer checks to the sound code. SVN r1075 (trunk) --- docs/rh-log.txt | 6 ++++++ src/s_sound.cpp | 20 +++++++++++++------- src/textures/multipatchtexture.cpp | 9 +++------ wadsrc/decorate/hexen/centaur.txt | 2 +- 4 files changed, 23 insertions(+), 14 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index ecc101c8a..117f73624 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,9 @@ +July 20, 2008 (Changes by Graf Zahl) +- fixed: Textures marked as complex must not redirect to the base patch. +- fixed: Alpha for composite textures was not applied. +- fixed: The CentaurMash didn't inherit from the Centaur. +- added some NULL pointer checks to the sound code. + July 19, 2008 (Changes by Graf Zahl) - Fixed: When Heretic's Mace was replaced by a non-child class A_SpawnMace still treated it as a mace and wrote into some undefined memory. diff --git a/src/s_sound.cpp b/src/s_sound.cpp index 327e839fe..a50d5c332 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -647,9 +647,12 @@ static void CalcPosVel(int type, const AActor *actor, const sector_t *sector, break; case SOURCE_Actor: - x = actor->x; - y = actor->z; - z = actor->y; + if (actor != NULL) + { + x = actor->x; + y = actor->z; + z = actor->y; + } break; case SOURCE_Sector: @@ -691,9 +694,12 @@ static void CalcPosVel(int type, const AActor *actor, const sector_t *sector, // Only actors maintain velocity information. if (type == SOURCE_Actor) { - vel->X = FIXED2FLOAT(actor->momx) * TICRATE; - vel->Y = FIXED2FLOAT(actor->momz) * TICRATE; - vel->Z = FIXED2FLOAT(actor->momy) * TICRATE; + if (actor != NULL) + { + vel->X = FIXED2FLOAT(actor->momx) * TICRATE; + vel->Y = FIXED2FLOAT(actor->momz) * TICRATE; + vel->Z = FIXED2FLOAT(actor->momy) * TICRATE; + } } else { @@ -1083,7 +1089,7 @@ void S_RestartSound(FSoundChan *chan) // be set. if (ochan->SourceType == SOURCE_Actor) { - ochan->Actor->SoundChans |= 1 << ochan->EntChannel; + if (ochan->Actor != NULL) ochan->Actor->SoundChans |= 1 << ochan->EntChannel; } } } diff --git a/src/textures/multipatchtexture.cpp b/src/textures/multipatchtexture.cpp index c70345fe5..01c50962a 100644 --- a/src/textures/multipatchtexture.cpp +++ b/src/textures/multipatchtexture.cpp @@ -574,7 +574,6 @@ int FMultiPatchTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rota if (b.a == 0 && b.r != BLEND_NONE) { info.blend = EBlend(b.r); - inf = &info; } else if (b.a != 0) { @@ -584,7 +583,6 @@ int FMultiPatchTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rota info.blendcolor[1] = b.g * FRACUNIT / 255; info.blendcolor[2] = b.b * FRACUNIT / 255; info.blend = BLEND_MODULATE; - inf = &info; } else { @@ -594,10 +592,9 @@ int FMultiPatchTexture::CopyTrueColorPixels(FBitmap *bmp, int x, int y, int rota info.blendcolor[2] = b.b * (FRACUNIT-info.blendcolor[3]); info.blend = BLEND_OVERLAY; - inf = &info; } } - ret = Parts[i].Texture->CopyTrueColorPixels(bmp, x+Parts[i].OriginX, y+Parts[i].OriginY, Parts[i].Rotate, inf); + ret = Parts[i].Texture->CopyTrueColorPixels(bmp, x+Parts[i].OriginX, y+Parts[i].OriginY, Parts[i].Rotate, &info); } } else @@ -1121,7 +1118,6 @@ void FMultiPatchTexture::ParsePatch(FScanner &sc, TexPart & part) part.Blend.a = clamp(int(sc.Float*255), 1, 254); } else part.Blend.a = 255; - bComplex = true; } else if (sc.Compare("alpha")) { @@ -1230,7 +1226,8 @@ FMultiPatchTexture::FMultiPatchTexture (FScanner &sc, int usetype) if (Parts->OriginX == 0 && Parts->OriginY == 0 && Parts->Texture->GetWidth() == Width && Parts->Texture->GetHeight() == Height && - Parts->Rotate == 0) + Parts->Rotate == 0 && + !bComplex) { bRedirect = true; } diff --git a/wadsrc/decorate/hexen/centaur.txt b/wadsrc/decorate/hexen/centaur.txt index b84c1f423..445f959b4 100644 --- a/wadsrc/decorate/hexen/centaur.txt +++ b/wadsrc/decorate/hexen/centaur.txt @@ -102,7 +102,7 @@ ACTOR CentaurLeader : Centaur 115 // The mashed centaur is only placed through ACS. Nowhere in the game source // is it ever referenced. -ACTOR CentaurMash +ACTOR CentaurMash : Centaur { Game Hexen SpawnID 103