summaryrefslogtreecommitdiffstats
path: root/game/code/presentation/presevents/presentationevent.cpp
diff options
context:
space:
mode:
authorSvxy <aidan61605@gmail.com>2023-05-31 23:31:32 +0200
committerSvxy <aidan61605@gmail.com>2023-05-31 23:31:32 +0200
commiteb4b3404aa00220d659e532151dab13d642c17a3 (patch)
tree7e1107c4995489a26c4007e41b53ea8d00ab2134 /game/code/presentation/presevents/presentationevent.cpp
downloadThe-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.gz
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.bz2
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.lz
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.xz
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.zst
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.zip
Diffstat (limited to 'game/code/presentation/presevents/presentationevent.cpp')
-rw-r--r--game/code/presentation/presevents/presentationevent.cpp180
1 files changed, 180 insertions, 0 deletions
diff --git a/game/code/presentation/presevents/presentationevent.cpp b/game/code/presentation/presevents/presentationevent.cpp
new file mode 100644
index 0000000..dd26a66
--- /dev/null
+++ b/game/code/presentation/presevents/presentationevent.cpp
@@ -0,0 +1,180 @@
+//=============================================================================
+// Copyright (C) 2002 Radical Entertainment Ltd. All rights reserved.
+//
+// File: presentationevent.cpp
+//
+// Description: Implement PresentationEvent
+//
+// History: 22/05/2002 + Created -- NAME
+//
+//=============================================================================
+
+//========================================
+// System Includes
+//========================================
+
+// Foundation Tech
+#include <raddebug.hpp>
+
+//========================================
+// Project Includes
+//========================================
+
+#include <presentation/animplayer.h>
+#include <presentation/presevents/presentationevent.h>
+
+//******************************************************************************
+//
+// Global Data, Local Data, Local Classes
+//
+//******************************************************************************
+
+//******************************************************************************
+//
+// Public Member Functions
+//
+//******************************************************************************
+
+//==============================================================================
+// PresentationEvent::PresentationEvent
+//==============================================================================
+// Description: Constructor.
+//
+// Parameters: None.
+//
+// Return: N/A.
+//
+//==============================================================================
+PresentationEvent::PresentationEvent()
+{
+ Init();
+}
+
+//==============================================================================
+// PresentationEvent::~PresentationEvent
+//==============================================================================
+// Description: Destructor.
+//
+// Parameters: None.
+//
+// Return: N/A.
+//
+//==============================================================================
+PresentationEvent::~PresentationEvent()
+{
+
+}
+
+
+//==============================================================================
+// PresentationEvent::OnLoadDataComplete
+//==============================================================================
+//
+// Description:
+//
+// Parameters:
+//
+// Return:
+//
+//==============================================================================
+void PresentationEvent::OnLoadDataComplete()
+{
+ if( pCallback != NULL )
+ {
+ pCallback->OnPresentationEventLoadComplete( this );
+ }
+}
+
+//=============================================================================
+// PresentationEvent::Update
+//=============================================================================
+// Description: Comment
+//
+// Parameters: ( unsigned int elapsedTime )
+//
+// Return: bool
+//
+//=============================================================================
+bool PresentationEvent::Update( unsigned int elapsedTime )
+{
+ AnimationPlayer* player = GetPlayer();
+
+ player->Update( elapsedTime );
+
+ return( player->IsPlaying() );
+}
+
+//=============================================================================
+// PresentationEvent::Start
+//=============================================================================
+// Description: Comment
+//
+// Parameters: ()
+//
+// Return: void
+//
+//=============================================================================
+void PresentationEvent::Start()
+{
+ AnimationPlayer* player = GetPlayer();
+
+ if( !mbLoaded )
+ {
+ player->LoadData( fileName, this, false, GetUserData() );
+
+ mbLoaded = true;
+ }
+ player->SetKeepLayersFrozen( mbKeepLayersFrozen );
+ player->SetSkippable(mbIsSkippable);
+ player->Play();
+}
+
+//=============================================================================
+// PresentationEvent::Stop
+//=============================================================================
+// Description: Comment
+//
+// Parameters: ()
+//
+// Return: void
+//
+//=============================================================================
+void PresentationEvent::Stop()
+{
+ AnimationPlayer* player = GetPlayer();
+
+ if( mbClearWhenDone )
+ {
+ player->ClearData();
+ }
+ else
+ {
+ player->Reset();
+ }
+}
+
+//=============================================================================
+// PresentationEvent::Init
+//=============================================================================
+// Description: Comment
+//
+// Parameters: ()
+//
+// Return: void
+//
+//=============================================================================
+void PresentationEvent::Init()
+{
+ mbAutoPlay = true;
+ mbClearWhenDone = true;
+ mbLoaded = false;
+ mbKeepLayersFrozen = false;
+ mbIsSkippable = true;
+}
+
+//******************************************************************************
+//
+// Private Member Functions
+//
+//******************************************************************************
+