[Scummvm-git-logs] scummvm master -> c27eb4dd8ae8ed74016fe3bf5e4a13b54ee6777e
bluegr
noreply at scummvm.org
Fri Apr 18 13:00:59 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
c27eb4dd8a QDENGINE: Fix Wswitch and Wcast-qual warnings
Commit: c27eb4dd8ae8ed74016fe3bf5e4a13b54ee6777e
https://github.com/scummvm/scummvm/commit/c27eb4dd8ae8ed74016fe3bf5e4a13b54ee6777e
Author: Alikhan Balpykov (lowliet1990 at mail.ru)
Date: 2025-04-18T16:00:55+03:00
Commit Message:
QDENGINE: Fix Wswitch and Wcast-qual warnings
Changed paths:
engines/qdengine/system/graphics/gr_dispatcher.cpp
engines/qdengine/system/graphics/gr_draw_sprite.cpp
diff --git a/engines/qdengine/system/graphics/gr_dispatcher.cpp b/engines/qdengine/system/graphics/gr_dispatcher.cpp
index d53f3093ac0..620541c8039 100644
--- a/engines/qdengine/system/graphics/gr_dispatcher.cpp
+++ b/engines/qdengine/system/graphics/gr_dispatcher.cpp
@@ -863,6 +863,7 @@ bool grDispatcher::convert_sprite(grPixelFormat src_fmt, grPixelFormat &dest_fmt
}
break;
case GR_ARGB8888:
+ case GR_RGBA8888:
if (src_fmt == GR_ARGB1555 || src_fmt == GR_RGB565) {
uint16 *p = reinterpret_cast<uint16 *>(data);
for (int i = 0; i < sx * sy; i++) {
@@ -882,9 +883,15 @@ bool grDispatcher::convert_sprite(grPixelFormat src_fmt, grPixelFormat &dest_fmt
p++;
- dp[0] = b;
- dp[1] = g;
- dp[2] = r;
+ if (dest_fmt == GR_ARGB8888) {
+ dp[0] = b;
+ dp[1] = g;
+ dp[2] = r;
+ } else if (dest_fmt == GR_RGBA8888) {
+ dp[1] = b;
+ dp[2] = g;
+ dp[3] = r;
+ }
dp += 4;
}
diff --git a/engines/qdengine/system/graphics/gr_draw_sprite.cpp b/engines/qdengine/system/graphics/gr_draw_sprite.cpp
index 4affa7ce078..d3cff68b338 100644
--- a/engines/qdengine/system/graphics/gr_draw_sprite.cpp
+++ b/engines/qdengine/system/graphics/gr_draw_sprite.cpp
@@ -715,7 +715,7 @@ void grDispatcher::putSpr(int x, int y, int sx, int sy, const byte *p, int mode,
for (int j = 0; j < psx; j++) {
if (*data_line) {
byte r, g, b;
- split_rgb565u(*(uint16 *)data_line, r, g, b);
+ split_rgb565u(*(const uint16 *)data_line, r, g, b);
setPixelFast(scr_buf, make_rgb(r, g, b));
}
scr_buf += dx;
More information about the Scummvm-git-logs
mailing list