[Scummvm-git-logs] scummvm master -> f759c87ffd1372ed6cbe220458c9e268a26229f6
dreammaster
paulfgilbert at gmail.com
Sat May 16 18:11:06 UTC 2020
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
62847bc24b ULTIMA4: Location debugger command now allows specifying new position
f759c87ffd ULTIMA4: Fix image display during endgame quiz
Commit: 62847bc24b3367b493ae559fdff106d17bdedb01
https://github.com/scummvm/scummvm/commit/62847bc24b3367b493ae559fdff106d17bdedb01
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-05-16T11:09:48-07:00
Commit Message:
ULTIMA4: Location debugger command now allows specifying new position
Changed paths:
engines/ultima/ultima4/core/debugger.cpp
diff --git a/engines/ultima/ultima4/core/debugger.cpp b/engines/ultima/ultima4/core/debugger.cpp
index a43fdb53e5..abef436e29 100644
--- a/engines/ultima/ultima4/core/debugger.cpp
+++ b/engines/ultima/ultima4/core/debugger.cpp
@@ -1510,7 +1510,29 @@ bool Debugger::cmdLeave(int argc, const char **argv) {
bool Debugger::cmdLocation(int argc, const char **argv) {
const MapCoords &pos = g_context->_location->_coords;
- if (isDebuggerActive()) {
+ if (argc == 3) {
+ Coords newPos;
+
+ if (strlen(argv[1]) == 2 && strlen(argv[2]) == 2
+ && Common::isAlpha(argv[1][0]) && Common::isAlpha(argv[1][1])
+ && Common::isAlpha(argv[2][0]) && Common::isAlpha(argv[2][1])
+ ) {
+ newPos.y = (toupper(argv[1][0]) - 'A') * 16 + (toupper(argv[1][1]) - 'A');
+ newPos.x = (toupper(argv[2][0]) - 'A') * 16 + (toupper(argv[2][1]) - 'A');
+ } else {
+ newPos.x = strToInt(argv[1]);
+ newPos.y = strToInt(argv[2]);
+ }
+
+ if (newPos.x >= 0 && newPos.y >= 0
+ && newPos.x < (int)g_context->_location->_map->_width
+ && newPos.y < (int)g_context->_location->_map->_height) {
+ g_context->_location->_coords = newPos;
+ return false;
+ } else {
+ print("Invalid location!");
+ }
+ } else if (isDebuggerActive()) {
if (g_context->_location->_map->isWorldMap())
print("Location: %s x: %d, y: %d",
"World Map", pos.x, pos.y);
Commit: f759c87ffd1372ed6cbe220458c9e268a26229f6
https://github.com/scummvm/scummvm/commit/f759c87ffd1372ed6cbe220458c9e268a26229f6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-05-16T11:09:48-07:00
Commit Message:
ULTIMA4: Fix image display during endgame quiz
Changed paths:
engines/ultima/ultima4/gfx/imagemgr.cpp
engines/ultima/ultima4/gfx/imagemgr.h
diff --git a/engines/ultima/ultima4/gfx/imagemgr.cpp b/engines/ultima/ultima4/gfx/imagemgr.cpp
index df4d2accaf..24c2396063 100644
--- a/engines/ultima/ultima4/gfx/imagemgr.cpp
+++ b/engines/ultima/ultima4/gfx/imagemgr.cpp
@@ -64,7 +64,7 @@ void ImageMgr::destroy() {
}
}
-ImageMgr::ImageMgr() : _baseSet(nullptr) {
+ImageMgr::ImageMgr() : _baseSet(nullptr), _abyssData(nullptr) {
settings.addObserver(this);
}
@@ -73,6 +73,8 @@ ImageMgr::~ImageMgr() {
for (Std::map<Common::String, ImageSet *>::iterator i = _imageSets.begin(); i != _imageSets.end(); i++)
delete i->_value;
+
+ delete[] _abyssData;
}
void ImageMgr::init() {
@@ -393,30 +395,32 @@ void ImageMgr::fixupIntro(Image *im, int prescale) {
}
void ImageMgr::fixupAbyssVision(Image *im, int prescale) {
- static uint *data = nullptr;
+ // Ignore fixups for xu4 PNG images - they're already correct
+ if (im->isIndexed())
+ return;
/*
* Each VGA vision components must be XORed with all the previous
* vision components to get the actual image.
*/
- if (data != nullptr) {
+ if (_abyssData) {
for (int y = 0; y < im->height(); y++) {
for (int x = 0; x < im->width(); x++) {
uint index;
im->getPixelIndex(x, y, index);
- index ^= data[y * im->width() + x];
+ index ^= _abyssData[y * im->width() + x];
im->putPixelIndex(x, y, index);
}
}
} else {
- data = new uint[im->width() * im->height()];
+ _abyssData = new uint[im->width() * im->height()];
}
for (int y = 0; y < im->height(); y++) {
for (int x = 0; x < im->width(); x++) {
uint index;
im->getPixelIndex(x, y, index);
- data[y * im->width() + x] = index;
+ _abyssData[y * im->width() + x] = index;
}
}
}
diff --git a/engines/ultima/ultima4/gfx/imagemgr.h b/engines/ultima/ultima4/gfx/imagemgr.h
index b53a386aa0..d7b489ef8e 100644
--- a/engines/ultima/ultima4/gfx/imagemgr.h
+++ b/engines/ultima/ultima4/gfx/imagemgr.h
@@ -192,6 +192,7 @@ private:
Std::vector<Common::String> _imageSetNames;
ImageSet *_baseSet;
ImageInfo _screenInfo;
+ uint *_abyssData;
};
#define imageMgr (ImageMgr::getInstance())
More information about the Scummvm-git-logs
mailing list