[Scummvm-git-logs] scummvm master -> 39c53260a2e6875dcc0cf5152329bdbaaa601db7
mikrosk
noreply at scummvm.org
Mon Apr 3 19:19:25 UTC 2023
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:
39c53260a2 ASYLUM: Fix rendering if width != pitch in 8bpp
Commit: 39c53260a2e6875dcc0cf5152329bdbaaa601db7
https://github.com/scummvm/scummvm/commit/39c53260a2e6875dcc0cf5152329bdbaaa601db7
Author: Miro Kropacek (miro.kropacek at gmail.com)
Date: 2023-04-03T21:19:49+02:00
Commit Message:
ASYLUM: Fix rendering if width != pitch in 8bpp
The reason why the engine needs linearly allocated surface is
Cursor::update() which passes cursor surfaces directly to
CursorMan::replaceCursor().
Changed paths:
engines/asylum/system/graphics.cpp
diff --git a/engines/asylum/system/graphics.cpp b/engines/asylum/system/graphics.cpp
index d3f7955833d..71f5bb9fcb5 100644
--- a/engines/asylum/system/graphics.cpp
+++ b/engines/asylum/system/graphics.cpp
@@ -57,7 +57,7 @@ bool GraphicResource::load(ResourceId id) {
void GraphicResource::clear() {
for (uint32 i = 0; i < _frames.size(); i++) {
- _frames[i].surface.free();
+ delete[] (byte*)_frames[i].surface.getPixels();
}
_frames.clear();
@@ -141,7 +141,7 @@ void GraphicResource::init(byte *data, int32 size) {
uint16 width = READ_LE_UINT16(dataPtr);
dataPtr += 2;
- _frames[i].surface.create(width, height, Graphics::PixelFormat::createFormatCLUT8());
+ _frames[i].surface.init(width, height, width, new byte[width * height], Graphics::PixelFormat::createFormatCLUT8());
memcpy(_frames[i].surface.getPixels(), dataPtr, (size_t)(width * height));
}
More information about the Scummvm-git-logs
mailing list