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

segs.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 
00043 // C++ required.
00044 #if !defined __cplusplus
00045 #error C++ compiler required
00046 #endif
00047 
00048 // Include guard
00049 #if !defined SEGS_H
00050 #define SEGS_H
00051 
00052 // C++ headers
00053 #include <vector>
00054 
00055 // Doom headers
00056 #include "global.hpp"
00057 #include "lump.hpp"
00058 #include "wadentry.hpp"
00059 
00060 namespace Doomwad
00061 {
00062 
00073   EXPORT class Seg : public WadEntryElement
00074   {
00075     public:
00076 
00078     static const size_t LENGTH;
00079 
00080     uint16 start;     
00081     uint16 end;       
00082     int16 angle;      
00083     uint16 linedef;   
00084     uint16 direction; 
00085     uint16 offset;    
00086 
00087     static const uint16 LEFT;  
00088     static const uint16 RIGHT; 
00089 
00090     static const uint16 NO_LINEDEF; 
00091 
00092     Seg (uint16 = 0, uint16 = 0, int16 = 0, uint16 = 0, uint16 = RIGHT, uint16 = 0) throw ();
00093     virtual ~Seg (void) throw ();
00094 
00095     virtual size_t getLength (void) const throw ();
00096     virtual bool write (Lump &lump, Lump::size_type i) const throw ();
00097     virtual bool read (const Lump &lump, Lump::size_type i) throw ();
00098     virtual std::string toString (void) const throw ();
00099   };
00100 
00128   EXPORT class GLSeg : public WadEntryElement
00129   {
00130     public:
00131 
00132     static const size_t LENGTH;    
00133     static const size_t LENGTH_V3; 
00134 
00135     uint32 start;     
00136     uint32 end;       
00137     uint16 linedef;   
00138     uint16 flags;     
00139     uint32 partner;   
00140 
00141     static const uint16 LEFT;  
00142     static const uint16 RIGHT; 
00143 
00144     static const uint16 NO_LINEDEF; 
00145 
00146     GLSeg (uint32 = 0, uint32 = 0, uint16 = 0, uint16 = RIGHT, uint32 = 0) throw ();
00147     virtual ~GLSeg (void) throw ();
00148 
00149     virtual bool writeV1 (Lump &lump, Lump::size_type i) const throw ();
00150     virtual bool readV1 (const Lump &lump, Lump::size_type i) throw ();
00151     virtual size_t getLength (void) const throw ();
00152     virtual bool write (Lump &lump, Lump::size_type i) const throw ();
00153     virtual bool read (const Lump &lump, Lump::size_type i) throw ();
00154     virtual std::string toString (void) const throw ();
00155   };
00156 
00162   EXPORT class Segs : public WadEntry, public std::vector<Seg>
00163   {
00164     public:
00165 
00167     static const std::string NAME;
00168 
00169     Segs (void) throw ();
00170     Segs (const Lump&) throw ();
00171     virtual ~Segs (void) throw ();
00172 
00173     virtual bool setFromLump (const Lump &lump) throw ();
00174     virtual Lump toLump (void) const throw ();
00175     virtual std::string toString (void) const throw ();
00176   };
00177 
00183   EXPORT class GLSegs : public WadEntry, public std::vector<GLSeg>
00184   {
00185     public:
00186 
00187     static const std::string NAME; 
00188     static const size_t V3_MARKER; 
00189 
00190     GLSegs (void) throw ();
00191     GLSegs (const Lump&) throw ();
00192     virtual ~GLSegs (void) throw ();
00193 
00194     virtual bool setFromLump (const Lump &lump) throw ();
00195     virtual Lump toLump (void) const throw ();
00196     virtual Lump toLumpV1 (void) const throw ();
00197     virtual std::string toString (void) const throw ();
00198   };
00199 }
00200 #endif

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