[Scummvm-git-logs] scummvm master -> 66d1c3fecc31885424f480ade6e89728548a3394

sev- sev at scummvm.org
Thu Mar 25 14:57:44 UTC 2021


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

Summary:
b8da2eed66 BURIED: Pass big parameters only by reference
99b947979d BURIED: Initialize class variables
f07685729c BURIED: Replace magic numbers with enum
b2a83dea8e BURIED: Fixed mixing signed/unsigned values
e087fe09cc BURIED: Plug memory leak
fe493acf55 BURIED: Plug another memory leak
b90a049ba0 BURIED: Clean up new scene on death to prevent memory leaks
0c35658304 BURIED: Added 1.00 version to the detection tables
4587da68a4 BURIED: Plugged another memory leak
2b9ec32e6e BURIED: Another leak on death plugged
66d1c3fecc BURIED: Plugged another memory leak


Commit: b8da2eed66aeeeeee99e765ce08f0fb0a53460fa
    https://github.com/scummvm/scummvm/commit/b8da2eed66aeeeeee99e765ce08f0fb0a53460fa
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-03-25T15:57:19+01:00

Commit Message:
BURIED: Pass big parameters only by reference

Changed paths:
    engines/buried/complete.cpp
    engines/buried/complete.h
    engines/buried/death.cpp
    engines/buried/death.h
    engines/buried/frame_window.cpp
    engines/buried/frame_window.h


