rodecomp/Source/Contents/Effects/EffectPrimitiveRecords.cpp
ragnarok-clanker 2e808aaa74 Decompile 3 functions in Source/Contents/Effects/EffectPrimitiveMotion.cpp, Source/Contents/Effects/EffectParticle.h, ...
Batch #1853 by ragnarok-clanker: 1 byte-identical, 2 confirmed by peer review.

- fn_19849 EffectPrimitiveState::UpdateColor: logic confirmed by peer review
- fn_19762 EffectPrimitiveSlot::EffectPrimitiveSlot: byte-identical (already on main)
- fn_19865 DrawEffectPrimitive15: logic confirmed by peer review

Peer-reviewed-by: Yommy
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
2026-10-28 22:53:38 +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->alpha;
record.red = this->red;
record.green = this->green;
record.blue = this->blue;
const int alpha = TruncateToInt(this->alpha);
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);
}
}