Skip to content

Commit

Permalink
Applied feedback from PR
Browse files Browse the repository at this point in the history
Signed-off-by: Luis Sempé <[email protected]>
  • Loading branch information
lsemp3d committed Dec 8, 2024
1 parent 097adfb commit b141d3c
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 26 deletions.
8 changes: 6 additions & 2 deletions Code/Editor/GameEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -517,7 +517,9 @@ void CGameEngine::SwitchToInGame()

if (movieSystem)
{
movieSystem->Reset(true, false);
constexpr bool playOnReset = true;
constexpr bool seekToStart = false;
movieSystem->Reset(playOnReset, seekToStart);
}

// Transition to runtime entity context.
Expand Down Expand Up @@ -548,7 +550,9 @@ void CGameEngine::SwitchToInEditor()
{
movieSystem->GetPlayingSequence(i)->Deactivate();
}
movieSystem->Reset(false, false);
constexpr bool playOnReset = false;
constexpr bool seekToStart = false;
movieSystem->Reset(playOnReset, seekToStart);
}

CViewport* pGameViewport = GetIEditor()->GetViewManager()->GetGameViewport();
Expand Down
35 changes: 18 additions & 17 deletions Code/Editor/SelectLightAnimationDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,30 +37,31 @@ void CSelectLightAnimationDialog::GetItems(std::vector<SItem>& outItems)
{
IMovieSystem* movieSystem = nullptr;
Maestro::MovieSystemRequestBus::BroadcastResult(movieSystem, &Maestro::MovieSystemRequestBus::Events::GetMovieSystem);
if (!movieSystem)
{
return;
}

if (movieSystem)
for (int i = 0; i < movieSystem->GetNumSequences(); ++i)
{
for (int i = 0; i < movieSystem->GetNumSequences(); ++i)
IAnimSequence* pSequence = movieSystem->GetSequence(i);
if ((pSequence->GetFlags() & IAnimSequence::eSeqFlags_LightAnimationSet) == 0)
{
IAnimSequence* pSequence = movieSystem->GetSequence(i);
if ((pSequence->GetFlags() & IAnimSequence::eSeqFlags_LightAnimationSet) == 0)
{
continue;
}
continue;
}

for (int k = 0; k < pSequence->GetNodeCount(); ++k)
for (int k = 0; k < pSequence->GetNodeCount(); ++k)
{
assert(pSequence->GetNode(k)->GetType() == AnimNodeType::Light);
if (pSequence->GetNode(k)->GetType() != AnimNodeType::Light)
{
assert(pSequence->GetNode(k)->GetType() == AnimNodeType::Light);
if (pSequence->GetNode(k)->GetType() != AnimNodeType::Light)
{
continue;
}
SItem item;
item.name = pSequence->GetNode(k)->GetName();
outItems.push_back(item);
continue;
}
return;
SItem item;
item.name = pSequence->GetNode(k)->GetName();
outItems.push_back(item);
}
return;
}
}

Expand Down
8 changes: 6 additions & 2 deletions Code/Legacy/CrySystem/LevelSystem/LevelSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,9 @@ ILevel* CLevelSystem::LoadLevelInternal(const char* _levelName)
if (movieSystem)
{
// bSeekAllToStart needs to be false here as it's only of interest in the editor
movieSystem->Reset(true, false);
constexpr bool playOnReset = true;
constexpr bool seekToStart = false;
movieSystem->Reset(playOnReset, seekToStart);
}

gEnv->pSystem->SetSystemGlobalState(ESYSTEM_GLOBAL_STATE_LEVEL_LOAD_START_PRECACHE);
Expand Down Expand Up @@ -781,7 +783,9 @@ void CLevelSystem::UnloadLevel()

if (movieSystem)
{
movieSystem->Reset(false, false);
constexpr bool playOnReset = false;
constexpr bool seekToStart = false;
movieSystem->Reset(playOnReset, seekToStart);
movieSystem->RemoveAllSequences();
}

Expand Down
8 changes: 6 additions & 2 deletions Code/Legacy/CrySystem/LevelSystem/SpawnableLevelSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,9 @@ namespace LegacyLevelSystem
if (movieSystem)
{
// bSeekAllToStart needs to be false here as it's only of interest in the editor
movieSystem->Reset(true, false);
constexpr bool playOnReset = true;
constexpr bool seekToStart = false;
movieSystem->Reset(playOnReset, seekToStart);
}

gEnv->pSystem->SetSystemGlobalState(ESYSTEM_GLOBAL_STATE_LEVEL_LOAD_START_PRECACHE);
Expand Down Expand Up @@ -587,7 +589,9 @@ namespace LegacyLevelSystem

if (movieSystem)
{
movieSystem->Reset(false, false);
constexpr bool playOnReset = false;
constexpr bool seekToStart = false;
movieSystem->Reset(playOnReset, seekToStart);
movieSystem->RemoveAllSequences();
}

Expand Down
1 change: 0 additions & 1 deletion Gems/Maestro/Code/Source/Components/SequenceComponent.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
*
*/
#pragma once
//#include <IMovieSystem.h>

#include <AzCore/Component/Component.h>
#include <Maestro/Bus/SequenceComponentBus.h>
Expand Down
2 changes: 0 additions & 2 deletions Gems/Maestro/Code/Source/MaestroSystemComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,13 @@ namespace Maestro
{
if (!startupParams.bSkipMovie)
{
// Create the movie System
m_movieSystem.reset(new CMovieSystem(&system));
}
}

///////////////////////////////////////////////////////////////////////////////////////////////
void MaestroSystemComponent::OnCrySystemShutdown([[maybe_unused]] ISystem& system)
{
// delete m_movieSystem
m_movieSystem.reset();
}
}

0 comments on commit b141d3c

Please sign in to comment.