Refactor artLockFrameData with FrmImage

This commit is contained in:
Alexander Batalov 2022-09-24 21:29:50 +03:00
parent 109dc6680c
commit 463968d798
1 changed files with 3 additions and 5 deletions

View File

@ -1141,13 +1141,11 @@ static void showHelp()
if (win != -1) {
unsigned char* windowBuffer = windowGetBuffer(win);
if (windowBuffer != NULL) {
FrmImage backgroundFrmImage;
int backgroundFid = buildFid(OBJ_TYPE_INTERFACE, 297, 0, 0, 0);
CacheEntry* backgroundHandle;
unsigned char* backgroundData = artLockFrameData(backgroundFid, 0, 0, &backgroundHandle);
if (backgroundData != NULL) {
if (backgroundFrmImage.lock(backgroundFid)) {
paletteSetEntries(gPaletteBlack);
blitBufferToBuffer(backgroundData, HELP_SCREEN_WIDTH, HELP_SCREEN_HEIGHT, HELP_SCREEN_WIDTH, windowBuffer, HELP_SCREEN_WIDTH);
artUnlock(backgroundHandle);
blitBufferToBuffer(backgroundFrmImage.getData(), HELP_SCREEN_WIDTH, HELP_SCREEN_HEIGHT, HELP_SCREEN_WIDTH, windowBuffer, HELP_SCREEN_WIDTH);
windowUnhide(win);
colorPaletteLoad("art\\intrface\\helpscrn.pal");
paletteSetEntries(_cmap);