mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
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().
This commit is contained in:
1 parent
cb5b2dc021
commit
39c53260a2
1 file changed
+2
-2
@@ -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));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user