-
Notifications
You must be signed in to change notification settings - Fork 44
Expand file tree
/
Copy pathBSShaderProperty.cpp
More file actions
158 lines (115 loc) · 4.23 KB
/
Copy pathBSShaderProperty.cpp
File metadata and controls
158 lines (115 loc) · 4.23 KB
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
/* Copyright (c) 2006, NIF File Format Library and Tools
All rights reserved. Please see niflib.h for license. */
//-----------------------------------NOTICE----------------------------------//
// Some of this file is automatically filled in by a Python script. Only //
// add custom code in the designated areas or it will be overwritten during //
// the next update. //
//-----------------------------------NOTICE----------------------------------//
//--BEGIN FILE HEAD CUSTOM CODE--//
//--END CUSTOM CODE--//
#include "../../include/FixLink.h"
#include "../../include/ObjectRegistry.h"
#include "../../include/NIF_IO.h"
#include "../../include/obj/BSShaderProperty.h"
using namespace Niflib;
//Definition of TYPE constant
const Type BSShaderProperty::TYPE("BSShaderProperty", &NiProperty::TYPE );
BSShaderProperty::BSShaderProperty() : flags((unsigned short)1), shaderType((BSShaderType)SHADER_DEFAULT), shaderFlags((BSShaderFlags)0x82000000), unknownInt2((int)1), envmapScale(1.0f) {
//--BEGIN CONSTRUCTOR CUSTOM CODE--//
//--END CUSTOM CODE--//
}
BSShaderProperty::~BSShaderProperty() {
//--BEGIN DESTRUCTOR CUSTOM CODE--//
//--END CUSTOM CODE--//
}
const Type & BSShaderProperty::GetType() const {
return TYPE;
}
NiObject * BSShaderProperty::Create() {
return new BSShaderProperty;
}
void BSShaderProperty::Read( istream& in, list<unsigned int> & link_stack, const NifInfo & info ) {
//--BEGIN PRE-READ CUSTOM CODE--//
//--END CUSTOM CODE--//
NiProperty::Read( in, link_stack, info );
NifStream( flags, in, info );
NifStream( shaderType, in, info );
NifStream( shaderFlags, in, info );
NifStream( unknownInt2, in, info );
if ( (info.userVersion == 11) ) {
NifStream( envmapScale, in, info );
};
//--BEGIN POST-READ CUSTOM CODE--//
//--END CUSTOM CODE--//
}
void BSShaderProperty::Write( ostream& out, const map<NiObjectRef,unsigned int> & link_map, list<NiObject *> & missing_link_stack, const NifInfo & info ) const {
//--BEGIN PRE-WRITE CUSTOM CODE--//
//--END CUSTOM CODE--//
NiProperty::Write( out, link_map, missing_link_stack, info );
NifStream( flags, out, info );
NifStream( shaderType, out, info );
NifStream( shaderFlags, out, info );
NifStream( unknownInt2, out, info );
if ( (info.userVersion == 11) ) {
NifStream( envmapScale, out, info );
};
//--BEGIN POST-WRITE CUSTOM CODE--//
//--END CUSTOM CODE--//
}
std::string BSShaderProperty::asString( bool verbose ) const {
//--BEGIN PRE-STRING CUSTOM CODE--//
//--END CUSTOM CODE--//
stringstream out;
out << NiProperty::asString();
out << " Flags: " << flags << endl;
out << " Shader Type: " << shaderType << endl;
out << " Shader Flags: " << shaderFlags << endl;
out << " Unknown Int 2: " << unknownInt2 << endl;
out << " Envmap Scale: " << envmapScale << endl;
return out.str();
//--BEGIN POST-STRING CUSTOM CODE--//
//--END CUSTOM CODE--//
}
void BSShaderProperty::FixLinks( const map<unsigned int,NiObjectRef> & objects, list<unsigned int> & link_stack, list<NiObjectRef> & missing_link_stack, const NifInfo & info ) {
//--BEGIN PRE-FIXLINKS CUSTOM CODE--//
//--END CUSTOM CODE--//
NiProperty::FixLinks( objects, link_stack, missing_link_stack, info );
//--BEGIN POST-FIXLINKS CUSTOM CODE--//
//--END CUSTOM CODE--//
}
std::list<NiObjectRef> BSShaderProperty::GetRefs() const {
list<Ref<NiObject> > refs;
refs = NiProperty::GetRefs();
return refs;
}
std::list<NiObject *> BSShaderProperty::GetPtrs() const {
list<NiObject *> ptrs;
ptrs = NiProperty::GetPtrs();
return ptrs;
}
//--BEGIN MISC CUSTOM CODE--//
unsigned short BSShaderProperty::GetFlags() const {
return flags;
}
void BSShaderProperty::SetFlags( unsigned short value ) {
flags = value;
}
BSShaderType BSShaderProperty::GetShaderType() const {
return shaderType;
}
void BSShaderProperty::SetShaderType( const BSShaderType & value ) {
shaderType = value;
}
BSShaderFlags BSShaderProperty::GetShaderFlags() const {
return shaderFlags;
}
void BSShaderProperty::SetShaderFlags( const BSShaderFlags & value ) {
shaderFlags = value;
}
float BSShaderProperty::GetEnvmapScale() const {
return envmapScale;
}
void BSShaderProperty::SetEnvmapScale( float value ) {
envmapScale = value;
}
//--END CUSTOM CODE--//