rodecomp/Source/Contents/Effects/EffectPrimitiveRecords.cpp
ragnarok-clanker a47d20f8be Reconstruct readable C++ and organize cohesive source subsystems
Administrative source import: native x86 compilation passed for 423 authored units. Source placement and submission states are migrated separately; this commit does not imply peer acceptance.

Previous head: 35d2a8cb36
Payload SHA256: 592f016d2730c5593bb653aa054c1e5f76a6df72c8f5a09e66f74876e2e33dee
2026-10-25 07:42:41 +00:00

27 lines
1.1 KiB
C++

#include "Contents/Effects/EffectPrimitiveState.h"
#include "Contents/Actors/RenderObjectState.h"
#include "Utility/Math/ScalarConversion.h"
#include <cstring>
// OFFSET: 0x00BAE670
// FUNCTION: fn_19768
void EffectPrimitiveState::InitializeRecords(const RenderObjectState& render) {
for (int index = 0; index < this->unknown_01F4; ++index) {
EffectPrimitiveRecord& record = this->records[index];
record.position = {render.position[0], render.position[1], render.position[2]};
std::memcpy(record.corners, this->corners, sizeof(record.corners));
record.unknown_003C = this->unknown_0348;
record.scale = this->scale;
record.angle = this->unknown_030C;
std::memcpy(record.matrix, this->matrix1, sizeof(record.matrix));
record.alpha = this->unknown_0324;
record.red = this->red;
record.green = this->green;
record.blue = this->blue;
const int alpha = TruncateToInt(this->unknown_0324);
record.color = static_cast<unsigned char>(this->blue) +
((static_cast<unsigned char>(this->green) + ((static_cast<unsigned char>(this->red) + (static_cast<std::uint32_t>(alpha) << 8)) << 8)) << 8);
}
}