Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

animated.hpp

Go to the documentation of this file.
00001 // libdoomwad: manipulates Doom wad files.
00002 // Copyright (C) 2005  John Gaughan
00003 //
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either
00007 // version 2.1 of the License, or (at your option) any later version.
00008 //
00009 // This library is distributed in the hope that it will be useful,
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012 // Lesser General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Lesser General Public
00015 // License along with this library; if not, write to the Free Software
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00017 //
00018 // This library is distributed with the full text of the LGPL. Please see
00019 // the accompanying file named COPYING.
00020 // 
00021 // You may contact the author at john@johngaughan.net
00022 
00044 // C++ required.
00045 #if !defined __cplusplus
00046 #error C++ compiler required
00047 #endif
00048 
00049 // Include guard
00050 #if !defined ANIMATED_H
00051 #define ANIMATED_H
00052 
00053 // C++ headers
00054 #include <list>
00055 #include <sstream>
00056 #include <string>
00057 
00058 // Doom headers
00059 #include "global.hpp"
00060 #include "lump.hpp"
00061 #include "wadentry.hpp"
00062 
00063 namespace Doomwad
00064 {
00065 
00075   EXPORT class Animation : public WadEntryElement
00076   {
00077     public:
00078 
00080     static const byte TEXTURE;
00081 
00083     static const byte FLAT;
00084 
00086     static const byte TERMINATE;
00087 
00089     static const byte DEFAULT_TYPE;
00090 
00092     static const size_t LENGTH;
00093 
00095     static const uint32 DEFAULT_SPEED;
00096 
00098     byte type;
00099 
00101     std::string last;
00102 
00104     std::string first;
00105 
00107     uint32 speed;
00108 
00109     Animation (void) throw ();
00110     Animation (const std::string&, const std::string&, byte = DEFAULT_TYPE, uint32 = DEFAULT_SPEED);
00111     virtual ~Animation (void) throw ();
00112 
00113     virtual size_t getLength (void) const throw ();
00114     virtual bool write (Lump &lump, Lump::size_type i) const throw ();
00115     virtual bool read (const Lump &lump, Lump::size_type i) throw ();
00116     virtual std::string toString (void) const throw ();
00117   };
00118 
00136   EXPORT class Animated : public WadEntry, public std::list<Animation>
00137   {
00138 
00139     public:
00140 
00142     static const std::string NAME;
00143 
00144     Animated (void) throw ();
00145     Animated (const Lump&) throw ();
00146     virtual ~Animated (void) throw ();
00147 
00148     virtual bool setFromLump (const Lump &lump) throw ();
00149     virtual Lump toLump (void) const throw ();
00150     virtual std::string toString (void) const throw ();
00151   };
00152 }
00153 #endif

Generated on Fri Jun 10 19:38:51 2005 for libdoomwad by  doxygen 1.4.0