Added NifRecord

actorid
Nicolay Korslund 15 years ago
parent abde68fed6
commit 3a15e6d0d5

@ -50,8 +50,13 @@ void NIFFile::parse()
cout << i << ": " << rec.toString() << endl;
NifRecord *r = NULL;
if(rec == "NiNode") cout << " got a node!\n";
if(r) r->read(this);
else cout << "No record was created\n";
break;
}
}

@ -33,6 +33,8 @@
#include <vector>
#include <string>
#include "record.h"
using namespace Mangle::Stream;
class NIFFile
@ -52,7 +54,6 @@ class NIFFile
std::string filename;
/// Record list
typedef void NifRecord;
std::vector<NifRecord*> records;
/// Used for error handling

@ -0,0 +1,42 @@
/*
OpenMW - The completely unofficial reimplementation of Morrowind
Copyright (C) 2008-2010 Nicolay Korslund
Email: < korslund@gmail.com >
WWW: http://openmw.sourceforge.net/
This file (record.h) is part of the OpenMW package.
OpenMW is distributed as free software: you can redistribute it
and/or modify it under the terms of the GNU General Public License
version 3, as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
version 3 along with this program. If not, see
http://www.gnu.org/licenses/ .
*/
#ifndef _NIF_RECORD_H_
#define _NIF_RECORD_H_
class NIFFile;
class NifRecord
{
public:
virtual void read(NIFFile *nif) = 0;
/*
Use these later if you want custom allocation of all NIF objects
static void* operator new(size_t size);
static void operator delete(void *p);
*/
};
#endif

@ -2,7 +2,7 @@ GCC=g++
all: niftool
niftool: niftool.cpp ../nif_file.h
niftool: niftool.cpp ../nif_file.h ../nif_file.cpp ../record.h
$(GCC) $< ../nif_file.cpp ../../tools/stringops.cpp -o $@
clean:

Loading…
Cancel
Save