00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "asSoundListenerComponent.h"
00018
00019 #ifdef __COMPILE_WITH_ANGELSCRIPT__
00020 #ifdef __COMPILE_WITH_SFML_AUDIO__
00021
00022 #include "../../ScriptHelper.h"
00023 #include "../../core/asEntityComponent.h"
00024
00025 #include "../../../components/sound/SoundListenerComponent.h"
00026
00027
00029 SoundListenerComponent* createSoundListenerComponent(Entity *parent, bool isMainListener = true)
00030 {
00031 return new SoundListenerComponent(parent, isMainListener);
00032 }
00033
00035 void bindSoundListenerComponent(asIScriptEngine *engine)
00036 {
00037
00038 int r;
00039
00040
00041 r = engine->RegisterObjectType("SoundListenerComponent", sizeof(SoundListenerComponent), asOBJ_REF); assert(r >= 0);
00042
00043
00044 bindEntityComponentBase<SoundListenerComponent>(engine, "SoundListenerComponent");
00045
00046
00047 r = engine->RegisterObjectBehaviour("SoundListenerComponent", asBEHAVE_FACTORY, "SoundListenerComponent@ f(Entity @+)",
00048 asFUNCTION(createSoundListenerComponent), asCALL_CDECL); assert(r >= 0);
00049 r = engine->RegisterObjectBehaviour("SoundListenerComponent", asBEHAVE_FACTORY, "SoundListenerComponent@ f(Entity @+, bool)",
00050 asFUNCTION(createSoundListenerComponent), asCALL_CDECL); assert(r >= 0);
00051
00052 r = engine->RegisterObjectMethod("SoundListenerComponent", "SoundListenerComponent& opAssign(const SoundListenerComponent &in)",
00053 asFUNCTION(assignT<SoundListenerComponent>), asCALL_CDECL_OBJFIRST); assert(r >= 0);
00054
00055
00056 r = engine->RegisterObjectMethod("SoundListenerComponent", "bool getIsMainListener()",
00057 asMETHOD(SoundListenerComponent, getIsMainListener), asCALL_THISCALL); assert(r >= 0);
00058
00059 r = engine->RegisterObjectMethod("SoundListenerComponent", "void setIsMainListener()",
00060 asMETHOD(SoundListenerComponent, setIsMainListener), asCALL_THISCALL); assert(r >= 0);
00061 r = engine->RegisterObjectMethod("SoundListenerComponent", "void setIsMainListener(bool)",
00062 asMETHOD(SoundListenerComponent, setIsMainListener), asCALL_THISCALL); assert(r >= 0);
00063 }
00064
00065 #endif // __COMPILE_WITH_SFML_AUDIO__
00066 #endif // __COMPILE_WITH_ANGELSCRIPT__
00067
00068