[Scummvm-git-logs] scummvm master -> 7759af515d2a1536fe73c4ace911d7a5ca95ad20

sev- sev at scummvm.org
Sun May 10 12:04:55 UTC 2020


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

Summary:
627c901f8f DIRECTOR: Fix MSVC warnings
50b9d9a64c DIRECTOR: Fix another MSVC warning
08d0eebc54 DIRECTOR: LINGO: Simplified func_cursor(), so MSVC is less confused
a7d27bb48c CRYOMNI3D: Fix MSVC warning
eeb91e8143 DRAGONS: Fix MSVC warning
b07bce9c33 DRAGONS: Remove unnecessary type casts. Poor MSVC got confused
ad39319544 DRAGONS: Make MSVC happier with minigames
96174b9cb6 DRAGONS: Fix warnings in minigame3
61a1c515f7 DRAGONS: Fix more MSVC warnings
c44840285d MOHAWK: Replace assert() with error()
e23d50bae0 GRAPHICS: Specify signedness in TS_ARGB macro
d1dd4a71b6 ULTIMA: ULTIMA4: Remove unnecessary variable
3dc2012368 ULTIMA: ULTIMA8: Fixed bug in playMusic_internal()
c2e97b85ce JANITORIAL: Code formatting
6029da21a4 ULTIMA: ULTIMA8: Fix wrong API usage
771a0a01ce ULTIMA: Added override keywords
7759af515d GUI: Fixed warning


Commit: 627c901f8fcbc924266e27202f9c933b7e131570
    https://github.com/scummvm/scummvm/commit/627c901f8fcbc924266e27202f9c933b7e131570
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-10T13:38:20+02:00

Commit Message:
DIRECTOR: Fix MSVC warnings

Changed paths:
    engines/director/transitions.cpp


