This commit is contained in:
parent
e71271653f
commit
9e1c863edd
2 changed files with 71 additions and 0 deletions
49
source/fx/fxthwack.cpp
Normal file
49
source/fx/fxthwack.cpp
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
/***********************/
|
||||||
|
/*** 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"
|
||||||
|
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
void CFXAttachAnim::init(DVECTOR const &_Pos)
|
||||||
|
{
|
||||||
|
CFXBaseAnim::init(_Pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*** Render ******************************************************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
void CFXAttachAnim::render()
|
||||||
|
{
|
||||||
|
CFXBaseAnim::render();
|
||||||
|
if (!canRender() || !IsVisible) return;
|
||||||
|
|
||||||
|
CThing *Parent=getParent();
|
||||||
|
ASSERT(Parent);
|
||||||
|
|
||||||
|
DVECTOR &ParentPos=Parent->getRenderPos();
|
||||||
|
int FrameW=Frame->x1-Frame->x0;
|
||||||
|
int HalfW=FrameW>>1;
|
||||||
|
|
||||||
|
Frame->x0=ParentPos.vx-HalfW;
|
||||||
|
Frame->y0=ParentPos.vy;
|
||||||
|
Frame->x1=ParentPos.vx+HalfW;
|
||||||
|
Frame->y1=ParentPos.vy;
|
||||||
|
|
||||||
|
int BY=Frame->y2-Frame->y0;
|
||||||
|
// setCollisionCentreOffset(0,BY>>1);
|
||||||
|
setCollisionSize(FrameW,BY*2);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
22
source/fx/fxthwack.h
Normal file
22
source/fx/fxthwack.h
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
/***********************/
|
||||||
|
/*** 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 render();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
Loading…
Add table
Add a link
Reference in a new issue