From d2a942946496b12f4aa1ea655c41e32ea7d452dd Mon Sep 17 00:00:00 2001 From: neuromancer Date: Sun, 3 Apr 2022 20:50:01 +0200 Subject: [PATCH] HYPNO: refactoring clearing of arcade data structures --- engines/hypno/arcade.cpp | 18 +----------------- engines/hypno/grammar.h | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/engines/hypno/arcade.cpp b/engines/hypno/arcade.cpp index 4beb7a0cce9..c285761da24 100644 --- a/engines/hypno/arcade.cpp +++ b/engines/hypno/arcade.cpp @@ -57,23 +57,7 @@ void HypnoEngine::parseArcadeShooting(const Common::String &prefix, const Common ArcadeShooting *arcade = new ArcadeShooting(); *arcade = *g_parsedArc; _levels[filename] = (Level*) arcade; - g_parsedArc->backgroundVideo.clear(); - g_parsedArc->transitionVideos.clear(); - g_parsedArc->transitionTimes.clear(); - g_parsedArc->transitionPalettes.clear(); - g_parsedArc->player.clear(); - g_parsedArc->shoots.clear(); - g_parsedArc->intros.clear(); - g_parsedArc->defeatNoEnergyFirstVideo.clear(); - g_parsedArc->defeatMissBossVideo.clear(); - g_parsedArc->defeatNoEnergySecondVideo.clear(); - g_parsedArc->missBoss1Video.clear(); - g_parsedArc->missBoss2Video.clear(); - g_parsedArc->hitBoss1Video.clear(); - g_parsedArc->hitBoss2Video.clear(); - g_parsedArc->beforeVideo.clear(); - g_parsedArc->briefingVideo.clear(); - g_parsedArc->segments.clear(); + g_parsedArc->clear(); } SegmentShootsSequence HypnoEngine::parseShootList(const Common::String &filename, const Common::String &data) { diff --git a/engines/hypno/grammar.h b/engines/hypno/grammar.h index 54a9fad99af..bce95a06be0 100644 --- a/engines/hypno/grammar.h +++ b/engines/hypno/grammar.h @@ -481,6 +481,28 @@ public: objMissesAllowed[1] = 0; frameDelay = 0; } + void clear() { + nextLevelVideo.clear(); + backgroundVideo.clear(); + transitionVideos.clear(); + transitionTimes.clear(); + transitionPalettes.clear(); + player.clear(); + shoots.clear(); + intros.clear(); + defeatNoEnergyFirstVideo.clear(); + defeatMissBossVideo.clear(); + defeatNoEnergySecondVideo.clear(); + missBoss1Video.clear(); + missBoss2Video.clear(); + hitBoss1Video.clear(); + hitBoss2Video.clear(); + beforeVideo.clear(); + briefingVideo.clear(); + additionalVideo.clear(); + segments.clear(); + } + uint32 id; uint32 frameDelay; Common::String mode;