diff --git a/engines/director/transitions.cpp b/engines/director/transitions.cpp
index 72dcee2f1e..7afd95cf90 100644
--- a/engines/director/transitions.cpp
+++ b/engines/director/transitions.cpp
@@ -381,15 +381,15 @@ void Frame::playTransition(Score *score) {
 
 		case kTransCoverDown:								// 29
 			rto.setHeight(h);
-			rto.moveTo(0, -h + t.yStepSize * i);
+			rto.moveTo(0, t.yStepSize * i - h);
 			break;
 
 		case kTransCoverDownLeft:							// 30
-			rto.moveTo(w - t.xStepSize * i, -h + t.yStepSize * i);
+			rto.moveTo(w - t.xStepSize * i, t.yStepSize * i - h);
 			break;
 
 		case kTransCoverDownRight:							// 31
-			rto.moveTo(-w + t.xStepSize * i, -h + t.yStepSize * i);
+			rto.moveTo(t.xStepSize * i - w, t.yStepSize * i - h);
 			break;
 
 		case kTransCoverLeft:								// 32
@@ -397,7 +397,7 @@ void Frame::playTransition(Score *score) {
 			break;
 
 		case kTransCoverRight:								// 33
-			rto.moveTo(-w + t.xStepSize * i, 0);
+			rto.moveTo(t.xStepSize * i - w, 0);
 			break;
 
 		case kTransCoverUp:									// 34
@@ -409,7 +409,7 @@ void Frame::playTransition(Score *score) {
 			break;
 
 		case kTransCoverUpRight:							// 36
-			rto.moveTo(-w + t.xStepSize * i, h - t.yStepSize * i);
+			rto.moveTo(t.xStepSize * i - w, h - t.yStepSize * i);
 			break;
 
 		case kTransVenetianBlind:							// 37


Commit: 50b9d9a64cdec2c8b18ca50f27d10555dd39c8cd
    https://github.com/scummvm/scummvm/commit/50b9d9a64cdec2c8b18ca50f27d10555dd39c8cd
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-10T13:38:20+02:00

Commit Message:
DIRECTOR: Fix another MSVC warning

Changed paths:
    engines/director/transitions.cpp


diff --git a/engines/director/transitions.cpp b/engines/director/transitions.cpp
index 7afd95cf90..a9ddbcba83 100644
--- a/engines/director/transitions.cpp
+++ b/engines/director/transitions.cpp
@@ -784,7 +784,7 @@ static void transMultiPass(TransParams &t, Score *score, Common::Rect &clipRect)
 
 			for (int y = 0; y < t.yStepSize; y++) {
 				for (int x = 0; x < t.xStepSize; x++) {
-					if ((x & 2) ^ (y & 2) ^ flag) {
+					if ((x & 2) ^ (y & 2) ^ (int)flag) {
 						rto.moveTo(x * t.stripSize, y * t.stripSize);
 						rects.push_back(rto);
 					}


Commit: 08d0eebc54b5610b1541fac6e30957c6e9b5d3dc
    https://github.com/scummvm/scummvm/commit/08d0eebc54b5610b1541fac6e30957c6e9b5d3dc
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-10T13:38:20+02:00

Commit Message:
DIRECTOR: LINGO: Simplified func_cursor(), so MSVC is less confused

Changed paths:
    engines/director/lingo/lingo-funcs.cpp


diff --git a/engines/director/lingo/lingo-funcs.cpp b/engines/director/lingo/lingo-funcs.cpp
index d65bd9f3e6..86f03a1757 100644
--- a/engines/director/lingo/lingo-funcs.cpp
+++ b/engines/director/lingo/lingo-funcs.cpp
@@ -368,24 +368,21 @@ void Lingo::func_cursor(int c, int m) {
 		byte *dst = assembly;
 
 		for (int y = 0; y < 16; y++) {
-			const byte *cursor, *mask;
-			bool nocursor = false;
+			const byte *cursor = nullptr, *mask = nullptr;
 
-			if (y >= score->_loadedCast->getVal(c)->_surface->h ||
-					y >= score->_loadedCast->getVal(m)->_surface->h )
-				nocursor = true;
-
-			if (!nocursor) {
+			if (y < score->_loadedCast->getVal(c)->_surface->h &&
+					y < score->_loadedCast->getVal(m)->_surface->h) {
 				cursor = (const byte *)score->_loadedCast->getVal(c)->_surface->getBasePtr(0, y);
 				mask = (const byte *)score->_loadedCast->getVal(m)->_surface->getBasePtr(0, y);
 			}
 
 			for (int x = 0; x < 16; x++) {
 				if (x >= score->_loadedCast->getVal(c)->_surface->w ||
-						x >= score->_loadedCast->getVal(m)->_surface->w )
-					nocursor = true;
+						x >= score->_loadedCast->getVal(m)->_surface->w) {
+					cursor = mask = nullptr;
+				}
 
-				if (nocursor) {
+				if (!cursor) {
 					*dst = 3;
 				} else {
 					*dst = *mask ? 3 : (*cursor ? 1 : 0);


Commit: a7d27bb48cb34fd025dd635dd2923b447e912517
    https://github.com/scummvm/scummvm/commit/a7d27bb48cb34fd025dd635dd2923b447e912517
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-10T13:38:21+02:00

Commit Message:
CRYOMNI3D: Fix MSVC warning

Changed paths:
    engines/cryomni3d/font_manager.cpp


diff --git a/engines/cryomni3d/font_manager.cpp b/engines/cryomni3d/font_manager.cpp
index 1243dbe0fc..421d3b486d 100644
--- a/engines/cryomni3d/font_manager.cpp
+++ b/engines/cryomni3d/font_manager.cpp
@@ -143,7 +143,7 @@ void FontManager::loadTTFList(const Common::String &ttfList, Common::CodePage co
 		fontFiles.push_back(fontFile);
 
 		// Use 96 dpi as it's the default under Windows
-		Graphics::Font *font = Graphics::findTTFace(fontFiles, uniFontFace, bold, italic, -size,
+		Graphics::Font *font = Graphics::findTTFace(fontFiles, uniFontFace, bold, italic, -(int)size,
 		                       96, Graphics::kTTFRenderModeMonochrome);
 		if (!font) {
 			error("Can't find required face (line %u) in %s", i, fontFile.c_str());


Commit: eeb91e81436d53a7c171e742828222e0250e5037
    https://github.com/scummvm/scummvm/commit/eeb91e81436d53a7c171e742828222e0250e5037
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-10T13:38:21+02:00

Commit Message:
DRAGONS: Fix MSVC warning

Changed paths:
    engines/dragons/actorresource.cpp


diff --git a/engines/dragons/actorresource.cpp b/engines/dragons/actorresource.cpp
index 05b579196a..f65f404f9c 100644
--- a/engines/dragons/actorresource.cpp
+++ b/engines/dragons/actorresource.cpp
@@ -178,7 +178,7 @@ const char *ActorResource::getFilename() {
 }
 
 byte *ActorResource::getSequenceDataAtOffset(uint32 offset) {
-	assert(offset < _fileSize);
+	assert(offset < (uint32)_fileSize);
 	return &_data[offset];
 }
 


Commit: b07bce9c33be65d873acd25dae0ffa2c1ccab5fb
    https://github.com/scummvm/scummvm/commit/b07bce9c33be65d873acd25dae0ffa2c1ccab5fb
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-10T13:38:21+02:00

Commit Message:
DRAGONS: Remove unnecessary type casts. Poor MSVC got confused

Changed paths:
    engines/dragons/dragons.cpp


diff --git a/engines/dragons/dragons.cpp b/engines/dragons/dragons.cpp
index e70d4d1bff..24ecf1c9a4 100644
--- a/engines/dragons/dragons.cpp
+++ b/engines/dragons/dragons.cpp
@@ -1397,8 +1397,8 @@ void DragonsEngine::updatePaletteCycling() {
 			if (_paletteCyclingTbl[loopIndex].updateInterval != 0) {
 				if (_paletteCyclingTbl[loopIndex].updateCounter == 0) {
 					uint16 *palette = (uint16 *)_screen->getPalette(_paletteCyclingTbl[loopIndex].paletteType);
-					int16 uVar14 = (uint)(uint16)_paletteCyclingTbl[loopIndex].startOffset;
-					int16 uVar8 = (uint)(uint16)_paletteCyclingTbl[loopIndex].endOffset;
+					int16 uVar14 = _paletteCyclingTbl[loopIndex].startOffset;
+					int16 uVar8 = _paletteCyclingTbl[loopIndex].endOffset;
 					if (uVar14 < uVar8) {
 						uint16 uVar11 = palette[uVar8];
 						int uVar15 = uVar8;
@@ -1407,7 +1407,7 @@ void DragonsEngine::updatePaletteCycling() {
 								uVar8--;
 								palette[uVar15] = palette[uVar15 - 1];
 								uVar15 = uVar8 & 0xffff;
-							} while ((uint)(uint16)_paletteCyclingTbl[loopIndex].startOffset < (uVar8 & 0xffff));
+							} while (_paletteCyclingTbl[loopIndex].startOffset < (uVar8 & 0xffff));
 						}
 						palette[(uint16)_paletteCyclingTbl[loopIndex].startOffset] = uVar11;
 						_paletteCyclingTbl[loopIndex].updateCounter = _paletteCyclingTbl[loopIndex].updateInterval;
@@ -1420,7 +1420,7 @@ void DragonsEngine::updatePaletteCycling() {
 									uVar8--;
 									palette[uVar15] = palette[uVar15 + 1];
 									uVar15 = uVar8 & 0xffff;
-								} while ((uVar8 & 0xffff) < (uint)(uint16)_paletteCyclingTbl[loopIndex].startOffset);
+								} while ((uVar8 & 0xffff) < _paletteCyclingTbl[loopIndex].startOffset);
 							}
 							palette[(uint16)_paletteCyclingTbl[loopIndex].endOffset] = uVar11;
 							_paletteCyclingTbl[loopIndex].updateCounter =


Commit: ad3931954401c47df0faceccd7655bfad2476688
    https://github.com/scummvm/scummvm/commit/ad3931954401c47df0faceccd7655bfad2476688
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-10T13:38:21+02:00

Commit Message:
DRAGONS: Make MSVC happier with minigames

Changed paths:
    engines/dragons/minigame1.cpp
    engines/dragons/minigame5.cpp


diff --git a/engines/dragons/minigame1.cpp b/engines/dragons/minigame1.cpp
index 53abed9c20..92aaf5e331 100644
--- a/engines/dragons/minigame1.cpp
+++ b/engines/dragons/minigame1.cpp
@@ -56,7 +56,7 @@ void Minigame1::run() {
 	uint16 auStack1008 [200];
 	DragonINI *originalFlickerIniID;
 	uint16 local_25c;
-	uint16 local_25a;
+	uint16 local_25a = 0;
 	uint16 catFieldE_scaleMaybe;
 	uint16 hitCounter;
 	uint16 local_254;
@@ -66,12 +66,12 @@ void Minigame1::run() {
 	uint16 local_242;
 	uint16 local_240;
 	uint16 local_23e;
-	short local_23c;
+	short local_23c = 0;
 	short local_23a;
 	short local_238;
 	short gameState;
-	uint16 local_234;
-	short local_232;
+	uint16 local_234 = 0;
+	short local_232 = 0;
 	uint16 local_22e;
 	uint16 local_22c;
 	Actor *targetActorIdTbl [5];
diff --git a/engines/dragons/minigame5.cpp b/engines/dragons/minigame5.cpp
index 21ec98c883..66d96fed75 100644
--- a/engines/dragons/minigame5.cpp
+++ b/engines/dragons/minigame5.cpp
@@ -52,8 +52,8 @@ void Minigame5::run() {
 	DragonINI*local_78;
 	//uint16 local_76;
 	uint16 local_74;
-	uint16 local_72;
-	uint16 bombScale;
+	uint16 local_72 = 0;
+	uint16 bombScale = DRAGONS_ENGINE_SPRITE_100_PERCENT_SCALE;
 	Actor *bombActor;
 	Actor *flickerActor;
 	Actor *pusherActor;
@@ -61,10 +61,10 @@ void Minigame5::run() {
 	uint16 local_66;
 	Actor *wheelsActor;
 	uint16 local_62;
-	uint16 local_60;
-	uint16 local_5e;
-	short local_5c;
-	short local_5a;
+	uint16 local_60 = 0;
+	uint16 local_5e = 0;
+	short local_5c = 0;
+	short local_5a = 0;
 	uint16 currentState;
 	short local_50;
 	Actor *local_4e;


Commit: 96174b9cb692934593b22640ff434850fe814eb8
    https://github.com/scummvm/scummvm/commit/96174b9cb692934593b22640ff434850fe814eb8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-10T13:38:21+02:00

Commit Message:
DRAGONS: Fix warnings in minigame3

Changed paths:
    engines/dragons/minigame3.cpp


diff --git a/engines/dragons/minigame3.cpp b/engines/dragons/minigame3.cpp
index 9442958582..c1fefb8912 100644
--- a/engines/dragons/minigame3.cpp
+++ b/engines/dragons/minigame3.cpp
@@ -74,7 +74,7 @@ void Minigame3::run() {
 	//uint16 local_5b2;
 	//byte auStack1072_palette[512];
 	Actor *bunnyActorTbl[4];
-	uint16 local_228;
+	uint16 local_228 = 0;
 	//uint16 local_226;
 	int16 local_224;
 	Actor *tearActorTbl[8];
@@ -87,7 +87,7 @@ void Minigame3::run() {
 	Actor *tearBlinkActorTbl2[4];
 	Actor *tearBlinkActorTbl[4];
 	int16 local_1c8 = 0;
-	int16 local_1c6;
+	int16 local_1c6 = 0;
 	uint16 local_1c2;
 	int16 local_1c0;
 	int16 local_1be;
@@ -107,12 +107,12 @@ void Minigame3::run() {
 	int16 local_58;
 	int16 local_56;
 	int16 hopCounter;
-	uint16 local_50;
+	uint16 local_50 = 0;
 	BunnyStruct bunnyInfo[2];
-	uint16 local_20;
-	uint16 local_1e;
-	uint16 local_1c;
-	uint16 local_1a;
+	uint16 local_20 = 0;
+	uint16 local_1e = 0;
+	uint16 local_1c = 0;
+	uint16 local_1a = 0;
 	int16 local_16;
 	int16 local_14;
 	InventoryState origInventoryType;


Commit: 61a1c515f78f354eb5716fdcd5f7f5066d4f923b
    https://github.com/scummvm/scummvm/commit/61a1c515f78f354eb5716fdcd5f7f5066d4f923b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-10T13:38:21+02:00

Commit Message:
DRAGONS: Fix more MSVC warnings

Changed paths:
    engines/dragons/scriptopcodes.cpp
    engines/dragons/sound.cpp
    engines/dragons/specialopcodes.cpp
    engines/dragons/talk.cpp


diff --git a/engines/dragons/scriptopcodes.cpp b/engines/dragons/scriptopcodes.cpp
index 4c11a026ac..6f32e3f50f 100644
--- a/engines/dragons/scriptopcodes.cpp
+++ b/engines/dragons/scriptopcodes.cpp
@@ -459,7 +459,7 @@ void ScriptOpcodes::opActorLoadSequence(ScriptOpCall &scriptOpCall) {
 		ini->actor->_flags |= ACTOR_FLAG_2000;
 	}
 
-	if (!ini->actor->_actorResource || ini->actor->_actorResource->_id != ini->actorResourceId) {
+	if (!ini->actor->_actorResource || ini->actor->_actorResource->_id != (uint32)ini->actorResourceId) {
 		ini->actor->_actorResource = _vm->_actorManager->getActorResource(ini->actorResourceId);
 	}
 
diff --git a/engines/dragons/sound.cpp b/engines/dragons/sound.cpp
index f27e98600d..b5c70cf338 100644
--- a/engines/dragons/sound.cpp
+++ b/engines/dragons/sound.cpp
@@ -437,7 +437,7 @@ void SoundManager::stopSound(uint16 soundId, uint16 volumeId) {
 
 uint16 SoundManager::getVabFromSoundId(uint16 soundId) {
 	// TODO
-	return -1;
+	return 0;
 }
 
 void SoundManager::loadMsf(uint32 sceneId) {
diff --git a/engines/dragons/specialopcodes.cpp b/engines/dragons/specialopcodes.cpp
index c4d9db40f0..12afb1d263 100644
--- a/engines/dragons/specialopcodes.cpp
+++ b/engines/dragons/specialopcodes.cpp
@@ -271,10 +271,10 @@ void SpecialOpcodes::spcCastleGardenLogic() {
 		sceneUpdater.iniIDTbl[3][0] = 0x145;
 		sceneUpdater.iniIDTbl[4][0] = 0x144;
 	} else {
-		sceneUpdater.sequenceIDTbl[0][0] = -1;
-		sceneUpdater.sequenceIDTbl[1][0] = -1;
-		sceneUpdater.sequenceIDTbl[2][0] = -1;
-		sceneUpdater.sequenceIDTbl[3][0] = -1;
+		sceneUpdater.sequenceIDTbl[0][0] = 0xffff;
+		sceneUpdater.sequenceIDTbl[1][0] = 0xffff;
+		sceneUpdater.sequenceIDTbl[2][0] = 0xffff;
+		sceneUpdater.sequenceIDTbl[3][0] = 0xffff;
 		sceneUpdater.iniIDTbl[3][0] = 0x83;
 		sceneUpdater.iniIDTbl[4][0] = 0x74;
 	}
diff --git a/engines/dragons/talk.cpp b/engines/dragons/talk.cpp
index 889d7eeccb..94d056dea9 100644
--- a/engines/dragons/talk.cpp
+++ b/engines/dragons/talk.cpp
@@ -138,7 +138,7 @@ uint8 Talk::conversation_related_maybe(uint16 *dialogText, uint16 x, uint16 y, u
 	uint16 *dialogTextLinePtr;
 	uint16 *puVar18;
 	uint16 *curDialogTextPtr;
-	int unaff_s4;
+	int unaff_s4 = 0;
 	uint16 uVar19;
 	short sVar20;
 	uint32 maxLineLengthMaybe;
@@ -644,7 +644,7 @@ bool Talk::talkToActor(ScriptOpCall &scriptOpCall) {
 
 TalkDialogEntry *Talk::displayTalkDialogMenu(Common::Array<TalkDialogEntry*> dialogEntries) {
 	bool bVar1;
-	short sVar2;
+	__INT16_TYPE__ sVar2;
 	uint uVar3;
 	uint uVar4;
 	uint16 y;
@@ -659,7 +659,7 @@ TalkDialogEntry *Talk::displayTalkDialogMenu(Common::Array<TalkDialogEntry*> dia
 	uint16 numEntries;
 	uint16 local_60;
 	uint16 local_58;
-	short local_50;
+	int16 local_50;
 	uint16 *local_40;
 	uint local_38;
 	bool hasDialogEntries;
@@ -777,7 +777,7 @@ TalkDialogEntry *Talk::displayTalkDialogMenu(Common::Array<TalkDialogEntry*> dia
 					uVar4 = FindLastPositionOf5cChar(_dat_80083104);
 					uVar4 = FUN_80031c28(_dat_80083104, local_40, uVar4 & 0xffff, 0x20);
 					_dat_80083104 = local_40;
-					if ((int)sVar2 == (uint)uVar8) {
+					if (sVar2 == uVar8) {
 						uVar7 = 0;
 						if (uVar6 < (uVar4 & 0xffff)) {
 							do {


Commit: c44840285d8a4cf6333edbd0250df348c1c5749b
    https://github.com/scummvm/scummvm/commit/c44840285d8a4cf6333edbd0250df348c1c5749b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-10T13:38:21+02:00

Commit Message:
MOHAWK: Replace assert() with error()

assert() is not compiled in MSVC release builds, which would lead
to unexpected behavior.

Changed paths:
    engines/mohawk/myst.cpp


diff --git a/engines/mohawk/myst.cpp b/engines/mohawk/myst.cpp
index b6ae6efdb4..8a4e238530 100644
--- a/engines/mohawk/myst.cpp
+++ b/engines/mohawk/myst.cpp
@@ -700,7 +700,7 @@ bool MohawkEngine_Myst::canDoAction(MystEventAction action) {
 		return actionsAllowed && stack->getStackId() != kDemoStack;
 	default:
 		// Not implemented yet
-		assert(false);
+		error("canDoAction(): Not implemented");
 	}
 }
 


Commit: e23d50bae0fab72463554ca811c523ff7734f99e
    https://github.com/scummvm/scummvm/commit/e23d50bae0fab72463554ca811c523ff7734f99e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-10T13:38:21+02:00

Commit Message:
GRAPHICS: Specify signedness in TS_ARGB macro

Changed paths:
    graphics/transparent_surface.h


diff --git a/graphics/transparent_surface.h b/graphics/transparent_surface.h
index 8f4493679b..8bfddef8c1 100644
--- a/graphics/transparent_surface.h
+++ b/graphics/transparent_surface.h
@@ -36,11 +36,11 @@
  */
 
 #ifdef SCUMM_LITTLE_ENDIAN
-#define TS_RGB(R,G,B)       ((0xff << 24) | ((R) << 16) | ((G) << 8) | (B))
-#define TS_ARGB(A,R,G,B)    (((R) << 24) | ((G) << 16) | ((B) << 8) | (A))
+#define TS_RGB(R,G,B)       (uint32)((0xff << 24) | ((R) << 16) | ((G) << 8) | (B))
+#define TS_ARGB(A,R,G,B)    (uint32)(((R) << 24) | ((G) << 16) | ((B) << 8) | (A))
 #else
-#define TS_RGB(R,G,B)       (((R) << 24) | ((G) << 16) | (B << 8) | 0xff)
-#define TS_ARGB(A,R,G,B)    (((R) << 24) | ((G) << 16) | ((B) << 8) | (A))
+#define TS_RGB(R,G,B)       (uint32)(((R) << 24) | ((G) << 16) | (B << 8) | 0xff)
+#define TS_ARGB(A,R,G,B)    (uint32)(((R) << 24) | ((G) << 16) | ((B) << 8) | (A))
 #endif
 
 namespace Graphics {


Commit: d1dd4a71b6b2d9e08d969e9cada4bc148630e3a6
    https://github.com/scummvm/scummvm/commit/d1dd4a71b6b2d9e08d969e9cada4bc148630e3a6
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-10T13:39:01+02:00

Commit Message:
ULTIMA: ULTIMA4: Remove unnecessary variable

Changed paths:
    engines/ultima/ultima4/gfx/image.cpp


diff --git a/engines/ultima/ultima4/gfx/image.cpp b/engines/ultima/ultima4/gfx/image.cpp
index 585277b99e..577f153cf5 100644
--- a/engines/ultima/ultima4/gfx/image.cpp
+++ b/engines/ultima/ultima4/gfx/image.cpp
@@ -437,7 +437,6 @@ void Image::drawSubRectOn(Image *d, int x, int y, int rx, int ry, int rw, int rh
 		// Blitting entire surface with stretching
 		assert(rx == 0 && ry == 0);
 
-		Graphics::ManagedSurface *destSurface = getSurface(d);
 		destSurface->transBlitFrom(*_surface,
 			Common::Rect(0, 0, _surface->w, _surface->h),
 			Common::Rect(x, y, x + rw, y + rh),


Commit: 3dc20123682af3a35223a4c903816ebfe42e8222
    https://github.com/scummvm/scummvm/commit/3dc20123682af3a35223a4c903816ebfe42e8222
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-10T13:40:48+02:00

Commit Message:
ULTIMA: ULTIMA8: Fixed bug in playMusic_internal()

Class variable was not updated because it was shadowed.

Changed paths:
    engines/ultima/ultima8/audio/remorse_music_process.cpp


diff --git a/engines/ultima/ultima8/audio/remorse_music_process.cpp b/engines/ultima/ultima8/audio/remorse_music_process.cpp
index 7eff13713e..cee7e32f9f 100644
--- a/engines/ultima/ultima8/audio/remorse_music_process.cpp
+++ b/engines/ultima/ultima8/audio/remorse_music_process.cpp
@@ -133,7 +133,7 @@ void RemorseMusicProcess::playMusic_internal(int track) {
 			return;
 		}
 
-		Audio::AudioStream *_playingStream = Audio::makeModXmS3mStream(rs, DisposeAfterUse::YES);
+		_playingStream = Audio::makeModXmS3mStream(rs, DisposeAfterUse::YES);
 		if (!_playingStream) {
 			error("Couldn't create stream from AMF file: %s", fname.c_str());
 			return;


Commit: c2e97b85ce4c96a5bbed4cf3efd1d932b5410a8d
    https://github.com/scummvm/scummvm/commit/c2e97b85ce4c96a5bbed4cf3efd1d932b5410a8d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-10T13:53:01+02:00

Commit Message:
JANITORIAL: Code formatting

Changed paths:
    engines/ultima/ultima8/convert/convert_shape.cpp


diff --git a/engines/ultima/ultima8/convert/convert_shape.cpp b/engines/ultima/ultima8/convert/convert_shape.cpp
index 26994720a3..68ceb7cf05 100644
--- a/engines/ultima/ultima8/convert/convert_shape.cpp
+++ b/engines/ultima/ultima8/convert/convert_shape.cpp
@@ -42,12 +42,10 @@ void ConvertShapeFrame::Free() {
 	_rle_data = nullptr;
 }
 
-ConvertShape::ConvertShape() : _num_frames(0), _frames(nullptr)
-{
+ConvertShape::ConvertShape() : _num_frames(0), _frames(nullptr) {
 }
 
-void ConvertShape::Free()
-{
+void ConvertShape::Free() {
 	if (_frames)
 		for(uint32 i = 0; i < _num_frames; ++i)
 			_frames[i].Free();
@@ -57,19 +55,16 @@ void ConvertShape::Free()
 	_num_frames = 0;
 }
 
-void ConvertShape::Read(IDataSource *source, const ConvertShapeFormat *csf, uint32 real_len)
-{
+void ConvertShape::Read(IDataSource *source, const ConvertShapeFormat *csf, uint32 real_len) {
 	// Just to be safe
 	uint32 start_pos = source->pos();
 
 	// Read the ident
-	if (csf->_bytes_ident)
-	{
+	if (csf->_bytes_ident) {
 		char ident[4];
 		source->read(ident, csf->_bytes_ident);
 
-		if (Std::memcmp (ident, csf->_ident, csf->_bytes_ident))
-		{
+		if (Std::memcmp (ident, csf->_ident, csf->_bytes_ident)) {
 			perr << "Warning: Corrupt shape!" << Std::endl;
 			return;
 		}
@@ -79,7 +74,7 @@ void ConvertShape::Read(IDataSource *source, const ConvertShapeFormat *csf, uint
 	uint8 special[256];
 	if (csf->_bytes_special) {
 		memset(special, 0, 256);
-		for (uint32 i = 0; i < csf->_bytes_special; i++) special[source->readByte()&0xFF] = i+2;
+		for (uint32 i = 0; i < csf->_bytes_special; i++) special[source->readByte()&0xFF] = i + 2;
 	}
 
 	// Read the header unknown
@@ -111,8 +106,7 @@ void ConvertShape::Read(IDataSource *source, const ConvertShapeFormat *csf, uint
 	Std::memset (_frames, 0, _num_frames * sizeof(ConvertShapeFrame));
 
 	// Now read the _frames
-	for(uint32 f = 0; f < _num_frames; ++f) 
-	{
+	for(uint32 f = 0; f < _num_frames; ++f) {
 #ifdef COMP_SHAPENUM
 		if (shapenum == COMP_SHAPENUM) pout << "Frame " << f << Std::endl;
 #endif
@@ -151,7 +145,7 @@ void ConvertShape::Read(IDataSource *source, const ConvertShapeFormat *csf, uint
 
 		if (csf->_bytes_special)
 			frame->ReadCmpFrame(source, csf, special, f>0?_frames+f-1:0);
-		else 
+		else
 			frame->Read(source, csf, frame_length);
 	}
 
@@ -160,8 +154,7 @@ void ConvertShape::Read(IDataSource *source, const ConvertShapeFormat *csf, uint
 #endif
 }
 
-void ConvertShapeFrame::Read(IDataSource *source, const ConvertShapeFormat *csf, uint32 frame_length)
-{
+void ConvertShapeFrame::Read(IDataSource *source, const ConvertShapeFormat *csf, uint32 frame_length) {
 	// Read unknown
 	if (csf->_bytes_frame_unknown) source->read(_unknown, csf->_bytes_frame_unknown);
 
@@ -202,7 +195,7 @@ void ConvertShapeFrame::Read(IDataSource *source, const ConvertShapeFormat *csf,
 
 			// Now fudge with the value and turn it into an offset into the rle data
 			// If required
-			if (!csf->_line_offset_absolute) 
+			if (!csf->_line_offset_absolute)
 				_line_offsets[i] -= (_height-i)*csf->_bytes_line_offset;
 		}
 
@@ -210,26 +203,24 @@ void ConvertShapeFrame::Read(IDataSource *source, const ConvertShapeFormat *csf,
 		_bytes_rle = frame_length - (csf->_len_frameheader2+(_height*csf->_bytes_line_offset));
 
 #ifdef COMP_SHAPENUM
-		if (_bytes_rle < 0)
-		{
+		if (_bytes_rle < 0) {
 			_bytes_rle = 0;
 			perr << "Corrupt frame?" << Std::endl;
 		}
-		
+
 #endif
-	} else 
+	} else
 		_line_offsets = nullptr;
 
 	// Read the RLE Data
 	if (_bytes_rle) {
 		_rle_data = new uint8[_bytes_rle];
 		source->read(_rle_data, _bytes_rle);
-	} else 
+	} else
 		_rle_data = nullptr;
 }
 
-void ConvertShapeFrame::ReadCmpFrame(IDataSource *source, const ConvertShapeFormat *csf, const uint8 special[256], ConvertShapeFrame *prev)
-{
+void ConvertShapeFrame::ReadCmpFrame(IDataSource *source, const ConvertShapeFormat *csf, const uint8 special[256], ConvertShapeFrame *prev) {
 	static OAutoBufferDataSource *rlebuf = nullptr;
 	uint8 outbuf[512];
 
@@ -248,19 +239,17 @@ void ConvertShapeFrame::ReadCmpFrame(IDataSource *source, const ConvertShapeForm
 	if (!rlebuf) rlebuf = new OAutoBufferDataSource(1024);
 	rlebuf->clear();
 
-	for(int32 y = 0; y < _height; ++y) 
-	{
+	for(int32 y = 0; y < _height; ++y) {
 		_line_offsets[y] = rlebuf->pos();
 
 		int32 xpos = 0;
 
-		do
-		{
+		do {
 			uint8 skip = source->readByte();
 			xpos += skip;
 
 			if (xpos > _width) {
-				source->skip(-1); 
+				source->skip(-1);
 				skip = _width-(xpos-skip);
 			}
 
@@ -273,14 +262,14 @@ void ConvertShapeFrame::ReadCmpFrame(IDataSource *source, const ConvertShapeForm
 
 			// Is this required???? It seems hacky and pointless
 			if (dlen == 0 || dlen == 1) {
-				source->skip(-1); 
+				source->skip(-1);
 				rlebuf->skip(-1);
 				rlebuf->writeByte(skip+(_width-xpos));
 				break;
 			}
 
 			int type = 0;
-			
+
 			if (_compression)  {
 				type = dlen & 1;
 				dlen >>= 1;
@@ -300,16 +289,14 @@ void ConvertShapeFrame::ReadCmpFrame(IDataSource *source, const ConvertShapeForm
 						o+=count;
 						extra += count-1;
 						xpos += count;
-					}
-					else if (c == 0xFF && prev) {
+					} else if (c == 0xFF && prev) {
 						int32 count = source->readByte();
 						prev->GetPixels(o,count,xpos-_xoff,y-_yoff);
 						o+=count;
 						extra += count-2;
 						xpos += count;
 						j++;
-					}
-					else {
+					} else {
 						*o++ = c;
 						xpos++;
 					}
@@ -321,8 +308,7 @@ void ConvertShapeFrame::ReadCmpFrame(IDataSource *source, const ConvertShapeForm
 
 				rlebuf->writeByte((dlen+extra) << _compression);
 				rlebuf->write(outbuf,dlen+extra);
-			}
-			else {
+			} else {
 				rlebuf->writeByte((dlen<<1)|1);
 				rlebuf->writeByte(source->readByte());
 				xpos+=dlen;
@@ -336,8 +322,7 @@ void ConvertShapeFrame::ReadCmpFrame(IDataSource *source, const ConvertShapeForm
 	memcpy (_rle_data, rlebuf->getData(), _bytes_rle);
 }
 
-void ConvertShapeFrame::GetPixels(uint8 *buf, int32 count, int32 x, int32 y)
-{
+void ConvertShapeFrame::GetPixels(uint8 *buf, int32 count, int32 x, int32 y) {
 	x += _xoff;
 	y += _yoff;
 
@@ -348,20 +333,18 @@ void ConvertShapeFrame::GetPixels(uint8 *buf, int32 count, int32 x, int32 y)
 
 	do {
 		xpos += *linedata++;
-	  
+
 		if (xpos == _width) break;
 
 		int32 dlen = *linedata++;
 		int type = 0;
-		
-		if (_compression) 
-		{
+
+		if (_compression) {
 			type = dlen & 1;
 			dlen >>= 1;
 		}
 
-		if (x >= xpos && x < (xpos+dlen))
-		{
+		if (x >= xpos && x < (xpos+dlen)) {
 			int diff = x-xpos;
 			dlen-=diff;
 			xpos = x;
@@ -377,8 +360,7 @@ void ConvertShapeFrame::GetPixels(uint8 *buf, int32 count, int32 x, int32 y)
 					count--;
 					x++;
 				}
-			}
-			else {
+			} else {
 				uint8 l = *linedata;
 
 				while (num--) {
@@ -390,7 +372,7 @@ void ConvertShapeFrame::GetPixels(uint8 *buf, int32 count, int32 x, int32 y)
 
 			if (count == 0) return;
 		}
-		
+
 		if (!type) linedata+=dlen;
 		else linedata++;
 
@@ -399,8 +381,7 @@ void ConvertShapeFrame::GetPixels(uint8 *buf, int32 count, int32 x, int32 y)
 	} while (xpos < _width);
 }
 
-int ConvertShape::CalcNumFrames(IDataSource *source, const ConvertShapeFormat *csf, uint32 real_len, uint32 start_pos)
-{
+int ConvertShape::CalcNumFrames(IDataSource *source, const ConvertShapeFormat *csf, uint32 real_len, uint32 start_pos) {
 	int f=0;
 	uint32 first_offset = 0xFFFFFFFF;
 
@@ -434,8 +415,7 @@ int ConvertShape::CalcNumFrames(IDataSource *source, const ConvertShapeFormat *c
 	return f;
 }
 
-bool ConvertShape::Check(IDataSource *source, const ConvertShapeFormat *csf, uint32 real_len)
-{
+bool ConvertShape::Check(IDataSource *source, const ConvertShapeFormat *csf, uint32 real_len) {
 #if 0
 	pout << "Testing " << csf->_name << "..." << Std::endl;
 #endif
@@ -445,14 +425,12 @@ bool ConvertShape::Check(IDataSource *source, const ConvertShapeFormat *csf, uin
 	int start_pos = source->pos();
 
 	// Read the ident
-	if (csf->_bytes_ident)
-	{
+	if (csf->_bytes_ident) {
 		char ident[5];
 		ident[csf->_bytes_ident] = 0;
 		source->read(ident, csf->_bytes_ident);
 
-		if (Std::memcmp (ident, csf->_ident, csf->_bytes_ident))
-		{
+		if (Std::memcmp (ident, csf->_ident, csf->_bytes_ident)) {
 			// Return to start position
 			source->seek(start_pos);
 			return false;
@@ -475,8 +453,7 @@ bool ConvertShape::Check(IDataSource *source, const ConvertShapeFormat *csf, uin
 	Std::memset (&oneframe, 0, sizeof(ConvertShapeFrame));
 
 	// Now read the _frames
-	for (int f = 0; f < numFrames; f++) 
-	{
+	for (int f = 0; f < numFrames; f++) {
 		ConvertShapeFrame *frame = &oneframe;
 
 		// Seek to initial pos
@@ -494,8 +471,7 @@ bool ConvertShape::Check(IDataSource *source, const ConvertShapeFormat *csf, uin
 		if (csf->_bytes_frame_length) frame_length = source->readX(csf->_bytes_frame_length) + csf->_bytes_frame_length_kludge;
 
 		// Invalid frame length
-		if ((frame_length + frame_offset) > real_len)
-		{
+		if ((frame_length + frame_offset) > real_len) {
 			result = false;
 			break;
 		}
@@ -513,8 +489,7 @@ bool ConvertShape::Check(IDataSource *source, const ConvertShapeFormat *csf, uin
 		frame->_xoff = source->readXS(csf->_bytes_frame_xoff);
 		frame->_yoff = source->readXS(csf->_bytes_frame_yoff);
 
-		if ((frame->_compression != 0 && frame->_compression != 1) || frame->_width < 0 || frame->_height < 0)
-		{
+		if ((frame->_compression != 0 && frame->_compression != 1) || frame->_width < 0 || frame->_height < 0) {
 			frame->_compression = 0;
 			frame->_width = 0;
 			frame->_height = 0;
@@ -524,8 +499,7 @@ bool ConvertShape::Check(IDataSource *source, const ConvertShapeFormat *csf, uin
 			break;
 		}
 
-		if (frame->_height)
-		{
+		if (frame->_height) {
 			// Line offsets
 			int32 highest_offset_byte = 0;
 
@@ -533,8 +507,7 @@ bool ConvertShape::Check(IDataSource *source, const ConvertShapeFormat *csf, uin
 			frame->_bytes_rle = frame_length - (csf->_len_frameheader2+(frame->_height*csf->_bytes_line_offset));
 
 			// Totally invalid shape
-			if (frame->_bytes_rle < 0)
-			{
+			if (frame->_bytes_rle < 0) {
 				result = false;
 				break;
 			}
@@ -546,17 +519,15 @@ bool ConvertShape::Check(IDataSource *source, const ConvertShapeFormat *csf, uin
 				source->seek(start_pos + frame_offset + csf->_len_frameheader2);
 
 				// Loop through each of the _frames and find the last rle run
-				for (int i = 0; i < frame->_height; i++) 
-				{
+				for (int i = 0; i < frame->_height; i++) {
 					int32 line_offset = source->readX(csf->_bytes_line_offset);
 
 					// Now fudge with the value and turn it into an offset into the rle data
 					// if required
-					if (!csf->_line_offset_absolute) 
+					if (!csf->_line_offset_absolute)
 						line_offset -= (frame->_height-i)*csf->_bytes_line_offset;
 
-					if (line_offset > frame->_bytes_rle)
-					{
+					if (line_offset > frame->_bytes_rle) {
 						result = false;
 						break;
 					}
@@ -573,40 +544,40 @@ bool ConvertShape::Check(IDataSource *source, const ConvertShapeFormat *csf, uin
 				uint32 dlen = 0;
 
 				// Compressed
-				if (frame->_compression) do
-				{
-					xpos += source->readByte();
-					if (xpos == frame->_width) break;
+				if (frame->_compression) {
+					do {
+						xpos += source->readByte();
+						if (xpos == frame->_width) break;
 
-					dlen = source->readByte();
-					int type = dlen & 1;
-					dlen >>= 1;
+						dlen = source->readByte();
+						int type = dlen & 1;
+						dlen >>= 1;
 
-					if (!type) source->skip(dlen);
-					else source->skip(1);
+						if (!type) source->skip(dlen);
+						else source->skip(1);
 
-					xpos += dlen;
+						xpos += dlen;
 
-				} while (xpos < frame->_width);
+					} while (xpos < frame->_width);
 				// Uncompressed
-				else do
-				{
-					xpos += source->readByte();
-					if (xpos == frame->_width) break;
+				} else {
+					do {
+						xpos += source->readByte();
+						if (xpos == frame->_width) break;
 
-					dlen = source->readByte();
-					source->skip(dlen);
+						dlen = source->readByte();
+						source->skip(dlen);
 
-					xpos += dlen;
-				} while (xpos < frame->_width);
+						xpos += dlen;
+					} while (xpos < frame->_width);
+				}
 
 				// Calc 'real' bytes rle
 				int32 highest_rle_byte = source->pos();
 				highest_rle_byte -= start_pos + frame_offset + csf->_len_frameheader2 + frame->_height*csf->_bytes_line_offset;
 
 				// Too many bytes
-				if (highest_rle_byte > frame->_bytes_rle)
-				{
+				if (highest_rle_byte > frame->_bytes_rle) {
 					result = false;
 					break;
 				}
@@ -623,8 +594,7 @@ bool ConvertShape::Check(IDataSource *source, const ConvertShapeFormat *csf, uin
 	return result;
 }
 
-bool ConvertShape::CheckUnsafe(IDataSource *source, const ConvertShapeFormat *csf, uint32 real_len)
-{
+bool ConvertShape::CheckUnsafe(IDataSource *source, const ConvertShapeFormat *csf, uint32 real_len) {
 #if 0
 	pout << "Testing " << csf->_name << "..." << Std::endl;
 #endif
@@ -634,14 +604,12 @@ bool ConvertShape::CheckUnsafe(IDataSource *source, const ConvertShapeFormat *cs
 	const uint32 start_pos = source->pos();
 
 	// Read the ident
-	if (csf->_bytes_ident)
-	{
+	if (csf->_bytes_ident) {
 		char ident[5];
 		ident[csf->_bytes_ident] = 0;
 		source->read(ident, csf->_bytes_ident);
 
-		if (Std::memcmp (ident, csf->_ident, csf->_bytes_ident))
-		{
+		if (Std::memcmp (ident, csf->_ident, csf->_bytes_ident)) {
 			// Return to start position
 			source->seek(start_pos);
 			return false;
@@ -664,8 +632,7 @@ bool ConvertShape::CheckUnsafe(IDataSource *source, const ConvertShapeFormat *cs
 	Std::memset (&oneframe, 0, sizeof(ConvertShapeFrame));
 
 	// Now read the _frames
-	for (int f = 0; f < numFrames; f++) 
-	{
+	for (int f = 0; f < numFrames; f++) {
 		ConvertShapeFrame *frame = &oneframe;
 
 		// Seek to initial pos
@@ -683,8 +650,7 @@ bool ConvertShape::CheckUnsafe(IDataSource *source, const ConvertShapeFormat *cs
 		if (csf->_bytes_frame_length) frame_length = source->readX(csf->_bytes_frame_length) + csf->_bytes_frame_length_kludge;
 
 		// Invalid frame length
-		if ((frame_length + frame_offset) > real_len)
-		{
+		if ((frame_length + frame_offset) > real_len) {
 			result = false;
 			break;
 		}
@@ -702,8 +668,7 @@ bool ConvertShape::CheckUnsafe(IDataSource *source, const ConvertShapeFormat *cs
 		frame->_xoff = source->readXS(csf->_bytes_frame_xoff);
 		frame->_yoff = source->readXS(csf->_bytes_frame_yoff);
 
-		if ((frame->_compression != 0 && frame->_compression != 1) || frame->_width < 0 || frame->_height < 0)
-		{
+		if ((frame->_compression != 0 && frame->_compression != 1) || frame->_width < 0 || frame->_height < 0) {
 			frame->_compression = 0;
 			frame->_width = 0;
 			frame->_height = 0;
@@ -713,14 +678,12 @@ bool ConvertShape::CheckUnsafe(IDataSource *source, const ConvertShapeFormat *cs
 			break;
 		}
 
-		if (frame->_height)
-		{
+		if (frame->_height) {
 			// Calculate the number of bytes of RLE data (may not be accurate but we don't care)
 			frame->_bytes_rle = frame_length - (csf->_len_frameheader2+(frame->_height*csf->_bytes_line_offset));
 
 			// Totally invalid shape
-			if (frame->_bytes_rle < 0)
-			{
+			if (frame->_bytes_rle < 0) {
 				result = false;
 				break;
 			}
@@ -736,8 +699,7 @@ bool ConvertShape::CheckUnsafe(IDataSource *source, const ConvertShapeFormat *cs
 	return result;
 }
 
-void ConvertShape::Write(ODataSource *dest, const ConvertShapeFormat *csf, uint32 &write_len)
-{
+void ConvertShape::Write(ODataSource *dest, const ConvertShapeFormat *csf, uint32 &write_len) {
 	// Just to be safe
 	const uint32 start_pos = dest->pos();
 
@@ -749,9 +711,8 @@ void ConvertShape::Write(ODataSource *dest, const ConvertShapeFormat *csf, uint3
 
 	// Now write _num_frames
 	if (csf->_bytes_num_frames) dest->writeX(_num_frames, csf->_bytes_num_frames);
-	else if (!csf->_bytes_num_frames && _num_frames > 1)
-	{
-		perr << "Error: Unable to convert multiple frame shapes to " << csf->_name << Std::endl; 
+	else if (!csf->_bytes_num_frames && _num_frames > 1) {
+		perr << "Error: Unable to convert multiple frame shapes to " << csf->_name << Std::endl;
 		return;
 	}
 
@@ -759,8 +720,7 @@ void ConvertShape::Write(ODataSource *dest, const ConvertShapeFormat *csf, uint3
 	for (uint32 i = 0; i < _num_frames*csf->_len_frameheader; i++) dest->writeByte(0);
 
 	// Now write the _frames
-	for(uint32 f = 0; f < _num_frames; f++) 
-	{
+	for(uint32 f = 0; f < _num_frames; f++) {
 		ConvertShapeFrame *frame = _frames+f;
 
 		// Get the frame offset
@@ -776,8 +736,7 @@ void ConvertShape::Write(ODataSource *dest, const ConvertShapeFormat *csf, uint3
 		if (csf->_bytes_frameheader_unk) dest->write(frame->_header_unknown, csf->_bytes_frameheader_unk);
 
 		// Calc and write frame_length
-		if (csf->_bytes_frame_length)
-		{
+		if (csf->_bytes_frame_length) {
 			uint32 frame_length = csf->_len_frameheader2 + (frame->_height*csf->_bytes_line_offset) + frame->_bytes_rle;
 			dest->writeX(frame_length - csf->_bytes_frame_length_kludge, csf->_bytes_frame_length);
 		}
@@ -796,12 +755,11 @@ void ConvertShape::Write(ODataSource *dest, const ConvertShapeFormat *csf, uint3
 		dest->writeX(frame->_yoff, csf->_bytes_frame_yoff);
 
 		// Line offsets
-		for (int32 i = 0; i < frame->_height; i++) 
-		{
+		for (int32 i = 0; i < frame->_height; i++) {
 			int32 actual_offset = frame->_line_offsets[i];
-			
+
 			// Unfudge the value and write it, if requiretd
-			if (!csf->_line_offset_absolute)  
+			if (!csf->_line_offset_absolute)
 				actual_offset += (frame->_height-i)*csf->_bytes_line_offset;
 
 			dest->writeX(actual_offset, csf->_bytes_line_offset);
@@ -817,12 +775,11 @@ void ConvertShape::Write(ODataSource *dest, const ConvertShapeFormat *csf, uint3
 
 
 // Shape format configuration for Pentagram
-const ConvertShapeFormat		PentagramShapeFormat =
-{
+const ConvertShapeFormat		PentagramShapeFormat = {
 	"Pentagram",
 	8,		// header
 	"PSHP",	// ident
-	4,		// bytes_ident 
+	4,		// bytes_ident
 	0,		// bytes_special
 	0,		// header_unk
 	4,		// _num_frames


Commit: 6029da21a48c019efee9dfb79a2ca552bfe4ce6e
    https://github.com/scummvm/scummvm/commit/6029da21a48c019efee9dfb79a2ca552bfe4ce6e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-10T13:53:34+02:00

Commit Message:
ULTIMA: ULTIMA8: Fix wrong API usage

skip() accepts only uints, so behaviour was not as developer expected

Changed paths:
    engines/ultima/ultima8/convert/convert_shape.cpp


diff --git a/engines/ultima/ultima8/convert/convert_shape.cpp b/engines/ultima/ultima8/convert/convert_shape.cpp
index 68ceb7cf05..2332ad8f02 100644
--- a/engines/ultima/ultima8/convert/convert_shape.cpp
+++ b/engines/ultima/ultima8/convert/convert_shape.cpp
@@ -249,7 +249,7 @@ void ConvertShapeFrame::ReadCmpFrame(IDataSource *source, const ConvertShapeForm
 			xpos += skip;
 
 			if (xpos > _width) {
-				source->skip(-1);
+				source->seek(-1, SEEK_CUR);
 				skip = _width-(xpos-skip);
 			}
 
@@ -262,8 +262,8 @@ void ConvertShapeFrame::ReadCmpFrame(IDataSource *source, const ConvertShapeForm
 
 			// Is this required???? It seems hacky and pointless
 			if (dlen == 0 || dlen == 1) {
-				source->skip(-1);
-				rlebuf->skip(-1);
+				source->seek(-1, SEEK_CUR);
+				rlebuf->seek(-1, SEEK_CUR);
 				rlebuf->writeByte(skip+(_width-xpos));
 				break;
 			}


Commit: 771a0a01cec47973c6b3e4bff2b574d8eb65c0e9
    https://github.com/scummvm/scummvm/commit/771a0a01cec47973c6b3e4bff2b574d8eb65c0e9
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-10T14:00:05+02:00

Commit Message:
ULTIMA: Added override keywords

Changed paths:
    engines/ultima/shared/core/file.h
    engines/ultima/ultima4/controllers/intro_controller.h
    engines/ultima/ultima8/audio/remorse_music_process.h
    engines/ultima/ultima8/audio/u8_music_process.h


diff --git a/engines/ultima/shared/core/file.h b/engines/ultima/shared/core/file.h
index 75cb6e6fa6..bf3b471017 100644
--- a/engines/ultima/shared/core/file.h
+++ b/engines/ultima/shared/core/file.h
@@ -68,7 +68,7 @@ public:
 	/**
 	 * Close the currently open file
 	 */
-	void close();
+	void close() override;
 
 	/**
 	 * Differing eof that returns true when pos == size as well as beyond
diff --git a/engines/ultima/ultima4/controllers/intro_controller.h b/engines/ultima/ultima4/controllers/intro_controller.h
index 968e85b11e..193f08f33f 100644
--- a/engines/ultima/ultima4/controllers/intro_controller.h
+++ b/engines/ultima/ultima4/controllers/intro_controller.h
@@ -98,7 +98,7 @@ public:
 	/**
 	 * Handles keystrokes during the introduction.
 	 */
-	bool keyPressed(int key);
+	bool keyPressed(int key) override;
 
 	/**
 	 * Mouse button was pressed
@@ -116,7 +116,7 @@ public:
 	 * Timer callback for the intro sequence.  Handles animating the intro
 	 * map, the beasties, etc..
 	 */
-	void timerFired();
+	void timerFired() override;
 
 	/**
 	 * Preload map tiles
@@ -128,7 +128,7 @@ public:
 	 * activated.
 	 * TODO: Reduce duped code.
 	 */
-	void update(Menu *menu, MenuEvent &event);
+	void update(Menu *menu, MenuEvent &event) override;
 	void updateConfMenu(MenuEvent &event);
 	void updateVideoMenu(MenuEvent &event);
 	void updateGfxMenu(MenuEvent &event);
diff --git a/engines/ultima/ultima8/audio/remorse_music_process.h b/engines/ultima/ultima8/audio/remorse_music_process.h
index 4a7662c5bd..eac7f3275a 100644
--- a/engines/ultima/ultima8/audio/remorse_music_process.h
+++ b/engines/ultima/ultima8/audio/remorse_music_process.h
@@ -44,7 +44,7 @@ protected:
 
 	//! Play a music track
 	//! \param track The track number to play. Pass 0 to stop music
-	void playMusic_internal(int track);
+	void playMusic_internal(int track) override;
 
 private:
 	int _currentTrack;      //! Currently playing track (don't save)
diff --git a/engines/ultima/ultima8/audio/u8_music_process.h b/engines/ultima/ultima8/audio/u8_music_process.h
index 94e437e708..75c209e45d 100644
--- a/engines/ultima/ultima8/audio/u8_music_process.h
+++ b/engines/ultima/ultima8/audio/u8_music_process.h
@@ -64,7 +64,7 @@ private:
 
 	//! Play a music track
 	//! \param track The track number to play. Pass 0 to stop music
-	void playMusic_internal(int track);
+	void playMusic_internal(int track) override;
 
 	MidiPlayer *_midiPlayer;
 	PlaybackStates _state;
@@ -94,20 +94,20 @@ public:
 	}
 
 	//! Play some background music. Does not change the current track if combat music is active.  If another track is currently queued, just queues this track for play.
-	void playMusic(int track);
+	void playMusic(int track) override;
 	//! Play some combat music - the last played track will be remembered
-	void playCombatMusic(int track);
+	void playCombatMusic(int track) override;
 	//! Queue a track to start once the current one finishes
-	void queueMusic(int track);
+	void queueMusic(int track) override;
 	//! Clear any queued track (does not affect currently playing track)
-	void unqueueMusic();
+	void unqueueMusic() override;
 	//! Restore the last requested non-combat track (eg, at the end of combat)
-	void restoreMusic();
+	void restoreMusic() override;
 
 	//! Save the current track state - used when the menu is opened
-	void saveTrackState();
+	void saveTrackState() override;
 	//! Bring back the track state from before it was put on hold
-	void restoreTrackState();
+	void restoreTrackState() override;
 
 	//! Get the state of tracks (wanted, requested, queued)
 	void getTrackState(TrackState &trackState) const;


Commit: 7759af515d2a1536fe73c4ace911d7a5ca95ad20
    https://github.com/scummvm/scummvm/commit/7759af515d2a1536fe73c4ace911d7a5ca95ad20
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-05-10T14:03:17+02:00

Commit Message:
GUI: Fixed warning

Changed paths:
    gui/options.cpp


diff --git a/gui/options.cpp b/gui/options.cpp
index 1b3e610e28..c7e970d3a5 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -1135,7 +1135,7 @@ void OptionsDialog::addAchievementsControls(GuiObject *boss, const Common::Strin
 		// run this twice, first view all achieved, then view all non-hidden & non-achieved
 
 		for (uint16 idx = 0; idx < nMax ; idx++) {
-			bool isAchieved = AchMan.isAchieved(info.descriptions[idx].id);
+			int16 isAchieved = AchMan.isAchieved(info.descriptions[idx].id) ? 1 : 0;
 
 			if (isAchieved != viewAchieved) {
 				continue;




More information about the Scummvm-git-logs mailing list