mirror of https://github.com/OpenMW/openmw.git
Added ARMO, BSGN and SOUN
parent
1d70b2c257
commit
a68b62b693
@ -0,0 +1,102 @@
|
||||
#ifndef _ESM_ARMO_H
|
||||
#define _ESM_ARMO_H
|
||||
|
||||
#include "esm_reader.hpp"
|
||||
|
||||
enum PartReferenceType
|
||||
{
|
||||
PRT_Head = 0,
|
||||
PRT_Hair = 1,
|
||||
PRT_Neck = 2,
|
||||
PRT_Cuirass = 3,
|
||||
PRT_Groin = 4,
|
||||
PRT_Skirt = 5,
|
||||
PRT_RHand = 6,
|
||||
PRT_LHand = 7,
|
||||
PRT_RWrist = 8,
|
||||
PRT_LWrist = 9,
|
||||
PRT_Shield = 10,
|
||||
PRT_RForearm = 11,
|
||||
PRT_LForearm = 12,
|
||||
PRT_RUpperarm = 13,
|
||||
PRT_LUpperarm = 14,
|
||||
PRT_RFoot = 15,
|
||||
PRT_LFoot = 16,
|
||||
PRT_RAnkle = 17,
|
||||
PRT_LAnkle = 18,
|
||||
PRT_RKnee = 19,
|
||||
PRT_LKnee = 20,
|
||||
PRT_RLeg = 21,
|
||||
PRT_LLeg = 22,
|
||||
PRT_RPauldron = 23,
|
||||
PRT_LPauldron = 24,
|
||||
PRT_Weapon = 25,
|
||||
PRT_Tail = 26
|
||||
};
|
||||
|
||||
// Reference to body parts
|
||||
struct PartReference
|
||||
{
|
||||
char part;
|
||||
std::string male, female;
|
||||
};
|
||||
|
||||
// A list of references to body parts
|
||||
struct PartReferenceList
|
||||
{
|
||||
std::vector<PartReference> parts;
|
||||
|
||||
void load(ESMReader &esm)
|
||||
{
|
||||
while(esm.isNextSub("INDX"))
|
||||
{
|
||||
PartReference pr;
|
||||
esm.getHT(pr.part); // The INDX byte
|
||||
pr.male = esm.getHNOString("BNAM");
|
||||
pr.female = esm.getHNOString("CNAM");
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
struct Armor
|
||||
{
|
||||
enum Type
|
||||
{
|
||||
Helmet = 0,
|
||||
Cuirass = 1,
|
||||
LPauldron = 2,
|
||||
RPauldron = 3,
|
||||
Greaves = 4,
|
||||
Boots = 5,
|
||||
LGauntlet = 6,
|
||||
RGauntlet = 7,
|
||||
Shield = 8,
|
||||
LBracer = 9,
|
||||
RBracer = 10
|
||||
};
|
||||
|
||||
struct AODTstruct
|
||||
{
|
||||
int type;
|
||||
float weight;
|
||||
int value, health, enchant, armor;
|
||||
};
|
||||
|
||||
AODTstruct data;
|
||||
PartReferenceList parts;
|
||||
|
||||
std::string name, model, icon, script, enchant;
|
||||
|
||||
void load(ESMReader &esm)
|
||||
{
|
||||
model = esm.getHNString("MODL");
|
||||
name = esm.getHNString("FNAM");
|
||||
script = esm.getHNOString("SCRI");
|
||||
esm.getHNT(data, "AODT", 24);
|
||||
icon = esm.getHNOString("ITEX");
|
||||
parts.load(esm);
|
||||
enchant = esm.getHNOString("ENAM");
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,24 @@
|
||||
#ifndef _ESM_SOUN_H
|
||||
#define _ESM_SOUN_H
|
||||
|
||||
#include "esm_reader.hpp"
|
||||
//#include "loadspel.hpp"
|
||||
|
||||
struct BirthSign
|
||||
{
|
||||
std::string name, description, texture;
|
||||
|
||||
// List of powers and abilities that come with this birth sign.
|
||||
//SpellList powers;
|
||||
|
||||
void load(ESMReader &esm)
|
||||
{
|
||||
name = esm.getHNString("FNAM");
|
||||
texture = esm.getHNOString("TNAM");
|
||||
description = esm.getHNOString("DESC");
|
||||
|
||||
//powers.load(esm);
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
@ -0,0 +1,22 @@
|
||||
#ifndef _ESM_SOUN_H
|
||||
#define _ESM_SOUN_H
|
||||
|
||||
#include "esm_reader.hpp"
|
||||
|
||||
struct SOUNstruct
|
||||
{
|
||||
unsigned char volume, minRange, maxRange;
|
||||
};
|
||||
|
||||
struct Sound
|
||||
{
|
||||
SOUNstruct data;
|
||||
std::string sound;
|
||||
|
||||
void load(ESMReader &esm)
|
||||
{
|
||||
sound = esm.getHNString("FNAM");
|
||||
esm.getHNT(data, "DATA", 3);
|
||||
}
|
||||
};
|
||||
#endif
|
@ -1,149 +0,0 @@
|
||||
/*
|
||||
OpenMW - The completely unofficial reimplementation of Morrowind
|
||||
Copyright (C) 2008 Nicolay Korslund
|
||||
Email: < korslund@gmail.com >
|
||||
WWW: http://openmw.snaptoad.com/
|
||||
|
||||
This file (loadarmo.d) 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/ .
|
||||
|
||||
*/
|
||||
|
||||
module esm.loadarmo;
|
||||
import esm.imports;
|
||||
|
||||
import esm.loadbody, esm.loadench;
|
||||
|
||||
/*
|
||||
* Armor
|
||||
*/
|
||||
|
||||
// Reference to body parts
|
||||
struct PartReference
|
||||
{
|
||||
enum Index
|
||||
{
|
||||
Head = 0,
|
||||
Hair = 1,
|
||||
Neck = 2,
|
||||
Cuirass = 3,
|
||||
Groin = 4,
|
||||
Skirt = 5,
|
||||
RHand = 6,
|
||||
LHand = 7,
|
||||
RWrist = 8,
|
||||
LWrist = 9,
|
||||
Shield = 10,
|
||||
RForearm = 11,
|
||||
LForearm = 12,
|
||||
RUpperarm = 13,
|
||||
LUpperarm = 14,
|
||||
RFoot = 15,
|
||||
LFoot = 16,
|
||||
RAnkle = 17,
|
||||
LAnkle = 18,
|
||||
RKnee = 19,
|
||||
LKnee = 20,
|
||||
RLeg = 21,
|
||||
LLeg = 22,
|
||||
RPauldron = 23,
|
||||
LPauldron = 24,
|
||||
Weapon = 25,
|
||||
Tail = 26
|
||||
}
|
||||
Index part;
|
||||
|
||||
BodyPart* male, female;
|
||||
}
|
||||
|
||||
struct PartReferenceList
|
||||
{
|
||||
RegionBuffer!(PartReference) parts;
|
||||
|
||||
void load()
|
||||
{with(esFile){
|
||||
parts = getRegion().getBuffer!(PartReference)(0,1);
|
||||
while(isNextSub("INDX"))
|
||||
{
|
||||
parts.length = parts.length + 1;
|
||||
with(parts.array[$-1])
|
||||
{
|
||||
part = cast(PartReference.Index) getHByte;
|
||||
male = getHNOPtr!(BodyPart)("BNAM", bodyParts);
|
||||
female = getHNOPtr!(BodyPart)("CNAM", bodyParts);
|
||||
}
|
||||
}
|
||||
}}
|
||||
}
|
||||
|
||||
struct Armor
|
||||
{
|
||||
enum Type : int
|
||||
{
|
||||
Helmet = 0,
|
||||
Cuirass = 1,
|
||||
LPauldron = 2,
|
||||
RPauldron = 3,
|
||||
Greaves = 4,
|
||||
Boots = 5,
|
||||
LGauntlet = 6,
|
||||
RGauntlet = 7,
|
||||
Shield = 8,
|
||||
LBracer = 9,
|
||||
RBracer = 10
|
||||
}
|
||||
|
||||
align(1) struct AODTstruct
|
||||
{
|
||||
Type type;
|
||||
float weight;
|
||||
int value, health, enchant, armor;
|
||||
|
||||
static assert(AODTstruct.sizeof==24);
|
||||
}
|
||||
|
||||
AODTstruct data;
|
||||
|
||||
mixin LoadT!();
|
||||
|
||||
PartReferenceList parts;
|
||||
|
||||
MeshIndex model;
|
||||
IconIndex icon;
|
||||
|
||||
Script *script;
|
||||
Enchantment *enchant;
|
||||
|
||||
void load()
|
||||
{with(esFile){
|
||||
model = getMesh();
|
||||
name = getHNString("FNAM");
|
||||
script = getHNOPtr!(Script)("SCRI", scripts);
|
||||
readHNExact(&data, data.sizeof, "AODT");
|
||||
icon = getOIcon();
|
||||
|
||||
parts.load();
|
||||
|
||||
enchant = getHNOPtr!(Enchantment)("ENAM", enchants);
|
||||
|
||||
makeProto();
|
||||
|
||||
proto.setInt("type", data.type);
|
||||
proto.setInt("armor", data.armor);
|
||||
|
||||
proto.setInt("health", data.health);
|
||||
}}
|
||||
}
|
||||
ListID!(Armor) armors;
|
Loading…
Reference in New Issue