From b2420bdc807eb0d03b2447d386bf39f8b18ab5ba Mon Sep 17 00:00:00 2001 From: Alexander Batalov Date: Mon, 7 Nov 2022 13:55:05 +0300 Subject: [PATCH] Refactor artLock with FrmImage --- src/display_monitor.cc | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/display_monitor.cc b/src/display_monitor.cc index aeb5467..f28e589 100644 --- a/src/display_monitor.cc +++ b/src/display_monitor.cc @@ -131,16 +131,15 @@ int displayMonitorInit() gDisplayMonitorBackgroundFrmData, DISPLAY_MONITOR_WIDTH); } else { - CacheEntry* backgroundFrmHandle; + FrmImage backgroundFrmImage; int backgroundFid = buildFid(OBJ_TYPE_INTERFACE, 16, 0, 0, 0); - Art* backgroundFrm = artLock(backgroundFid, &backgroundFrmHandle); - if (backgroundFrm == NULL) { + if (!backgroundFrmImage.lock(backgroundFid)) { internal_free(gDisplayMonitorBackgroundFrmData); return -1; } - unsigned char* backgroundFrmData = artGetFrameData(backgroundFrm, 0, 0); - _intface_full_width = artGetWidth(backgroundFrm, 0, 0); + unsigned char* backgroundFrmData = backgroundFrmImage.getData(); + _intface_full_width = backgroundFrmImage.getWidth(); blitBufferToBuffer(backgroundFrmData + _intface_full_width * DISPLAY_MONITOR_Y + DISPLAY_MONITOR_X, DISPLAY_MONITOR_WIDTH, @@ -148,8 +147,6 @@ int displayMonitorInit() _intface_full_width, gDisplayMonitorBackgroundFrmData, DISPLAY_MONITOR_WIDTH); - - artUnlock(backgroundFrmHandle); } gDisplayMonitorScrollUpButton = buttonCreate(gInterfaceBarWindow,