Added: #1469 A way to get a modifier name

--HG--
branch : gsoc2012-fabien
hg/feature/gsoc2012-fabien
Fabien_HENON 13 years ago
parent 1095975a3f
commit 2334512d63

@ -32,6 +32,10 @@ class ICameraAnimationModifier
public: public:
/// This function is called when it's time to parse the primitive to load the camera animation modifier /// This function is called when it's time to parse the primitive to load the camera animation modifier
virtual bool parseModifier(const NLLIGO::IPrimitive* prim, const std::string& filename) = 0; virtual bool parseModifier(const NLLIGO::IPrimitive* prim, const std::string& filename) = 0;
/// Function to get the name of the modifier
virtual std::string getModifierName() const = 0;
}; };
/************************************************************************/ /************************************************************************/
@ -55,7 +59,7 @@ protected:
}; };
// Define used to register the different types of camera animation modifiers // Define used to register the different types of camera animation modifiers
#define CAMERA_ANIMATION_REGISTR_MODIFIER(_class_,_name_) \ #define CAMERA_ANIMATION_REGISTER_MODIFIER(_class_,_name_) \
class _class_##CameraAnimationModifierFactory : public ICameraAnimationModifierFactory \ class _class_##CameraAnimationModifierFactory : public ICameraAnimationModifierFactory \
{\ {\
public:\ public:\
@ -76,4 +80,10 @@ public:\
};\ };\
static _class_##CameraAnimationModifierFactory* _class_##CameraAnimationModifierFactoryInstance = new _class_##CameraAnimationModifierFactory; static _class_##CameraAnimationModifierFactory* _class_##CameraAnimationModifierFactoryInstance = new _class_##CameraAnimationModifierFactory;
#define CAMERA_ANIMATION_MODIFIER_NAME(name) \
std::string getModifierName() const \
{ \
return name; \
}
#endif /* RY_CAMERAANIMATIONMODIFIERFACTORY_H */ #endif /* RY_CAMERAANIMATIONMODIFIERFACTORY_H */

@ -51,8 +51,10 @@ public:
return true; return true;
} }
CAMERA_ANIMATION_MODIFIER_NAME("camera_modifier_shake");
}; };
CAMERA_ANIMATION_REGISTR_MODIFIER(CCameraAnimationModifierShake, "camera_modifier_shake"); CAMERA_ANIMATION_REGISTER_MODIFIER(CCameraAnimationModifierShake, "camera_modifier_shake");
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
/// This animation modifier plays a sound. The parameters are /// This animation modifier plays a sound. The parameters are
@ -97,5 +99,7 @@ public:
return true; return true;
} }
CAMERA_ANIMATION_MODIFIER_NAME("sound_trigger");
}; };
CAMERA_ANIMATION_REGISTR_MODIFIER(CCameraAnimationModifierSoundTrigger, "sound_trigger"); CAMERA_ANIMATION_REGISTER_MODIFIER(CCameraAnimationModifierSoundTrigger, "sound_trigger");
Loading…
Cancel
Save