00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00043
00044 #if !defined __cplusplus
00045 #error C++ compiler required
00046 #endif
00047
00048
00049 #if !defined NODES_H
00050 #define NODES_H
00051
00052
00053 #include <vector>
00054
00055
00056 #include "global.hpp"
00057 #include "lump.hpp"
00058 #include "wadentry.hpp"
00059
00060 namespace Doomwad
00061 {
00062
00070 EXPORT class Node : public WadEntryElement
00071 {
00072 public:
00073
00075 static const size_t LENGTH;
00076
00078 static const int16 SUBSECTOR_MASK;
00079
00080 int16 x;
00081 int16 y;
00082 int16 dx;
00083 int16 dy;
00084 int16 r_y_upper;
00085 int16 r_y_lower;
00086 int16 r_x_lower;
00087 int16 r_x_upper;
00088 int16 l_y_upper;
00089 int16 l_y_lower;
00090 int16 l_x_lower;
00091 int16 l_x_upper;
00092 uint16 r_child;
00093 uint16 l_child;
00094
00095
00096 Node (int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, uint16 = 0, uint16 = 0) throw ();
00097 virtual ~Node (void) throw ();
00098
00099 virtual size_t getLength (void) const throw ();
00100 virtual bool write (Lump &lump, Lump::size_type i) const throw ();
00101 virtual bool read (const Lump &lump, Lump::size_type i) throw ();
00102 virtual std::string toString (void) const throw ();
00103 };
00104
00112 EXPORT class GLNode : public WadEntryElement
00113 {
00114 public:
00115
00117 static const size_t LENGTH;
00118
00120 static const int16 SUBSECTOR_MASK;
00121
00122 int16 x;
00123 int16 y;
00124 int16 dx;
00125 int16 dy;
00126 int16 r_y_upper;
00127 int16 r_y_lower;
00128 int16 r_x_lower;
00129 int16 r_x_upper;
00130 int16 l_y_upper;
00131 int16 l_y_lower;
00132 int16 l_x_lower;
00133 int16 l_x_upper;
00134 uint16 r_child;
00135 uint16 l_child;
00136
00137
00138 GLNode (int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, int16 = 0, uint16 = 0, uint16 = 0) throw ();
00139 virtual ~GLNode (void) throw ();
00140
00141 virtual size_t getLength (void) const throw ();
00142 virtual bool write (Lump &lump, Lump::size_type i) const throw ();
00143 virtual bool read (const Lump &lump, Lump::size_type i) throw ();
00144 virtual std::string toString (void) const throw ();
00145 };
00146
00152 EXPORT class Nodes : public WadEntry, public std::vector<Node>
00153 {
00154 public:
00155
00157 static const std::string NAME;
00158
00159 Nodes (void) throw ();
00160 Nodes (const Lump&) throw ();
00161 virtual ~Nodes (void) throw ();
00162
00163 virtual bool setFromLump (const Lump &lump) throw ();
00164 virtual Lump toLump (void) const throw ();
00165 virtual std::string toString (void) const throw ();
00166 };
00167
00173 EXPORT class GLNodes : public WadEntry, public std::vector<GLNode>
00174 {
00175 public:
00176
00178 static const std::string NAME;
00179
00180 GLNodes (void) throw ();
00181 GLNodes (const Lump&) throw ();
00182 virtual ~GLNodes (void) throw ();
00183
00184 virtual bool setFromLump (const Lump &lump) throw ();
00185 virtual Lump toLump (void) const throw ();
00186 virtual std::string toString (void) const throw ();
00187 };
00188 }
00189 #endif