
01.07.2024, 14:42
|
|
Познающий
Регистрация: 21.01.2019
Сообщений: 62
С нами:
3847510
Репутация:
58
|
|
Сообщение от AdCKuY_DpO4uLa
полный код кинь
radar.cpp:
Код:
#include "radar.h"
void radar::initialize() {
hookTransformPos.set_dest(0x583480);
hookTransformPos.set_cb(std::bind(&radar::transformPos, this, _1, _2, _3));
hookTransformPos.install();
}
RwV2d* __cdecl radar::transformPos(const decltype(hookTransformPos)& hook, CVector2D* out, CVector2D* in) {
if (FrontEndMenuManager.drawRadarOrMap) {
out->x = FrontEndMenuManager.m_fMapZoom * in->x + FrontEndMenuManager.m_fMapBaseX;
out->y = FrontEndMenuManager.m_fMapBaseY - FrontEndMenuManager.m_fMapZoom * in->y;
}
else {
out->x = 0.5 * (94.0 * (RsGlobal.maximumWidth * 0.0015625)) + RsGlobal.maximumWidth * 0.0015625 * 40.0 + 94.0 * (RsGlobal.maximumWidth * 0.0015625) * in->x * 0.5;
out->y = RsGlobal.maximumHeight - 0.002232143 * RsGlobal.maximumHeight * 104.0 + 76.0 * (0.002232143 * RsGlobal.maximumHeight) * 0.5 - 76.0 * (0.002232143 * RsGlobal.maximumHeight) * in->y * 0.5;
}
return hook.get_trampoline()(out, in);
}
radar.h:
Код:
#pragma once
#include
#include
#include
#include
#include
#include "CMenuManager.h"
using namespace plugin;
using namespace std::placeholders;
class radar {
public:
void initialize();
private:
kthook::kthook_simple hookTransformPos {};
RwV2d* __cdecl transformPos(const decltype(hookTransformPos)& hook, CVector2D* out, CVector2D* in);
};
inline radar g_radar;
|
|
|