#pragma once

#include "sdk/defines.hpp"

// Uncomment this for vulkan support, add '-vulkan' into your launch
// parameters and lastly include both 'imgui_impl_vulkan' files.
//
// Vulkan SDK is needed only for building!
// #define SDK_ENABLE_VULKAN_SUPPORT

// Pretty self-explanatory.
#define SDK_ENABLE_LOGGING

// Prints schema offsets in console.
// #define SDK_ENABLE_SCHEMA_FIELD_OFFSET_LOGGING

// Helper
#define SDK_SIG(sig) \
    stb::simple_conversion::build<stb::fixed_string{sig}>::value

// Modules
#define CLIENT_DLL "client.dll"
#define ENGINE2_DLL "engine2.dll"
#define SCHEMASYSTEM_DLL "schemasystem.dll"
#define INPUTSYSTEM_DLL "inputsystem.dll"
#define SDL3_DLL "SDL3.dll"
#define TIER0_DLL "tier0.dll"
#define NAVSYSTEM_DLL "navsystem.dll"
#define RENDERSYSTEMVULKAN_DLL "rendersystemvulkan.dll"
#define LOCALIZE_DLL "localize.dll"
#define PARTICLES_DLL "particles.dll"
#define SCENESYSTEM_DLL "scenesystem.dll"
#define MATERIALSYSTEM_DLL "materialsystem2.dll"
#define GPAPI_DLL "navsystem.dll"

// Interfaces
#define GAME_RESOURCE_SERVICE_CLIENT "GameResourceServiceClientV001"
#define SOURCE2_CLIENT "Source2Client002"
#define SCHEMA_SYSTEM "SchemaSystem_001"
#define INPUT_SYSTEM_VERSION "InputSystemVersion001"
#define SOURCE2_ENGINE_TO_CLIENT "Source2EngineToClient001"
#define ENGINE_CVAR "VEngineCvar007"
#define LOCALIZE "Localize_001"
#define MATERIAL_SYSTEM "VMaterialSystem2_001"

// Signatures
#define GET_HIGHEST_ENTITY_INDEX SDK_SIG("33 DB E8 ? ? ? ? 8B 08")
#define GET_BASE_ENTITY SDK_SIG("81 FA FE 7F 00 00 77 36")
#define PRINT_SCHEMA_DETAILED_CLASS_LAYOUT \
    SDK_SIG("48 89 5C 24 ? 48 89 6C 24 ? 48 89 4C 24 ?")
#define GET_GC_CLIENT_SYSTEM SDK_SIG("E8 ? ? ? ? 48 85 C0 0F 84 ? ? ? ? 48 8D 0D ? ? ? ? FF 15 ? ? ? ? 48 83 38 00 74 6A 48 85 F6 0F 84")
#define CREATE_BASE_TYPE_CACHE SDK_SIG("E8 ? ? ? ? 33 C9 8B D1")
#define FIND_SO_CACHE SDK_SIG("E8 ? ? ? ? 48 8B F0 48 85 C0 74 0E 4C 8B C3")
#define GET_LOCAL_PLAYER_CONTROLLER SDK_SIG("E8 ? ? ? ? 48 85 C0 74 15 8B CB E8 ? ? ? ? 48 8B D0 41 B0 01")
#define SET_DYNAMIC_ATTRIBUTE_VALUE_UINT                                       \
    SDK_SIG(                                                                   \
        "E9 ? ? ? ? CC CC CC CC CC CC CC CC CC CC CC CC CC CC CC 49 8B C0 48 " \
        "8B CA 48 8B D0")
#define COMPUTE_HITBOX_SURROUNDING_BOX SDK_SIG("E8 ? ? ? ? E9 ? ? ? ? 48 8B CB E8 ? ? ? ? E9 ? ? ? ? 48 8B 4B 08")
#define MOUSE_INPUT_ENABLED \
    SDK_SIG("40 53 48 83 EC 20 80 B9 ? ? ? ? ? 48 8B D9 75 78")
#define GET_MATRICES_FOR_VIEW SDK_SIG("40 53 48 81 EC ? ? ? ? 49 8B C1")
#define CREATMOVE_SIG SDK_SIG("48 8B C4 4C 89 40 18 48 89 48 08 55 53 57 41 54 48 8D A8")
// new
#define GET_WEAPON_DATA                                                      \
    SDK_SIG(                                                                 \
        "48 81 EC ? ? ? ? 48 85 C9 75 ? 33 C0 48 81 C4 ? ? ? ? C3 48 89 9C " \
        "24")
