[Scummvm-git-logs] scummvm master -> 3ca064ca77467c158346decc54f9b4a614145957

OMGPizzaGuy noreply at scummvm.org
Thu Mar 28 03:12:26 UTC 2024


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

Summary:
3ca064ca77 ULTIMA8: Crop black sections of minimap.


Commit: 3ca064ca77467c158346decc54f9b4a614145957
    https://github.com/scummvm/scummvm/commit/3ca064ca77467c158346decc54f9b4a614145957
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2024-03-27T22:12:00-05:00

Commit Message:
ULTIMA8: Crop black sections of minimap.
Generating the full map can bloat the save file. This change should reduce the size to only relevant data

Changed paths:
    engines/ultima/ultima8/world/minimap.cpp


diff --git a/engines/ultima/ultima8/world/minimap.cpp b/engines/ultima/ultima8/world/minimap.cpp
index ce6f28cb633..c4c651bbc29 100644
--- a/engines/ultima/ultima8/world/minimap.cpp
+++ b/engines/ultima/ultima8/world/minimap.cpp
@@ -183,7 +183,7 @@ const Common::Rect MiniMap::getCropBounds() const {
 	for (int x = bounds.left; x < bounds.right; x++) {
 		for (int y = bounds.top; y < bounds.bottom; y++) {
 			uint32 val = _surface.getPixel(x, y);
-			if (val != KEY_COLOR) {
+			if (val != KEY_COLOR && val != BLACK_COLOR) {
 				bounds.left = x;
 
 				// end loops
@@ -197,7 +197,7 @@ const Common::Rect MiniMap::getCropBounds() const {
 	for (int y = bounds.top; y < bounds.bottom; y++) {
 		for (int x = bounds.left; x < bounds.right; x++) {
 			uint32 val = _surface.getPixel(x, y);
-			if (val != KEY_COLOR) {
+			if (val != KEY_COLOR && val != BLACK_COLOR) {
 				bounds.top = y;
 
 				// end loops
@@ -211,7 +211,7 @@ const Common::Rect MiniMap::getCropBounds() const {
 	for (int x = bounds.right - 1; x > bounds.left; x--) {
 		for (int y = bounds.bottom - 1; y > bounds.top; y--) {
 			uint32 val = _surface.getPixel(x, y);
-			if (val != KEY_COLOR) {
+			if (val != KEY_COLOR && val != BLACK_COLOR) {
 				bounds.right = x + 1;
 
 				// end loops
@@ -225,7 +225,7 @@ const Common::Rect MiniMap::getCropBounds() const {
 	for (int y = bounds.bottom - 1; y > bounds.top; y--) {
 		for (int x = bounds.right - 1; x > bounds.left; x--) {
 			uint32 val = _surface.getPixel(x, y);
-			if (val != KEY_COLOR) {
+			if (val != KEY_COLOR && val != BLACK_COLOR) {
 				bounds.bottom = y + 1;
 
 				// end loops




More information about the Scummvm-git-logs mailing list