Maintenance: D15: FaceCamera written as the original client source does it (store the float->short angle into alphaT, then recompute

Batch #18240 by ragnarok-clanker: forced by an admin (14 lower score(s), 49 changed function(s)); checked with 18 compiled unit(s), including every includer of Source/Contents/Effects/Primitives/EffectPrim.h.
This commit is contained in:
ragnarok-clanker 2026-11-12 12:02:30 +00:00
commit 8d7781e4e5
2 changed files with 8 additions and 4 deletions

View file

@ -157,7 +157,7 @@ struct CEffectPrim : CRenderObject {
bool IsPartyVisible();
unsigned char FollowMasterAndAdvance();
void FollowMasterAndTickSlots();
void FollowMasterAndTickSlots2();
bool FollowMasterAndTickSlots2();
void ShiftSegment();
void InitSegment();
void RenderTeiRect(int* rpCnt, short alpha, vector3d vec1, vector3d vec2, vector3d vec3, vector3d vec4, matrix& wtm, short pw, char tn, char f1, unsigned char r, unsigned char g, unsigned char b, float ty1, float ty2, float tx, float tx2, char extra);

View file

@ -89,8 +89,11 @@ namespace {
// INLINED
__forceinline void FaceCamera(EffectPrimitiveSlot* slots) {
const CView* view = static_cast<CGameMode*>(g_modeMgr.GetGameMode())->camera;
slots[0].alphaT = static_cast<std::int16_t>(360 - static_cast<int>(view->camera.yaw));
slots[1].alphaT = static_cast<std::int16_t>(360 - static_cast<int>(view->camera.pitch) + 90);
slots[0].alphaT = static_cast<std::int16_t>(view->camera.yaw);
slots[0].alphaT = 360 - slots[0].alphaT;
slots[1].alphaT = static_cast<std::int16_t>(view->camera.pitch);
slots[1].alphaT = 360 - slots[1].alphaT + 90;
if (slots[1].alphaT >= 360) {
slots[1].alphaT -= 360;
@ -3006,9 +3009,10 @@ __declspec(noinline) void CEffectPrim::FollowMasterAndTickSlots() {
// OFFSET: 0x00BE8770
// FUNCTION: fn_19944
__declspec(noinline) void CEffectPrim::FollowMasterAndTickSlots2() {
__declspec(noinline) bool CEffectPrim::FollowMasterAndTickSlots2() {
FollowMaster(*this);
TickLiveSlots(this->state.slots);
return true;
}
// INLINED