You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.3 KiB
C++
67 lines
1.3 KiB
C++
15 years ago
|
#ifndef _ESM_REGN_H
|
||
|
#define _ESM_REGN_H
|
||
|
|
||
|
#include "esm_reader.hpp"
|
||
|
|
||
|
namespace ESM {
|
||
|
|
||
|
/*
|
||
|
* Region data
|
||
|
*/
|
||
|
|
||
|
struct Region
|
||
|
{
|
||
15 years ago
|
#pragma pack(push)
|
||
|
#pragma pack(1)
|
||
15 years ago
|
struct WEATstruct
|
||
|
{
|
||
|
// I guess these are probabilities
|
||
|
char clear, cloudy, foggy, overcast, rain, thunder, ash,
|
||
|
blight,
|
||
|
// Unknown weather, probably snow and something. Only
|
||
|
// present in file version 1.3.
|
||
|
a,b;
|
||
|
}; // 10 bytes
|
||
|
|
||
|
// Reference to a sound that is played randomly in this region
|
||
|
struct SoundRef
|
||
|
{
|
||
|
NAME32 sound;
|
||
|
char chance;
|
||
|
}; // 33 bytes
|
||
15 years ago
|
#pragma pack(pop)
|
||
15 years ago
|
|
||
|
WEATstruct data;
|
||
|
int mapColor; // RGBA
|
||
|
|
||
|
// sleepList refers to a eveled list of creatures you can meet if
|
||
|
// you sleep outside in this region.
|
||
|
std::string name, sleepList;
|
||
|
|
||
|
std::vector<SoundRef> soundList;
|
||
|
|
||
|
void load(ESMReader &esm)
|
||
|
{
|
||
|
name = esm.getHNString("FNAM");
|
||
|
|
||
|
if(esm.getVer() == VER_12)
|
||
|
esm.getHNExact(&data, sizeof(data)-2, "WEAT");
|
||
|
else if(esm.getVer() == VER_13)
|
||
|
esm.getHNExact(&data, sizeof(data), "WEAT");
|
||
|
else esm.fail("Don't know what to do in this version");
|
||
|
|
||
|
sleepList = esm.getHNOString("BNAM");
|
||
|
|
||
|
esm.getHNT(mapColor, "CNAM");
|
||
|
|
||
|
while(esm.hasMoreSubs())
|
||
|
{
|
||
|
SoundRef sr;
|
||
|
esm.getHNT(sr, "SNAM", 33);
|
||
|
soundList.push_back(sr);
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
}
|
||
|
#endif
|