From 6e672f0b3abe9fb9b070e2de0e25fdb712c454a6 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 23 Apr 2001 16:44:37 +0000 Subject: [PATCH] --- source/platform/pcirculr.cpp | 34 ++++++++++++++++++++++++++++++++++ source/platform/pcirculr.h | 29 +++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) create mode 100644 source/platform/pcirculr.cpp create mode 100644 source/platform/pcirculr.h diff --git a/source/platform/pcirculr.cpp b/source/platform/pcirculr.cpp new file mode 100644 index 000000000..edee2815e --- /dev/null +++ b/source/platform/pcirculr.cpp @@ -0,0 +1,34 @@ +/*========================================================================= + + pcirculr.cpp + + Author: CRB + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __PLATFORM_PCIRCULR_H__ +#include "platform\pcirculr.h" +#endif + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CNpcCircularPlatform::postInit() +{ + m_extension = 100; +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CNpcCircularPlatform::processMovement( int _frames ) +{ + m_rotation += m_data[m_type].speed; + m_rotation &= 4095; + + Pos.vx = m_base.vx + ( ( m_extension * rcos( m_rotation ) ) >> 12 ); + Pos.vy = m_base.vy + ( ( m_extension * rsin( m_rotation ) ) >> 12 ); +} diff --git a/source/platform/pcirculr.h b/source/platform/pcirculr.h new file mode 100644 index 000000000..e1c2547e7 --- /dev/null +++ b/source/platform/pcirculr.h @@ -0,0 +1,29 @@ +/*========================================================================= + + pcirculr.h + + Author: CRB + Created: + Project: Spongebob + Purpose: + + Copyright (c) 2001 Climax Development Ltd + +===========================================================================*/ + +#ifndef __PLATFORM_PCIRCULR_H__ +#define __PLATFORM_PCIRCULR_H__ + +#ifndef __PLATFORM_PLATFORM_H__ +#include "platform\platform.h" +#endif + +class CNpcCircularPlatform : public CNpcPlatform +{ +public: + virtual void postInit(); +protected: + virtual void processMovement( int _frames ); +}; + +#endif \ No newline at end of file