RigsofRods
Soft-body Physics Simulation
SoundScriptAngelscript.cpp
Go to the documentation of this file.
1 /*
2  This source file is part of Rigs of Rods
3  Copyright 2023 Petr Ohlidal
4 
5  For more information, see http://www.rigsofrods.org/
6 
7  Rigs of Rods is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License version 3, as
9  published by the Free Software Foundation.
10 
11  Rigs of Rods is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
22 
23 #include "ScriptEngine.h"
24 #include "Sound.h"
25 #include "SoundScriptManager.h"
26 
27 using namespace RoR;
28 using namespace AngelScript;
29 
30 void RoR::RegisterSoundScript(AngelScript::asIScriptEngine* engine)
31 {
32  int result = 0;
33 
34  // enum SoundTriggers
35  result = engine->RegisterEnum("SoundTriggers"); ROR_ASSERT(result >= 0);
36  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_NONE", SS_TRIG_NONE); ROR_ASSERT(result >= 0);
37  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_ENGINE", SS_TRIG_ENGINE); ROR_ASSERT(result >= 0);
38  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AEROENGINE1", SS_TRIG_AEROENGINE1); ROR_ASSERT(result >= 0);
39  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AEROENGINE2", SS_TRIG_AEROENGINE2); ROR_ASSERT(result >= 0);
40  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AEROENGINE3", SS_TRIG_AEROENGINE3); ROR_ASSERT(result >= 0);
41  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AEROENGINE4", SS_TRIG_AEROENGINE4); ROR_ASSERT(result >= 0);
42  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_HORN", SS_TRIG_HORN); ROR_ASSERT(result >= 0);
43  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_BRAKE", SS_TRIG_BRAKE); ROR_ASSERT(result >= 0);
44  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_PUMP", SS_TRIG_PUMP); ROR_ASSERT(result >= 0);
45  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_STARTER", SS_TRIG_STARTER); ROR_ASSERT(result >= 0);
46  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_TURBOBOV", SS_TRIG_TURBOBOV); ROR_ASSERT(result >= 0);
47  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_TURBOWASTEGATE", SS_TRIG_TURBOWASTEGATE); ROR_ASSERT(result >= 0);
48  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_TURBOBACKFIRE", SS_TRIG_TURBOBACKFIRE); ROR_ASSERT(result >= 0);
49  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_ALWAYSON", SS_TRIG_ALWAYSON); ROR_ASSERT(result >= 0);
50  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_REPAIR", SS_TRIG_REPAIR); ROR_ASSERT(result >= 0);
51  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AIR", SS_TRIG_AIR); ROR_ASSERT(result >= 0);
52  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_GPWS_APDISCONNECT", SS_TRIG_GPWS_APDISCONNECT); ROR_ASSERT(result >= 0);
53  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_GPWS_10", SS_TRIG_GPWS_10); ROR_ASSERT(result >= 0);
54  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_GPWS_20", SS_TRIG_GPWS_20); ROR_ASSERT(result >= 0);
55  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_GPWS_30", SS_TRIG_GPWS_30); ROR_ASSERT(result >= 0);
56  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_GPWS_40", SS_TRIG_GPWS_40); ROR_ASSERT(result >= 0);
57  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_GPWS_50", SS_TRIG_GPWS_50); ROR_ASSERT(result >= 0);
58  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_GPWS_100", SS_TRIG_GPWS_100); ROR_ASSERT(result >= 0);
59  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_GPWS_PULLUP", SS_TRIG_GPWS_PULLUP); ROR_ASSERT(result >= 0);
60  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_GPWS_MINIMUMS", SS_TRIG_GPWS_MINIMUMS); ROR_ASSERT(result >= 0);
61  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AIR_PURGE", SS_TRIG_AIR_PURGE); ROR_ASSERT(result >= 0);
62  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_SHIFT", SS_TRIG_SHIFT); ROR_ASSERT(result >= 0);
63  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_GEARSLIDE", SS_TRIG_GEARSLIDE); ROR_ASSERT(result >= 0);
64  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_CREAK", SS_TRIG_CREAK); ROR_ASSERT(result >= 0);
65  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_BREAK", SS_TRIG_BREAK); ROR_ASSERT(result >= 0);
66  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_SCREETCH", SS_TRIG_SCREETCH); ROR_ASSERT(result >= 0);
67  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_PARK", SS_TRIG_PARK); ROR_ASSERT(result >= 0);
68  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AFTERBURNER1", SS_TRIG_AFTERBURNER1); ROR_ASSERT(result >= 0);
69  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AFTERBURNER2", SS_TRIG_AFTERBURNER2); ROR_ASSERT(result >= 0);
70  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AFTERBURNER3", SS_TRIG_AFTERBURNER3); ROR_ASSERT(result >= 0);
71  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AFTERBURNER4", SS_TRIG_AFTERBURNER4); ROR_ASSERT(result >= 0);
72  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AFTERBURNER5", SS_TRIG_AFTERBURNER5); ROR_ASSERT(result >= 0);
73  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AFTERBURNER6", SS_TRIG_AFTERBURNER6); ROR_ASSERT(result >= 0);
74  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AFTERBURNER7", SS_TRIG_AFTERBURNER7); ROR_ASSERT(result >= 0);
75  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AFTERBURNER8", SS_TRIG_AFTERBURNER8); ROR_ASSERT(result >= 0);
76  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AEROENGINE5", SS_TRIG_AEROENGINE5); ROR_ASSERT(result >= 0);
77  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AEROENGINE6", SS_TRIG_AEROENGINE6); ROR_ASSERT(result >= 0);
78  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AEROENGINE7", SS_TRIG_AEROENGINE7); ROR_ASSERT(result >= 0);
79  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AEROENGINE8", SS_TRIG_AEROENGINE8); ROR_ASSERT(result >= 0);
80  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AOA", SS_TRIG_AOA); ROR_ASSERT(result >= 0);
81  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_IGNITION", SS_TRIG_IGNITION); ROR_ASSERT(result >= 0);
82  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_REVERSE_GEAR", SS_TRIG_REVERSE_GEAR); ROR_ASSERT(result >= 0);
83  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_TURN_SIGNAL", SS_TRIG_TURN_SIGNAL); ROR_ASSERT(result >= 0);
84  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_TURN_SIGNAL_TICK", SS_TRIG_TURN_SIGNAL_TICK); ROR_ASSERT(result >= 0);
85  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_TURN_SIGNAL_WARN_TICK", SS_TRIG_TURN_SIGNAL_WARN_TICK); ROR_ASSERT(result >= 0);
86  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_ALB_ACTIVE", SS_TRIG_ALB_ACTIVE); ROR_ASSERT(result >= 0);
87  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_TC_ACTIVE", SS_TRIG_TC_ACTIVE); ROR_ASSERT(result >= 0);
88  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AVICHAT01", SS_TRIG_AVICHAT01); ROR_ASSERT(result >= 0);
89  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AVICHAT02", SS_TRIG_AVICHAT02); ROR_ASSERT(result >= 0);
90  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AVICHAT03", SS_TRIG_AVICHAT03); ROR_ASSERT(result >= 0);
91  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AVICHAT04", SS_TRIG_AVICHAT04); ROR_ASSERT(result >= 0);
92  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AVICHAT05", SS_TRIG_AVICHAT05); ROR_ASSERT(result >= 0);
93  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AVICHAT06", SS_TRIG_AVICHAT06); ROR_ASSERT(result >= 0);
94  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AVICHAT07", SS_TRIG_AVICHAT07); ROR_ASSERT(result >= 0);
95  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AVICHAT08", SS_TRIG_AVICHAT08); ROR_ASSERT(result >= 0);
96  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AVICHAT09", SS_TRIG_AVICHAT09); ROR_ASSERT(result >= 0);
97  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AVICHAT10", SS_TRIG_AVICHAT10); ROR_ASSERT(result >= 0);
98  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AVICHAT11", SS_TRIG_AVICHAT11); ROR_ASSERT(result >= 0);
99  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AVICHAT12", SS_TRIG_AVICHAT12); ROR_ASSERT(result >= 0);
100  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_AVICHAT13", SS_TRIG_AVICHAT13); ROR_ASSERT(result >= 0);
101  result = engine->RegisterEnumValue("SoundTriggers", "SS_TRIG_LINKED_COMMAND", SS_TRIG_LINKED_COMMAND); ROR_ASSERT(result >= 0);
102 
103  // enum ModulationSources
104  result = engine->RegisterEnum("ModulationSources"); ROR_ASSERT(result >= 0);
105  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_NONE", SS_MOD_NONE); ROR_ASSERT(result >= 0);
106  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_ENGINE", SS_MOD_ENGINE); ROR_ASSERT(result >= 0);
107  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_TURBO", SS_MOD_TURBO); ROR_ASSERT(result >= 0);
108  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_AEROENGINE1", SS_MOD_AEROENGINE1); ROR_ASSERT(result >= 0);
109  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_AEROENGINE2", SS_MOD_AEROENGINE2); ROR_ASSERT(result >= 0);
110  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_AEROENGINE3", SS_MOD_AEROENGINE3); ROR_ASSERT(result >= 0);
111  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_AEROENGINE4", SS_MOD_AEROENGINE4); ROR_ASSERT(result >= 0);
112  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_WHEELSPEED", SS_MOD_WHEELSPEED); ROR_ASSERT(result >= 0);
113  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_INJECTOR", SS_MOD_INJECTOR); ROR_ASSERT(result >= 0);
114  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_TORQUE", SS_MOD_TORQUE); ROR_ASSERT(result >= 0);
115  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_GEARBOX", SS_MOD_GEARBOX); ROR_ASSERT(result >= 0);
116  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_CREAK", SS_MOD_CREAK); ROR_ASSERT(result >= 0);
117  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_BREAK", SS_MOD_BREAK); ROR_ASSERT(result >= 0);
118  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_SCREETCH", SS_MOD_SCREETCH); ROR_ASSERT(result >= 0);
119  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_PUMP", SS_MOD_PUMP); ROR_ASSERT(result >= 0);
120  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_THROTTLE1", SS_MOD_THROTTLE1); ROR_ASSERT(result >= 0);
121  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_THROTTLE2", SS_MOD_THROTTLE2); ROR_ASSERT(result >= 0);
122  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_THROTTLE3", SS_MOD_THROTTLE3); ROR_ASSERT(result >= 0);
123  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_THROTTLE4", SS_MOD_THROTTLE4); ROR_ASSERT(result >= 0);
124  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_THROTTLE5", SS_MOD_THROTTLE5); ROR_ASSERT(result >= 0);
125  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_THROTTLE6", SS_MOD_THROTTLE6); ROR_ASSERT(result >= 0);
126  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_THROTTLE7", SS_MOD_THROTTLE7); ROR_ASSERT(result >= 0);
127  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_THROTTLE8", SS_MOD_THROTTLE8); ROR_ASSERT(result >= 0);
128  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_AEROENGINE5", SS_MOD_AEROENGINE5); ROR_ASSERT(result >= 0);
129  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_AEROENGINE6", SS_MOD_AEROENGINE6); ROR_ASSERT(result >= 0);
130  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_AEROENGINE7", SS_MOD_AEROENGINE7); ROR_ASSERT(result >= 0);
131  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_AEROENGINE8", SS_MOD_AEROENGINE8); ROR_ASSERT(result >= 0);
132  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_AIRSPEED", SS_MOD_AIRSPEED); ROR_ASSERT(result >= 0);
133  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_AOA", SS_MOD_AOA); ROR_ASSERT(result >= 0);
134  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_LINKED_COMMANDRATE", SS_MOD_LINKED_COMMANDRATE); ROR_ASSERT(result >= 0);
135  result = engine->RegisterEnumValue("ModulationSources", "SS_MOD_MUSIC_VOLUME", SS_MOD_MUSIC_VOLUME); ROR_ASSERT(result >= 0);
136 
137  // class SoundScriptTemplate
138  SoundScriptTemplate::RegisterRefCountingObject(engine, "SoundScriptTemplateClass");
139  SoundScriptTemplatePtr::RegisterRefCountingObjectPtr(engine, "SoundScriptTemplateClassPtr", "SoundScriptTemplateClass");
140 
141  result = engine->RegisterObjectMethod("SoundScriptTemplateClass", "int getNumSounds()", asMETHOD(SoundScriptTemplate, getNumSounds), asCALL_THISCALL); ROR_ASSERT(result >= 0);
142  result = engine->RegisterObjectMethod("SoundScriptTemplateClass", "string getSoundName(int)", asMETHOD(SoundScriptTemplate, getSoundName), asCALL_THISCALL); ROR_ASSERT(result >= 0);
143  result = engine->RegisterObjectMethod("SoundScriptTemplateClass", "float getSoundPitch(int)", asMETHOD(SoundScriptTemplate, getSoundPitch), asCALL_THISCALL); ROR_ASSERT(result >= 0);
144 
145  result = engine->RegisterObjectMethod("SoundScriptTemplateClass", "string getStartSoundName()", asMETHOD(SoundScriptTemplate, getStartSoundName), asCALL_THISCALL); ROR_ASSERT(result >= 0);
146  result = engine->RegisterObjectMethod("SoundScriptTemplateClass", "float getStartSoundPitch()", asMETHOD(SoundScriptTemplate, getStartSoundPitch), asCALL_THISCALL); ROR_ASSERT(result >= 0);
147  result = engine->RegisterObjectMethod("SoundScriptTemplateClass", "string getStopSoundName()", asMETHOD(SoundScriptTemplate, getStopSoundName), asCALL_THISCALL); ROR_ASSERT(result >= 0);
148  result = engine->RegisterObjectMethod("SoundScriptTemplateClass", "float getStopSoundPitch()", asMETHOD(SoundScriptTemplate, getStopSoundPitch), asCALL_THISCALL); ROR_ASSERT(result >= 0);
149 
150  result = engine->RegisterObjectMethod("SoundScriptTemplateClass", "string getName()", asMETHOD(SoundScriptTemplate, getName), asCALL_THISCALL); ROR_ASSERT(result >= 0);
151  result = engine->RegisterObjectMethod("SoundScriptTemplateClass", "string getFileName()", asMETHOD(SoundScriptTemplate, getFileName), asCALL_THISCALL); ROR_ASSERT(result >= 0);
152  result = engine->RegisterObjectMethod("SoundScriptTemplateClass", "string getGroupName()", asMETHOD(SoundScriptTemplate, getGroupName), asCALL_THISCALL); ROR_ASSERT(result >= 0);
153  result = engine->RegisterObjectMethod("SoundScriptTemplateClass", "bool isBaseTemplate()", asMETHOD(SoundScriptTemplate, isBaseTemplate), asCALL_THISCALL); ROR_ASSERT(result >= 0);
154 
155  // class Sound
156  Sound::RegisterRefCountingObject(engine, "SoundClass");
157  SoundPtr::RegisterRefCountingObjectPtr(engine, "SoundClassPtr", "SoundClass");
158 
159  result = engine->RegisterObjectMethod("SoundClass", "void setPitch(float pitch)", asMETHOD(Sound, setPitch), asCALL_THISCALL); ROR_ASSERT(result >= 0);
160  result = engine->RegisterObjectMethod("SoundClass", "void setGain(float gain)", asMETHOD(Sound, setGain), asCALL_THISCALL); ROR_ASSERT(result >= 0);
161  result = engine->RegisterObjectMethod("SoundClass", "void setPosition(vector3 pos)", asMETHOD(Sound, setPosition), asCALL_THISCALL); ROR_ASSERT(result >= 0);
162  result = engine->RegisterObjectMethod("SoundClass", "void setVelocity(vector3 vel)", asMETHOD(Sound, setVelocity), asCALL_THISCALL); ROR_ASSERT(result >= 0);
163  result = engine->RegisterObjectMethod("SoundClass", "void setLoop(bool loop)", asMETHOD(Sound, setLoop), asCALL_THISCALL); ROR_ASSERT(result >= 0);
164  result = engine->RegisterObjectMethod("SoundClass", "void setEnabled(bool e)", asMETHOD(Sound, setEnabled), asCALL_THISCALL); ROR_ASSERT(result >= 0);
165  result = engine->RegisterObjectMethod("SoundClass", "void play()", asMETHOD(Sound, play), asCALL_THISCALL); ROR_ASSERT(result >= 0);
166  result = engine->RegisterObjectMethod("SoundClass", "void stop()", asMETHOD(Sound, stop), asCALL_THISCALL); ROR_ASSERT(result >= 0);
167 
168  result = engine->RegisterObjectMethod("SoundClass", "bool getEnabled()", asMETHOD(Sound, getEnabled), asCALL_THISCALL); ROR_ASSERT(result >= 0);
169  result = engine->RegisterObjectMethod("SoundClass", "bool isPlaying()", asMETHOD(Sound, isPlaying), asCALL_THISCALL); ROR_ASSERT(result >= 0);
170  result = engine->RegisterObjectMethod("SoundClass", "float getAudibility() ", asMETHOD(Sound, getAudibility), asCALL_THISCALL); ROR_ASSERT(result >= 0);
171  result = engine->RegisterObjectMethod("SoundClass", "float getGain() ", asMETHOD(Sound, getGain), asCALL_THISCALL); ROR_ASSERT(result >= 0);
172  result = engine->RegisterObjectMethod("SoundClass", "float getPitch() ", asMETHOD(Sound, getPitch), asCALL_THISCALL); ROR_ASSERT(result >= 0);
173  result = engine->RegisterObjectMethod("SoundClass", "bool getLoop()", asMETHOD(Sound, getLoop), asCALL_THISCALL); ROR_ASSERT(result >= 0);
174  result = engine->RegisterObjectMethod("SoundClass", "int getCurrentHardwareIndex()", asMETHOD(Sound, getCurrentHardwareIndex), asCALL_THISCALL); ROR_ASSERT(result >= 0);
175  result = engine->RegisterObjectMethod("SoundClass", "uint getBuffer()", asMETHOD(Sound, getBuffer), asCALL_THISCALL); ROR_ASSERT(result >= 0);
176  result = engine->RegisterObjectMethod("SoundClass", "vector3 getPosition()", asMETHOD(Sound, getPosition), asCALL_THISCALL); ROR_ASSERT(result >= 0);
177  result = engine->RegisterObjectMethod("SoundClass", "vector3 getVelocity()", asMETHOD(Sound, getVelocity), asCALL_THISCALL); ROR_ASSERT(result >= 0);
178  result = engine->RegisterObjectMethod("SoundClass", "int getSourceIndex()", asMETHOD(Sound, getSourceIndex), asCALL_THISCALL); ROR_ASSERT(result >= 0);
179 
180  // class SoundScriptInstance
181  SoundScriptInstance::RegisterRefCountingObject(engine, "SoundScriptInstanceClass");
182  SoundScriptInstancePtr::RegisterRefCountingObjectPtr(engine, "SoundScriptInstanceClassPtr", "SoundScriptInstanceClass");
183 
184  result = engine->RegisterObjectMethod("SoundScriptInstanceClass", "void runOnce()", asMETHOD(SoundScriptInstance, runOnce), asCALL_THISCALL); ROR_ASSERT(result >= 0);
185  result = engine->RegisterObjectMethod("SoundScriptInstanceClass", "void setPitch(float pitch)", asMETHOD(SoundScriptInstance, setPitch), asCALL_THISCALL); ROR_ASSERT(result >= 0);
186  result = engine->RegisterObjectMethod("SoundScriptInstanceClass", "void setGain(float gain)", asMETHOD(SoundScriptInstance, setGain), asCALL_THISCALL); ROR_ASSERT(result >= 0);
187  result = engine->RegisterObjectMethod("SoundScriptInstanceClass", "void setPosition(vector3 pos)", asMETHOD(SoundScriptInstance, setPosition), asCALL_THISCALL); ROR_ASSERT(result >= 0);
188  result = engine->RegisterObjectMethod("SoundScriptInstanceClass", "void setVelocity(vector3 velo)", asMETHOD(SoundScriptInstance, setVelocity), asCALL_THISCALL); ROR_ASSERT(result >= 0);
189  result = engine->RegisterObjectMethod("SoundScriptInstanceClass", "void start()", asMETHOD(SoundScriptInstance, start), asCALL_THISCALL); ROR_ASSERT(result >= 0);
190  result = engine->RegisterObjectMethod("SoundScriptInstanceClass", "void stop()", asMETHOD(SoundScriptInstance, stop), asCALL_THISCALL); ROR_ASSERT(result >= 0);
191  result = engine->RegisterObjectMethod("SoundScriptInstanceClass", "void kill()", asMETHOD(SoundScriptInstance, kill), asCALL_THISCALL); ROR_ASSERT(result >= 0);
192 
193  result = engine->RegisterObjectMethod("SoundScriptInstanceClass", "SoundScriptTemplateClassPtr@ getTemplate()", asMETHOD(SoundScriptInstance, getTemplate), asCALL_THISCALL); ROR_ASSERT(result >= 0);
194  result = engine->RegisterObjectMethod("SoundScriptInstanceClass", "SoundClassPtr@ getStartSound()", asMETHOD(SoundScriptInstance, getStartSound), asCALL_THISCALL); ROR_ASSERT(result >= 0);
195  result = engine->RegisterObjectMethod("SoundScriptInstanceClass", "SoundClassPtr@ getStopSound()", asMETHOD(SoundScriptInstance, getStopSound), asCALL_THISCALL); ROR_ASSERT(result >= 0);
196  result = engine->RegisterObjectMethod("SoundScriptInstanceClass", "SoundClassPtr@ getSound(int pos)", asMETHOD(SoundScriptInstance, getSound), asCALL_THISCALL); ROR_ASSERT(result >= 0);
197  result = engine->RegisterObjectMethod("SoundScriptInstanceClass", "float getStartSoundPitchgain()", asMETHOD(SoundScriptInstance, getStartSoundPitchgain), asCALL_THISCALL); ROR_ASSERT(result >= 0);
198  result = engine->RegisterObjectMethod("SoundScriptInstanceClass", "float getStopSoundPitchgain()", asMETHOD(SoundScriptInstance, getStopSoundPitchgain), asCALL_THISCALL); ROR_ASSERT(result >= 0);
199  result = engine->RegisterObjectMethod("SoundScriptInstanceClass", "float getSoundPitchgain(int pos)", asMETHOD(SoundScriptInstance, getSoundPitchgain), asCALL_THISCALL); ROR_ASSERT(result >= 0);
200  result = engine->RegisterObjectMethod("SoundScriptInstanceClass", "int getActorInstanceId()", asMETHOD(SoundScriptInstance, getActorInstanceId), asCALL_THISCALL); ROR_ASSERT(result >= 0);
201  result = engine->RegisterObjectMethod("SoundScriptInstanceClass", "const string& getInstanceName()", asMETHOD(SoundScriptInstance, getInstanceName), asCALL_THISCALL); ROR_ASSERT(result >= 0);
202 
203 }
RoR::SS_TRIG_AVICHAT09
@ SS_TRIG_AVICHAT09
Definition: SoundScriptManager.h:113
RoR::SS_TRIG_GPWS_40
@ SS_TRIG_GPWS_40
Definition: SoundScriptManager.h:73
ROR_ASSERT
#define ROR_ASSERT(_EXPR)
Definition: Application.h:40
RoR::SS_MOD_THROTTLE7
@ SS_MOD_THROTTLE7
Definition: SoundScriptManager.h:145
RoR::SS_TRIG_GPWS_APDISCONNECT
@ SS_TRIG_GPWS_APDISCONNECT
Definition: SoundScriptManager.h:69
RoR::SS_TRIG_AVICHAT06
@ SS_TRIG_AVICHAT06
Definition: SoundScriptManager.h:110
Sound.h
RoR::SS_TRIG_CREAK
@ SS_TRIG_CREAK
Definition: SoundScriptManager.h:81
RoR::SS_TRIG_AEROENGINE8
@ SS_TRIG_AEROENGINE8
Definition: SoundScriptManager.h:96
RoR::SS_MOD_THROTTLE6
@ SS_MOD_THROTTLE6
Definition: SoundScriptManager.h:144
RoR::SS_TRIG_AVICHAT04
@ SS_TRIG_AVICHAT04
Definition: SoundScriptManager.h:108
RoR::SS_MOD_AEROENGINE1
@ SS_MOD_AEROENGINE1
Definition: SoundScriptManager.h:127
RefCountingObjectPtr< SoundScriptTemplate >::RegisterRefCountingObjectPtr
static void RegisterRefCountingObjectPtr(AS_NAMESPACE_QUALIFIER asIScriptEngine *engine, const char *handle_name, const char *obj_name)
Definition: RefCountingObjectPtr.h:84
RoR::SS_TRIG_AFTERBURNER6
@ SS_TRIG_AFTERBURNER6
Definition: SoundScriptManager.h:90
RoR::SS_TRIG_TURN_SIGNAL_TICK
@ SS_TRIG_TURN_SIGNAL_TICK
Definition: SoundScriptManager.h:101
RoR::SS_MOD_AEROENGINE5
@ SS_MOD_AEROENGINE5
Definition: SoundScriptManager.h:147
RoR::SS_TRIG_ALB_ACTIVE
@ SS_TRIG_ALB_ACTIVE
Definition: SoundScriptManager.h:103
RoR::SS_TRIG_AEROENGINE2
@ SS_TRIG_AEROENGINE2
Definition: SoundScriptManager.h:56
RoR::SS_TRIG_AEROENGINE6
@ SS_TRIG_AEROENGINE6
Definition: SoundScriptManager.h:94
RoR::SS_TRIG_ENGINE
@ SS_TRIG_ENGINE
Definition: SoundScriptManager.h:54
RoR::SoundScriptTemplate
Definition: SoundScriptManager.h:176
RoR::SS_TRIG_GPWS_MINIMUMS
@ SS_TRIG_GPWS_MINIMUMS
Definition: SoundScriptManager.h:77
RoR::SS_TRIG_BRAKE
@ SS_TRIG_BRAKE
Definition: SoundScriptManager.h:60
RoR::SS_TRIG_AFTERBURNER5
@ SS_TRIG_AFTERBURNER5
Definition: SoundScriptManager.h:89
RoR::SS_TRIG_TURBOBACKFIRE
@ SS_TRIG_TURBOBACKFIRE
Definition: SoundScriptManager.h:65
RoR::Sound
Definition: Sound.h:39
RoR::SS_TRIG_AFTERBURNER2
@ SS_TRIG_AFTERBURNER2
Definition: SoundScriptManager.h:86
RefCountingObject< SoundScriptTemplate >::RegisterRefCountingObject
static void RegisterRefCountingObject(AS_NAMESPACE_QUALIFIER asIScriptEngine *engine, const char *name)
Definition: RefCountingObject.h:65
RoR::SS_TRIG_AVICHAT03
@ SS_TRIG_AVICHAT03
Definition: SoundScriptManager.h:107
RoR::SS_MOD_PUMP
@ SS_MOD_PUMP
Definition: SoundScriptManager.h:138
RoR::SS_TRIG_TURBOWASTEGATE
@ SS_TRIG_TURBOWASTEGATE
Definition: SoundScriptManager.h:64
RoR::SS_MOD_AEROENGINE4
@ SS_MOD_AEROENGINE4
Definition: SoundScriptManager.h:130
RoR::SS_TRIG_AEROENGINE3
@ SS_TRIG_AEROENGINE3
Definition: SoundScriptManager.h:57
RoR::SS_TRIG_TC_ACTIVE
@ SS_TRIG_TC_ACTIVE
Definition: SoundScriptManager.h:104
RoR::SS_MOD_AEROENGINE8
@ SS_MOD_AEROENGINE8
Definition: SoundScriptManager.h:150
RoR::SS_TRIG_GPWS_PULLUP
@ SS_TRIG_GPWS_PULLUP
Definition: SoundScriptManager.h:76
RoR::SS_TRIG_PUMP
@ SS_TRIG_PUMP
Definition: SoundScriptManager.h:61
RoR::SS_MOD_AOA
@ SS_MOD_AOA
Definition: SoundScriptManager.h:152
RoR::SS_MOD_GEARBOX
@ SS_MOD_GEARBOX
Definition: SoundScriptManager.h:134
RoR::SS_TRIG_AVICHAT11
@ SS_TRIG_AVICHAT11
Definition: SoundScriptManager.h:115
RoR::SS_MOD_AEROENGINE2
@ SS_MOD_AEROENGINE2
Definition: SoundScriptManager.h:128
RoR::SS_MOD_MUSIC_VOLUME
@ SS_MOD_MUSIC_VOLUME
Definition: SoundScriptManager.h:154
RoR::SS_TRIG_SCREETCH
@ SS_TRIG_SCREETCH
Definition: SoundScriptManager.h:83
RoR::SS_TRIG_TURN_SIGNAL_WARN_TICK
@ SS_TRIG_TURN_SIGNAL_WARN_TICK
Definition: SoundScriptManager.h:102
RoR::SS_TRIG_AFTERBURNER4
@ SS_TRIG_AFTERBURNER4
Definition: SoundScriptManager.h:88
RoR::SS_MOD_INJECTOR
@ SS_MOD_INJECTOR
Definition: SoundScriptManager.h:132
RoR::SS_TRIG_REVERSE_GEAR
@ SS_TRIG_REVERSE_GEAR
Definition: SoundScriptManager.h:99
RoR::SS_TRIG_GPWS_10
@ SS_TRIG_GPWS_10
Definition: SoundScriptManager.h:70
RoR::SS_TRIG_PARK
@ SS_TRIG_PARK
Definition: SoundScriptManager.h:84
RoR::SS_TRIG_LINKED_COMMAND
@ SS_TRIG_LINKED_COMMAND
Definition: SoundScriptManager.h:118
RoR::SS_TRIG_AVICHAT13
@ SS_TRIG_AVICHAT13
Definition: SoundScriptManager.h:117
RoR::SS_MOD_TURBO
@ SS_MOD_TURBO
Definition: SoundScriptManager.h:126
RoR::SS_TRIG_AIR_PURGE
@ SS_TRIG_AIR_PURGE
Definition: SoundScriptManager.h:78
RoR::SS_MOD_THROTTLE1
@ SS_MOD_THROTTLE1
Definition: SoundScriptManager.h:139
RoR::SS_TRIG_AEROENGINE1
@ SS_TRIG_AEROENGINE1
Definition: SoundScriptManager.h:55
ScriptEngine.h
RoR::SS_TRIG_AIR
@ SS_TRIG_AIR
Definition: SoundScriptManager.h:68
RoR::SS_TRIG_AVICHAT01
@ SS_TRIG_AVICHAT01
Definition: SoundScriptManager.h:105
RoR::SS_TRIG_ALWAYSON
@ SS_TRIG_ALWAYSON
Definition: SoundScriptManager.h:66
RoR::SS_MOD_WHEELSPEED
@ SS_MOD_WHEELSPEED
Definition: SoundScriptManager.h:131
RoR::SS_TRIG_GPWS_50
@ SS_TRIG_GPWS_50
Definition: SoundScriptManager.h:74
SoundScriptManager.h
RoR::SS_MOD_THROTTLE3
@ SS_MOD_THROTTLE3
Definition: SoundScriptManager.h:141
RoR::SS_MOD_NONE
@ SS_MOD_NONE
Definition: SoundScriptManager.h:124
RoR::SS_TRIG_AEROENGINE4
@ SS_TRIG_AEROENGINE4
Definition: SoundScriptManager.h:58
RoR::SS_MOD_LINKED_COMMANDRATE
@ SS_MOD_LINKED_COMMANDRATE
Definition: SoundScriptManager.h:153
RoR::SS_MOD_SCREETCH
@ SS_MOD_SCREETCH
Definition: SoundScriptManager.h:137
RoR::SS_TRIG_GPWS_30
@ SS_TRIG_GPWS_30
Definition: SoundScriptManager.h:72
RoR::SS_TRIG_GPWS_20
@ SS_TRIG_GPWS_20
Definition: SoundScriptManager.h:71
RoR::SS_MOD_AEROENGINE7
@ SS_MOD_AEROENGINE7
Definition: SoundScriptManager.h:149
RoR::SS_TRIG_TURBOBOV
@ SS_TRIG_TURBOBOV
Definition: SoundScriptManager.h:63
RoR::SS_TRIG_HORN
@ SS_TRIG_HORN
Definition: SoundScriptManager.h:59
RoR::SS_TRIG_AVICHAT05
@ SS_TRIG_AVICHAT05
Definition: SoundScriptManager.h:109
RoR::SS_TRIG_GPWS_100
@ SS_TRIG_GPWS_100
Definition: SoundScriptManager.h:75
RoR::SS_TRIG_AVICHAT08
@ SS_TRIG_AVICHAT08
Definition: SoundScriptManager.h:112
RoR::SS_TRIG_AEROENGINE5
@ SS_TRIG_AEROENGINE5
Definition: SoundScriptManager.h:93
getPitch
radian getPitch(bool reprojectAxis=true) const
RoR::SS_TRIG_BREAK
@ SS_TRIG_BREAK
Definition: SoundScriptManager.h:82
RoR::SS_MOD_AIRSPEED
@ SS_MOD_AIRSPEED
Definition: SoundScriptManager.h:151
RoR::SS_MOD_THROTTLE5
@ SS_MOD_THROTTLE5
Definition: SoundScriptManager.h:143
RoR::SoundScriptInstance
Definition: SoundScriptManager.h:238
RoR::SS_MOD_THROTTLE4
@ SS_MOD_THROTTLE4
Definition: SoundScriptManager.h:142
RoR::RegisterSoundScript
void RegisterSoundScript(AngelScript::asIScriptEngine *engine)
defined in SoundScriptAngelscript.cpp
Definition: SoundScriptAngelscript.cpp:30
RoR::SS_TRIG_SHIFT
@ SS_TRIG_SHIFT
Definition: SoundScriptManager.h:79
RoR::SS_TRIG_AVICHAT12
@ SS_TRIG_AVICHAT12
Definition: SoundScriptManager.h:116
RoR::SS_TRIG_GEARSLIDE
@ SS_TRIG_GEARSLIDE
Definition: SoundScriptManager.h:80
RoR::SS_MOD_CREAK
@ SS_MOD_CREAK
Definition: SoundScriptManager.h:135
RoR::SS_TRIG_AEROENGINE7
@ SS_TRIG_AEROENGINE7
Definition: SoundScriptManager.h:95
RoR::SS_TRIG_TURN_SIGNAL
@ SS_TRIG_TURN_SIGNAL
Definition: SoundScriptManager.h:100
RoR::SS_MOD_ENGINE
@ SS_MOD_ENGINE
Definition: SoundScriptManager.h:125
RoR::SS_MOD_BREAK
@ SS_MOD_BREAK
Definition: SoundScriptManager.h:136
RoR::SS_TRIG_REPAIR
@ SS_TRIG_REPAIR
Definition: SoundScriptManager.h:67
RoR::SS_TRIG_AVICHAT02
@ SS_TRIG_AVICHAT02
Definition: SoundScriptManager.h:106
RoR::SS_TRIG_AFTERBURNER7
@ SS_TRIG_AFTERBURNER7
Definition: SoundScriptManager.h:91
RoR::SS_TRIG_IGNITION
@ SS_TRIG_IGNITION
Definition: SoundScriptManager.h:98
RoR::SS_TRIG_AVICHAT10
@ SS_TRIG_AVICHAT10
Definition: SoundScriptManager.h:114
RoR::SS_MOD_AEROENGINE6
@ SS_MOD_AEROENGINE6
Definition: SoundScriptManager.h:148
RoR::SS_TRIG_AVICHAT07
@ SS_TRIG_AVICHAT07
Definition: SoundScriptManager.h:111
RoR::SS_TRIG_AFTERBURNER3
@ SS_TRIG_AFTERBURNER3
Definition: SoundScriptManager.h:87
RoR::SS_TRIG_NONE
@ SS_TRIG_NONE
Definition: SoundScriptManager.h:53
RoR::SS_MOD_THROTTLE2
@ SS_MOD_THROTTLE2
Definition: SoundScriptManager.h:140
RoR::SS_MOD_AEROENGINE3
@ SS_MOD_AEROENGINE3
Definition: SoundScriptManager.h:129
RoR::SS_TRIG_AFTERBURNER8
@ SS_TRIG_AFTERBURNER8
Definition: SoundScriptManager.h:92
RoR
Definition: AppContext.h:36
RoR::SS_MOD_TORQUE
@ SS_MOD_TORQUE
Definition: SoundScriptManager.h:133
RoR::SS_MOD_THROTTLE8
@ SS_MOD_THROTTLE8
Definition: SoundScriptManager.h:146
RoR::SS_TRIG_STARTER
@ SS_TRIG_STARTER
Definition: SoundScriptManager.h:62
RoR::SS_TRIG_AFTERBURNER1
@ SS_TRIG_AFTERBURNER1
Definition: SoundScriptManager.h:85
RoR::SS_TRIG_AOA
@ SS_TRIG_AOA
Definition: SoundScriptManager.h:97