SBSPSS/source/hazard/hcsaw.cpp

72 lines
1.4 KiB
C++
Raw Normal View History

2001-05-03 16:42:12 +02:00
/*=========================================================================
hcsaw.cpp
Author: CRB
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __HAZARD_HCSAW_H__
#include "hazard\hcsaw.h"
#endif
#ifndef __VID_HEADER_
#include "system\vid.h"
#endif
#ifndef __LEVEL_LEVEL_H__
#include "level\level.h"
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcCircularSawHazard::init()
{
CNpcHazard::init();
m_rotation = 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcCircularSawHazard::processMovement( int _frames )
{
m_rotation += 256 * _frames;
m_rotation &= 4095;
2001-06-01 18:30:37 +02:00
2001-06-18 21:06:43 +02:00
if ( m_soundId == NOT_PLAYING )
{
m_soundId = (int) CSoundMediator::playSfx( CSoundMediator::SFX_SAW, true );
}
2001-05-03 16:42:12 +02:00
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcCircularSawHazard::render()
{
CHazardThing::render();
2001-05-14 23:08:03 +02:00
if (canRender())
{
DVECTOR &renderPos=getRenderPos();
2001-05-03 16:42:12 +02:00
2001-05-14 23:08:03 +02:00
SVECTOR rotation;
rotation.vx = 0;
rotation.vy = 0;
rotation.vz = m_rotation;
2001-05-03 16:42:12 +02:00
2001-05-14 23:08:03 +02:00
VECTOR scale;
scale.vx = ONE;
scale.vy = ONE;
scale.vz = ONE;
2001-05-05 16:58:49 +02:00
2001-05-14 23:08:03 +02:00
m_modelGfx->Render(renderPos,&rotation,&scale);
2001-05-03 16:42:12 +02:00
}
}