@@ -2483,30 +2483,26 @@ static void customInterfaceBarInit()
24832483{
24842484 gInterfaceBarContentOffset = gInterfaceBarWidth - 640 ;
24852485
2486- char path[COMPAT_MAX_PATH];
2487- snprintf (path, sizeof (path), " art\\ intrface\\ HR_IFACE_%d.FRM" , gInterfaceBarWidth );
2486+ if (gInterfaceBarContentOffset > 0 && screenGetWidth () > 640 ) {
2487+ char path[COMPAT_MAX_PATH];
2488+ snprintf (path, sizeof (path), " art\\ intrface\\ HR_IFACE_%d.FRM" , gInterfaceBarWidth );
2489+
2490+ gCustomInterfaceBarBackground = artLoad (path);
2491+ }
24882492
2489- int size;
2490- if (dbGetFileSize (path, &size) != 0 || gInterfaceBarContentOffset <= 0 || screenGetWidth () <= 640 ) {
2493+ if (gCustomInterfaceBarBackground != nullptr ) {
2494+ gInterfaceBarIsCustom = true ;
2495+ } else {
24912496 gInterfaceBarContentOffset = 0 ;
24922497 gInterfaceBarWidth = 640 ;
24932498 gInterfaceBarIsCustom = false ;
2494- } else {
2495- gInterfaceBarIsCustom = true ;
2496-
2497- gCustomInterfaceBarBackground = (Art*)(malloc (size));
2498- if (artRead (path, (unsigned char *)gCustomInterfaceBarBackground ) != 0 ) {
2499- gInterfaceBarIsCustom = false ;
2500- free (gCustomInterfaceBarBackground );
2501- gCustomInterfaceBarBackground = nullptr ;
2502- }
25032499 }
25042500}
25052501
25062502static void customInterfaceBarExit ()
25072503{
25082504 if (gCustomInterfaceBarBackground != nullptr ) {
2509- free (gCustomInterfaceBarBackground );
2505+ internal_free (gCustomInterfaceBarBackground );
25102506 gCustomInterfaceBarBackground = nullptr ;
25112507 }
25122508}
@@ -2585,21 +2581,11 @@ static void sidePanelsShow()
25852581
25862582static void sidePanelsDraw (const char * path, int win, bool isLeading)
25872583{
2588- int size;
2589- if (dbGetFileSize (path, &size) != 0 ) {
2590- return ;
2591- }
2592-
2593- Art* image = reinterpret_cast <Art*>(internal_malloc (size));
2584+ Art* image = artLoad (path);
25942585 if (image == nullptr ) {
25952586 return ;
25962587 }
25972588
2598- if (artRead (path, reinterpret_cast <unsigned char *>(image)) != 0 ) {
2599- internal_free (image);
2600- return ;
2601- }
2602-
26032589 unsigned char * imageData = artGetFrameData (image, 0 , 0 );
26042590
26052591 int imageWidth = artGetWidth (image, 0 , 0 );
0 commit comments