diff --git a/engines/buried/complete.cpp b/engines/buried/complete.cpp
index 7f30647f66..07f46d0cd7 100644
--- a/engines/buried/complete.cpp
+++ b/engines/buried/complete.cpp
@@ -53,7 +53,7 @@ namespace Buried {
 	if (_globalFlags.evcapBaseID[i] == flag) \
 		supportingEvidence++
 
-CompletionWindow::CompletionWindow(BuriedEngine *vm, Window *parent, GlobalFlags globalFlags) : Window(vm, parent), _globalFlags(globalFlags) {
+CompletionWindow::CompletionWindow(BuriedEngine *vm, Window *parent, GlobalFlags &globalFlags) : Window(vm, parent), _globalFlags(globalFlags) {
 	_vm->_sound->setAmbientSound();
 
 	_status = 0;
@@ -182,7 +182,7 @@ CompletionWindow::CompletionWindow(BuriedEngine *vm, Window *parent, GlobalFlags
 CompletionWindow::~CompletionWindow() {
 	delete _gageVideo;
 	killTimer(_timer);
-	
+
 	delete _textFontA;
 	delete _textFontB;
 
diff --git a/engines/buried/complete.h b/engines/buried/complete.h
index 2c1e8f9bb9..99b8bbc454 100644
--- a/engines/buried/complete.h
+++ b/engines/buried/complete.h
@@ -40,7 +40,7 @@ class VideoWindow;
 
 class CompletionWindow : public Window {
 public:
-	CompletionWindow(BuriedEngine *vm, Window *parent, GlobalFlags globalFlags);
+	CompletionWindow(BuriedEngine *vm, Window *parent, GlobalFlags &globalFlags);
 	~CompletionWindow();
 
 	void onPaint();
diff --git a/engines/buried/death.cpp b/engines/buried/death.cpp
index 3bfa549d48..b36b3f5ad2 100644
--- a/engines/buried/death.cpp
+++ b/engines/buried/death.cpp
@@ -62,7 +62,7 @@ enum {
 	if (_globalFlags.evcapBaseID[i] == flag) \
 		supportingEvidence++
 
-DeathWindow::DeathWindow(BuriedEngine *vm, Window *parent, int deathSceneIndex, GlobalFlags globalFlags, Common::Array<int> itemArray)
+DeathWindow::DeathWindow(BuriedEngine *vm, Window *parent, int deathSceneIndex, GlobalFlags &globalFlags, Common::Array<int> itemArray)
 		: Window(vm, parent), _deathSceneIndex(deathSceneIndex), _globalFlags(globalFlags), _itemArray(itemArray) {
 	_curButton = 0;
 	_deathFrameIndex = -1;
diff --git a/engines/buried/death.h b/engines/buried/death.h
index 86c75c0b55..a39f605696 100644
--- a/engines/buried/death.h
+++ b/engines/buried/death.h
@@ -40,7 +40,7 @@ class AVIFrames;
 
 class DeathWindow : public Window {
 public:
-	DeathWindow(BuriedEngine *vm, Window *parent, int deathSceneIndex, GlobalFlags globalFlags, Common::Array<int> itemArray);
+	DeathWindow(BuriedEngine *vm, Window *parent, int deathSceneIndex, GlobalFlags &globalFlags, Common::Array<int> itemArray);
 	~DeathWindow();
 
 	void onPaint();
diff --git a/engines/buried/frame_window.cpp b/engines/buried/frame_window.cpp
index 9466924fd7..43f0e4c4ec 100644
--- a/engines/buried/frame_window.cpp
+++ b/engines/buried/frame_window.cpp
@@ -263,7 +263,7 @@ bool FrameWindow::startNewGame(bool walkthrough, bool introMovie) {
 	return true;
 }
 
-bool FrameWindow::showDeathScene(int deathSceneIndex, GlobalFlags globalFlags, Common::Array<int> itemArray) {
+bool FrameWindow::showDeathScene(int deathSceneIndex, GlobalFlags &globalFlags, Common::Array<int> itemArray) {
 	_gameInProgress = false;
 	_atMainMenu = false;
 
@@ -277,7 +277,7 @@ bool FrameWindow::showDeathScene(int deathSceneIndex, GlobalFlags globalFlags, C
 	return true;
 }
 
-bool FrameWindow::showCompletionScene(GlobalFlags globalFlags) {
+bool FrameWindow::showCompletionScene(GlobalFlags &globalFlags) {
 	_gameInProgress = false;
 	_atMainMenu = false;
 
@@ -348,7 +348,7 @@ void FrameWindow::onKeyDown(const Common::KeyState &key, uint flags) {
 
 	if (key.keycode == Common::KEYCODE_ESCAPE) {
 		if (_gameInProgress || !_atMainMenu) {
-			// Ask if the player wants to return 
+			// Ask if the player wants to return
 			if (_vm->runQuitDialog())
 				showMainMenu();
 		} else {
@@ -383,7 +383,7 @@ void FrameWindow::setTransitionSpeed(int newSpeed) {
 	ConfMan.setInt(_vm->isDemo() ? "TransitionSpeed" : _vm->getString(IDS_INI_KEY_TRANS_SPEED), newSpeed);
 }
 
-void FrameWindow::loadFromState(const Location &location, GlobalFlags flags, Common::Array<int> inventoryItems) {
+void FrameWindow::loadFromState(const Location &location, GlobalFlags &flags, Common::Array<int> inventoryItems) {
 	if (!_gameInProgress) {
 		// Make the game in progress
 		_atMainMenu = false;
diff --git a/engines/buried/frame_window.h b/engines/buried/frame_window.h
index 0d48d0a4f4..788e7c45e9 100644
--- a/engines/buried/frame_window.h
+++ b/engines/buried/frame_window.h
@@ -45,8 +45,8 @@ public:
 	bool showClosingScreen();
 	bool showFeaturesScreen();
 	bool startNewGame(bool walkthrough = false, bool introMovie = false);
-	bool showDeathScene(int deathSceneIndex, GlobalFlags globalFlags, Common::Array<int> itemArray);
-	bool showCompletionScene(GlobalFlags globalFlags);
+	bool showDeathScene(int deathSceneIndex, GlobalFlags &globalFlags, Common::Array<int> itemArray);
+	bool showCompletionScene(GlobalFlags &globalFlags);
 	bool showCredits();
 	bool showOverview();
 	bool notifyUserOfFrameCycling();
@@ -69,7 +69,7 @@ public:
 
 	bool isGameInProgress() const { return _gameInProgress; }
 	Window *getMainChildWindow() const { return _mainChildWindow; }
-	void loadFromState(const Location &location, GlobalFlags flags, Common::Array<int> inventoryItems);
+	void loadFromState(const Location &location, GlobalFlags &flags, Common::Array<int> inventoryItems);
 
 private:
 	Window *_mainChildWindow;


Commit: 99b947979d33d0040f04a476488ae702996be986
    https://github.com/scummvm/scummvm/commit/99b947979d33d0040f04a476488ae702996be986
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-03-25T15:57:19+01:00

Commit Message:
BURIED: Initialize class variables

Changed paths:
    engines/buried/environ/ai_lab.cpp


diff --git a/engines/buried/environ/ai_lab.cpp b/engines/buried/environ/ai_lab.cpp
index dc27949316..d47a5bb1c3 100644
--- a/engines/buried/environ/ai_lab.cpp
+++ b/engines/buried/environ/ai_lab.cpp
@@ -66,6 +66,7 @@ BaseOxygenTimer::BaseOxygenTimer(BuriedEngine *vm, Window *viewWindow, const Loc
 		SceneBase(vm, viewWindow, sceneStaticData, priorLocation) {
 	_deathID = 41;
 	_jumped = false;
+	_entryStartTime = g_system->getMillis();
 }
 
 int BaseOxygenTimer::postEnterRoom(Window *viewWindow, const Location &priorLocation) {
@@ -1690,6 +1691,7 @@ protected:
 BaseOxygenTimerCapacitance::BaseOxygenTimerCapacitance(BuriedEngine *vm, Window *viewWindow, const LocationStaticData &sceneStaticData, const Location &priorLocation) :
 		SceneBase(vm, viewWindow, sceneStaticData, priorLocation) {
 	_jumped = false;
+	_entryStartTime = g_system->getMillis();
 }
 
 int BaseOxygenTimerCapacitance::postEnterRoom(Window *viewWindow, const Location &priorLocation) {


Commit: f07685729c36a22c36c1cc14c4315889514bef26
    https://github.com/scummvm/scummvm/commit/f07685729c36a22c36c1cc14c4315889514bef26
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-03-25T15:57:19+01:00

Commit Message:
BURIED: Replace magic numbers with enum

Changed paths:
    engines/buried/navarrow.cpp
    engines/buried/scene_view.cpp
    engines/buried/scene_view.h


diff --git a/engines/buried/navarrow.cpp b/engines/buried/navarrow.cpp
index 09f3e1a7c4..9cceb9ed3e 100644
--- a/engines/buried/navarrow.cpp
+++ b/engines/buried/navarrow.cpp
@@ -149,17 +149,17 @@ void NavArrowWindow::onLButtonDown(const Common::Point &point, uint flags) {
 		// If we only clicked on the forward arrow, then take care of it here
 		if (!rightButton.contains(point) && !downButton.contains(point)) {
 			if (_arrowStatus[4] == BUTTON_ENABLED)
-				((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(4);
+				((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(kDirectionForward);
 		} else {
 			if (rightButton.contains(point)) {
 				Graphics::Surface *centerArrow = _vm->_gfx->getBitmap(_arrowBitmaps[4][_arrowStatus[4]]);
 
 				if (_vm->_gfx->checkPointAgainstMaskedBitmap(centerArrow, 39, 49, point, 255, 255, 255)) {
 					if (_arrowStatus[4] == BUTTON_ENABLED)
-						retVal = ((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(4);
+						retVal = ((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(kDirectionForward);
 				} else {
 					if (_arrowStatus[2] == BUTTON_ENABLED)
-						retVal = ((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(2);
+						retVal = ((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(kDirectionRight);
 				}
 
 				centerArrow->free();
@@ -171,10 +171,10 @@ void NavArrowWindow::onLButtonDown(const Common::Point &point, uint flags) {
 
 				if (_vm->_gfx->checkPointAgainstMaskedBitmap(centerArrow, 39, 49, point, 255, 255, 255)) {
 					if (_arrowStatus[4] == BUTTON_ENABLED)
-						retVal = ((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(4);
+						retVal = ((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(kDirectionForward);
 				} else {
 					if (_arrowStatus[3] == BUTTON_ENABLED)
-						retVal = ((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(3);
+						retVal = ((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(kDirectionDown);
 				}
 
 				centerArrow->free();
@@ -183,16 +183,16 @@ void NavArrowWindow::onLButtonDown(const Common::Point &point, uint flags) {
 		}
 	} else {
 		if (upButton.contains(point) && _arrowStatus[0] == BUTTON_ENABLED)
-			retVal = ((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(0);
+			retVal = ((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(kDirectionUp);
 
 		if (leftButton.contains(point) && _arrowStatus[1] == BUTTON_ENABLED)
-			retVal = ((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(1);
+			retVal = ((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(kDirectionLeft);
 
 		if (rightButton.contains(point) && _arrowStatus[2] == BUTTON_ENABLED)
-			retVal = ((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(2);
+			retVal = ((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(kDirectionRight);
 
 		if (downButton.contains(point) && _arrowStatus[3] == BUTTON_ENABLED)
-			retVal = ((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(3);
+			retVal = ((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(kDirectionDown);
 	}
 
 	if (retVal) {
@@ -206,26 +206,26 @@ void NavArrowWindow::onKeyUp(const Common::KeyState &key, uint flags) {
 	case Common::KEYCODE_KP4:
 	case Common::KEYCODE_LEFT:
 		if (_arrowStatus[1] == BUTTON_ENABLED)
-			((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(1);
+			((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(kDirectionLeft);
 		break;
 	case Common::KEYCODE_KP6:
 	case Common::KEYCODE_RIGHT:
 		if (_arrowStatus[2] == BUTTON_ENABLED)
-			((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(2);
+			((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(kDirectionRight);
 		break;
 	case Common::KEYCODE_KP2:
 	case Common::KEYCODE_DOWN:
 		if (_arrowStatus[3] == BUTTON_ENABLED)
-			((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(3);
+			((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(kDirectionDown);
 		break;
 	case Common::KEYCODE_KP8:
 	case Common::KEYCODE_UP:
 		if (_arrowStatus[0] == BUTTON_ENABLED)
-			((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(0);
+			((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(kDirectionUp);
 		break;
 	case Common::KEYCODE_KP5:
 		if (_arrowStatus[4] == BUTTON_ENABLED)
-			((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(4);
+			((GameUIWindow *)_parent)->_sceneViewWindow->moveInDirection(kDirectionForward);
 		break;
 	default:
 		break;
diff --git a/engines/buried/scene_view.cpp b/engines/buried/scene_view.cpp
index 016029764b..21ae8d29b5 100644
--- a/engines/buried/scene_view.cpp
+++ b/engines/buried/scene_view.cpp
@@ -486,7 +486,7 @@ bool SceneViewWindow::jumpToSceneRestore(const Location &newLocation) {
 	return true;
 }
 
-bool SceneViewWindow::moveInDirection(int direction) {
+bool SceneViewWindow::moveInDirection(Direction direction) {
 	if (!_currentScene)
 		return false;
 
@@ -495,19 +495,19 @@ bool SceneViewWindow::moveInDirection(int direction) {
 	DestinationScene destinationData;
 
 	switch (direction) {
-	case 0: // Up
+	case kDirectionUp: // Up
 		destinationData = _currentScene->_staticData.destUp;
 		break;
-	case 1: // Left
+	case kDirectionLeft: // Left
 		destinationData = _currentScene->_staticData.destLeft;
 		break;
-	case 2: // Right
+	case kDirectionRight: // Right
 		destinationData = _currentScene->_staticData.destRight;
 		break;
-	case 3: // Down
+	case kDirectionDown: // Down
 		destinationData = _currentScene->_staticData.destDown;
 		break;
-	case 4: // Forward
+	case kDirectionForward: // Forward
 		destinationData = _currentScene->_staticData.destForward;
 		break;
 	}
diff --git a/engines/buried/scene_view.h b/engines/buried/scene_view.h
index 7210ae548d..5e93d75262 100644
--- a/engines/buried/scene_view.h
+++ b/engines/buried/scene_view.h
@@ -44,6 +44,14 @@ class AVIFrames;
 class SceneBase;
 class VideoWindow;
 
+enum Direction {
+	kDirectionUp = 0,
+	kDirectionLeft = 1,
+	kDirectionRight = 2,
+	kDirectionDown = 3,
+	kDirectionForward = 4
+};
+
 class SceneViewWindow : public Window {
 public:
 	SceneViewWindow(BuriedEngine *vm, Window *parent);
@@ -64,7 +72,7 @@ public:
 
 	bool jumpToScene(const Location &newLocation);
 	bool jumpToSceneRestore(const Location &newLocation);
-	bool moveInDirection(int direction);
+	bool moveInDirection(Direction direction);
 	bool moveToDestination(const DestinationScene &destinationData);
 	bool timeSuitJump(int destination);
 
@@ -140,7 +148,7 @@ public:
 	void onMouseMove(const Common::Point &point, uint flags);
 
 	void onKeyUp(const Common::KeyState &key, uint flags);
-	
+
 	bool isScenePresent() { return _currentScene != 0; }
 	int draggingItem(int itemID, const Common::Point &pointLocation, int itemFlags);
 	int droppedItem(int itemID, const Common::Point &pointLocation, int itemFlags);


Commit: b2a83dea8e654e95bf3687a9c4f397f0a2d45c05
    https://github.com/scummvm/scummvm/commit/b2a83dea8e654e95bf3687a9c4f397f0a2d45c05
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-03-25T15:57:20+01:00

Commit Message:
BURIED: Fixed mixing signed/unsigned values

Changed paths:
    engines/buried/graphics.cpp
    engines/buried/graphics.h
    engines/buried/scene_view.cpp
    engines/buried/scene_view.h


diff --git a/engines/buried/graphics.cpp b/engines/buried/graphics.cpp
index 8fe21ee730..e6e42ff42d 100644
--- a/engines/buried/graphics.cpp
+++ b/engines/buried/graphics.cpp
@@ -377,7 +377,7 @@ void GraphicsManager::blit(const Graphics::Surface *surface, int x, int y) {
 		memcpy(_screen->getBasePtr(x, y + i), surface->getBasePtr(0, i), surface->w * surface->format.bytesPerPixel);
 }
 
-void GraphicsManager::blit(const Graphics::Surface *surface, int x, int y, int width, int height) {
+void GraphicsManager::blit(const Graphics::Surface *surface, int x, int y, uint width, uint height) {
 	assert(surface->format.bytesPerPixel == _screen->format.bytesPerPixel);
 
 	for (int i = 0; i < height; i++)
@@ -387,8 +387,8 @@ void GraphicsManager::blit(const Graphics::Surface *surface, int x, int y, int w
 void GraphicsManager::blit(const Graphics::Surface *surface, const Common::Rect &srcRect, const Common::Rect &dstRect) {
 	assert(surface->format.bytesPerPixel == _screen->format.bytesPerPixel);
 
-	int width = MIN(srcRect.width(), dstRect.width());
-	int height = MIN(srcRect.height(), dstRect.height());
+	uint width = MIN(srcRect.width(), dstRect.width());
+	uint height = MIN(srcRect.height(), dstRect.height());
 
 	for (int i = 0; i < height; i++)
 		memcpy(_screen->getBasePtr(dstRect.left, dstRect.top + i), surface->getBasePtr(srcRect.left, srcRect.top + i), width * surface->format.bytesPerPixel);
@@ -635,7 +635,7 @@ int GraphicsManager::computeVPushOffset(int speed) {
 	return 189;
 }
 
-void GraphicsManager::crossBlit(Graphics::Surface *dst, int xDst, int yDst, int w, int h, const Graphics::Surface *src, int xSrc, int ySrc) {
+void GraphicsManager::crossBlit(Graphics::Surface *dst, int xDst, int yDst, uint w, uint h, const Graphics::Surface *src, int xSrc, int ySrc) {
 	assert(dst->format.bytesPerPixel == src->format.bytesPerPixel);
 
 	for (int y = 0; y < h; y++)
diff --git a/engines/buried/graphics.h b/engines/buried/graphics.h
index b00abb0ada..b1305a11ee 100644
--- a/engines/buried/graphics.h
+++ b/engines/buried/graphics.h
@@ -95,12 +95,12 @@ public:
 	bool needsErase() const { return _needsErase; }
 
 	void blit(const Graphics::Surface *surface, int x, int y);
-	void blit(const Graphics::Surface *surface, int x, int y, int width, int height);
+	void blit(const Graphics::Surface *surface, int x, int y, uint width, uint height);
 	void blit(const Graphics::Surface *surface, const Common::Rect &srcRect, const Common::Rect &dstRect);
 	void fillRect(const Common::Rect &rect, uint32 color);
 	void opaqueTransparentBlit(Graphics::Surface *dst, int xDst, int yDst, int w, int h, const Graphics::Surface *src, int xSrc, int ySrc, int opacityValue, byte r, byte g, byte b);
 	bool checkPointAgainstMaskedBitmap(const Graphics::Surface *bitmap, int x, int y, const Common::Point &point, byte rTrans, byte gTrans, byte bTrans);
-	void crossBlit(Graphics::Surface *dst, int xDst, int yDst, int w, int h, const Graphics::Surface *src, int xSrc, int ySrc);
+	void crossBlit(Graphics::Surface *dst, int xDst, int yDst, uint w, uint h, const Graphics::Surface *src, int xSrc, int ySrc);
 	void renderText(Graphics::Surface *dst, Graphics::Font *font, const Common::String &text, int x, int y, int w, int h, uint32 color, int lineHeight, TextAlign textAlign = kTextAlignLeft, bool centerVertically = false);
 	void drawEllipse(const Common::Rect &rect, uint32 color);
 
diff --git a/engines/buried/scene_view.cpp b/engines/buried/scene_view.cpp
index 21ae8d29b5..c99973c247 100644
--- a/engines/buried/scene_view.cpp
+++ b/engines/buried/scene_view.cpp
@@ -1146,7 +1146,7 @@ bool SceneViewWindow::walkTransition(const Location &location, const Destination
 	return true;
 }
 
-bool SceneViewWindow::pushTransition(Graphics::Surface *curBackground, Graphics::Surface *newBackground, int direction, int stripSize, int totalTime) {
+bool SceneViewWindow::pushTransition(Graphics::Surface *curBackground, Graphics::Surface *newBackground, int direction, uint stripSize, int totalTime) {
 	// Check the validity of the parameters
 	if (!curBackground || !newBackground || direction < 0 || direction > 4 || stripSize <= 0 || totalTime < 0)
 		return false;
@@ -1228,8 +1228,8 @@ bool SceneViewWindow::slideInTransition(Graphics::Surface *newBackground, int di
 
 	switch (direction) {
 	case 0: // Push down
-		for (int i = stripSize; i <= DIB_FRAME_HEIGHT; i += stripSize) {
-			for (int j = 0; j < i; j++)
+		for (uint i = stripSize; i <= DIB_FRAME_HEIGHT; i += stripSize) {
+			for (uint j = 0; j < i; j++)
 				memcpy(_preBuffer->getBasePtr(0, j), newBackground->getBasePtr(0, DIB_FRAME_HEIGHT - j), newBackground->w * newBackground->format.bytesPerPixel);
 
 			invalidateWindow(false);
@@ -1237,8 +1237,8 @@ bool SceneViewWindow::slideInTransition(Graphics::Surface *newBackground, int di
 		}
 		break;
 	case 1: // Push right
-		for (int i = stripSize; i <= DIB_FRAME_WIDTH; i += stripSize) {
-			for (int j = 0; j < DIB_FRAME_HEIGHT; j++)
+		for (uint i = stripSize; i <= DIB_FRAME_WIDTH; i += stripSize) {
+			for (uint j = 0; j < DIB_FRAME_HEIGHT; j++)
 				memcpy(_preBuffer->getBasePtr(0, j), newBackground->getBasePtr(DIB_FRAME_WIDTH - i, j), i * newBackground->format.bytesPerPixel);
 
 			invalidateWindow(false);
@@ -1246,8 +1246,8 @@ bool SceneViewWindow::slideInTransition(Graphics::Surface *newBackground, int di
 		}
 		break;
 	case 2: // Push left
-		for (int i = stripSize; i <= DIB_FRAME_WIDTH; i += stripSize) {
-			for (int j = 0; j < DIB_FRAME_HEIGHT; j++)
+		for (uint i = stripSize; i <= DIB_FRAME_WIDTH; i += stripSize) {
+			for (uint j = 0; j < DIB_FRAME_HEIGHT; j++)
 				memcpy(_preBuffer->getBasePtr(0, DIB_FRAME_WIDTH - i), newBackground->getBasePtr(0, j), i * newBackground->format.bytesPerPixel);
 
 			invalidateWindow(false);
@@ -1255,8 +1255,8 @@ bool SceneViewWindow::slideInTransition(Graphics::Surface *newBackground, int di
 		}
 		break;
 	case 3: // Push up
-		for (int i = stripSize; i <= DIB_FRAME_HEIGHT; i += stripSize) {
-			for (int j = 0; j < i; j++)
+		for (uint i = stripSize; i <= DIB_FRAME_HEIGHT; i += stripSize) {
+			for (uint j = 0; j < i; j++)
 				memcpy(_preBuffer->getBasePtr(0, DIB_FRAME_HEIGHT - j), newBackground->getBasePtr(0, j), newBackground->w * newBackground->format.bytesPerPixel);
 
 			invalidateWindow(false);
diff --git a/engines/buried/scene_view.h b/engines/buried/scene_view.h
index 5e93d75262..e530cac0d6 100644
--- a/engines/buried/scene_view.h
+++ b/engines/buried/scene_view.h
@@ -79,7 +79,7 @@ public:
 	bool playTransition(const DestinationScene &destinationData, int navFrame);
 	bool videoTransition(const Location &location, DestinationScene destinationData, int navFrame);
 	bool walkTransition(const Location &location, const DestinationScene &destinationData, int navFrame);
-	bool pushTransition(Graphics::Surface *curBackground, Graphics::Surface *newBackground, int direction, int stripSize, int totalTime);
+	bool pushTransition(Graphics::Surface *curBackground, Graphics::Surface *newBackground, int direction, uint stripSize, int totalTime);
 	bool pushNewTransition(Graphics::Surface *newBackground, int direction, int stripSize, int totalTime);
 	bool slideInTransition(Graphics::Surface *newBackground, int direction, int stripSize, int totalTime);
 	bool slideOutTransition(Graphics::Surface *newBackground, int direction, int stripSize, int totalTime);


Commit: e087fe09cccb02e0eae55afce5c68dcf976722de
    https://github.com/scummvm/scummvm/commit/e087fe09cccb02e0eae55afce5c68dcf976722de
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-03-25T15:57:20+01:00

Commit Message:
BURIED: Plug memory leak

Changed paths:
    engines/buried/environ/scene_common.cpp


diff --git a/engines/buried/environ/scene_common.cpp b/engines/buried/environ/scene_common.cpp
index 8ebc31c83f..cccf204c65 100644
--- a/engines/buried/environ/scene_common.cpp
+++ b/engines/buried/environ/scene_common.cpp
@@ -1130,6 +1130,8 @@ int BrowseBook::mouseUp(Window *viewWindow, const Common::Point &pointLocation)
 		// Perform the transition
 		Graphics::Surface *newBackground = ((SceneViewWindow *)viewWindow)->getStillFrameCopy(_staticData.navFrameIndex);
 		((SceneViewWindow *)viewWindow)->pushNewTransition(newBackground, 0, _vm->_gfx->computeVPushOffset(_vm->getTransitionSpeed()), 0);
+		newBackground->free();
+		delete newBackground;
 		_curLineIndex = -1;
 		viewWindow->invalidateWindow(false);
 		pageChanged(viewWindow);
@@ -1142,6 +1144,8 @@ int BrowseBook::mouseUp(Window *viewWindow, const Common::Point &pointLocation)
 		// Perform the transition
 		Graphics::Surface *newBackground = ((SceneViewWindow *)viewWindow)->getStillFrameCopy(_staticData.navFrameIndex);
 		((SceneViewWindow *)viewWindow)->pushNewTransition(newBackground, 3, _vm->_gfx->computeVPushOffset(_vm->getTransitionSpeed()), 0);
+		newBackground->free();
+		delete newBackground;
 		_curLineIndex = -1;
 		viewWindow->invalidateWindow(false);
 		pageChanged(viewWindow);
@@ -1154,6 +1158,8 @@ int BrowseBook::mouseUp(Window *viewWindow, const Common::Point &pointLocation)
 		// Perform the transition
 		Graphics::Surface *newBackground = ((SceneViewWindow *)viewWindow)->getStillFrameCopy(_staticData.navFrameIndex);
 		((SceneViewWindow *)viewWindow)->pushNewTransition(newBackground, 1, _vm->_gfx->computeHPushOffset(_vm->getTransitionSpeed()), 0);
+		newBackground->free();
+		delete newBackground;
 		_curLineIndex = -1;
 		viewWindow->invalidateWindow(false);
 		pageChanged(viewWindow);
@@ -1166,6 +1172,8 @@ int BrowseBook::mouseUp(Window *viewWindow, const Common::Point &pointLocation)
 		// Perform the transition
 		Graphics::Surface *newBackground = ((SceneViewWindow *)viewWindow)->getStillFrameCopy(_staticData.navFrameIndex);
 		((SceneViewWindow *)viewWindow)->pushNewTransition(newBackground, 1, _vm->_gfx->computeHPushOffset(_vm->getTransitionSpeed()), 0);
+		newBackground->free();
+		delete newBackground;
 		_curLineIndex = -1;
 		viewWindow->invalidateWindow(false);
 		pageChanged(viewWindow);


Commit: fe493acf552582a5380b80a6d39ccb4f49f5a356
    https://github.com/scummvm/scummvm/commit/fe493acf552582a5380b80a6d39ccb4f49f5a356
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-03-25T15:57:20+01:00

Commit Message:
BURIED: Plug another memory leak

Changed paths:
    engines/buried/scene_view.cpp


diff --git a/engines/buried/scene_view.cpp b/engines/buried/scene_view.cpp
index c99973c247..4f384d118b 100644
--- a/engines/buried/scene_view.cpp
+++ b/engines/buried/scene_view.cpp
@@ -1131,8 +1131,12 @@ bool SceneViewWindow::walkTransition(const Location &location, const Destination
 		_vm->_sound->timerCallback();
 	}
 
-	if (_vm->shouldQuit())
+	if (_vm->shouldQuit()) {
+		newBackground->free();
+		delete newBackground;
+
 		return true;
+	}
 
 	_vm->_sound->stopFootsteps();
 


Commit: b90a049ba0a87a5a8f32d8796884282c8a94462d
    https://github.com/scummvm/scummvm/commit/b90a049ba0a87a5a8f32d8796884282c8a94462d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-03-25T15:57:20+01:00

Commit Message:
BURIED: Clean up new scene on death to prevent memory leaks

This plugs memory leak in this case

Changed paths:
    engines/buried/scene_view.cpp


diff --git a/engines/buried/scene_view.cpp b/engines/buried/scene_view.cpp
index 4f384d118b..6322343ead 100644
--- a/engines/buried/scene_view.cpp
+++ b/engines/buried/scene_view.cpp
@@ -361,8 +361,12 @@ bool SceneViewWindow::jumpToScene(const Location &newLocation) {
 
 	SceneBase *newScene = constructSceneObject(this, newSceneStaticData, passedLocation);
 
-	if (_currentScene && _currentScene->postExitRoom(this, passedLocation) == SC_DEATH)
+	if (_currentScene && _currentScene->postExitRoom(this, passedLocation) == SC_DEATH) {
+		newScene->preDestructor();
+		delete newScene;
+
 		return false;
+	}
 
 	if (!newScene)
 		error("Failed to create scene");
@@ -608,8 +612,11 @@ bool SceneViewWindow::moveToDestination(const DestinationScene &destinationData)
 	// Call the post-exit function
 	retVal = _currentScene->postExitRoom(this, destinationData.destinationScene);
 
-	if (retVal == SC_DEATH)
+	if (retVal == SC_DEATH) {
+		newScene->preDestructor();
+		delete newScene;
 		return false;
+	}
 
 	if (retVal != SC_TRUE) {
 		newScene->preDestructor();
@@ -814,8 +821,12 @@ bool SceneViewWindow::timeSuitJump(int destination) {
 
 	if (_currentScene) {
 		// Post-transition function
-		if (_currentScene->postExitRoom(this, specOldLocation) == SC_DEATH)
+		if (_currentScene->postExitRoom(this, specOldLocation) == SC_DEATH) {
+			newScene->preDestructor();
+			delete newScene;
+
 			return false;
+		}
 
 		// Delete the old scene
 		_currentScene->preDestructor();


Commit: 0c35658304782225eafd6a7c9d9e6fda4e69055b
    https://github.com/scummvm/scummvm/commit/0c35658304782225eafd6a7c9d9e6fda4e69055b
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-03-25T15:57:20+01:00

Commit Message:
BURIED: Added 1.00 version to the detection tables

Changed paths:
    engines/buried/detection_tables.h


diff --git a/engines/buried/detection_tables.h b/engines/buried/detection_tables.h
index 496ec13b65..efff510d2e 100644
--- a/engines/buried/detection_tables.h
+++ b/engines/buried/detection_tables.h
@@ -23,6 +23,34 @@
 namespace Buried {
 
 static const ADGameDescription gameDescriptions[] = {
+	// English Windows 3.11 8BPP
+	// Installed
+	// v1.00
+	{
+		"buried",
+		"v1.00 8BPP",
+		AD_ENTRY2s("BIT816.EXE", "da3c191bd4384950c17a19b9ea06cd7c", 1166336,
+				   "BIT8LIB.DLL","31bcd9e5cc32df00b09ce626e6d9106e", 2420480),
+		Common::EN_ANY,
+		Common::kPlatformWindows,
+		ADGF_NO_FLAGS,
+		GUIO0()
+	},
+
+	// English Windows 3.11 24BPP
+	// Installed
+	// v1.01
+	{
+		"buried",
+		"v1.00 24BPP",
+		AD_ENTRY2s("BIT2416.EXE", "e661f758d191150cbdf6781bb2565acb", 1162752,
+				   "BIT24LIB.DLL","74ac9dae92f415fea8cdbd220ba8795c", 5211648),
+		Common::EN_ANY,
+		Common::kPlatformWindows,
+		GF_TRUECOLOR,
+		GUIO0()
+	},
+
 	// English Windows 3.11 8BPP
 	// Installed
 	// v1.01
@@ -79,6 +107,34 @@ static const ADGameDescription gameDescriptions[] = {
 		GUIO0()
 	},
 
+	// English Windows 3.11 8BPP
+	// Not Installed
+	// v1.00
+	{
+		"buried",
+		"v1.01 8BPP",
+		AD_ENTRY2s("BIT816.EX_", "e385901182f4eafe0a8a157e4f24fc1f", 366069,
+				   "BIT8LIB.DL_","8a345993f60f6bed7c17fa9e7f2bc37d", 908854),
+		Common::EN_ANY,
+		Common::kPlatformWindows,
+		GF_COMPRESSED,
+		GUIO0()
+	},
+
+	// English Windows 3.11 24BPP
+	// Not Installed
+	// v1.00
+	{
+		"buried",
+		"v1.01 24BPP",
+		AD_ENTRY2s("BIT2416.EX_", "144ad890ad0ded4262438c3ef37b88f4", 363601,
+				   "BIT24LIB.DL_","00e6eedbcef824988fbb01a87ca8f7fd", 2269314),
+		Common::EN_ANY,
+		Common::kPlatformWindows,
+		GF_COMPRESSED | GF_TRUECOLOR,
+		GUIO0()
+	},
+
 	// English Windows 3.11 8BPP
 	// Not Installed
 	// v1.01


Commit: 4587da68a4ba141d427b34e3bdd9b60efdbb40f0
    https://github.com/scummvm/scummvm/commit/4587da68a4ba141d427b34e3bdd9b60efdbb40f0
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-03-25T15:57:20+01:00

Commit Message:
BURIED: Plugged another memory leak

Changed paths:
    engines/buried/scene_view.cpp


diff --git a/engines/buried/scene_view.cpp b/engines/buried/scene_view.cpp
index 6322343ead..a6b84d3fd7 100644
--- a/engines/buried/scene_view.cpp
+++ b/engines/buried/scene_view.cpp
@@ -1079,8 +1079,12 @@ bool SceneViewWindow::videoTransition(const Location &location, DestinationScene
 		_vm->_sound->timerCallback();
 	}
 
-	if (_vm->shouldQuit())
+	if (_vm->shouldQuit()) {
+		newBackground->free();
+		delete newBackground;
+
 		return true;
+	}
 
 	animationMovie.reset();
 


Commit: 2b9ec32e6e0998b01350368fe5093d6f308eb561
    https://github.com/scummvm/scummvm/commit/2b9ec32e6e0998b01350368fe5093d6f308eb561
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-03-25T15:57:20+01:00

Commit Message:
BURIED: Another leak on death plugged

Changed paths:
    engines/buried/scene_view.cpp


diff --git a/engines/buried/scene_view.cpp b/engines/buried/scene_view.cpp
index a6b84d3fd7..87578a18e2 100644
--- a/engines/buried/scene_view.cpp
+++ b/engines/buried/scene_view.cpp
@@ -448,8 +448,12 @@ bool SceneViewWindow::jumpToSceneRestore(const Location &newLocation) {
 	SceneBase *newScene = constructSceneObject(this, newSceneStaticData, passedLocation);
 
 	// Call the post-transition function
-	if (_currentScene && _currentScene->postExitRoom(this, passedLocation) == SC_DEATH)
+	if (_currentScene && _currentScene->postExitRoom(this, passedLocation) == SC_DEATH) {
+		newScene->preDestructor();
+		delete newScene;
+
 		return false;
+	}
 
 	if (_currentScene) {
 		_currentScene->preDestructor();


Commit: 66d1c3fecc31885424f480ade6e89728548a3394
    https://github.com/scummvm/scummvm/commit/66d1c3fecc31885424f480ade6e89728548a3394
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-03-25T15:57:20+01:00

Commit Message:
BURIED: Plugged another memory leak

Changed paths:
    engines/buried/inventory_window.cpp


diff --git a/engines/buried/inventory_window.cpp b/engines/buried/inventory_window.cpp
index 289a9a5721..1b131e656b 100644
--- a/engines/buried/inventory_window.cpp
+++ b/engines/buried/inventory_window.cpp
@@ -96,7 +96,7 @@ InventoryWindow::InventoryWindow(BuriedEngine *vm, Window *parent) : Window(vm,
 	} else {
 		// The full version uses bitmaps
 		_dragFrames = NULL;
-	}	
+	}
 }
 
 InventoryWindow::~InventoryWindow() {
@@ -114,7 +114,7 @@ InventoryWindow::~InventoryWindow() {
 	}
 
 	if (_scrollTimer != 0)
-		killTimer(_scrollTimer);	
+		killTimer(_scrollTimer);
 
 	delete _textFont;
 	delete _dragFrames;
@@ -145,6 +145,8 @@ bool InventoryWindow::rebuildPreBuffer() {
 		// Draw the icon for the current item
 		Graphics::Surface *icon = _vm->_gfx->getBitmap(IDB_PICON_BITMAP_BASE + _itemArray[_curItem]);
 		_vm->_gfx->crossBlit(_background, 17, 8, icon->w, icon->h, icon, 0, 0);
+		icon->free();
+		delete icon;
 	}
 
 	return true;
@@ -386,7 +388,7 @@ void InventoryWindow::onLButtonDown(const Common::Point &point, uint flags) {
 					((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags().lensFilterActivated = 1;
 					return;
 				}
-	
+
 				if (((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags().lensFilterActivated == 0) {
 					((GameUIWindow *)_parent)->_sceneViewWindow->getGlobalFlags().lensFilterActivated = 1;
 					((GameUIWindow *)_parent)->_sceneViewWindow->displayLiveText(_vm->getString(IDS_LENS_FILTER_ATTACHED));
@@ -394,7 +396,7 @@ void InventoryWindow::onLButtonDown(const Common::Point &point, uint flags) {
 					// Deny removing the filter in the alien space ship
 					Location currentLocation;
 					((GameUIWindow *)_parent)->_sceneViewWindow->getCurrentSceneLocation(currentLocation);
-			
+
 					if (currentLocation.timeZone == 7) {
 						((GameUIWindow *)_parent)->_sceneViewWindow->displayLiveText(_vm->getString(IDS_LENS_FILTER_DENY_REMOVAL));
 					} else {




More information about the Scummvm-git-logs mailing list