@@ -186,6 +186,7 @@ struct enum_wrapper {
186
186
TYPE * Random##TYPE(std::string group) { return Random##TYPE (group, " All" ); }
187
187
188
188
// These are expanded by the preprocessor to all the different cloning function definitions.
189
+ LUAENTITYCREATE (SoundContainer)
189
190
LUAENTITYCREATE (Attachable)
190
191
LUAENTITYCREATE (AEmitter)
191
192
LUAENTITYCREATE (Turret)
@@ -229,6 +230,7 @@ LUAENTITYCREATE(PEmitter)
229
230
230
231
// These are expanded by the preprocessor to all the different cloning function definitions.
231
232
LUAENTITYCLONE (Entity)
233
+ LUAENTITYCLONE (SoundContainer)
232
234
LUAENTITYCLONE (SceneObject)
233
235
LUAENTITYCLONE (MovableObject)
234
236
LUAENTITYCLONE (Attachable)
@@ -287,9 +289,10 @@ void DeleteEntity(Entity *pEntity)
287
289
bool Is##TYPE(Entity *pEntity) { return dynamic_cast <TYPE *>(pEntity) ? true : false ; }
288
290
289
291
// These are expanded by the preprocessor to all the different casting function definitions named: To[Type]()
292
+ LUAENTITYCAST (Entity)
293
+ LUAENTITYCAST (SoundContainer)
290
294
LUAENTITYCAST (SceneObject)
291
295
LUAENTITYCAST (MovableObject)
292
- LUAENTITYCAST (Entity)
293
296
LUAENTITYCAST (Attachable)
294
297
LUAENTITYCAST (Arm)
295
298
LUAENTITYCAST (Leg)
@@ -569,23 +572,28 @@ int LuaMan::Create() {
569
572
.def (" AddToGroup" , &Entity::AddToGroup)
570
573
.def (" IsInGroup" , (bool (Entity::*)(const string &))&Entity::IsInGroup),
571
574
572
- class_<SoundContainer>( " SoundContainer" )
575
+ CONCRETELUABINDING ( SoundContainer, Entity )
573
576
.def (constructor<>())
577
+ .property (" Immobile" , &SoundContainer::IsImmobile, &SoundContainer::SetImmobile)
578
+ .property (" AttenuationStartDistance" , &SoundContainer::GetAttenuationStartDistance, &SoundContainer::SetAttenuationStartDistance)
579
+ .property (" Loops" , &SoundContainer::GetLoopSetting, &SoundContainer::SetLoopSetting)
580
+ .property (" Priority" , &SoundContainer::GetPriority, &SoundContainer::SetPriority)
581
+ .property (" AffectedByGlobalPitch" , &SoundContainer::IsAffectedByGlobalPitch, &SoundContainer::SetAffectedByGlobalPitch)
582
+ .property (" Pos" , &SoundContainer::GetPosition, &SoundContainer::SetPosition)
583
+ .property (" Volume" , &SoundContainer::GetVolume, &SoundContainer::SetVolume)
584
+ .property (" Pitch" , &SoundContainer::GetPitch, &SoundContainer::SetPitch)
574
585
.def (" HasAnySounds" , &SoundContainer::HasAnySounds)
575
586
.def (" IsBeingPlayed" , &SoundContainer::IsBeingPlayed)
576
587
.def (" Play" , (bool (SoundContainer:: *)()) &SoundContainer::Play)
588
+ .def (" Play" , (bool (SoundContainer:: *)(const int player)) &SoundContainer::Play)
577
589
.def (" Play" , (bool (SoundContainer:: *)(const Vector &position)) &SoundContainer::Play)
578
590
.def (" Play" , (bool (SoundContainer:: *)(const Vector &position, int player)) &SoundContainer::Play)
579
591
.def (" Stop" , (bool (SoundContainer:: *)()) &SoundContainer::Stop)
580
592
.def (" Stop" , (bool (SoundContainer:: *)(int player)) &SoundContainer::Stop)
581
593
.def (" AddSound" , (void (SoundContainer:: *)(std::string const &soundFilePath)) &SoundContainer::AddSound)
582
594
.def (" AddSound" , (void (SoundContainer:: *)(std::string const &soundFilePath, const Vector &offset, float attenuationStartDistance, bool abortGameForInvalidSound)) &SoundContainer::AddSound)
583
595
.def (" AddSound" , (void (SoundContainer:: *)(std::string const &soundFilePath, unsigned int soundSetIndex, const Vector &offset, float minimumAudibleDistance, float attenuationStartDistance, bool abortGameForInvalidSound)) &SoundContainer::AddSound)
584
- .def (" SetPosition" , &SoundContainer::SetPosition)
585
- .def (" SelectNextSoundSet" , &SoundContainer::SelectNextSoundSet)
586
- .property (" Loops" , &SoundContainer::GetLoopSetting, &SoundContainer::SetLoopSetting)
587
- .property (" Priority" , &SoundContainer::GetPriority, &SoundContainer::SetPriority)
588
- .property (" AffectedByGlobalPitch" , &SoundContainer::IsAffectedByGlobalPitch, &SoundContainer::SetAffectedByGlobalPitch),
596
+ .def (" SelectNextSoundSet" , &SoundContainer::SelectNextSoundSet),
589
597
590
598
ABSTRACTLUABINDING (SceneObject, Entity)
591
599
.property (" Pos" , &SceneObject::GetPos, &SceneObject::SetPos)
@@ -1515,19 +1523,16 @@ int LuaMan::Create() {
1515
1523
.def (" SetMusicPosition" , &AudioMan::SetMusicPosition)
1516
1524
.def (" SetMusicPitch" , &AudioMan::SetMusicPitch)
1517
1525
.property (" SoundsVolume" , &AudioMan::GetSoundsVolume, &AudioMan::SetSoundsVolume)
1518
- .def (" SetSoundPosition" , &AudioMan::SetSoundPosition)
1519
- .def (" SetSoundPitch" , &AudioMan::SetSoundPitch)
1520
1526
.def (" StopAll" , &AudioMan::StopMusic)
1521
1527
.def (" PlayMusic" , &AudioMan::PlayMusic)
1522
1528
.def (" PlayNextStream" , &AudioMan::PlayNextStream)
1523
1529
.def (" StopMusic" , &AudioMan::StopMusic)
1524
1530
.def (" QueueMusicStream" , &AudioMan::QueueMusicStream)
1525
1531
.def (" QueueSilence" , &AudioMan::QueueSilence)
1526
1532
.def (" ClearMusicQueue" , &AudioMan::ClearMusicQueue)
1527
- .def (" PlaySound" , (SoundContainer *(AudioMan:: *)(const char *filePath)) &AudioMan::PlaySound)
1528
- .def (" PlaySound" , (SoundContainer *(AudioMan:: *)(const char *filePath, const Vector &position)) &AudioMan::PlaySound)
1529
- .def (" PlaySound" , (SoundContainer *(AudioMan:: *)(const char *filePath, const Vector &position, int player)) &AudioMan::PlaySound)
1530
- .def (" PlaySound" , (SoundContainer *(AudioMan:: *)(const char *filePath, const Vector &position, int player, int loops, int priority, double pitchOrAffectedByGlobalPitch, float attenuationStartDistance, bool immobile)) &AudioMan::PlaySound)
1533
+ .def (" PlaySound" , (SoundContainer *(AudioMan:: *)(const std::string &filePath)) &AudioMan::PlaySound, adopt (result))
1534
+ .def (" PlaySound" , (SoundContainer *(AudioMan:: *)(const std::string &filePath, const Vector &position)) &AudioMan::PlaySound, adopt (result))
1535
+ .def (" PlaySound" , (SoundContainer *(AudioMan:: *)(const std::string &filePath, const Vector &position, int player)) &AudioMan::PlaySound, adopt (result))
1531
1536
.def (" StopSound" , (bool (AudioMan:: *)(SoundContainer *soundContainer)) &AudioMan::StopSound)
1532
1537
.def (" StopSound" , (bool (AudioMan:: *)(SoundContainer *soundContainer, int player)) &AudioMan::StopSound)
1533
1538
.def (" FadeOutSound" , &AudioMan::FadeOutSound),
0 commit comments