From 000d0922dfb196de1c986649514da26142264c41 Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 6 Jun 2001 15:04:20 +0000 Subject: [PATCH] --- makefile.gaz | 3 +- source/hazard/hpendulm.cpp | 62 ++++++++++++++++++- source/hazard/hpendulm.h | 2 + source/platform/platdata.cpp | 13 ++++ source/platform/platform.cpp | 10 +++ source/platform/platform.h | 1 + tools/Data/bin/MkLevel.ini | 2 +- .../spongebob project/spongebob project.dsp | 8 +++ 8 files changed, 98 insertions(+), 3 deletions(-) diff --git a/makefile.gaz b/makefile.gaz index 1fc3390f4..e28f3d7c9 100644 --- a/makefile.gaz +++ b/makefile.gaz @@ -132,7 +132,8 @@ platform_src := platform \ pcbubble \ pdrop \ psswitch \ - plift + plift \ + plurve hazard_src := hazard \ hfalling \ diff --git a/source/hazard/hpendulm.cpp b/source/hazard/hpendulm.cpp index 4556d72e6..81851cc61 100644 --- a/source/hazard/hpendulm.cpp +++ b/source/hazard/hpendulm.cpp @@ -19,6 +19,15 @@ #include "utils\utils.h" #endif +#ifndef __VID_HEADER_ +#include "system\vid.h" +#endif + +#ifndef __GAME_GAME_H__ +#include "game\game.h" +#endif + + //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// void CNpcPendulumHazard::init() @@ -107,4 +116,55 @@ void CNpcPendulumHazard::processMovement( int _frames ) Pos.vx = m_base.vx + ( ( m_length * rcos( m_heading + m_extension ) ) >> 12 ); Pos.vy = m_base.vy + ( ( m_length * rsin( m_heading + m_extension ) ) >> 12 ); -} \ No newline at end of file +} + +//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// + +void CNpcPendulumHazard::render() +{ + int x1,y1,x2,y2; + int minX, maxX, minY, maxY; + + DVECTOR offset = CLevel::getCameraPos(); + + CHazardThing::render(); + + if (canRender()) + { + DVECTOR &renderPos=getRenderPos(); + + m_modelGfx->Render(renderPos); + } + + x1 = Pos.vx - offset.vx; + x2 = m_base.vx - offset.vx; + + y1 = Pos.vy - offset.vy; + y2 = m_base.vy - offset.vy; + + minX = x1; + maxX = x2; + + if ( minX > maxX ) + { + minX = x2; + maxX = x1; + } + + minY = y1; + maxY = y2; + + if ( minY > maxY ) + { + minY = y2; + maxY = y1; + } + + if ( maxX >= 0 && minX <= VidGetScrW() ) + { + if ( maxY >= 0 && minY <= VidGetScrH() ) + { + DrawLine( x1, y1, x2, y2, 0, 0, 0, 0 ); + } + } +} diff --git a/source/hazard/hpendulm.h b/source/hazard/hpendulm.h index cf9a84bc5..02c01fe0f 100644 --- a/source/hazard/hpendulm.h +++ b/source/hazard/hpendulm.h @@ -22,12 +22,14 @@ class CNpcPendulumHazard : public CNpcHazard { public: void init(); + virtual void render(); protected: virtual void setWaypoints( sThingHazard *ThisHazard ); void processMovement( int _frames ); s32 m_length; s32 m_maxExtension; + s16 m_rotation; }; #endif \ No newline at end of file diff --git a/source/platform/platdata.cpp b/source/platform/platdata.cpp index 4ff456215..422786959 100644 --- a/source/platform/platdata.cpp +++ b/source/platform/platdata.cpp @@ -502,6 +502,18 @@ CNpcPlatform::NPC_PLATFORM_DATA CNpcPlatform::m_data[NPC_PLATFORM_TYPE_MAX] = 0, NPC_PLATFORM_TIMER_NONE, }, + + { // NPC_LOVE_BOAT_PLATFORM + 3, + 128, + true, + DAMAGE__NONE, + 0, + 4, + NPC_PLATFORM_INFINITE_LIFE, + 2, + NPC_PLATFORM_TIMER_NONE, + }, }; CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::mapEditConvertTable[NPC_PLATFORM_TYPE_MAX] = @@ -541,6 +553,7 @@ CNpcPlatform::NPC_PLATFORM_UNIT_TYPE CNpcPlatform::mapEditConvertTable[NPC_PLATF NPC_DROP_PLATFORM, NPC_STEAM_SWITCH_PLATFORM, NPC_LIFT_PLATFORM, + NPC_LOVE_BOAT_PLATFORM, NPC_CONVEYOR_PLATFORM, NPC_PLAYER_BUBBLE_PLATFORM, NPC_CLAM_PLATFORM, diff --git a/source/platform/platform.cpp b/source/platform/platform.cpp index 417bd06f2..18db18757 100644 --- a/source/platform/platform.cpp +++ b/source/platform/platform.cpp @@ -183,6 +183,10 @@ #include "platform\plift.h" #endif +#ifndef __PLATFORM_PLURVE_H__ +#include "platform\plurve.h" +#endif + #include "fx\fx.h" #include "fx\fxjfish.h" @@ -421,6 +425,12 @@ CNpcPlatform *CNpcPlatform::Create(int Type) break; } + case NPC_LOVE_BOAT_PLATFORM: + { + platform = new ("love boat platform") CNpcLoveBoatPlatform; + break; + } + default: { ASSERT( 0 ); diff --git a/source/platform/platform.h b/source/platform/platform.h index a692b3809..ca9fa7151 100644 --- a/source/platform/platform.h +++ b/source/platform/platform.h @@ -92,6 +92,7 @@ public: NPC_DROP_PLATFORM, NPC_STEAM_SWITCH_PLATFORM, NPC_LIFT_PLATFORM, + NPC_LOVE_BOAT_PLATFORM, NPC_PLATFORM_TYPE_MAX, }; enum diff --git a/tools/Data/bin/MkLevel.ini b/tools/Data/bin/MkLevel.ini index 97b2bc2eb..b8eec7f2b 100644 --- a/tools/Data/bin/MkLevel.ini +++ b/tools/Data/bin/MkLevel.ini @@ -96,7 +96,7 @@ OilDrum=13 OilDrumGenerator=17 Crate=14 CrateGenerator=18 -Loveboat=19 +Loveboat=35 BouncyRing=15 BouncyTyre=15 DualPlatform=16 diff --git a/users/paul/spongebob project/spongebob project.dsp b/users/paul/spongebob project/spongebob project.dsp index 739b19515..d154160a8 100644 --- a/users/paul/spongebob project/spongebob project.dsp +++ b/users/paul/spongebob project/spongebob project.dsp @@ -1581,6 +1581,14 @@ SOURCE=..\..\..\source\platform\plinear.h # End Source File # Begin Source File +SOURCE=..\..\..\source\platform\plurve.cpp +# End Source File +# Begin Source File + +SOURCE=..\..\..\source\platform\plurve.h +# End Source File +# Begin Source File + SOURCE=..\..\..\source\platform\ppendulm.cpp # End Source File # Begin Source File