MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / SetMeshSwapFlags

Method SetMeshSwapFlags

TombEngine/Game/items.cpp:140–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

138}
139
140void ItemInfo::SetMeshSwapFlags(unsigned int flags, bool clear)
141{
142 const auto& object = Objects[ObjectNumber];
143
144 bool isMeshSwapPresent = (object.meshSwapSlot != NO_VALUE && Objects[object.meshSwapSlot].loaded);
145
146 for (int i = 0; i < Model.MeshIndex.size(); i++)
147 {
148 if (isMeshSwapPresent && (flags & (1 << i)))
149 {
150 if (clear)
151 {
152 Model.MeshIndex[i] = Model.BaseMesh + i;
153 }
154 else
155 {
156 const auto& meshSwapObject = Objects[object.meshSwapSlot];
157 Model.MeshIndex[i] = meshSwapObject.meshIndex + i;
158 }
159 }
160 else
161 {
162 Model.MeshIndex[i] = Model.BaseMesh + i;
163 }
164 }
165}
166
167void ItemInfo::SetMeshSwapFlags(const std::vector<unsigned int>& flags, bool clear)
168{

Callers 15

InitializeGuardFunction · 0.80
GuardControlFunction · 0.80
InitializeMafia2Function · 0.80
Mafia2ControlFunction · 0.80
InitializeGladiatorFunction · 0.80
RomanStatueControlFunction · 0.80
ImpControlFunction · 0.80
CyborgControlFunction · 0.80
InitializeGuideFunction · 0.80
GuideControlFunction · 0.80
InitializeBaddyFunction · 0.80
BaddyControlFunction · 0.80

Calls 3

ToPackedBitsMethod · 0.80
sizeMethod · 0.45
SetMethod · 0.45

Tested by

no test coverage detected