diff --git a/source/platform/pjellfsh.cpp b/source/platform/pjellfsh.cpp new file mode 100644 index 000000000..7f81884b5 --- /dev/null +++ b/source/platform/pjellfsh.cpp @@ -0,0 +1,77 @@ +/*========================================================================= + + pjellfsh.h + + Author: CRB + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __PLATFORM_PJELLFSH_H__ +#include "platform\pjellfsh.h" +#endif + + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CNpcJellyfishPlatform::render() +{ + if ( m_isActive ) + { + CPlatformThing::render(); + + // Render + DVECTOR renderPos; + DVECTOR offset = CLevel::getCameraPos(); + + renderPos.vx = Pos.vx - offset.vx; + renderPos.vy = Pos.vy - offset.vy; + + CRECT collisionRect = getCollisionArea(); + collisionRect.x1 -= Pos.vx; + collisionRect.x2 -= Pos.vx; + collisionRect.y1 -= Pos.vy; + collisionRect.y2 -= Pos.vy; + + if ( renderPos.vx + collisionRect.x2 >= 0 && renderPos.vx + collisionRect.x1 <= VidGetScrW() ) + { + if ( renderPos.vy + collisionRect.y2 >= 0 && renderPos.vy + collisionRect.y1 <= VidGetScrH() ) + { + m_modelGfx->Render(renderPos); +// POLY_F4 *F4=GetPrimF4(); +// setXYWH(F4,renderPos.vx-32,renderPos.vy-32,64,16); +// setRGB0(F4,127,127,64); +// AddPrimToList(F4,2); + +#if defined (__USER_paul__) || defined (__USER_charles__) + DVECTOR size; + DVECTOR centre; + int halfLength; + int x1,y1,x2,y2; + + centre=getCollisionCentre(); + size=getCollisionSize(); + halfLength=size.vx>>1; + + x1=-halfLength*mcos(getCollisionAngle()&4095)>>12; + y1=-halfLength*msin(getCollisionAngle()&4095)>>12; + x2=+halfLength*mcos(getCollisionAngle()&4095)>>12; + y2=+halfLength*msin(getCollisionAngle()&4095)>>12; + + centre.vx-=offset.vx; + centre.vy-=offset.vy; + x1+=centre.vx; + y1+=centre.vy; + x2+=centre.vx; + y2+=centre.vy; + + DrawLine(x1,y1,x2,y2,0,255,0,0); +#endif + } + } + } +} diff --git a/source/platform/pjellfsh.h b/source/platform/pjellfsh.h new file mode 100644 index 000000000..0fe6ba0c2 --- /dev/null +++ b/source/platform/pjellfsh.h @@ -0,0 +1,27 @@ +/*========================================================================= + + pjellfsh.h + + Author: CRB + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __PLATFORM_PJELLFSH_H__ +#define __PLATFORM_PLANTERN_H__ + +#ifndef __PLATFORM_PLATFORM_H__ +#include "platform\platform.h" +#endif + +class CNpcJellyfishPlatform : public CNpcPlatform +{ +public: + virtual void render(); +}; + +#endif \ No newline at end of file