Files
wowdecomp/Engine/Source/Tempest/C2Vector.cpp
T
SatyandClaude Opus 5.5 34770ee7ab Frame: port Engine/Frame (waves 1-4), 1667 of 1669 functions
Core (CSimpleFrame + Lua, CSimpleTop/CFrameStrata/CSimpleRender/
CRenderBatch, CSimpleRegion/CBackdropGenerator/CScriptRegion), animation,
text (FontString/Font/Fontable), texture and model, buttons, EditBox,
MessageFrame/MessageScrollFrame, MovieFrame/ColorSelect/StatusBar,
Slider/ScrollFrame/HTML/HyperlinkedFrame, all Lua method tables and
RegisterScriptMethods. Layouts, vtables and sizes rebuilt from the
12340 ctors, vtables and allocator initializers; CScriptObject vtable
slots 5/6 fixed; CSimpleFontedFrame is a real secondary base. Lua error
paths return after luaL_error as in 12340 (209 sites; 5 fall through).
Binary quirks kept and documented in docs/.

Supporting additions: Event key/char/ime/focus/size event headers,
Scrn/Scrn.h (ScrnLayerCreate), DivxDecoder import declarations,
C2Vector/CRect helpers, CM2Light dtor, OsInputEnableSecureMode, stpl.h
instance addresses, FrameXML LoadXML_AnimGroup/Create_SimpleMovieFrame.
Engine->WoW includes where 12340 calls directly: CSimpleModelFFX,
StringToMouseButton, GetDeclinedWord, EmblemTextureUpdate.

Also drops stale VERIFY stamps found invalid by the harness recheck.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
2026-09-27 15:32:18 +02:00

37 lines
836 B
C++

#include <cmath>
#include "Engine/Source/Tempest/C2Vector.h"
#include "Engine/Source/Tempest/C3Vector.h"
// INLINED
C2Vector::C2Vector(float x, float y) {
this->x = x;
this->y = y;
}
// VERIFY: 955bf3fe manual
// OFFSET: 0x0048B820
void C2Vector::NormalizeSafe() {
float length = this->y * this->y + this->x * this->x;
if (length > 0.00000023841858f) {
float scale = 1.0f / sqrt(length);
this->x = this->x * scale;
this->y = scale * this->y;
}
}
// VERIFY: 1302d485 manual
// OFFSET: 0x004C4DF0
C2Vector::C2Vector(const C3Vector& v) {
this->x = v.x;
this->y = v.y;
}
// VERIFY: 0582b503 manual
// OFFSET: 0x006FF6A0
void C2Vector::Normalize() {
float scale = 1.0f / sqrt(this->x * this->x + this->y * this->y);
this->x = this->x * scale;
this->y = scale * this->y;
}