OpenMW
components/nif/record.hpp
Go to the documentation of this file.
00001 /*
00002   OpenMW - The completely unofficial reimplementation of Morrowind
00003   Copyright (C) 2008-2010  Nicolay Korslund
00004   Email: < korslund@gmail.com >
00005   WWW: http://openmw.sourceforge.net/
00006 
00007   This file (record.h) is part of the OpenMW package.
00008 
00009   OpenMW is distributed as free software: you can redistribute it
00010   and/or modify it under the terms of the GNU General Public License
00011   version 3, as published by the Free Software Foundation.
00012 
00013   This program is distributed in the hope that it will be useful, but
00014   WITHOUT ANY WARRANTY; without even the implied warranty of
00015   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016   General Public License for more details.
00017 
00018   You should have received a copy of the GNU General Public License
00019   version 3 along with this program. If not, see
00020   http://www.gnu.org/licenses/ .
00021 
00022  */
00023 
00024 #ifndef OPENMW_COMPONENTS_NIF_RECORD_HPP
00025 #define OPENMW_COMPONENTS_NIF_RECORD_HPP
00026 
00027 #include <string>
00028 
00029 namespace Nif
00030 {
00031 
00032 class NIFFile;
00033 class NIFStream;
00034 
00035 enum RecordType
00036 {
00037   RC_MISSING = 0,
00038   RC_NiNode,
00039   RC_NiBillboardNode,
00040   RC_AvoidNode,
00041   RC_NiTriShape,
00042   RC_NiRotatingParticles,
00043   RC_NiAutoNormalParticles,
00044   RC_NiBSParticleNode,
00045   RC_NiCamera,
00046   RC_NiTexturingProperty,
00047   RC_NiMaterialProperty,
00048   RC_NiZBufferProperty,
00049   RC_NiAlphaProperty,
00050   RC_NiVertexColorProperty,
00051   RC_NiShadeProperty,
00052   RC_NiDitherProperty,
00053   RC_NiWireframeProperty,
00054   RC_NiSpecularProperty,
00055   RC_NiStencilProperty,
00056   RC_NiVisController,
00057   RC_NiGeomMorpherController,
00058   RC_NiKeyframeController,
00059   RC_NiAlphaController,
00060   RC_NiUVController,
00061   RC_NiPathController,
00062   RC_NiMaterialColorController,
00063   RC_NiBSPArrayController,
00064   RC_NiParticleSystemController,
00065   RC_NiFlipController,
00066   RC_NiBSAnimationNode,
00067   RC_NiLight,
00068   RC_NiTextureEffect,
00069   RC_NiVertWeightsExtraData,
00070   RC_NiTextKeyExtraData,
00071   RC_NiStringExtraData,
00072   RC_NiGravity,
00073   RC_NiPlanarCollider,
00074   RC_NiParticleGrowFade,
00075   RC_NiParticleColorModifier,
00076   RC_NiParticleRotation,
00077   RC_NiFloatData,
00078   RC_NiTriShapeData,
00079   RC_NiVisData,
00080   RC_NiColorData,
00081   RC_NiPixelData,
00082   RC_NiMorphData,
00083   RC_NiKeyframeData,
00084   RC_NiSkinData,
00085   RC_NiUVData,
00086   RC_NiPosData,
00087   RC_NiRotatingParticlesData,
00088   RC_NiAutoNormalParticlesData,
00089   RC_NiSequenceStreamHelper,
00090   RC_NiSourceTexture,
00091   RC_NiSkinInstance,
00092   RC_RootCollisionNode
00093 };
00094 
00096 struct Record
00097 {
00098     // Record type and type name
00099     int recType;
00100     std::string recName;
00101     size_t recIndex;
00102 
00103     Record() : recType(RC_MISSING), recIndex(~(size_t)0) {}
00104 
00106     virtual void read(NIFStream *nif) = 0;
00107 
00109     virtual void post(NIFFile *nif) {}
00110 
00111     virtual ~Record() {}
00112 
00113     /*
00114        Use these later if you want custom allocation of all NIF objects
00115     static void* operator new(size_t size);
00116     static void operator delete(void *p);
00117     */
00118 };
00119 
00120 } // Namespace
00121 #endif