@@ -533,11 +533,17 @@ static void saveOptions()
533533 // -------------------------------------------------------------------------------------------------
534534 // antialiasing
535535 GadgetComboBoxGetSelectedPos (comboBoxAntiAliasing, &index);
536- if ( index >= 0 && TheGlobalData-> m_antiAliasBoxValue != index )
536+ if ( index >= 0 )
537537 {
538- TheWritableGlobalData->m_antiAliasBoxValue = index;
538+ Int mode = WW3D::MULTISAMPLE_MODE_NONE;
539+
540+ // TheSuperHackers @info We are converting comboBox entry position to MultiSampleModeEnum values
541+ index = clamp ((int )OptionPreferences::AntiAliasingMode_OFF, index, (int )OptionPreferences::AntiAliasingMode_MSAA_8X);
542+ mode = (index > 0 ) ? 1 << index : 0 ;
543+
544+ TheWritableGlobalData->m_antiAliasLevel = mode;
539545 AsciiString prefString;
540- prefString.format (" %d" , index );
546+ prefString.format (" %d" , mode );
541547 (*pref)[" AntiAliasing" ] = prefString;
542548 }
543549
@@ -992,14 +998,6 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )
992998
993999 Color color = GameMakeColor (255 ,255 ,255 ,255 );
9941000
995- enum AliasingMode CPP_11 (: Int)
996- {
997- OFF = 0 ,
998- LOW,
999- HIGH,
1000- NUM_ALIASING_MODES
1001- };
1002-
10031001 initLabelVersion ();
10041002
10051003 // Choose an IP address, then initialize the IP combo box
@@ -1103,18 +1101,32 @@ void OptionsMenuInit( WindowLayout *layout, void *userData )
11031101 GadgetComboBoxReset (comboBoxAntiAliasing);
11041102 AsciiString temp;
11051103 Int i=0 ;
1106- for (; i < NUM_ALIASING_MODES ; ++i)
1104+ for (; i < OptionPreferences::AntiAliasingMode_Count ; ++i)
11071105 {
11081106 temp.format (" GUI:AntiAliasing%d" , i);
11091107 str = TheGameText->fetch ( temp );
11101108 index = GadgetComboBoxAddEntry (comboBoxAntiAliasing, str, color);
11111109 }
11121110 Int val = atoi (selectedAliasingMode.str ());
1113- if ( val < 0 || val > NUM_ALIASING_MODES )
1111+ Int pos = 0 ;
1112+
1113+ // TheSuperHackers @info We are converting from human readable value to comboBox entry position
1114+ val = highestBit (val);
1115+
1116+ if (val == WW3D::MULTISAMPLE_MODE_NONE)
1117+ pos = OptionPreferences::AntiAliasingMode_OFF;
1118+ else if (val == WW3D::MULTISAMPLE_MODE_2X)
1119+ pos = OptionPreferences::AntiAliasingMode_MSAA_2X;
1120+ else if (val == WW3D::MULTISAMPLE_MODE_4X)
1121+ pos = OptionPreferences::AntiAliasingMode_MSAA_4X;
1122+ else if (val == WW3D::MULTISAMPLE_MODE_8X)
1123+ pos = OptionPreferences::AntiAliasingMode_MSAA_8X;
1124+
1125+ if (val < 0 || val > WW3D::MULTISAMPLE_MODE_8X)
11141126 {
1115- TheWritableGlobalData->m_antiAliasBoxValue = val = 0 ;
1127+ TheWritableGlobalData->m_antiAliasLevel = pos = 0 ;
11161128 }
1117- GadgetComboBoxSetSelectedPos (comboBoxAntiAliasing, val );
1129+ GadgetComboBoxSetSelectedPos (comboBoxAntiAliasing, pos );
11181130
11191131 // get resolution from saved preferences file
11201132 AsciiString selectedResolution = (*pref) [" Resolution" ];
0 commit comments