/*! * @file resource_md2.h * @brief Contains the ResourceMD2 class, that handles the Resource-specific loading part of the MD2. * */ #ifndef _RESOURCE_MD2_H #define _RESOURCE_MD2_H #include "util/loading/resource.h" #include "md2Model.h" class ResourceMD2 : public MD2Model, public Resources::Resource { public: ResourceMD2(const std::string& modelName, const std::string& skinName = "", float scale = 1.0f, const Resources::KeepLevel& keepLevel = Resources::KeepLevel()); static ResourceMD2 createFromString(const std::string& loadString, const Resources::KeepLevel& keepLevel = Resources::KeepLevel()); static std::string loadString(const std::string& modelName, const std::string& skinName = "", float scale = 1.0f); private: class MD2ResourcePointer : public Resources::StorePointer { public: MD2ResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const MD2Data::Pointer& data); inline const MD2Data::Pointer& ptr() const { return pointer; } virtual bool last() const { return pointer.count() == 1; } private: MD2Data::Pointer pointer; }; private: static Resources::tType type; }; #endif /* _RESOURCE_MD2_H */