From 650f284e4ae1bd3ff3d9d172f8027ffbdb8ca4e6 Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 30 May 2001 20:22:25 +0000 Subject: [PATCH] --- source/triggers/tgarygo.cpp | 106 ++++++++++++++++++++++++++++++++++++ source/triggers/tgarygo.h | 68 +++++++++++++++++++++++ 2 files changed, 174 insertions(+) create mode 100644 source/triggers/tgarygo.cpp create mode 100644 source/triggers/tgarygo.h diff --git a/source/triggers/tgarygo.cpp b/source/triggers/tgarygo.cpp new file mode 100644 index 000000000..ecef9ada7 --- /dev/null +++ b/source/triggers/tgarygo.cpp @@ -0,0 +1,106 @@ +/*========================================================================= + + tgarygo.cpp + + Author: PKG + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +#include "triggers\trigger.h" +#include "triggers\tgarygo.h" + +#ifndef __GAME_GAME_H__ +#include "game\game.h" +#endif + + +/* Std Lib + ------- */ + +/* Data + ---- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +/*---------------------------------------------------------------------- + Function Prototypes + ------------------- */ + +/*---------------------------------------------------------------------- + Vars + ---- */ + + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +#if defined (__USER_art__) || defined (__USER_sbart__) +#include "gfx\prim.h" +void CGaryStartTrigger::render() +{ + DVECTOR ofs; + CRECT area; + + CTriggerThing::render(); + + ofs=CLevel::getCameraPos(); + area=getCollisionArea(); + area.x1-=ofs.vx; + area.y1-=ofs.vy; + area.x2-=ofs.vx; + area.y2-=ofs.vy; + + if(area.x1<=511&&area.x2>=0&& + area.y1<=255&&area.y2>=0) + { + POLY_F4 *f4; + f4=GetPrimF4(); + setXY4(f4,area.x1,area.y1, + area.x2,area.y1, + area.x1,area.y2, + area.x2,area.y2); + setRGB0(f4,0,255,0); + setSemiTrans(f4,true); + AddPrimToList(f4,0); + DrawLine(area.x1,area.y1,area.x2,area.y1,0,255,0,0); + DrawLine(area.x2,area.y1,area.x2,area.y2,0,255,0,0); + DrawLine(area.x2,area.y2,area.x1,area.y2,0,255,0,0); + DrawLine(area.x1,area.y2,area.x1,area.y1,0,255,0,0); + } +} +#endif + +/*---------------------------------------------------------------------- + Function: + Purpose: + Params: + Returns: + ---------------------------------------------------------------------- */ +void CGaryStartTrigger::collidedWith(CThing *_thisThing) +{ + ASSERT(_thisThing->getThingType()==TYPE_PLAYER); + + CPlayer *player = (CPlayer *) _thisThing; + m_gary->start(); +} + +/*=========================================================================== +end */ diff --git a/source/triggers/tgarygo.h b/source/triggers/tgarygo.h new file mode 100644 index 000000000..8fe8424d6 --- /dev/null +++ b/source/triggers/tgarygo.h @@ -0,0 +1,68 @@ +/*========================================================================= + + tgarygo.h + + Author: Charles Blair + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __TRIGGERS_TGARYGO_H__ +#define __TRIGGERS_TGARYGO_H__ + +/*---------------------------------------------------------------------- + Includes + -------- */ + +#ifndef __THING_THING_H__ +#include "thing/thing.h" +#endif + +#ifndef __FRIEND_FGARY_H__ +#include "friend\fgary.h" +#endif + + +/* Std Lib + ------- */ + +/*---------------------------------------------------------------------- + Tyepdefs && Defines + ------------------- */ + +/*---------------------------------------------------------------------- + Structure defintions + -------------------- */ + +class CGaryStartTrigger : public CTrigger +{ +public: +#if defined (__USER_art__) || defined (__USER_sbart__) + virtual void render(); +#endif + virtual void setGary( CNpcGaryFriend *gary ) {m_gary = gary;} + +protected: + virtual void collidedWith(CThing *_thisThing); + + CNpcGaryFriend *m_gary; +}; + +/*---------------------------------------------------------------------- + Globals + ------- */ + +/*---------------------------------------------------------------------- + Functions + --------- */ + +/*---------------------------------------------------------------------- */ + +#endif /* __TRIGGERS_TPLATFRM_H__ */ + +/*=========================================================================== + end */