#define GET_BONE_FLAGS SDK_SIG("85 D2 78 16 3B 91")
#define GET_BONE_PARENT SDK_SIG("85 D2 78 17 3B 91 78")
#define GET_BONE_NAME SDK_SIG("85 D2 78 25 3B 91")
#define GET_BONE_INDEX SDK_SIG("E8 ? ? ? ? 85 C0 78 ? 4C 8D 4D")
#define GET_HITBOX_SET SDK_SIG("E8 ? ? ? ? 48 85 C0 0F 85 ? ? ? ? 44 8D 48 07")
// chams

#define C_CSGO_INPUT SDK_SIG("48 8B 0D ? ? ? ? 4C 8D 8F ? ? ? ? 45 33 FF")
#define SET_MATERIAL                                                         \
    SDK_SIG(                                                                 \
        "48 89 5C 24 ? 48 89 6C 24 ? 56 57 41 54 41 56 41 57 48 83 EC ? 0F " \
        "B6 01 45 0F B6 F9 8B 2A 48 8B F9")
#define FIND_VAR SDK_SIG("48 89 5C 24 ? 57 48 81 EC ? ? ? ? 33 C0 8B DA")
#define DRAW_OBJECT SDK_SIG("48 8B C4 48 89 50 10 53")
#define SET_MATERIAL_SHADER \
    SDK_SIG("E8 ? ? ? ? 48 8D 05 ? ? ? ? C7 44 24 20 9B 01 F3 D1")

#define CREATE_MATERIAL                                                   \
    SDK_SIG(                                                              \
        "48 89 5C 24 ? 48 89 6C 24 ? 56 57 41 56 48 81 EC ? ? ? ? 48 8D 0D")
#define LOAD_KEY_VALUES SDK_SIG("40 53 48 83 EC ? 48 C7 C0 ? ? ? ?")
#define SET_TYPE SDK_SIG("E8 ? ? ? ? 4C 89 7B 30")
#define FREE_ALLOC_KV3 SDK_SIG("E8 ? ? ? ? 48 8B 43 08 FF 4B 14")
/* TRACE */
#define GET_HANDLE_FROM_ENTITY                                                \
    SDK_SIG(                                                                  \
        "48 85 C9 74 ? 48 8B 41 ? 48 85 C0 74 ? 44 8B 40 ? BA ? ? ? ? 8B 48 " \
        "? "                                                                  \
        "41 8B C0 83 E1")
#define TRACE_SHAPE SDK_SIG("E8 ? ? ? ? 80 7D ? ? 75 ? F3 0F 10 45")

#define ENGINE_TRACE SDK_SIG("4C 8B 3D ? ? ? ? 24 C9 0C 49 66 0F 7F 45 ?")
#define GLOBAL_VARS SDK_SIG("48 89 0D ? ? ? ? 48 89 41")
#define GET_SURFACE_DATA SDK_SIG("E8 ? ? ? ? 48 85 C0 74 ? 44 38 60")
#define SET_VIEW_ANGLE SDK_SIG("F2 41 0F 10 00 4C 63 CA")
#define FRAMESTAGE_NOTIFY SDK_SIG("48 89 5C 24 ? 56 48 83 EC 30 8B 05")

#define UPDATE_3D_PARAMS SDK_SIG("48 89 5C 24 08 48 89 74 24 10 57 48 83 EC 70 8B 05 AB D8 08 01")
#define UPDATE_COLOR_TO_SCENE SDK_SIG("E8 ? ? ? ? 48 8B 4C 24 ? 33 D2 4C 8B 54 24 ? 4C 8B 5C 24 ? 8B 00 4C 89 77 18")
#define HK_SETUP_LIGHT SDK_SIG("E8 ? ? ? ? 4C 8B 8F")
#define SKYBOX_COLOR_UPDATE SDK_SIG("48 8B C4 48 89 58 18 48 89 70 20 55 57 41 54 41 55")
#define TEST_SOSAL SDK_SIG("40 53 48 83 EC 30 48 8B D9 49 BA ? ? ? ? ? ? ? ? 0F B6 CA 44")

//
// Internal
#ifdef DISTRIBUTION_BUILD
#undef SDK_ENABLE_LOGGING
#endif
