This commit is contained in:
parent
96801c6b4c
commit
c574dd3894
66
source/fx/fxgeyser.cpp
Normal file
66
source/fx/fxgeyser.cpp
Normal file
@ -0,0 +1,66 @@
|
||||
/***********************/
|
||||
/*** Anim Base Class ***/
|
||||
/***********************/
|
||||
|
||||
#include "system\global.h"
|
||||
#include <DStructs.h>
|
||||
#include "utils\utils.h"
|
||||
#include "gfx\prim.h"
|
||||
#include "gfx\sprbank.h"
|
||||
#include <sprites.h>
|
||||
#include "level\level.h"
|
||||
#include "game\game.h"
|
||||
|
||||
#include "FX\FXBaseAnim.h"
|
||||
#include "FX\FXAttachAnim.h"
|
||||
|
||||
int MaxHeight=128;
|
||||
|
||||
/*****************************************************************************/
|
||||
void CFXAttachAnim::init(DVECTOR const &_Pos)
|
||||
{
|
||||
CFXBaseAnim::init(_Pos);
|
||||
Height=TargetHeight=8;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
void CFXAttachAnim::thing(int Frames)
|
||||
{
|
||||
CFXBaseAnim::think(Frames);
|
||||
CThing *Parent=getParent();
|
||||
|
||||
int HDiff=TargetHeight-Height;
|
||||
Height+=(HDiff+1)/2;
|
||||
|
||||
if (Parent)
|
||||
{
|
||||
Pos2=Parent->getRenderPos();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
/*****************************************************************************/
|
||||
/*** Render ******************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CFXAttachAnim::render()
|
||||
{
|
||||
CFXBaseAnim::render();
|
||||
if (!canRender() || Flags & FX_FLAG_HIDDEN) return;
|
||||
|
||||
int FrameW=Frame->x1-Frame->x0;
|
||||
int HalfW=FrameW>>1;
|
||||
|
||||
Frame->x0=Pos2.vx-HalfW;
|
||||
Frame->y0=Pos2.vy;
|
||||
Frame->x1=Pos2.vx+HalfW;
|
||||
Frame->y1=Pos2.vy;
|
||||
|
||||
int BY=Frame->y2-Frame->y0;
|
||||
// setCollisionCentreOffset(0,BY>>1);
|
||||
setCollisionSize(FrameW,BY*2);
|
||||
|
||||
}
|
||||
|
23
source/fx/fxgeyser.h
Normal file
23
source/fx/fxgeyser.h
Normal file
@ -0,0 +1,23 @@
|
||||
/***********************/
|
||||
/*** Anim Base Class ***/
|
||||
/***********************/
|
||||
|
||||
#ifndef __FX_FX_ATTACH_ANIM_HEADER__
|
||||
#define __FX_FX_ATTACH_ANIM_HEADER__
|
||||
|
||||
#include "fx/fx.h"
|
||||
#include "fx/fxbaseAnim.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
class CFXAttachAnim : public CFXBaseAnim
|
||||
{
|
||||
public:
|
||||
virtual void init(DVECTOR const &Pos);
|
||||
virtual void thing(int Frames);
|
||||
virtual void render();
|
||||
|
||||
protected:
|
||||
DVECTOR Pos2;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user