This commit is contained in:
Charles 2001-05-04 20:28:30 +00:00
parent 0ea89d789d
commit ffa75f2326
2 changed files with 106 additions and 0 deletions

74
source/hazard/hmower.cpp Normal file
View File

@ -0,0 +1,74 @@
/*=========================================================================
hmower.cpp
Author: CRB
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __HAZARD_HMOWER_H__
#include "hazard\hmower.h"
#endif
#ifndef __VID_HEADER_
#include "system\vid.h"
#endif
#ifndef __LEVEL_LEVEL_H__
#include "level\level.h"
#endif
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcMowerHazard::init()
{
CNpcHazard::init();
m_rotation = 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcMowerHazard::processMovement( int _frames )
{
m_rotation += 256 * _frames;
m_rotation &= 4095;
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
void CNpcMowerHazard::render()
{
CHazardThing::render();
// Render
DVECTOR renderPos;
DVECTOR offset = CLevel::getCameraPos();
renderPos.vx = Pos.vx - offset.vx;
renderPos.vy = Pos.vy - offset.vy;
if ( renderPos.vx >= 0 && renderPos.vx <= VidGetScrW() )
{
if ( renderPos.vy >= 0 && renderPos.vy <= VidGetScrH() )
{
SVECTOR rotation;
rotation.vx = 0;
rotation.vy = 0;
rotation.vz = m_rotation;
VECTOR scale;
scale.vx = ONE;
scale.vy = ONE;
scale.vz = ONE;
m_modelGfx->Render(renderPos,&rotation,&scale);
}
}
}

32
source/hazard/hmower.h Normal file
View File

@ -0,0 +1,32 @@
/*=========================================================================
hmower.h
Author: CRB
Created:
Project: Spongebob
Purpose:
Copyright (c) 2001 Climax Development Ltd
===========================================================================*/
#ifndef __HAZARD_HMOWER_H__
#define __HAZARD_HMOWER_H__
#ifndef __HAZARD_HAZARD_H__
#include "hazard\hazard.h"
#endif
class CNpcMowerHazard : public CNpcHazard
{
public:
void init();
virtual void render();
protected:
void processMovement( int _frames );
s16 m_rotation;
};
#endif