Rev | Line | |
---|
[9781] | 1 | /*! |
---|
[9824] | 2 | * @file resource_md2.h |
---|
| 3 | * @brief Contains the ResourceMD2 class, that handles the Resource-specific loading part of the MD2. |
---|
[9781] | 4 | * |
---|
| 5 | */ |
---|
| 6 | |
---|
[9824] | 7 | #ifndef _RESOURCE_MD2_H |
---|
| 8 | #define _RESOURCE_MD2_H |
---|
[9781] | 9 | |
---|
| 10 | #include "util/loading/resource.h" |
---|
[9824] | 11 | #include "md2Model.h" |
---|
[9781] | 12 | |
---|
| 13 | |
---|
[9847] | 14 | class ResourceMD2 : public MD2Model, public Resources::Resource |
---|
[9781] | 15 | { |
---|
[9785] | 16 | public: |
---|
[9854] | 17 | ResourceMD2(const std::string& modelName, |
---|
| 18 | const std::string& skinName = "", |
---|
| 19 | float scale = 1.0f, |
---|
| 20 | const Resources::KeepLevel& keepLevel = Resources::KeepLevel()); |
---|
| 21 | static ResourceMD2 createFromString(const std::string& loadString, const Resources::KeepLevel& keepLevel = Resources::KeepLevel()); |
---|
[9824] | 22 | static std::string loadString(const std::string& modelName, const std::string& skinName = "", float scale = 1.0f); |
---|
[9781] | 23 | |
---|
| 24 | private: |
---|
[9824] | 25 | class MD2ResourcePointer : public Resources::StorePointer |
---|
[9781] | 26 | { |
---|
| 27 | public: |
---|
[9824] | 28 | MD2ResourcePointer(const std::string& loadString, const Resources::KeepLevel& keepLevel, const MD2Data::Pointer& data); |
---|
| 29 | inline const MD2Data::Pointer& ptr() const { return pointer; } |
---|
[9846] | 30 | virtual bool last() const { return pointer.count() == 1; } |
---|
| 31 | private: |
---|
[9824] | 32 | MD2Data::Pointer pointer; |
---|
[9781] | 33 | }; |
---|
| 34 | |
---|
[9785] | 35 | private: |
---|
[9824] | 36 | static Resources::tType<ResourceMD2> type; |
---|
[9781] | 37 | }; |
---|
| 38 | |
---|
| 39 | |
---|
[9824] | 40 | #endif /* _RESOURCE_MD2_H */ |
---|
Note: See
TracBrowser
for help on using the repository browser.