Enable bigger squad sizes for 720p resolution (#160)

This commit is contained in:
Asdow
2023-05-28 16:32:12 +03:00
committed by GitHub
parent 744e9c92ec
commit 986d280193
5 changed files with 25 additions and 10 deletions
+2 -2
View File
@@ -4153,7 +4153,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
if( reason & MSYS_CALLBACK_REASON_LBUTTON_REPEAT )
{
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
if (iResolution >= _800x600 && iResolution < _1024x768)
if (iResolution >= _800x600 && iResolution < _1280x720)
maxSquadSize = GIO_SQUAD_SIZE_8;
if ( iCurrentSquadSize < maxSquadSize )
@@ -4173,7 +4173,7 @@ void BtnGIOSquadSizeSelectionRightCallback( GUI_BUTTON *btn,INT32 reason )
btn->uiFlags|=(BUTTON_CLICKED_ON);
UINT8 maxSquadSize = GIO_SQUAD_SIZE_10;
if (iResolution >= _800x600 && iResolution < _1024x768)
if (iResolution >= _800x600 && iResolution < _1280x720)
maxSquadSize = GIO_SQUAD_SIZE_8;
if ( iCurrentSquadSize < maxSquadSize )
+1 -1
View File
@@ -4926,7 +4926,7 @@ BOOLEAN LoadSavedGame( int ubSavedGameID )
}
if ((gGameOptions.ubSquadSize == 8 && iResolution < _800x600) ||
(gGameOptions.ubSquadSize == 10 && iResolution < _1024x768))
(gGameOptions.ubSquadSize == 10 && iResolution < _1280x720))
{
FileClose( hFile );
return(FALSE);
+1 -1
View File
@@ -2512,7 +2512,7 @@ void DoneFadeOutForSaveLoadScreen( void )
NextLoopCheckForEnoughFreeHardDriveSpace();
}
else if ((gGameOptions.ubSquadSize == 8 && iResolution < _800x600) ||
(gGameOptions.ubSquadSize == 10 && iResolution < _1024x768))
(gGameOptions.ubSquadSize == 10 && iResolution < _1280x720))
{
DoSaveLoadMessageBox( MSG_BOX_BASIC_STYLE, zSaveLoadText[SLG_SQUAD_SIZE_RES_ERROR], SAVE_LOAD_SCREEN, MSG_BOX_FLAG_OK, FailedLoadingGameCallBack );
NextLoopCheckForEnoughFreeHardDriveSpace();
+12 -2
View File
@@ -5199,7 +5199,7 @@ BOOLEAN InitializeTEAMPanel( )
if (iResolution >= _640x480 && iResolution < _800x600)
FilenameForBPP("INTERFACE\\bottom_bar.sti", VObjectDesc.ImageFile);
else if (iResolution < _1024x768)
else if (iResolution < _1280x720)
{
if (gGameOptions.ubSquadSize > 6)
{
@@ -5240,6 +5240,16 @@ BOOLEAN InitializeTEAMPanel( )
memset( gfTEAM_HandInvDispText, 0, sizeof( gfTEAM_HandInvDispText ) );
// Offset button coordinates to correct positions if squadsize is 10
if (iResolution == _1280x720)
{
UINT16 offset = 223;
TM_ENDTURN_X = xResOffset + (xResSize - 131) + offset;
TM_ROSTERMODE_X = xResOffset + (xResSize - 131) + offset;
TM_DISK_X = xResOffset + (xResSize - 131) + offset;
INTERFACE_CLOCK_TM_X = xResOffset + (xResSize - 86) + offset;
LOCATION_NAME_TM_X = xResOffset + (xResSize - 92) + offset;
}
// Create buttons
CHECKF( CreateTEAMPanelButtons( ) );
@@ -5358,7 +5368,7 @@ BOOLEAN ShutdownTEAMPanel( )
if( fRenderRadarScreen == FALSE )
{
// start rendering radar region again,
fRenderRadarScreen = TRUE;
fRenderRadarScreen = TRUE;
// remove squad panel
CreateDestroyMouseRegionsForSquadList( );
+9 -4
View File
@@ -82,13 +82,14 @@ void InitRadarScreenCoords( )
{
RADAR_WINDOW_STRAT_X = UI_BOTTOM_X + 1182;
RADAR_WINDOW_STRAT_Y = UI_BOTTOM_Y + 9;
RADAR_WINDOW_TM_X = xResOffset + (xResSize - 97) + 223;
}
else
{
RADAR_WINDOW_STRAT_X = xResOffset + (xResSize - 97);
RADAR_WINDOW_STRAT_Y = (SCREEN_HEIGHT - 107);
RADAR_WINDOW_TM_X = xResOffset + (xResSize - 97);
}
RADAR_WINDOW_TM_X = xResOffset + (xResSize - 97);
RADAR_WINDOW_SM_X = xResOffset + (xResSize - 97);
RADAR_WINDOW_TM_Y = (INTERFACE_START_Y + 13);
@@ -767,9 +768,13 @@ BOOLEAN CreateDestroyMouseRegionsForSquadList( void )
CHECKF(AddVideoObject(&VObjectDesc, &uiHandle));
GetVideoObject(&hHandle, uiHandle);
BltVideoObject( guiSAVEBUFFER , hHandle, 0,(xResOffset + xResSize - 102 - 1), gsVIEWPORT_END_Y, VO_BLT_SRCTRANSPARENCY,NULL );
RestoreExternBackgroundRect ((xResOffset + xResSize - 102 - 1), gsVIEWPORT_END_Y, 102,( INT16 ) ( SCREEN_HEIGHT - gsVIEWPORT_END_Y ) );
INT32 xCoord = (xResOffset + xResSize - 102 - 1);
if (isWidescreenUI())
{
xCoord += 224;
}
BltVideoObject( guiSAVEBUFFER, hHandle, 0, xCoord, gsVIEWPORT_END_Y, VO_BLT_SRCTRANSPARENCY,NULL );
RestoreExternBackgroundRect(xCoord, gsVIEWPORT_END_Y, 102,( INT16 ) ( SCREEN_HEIGHT - gsVIEWPORT_END_Y ) );
for( sCounter = 0; sCounter < NUMBER_OF_SQUADS; sCounter++ )
{