This commit is contained in:
parent
30272803d0
commit
25de06c1a6
21 changed files with 595 additions and 41 deletions
127
source/triggers/tgstop.cpp
Normal file
127
source/triggers/tgstop.cpp
Normal file
|
@ -0,0 +1,127 @@
|
|||
/*=========================================================================
|
||||
|
||||
tgstop.cpp
|
||||
|
||||
Author: CRB
|
||||
Created:
|
||||
Project: Spongebob
|
||||
Purpose:
|
||||
|
||||
Copyright (c) 2001 Climax Development Ltd
|
||||
|
||||
===========================================================================*/
|
||||
|
||||
/*----------------------------------------------------------------------
|
||||
Includes
|
||||
-------- */
|
||||
|
||||
#include "triggers\trigger.h"
|
||||
#include "triggers\tgstop.h"
|
||||
|
||||
#ifndef __GAME_GAME_H__
|
||||
#include "game\game.h"
|
||||
#endif
|
||||
|
||||
#ifndef __FRIEND_FRIEND_H__
|
||||
#include "friend\friend.h"
|
||||
#endif
|
||||
|
||||
#ifndef __FRIEND_FGARY_H__
|
||||
#include "friend\fgary.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 CGaryGoLeftTrigger::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 CGaryStopTrigger::collidedWith(CThing *_thisThing)
|
||||
{
|
||||
switch( _thisThing->getThingType() )
|
||||
{
|
||||
case TYPE_NPC:
|
||||
{
|
||||
if ( _thisThing->getThingSubType() == CNpcFriend::NPC_FRIEND_GARY )
|
||||
{
|
||||
CNpcGaryFriend *gary = (CNpcGaryFriend *) _thisThing;
|
||||
|
||||
gary->stop();
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*===========================================================================
|
||||
end */
|
Loading…
Add table
Add a link
Reference in a new issue