X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fobject%2Fambient_sound.hpp;h=a7a14bca770a151da39e9e093cc66d2a91b430f4;hb=1dfbd27a41341f26775ca4e2b9ca4864f5744a6f;hp=9adf724e3ad4146bebcce566f907b2993ef47d68;hpb=8a627e73d824b5a14249cfe066dc2fdc643ce28d;p=supertux.git diff --git a/src/object/ambient_sound.hpp b/src/object/ambient_sound.hpp index 9adf724e3..a7a14bca7 100644 --- a/src/object/ambient_sound.hpp +++ b/src/object/ambient_sound.hpp @@ -43,7 +43,7 @@ #ifndef __AMBIENT_SOUND_H__ #define __AMBIENT_SOUND_H__ -#include "moving_object.hpp" +#include "game_object.hpp" #include "resources.hpp" #include "player.hpp" #include "script_interface.hpp" @@ -51,43 +51,32 @@ class SoundSource; -class AmbientSound : public MovingObject, public ScriptInterface, public Scripting::AmbientSound +class AmbientSound : public GameObject, public ScriptInterface, public Scripting::AmbientSound { public: AmbientSound(const lisp::Lisp& lisp); AmbientSound(Vector pos, float factor, float bias, float vol, std::string file); ~AmbientSound(); - /*void set_pos(Vector newpos) + void set_pos(Vector newpos) { position=newpos; } - const Vector &get_pos() const + const Vector get_pos() const { - return get_pos(); - }*/ - - // --- BEGIN METHODS TO EXPOSE TO SQUIRREL --- // - void set_pos(float x, float y) - { - MovingObject::set_pos(x, y); + return position; } - float get_pos_x() const - { - return MovingObject::get_pos_x(); - } - - float get_pos_y() const - { - return MovingObject::get_pos_y(); - } - // --- END METHODS TO EXPOSE TO SQUIRREL --- // - - HitResponse collision(GameObject&, const CollisionHit&) - { - return ABORT_MOVE; - } + /** + * @name Scriptable Methods + * @{ + */ + void set_pos(float x, float y); + float get_pos_x() const; + float get_pos_y() const; + /** + * @} + */ protected: virtual void hit(Player& player); @@ -98,6 +87,10 @@ protected: virtual void expose(HSQUIRRELVM vm, SQInteger table_idx); virtual void unexpose(HSQUIRRELVM vm, SQInteger table_idx); private: + std::string name; /**< user-defined name for use in scripts or empty string if not scriptable */ + Vector position; + Vector dimension; + std::string sample; SoundSource* sound_source; int latency;