This commit is contained in:
parent
4135b52516
commit
ea7de9b2f9
2 changed files with 104 additions and 0 deletions
77
source/platform/pjellfsh.cpp
Normal file
77
source/platform/pjellfsh.cpp
Normal file
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
27
source/platform/pjellfsh.h
Normal file
27
source/platform/pjellfsh.h
Normal file
|
@ -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
|
Loading…
Add table
Reference in a new issue