enderalse/source/Enderal DLL/src/Patches/FlatMapMarkers.h

21 lines
761 B
C
Raw Normal View History

#pragma once
// Based on Ryan McKenzie's Flat Map Markers
// CommonLibSSE-NG update by Eddoursul
namespace FlatMapMarkers
{
inline void Hook_WorldPtToScreenPt3(RE::NiCamera* a_camera, RE::NiPoint3& a_in, float& a_xOut, float& a_yOut, float& a_zOut, float a_zeroTolerance)
{
a_in.z = 100000.156250;
RE::NiCamera::WorldPtToScreenPt3(a_camera->GetRuntimeData().worldToCam, a_camera->GetRuntimeData2().port, a_in, a_xOut, a_yOut, a_zOut, a_zeroTolerance);
}
inline void Install()
{
2023-12-21 11:41:08 +00:00
// Checked: 1.5.97, 1.6.640, 1.6.659, 1.6.1130
REL::Relocation<std::uintptr_t> offset{ REL::RelocationID(52224, 53111), REL::Relocate(0x22F, 0x21F) };
SKSE::AllocTrampoline(14);
2023-12-21 11:41:08 +00:00
SKSE::GetTrampoline().write_call<5>(offset.address(), &Hook_WorldPtToScreenPt3);
}
}