From 463968d79853fa26d57f010e9aa434f61bcadef2 Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Sat, 24 Sep 2022 21:29:50 +0300 Subject: [PATCH] Refactor artLockFrameData with FrmImage --- src/game.cc | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/game.cc b/src/game.cc index b33faff..ac00be8 100644 --- a/src/game.cc +++ b/src/game.cc @@ -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);