This commit is contained in:
parent
04a1f46877
commit
b94fec971d
2 changed files with 99 additions and 0 deletions
71
source/platform/pclam.cpp
Normal file
71
source/platform/pclam.cpp
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
/*=========================================================================
|
||||||
|
|
||||||
|
pclam.cpp
|
||||||
|
|
||||||
|
Author: CRB
|
||||||
|
Created:
|
||||||
|
Project: Spongebob
|
||||||
|
Purpose:
|
||||||
|
|
||||||
|
Copyright (c) 2001 Climax Development Ltd
|
||||||
|
|
||||||
|
===========================================================================*/
|
||||||
|
|
||||||
|
#ifndef __PLATFORM_PCLAM_H__
|
||||||
|
#include "platform\pclam.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __LEVEL_LEVEL_H__
|
||||||
|
#include "level\level.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef __UTILS_HEADER__
|
||||||
|
#include "utils\utils.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void CNpcClamPlatform::render()
|
||||||
|
{
|
||||||
|
if (canRender())
|
||||||
|
{
|
||||||
|
//CNpcPlatform::render();
|
||||||
|
|
||||||
|
DVECTOR &renderPos=getRenderPos();
|
||||||
|
|
||||||
|
#if defined (__USER_paul__) || defined (__USER_charles__)
|
||||||
|
DVECTOR offset = CLevel::getCameraPos();
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
void CNpcClamPlatform::setBBox()
|
||||||
|
{
|
||||||
|
setCollisionSize( 54, PLATFORMCOLLISIONHEIGHT);
|
||||||
|
setCollisionCentreOffset( 0, -30 );
|
||||||
|
}
|
28
source/platform/pclam.h
Normal file
28
source/platform/pclam.h
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
/*=========================================================================
|
||||||
|
|
||||||
|
pclam.h
|
||||||
|
|
||||||
|
Author: CRB
|
||||||
|
Created:
|
||||||
|
Project: Spongebob
|
||||||
|
Purpose:
|
||||||
|
|
||||||
|
Copyright (c) 2001 Climax Development Ltd
|
||||||
|
|
||||||
|
===========================================================================*/
|
||||||
|
|
||||||
|
#ifndef __PLATFORM_PCLAM_H__
|
||||||
|
#define __PLATFORM_PCLAM_H__
|
||||||
|
|
||||||
|
#ifndef __PLATFORM_PLATFORM_H__
|
||||||
|
#include "platform\platform.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
class CNpcClamPlatform : public CNpcPlatform
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
virtual void render();
|
||||||
|
void setBBox();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
Loading…
Add table
Reference in a new issue