@@ -155,38 +155,37 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
155155#define EAX_MATERIAL_CURTAINLF 0 .15f
156156#define EAX_MATERIAL_CURTAINROOMRATIO 1 .00f
157157
158- #define EAX_NUM_LEGACY_PRESETS 26
159- const char * EAX_LEGACY_PRESET_NAMES [EAX_NUM_LEGACY_PRESETS ] =
160- {
161- " Generic" ,
162- " Padded Cell" ,
163- " Room" ,
164- " Bathroom" ,
165- " Living Room" ,
166- " Stone Room" ,
167- " Auditorium" ,
168- " Concert Hall" ,
169- " Cave" ,
170- " Arena" ,
171- " Hangar" ,
172- " Carpetted Hallway" ,
173- " Hallway" ,
174- " Stone Corridor" ,
175- " Alley" ,
176- " Forest" ,
177- " City" ,
178- " Mountains" ,
179- " Quarry" ,
180- " Plain" ,
181- " Parking Lot" ,
182- " Sewer Pipe" ,
183- " Underwater" ,
184- " Drugged" ,
185- " Dizzy" ,
186- " Psychotic"
158+ // #define EAX_NUM_LEGACY_PRESETS 26
159+ const TCHAR *EAX_LEGACY_PRESET_NAMES [] = {
160+ _T (" Generic" ),
161+ _T (" Padded Cell" ),
162+ _T (" Room" ),
163+ _T (" Bathroom" ),
164+ _T (" Living Room" ),
165+ _T (" Stone Room" ),
166+ _T (" Auditorium" ),
167+ _T (" Concert Hall" ),
168+ _T (" Cave" ),
169+ _T (" Arena" ),
170+ _T (" Hangar" ),
171+ _T (" Carpeted Hallway" ),
172+ _T (" Hallway" ),
173+ _T (" Stone Corridor" ),
174+ _T (" Alley" ),
175+ _T (" Forest" ),
176+ _T (" City" ),
177+ _T (" Mountains" ),
178+ _T (" Quarry" ),
179+ _T (" Plain" ),
180+ _T (" Parking Lot" ),
181+ _T (" Sewer Pipe" ),
182+ _T (" Underwater" ),
183+ _T (" Drugged" ),
184+ _T (" Dizzy" ),
185+ _T (" Psychotic" )
187186};
188187
189- EFXEAXREVERBPROPERTIES EAX_LEGACY_PRESETS [EAX_NUM_LEGACY_PRESETS ] = {
188+ EFXEAXREVERBPROPERTIES EAX_LEGACY_PRESETS [] = {
190189 EFX_REVERB_PRESET_GENERIC ,
191190 EFX_REVERB_PRESET_PADDEDCELL ,
192191 EFX_REVERB_PRESET_ROOM ,
@@ -1689,7 +1688,7 @@ void plBaseSoundEmitterComponent::IGrabEAXParams( plSound *sound, plErrorMsg
16891688{
16901689 sEAXPropsDlgProc .FlushSwappedPBs ();
16911690
1692- plEAXSourceSettings &settings = sound->GetEAXSettings ();
1691+ plEAXSourceSettings &settings = sound->GetEFXSettings ();
16931692
16941693 if ( fCompPB ->GetInt ( (ParamID)kEAXEnabled ) )
16951694 {
@@ -2544,7 +2543,7 @@ bool plBackgroundMusicComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
25442543 }
25452544
25462545 IGrabSoftRegion ( sound, pErrMsg );
2547- sound->GetEAXSettings ().Enable ( false );
2546+ sound->GetEFXSettings ().Enable ( false );
25482547 }
25492548
25502549 return true ;
@@ -2832,8 +2831,8 @@ class plEAXListenerDlgProc : public plSingleCompSelProc
28322831 HWND comboBox = GetDlgItem ( hWnd, IDC_EAX_PRESET_COMBO );
28332832 ComboBox_ResetContent ( comboBox );
28342833
2835- for ( int i = 0 ; i < EAX_NUM_LEGACY_PRESETS ; i++ )
2836- ComboBox_AddString (comboBox, EAX_LEGACY_PRESET_NAMES [i] );
2834+ for ( auto preset_name : EAX_LEGACY_PRESET_NAMES )
2835+ ComboBox_AddString (comboBox, preset_name );
28372836
28382837 ComboBox_SetCurSel ( comboBox, pb->GetInt ( (ParamID)plEAXListenerComponent::kRefPreset ) );
28392838
@@ -2971,55 +2970,52 @@ bool plEAXListenerComponent::Convert(plMaxNode *node, plErrorMsg *errMsg)
29712970 // Set up the parameters of the listener mod
29722971 if (fCompPB ->GetInt ( (ParamID)kRefWhichSettings ) == 0 ) {
29732972 // Set params based on a preset
2974- listener->SetFromEFXPreset (EAX_LEGACY_PRESETS [fCompPB ->GetInt ((ParamID)kRefPreset )]);
2973+ listener->SetFromPreset (EAX_LEGACY_PRESETS [fCompPB ->GetInt ((ParamID)kRefPreset )]);
29752974 } else {
29762975 // Set params based on artist selections
2977- EAXREVERBPROPERTIES * eaxProps = new EAXREVERBPROPERTIES ;
2976+ EAXLISTENERPROPERTIES eaxProps;
29782977
29792978 // Get the raw params
2980- eaxProps-> flEnvironmentSize = fCompPB ->GetFloat ( (ParamID)kRefEnvironmentSize );
2981- eaxProps-> flEnvironmentDiffusion = fCompPB ->GetFloat ( (ParamID)kRefEnvironmentDiffusion );
2982- eaxProps-> lRoom = fCompPB ->GetInt ( (ParamID)kRefRoom );
2983- eaxProps-> lRoomHF = fCompPB ->GetInt ( (ParamID)kRefRoomHF );
2984- eaxProps-> lRoomLF = fCompPB ->GetInt ( (ParamID)kRefRoomLF );
2985- eaxProps-> flDecayTime = fCompPB ->GetFloat ( (ParamID)kRefDecayTime );
2986- eaxProps-> flDecayHFRatio = fCompPB ->GetFloat ( (ParamID)kRefDecayHFRatio );
2987- eaxProps-> flDecayLFRatio = fCompPB ->GetFloat ( (ParamID)kRefDecayLFRatio );
2988- eaxProps-> lReflections = fCompPB ->GetInt ( (ParamID)kRefReflections );
2989- eaxProps-> flReflectionsDelay = fCompPB ->GetFloat ( (ParamID)kRefReflectionsDelay );
2990- // eaxProps->vReflectionsPan; // early reflections panning vector
2991- eaxProps-> lReverb = fCompPB ->GetInt ( (ParamID)kRefReverb ); // late reverberation level relative to room effect
2992- eaxProps-> flReverbDelay = fCompPB ->GetFloat ( (ParamID)kRefReverbDelay );
2993- // eaxProps->vReverbPan; // late reverberation panning vector
2994- eaxProps-> flEchoTime = fCompPB ->GetFloat ( (ParamID)kRefEchoTime );
2995- eaxProps-> flEchoDepth = fCompPB ->GetFloat ( (ParamID)kRefEchoDepth );
2996- eaxProps-> flModulationTime = fCompPB ->GetFloat ( (ParamID)kRefModulationTime );
2997- eaxProps-> flModulationDepth = fCompPB ->GetFloat ( (ParamID)kRefModulationDepth );
2998- eaxProps-> flAirAbsorptionHF = fCompPB ->GetFloat ( (ParamID)kRefAirAbsorptionHF );
2999- eaxProps-> flHFReference = fCompPB ->GetFloat ( (ParamID)kRefHFReference );
3000- eaxProps-> flLFReference = fCompPB ->GetFloat ( (ParamID)kRefLFReference );
3001- eaxProps-> flRoomRolloffFactor = fCompPB ->GetFloat ( (ParamID)kRefRoomRolloffFactor );
3002- eaxProps-> ulFlags = fCompPB ->GetInt ( (ParamID)kRefFlags );
2979+ eaxProps. flEnvironmentSize = fCompPB ->GetFloat ( (ParamID)kRefEnvironmentSize );
2980+ eaxProps. flEnvironmentDiffusion = fCompPB ->GetFloat ( (ParamID)kRefEnvironmentDiffusion );
2981+ eaxProps. lRoom = fCompPB ->GetInt ( (ParamID)kRefRoom );
2982+ eaxProps. lRoomHF = fCompPB ->GetInt ( (ParamID)kRefRoomHF );
2983+ eaxProps. lRoomLF = fCompPB ->GetInt ( (ParamID)kRefRoomLF );
2984+ eaxProps. flDecayTime = fCompPB ->GetFloat ( (ParamID)kRefDecayTime );
2985+ eaxProps. flDecayHFRatio = fCompPB ->GetFloat ( (ParamID)kRefDecayHFRatio );
2986+ eaxProps. flDecayLFRatio = fCompPB ->GetFloat ( (ParamID)kRefDecayLFRatio );
2987+ eaxProps. lReflections = fCompPB ->GetInt ( (ParamID)kRefReflections );
2988+ eaxProps. flReflectionsDelay = fCompPB ->GetFloat ( (ParamID)kRefReflectionsDelay );
2989+ // eaxProps->vReflectionsPan;
2990+ eaxProps. lReverb = fCompPB ->GetInt ( (ParamID)kRefReverb );
2991+ eaxProps. flReverbDelay = fCompPB ->GetFloat ( (ParamID)kRefReverbDelay );
2992+ // eaxProps->vReverbPan;
2993+ eaxProps. flEchoTime = fCompPB ->GetFloat ( (ParamID)kRefEchoTime );
2994+ eaxProps. flEchoDepth = fCompPB ->GetFloat ( (ParamID)kRefEchoDepth );
2995+ eaxProps. flModulationTime = fCompPB ->GetFloat ( (ParamID)kRefModulationTime );
2996+ eaxProps. flModulationDepth = fCompPB ->GetFloat ( (ParamID)kRefModulationDepth );
2997+ eaxProps. flAirAbsorptionHF = fCompPB ->GetFloat ( (ParamID)kRefAirAbsorptionHF );
2998+ eaxProps. flHFReference = fCompPB ->GetFloat ( (ParamID)kRefHFReference );
2999+ eaxProps. flLFReference = fCompPB ->GetFloat ( (ParamID)kRefLFReference );
3000+ eaxProps. flRoomRolloffFactor = fCompPB ->GetFloat ( (ParamID)kRefRoomRolloffFactor );
3001+ eaxProps. ulFlags = fCompPB ->GetInt ( (ParamID)kRefFlags );
30033002
30043003 // Convert to EFX and store them
3005- plEAXListenerMod::ConvertEAXToEFX (eaxProps, listener->GetListenerProps ());
3006- delete eaxProps;
3004+ *(listener->GetListenerProps ()) = *ConvertEAXToEFX (&eaxProps);
30073005 }
30083006
30093007 return true ;
30103008}
30113009
30123010bool plEAXListenerComponent::PreConvert (plMaxNode *pNode, plErrorMsg *errMsg)
30133011{
3014-
30153012 return true ;
30163013}
30173014
30183015// SetupProperties - Internal setup and write-only set properties on the MaxNode. No reading
30193016// of properties on the MaxNode, as it's still indeterminant.
30203017bool plEAXListenerComponent::SetupProperties (plMaxNode *pNode, plErrorMsg *errMsg)
30213018{
3022-
30233019 return true ;
30243020}
30253021
0 commit comments