File: loadbody.hpp

package info (click to toggle)
openmw 0.49.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 33,992 kB
  • sloc: cpp: 372,479; xml: 2,149; sh: 1,403; python: 797; makefile: 26
file content (79 lines) | stat: -rw-r--r-- 1,795 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
#ifndef OPENMW_ESM_BODY_H
#define OPENMW_ESM_BODY_H

#include "components/esm/defs.hpp"
#include "components/esm/refid.hpp"

#include <cstdint>
#include <string>

namespace ESM
{

    class ESMReader;
    class ESMWriter;

    struct BodyPart
    {
        constexpr static RecNameInts sRecordId = REC_BODY;

        /// Return a string descriptor for this record type. Currently used for debugging / error logs only.
        static std::string_view getRecordType() { return "BodyPart"; }

        enum MeshPart
        {
            MP_Head = 0,
            MP_Hair = 1,
            MP_Neck = 2,
            MP_Chest = 3,
            MP_Groin = 4,
            MP_Hand = 5,
            MP_Wrist = 6,
            MP_Forearm = 7,
            MP_Upperarm = 8,
            MP_Foot = 9,
            MP_Ankle = 10,
            MP_Knee = 11,
            MP_Upperleg = 12,
            MP_Clavicle = 13,
            MP_Tail = 14,

            MP_Count = 15
        };

        enum Flags
        {
            BPF_Female = 1,
            BPF_NotPlayable = 2
        };

        enum MeshType
        {
            MT_Skin = 0,
            MT_Clothing = 1,
            MT_Armor = 2
        };

        struct BYDTstruct
        {
            unsigned char mPart; // mesh part
            unsigned char mVampire; // boolean
            unsigned char mFlags;
            unsigned char mType; // mesh type
        };

        BYDTstruct mData;
        uint32_t mRecordFlags;
        RefId mId, mRace;
        std::string mModel;

        void load(ESMReader& esm, bool& isDeleted);
        void save(ESMWriter& esm, bool isDeleted = false) const;

        void blank();
        ///< Set record to default state (does not touch the ID).
    };

    bool isFirstPersonBodyPart(const BodyPart& value);
}
#endif