~ruther/NosSmooth

ref: 45f8bc92fd853ae7008cf52c153aa71368f11f32 NosSmooth/Local/NosSmooth.LocalCore/Character.cpp -rw-r--r-- 817 bytes
45f8bc92 — František Boháček feat: use nostale bindings instead of nossmooth core 3 years ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "Character.h"
#include <windows.h>
using namespace NosSmoothCore;
using namespace System;
using namespace System::Runtime::InteropServices;

Character::Character(ModuleHook moduleHook)
{
    CharacterUnmanaged::GetInstance()->Setup(moduleHook);
}

void Character::Walk(int x, int y)
{
    DWORD position = (y << 16) | x;
    CharacterUnmanaged::GetInstance()->Walk(position);
}

void Character::SetWalkCallback(WalkCallback^ walkCallback)
{
    _walkCallback = walkCallback;
    IntPtr functionPointer = Marshal::GetFunctionPointerForDelegate(walkCallback);
    CharacterUnmanaged::GetInstance()->SetWalkCallback(static_cast<NativeWalkCallback>(functionPointer.ToPointer()));
}

void NosSmoothCore::Character::ResetHooks()
{
    CharacterUnmanaged::GetInstance()->ResetHooks();
}
Do not follow this link