Decompile fn_17493 (C3dActorV1::Update)

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

- fn_17493 C3dActorV1::Update: logic confirmed by peer review

Peer-reviewed-by: Yommy, dori, codeplay
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-05 16:01:26 +00:00
commit 3f9b790c6e

View file

@ -17,24 +17,38 @@ namespace {
// OFFSET: 0x00AB7930
// FUNCTION: fn_17493
void C3dActorV1::Update() {
if (this->playback != 1 && this->playback != 2) {
return;
switch (this->playback) {
case 1: {
const unsigned tick = GetTickCount();
if (tick == this->lastTick) {
return;
}
this->frame = static_cast<int>(this->speed * 100.0f + static_cast<float>(this->frame));
if (this->frame >= this->animationLength) {
this->frame = this->animationLength - 1;
}
this->Animate(static_cast<double>(this->frame));
this->lastTick = tick;
break;
}
case 2: {
const unsigned tick = GetTickCount();
if (tick == this->lastTick) {
return;
}
this->frame = static_cast<int>(this->speed * 100.0f + static_cast<float>(this->frame));
if (this->frame >= this->animationLength) {
this->frame = 0;
}
this->Animate(static_cast<double>(this->frame));
this->lastTick = tick;
break;
}
}
const unsigned tick = GetTickCount();
if (tick == this->lastTick) {
return;
}
this->frame = TruncateToInt(this->speed * 100.0f + static_cast<float>(this->frame));
if (this->frame >= this->animationLength) {
this->frame = this->playback == 1 ? this->animationLength - 1 : 0;
}
this->Animate(static_cast<double>(this->frame));
this->lastTick = tick;
}
// OFFSET: 0x00AB7A10