[Scummvm-git-logs] scummvm branch-3-0 -> 42a2216737e7a83651b1a0251ed48e49ea98c028
moralrecordings
noreply at scummvm.org
Fri Jan 16 16:45:26 UTC 2026
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
099cbcf7b8 DIRECTOR: Fix buggy behaviour of d_strstr
014929a9a3 DIRECTOR: Fix Ghost/NotGhost/Reverse/NotReverse ink types in 32bpp mode
42a2216737 DIRECTOR: Make 32-bit BITDDecoder images output an RGBA surface
Commit: 099cbcf7b8393bfe5410653ba9f37f714c0e58e4
https://github.com/scummvm/scummvm/commit/099cbcf7b8393bfe5410653ba9f37f714c0e58e4
Author: Scott Percival (code at moral.net.au)
Date: 2026-01-17T00:36:23+08:00
Commit Message:
DIRECTOR: Fix buggy behaviour of d_strstr
Fixes substitution of the commander's name in Beyond the Wall of Stars -
this uses b_offset() to search for "iii", which was getting tripped up
by the singular letter I.
Changed paths:
engines/director/util.cpp
diff --git a/engines/director/util.cpp b/engines/director/util.cpp
index 9e9cec7ef9a..777dc786c2b 100644
--- a/engines/director/util.cpp
+++ b/engines/director/util.cpp
@@ -1807,24 +1807,34 @@ bool compareStringEquality(const Common::String &s1, const Common::String &s2) {
}
const char *d_strstr(const char *str, const char *substr) {
- // Check if the substr is found inside the str
- int len = strlen(substr);
- const char *ref = substr;
-
- while (*str && *ref) {
- const uint32 c1 = getCharEquality(*str);
- const uint32 c2 = getCharEquality(*ref);
-
- str++;
+ while (*str && *substr) {
+ uint32 c1 = getCharEquality(*str);
+ uint32 c2 = getCharEquality(*substr);
+
+ if (c1 == c2) {
+ // inner loop, keep track of the starting character
+ const char *baseptr = str;
+ const char *ref = substr;
+ while (*baseptr && *ref) {
+ c1 = getCharEquality(*baseptr);
+ c2 = getCharEquality(*ref);
+
+ // characters equal, increment substring
+ if (c1 == c2) {
+ ref++;
+ } else {
+ break;
+ }
- if (c1 == c2)
- ref++;
+ // reached the end of the substring, success
+ if (!*ref)
+ return str;
- if (!*ref)
- return (str - len);
+ baseptr++;
+ }
+ }
- if (len == (ref - substr))
- ref = substr;
+ str++;
}
return nullptr;
Commit: 014929a9a39baec4e4a9b0f3c56996e0b118724a
https://github.com/scummvm/scummvm/commit/014929a9a39baec4e4a9b0f3c56996e0b118724a
Author: Scott Percival (code at moral.net.au)
Date: 2026-01-17T00:36:34+08:00
Commit Message:
DIRECTOR: Fix Ghost/NotGhost/Reverse/NotReverse ink types in 32bpp mode
Changed paths:
engines/director/graphics.cpp
diff --git a/engines/director/graphics.cpp b/engines/director/graphics.cpp
index 4d3c4c46c53..d09b6152098 100644
--- a/engines/director/graphics.cpp
+++ b/engines/director/graphics.cpp
@@ -443,33 +443,53 @@ void InkPrimitives<T>::drawPoint(int x, int y, uint32 src, void *data) {
}
break;
case kInkTypeReverse:
- // XOR dst palette index with src.
- // Originally designed for 1-bit mode so that
- // black pixels would appear white on a black
- // background.
- *dst ^= src;
+ if (sizeof(T) == 1) {
+ // XOR dst palette index with src.
+ // Originally designed for 1-bit mode so that
+ // black pixels would appear white on a black
+ // background.
+ *dst ^= src;
+ } else {
+ // In 32-bit mode, this is the opposite??
+ *dst ^= ~(src);
+ }
break;
case kInkTypeNotReverse:
- // XOR dst palette index with the inverse of src.
- *dst ^= ~(src);
+ if (sizeof(T) == 1) {
+ // XOR dst palette index with the inverse of src.
+ *dst ^= ~(src);
+ } else {
+ // In 32-bit mode, this is the opposite??
+ *dst ^= src & 0xffffff00;
+ }
break;
case kInkTypeGhost:
if (p->oneBitImage || p->applyColor) {
*dst = (src == p->colorBlack) ? p->backColor : *dst;
} else {
- // AND dst palette index with the inverse of src.
- // Originally designed for 1-bit mode so that
- // black pixels would be invisible until they were
- // over a black background, showing as white.
- *dst = *dst & ~src;
+ if (sizeof(T) == 1) {
+ // AND dst palette index with the inverse of src.
+ // Originally designed for 1-bit mode so that
+ // black pixels would be invisible until they were
+ // over a black background, showing as white.
+ *dst = *dst & ~src;
+ } else {
+ // In 32-bit mode, OR dst RGBA with inverse src
+ *dst = *dst | ~src;
+ }
}
break;
case kInkTypeNotGhost:
if (p->oneBitImage || p->applyColor) {
*dst = (src == p->colorWhite) ? p->backColor : *dst;
} else {
- // AND dst palette index with src.
- *dst = *dst & src;
+ if (sizeof(T) == 1) {
+ // AND dst palette index with src.
+ *dst = *dst & src;
+ } else {
+ // In 32-bit mode, OR dst RGBA with src
+ *dst = *dst | src;
+ }
}
break;
default: {
Commit: 42a2216737e7a83651b1a0251ed48e49ea98c028
https://github.com/scummvm/scummvm/commit/42a2216737e7a83651b1a0251ed48e49ea98c028
Author: Scott Percival (code at moral.net.au)
Date: 2026-01-17T00:36:41+08:00
Commit Message:
DIRECTOR: Make 32-bit BITDDecoder images output an RGBA surface
Changed paths:
engines/director/images.cpp
diff --git a/engines/director/images.cpp b/engines/director/images.cpp
index beebc03bf97..735ad73b00f 100644
--- a/engines/director/images.cpp
+++ b/engines/director/images.cpp
@@ -149,8 +149,8 @@ BITDDecoder::BITDDecoder(int w, int h, uint16 bitsPerPixel, uint16 pitch, const
format = Graphics::PixelFormat(2, 5, 5, 5, 0, 10, 5, 0, 0);
break;
case 4:
- // RGB888
- format = Graphics::PixelFormat(4, 8, 8, 8, 0, 16, 8, 0, 0);
+ // RGB8888
+ format = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
break;
default:
warning("BITDDecoder::BITDDecoder(): unsupported bpp %d", bitsPerPixel);
@@ -309,7 +309,7 @@ bool BITDDecoder::loadStream(Common::SeekableReadStream &stream) {
pixels[(((y * _surface->w * 4)) + (x + 2 * _surface->w))] << 8 |
pixels[(((y * _surface->w * 4)) + (x + 3 * _surface->w))];
}
- *((uint32 *)_surface->getBasePtr(x, y)) = color;
+ *((uint32 *)_surface->getBasePtr(x, y)) = (color << 8) | 0xff;
x++;
break;
More information about the Scummvm-git-logs
mailing list