[Scummvm-cvs-logs] scummvm master -> ea5bd95492f9848236f4194d182a91bca1a3dab0

urukgit urukgit at users.noreply.github.com
Fri Mar 7 09:01:59 CET 2014


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ea5bd95492 AVALANACHE: Rework use of MainMenu.


Commit: ea5bd95492f9848236f4194d182a91bca1a3dab0
    https://github.com/scummvm/scummvm/commit/ea5bd95492f9848236f4194d182a91bca1a3dab0
Author: uruk (koppirnyo at gmail.com)
Date: 2014-03-07T00:01:28-08:00

Commit Message:
AVALANACHE: Rework use of MainMenu.

Changed paths:
    engines/avalanche/avalanche.cpp
    engines/avalanche/avalanche.h
    engines/avalanche/avalot.cpp



diff --git a/engines/avalanche/avalanche.cpp b/engines/avalanche/avalanche.cpp
index 3f83f82..3b1ca60 100644
--- a/engines/avalanche/avalanche.cpp
+++ b/engines/avalanche/avalanche.cpp
@@ -58,7 +58,6 @@ AvalancheEngine::AvalancheEngine(OSystem *syst, const AvalancheGameDescription *
 	_ghostroom = nullptr;
 	_help = nullptr;
 	_shootemup = nullptr;
-	_mainmenu = nullptr;
 
 	_platform = gd->desc.platform;
 	initVariables();
@@ -84,7 +83,6 @@ AvalancheEngine::~AvalancheEngine() {
 	delete _ghostroom;
 	delete _help;
 	delete _shootemup;
-	delete _mainmenu;
 
 	for (int i = 0; i < 31; i++) {
 		for (int j = 0; j < 2; j++) {
@@ -170,7 +168,6 @@ Common::ErrorCode AvalancheEngine::initialize() {
 	_ghostroom = new GhostRoom(this);
 	_help = new Help(this);
 	_shootemup = new ShootEmUp(this);
-	_mainmenu = new MainMenu(this);
 
 	_graphics->init();
 	_dialogs->init();
diff --git a/engines/avalanche/avalanche.h b/engines/avalanche/avalanche.h
index 41ec00e..1eec79f 100644
--- a/engines/avalanche/avalanche.h
+++ b/engines/avalanche/avalanche.h
@@ -92,7 +92,6 @@ public:
 	GhostRoom *_ghostroom;
 	Help *_help;
 	ShootEmUp *_shootemup;
-	MainMenu *_mainmenu;
 
 	OSystem *_system;
 
diff --git a/engines/avalanche/avalot.cpp b/engines/avalanche/avalot.cpp
index ae96ac4..8f619e6 100644
--- a/engines/avalanche/avalot.cpp
+++ b/engines/avalanche/avalot.cpp
@@ -190,7 +190,6 @@ void AvalancheEngine::setup() {
 
 	_animation->resetAnims();
 
-	drawToolbar();
 	_dialogs->setReadyLight(2);
 
 	fadeIn();
@@ -210,12 +209,17 @@ void AvalancheEngine::setup() {
 
 		loadGame(loadSlot);
 	} else {
-		_mainmenu->run();
+		// We don't need the MainMenu during the whole game, only at the beginning of it.
+		MainMenu *mainmenu = new MainMenu(this);
+		mainmenu->run();
+		delete mainmenu;
 		if (_letMeOut)
 			return;
 		
 		newGame();
 
+		drawToolbar();
+
 		thinkAbout(kObjectMoney, kThing);
 
 		_dialogs->displayScrollChain('Q', 83); // Info on the game, etc.






More information about the Scummvm-git-logs mailing list