PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: TextureAniLoaderPL.h * 00003 * 00004 * Copyright (C) 2002-2011 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLRENDERER_MATERIALLOADER_PL_H__ 00024 #define __PLRENDERER_MATERIALLOADER_PL_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include "PLRenderer/Texture/TextureAniLoader.h" 00032 00033 00034 //[-------------------------------------------------------] 00035 //[ Forward declarations ] 00036 //[-------------------------------------------------------] 00037 namespace PLCore { 00038 class XmlElement; 00039 } 00040 namespace PLRenderer { 00041 class AniInfoManager; 00042 } 00043 00044 00045 //[-------------------------------------------------------] 00046 //[ Namespace ] 00047 //[-------------------------------------------------------] 00048 namespace PLRenderer { 00049 00050 00051 //[-------------------------------------------------------] 00052 //[ Classes ] 00053 //[-------------------------------------------------------] 00054 /** 00055 * @brief 00056 * Texture animation loader implementation for the PixelLight texture animation XML file format 00057 */ 00058 class TextureAniLoaderPL : public TextureAniLoader { 00059 00060 00061 //[-------------------------------------------------------] 00062 //[ RTTI interface ] 00063 //[-------------------------------------------------------] 00064 pl_class(PLRENDERER_RTTI_EXPORT, TextureAniLoaderPL, "PLRenderer", PLRenderer::TextureAniLoader, "Texture animation loader implementation for the PixelLight texture animation XML file format") 00065 // Properties 00066 pl_properties 00067 pl_property("Formats", "tani,TANI") 00068 pl_property("Load", "1") 00069 pl_property("Save", "1") 00070 pl_properties_end 00071 // Constructors 00072 pl_constructor_0(DefaultConstructor, "Default constructor", "") 00073 // Methods 00074 pl_method_2(Load, pl_ret_type(bool), TextureAni&, PLCore::File&, "Load method", "") 00075 pl_method_2(Save, pl_ret_type(bool), const TextureAni&, PLCore::File&, "Save method", "") 00076 pl_class_end 00077 00078 00079 //[-------------------------------------------------------] 00080 //[ Public RTTI methods ] 00081 //[-------------------------------------------------------] 00082 public: 00083 PLRENDERER_API bool Load(TextureAni &cTextureAni, PLCore::File &cFile); 00084 PLRENDERER_API bool Save(const TextureAni &cTextureAni, PLCore::File &cFile); 00085 00086 00087 //[-------------------------------------------------------] 00088 //[ Public functions ] 00089 //[-------------------------------------------------------] 00090 public: 00091 /** 00092 * @brief 00093 * Default constructor 00094 */ 00095 PLRENDERER_API TextureAniLoaderPL(); 00096 00097 /** 00098 * @brief 00099 * Destructor 00100 */ 00101 PLRENDERER_API virtual ~TextureAniLoaderPL(); 00102 00103 00104 //[-------------------------------------------------------] 00105 //[ Private functions ] 00106 //[-------------------------------------------------------] 00107 private: 00108 /** 00109 * @brief 00110 * Loader implementation for format version 1 00111 * 00112 * @param[in] cTextureAni 00113 * Texture animation to load into 00114 * @param[in] cTextureAniElement 00115 * Texture animation XML element to read the data from 00116 * 00117 * @return 00118 * 'true' if all went fine, else 'false' 00119 */ 00120 bool LoadV1(TextureAni &cTextureAni, const PLCore::XmlElement &cTextureAniElement) const; 00121 00122 /** 00123 * @brief 00124 * Adds an animation information manager to the given XML element 00125 * 00126 * @param[out] cElement 00127 * XML element to add to 00128 * @param[in] cAniInfoManager 00129 * Animation information manager to use 00130 * @param[in] sType 00131 * Type of animation 00132 */ 00133 void AddAniInfoManager(PLCore::XmlElement &cElement, const AniInfoManager &cAniInfoManager, const PLCore::String &sType) const; 00134 00135 00136 }; 00137 00138 00139 //[-------------------------------------------------------] 00140 //[ Namespace ] 00141 //[-------------------------------------------------------] 00142 } // PLRenderer 00143 00144 00145 #endif // __PLRENDERER_MATERIALLOADER_PL_H__
|