From cd3e7366b49ba08047bca42443b6552299fb08fc Mon Sep 17 00:00:00 2001 From: jummy Date: Sun, 8 Sep 2024 17:23:02 -0500 Subject: [PATCH] g --- src/event.cpp | 23 +++++++++++------------ src/network.cpp | 2 +- src/pixmap.cpp | 34 ++++++++++++---------------------- src/pixmap.h | 2 +- 4 files changed, 25 insertions(+), 36 deletions(-) diff --git a/src/event.cpp b/src/event.cpp index f2ed3a7..41ef4f7 100644 --- a/src/event.cpp +++ b/src/event.cpp @@ -602,18 +602,13 @@ void CEvent::FlushInput() BOOL CEvent::CreateButtons() { - int i = 0, message, num = 0, size; - int num3 = 0; + int message; int* iconMenu; - POINT pos, toolTips; + POINT pos; BOOL bMinimizeRedraw = FALSE; - CButton* button; - - size = m_phase * sizeof(Phase); - button = m_buttons; - while (table[m_index].buttons[i].message != 0) + for (int i = 0; table[m_index].buttons[i].message != 0; i++) { pos.x = table[m_index].buttons[i].x; pos.y = table[m_index].buttons[i].y; @@ -628,10 +623,9 @@ BOOL CEvent::CreateButtons() { iconMenu++; } - m_buttons->SetIconMenu(table[m_index].buttons[i].iconMenu + 1, iconMenu[0]); - m_buttons->SetToolTips(table[m_index].buttons[i].toolTips + 1, table[m_index].buttons[i].toolTips[0]); - - i++; + + m_buttons[i].SetIconMenu(&table[m_index].buttons[i].iconMenu[1], iconMenu[0]); + m_buttons[i].SetToolTips(&table[m_index].buttons[i].toolTips[1], table[m_index].buttons[i].toolTips[0]); } return TRUE; } @@ -1073,6 +1067,11 @@ BOOL CEvent::DrawButtons() { DrawText(m_pPixmap, { 414, 446 }, "Version 2.2", FONTLITTLE); } + + for (int i = 0; table[m_index].buttons[i].message != 0; i++) + { + m_buttons[i].Draw(); + } if (m_phase == WM_PHASE_GAMER) { diff --git a/src/network.cpp b/src/network.cpp index 9aa5714..14875ed 100644 --- a/src/network.cpp +++ b/src/network.cpp @@ -94,7 +94,7 @@ BOOL CNetwork::CreateProvider(int index) void CNetwork::FreeProviderList() { - if (m_providers.list) free(m_providers.list); + if (m_providers.list) free(m_providers.list); // wrong m_providers.nb = 0; *m_providers.list = NULL; diff --git a/src/pixmap.cpp b/src/pixmap.cpp index 0c05cbe..629b3fd 100644 --- a/src/pixmap.cpp +++ b/src/pixmap.cpp @@ -27,7 +27,7 @@ CPixmap::CPixmap() m_bFullScreen = FALSE; m_bBenchmarkSuccess = TRUE; - m_bTrueColor = FALSE; + m_bTrueColorBack = FALSE; m_bTrueColorDecor = FALSE; m_mouseType = MOUSETYPEGRA; m_bDebug = TRUE; @@ -155,7 +155,7 @@ BOOL CPixmap::Create(HWND hwnd, POINT dim, m_mouseType = mouseType; m_dim = dim; m_bTrueColorDecor = bTrueColorDecor; - m_bTrueColor = bTrueColor; + m_bTrueColorBack = bTrueColor; if ( m_mouseType == MOUSETYPEGRA ) { @@ -433,7 +433,7 @@ BOOL CPixmap::InitSysPalette() BOOL CPixmap::GetTrueColor() { - return m_bTrueColor; + return m_bTrueColorBack; } void CPixmap::SetBenchmarkSuccess(BOOL bSuccess) @@ -443,7 +443,7 @@ void CPixmap::SetBenchmarkSuccess(BOOL bSuccess) void CPixmap::SetTrueColor(BOOL bTrueColor) { - m_bTrueColor = bTrueColor; + m_bTrueColorBack = bTrueColor; } void CPixmap::SetTrueColorDecor(BOOL bTrueColorDecor) @@ -821,7 +821,7 @@ BOOL CPixmap::Cache2(int channel, LPCSTR pFilename, POINT totalDim, POINT iconDi if ( m_bDebug ) OutputDebug("Use Palette\n"); if (m_lpDDPal != NULL) { - if ( m_bDebug ) OutputDebug("Release palette"); + if ( m_bDebug ) OutputDebug("Release palette\n"); m_lpDDPal->Release(); m_lpDDPal = NULL; } @@ -898,27 +898,17 @@ BOOL CPixmap::BackgroundCache(int channel, const char* pFilename, POINT totalDim strstr(pFilename, "element") != pFilename && strstr(pFilename, "explo") != pFilename && strstr(pFilename, "object") != pFilename; - if ( bUsePalette ) + if (!bUsePalette && (!decor || m_bTrueColorBack)) { - goto LABEL1; - } - if (decor) - { - if (m_bTrueColor == FALSE) + strcpy(file, "image16\\"); + strcat(file, pFilename); + if (Cache2(channel, file, totalDim, iconDim, FALSE)) { - if (decor) goto LABEL1; - if (m_bTrueColorDecor == FALSE) goto LABEL1; + return TRUE; } } - strcpy(file, "image16\\"); - strcat(file, pFilename); - if (Cache2(channel, file, totalDim, iconDim, FALSE) != FALSE) - { - return TRUE; - } -LABEL1: strcpy(file, "image08\\"); - strcat(file, (char*)pFilename); + strcat(file, pFilename); return Cache2(channel, file, totalDim, iconDim, bUsePalette); } @@ -946,7 +936,7 @@ BOOL CPixmap::CacheAll(BOOL cache, HWND hWnd, BOOL bFullScreen, BOOL bTrueColor, delete this; hWnd = m_hWnd; bFullScreen = m_bFullScreen; - bTrueColor = m_bTrueColor; + bTrueColor = m_bTrueColorBack; bTrueColorDecor = m_bTrueColorDecor; mouseType = m_mouseType; } diff --git a/src/pixmap.h b/src/pixmap.h index ab2daa6..10eecb7 100644 --- a/src/pixmap.h +++ b/src/pixmap.h @@ -87,7 +87,7 @@ protected: protected: BOOL m_bFullScreen; BOOL m_bBenchmarkSuccess; - BOOL m_bTrueColor; + BOOL m_bTrueColorBack; BOOL m_bTrueColorDecor; BOOL m_field5_0x14; //Need to figure out BOOL m_field5_0x18; //Need to figure out