From 9e1c863edd11d012eaf441427bcddfaad577aa01 Mon Sep 17 00:00:00 2001 From: Daveo Date: Tue, 12 Jun 2001 16:12:09 +0000 Subject: [PATCH] --- source/fx/fxthwack.cpp | 49 ++++++++++++++++++++++++++++++++++++++++++ source/fx/fxthwack.h | 22 +++++++++++++++++++ 2 files changed, 71 insertions(+) create mode 100644 source/fx/fxthwack.cpp create mode 100644 source/fx/fxthwack.h diff --git a/source/fx/fxthwack.cpp b/source/fx/fxthwack.cpp new file mode 100644 index 000000000..86915ccbb --- /dev/null +++ b/source/fx/fxthwack.cpp @@ -0,0 +1,49 @@ +/***********************/ +/*** Anim Base Class ***/ +/***********************/ + +#include "system\global.h" +#include +#include "utils\utils.h" +#include "gfx\prim.h" +#include "gfx\sprbank.h" +#include +#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); + +} + diff --git a/source/fx/fxthwack.h b/source/fx/fxthwack.h new file mode 100644 index 000000000..92080df13 --- /dev/null +++ b/source/fx/fxthwack.h @@ -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