mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-29 07:22:07 +00:00
- added SMMU/Eternity method of defining warped textures (Patch by Gez)
SVN r3433 (trunk)
This commit is contained in:
parent
ce43552ebb
commit
365311ec36
1 changed files with 38 additions and 30 deletions
|
@ -198,16 +198,23 @@ void FTextureManager::InitAnimated (void)
|
|||
!(pic2 = CheckForTexture (anim_p + 1 /* .startname */, FTexture::TEX_Flat, texflags)).Exists())
|
||||
continue;
|
||||
}
|
||||
if (pic1 == pic2)
|
||||
{
|
||||
// This animation only has one frame. Skip it. (Doom aborted instead.)
|
||||
Printf ("Animation %s in ANIMATED has only one frame\n", anim_p + 10);
|
||||
continue;
|
||||
}
|
||||
|
||||
FTexture *tex1 = Texture(pic1);
|
||||
FTexture *tex2 = Texture(pic2);
|
||||
|
||||
animspeed = (BYTE(anim_p[19]) << 0) | (BYTE(anim_p[20]) << 8) |
|
||||
(BYTE(anim_p[21]) << 16) | (BYTE(anim_p[22]) << 24);
|
||||
|
||||
// SMMU-style swirly hack? Don't apply on already-warping texture
|
||||
if (animspeed > 65535 && tex1 != null && !tex1->bWarped)
|
||||
{
|
||||
FTexture *warper = new FWarp2Texture (tex1);
|
||||
ReplaceTexture (pic1, warper, false);
|
||||
}
|
||||
// These tests were not really relevant for swirling textures, or even potentially
|
||||
// harmful, so they have been moved to the else block.
|
||||
else
|
||||
{
|
||||
if (tex1->UseType != tex2->UseType)
|
||||
{
|
||||
// not the same type -
|
||||
|
@ -221,21 +228,22 @@ void FTextureManager::InitAnimated (void)
|
|||
tex2->Name, pic2.GetIndex(), tex2->GetSourceLump(), Wads.GetLumpFile(tex2->GetSourceLump()));
|
||||
}
|
||||
|
||||
if (pic1 == pic2)
|
||||
{
|
||||
// This animation only has one frame. Skip it. (Doom aborted instead.)
|
||||
Printf ("Animation %s in ANIMATED has only one frame\n", anim_p + 10);
|
||||
continue;
|
||||
}
|
||||
// [RH] Allow for backward animations as well as forward.
|
||||
if (pic1 > pic2)
|
||||
else if (pic1 > pic2)
|
||||
{
|
||||
swapvalues (pic1, pic2);
|
||||
animtype = FAnimDef::ANIM_Backward;
|
||||
}
|
||||
|
||||
// Speed is stored as tics, but we want ms so scale accordingly.
|
||||
animspeed = /* .speed */
|
||||
Scale ((BYTE(anim_p[19]) << 0) |
|
||||
(BYTE(anim_p[20]) << 8) |
|
||||
(BYTE(anim_p[21]) << 16) |
|
||||
(BYTE(anim_p[22]) << 24), 1000, 35);
|
||||
|
||||
AddSimpleAnim (pic1, pic2 - pic1 + 1, animtype, animspeed);
|
||||
AddSimpleAnim (pic1, pic2 - pic1 + 1, animtype, Scale (animspeed, 1000, 35));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue