1
0
mirror of https://github.com/jummy0/sb2-decomp synced 2025-03-14 20:23:30 +01:00
This commit is contained in:
jummy 2024-09-08 17:23:02 -05:00
parent 9f48cb6d67
commit cd3e7366b4
4 changed files with 25 additions and 36 deletions

View File

@ -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)
{

View File

@ -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;

View File

@ -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;
}

View File

@ -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