[Scummvm-cvs-logs] scummvm master -> 8b896600697d4605a9b23bef148c6a96bb2552a5

bgK bastien.bouclet at gmail.com
Sat Jul 2 22:04:23 CEST 2011


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:
a360a64dd7 SDL: Set a black palette by default.
8e80f5690d MOHAWK: Misc Mechanical fixes. Many thanks to Patrick Monnerat for the patch.
8b89660069 GUI: Zero is a valid save slot number.


Commit: a360a64dd744c922232e1f0d9a1b35a782bd572c
    https://github.com/scummvm/scummvm/commit/a360a64dd744c922232e1f0d9a1b35a782bd572c
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2011-07-02T13:01:45-07:00

Commit Message:
SDL: Set a black palette by default.

This fixes white flashing screens when using SDL 1.3.
SDL 1.3 palettes are all white by default, whereas
SDL 1.2 palettes are all black ...

Changed paths:
    backends/graphics/surfacesdl/surfacesdl-graphics.cpp



diff --git a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
index 66207b6..3739cb2 100644
--- a/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
+++ b/backends/graphics/surfacesdl/surfacesdl-graphics.cpp
@@ -157,6 +157,12 @@ SurfaceSdlGraphicsManager::SurfaceSdlGraphicsManager(SdlEventSource *sdlEventSou
 	_currentPalette = (SDL_Color *)calloc(sizeof(SDL_Color), 256);
 	_cursorPalette = (SDL_Color *)calloc(sizeof(SDL_Color), 256);
 
+	// Init palette with black :
+	// SDL 1.2 palettes default to all black,
+	// SDL 1.3 palettes default to all white,
+	// thus we have to set our own default.
+	memset(_currentPalette, 0, sizeof(SDL_Color) * 256);
+
 	_mouseBackup.x = _mouseBackup.y = _mouseBackup.w = _mouseBackup.h = 0;
 
 	memset(&_mouseCurState, 0, sizeof(_mouseCurState));
@@ -752,6 +758,9 @@ bool SurfaceSdlGraphicsManager::loadGFXMode() {
 		error("allocating _screen failed");
 #endif
 
+	// Set a default palette. SDL_SetColors does nothing for non indexed surfaces.
+	SDL_SetColors(_screen, _currentPalette, 0, 256);
+
 	//
 	// Create the surface that contains the scaled graphics in 16 bit mode
 	//


Commit: 8e80f5690d6e7e1c7d176a258799df29e703975a
    https://github.com/scummvm/scummvm/commit/8e80f5690d6e7e1c7d176a258799df29e703975a
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2011-07-02T13:01:46-07:00

Commit Message:
MOHAWK: Misc Mechanical fixes. Many thanks to Patrick Monnerat for the patch.

- Adds break statements where missing in Mechanical::toggleVar() and Mechanical::setVarValue()
- Restore proper numbering of Achenar and Sirrus panel state variables, which were wrongly swapped.
- When bird is singing, play sound continuously.
- When operating the fortress elevator, keep the engine sound active while the elevator is moving.

Changed paths:
    engines/mohawk/myst_scripts.cpp
    engines/mohawk/myst_stacks/mechanical.cpp
    engines/mohawk/sound.cpp



diff --git a/engines/mohawk/myst_scripts.cpp b/engines/mohawk/myst_scripts.cpp
index 17f6de5..307be2d 100644
--- a/engines/mohawk/myst_scripts.cpp
+++ b/engines/mohawk/myst_scripts.cpp
@@ -560,6 +560,7 @@ void MystScriptParser::o_playSoundBlocking(uint16 op, uint16 var, uint16 argc, u
 	debugC(kDebugScript, "Opcode %d: playSoundBlocking", op);
 	debugC(kDebugScript, "\tsoundId: %d", soundId);
 
+	_vm->_sound->stopSound();
 	_vm->_sound->playSoundBlocking(soundId);
 }
 
diff --git a/engines/mohawk/myst_stacks/mechanical.cpp b/engines/mohawk/myst_stacks/mechanical.cpp
index d6dd1b5..12d9dc7 100644
--- a/engines/mohawk/myst_stacks/mechanical.cpp
+++ b/engines/mohawk/myst_stacks/mechanical.cpp
@@ -102,6 +102,7 @@ void Mechanical::setupOpcodes() {
 
 void Mechanical::disablePersistentScripts() {
 	_fortressSimulationRunning = false;
+	_elevatorRotationLeverMoving = false;
 	_elevatorGoingMiddle = false;
 	_birdSinging = false;
 	_fortressRotationRunning = false;
@@ -126,10 +127,10 @@ void Mechanical::runPersistentScripts() {
 
 uint16 Mechanical::getVar(uint16 var) {
 	switch(var) {
-	case 0: // Sirrus's Secret Panel State
-		return _state.sirrusPanelState;
-	case 1: // Achenar's Secret Panel State
+	case 0: // Achenar's Secret Panel State
 		return _state.achenarPanelState;
+	case 1: // Sirrus's Secret Panel State
+		return _state.sirrusPanelState;
 	case 2: // Achenar's Secret Room Crate Lid Open and Blue Page Present
 		if (_state.achenarCrateOpened) {
 			if (_globals.bluePagesInBook & 4 || _globals.heldPage == 3)
@@ -195,16 +196,21 @@ uint16 Mechanical::getVar(uint16 var) {
 
 void Mechanical::toggleVar(uint16 var) {
 	switch(var) {
-	case 0: // Sirrus's Secret Panel State
-		_state.sirrusPanelState ^= 1;
-	case 1: // Achenar's Secret Panel State
+	case 0: // Achenar's Secret Panel State
 		_state.achenarPanelState ^= 1;
+		break;
+	case 1: // Sirrus's Secret Panel State
+		_state.sirrusPanelState ^= 1;
+		break;
 	case 3: // Achenar's Secret Room Crate State
 		_state.achenarCrateOpened ^= 1;
+		break;
 	case 4: // Myst Book Room Staircase State
 		_mystStaircaseState ^= 1;
+		break;
 	case 10: // Fortress Staircase State
 		_state.staircaseState ^= 1;
+		break;
 	case 16: // Code Lock Shape #1 - Left
 	case 17: // Code Lock Shape #2
 	case 18: // Code Lock Shape #3
@@ -242,6 +248,7 @@ bool Mechanical::setVarValue(uint16 var, uint16 value) {
 	switch (var) {
 	case 13:
 		_elevatorPosition = value;
+		break;
 	case 14: // Elevator going down when at top
 		_elevatorGoingDown = value;
 		break;
@@ -724,6 +731,7 @@ void Mechanical::birdSing_run() {
 	uint32 time = _vm->_system->getMillis();
 	if (_birdSingEndTime < time) {
 		_bird->pauseMovie(true);
+		_vm->_sound->stopSound();
 		_birdSinging = false;
 	}
 }
diff --git a/engines/mohawk/sound.cpp b/engines/mohawk/sound.cpp
index 6144c89..791b18d 100644
--- a/engines/mohawk/sound.cpp
+++ b/engines/mohawk/sound.cpp
@@ -141,6 +141,19 @@ Audio::SoundHandle *Sound::replaceSoundMyst(uint16 id, byte volume, bool loop) {
 				&& name.equals(_vm->getResourceName(ID_MSND, convertMystID(_handles[i].id))))
 			return &_handles[i].handle;
 
+	// The original engine also forces looping for those sounds
+	switch (id) {
+	case 2205:
+	case 2207:
+	case 5378:
+	case 7220:
+	case 9119: 	// Elevator engine sound in mechanical age is looping.
+	case 9120:
+	case 9327:
+		loop = true;
+		break;
+	}
+
 	stopSound();
 	return playSound(id, volume, loop);
 }


Commit: 8b896600697d4605a9b23bef148c6a96bb2552a5
    https://github.com/scummvm/scummvm/commit/8b896600697d4605a9b23bef148c6a96bb2552a5
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2011-07-02T13:01:47-07:00

Commit Message:
GUI: Zero is a valid save slot number.

Fixes loading from slot 0 using the GMM. 

Changed paths:
    engines/engine.cpp



diff --git a/engines/engine.cpp b/engines/engine.cpp
index b952f06..b19daa2 100644
--- a/engines/engine.cpp
+++ b/engines/engine.cpp
@@ -410,7 +410,7 @@ void Engine::openMainMenuDialog() {
 	// value, which is quite bad since it could
 	// be a fatal loading error, which renders
 	// the engine unusable.
-	if (_saveSlotToLoad > 0)
+	if (_saveSlotToLoad >= 0)
 		loadGameState(_saveSlotToLoad);
 
 	syncSoundSettings();






More information about the Scummvm-git-logs mailing list