MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / emit

Method emit

src/SB/Core/x/xDecal.cpp:131–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

129}
130
131void xDecalEmitter::emit(const xMat4x3& mat, S32 texture_index)
132{
133 if (this->units.full())
134 {
135 this->units.pop_back();
136 }
137
138 this->units.push_front();
139 unit_data& udata = this->units.front();
140 udata.age = 0.0f;
141
142 if (this->cfg.flags & 0x2)
143 {
144 udata.mat.right.assign(1.0f, 1.0f, 1.0f);
145 udata.mat.pos = mat.pos;
146 udata.cull_size = 0.5f;
147 }
148 else
149 {
150 udata.mat = mat;
151 F32 greatest_length = choose_greatest(udata.mat.right.length(), udata.mat.up.length(), udata.mat.at.length());
152 udata.cull_size = greatest_length * 0.5f;
153 }
154
155 if (texture_index < 0 || texture_index > (S32)this->texture.units)
156 {
157 texture_index = this->select_texture_unit();
158 }
159
160 udata.u = texture_index % this->cfg.texture.rows;
161 udata.v = texture_index / this->cfg.texture.rows;
162}
163
164namespace
165{

Callers 1

start_effectsMethod · 0.45

Calls 6

select_texture_unitMethod · 0.95
choose_greatestFunction · 0.85
push_frontMethod · 0.80
lengthMethod · 0.80
fullMethod · 0.45
pop_backMethod · 0.45

Tested by

no test coverage detected