Files
t5de-renderer/adapter/scene_hooks.hpp
T
dhkatzandClaude Opus 5.5 2471b1fd4f
CI / build (push) Successful in 27s
Pose avatars between ticks
ModelInstance::render poses its model (updateCalSkeleton) before drawing it;
the adapter redirects that one call (after checking it) to ours, which between
ticks moves each playing animation that went on a frame at the last tick ahead
by the fraction of a frame since, has IMVU's code pose the skeleton (Cal3D
poses between keyframes), and puts the animations back, marking the skeleton
to be posed again. Held, looping and starting animations are posed as they
are. The frame lengths come from zero.dll's millisecondsPerFrame and
secondsPerFrame.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-28 21:38:07 -07:00

26 lines
1.3 KiB
C++

#pragma once
// Our hooks into SceneWindow.dll's scene code, installed once, the first time an engine is made. Each replaces where
// IMVU's code calls a function (an entry of an exported vtable, or a call instruction's target), after checking it
// calls the function expected, with ours, which calls IMVU's: nothing else is changed, and nothing is if a check
// fails (an unexpected SceneWindow.dll: the hooks' features are then off, and the client runs as it would without).
//
// - SceneViewer::step (the IFrameListener vtable): the client's tick, 30 times a second (SceneWindow.dll's runApp
// calls stepFrame, which steps each scene viewer). Recorded, for the frame pacer and for drawing between ticks.
// - ModelInstance::render's call to updateCalSkeleton, which poses the model before it's drawn: between ticks, the
// model is posed at the time between them (its animations' times moved on by the fraction of a frame since the
// tick; Cal3D poses between keyframes), then its animations are put back as they were.
#include <cstdint>
namespace t5de::scene_hooks {
void install();
// Whether the hooks are installed.
[[nodiscard]] bool installed();
// When a scene viewer last stepped (QueryPerformanceCounter), or 0 if none has.
[[nodiscard]] std::int64_t lastStep();
} // namespace t5de::scene_hooks