mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 23:53:52 +00:00
Added NifRecord
This commit is contained in:
parent
abde68fed6
commit
3a15e6d0d5
4 changed files with 50 additions and 2 deletions
|
@ -50,8 +50,13 @@ void NIFFile::parse()
|
||||||
|
|
||||||
cout << i << ": " << rec.toString() << endl;
|
cout << i << ": " << rec.toString() << endl;
|
||||||
|
|
||||||
|
NifRecord *r = NULL;
|
||||||
|
|
||||||
if(rec == "NiNode") cout << " got a node!\n";
|
if(rec == "NiNode") cout << " got a node!\n";
|
||||||
|
|
||||||
|
if(r) r->read(this);
|
||||||
|
else cout << "No record was created\n";
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,8 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "record.h"
|
||||||
|
|
||||||
using namespace Mangle::Stream;
|
using namespace Mangle::Stream;
|
||||||
|
|
||||||
class NIFFile
|
class NIFFile
|
||||||
|
@ -52,7 +54,6 @@ class NIFFile
|
||||||
std::string filename;
|
std::string filename;
|
||||||
|
|
||||||
/// Record list
|
/// Record list
|
||||||
typedef void NifRecord;
|
|
||||||
std::vector<NifRecord*> records;
|
std::vector<NifRecord*> records;
|
||||||
|
|
||||||
/// Used for error handling
|
/// Used for error handling
|
||||||
|
|
42
nif/record.h
Normal file
42
nif/record.h
Normal file
|
@ -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
|
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 $@
|
$(GCC) $< ../nif_file.cpp ../../tools/stringops.cpp -o $@
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
|
Loading…
Reference in a new issue