[Scummvm-cvs-logs] scummvm master -> 0a9b8978ee87039e32ad6348f90d9cc3a0227a47
Strangerke
Strangerke at scummvm.org
Sat Mar 15 11:21:19 CET 2014
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
1cf283bfa7 CGE: Move several variable initializations to the constructor
62c4062841 CGE: Reorder CGEEngine constructor
0a9b8978ee CGE: Remove a useless variable, remove some associated dead code
Commit: 1cf283bfa7c460d4b73b2c896112ea5d5f41b3a8
https://github.com/scummvm/scummvm/commit/1cf283bfa7c460d4b73b2c896112ea5d5f41b3a8
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-03-15T11:09:52+01:00
Commit Message:
CGE: Move several variable initializations to the constructor
Changed paths:
engines/cge/cge.cpp
diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp
index 49297b0..f63acc2 100644
--- a/engines/cge/cge.cpp
+++ b/engines/cge/cge.cpp
@@ -83,6 +83,37 @@ CGEEngine::CGEEngine(OSystem *syst, const ADGameDescription *gameDescription)
_miniShp = nullptr;
_miniShpList = nullptr;
_console = nullptr;
+
+ _lastFrame = 0;
+ _lastTick = 0;
+ _music = true;
+ _maxScene = 0;
+ _dark = false;
+ _game = false;
+ _endGame = false;
+ _now = 1;
+ _lev = -1;
+ _mode = 0;
+ _soundOk = 1;
+ _sprTv = nullptr;
+ _gameCase2Cpt = 0;
+ _offUseCount = 0;
+ _sprK1 = nullptr;
+ _sprK2 = nullptr;
+ _sprK3 = nullptr;
+ _font = nullptr;
+ _vga = nullptr;
+ _sys = nullptr;
+
+ for (int i = 0; i < kPocketNX; i++)
+ _pocref[i] = -1;
+ _volume[0] = 0;
+ _volume[1] = 0;
+
+ for (int i = 0; i < 4; i++)
+ _flag[i] = false;
+
+ initSceneValues();
}
void CGEEngine::initSceneValues() {
@@ -101,14 +132,13 @@ void CGEEngine::init() {
debugC(1, kCGEDebugEngine, "CGEEngine::init()");
// Initialize fields
- _lastFrame = 0;
- _lastTick = 0;
- _hero = NULL;
- _shadow = NULL;
- _miniScene = NULL;
- _miniShp = NULL;
- _miniShpList = NULL;
- _sprite = NULL;
+ _hero = nullptr;
+ _shadow = nullptr;
+ _miniScene = nullptr;
+ _miniShp = nullptr;
+ _miniShpList = nullptr;
+ _sprite = nullptr;
+
_resman = new ResourceManager();
// Create debugger console
@@ -117,12 +147,12 @@ void CGEEngine::init() {
// Initialize engine objects
_font = new Font(this, "CGE");
_text = new Text(this, "CGE");
- _talk = NULL;
+ _talk = nullptr;
_vga = new Vga(this);
_sys = new System(this);
_pocLight = new PocLight(this);
for (int i = 0; i < kPocketNX; i++)
- _pocket[i] = NULL;
+ _pocket[i] = nullptr;
_horzLine = new HorizLine(this);
_infoLine = new InfoLine(this, kInfoW);
_sceneLight = new SceneLight(this);
@@ -137,30 +167,6 @@ void CGEEngine::init() {
_sound = new Sound(this);
_offUseCount = atoi(_text->getText(kOffUseCount));
- _music = true;
-
- for (int i = 0; i < kPocketNX; i++)
- _pocref[i] = -1;
- _volume[0] = 0;
- _volume[1] = 0;
-
- initSceneValues();
-
- _maxScene = 0;
- _dark = false;
- _game = false;
- _endGame = false;
- _now = 1;
- _lev = -1;
- _recentStep = -2;
-
- for (int i = 0; i < 4; i++)
- _flag[i] = false;
-
- _mode = 0;
- _soundOk = 1;
- _sprTv = NULL;
- _gameCase2Cpt = 0;
_startGameSlot = ConfMan.hasKey("save_slot") ? ConfMan.getInt("save_slot") : -1;
}
Commit: 62c4062841dd063118c1ac853a86e363184c1c68
https://github.com/scummvm/scummvm/commit/62c4062841dd063118c1ac853a86e363184c1c68
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-03-15T11:15:55+01:00
Commit Message:
CGE: Reorder CGEEngine constructor
Changed paths:
engines/cge/cge.cpp
diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp
index f63acc2..7459efe 100644
--- a/engines/cge/cge.cpp
+++ b/engines/cge/cge.cpp
@@ -50,13 +50,6 @@ CGEEngine::CGEEngine(OSystem *syst, const ADGameDescription *gameDescription)
DebugMan.addDebugChannel(kCGEDebugFile, "file", "CGE IO debug channel");
DebugMan.addDebugChannel(kCGEDebugEngine, "engine", "CGE Engine debug channel");
- _startupMode = 1;
- _oldLev = 0;
- _pocPtr = 0;
- _quitFlag = false;
- _showBoundariesFl = false;
- _startGameSlot = -1;
- _recentStep = -2;
_bitmapPalette = nullptr;
_pocLight = nullptr;
_keyboard = nullptr;
@@ -83,21 +76,7 @@ CGEEngine::CGEEngine(OSystem *syst, const ADGameDescription *gameDescription)
_miniShp = nullptr;
_miniShpList = nullptr;
_console = nullptr;
-
- _lastFrame = 0;
- _lastTick = 0;
- _music = true;
- _maxScene = 0;
- _dark = false;
- _game = false;
- _endGame = false;
- _now = 1;
- _lev = -1;
- _mode = 0;
- _soundOk = 1;
- _sprTv = nullptr;
- _gameCase2Cpt = 0;
- _offUseCount = 0;
+ _sprTv = nullptr;
_sprK1 = nullptr;
_sprK2 = nullptr;
_sprK3 = nullptr;
@@ -105,14 +84,34 @@ CGEEngine::CGEEngine(OSystem *syst, const ADGameDescription *gameDescription)
_vga = nullptr;
_sys = nullptr;
- for (int i = 0; i < kPocketNX; i++)
- _pocref[i] = -1;
- _volume[0] = 0;
- _volume[1] = 0;
-
+ _quitFlag = false;
+ _showBoundariesFl = false;
+ _music = true;
+ _dark = false;
+ _game = false;
+ _endGame = false;
for (int i = 0; i < 4; i++)
_flag[i] = false;
+ _startupMode = 1;
+ _oldLev = 0;
+ _pocPtr = 0;
+ _startGameSlot = -1;
+ _recentStep = -2;
+ _lastFrame = 0;
+ _lastTick = 0;
+ _maxScene = 0;
+ _now = 1;
+ _lev = -1;
+ _mode = 0;
+ _soundOk = 1;
+ _gameCase2Cpt = 0;
+ _offUseCount = 0;
+ _volume[0] = 0;
+ _volume[1] = 0;
+ for (int i = 0; i < kPocketNX; i++)
+ _pocref[i] = -1;
+
initSceneValues();
}
Commit: 0a9b8978ee87039e32ad6348f90d9cc3a0227a47
https://github.com/scummvm/scummvm/commit/0a9b8978ee87039e32ad6348f90d9cc3a0227a47
Author: Strangerke (strangerke at scummvm.org)
Date: 2014-03-15T11:19:21+01:00
Commit Message:
CGE: Remove a useless variable, remove some associated dead code
Changed paths:
engines/cge/cge.cpp
engines/cge/cge.h
engines/cge/cge_main.cpp
diff --git a/engines/cge/cge.cpp b/engines/cge/cge.cpp
index 7459efe..3f7aa4a 100644
--- a/engines/cge/cge.cpp
+++ b/engines/cge/cge.cpp
@@ -104,7 +104,6 @@ CGEEngine::CGEEngine(OSystem *syst, const ADGameDescription *gameDescription)
_now = 1;
_lev = -1;
_mode = 0;
- _soundOk = 1;
_gameCase2Cpt = 0;
_offUseCount = 0;
_volume[0] = 0;
diff --git a/engines/cge/cge.h b/engines/cge/cge.h
index 8c5ae29..1af9a90 100644
--- a/engines/cge/cge.h
+++ b/engines/cge/cge.h
@@ -168,7 +168,6 @@ public:
int _now;
int _lev;
int _mode;
- int _soundOk;
int _gameCase2Cpt;
int _offUseCount;
Dac *_bitmapPalette;
diff --git a/engines/cge/cge_main.cpp b/engines/cge/cge_main.cpp
index 260fd89..b18bae6 100644
--- a/engines/cge/cge_main.cpp
+++ b/engines/cge/cge_main.cpp
@@ -397,7 +397,7 @@ void CGEEngine::syncGame(Common::SeekableReadStream *readStream, Common::WriteSt
}
} else {
// Loading game
- if (_soundOk == 1 && _mode == 0) {
+ if (_mode == 0) {
// Skip Digital and Midi volumes, useless under ScummVM
sndSetVolume();
}
@@ -1483,25 +1483,6 @@ bool CGEEngine::showTitle(const char *name) {
selectPocket(-1);
_vga->sunrise(_vga->_sysPal);
- if (_mode < 2 && !_soundOk) {
- _vga->copyPage(1, 2);
- _vga->copyPage(0, 1);
- _vga->_showQ->append(_mouse);
- _mouse->on();
- for (; !_commandHandler->idle() || Vmenu::_addr;) {
- mainLoop();
- if (_quitFlag)
- return false;
- }
-
- _mouse->off();
- _vga->_showQ->clear();
- _vga->copyPage(0, 2);
- _soundOk = 2;
- if (_music)
- _midiPlayer->loadMidi(0);
- }
-
if (_mode < 2) {
// At this point the game originally set the protection variables
// used by the copy protection check
@@ -1540,7 +1521,7 @@ void CGEEngine::cge_main() {
if (_horzLine)
_horzLine->_flags._hide = true;
- if (_music && _soundOk)
+ if (_music)
_midiPlayer->loadMidi(0);
if (_startGameSlot != -1) {
More information about the Scummvm-git-logs
mailing list