MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / DrawCompass

Method DrawCompass

TombEngine/Game/gui.cpp:3413–3430  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3411 }
3412
3413 void GuiController::DrawCompass(ItemInfo* item)
3414 {
3415 if (!Lara.Inventory.HasCompass)
3416 return;
3417
3418 constexpr auto POS_2D = Vector2(130.0f, 450.0f);
3419 constexpr auto LERP_ALPHA = 0.1f;
3420
3421 auto needleOrient = EulerAngles(0, CompassNeedleAngle, 0);
3422 needleOrient.Lerp(EulerAngles(0, item->Pose.Orientation.y, 0), LERP_ALPHA);
3423
3424 float wibble = std::sin((float(GlobalCounter & 0x3F) / (float)0x3F) * PI_MUL_2);
3425 CompassNeedleAngle = needleOrient.y + ANGLE(wibble);
3426
3427 // HACK: Needle is rotated in the draw function.
3428 const auto& invObject = InventoryObjectTable[INV_OBJECT_COMPASS];
3429 g_Renderer.DrawObjectIn2DSpace(ID_COMPASS_ITEM, POS_2D, EulerAngles::Identity, invObject.Scale1 * 1.5f);
3430 }
3431
3432 int GuiController::GetLoadSaveSelection()
3433 {

Callers 1

RenderNewInventoryMethod · 0.80

Calls 5

ANGLEFunction · 0.85
DrawObjectIn2DSpaceMethod · 0.80
Vector2Function · 0.50
EulerAnglesClass · 0.50
LerpMethod · 0.45

Tested by

no test coverage detected