2016-03-01 15:47:10 +00:00
|
|
|
/*
|
|
|
|
** p_switch.cpp
|
|
|
|
** Switch and button maintenance and animation
|
|
|
|
**
|
|
|
|
**---------------------------------------------------------------------------
|
|
|
|
** Copyright 1998-2006 Randy Heit
|
|
|
|
** All rights reserved.
|
|
|
|
**
|
|
|
|
** Redistribution and use in source and binary forms, with or without
|
|
|
|
** modification, are permitted provided that the following conditions
|
|
|
|
** are met:
|
|
|
|
**
|
|
|
|
** 1. Redistributions of source code must retain the above copyright
|
|
|
|
** notice, this list of conditions and the following disclaimer.
|
|
|
|
** 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
** notice, this list of conditions and the following disclaimer in the
|
|
|
|
** documentation and/or other materials provided with the distribution.
|
|
|
|
** 3. The name of the author may not be used to endorse or promote products
|
|
|
|
** derived from this software without specific prior written permission.
|
|
|
|
**
|
|
|
|
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
**---------------------------------------------------------------------------
|
|
|
|
**
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "templates.h"
|
|
|
|
#include "i_system.h"
|
|
|
|
#include "doomdef.h"
|
|
|
|
#include "p_local.h"
|
|
|
|
#include "p_lnspec.h"
|
|
|
|
#include "p_3dmidtex.h"
|
|
|
|
#include "m_random.h"
|
|
|
|
#include "g_game.h"
|
|
|
|
#include "s_sound.h"
|
|
|
|
#include "doomstat.h"
|
|
|
|
#include "r_state.h"
|
|
|
|
#include "w_wad.h"
|
|
|
|
#include "tarray.h"
|
|
|
|
#include "cmdlib.h"
|
2016-09-19 22:41:22 +00:00
|
|
|
#include "serializer.h"
|
2016-03-01 15:47:10 +00:00
|
|
|
#include "p_maputl.h"
|
|
|
|
#include "p_spec.h"
|
2017-03-10 01:22:42 +00:00
|
|
|
#include "textures.h"
|
|
|
|
#include "actor.h"
|
|
|
|
#include "actorinlines.h"
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
#include "gi.h"
|
|
|
|
|
|
|
|
static FRandom pr_switchanim ("AnimSwitch");
|
|
|
|
|
|
|
|
class DActiveButton : public DThinker
|
|
|
|
{
|
|
|
|
DECLARE_CLASS (DActiveButton, DThinker)
|
|
|
|
public:
|
|
|
|
DActiveButton ();
|
2016-03-28 22:31:59 +00:00
|
|
|
DActiveButton (side_t *, int, FSwitchDef *, const DVector2 &pos, bool flippable);
|
2016-03-01 15:47:10 +00:00
|
|
|
|
2016-09-19 22:41:22 +00:00
|
|
|
void Serialize(FSerializer &arc);
|
2016-03-01 15:47:10 +00:00
|
|
|
void Tick ();
|
|
|
|
|
|
|
|
side_t *m_Side;
|
2017-03-08 14:20:00 +00:00
|
|
|
int8_t m_Part;
|
2016-03-01 15:47:10 +00:00
|
|
|
bool bFlippable;
|
|
|
|
bool bReturning;
|
|
|
|
FSwitchDef *m_SwitchDef;
|
2017-03-03 18:35:08 +00:00
|
|
|
int32_t m_Frame;
|
2017-03-08 14:20:00 +00:00
|
|
|
uint32_t m_Timer;
|
2016-03-28 22:31:59 +00:00
|
|
|
DVector2 m_Pos;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
bool AdvanceFrame ();
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Start a button counting down till it turns off.
|
|
|
|
// [RH] Rewritten to remove MAXBUTTONS limit.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2016-03-28 22:31:59 +00:00
|
|
|
static bool P_StartButton (side_t *side, int Where, FSwitchDef *Switch, const DVector2 &pos, bool useagain)
|
2016-03-01 15:47:10 +00:00
|
|
|
{
|
|
|
|
DActiveButton *button;
|
|
|
|
TThinkerIterator<DActiveButton> iterator;
|
|
|
|
|
|
|
|
// See if button is already pressed
|
|
|
|
while ( (button = iterator.Next ()) )
|
|
|
|
{
|
|
|
|
if (button->m_Side == side)
|
|
|
|
{
|
|
|
|
button->m_Timer=1; // force advancing to the next frame
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-04-14 11:31:58 +00:00
|
|
|
Create<DActiveButton> (side, Where, Switch, pos, useagain);
|
2016-03-01 15:47:10 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Checks whether a switch is reachable
|
|
|
|
// This is optional because old maps can rely on being able to
|
|
|
|
// use non-reachable switches.
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2016-03-27 18:58:01 +00:00
|
|
|
bool P_CheckSwitchRange(AActor *user, line_t *line, int sideno, const DVector3 *optpos)
|
2016-03-01 15:47:10 +00:00
|
|
|
{
|
|
|
|
// Activated from an empty side -> always succeed
|
|
|
|
side_t *side = line->sidedef[sideno];
|
|
|
|
if (side == NULL)
|
|
|
|
return true;
|
|
|
|
|
2016-03-26 11:36:15 +00:00
|
|
|
double checktop;
|
|
|
|
double checkbot;
|
2016-03-01 15:47:10 +00:00
|
|
|
sector_t *front = side->sector;
|
|
|
|
FLineOpening open;
|
|
|
|
int flags = line->flags;
|
|
|
|
|
|
|
|
if (!side->GetTexture(side_t::mid).isValid())
|
|
|
|
{ // Do not force range checks for 3DMIDTEX lines if there is no actual midtexture.
|
|
|
|
flags &= ~ML_3DMIDTEX;
|
|
|
|
}
|
|
|
|
|
|
|
|
// 3DMIDTEX forces CHECKSWITCHRANGE because otherwise it might cause problems.
|
|
|
|
if (!(flags & (ML_3DMIDTEX|ML_CHECKSWITCHRANGE)))
|
|
|
|
return true;
|
|
|
|
|
|
|
|
// calculate the point where the user would touch the wall.
|
2016-03-27 18:58:01 +00:00
|
|
|
divline_t dll, dlu;
|
|
|
|
double inter;
|
|
|
|
DVector2 check;
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
P_MakeDivline (line, &dll);
|
|
|
|
|
2016-03-27 18:58:01 +00:00
|
|
|
DVector3 pos = optpos? *optpos : user->PosRelative(line);
|
|
|
|
dlu.x = pos.X;
|
|
|
|
dlu.y = pos.Y;
|
|
|
|
dlu.dx = user->Angles.Yaw.Cos();
|
|
|
|
dlu.dy = user->Angles.Yaw.Sin();
|
2016-03-01 15:47:10 +00:00
|
|
|
inter = P_InterceptVector(&dll, &dlu);
|
|
|
|
|
|
|
|
|
|
|
|
// Polyobjects must test the containing sector, not the one they originate from.
|
|
|
|
if (line->sidedef[0]->Flags & WALLF_POLYOBJ)
|
|
|
|
{
|
|
|
|
// Get a check point slightly inside the polyobject so that this still works
|
|
|
|
// if the polyobject lies directly on a sector boundary
|
2016-03-27 18:58:01 +00:00
|
|
|
check.X = dll.x + dll.dx * (inter + 0.01);
|
|
|
|
check.Y = dll.y + dll.dy * (inter + 0.01);
|
|
|
|
front = P_PointInSector(check);
|
2016-03-01 15:47:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2016-03-27 18:58:01 +00:00
|
|
|
check.X = dll.x + dll.dx * inter;
|
|
|
|
check.Y = dll.y + dll.dy * inter;
|
2016-03-01 15:47:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// one sided line or polyobject
|
|
|
|
if (line->sidedef[1] == NULL || (line->sidedef[0]->Flags & WALLF_POLYOBJ))
|
|
|
|
{
|
|
|
|
onesided:
|
2016-03-27 18:58:01 +00:00
|
|
|
double sectorc = front->ceilingplane.ZatPoint(check);
|
|
|
|
double sectorf = front->floorplane.ZatPoint(check);
|
|
|
|
return (user->Top() >= sectorf && user->Z() <= sectorc);
|
2016-03-01 15:47:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Now get the information from the line.
|
2016-03-27 18:58:01 +00:00
|
|
|
P_LineOpening(open, NULL, line, check, &pos);
|
2016-03-01 15:47:10 +00:00
|
|
|
if (open.range <= 0)
|
|
|
|
goto onesided;
|
|
|
|
|
|
|
|
if ((TexMan.FindSwitch(side->GetTexture(side_t::top))) != NULL)
|
|
|
|
{
|
|
|
|
|
|
|
|
// Check 3D floors on back side
|
|
|
|
{
|
|
|
|
sector_t * back = line->sidedef[1 - sideno]->sector;
|
2016-03-28 22:31:59 +00:00
|
|
|
for (auto rover : back->e->XFloor.ffloors)
|
2016-03-01 15:47:10 +00:00
|
|
|
{
|
|
|
|
if (!(rover->flags & FF_EXISTS)) continue;
|
|
|
|
if (!(rover->flags & FF_UPPERTEXTURE)) continue;
|
|
|
|
|
2016-03-28 22:31:59 +00:00
|
|
|
if (user->isAbove(rover->top.plane->ZatPoint(check)) ||
|
2016-03-27 18:58:01 +00:00
|
|
|
user->Top() < rover->bottom.plane->ZatPoint(check))
|
2016-03-01 15:47:10 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
// This 3D floor depicts a switch texture in front of the player's eyes
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-25 17:19:54 +00:00
|
|
|
return (user->Top() > open.top);
|
2016-03-01 15:47:10 +00:00
|
|
|
}
|
|
|
|
else if ((TexMan.FindSwitch(side->GetTexture(side_t::bottom))) != NULL)
|
|
|
|
{
|
|
|
|
// Check 3D floors on back side
|
|
|
|
{
|
|
|
|
sector_t * back = line->sidedef[1 - sideno]->sector;
|
|
|
|
for (unsigned i = 0; i < back->e->XFloor.ffloors.Size(); i++)
|
|
|
|
{
|
|
|
|
F3DFloor *rover = back->e->XFloor.ffloors[i];
|
|
|
|
if (!(rover->flags & FF_EXISTS)) continue;
|
|
|
|
if (!(rover->flags & FF_LOWERTEXTURE)) continue;
|
|
|
|
|
2016-03-28 22:31:59 +00:00
|
|
|
if (user->isAbove(rover->top.plane->ZatPoint(check)) ||
|
2016-03-27 18:58:01 +00:00
|
|
|
user->Top() < rover->bottom.plane->ZatPoint(check))
|
2016-03-01 15:47:10 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
// This 3D floor depicts a switch texture in front of the player's eyes
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-25 17:19:54 +00:00
|
|
|
return (user->Z() < open.bottom);
|
2016-03-01 15:47:10 +00:00
|
|
|
}
|
|
|
|
else if ((flags & ML_3DMIDTEX) || (TexMan.FindSwitch(side->GetTexture(side_t::mid))) != NULL)
|
|
|
|
{
|
|
|
|
// 3DMIDTEX lines will force a mid texture check if no switch is found on this line
|
|
|
|
// to keep compatibility with Eternity's implementation.
|
|
|
|
if (!P_GetMidTexturePosition(line, sideno, &checktop, &checkbot))
|
|
|
|
return false;
|
2016-03-28 22:31:59 +00:00
|
|
|
return user->isBelow(checktop) && user->Top() > checkbot;
|
2016-03-01 15:47:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// no switch found. Check whether the player can touch either top or bottom texture
|
2016-03-28 22:31:59 +00:00
|
|
|
return (user->Top() > open.top) || (user->isBelow(open.bottom));
|
2016-03-01 15:47:10 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Function that changes wall texture.
|
|
|
|
// Tell it if switch is ok to use again (1=yes, it's a button).
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2017-03-08 14:20:00 +00:00
|
|
|
bool P_ChangeSwitchTexture (side_t *side, int useAgain, uint8_t special, bool *quest)
|
2016-03-01 15:47:10 +00:00
|
|
|
{
|
|
|
|
int texture;
|
|
|
|
int sound;
|
|
|
|
FSwitchDef *Switch;
|
|
|
|
|
|
|
|
if ((Switch = TexMan.FindSwitch (side->GetTexture(side_t::top))) != NULL)
|
|
|
|
{
|
|
|
|
texture = side_t::top;
|
|
|
|
}
|
|
|
|
else if ((Switch = TexMan.FindSwitch (side->GetTexture(side_t::bottom))) != NULL)
|
|
|
|
{
|
|
|
|
texture = side_t::bottom;
|
|
|
|
}
|
|
|
|
else if ((Switch = TexMan.FindSwitch (side->GetTexture(side_t::mid))) != NULL)
|
|
|
|
{
|
|
|
|
texture = side_t::mid;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (quest != NULL)
|
|
|
|
{
|
|
|
|
*quest = false;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// EXIT SWITCH?
|
|
|
|
if (Switch->Sound != 0)
|
|
|
|
{
|
|
|
|
sound = Switch->Sound;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
sound = S_FindSound (
|
|
|
|
special == Exit_Normal ||
|
|
|
|
special == Exit_Secret ||
|
|
|
|
special == Teleport_NewMap ||
|
|
|
|
special == Teleport_EndGame
|
|
|
|
? "switches/exitbutn" : "switches/normbutn");
|
|
|
|
}
|
|
|
|
|
|
|
|
// [RH] The original code played the sound at buttonlist->soundorg,
|
|
|
|
// which wasn't necessarily anywhere near the switch if it was
|
|
|
|
// facing a big sector (and which wasn't necessarily for the
|
|
|
|
// button just activated, either).
|
2016-03-31 19:13:32 +00:00
|
|
|
DVector2 pt(side->linedef->v1->fPos() + side->linedef->Delta() / 2);
|
2016-03-01 15:47:10 +00:00
|
|
|
bool playsound;
|
|
|
|
|
|
|
|
side->SetTexture(texture, Switch->frames[0].Texture);
|
|
|
|
if (useAgain || Switch->NumFrames > 1)
|
|
|
|
{
|
2016-03-28 22:31:59 +00:00
|
|
|
playsound = P_StartButton (side, texture, Switch, pt, !!useAgain);
|
2016-03-01 15:47:10 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
playsound = true;
|
|
|
|
}
|
|
|
|
if (playsound)
|
|
|
|
{
|
2016-03-28 22:31:59 +00:00
|
|
|
S_Sound (DVector3(pt, 0), CHAN_VOICE|CHAN_LISTENERZ, sound, 1, ATTN_STATIC);
|
2016-03-01 15:47:10 +00:00
|
|
|
}
|
|
|
|
if (quest != NULL)
|
|
|
|
{
|
|
|
|
*quest = Switch->QuestPanel;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Button thinker
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2016-11-24 20:36:02 +00:00
|
|
|
IMPLEMENT_CLASS(DActiveButton, false, false)
|
2016-03-01 15:47:10 +00:00
|
|
|
|
|
|
|
DActiveButton::DActiveButton ()
|
|
|
|
{
|
|
|
|
m_Side = NULL;
|
|
|
|
m_Part = -1;
|
|
|
|
m_SwitchDef = 0;
|
|
|
|
m_Timer = 0;
|
2016-03-28 22:31:59 +00:00
|
|
|
m_Pos = { 0,0 };
|
2016-03-01 15:47:10 +00:00
|
|
|
bFlippable = false;
|
|
|
|
bReturning = false;
|
|
|
|
m_Frame = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
DActiveButton::DActiveButton (side_t *side, int Where, FSwitchDef *Switch,
|
2016-03-28 22:31:59 +00:00
|
|
|
const DVector2 &pos, bool useagain)
|
2016-03-01 15:47:10 +00:00
|
|
|
{
|
|
|
|
m_Side = side;
|
2017-03-08 14:20:00 +00:00
|
|
|
m_Part = int8_t(Where);
|
2016-03-28 22:31:59 +00:00
|
|
|
m_Pos = pos;
|
2016-03-01 15:47:10 +00:00
|
|
|
bFlippable = useagain;
|
|
|
|
bReturning = false;
|
|
|
|
|
|
|
|
m_SwitchDef = Switch;
|
|
|
|
m_Frame = -1;
|
|
|
|
AdvanceFrame ();
|
|
|
|
}
|
|
|
|
|
2016-09-19 22:41:22 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// operator<<
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
template<> FSerializer &Serialize (FSerializer &arc, const char *key, FSwitchDef* &Switch, FSwitchDef **def)
|
|
|
|
{
|
|
|
|
if (arc.isWriting())
|
|
|
|
{
|
|
|
|
Serialize(arc, key, Switch->PreTexture, nullptr);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
FTextureID tex;
|
|
|
|
tex.SetInvalid();
|
|
|
|
Serialize(arc, key, tex, nullptr);
|
|
|
|
Switch = TexMan.FindSwitch(tex);
|
|
|
|
}
|
|
|
|
return arc;
|
|
|
|
}
|
|
|
|
|
2016-03-01 15:47:10 +00:00
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
2016-09-19 22:41:22 +00:00
|
|
|
void DActiveButton::Serialize(FSerializer &arc)
|
2016-03-01 15:47:10 +00:00
|
|
|
{
|
|
|
|
Super::Serialize (arc);
|
2016-09-19 22:41:22 +00:00
|
|
|
arc("side", m_Side)
|
|
|
|
("part", m_Part)
|
|
|
|
("switchdef", m_SwitchDef)
|
|
|
|
("frame", m_Frame)
|
|
|
|
("timer", m_Timer)
|
|
|
|
("fippable", bFlippable)
|
|
|
|
("pos", m_Pos)
|
|
|
|
("returning", bReturning);
|
2016-03-01 15:47:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
void DActiveButton::Tick ()
|
|
|
|
{
|
|
|
|
if (m_SwitchDef == NULL)
|
|
|
|
{
|
|
|
|
// We lost our definition due to a bad savegame.
|
|
|
|
Destroy();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
FSwitchDef *def = bReturning? m_SwitchDef->PairDef : m_SwitchDef;
|
|
|
|
if (--m_Timer == 0)
|
|
|
|
{
|
|
|
|
if (m_Frame == def->NumFrames - 1)
|
|
|
|
{
|
|
|
|
bReturning = true;
|
|
|
|
def = m_SwitchDef->PairDef;
|
|
|
|
if (def != NULL)
|
|
|
|
{
|
|
|
|
m_Frame = -1;
|
2016-03-28 22:31:59 +00:00
|
|
|
S_Sound (DVector3(m_Pos, 0), CHAN_VOICE|CHAN_LISTENERZ,
|
2016-03-01 15:47:10 +00:00
|
|
|
def->Sound != 0 ? FSoundID(def->Sound) : FSoundID("switches/normbutn"),
|
|
|
|
1, ATTN_STATIC);
|
|
|
|
bFlippable = false;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
Destroy ();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
bool killme = AdvanceFrame ();
|
|
|
|
|
|
|
|
m_Side->SetTexture(m_Part, def->frames[m_Frame].Texture);
|
|
|
|
|
|
|
|
if (killme)
|
|
|
|
{
|
|
|
|
Destroy ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//==========================================================================
|
|
|
|
|
|
|
|
bool DActiveButton::AdvanceFrame ()
|
|
|
|
{
|
|
|
|
bool ret = false;
|
|
|
|
FSwitchDef *def = bReturning? m_SwitchDef->PairDef : m_SwitchDef;
|
|
|
|
|
|
|
|
if (++m_Frame == def->NumFrames - 1)
|
|
|
|
{
|
|
|
|
if (bFlippable == true)
|
|
|
|
{
|
|
|
|
m_Timer = BUTTONTIME;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ret = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
m_Timer = def->frames[m_Frame].TimeMin;
|
|
|
|
if (def->frames[m_Frame].TimeRnd != 0)
|
|
|
|
{
|
|
|
|
m_Timer += pr_switchanim(def->frames[m_Frame].TimeRnd);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|