1
0
mirror of https://github.com/jummy0/sb2-decomp synced 2025-03-15 04:24:48 +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() BOOL CEvent::CreateButtons()
{ {
int i = 0, message, num = 0, size; int message;
int num3 = 0;
int* iconMenu; int* iconMenu;
POINT pos, toolTips; POINT pos;
BOOL bMinimizeRedraw = FALSE; 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.x = table[m_index].buttons[i].x;
pos.y = table[m_index].buttons[i].y; pos.y = table[m_index].buttons[i].y;
@ -628,10 +623,9 @@ BOOL CEvent::CreateButtons()
{ {
iconMenu++; 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]); 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]);
i++;
} }
return TRUE; return TRUE;
} }
@ -1073,6 +1067,11 @@ BOOL CEvent::DrawButtons()
{ {
DrawText(m_pPixmap, { 414, 446 }, "Version 2.2", FONTLITTLE); 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) if (m_phase == WM_PHASE_GAMER)
{ {

View File

@ -94,7 +94,7 @@ BOOL CNetwork::CreateProvider(int index)
void CNetwork::FreeProviderList() 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.nb = 0;
*m_providers.list = NULL; *m_providers.list = NULL;

View File

@ -27,7 +27,7 @@ CPixmap::CPixmap()
m_bFullScreen = FALSE; m_bFullScreen = FALSE;
m_bBenchmarkSuccess = TRUE; m_bBenchmarkSuccess = TRUE;
m_bTrueColor = FALSE; m_bTrueColorBack = FALSE;
m_bTrueColorDecor = FALSE; m_bTrueColorDecor = FALSE;
m_mouseType = MOUSETYPEGRA; m_mouseType = MOUSETYPEGRA;
m_bDebug = TRUE; m_bDebug = TRUE;
@ -155,7 +155,7 @@ BOOL CPixmap::Create(HWND hwnd, POINT dim,
m_mouseType = mouseType; m_mouseType = mouseType;
m_dim = dim; m_dim = dim;
m_bTrueColorDecor = bTrueColorDecor; m_bTrueColorDecor = bTrueColorDecor;
m_bTrueColor = bTrueColor; m_bTrueColorBack = bTrueColor;
if ( m_mouseType == MOUSETYPEGRA ) if ( m_mouseType == MOUSETYPEGRA )
{ {
@ -433,7 +433,7 @@ BOOL CPixmap::InitSysPalette()
BOOL CPixmap::GetTrueColor() BOOL CPixmap::GetTrueColor()
{ {
return m_bTrueColor; return m_bTrueColorBack;
} }
void CPixmap::SetBenchmarkSuccess(BOOL bSuccess) void CPixmap::SetBenchmarkSuccess(BOOL bSuccess)
@ -443,7 +443,7 @@ void CPixmap::SetBenchmarkSuccess(BOOL bSuccess)
void CPixmap::SetTrueColor(BOOL bTrueColor) void CPixmap::SetTrueColor(BOOL bTrueColor)
{ {
m_bTrueColor = bTrueColor; m_bTrueColorBack = bTrueColor;
} }
void CPixmap::SetTrueColorDecor(BOOL bTrueColorDecor) 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_bDebug ) OutputDebug("Use Palette\n");
if (m_lpDDPal != NULL) if (m_lpDDPal != NULL)
{ {
if ( m_bDebug ) OutputDebug("Release palette"); if ( m_bDebug ) OutputDebug("Release palette\n");
m_lpDDPal->Release(); m_lpDDPal->Release();
m_lpDDPal = NULL; m_lpDDPal = NULL;
} }
@ -898,27 +898,17 @@ BOOL CPixmap::BackgroundCache(int channel, const char* pFilename, POINT totalDim
strstr(pFilename, "element") != pFilename && strstr(pFilename, "element") != pFilename &&
strstr(pFilename, "explo") != pFilename && strstr(pFilename, "explo") != pFilename &&
strstr(pFilename, "object") != pFilename; strstr(pFilename, "object") != pFilename;
if ( bUsePalette ) if (!bUsePalette && (!decor || m_bTrueColorBack))
{ {
goto LABEL1; strcpy(file, "image16\\");
} strcat(file, pFilename);
if (decor) if (Cache2(channel, file, totalDim, iconDim, FALSE))
{
if (m_bTrueColor == FALSE)
{ {
if (decor) goto LABEL1; return TRUE;
if (m_bTrueColorDecor == FALSE) goto LABEL1;
} }
} }
strcpy(file, "image16\\");
strcat(file, pFilename);
if (Cache2(channel, file, totalDim, iconDim, FALSE) != FALSE)
{
return TRUE;
}
LABEL1:
strcpy(file, "image08\\"); strcpy(file, "image08\\");
strcat(file, (char*)pFilename); strcat(file, pFilename);
return Cache2(channel, file, totalDim, iconDim, bUsePalette); return Cache2(channel, file, totalDim, iconDim, bUsePalette);
} }
@ -946,7 +936,7 @@ BOOL CPixmap::CacheAll(BOOL cache, HWND hWnd, BOOL bFullScreen, BOOL bTrueColor,
delete this; delete this;
hWnd = m_hWnd; hWnd = m_hWnd;
bFullScreen = m_bFullScreen; bFullScreen = m_bFullScreen;
bTrueColor = m_bTrueColor; bTrueColor = m_bTrueColorBack;
bTrueColorDecor = m_bTrueColorDecor; bTrueColorDecor = m_bTrueColorDecor;
mouseType = m_mouseType; mouseType = m_mouseType;
} }

View File

@ -87,7 +87,7 @@ protected:
protected: protected:
BOOL m_bFullScreen; BOOL m_bFullScreen;
BOOL m_bBenchmarkSuccess; BOOL m_bBenchmarkSuccess;
BOOL m_bTrueColor; BOOL m_bTrueColorBack;
BOOL m_bTrueColorDecor; BOOL m_bTrueColorDecor;
BOOL m_field5_0x14; //Need to figure out BOOL m_field5_0x14; //Need to figure out
BOOL m_field5_0x18; //Need to figure out BOOL m_field5_0x18; //Need to figure out