MADE: Use new CursorMan with cursor surface

This commit is contained in:
Miro Kropacek 2023-04-04 17:36:40 +02:00 committed by Eugene Sandulenko
parent dd1232325d
commit 38ffb065f5
2 changed files with 4 additions and 2 deletions

View File

@ -72,6 +72,7 @@ void decompressImage(byte *source, Graphics::Surface &surface, uint16 cmdOffs, u
960, 961, 962, 963
};
uint16 pitch = surface.pitch;
uint16 width = surface.w;
uint16 height = surface.h;
@ -175,11 +176,12 @@ void decompressImage(byte *source, Graphics::Surface &surface, uint16 cmdOffs, u
*destPtr = lineBuf[x + y * 320];
destPtr++;
}
destPtr += pitch - width;
}
} else {
for (int y = 0; y < 4 && height > 0; y++, height--) {
memcpy(destPtr, &lineBuf[y * 320], width);
destPtr += width;
destPtr += pitch;
}
}

View File

@ -580,7 +580,7 @@ int16 ScriptFunctions::sfLoadMouseCursor(int16 argc, int16 *argv) {
PictureResource *flex = _vm->_res->getPicture(argv[2]);
if (flex) {
Graphics::Surface *surf = flex->getPicture();
CursorMan.replaceCursor(surf->getPixels(), surf->w, surf->h, argv[1], argv[0], 0);
CursorMan.replaceCursor(*surf, argv[1], argv[0], 0);
_vm->_res->freeResource(flex);
}
return 0;