Decompile fn_21038 (CRenderObject::ScaleByFadePulse)

Batch #10517 by cremane: 0 byte-identical, 1 confirmed by peer review.

- fn_21038 CRenderObject::ScaleByFadePulse: logic confirmed by peer review

Peer-reviewed-by: Toshiro, dori, StrawberrysherbetIX
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-11-04 16:33:55 +00:00
commit b2ee23901d

View file

@ -2913,11 +2913,11 @@ void CGameActor::SetUnknown03C4(int value) {
// FUNCTION: fn_21038
void CRenderObject::ScaleByFadePulse(float& scale) const {
if ((this->render.flags & 0x10) != 0) {
const unsigned index = std::max(this->render.pulsePhases[0] * 4u + 90u, 90u);
if (index <= 270) {
scale = ((ClientSine(index) + 1.0f) * 0.25f + 0.5f) * scale;
} else {
const unsigned index = this->render.pulsePhases[0] * 4u + 90u;
if (index > 270) {
scale = scale * 0.5f;
} else {
scale = ((g_sinTable[std::max(index, 90u)] + 1.0f) * 0.25f + 0.5f) * scale;
}
}
}