From 7f9b67c210f29c2cfac074df427a131ef8ed5c01 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Mon, 28 Jan 2019 05:07:24 +0100 Subject: [PATCH] Remove redundant code --- Stub/sdlrender.cpp | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) diff --git a/Stub/sdlrender.cpp b/Stub/sdlrender.cpp index e5c560c15..d34f59748 100644 --- a/Stub/sdlrender.cpp +++ b/Stub/sdlrender.cpp @@ -556,25 +556,6 @@ void __fastcall LoadPalInMem(PALETTEENTRY *pPal) } BOOL __cdecl LoadArtImage(char *pszFile, void **pBuffer, int frames, DWORD *data) -{ - DWORD width; // [esp+44h] [ebp-8h] - DWORD height; // [esp+48h] [ebp-4h] MAPDST - - *pBuffer = NULL; - - if (!SBmpLoadImage(pszFile, 0, 0, 0, &width, &height, 0)) - return 0; - *pBuffer = SMemAlloc(height * width, "U:\\DiabloUI\\Ui\\local.cpp", 88, 0); - if (!SBmpLoadImage(pszFile, NULL, *pBuffer, height * width, 0, 0, 0)) - return 0; - if (pBuffer && data) { - data[0] = width; - data[1] = height / frames; - } - return 1; -} - -BOOL __cdecl LoadArtWithPal(char *pszFile, void **pBuffer, int frames, DWORD *data) { DWORD width; DWORD height; @@ -586,9 +567,6 @@ BOOL __cdecl LoadArtWithPal(char *pszFile, void **pBuffer, int frames, DWORD *da *pBuffer = SMemAlloc(height * width, "U:\\DiabloUI\\Ui\\local.cpp", 88, 0); if (!SBmpLoadImage(pszFile, pcxPal, *pBuffer, height * width, 0, 0, 0)) return 0; - - LoadPalInMem(pcxPal); - if (pBuffer && data) { data[0] = width; data[1] = height / frames; @@ -907,7 +885,8 @@ void LoadTitelArt(char *pszFile) return; } - LoadArtWithPal(pszFile, &pPcxTitleImage, 1, dwData); + LoadArtImage(pszFile, &pPcxTitleImage, 1, dwData); + LoadPalInMem(pcxPal); ApplyGamma(logical_palette, orig_palette, 256); gdwTitleWidth = dwData[0]; gdwTitleHeight = dwData[1];