[Scummvm-git-logs] scummvm master -> c5d91134eec7cf74991402876edf62c8416f4568
sev-
noreply at scummvm.org
Thu Feb 2 18:33:46 UTC 2023
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
0722f5e9c0 GRAPHICS: Implemented PixelFormat::isCLUT8()
e0736936e9 BACKENDS: OPENGL: Use isCLUT8()
c5d91134ee BACKENDS: DS: Use icCLUT8()
Commit: 0722f5e9c089e1fc59371c82e76355551affb4e6
https://github.com/scummvm/scummvm/commit/0722f5e9c089e1fc59371c82e76355551affb4e6
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-02-02T19:33:20+01:00
Commit Message:
GRAPHICS: Implemented PixelFormat::isCLUT8()
Changed paths:
graphics/pixelformat.h
diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h
index c1c7d05a0db..5973dd18bab 100644
--- a/graphics/pixelformat.h
+++ b/graphics/pixelformat.h
@@ -372,6 +372,12 @@ struct PixelFormat {
}
/** Return string representation. */
Common::String toString() const;
+
+ /** Shortcut method for checking if the current format is CLUT8 or not */
+ bool isCLUT8() const {
+ // We do not really need to check masks when all shifts equal zeroes
+ return bytesPerPixel == 1 && rShift == 0 && gShift == 0 && bShift == 0 && aShift == 0;
+ }
};
template<>
Commit: e0736936e90c19b637e0fe7b1ac752c5a233b1b1
https://github.com/scummvm/scummvm/commit/e0736936e90c19b637e0fe7b1ac752c5a233b1b1
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-02-02T19:33:20+01:00
Commit Message:
BACKENDS: OPENGL: Use isCLUT8()
Changed paths:
backends/graphics/opengl/texture.cpp
diff --git a/backends/graphics/opengl/texture.cpp b/backends/graphics/opengl/texture.cpp
index eb9d96a85d6..a985baad67e 100644
--- a/backends/graphics/opengl/texture.cpp
+++ b/backends/graphics/opengl/texture.cpp
@@ -378,7 +378,7 @@ FakeTexture::FakeTexture(GLenum glIntFormat, GLenum glFormat, GLenum glType, con
_fakeFormat(fakeFormat),
_rgbData(),
_palette(nullptr) {
- if (_fakeFormat == Graphics::PixelFormat::createFormatCLUT8()) {
+ if (_fakeFormat.isCLUT8()) {
_palette = new uint32[256];
memset(_palette, 0, sizeof(uint32));
}
Commit: c5d91134eec7cf74991402876edf62c8416f4568
https://github.com/scummvm/scummvm/commit/c5d91134eec7cf74991402876edf62c8416f4568
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2023-02-02T19:33:20+01:00
Commit Message:
BACKENDS: DS: Use icCLUT8()
Changed paths:
backends/platform/ds/background.cpp
diff --git a/backends/platform/ds/background.cpp b/backends/platform/ds/background.cpp
index 9e03a36175c..95f8a9135c3 100644
--- a/backends/platform/ds/background.cpp
+++ b/backends/platform/ds/background.cpp
@@ -97,7 +97,7 @@ Background::Background(Graphics::Surface *surface, int layer, bool isSub, int ma
assert(_surface);
uint16 realPitch, realHeight;
- bool isRGB = (_surface->format != Graphics::PixelFormat::createFormatCLUT8());
+ bool isRGB = !_surface->format.isCLUT8();
BgType type = (isRGB || swScale) ? BgType_Bmp16 : BgType_Bmp8;
BgSize size = getBgSize(_surface->w, _surface->h, isRGB, swScale, realPitch, realHeight);
More information about the Scummvm-git-logs
mailing list