mirror of
https://github.com/XLabsProject/s1x-client.git
synced 2023-08-02 15:02:12 +02:00
Fixes and more stuff
This commit is contained in:
parent
d746af4c11
commit
2247b68b4a
69
src/client/component/branding.cpp
Normal file
69
src/client/component/branding.cpp
Normal file
@ -0,0 +1,69 @@
|
||||
#include <std_include.hpp>
|
||||
#include "loader/component_loader.hpp"
|
||||
#include "localized_strings.hpp"
|
||||
#include "scheduler.hpp"
|
||||
#include "command.hpp"
|
||||
#include "game/game.hpp"
|
||||
|
||||
#include "dvars.hpp"
|
||||
|
||||
#include <utils/hook.hpp>
|
||||
#include <utils/string.hpp>
|
||||
|
||||
#include "version.hpp"
|
||||
|
||||
namespace branding
|
||||
{
|
||||
namespace
|
||||
{
|
||||
utils::hook::detour ui_get_formatted_build_number_hook;
|
||||
|
||||
const char* ui_get_formatted_build_number_stub()
|
||||
{
|
||||
const auto* const build_num = ui_get_formatted_build_number_hook.invoke<const char*>();
|
||||
|
||||
return utils::string::va("%s (%s)", VERSION, build_num);
|
||||
}
|
||||
}
|
||||
|
||||
class component final : public component_interface
|
||||
{
|
||||
public:
|
||||
void post_unpack() override
|
||||
{
|
||||
if (game::environment::is_dedi())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (game::environment::is_mp())
|
||||
{
|
||||
localized_strings::override("LUA_MENU_MULTIPLAYER_CAPS", "S1-MOD: MULTIPLAYER\n");
|
||||
}
|
||||
localized_strings::override("LUA_MENU_LEGAL_COPYRIGHT", "S1-Mod: " VERSION);
|
||||
|
||||
dvars::override::Dvar_SetString("version", utils::string::va("IW6x %s", VERSION));
|
||||
|
||||
ui_get_formatted_build_number_hook.create(SELECT_VALUE(0x14035B3F0, 0x1404A8950), ui_get_formatted_build_number_stub);
|
||||
|
||||
scheduler::loop([]()
|
||||
{
|
||||
const auto x = 3;
|
||||
const auto y = 0;
|
||||
const auto scale = 1.0f;
|
||||
float color[4] = { 0.666f, 0.666f, 0.666f, 0.666f };
|
||||
const auto* text = "S1-Mod: " VERSION;
|
||||
|
||||
auto* font = game::R_RegisterFont("fonts/normalfont");
|
||||
|
||||
if (!font) return;
|
||||
|
||||
game::R_AddCmdDrawText(text, 0x7FFFFFFF, font, static_cast<float>(x),
|
||||
y + static_cast<float>(font->pixelHeight) * scale,
|
||||
scale, scale, 0.0f, color, 0);
|
||||
}, scheduler::pipeline::renderer);
|
||||
}
|
||||
};
|
||||
} // namespace branding
|
||||
|
||||
REGISTER_COMPONENT(branding::component)
|
226
src/client/component/dvars.cpp
Normal file
226
src/client/component/dvars.cpp
Normal file
@ -0,0 +1,226 @@
|
||||
#include <std_include.hpp>
|
||||
#include "loader/component_loader.hpp"
|
||||
#include "dvars.hpp"
|
||||
|
||||
#include "game/game.hpp"
|
||||
|
||||
namespace dvars
|
||||
{
|
||||
namespace override
|
||||
{
|
||||
class dvar_bool
|
||||
{
|
||||
public:
|
||||
const char* name;
|
||||
bool value;
|
||||
unsigned int flags;
|
||||
const char* description;
|
||||
};
|
||||
|
||||
class dvar_float
|
||||
{
|
||||
public:
|
||||
const char* name;
|
||||
float value;
|
||||
float min;
|
||||
float max;
|
||||
unsigned int flags;
|
||||
const char* description;
|
||||
};
|
||||
|
||||
class dvar_int
|
||||
{
|
||||
public:
|
||||
const char* name;
|
||||
int value;
|
||||
int min;
|
||||
int max;
|
||||
unsigned int flags;
|
||||
const char* description;
|
||||
};
|
||||
|
||||
class dvar_string
|
||||
{
|
||||
public:
|
||||
const char* name;
|
||||
const char* value;
|
||||
unsigned int flags;
|
||||
const char* description;
|
||||
};
|
||||
|
||||
class dvar_setstring
|
||||
{
|
||||
public:
|
||||
const char* dvar_name;
|
||||
const char* string;
|
||||
};
|
||||
|
||||
static std::vector<dvar_bool> bool_overrides;
|
||||
static std::vector<dvar_float> float_overrides;
|
||||
static std::vector<dvar_int> int_overrides;
|
||||
static std::vector<dvar_string> string_overrides;
|
||||
|
||||
static std::vector<dvar_setstring> set_string_overrides;
|
||||
|
||||
void Dvar_RegisterBool(const char* name, bool value, unsigned int flags, const char* description)
|
||||
{
|
||||
dvar_bool values;
|
||||
values.name = name;
|
||||
values.value = value;
|
||||
values.flags = flags;
|
||||
values.description = description;
|
||||
bool_overrides.push_back(std::move(values));
|
||||
}
|
||||
|
||||
void Dvar_RegisterFloat(const char* name, float value, float min, float max, unsigned int flags, const char* description)
|
||||
{
|
||||
dvar_float values;
|
||||
values.name = name;
|
||||
values.value = value;
|
||||
values.min = min;
|
||||
values.max = max;
|
||||
values.flags = flags;
|
||||
values.description = description;
|
||||
float_overrides.push_back(std::move(values));
|
||||
}
|
||||
|
||||
void Dvar_RegisterInt(const char* name, int value, int min, int max, unsigned int flags, const char* description)
|
||||
{
|
||||
dvar_int values;
|
||||
values.name = name;
|
||||
values.value = value;
|
||||
values.min = min;
|
||||
values.max = max;
|
||||
values.flags = flags;
|
||||
values.description = description;
|
||||
int_overrides.push_back(std::move(values));
|
||||
}
|
||||
|
||||
void Dvar_RegisterString(const char* name, const char* value, unsigned int flags, const char* description)
|
||||
{
|
||||
dvar_string values;
|
||||
values.name = name;
|
||||
values.value = value;
|
||||
values.flags = flags;
|
||||
values.description = description;
|
||||
string_overrides.push_back(std::move(values));
|
||||
}
|
||||
|
||||
void Dvar_SetString(const char* dvar_name, const char* string)
|
||||
{
|
||||
dvar_setstring setstring;
|
||||
setstring.dvar_name = dvar_name;
|
||||
setstring.string = string;
|
||||
set_string_overrides.push_back(std::move(setstring));
|
||||
}
|
||||
}
|
||||
|
||||
utils::hook::detour dvar_register_bool_hook;
|
||||
utils::hook::detour dvar_register_float_hook;
|
||||
utils::hook::detour dvar_register_int_hook;
|
||||
utils::hook::detour dvar_register_string_hook;
|
||||
|
||||
utils::hook::detour dvar_set_string_hook;
|
||||
|
||||
game::dvar_t* dvar_register_bool(const char* name, bool value, unsigned int flags, const char* description)
|
||||
{
|
||||
for (auto i = 0; i < override::bool_overrides.size(); i++)
|
||||
{
|
||||
if (!strcmp(name, override::bool_overrides[i].name))
|
||||
{
|
||||
auto* dv = &override::bool_overrides[i];
|
||||
value = dv->value;
|
||||
flags = dv->flags;
|
||||
description = dv->description;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return dvar_register_bool_hook.invoke<game::dvar_t*>(name, value, flags, description);
|
||||
}
|
||||
|
||||
game::dvar_t* dvar_register_float(const char* name, float value, float min, float max, unsigned int flags, const char* description)
|
||||
{
|
||||
for (auto i = 0; i < override::float_overrides.size(); i++)
|
||||
{
|
||||
if (!strcmp(name, override::float_overrides[i].name))
|
||||
{
|
||||
auto* dv = &override::float_overrides[i];
|
||||
value = dv->value;
|
||||
min = dv->min;
|
||||
max = dv->max;
|
||||
flags = dv->flags;
|
||||
description = dv->description;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return dvar_register_float_hook.invoke<game::dvar_t*>(name, value, min, max, flags, description);
|
||||
}
|
||||
|
||||
game::dvar_t* dvar_register_int(const char* name, int value, int min, int max, unsigned int flags, const char* description)
|
||||
{
|
||||
for (auto i = 0; i < override::int_overrides.size(); i++)
|
||||
{
|
||||
if (!strcmp(name, override::int_overrides[i].name))
|
||||
{
|
||||
auto* dv = &override::int_overrides[i];
|
||||
value = dv->value;
|
||||
min = dv->min;
|
||||
max = dv->max;
|
||||
flags = dv->flags;
|
||||
description = dv->description;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return dvar_register_int_hook.invoke<game::dvar_t*>(name, value, min, max, flags, description);
|
||||
}
|
||||
|
||||
game::dvar_t* dvar_register_string(const char* name, const char* value, unsigned int flags, const char* description)
|
||||
{
|
||||
for (auto i = 0; i < override::string_overrides.size(); i++)
|
||||
{
|
||||
if (!strcmp(name, override::string_overrides[i].name))
|
||||
{
|
||||
auto* dv = &override::string_overrides[i];
|
||||
value = dv->value;
|
||||
flags = dv->flags;
|
||||
description = dv->description;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return dvar_register_string_hook.invoke<game::dvar_t*>(name, value, flags, description);
|
||||
}
|
||||
|
||||
bool dvar_set_string(game::dvar_t* dvar, const char* string)
|
||||
{
|
||||
for (auto i = 0; i < override::set_string_overrides.size(); i++)
|
||||
{
|
||||
if (!strcmp(dvar->name, override::set_string_overrides[i].dvar_name))
|
||||
{
|
||||
string = override::set_string_overrides[i].string;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return dvar_set_string_hook.invoke<bool>(dvar, string);
|
||||
}
|
||||
|
||||
class component final : public component_interface
|
||||
{
|
||||
public:
|
||||
void post_unpack() override
|
||||
{
|
||||
dvar_register_bool_hook.create(SELECT_VALUE(0x140371850, 0x1404C0BE0), &dvar_register_bool);
|
||||
dvar_register_float_hook.create(SELECT_VALUE(0x140371C20, 0x1404C0FB0), &dvar_register_float);
|
||||
dvar_register_int_hook.create(SELECT_VALUE(0x140371CF0, 0x1404C1080), &dvar_register_int);
|
||||
dvar_register_string_hook.create(SELECT_VALUE(0x140372050, 0x1404C1450), &dvar_register_string);
|
||||
|
||||
dvar_set_string_hook.create(SELECT_VALUE(0x140373DE0, 0x1404C3610), &dvar_set_string);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
REGISTER_COMPONENT(dvars::component)
|
14
src/client/component/dvars.hpp
Normal file
14
src/client/component/dvars.hpp
Normal file
@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
|
||||
namespace dvars
|
||||
{
|
||||
namespace override
|
||||
{
|
||||
void Dvar_RegisterBool(const char* name, bool value, unsigned int flags, const char* description = "");
|
||||
void Dvar_RegisterFloat(const char* name, float value, float min, float max, unsigned int flags, const char* description = "");
|
||||
void Dvar_RegisterInt(const char* name, int value, int min, int max, unsigned int flags, const char* description = "");
|
||||
void Dvar_RegisterString(const char* name, const char* value, unsigned int flags, const char* description = "");
|
||||
|
||||
void Dvar_SetString(const char* dvar_name, const char* string);
|
||||
}
|
||||
}
|
@ -64,10 +64,15 @@ namespace fastfiles
|
||||
}, 0, false);
|
||||
});
|
||||
|
||||
if (!game::environment::is_sp())
|
||||
command::add("g_poolSizes", []()
|
||||
{
|
||||
reallocate_asset_pool(game::ASSET_TYPE_WEAPON, 320);
|
||||
}
|
||||
for (auto i = 0; i < game::ASSET_TYPE_COUNT; i++)
|
||||
{
|
||||
printf("g_poolSize[%i]: %i // %s\n", i, game::g_poolSize[i], game::g_assetNames[i]);
|
||||
}
|
||||
});
|
||||
|
||||
reallocate_asset_pool(game::ASSET_TYPE_FONT, 48);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
175
src/client/component/fps.cpp
Normal file
175
src/client/component/fps.cpp
Normal file
@ -0,0 +1,175 @@
|
||||
#include <std_include.hpp>
|
||||
#include "loader/component_loader.hpp"
|
||||
#include "scheduler.hpp"
|
||||
|
||||
#include "game/game.hpp"
|
||||
#include "game/dvars.hpp"
|
||||
|
||||
#include <utils/hook.hpp>
|
||||
#include <utils/string.hpp>
|
||||
|
||||
namespace fps
|
||||
{
|
||||
namespace
|
||||
{
|
||||
float fps_color_good[4] = { 0.6f, 1.0f, 0.0f, 1.0f };
|
||||
float fps_color_ok[4] = { 1.0f, 0.7f, 0.3f, 1.0f };
|
||||
float fps_color_bad[4] = { 1.0f, 0.3f, 0.3f, 1.0f };
|
||||
|
||||
//float origin_color[4] = { 1.0f, 0.67f, 0.13f, 1.0f };
|
||||
float ping_color[4] = { 1.0f, 1.0f, 1.0f, 0.65f };
|
||||
|
||||
struct cg_perf_data
|
||||
{
|
||||
std::chrono::time_point<std::chrono::steady_clock> perf_start;
|
||||
std::int32_t current_ms{};
|
||||
std::int32_t previous_ms{};
|
||||
std::int32_t frame_ms{};
|
||||
std::int32_t history[32]{};
|
||||
std::int32_t count{};
|
||||
std::int32_t index{};
|
||||
std::int32_t instant{};
|
||||
std::int32_t total{};
|
||||
float average{};
|
||||
float variance{};
|
||||
std::int32_t min{};
|
||||
std::int32_t max{};
|
||||
};
|
||||
|
||||
cg_perf_data cg_perf = cg_perf_data();
|
||||
|
||||
void perf_calc_fps(cg_perf_data* data, const std::int32_t value)
|
||||
{
|
||||
data->history[data->index % 32] = value;
|
||||
data->instant = value;
|
||||
data->min = 0x7FFFFFFF;
|
||||
data->max = 0;
|
||||
data->average = 0.0f;
|
||||
data->variance = 0.0f;
|
||||
data->total = 0;
|
||||
|
||||
for (auto i = 0; i < data->count; ++i)
|
||||
{
|
||||
const std::int32_t idx = (data->index - i) % 32;
|
||||
|
||||
if (idx < 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
data->total += data->history[idx];
|
||||
|
||||
if (data->min > data->history[idx])
|
||||
{
|
||||
data->min = data->history[idx];
|
||||
}
|
||||
|
||||
if (data->max < data->history[idx])
|
||||
{
|
||||
data->max = data->history[idx];
|
||||
}
|
||||
}
|
||||
|
||||
data->average = static_cast<float>(data->total) / static_cast<float>(data->count);
|
||||
++data->index;
|
||||
}
|
||||
|
||||
void perf_update()
|
||||
{
|
||||
cg_perf.count = 32;
|
||||
|
||||
cg_perf.current_ms = static_cast<std::int32_t>(std::chrono::duration_cast<std::chrono::milliseconds>(
|
||||
std::chrono::high_resolution_clock::now() - cg_perf.perf_start).count());
|
||||
cg_perf.frame_ms = cg_perf.current_ms - cg_perf.previous_ms;
|
||||
cg_perf.previous_ms = cg_perf.current_ms;
|
||||
|
||||
perf_calc_fps(&cg_perf, cg_perf.frame_ms);
|
||||
|
||||
utils::hook::invoke<void>(SELECT_VALUE(0x1404F6A90, 0x14062C540));
|
||||
}
|
||||
|
||||
void cg_draw_fps()
|
||||
{
|
||||
const auto* draw_fps = game::Dvar_FindVar("cg_drawFPS");
|
||||
if (draw_fps && draw_fps->current.integer > 0 /*&& game::CL_IsCgameInitialized()*/)
|
||||
{
|
||||
const auto fps = static_cast<std::int32_t>(static_cast<float>(1000.0f / static_cast<float>(cg_perf.
|
||||
average))
|
||||
+ 9.313225746154785e-10);
|
||||
|
||||
auto* font = game::R_RegisterFont("fonts/normalfont");
|
||||
if (!font) return;
|
||||
|
||||
const auto* const fps_string = utils::string::va("%i", fps);
|
||||
|
||||
const auto scale = 1.0f;
|
||||
|
||||
const auto x = (game::ScrPlace_GetViewPlacement()->realViewportSize[0] - 10.0f) - game::R_TextWidth(
|
||||
fps_string, 0x7FFFFFFF, font) * scale;
|
||||
|
||||
const auto y = font->pixelHeight * 1.2f;
|
||||
|
||||
const auto fps_color = fps >= 60 ? fps_color_good : (fps >= 30 ? fps_color_ok : fps_color_bad);
|
||||
game::R_AddCmdDrawText(fps_string, 0x7FFFFFFF, font, x, y, scale, scale, 0.0f, fps_color, 6);
|
||||
}
|
||||
}
|
||||
|
||||
void cg_draw_ping()
|
||||
{
|
||||
const auto* draw_ping = game::Dvar_FindVar("cg_drawPing");
|
||||
if (draw_ping && draw_ping->current.integer > 0 && game::CL_IsCgameInitialized())
|
||||
{
|
||||
const auto ping = *reinterpret_cast<int*>(0x1417E6A84);
|
||||
|
||||
auto* font = game::R_RegisterFont("fonts/normalfont");
|
||||
if (!font) return;
|
||||
|
||||
auto* const ping_string = utils::string::va("Ping: %i", ping);
|
||||
|
||||
const auto scale = 1.0f;
|
||||
|
||||
const auto x = (game::ScrPlace_GetViewPlacement()->realViewportSize[0] - 375.0f) - game::R_TextWidth(
|
||||
ping_string, 0x7FFFFFFF, font) * scale;
|
||||
|
||||
const auto y = font->pixelHeight * 1.2f;
|
||||
|
||||
game::R_AddCmdDrawText(ping_string, 0x7FFFFFFF, font, x, y, scale, scale, 0.0f, ping_color, 6);
|
||||
}
|
||||
}
|
||||
|
||||
void cg_draw_fps_register_stub(const char* name, const char** _enum, const int value, unsigned int /*flags*/,
|
||||
const char* desc)
|
||||
{
|
||||
game::Dvar_RegisterEnum(name, _enum, value, 0x1, desc);
|
||||
}
|
||||
}
|
||||
|
||||
class component final : public component_interface
|
||||
{
|
||||
public:
|
||||
void post_unpack() override
|
||||
{
|
||||
if (game::environment::is_dedi())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// fps setup
|
||||
cg_perf.perf_start = std::chrono::high_resolution_clock::now();
|
||||
utils::hook::call(SELECT_VALUE(0x140144D41, 0x140213B27), &perf_update);
|
||||
|
||||
// change cg_drawfps flags to saved
|
||||
utils::hook::call(SELECT_VALUE(0x1400EF951, 0x1401A4B8E), &cg_draw_fps_register_stub);
|
||||
|
||||
scheduler::loop(cg_draw_fps, scheduler::pipeline::renderer);
|
||||
if (game::environment::is_mp())
|
||||
{
|
||||
game::Dvar_RegisterInt("cg_drawPing", 0, 0, 1, 0, "Choose to draw ping");
|
||||
scheduler::loop(cg_draw_ping, scheduler::pipeline::renderer);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
REGISTER_COMPONENT(fps::component)
|
58
src/client/component/localized_strings.cpp
Normal file
58
src/client/component/localized_strings.cpp
Normal file
@ -0,0 +1,58 @@
|
||||
#include <std_include.hpp>
|
||||
#include "loader/component_loader.hpp"
|
||||
#include "localized_strings.hpp"
|
||||
#include <utils/hook.hpp>
|
||||
#include <utils/string.hpp>
|
||||
#include "game/game.hpp"
|
||||
|
||||
namespace localized_strings
|
||||
{
|
||||
namespace
|
||||
{
|
||||
utils::hook::detour seh_string_ed_get_string_hook;
|
||||
|
||||
std::unordered_map<std::string, std::string>& get_localized_overrides()
|
||||
{
|
||||
static std::unordered_map<std::string, std::string> overrides;
|
||||
return overrides;
|
||||
}
|
||||
|
||||
std::mutex& get_synchronization_mutex()
|
||||
{
|
||||
static std::mutex mutex;
|
||||
return mutex;
|
||||
}
|
||||
|
||||
const char* seh_string_ed_get_string(const char* reference)
|
||||
{
|
||||
std::lock_guard<std::mutex> _(get_synchronization_mutex());
|
||||
|
||||
auto& overrides = get_localized_overrides();
|
||||
const auto entry = overrides.find(reference);
|
||||
if (entry != overrides.end())
|
||||
{
|
||||
return utils::string::va("%s", entry->second.data());
|
||||
}
|
||||
|
||||
return seh_string_ed_get_string_hook.invoke<const char*>(reference);
|
||||
}
|
||||
}
|
||||
|
||||
void override(const std::string& key, const std::string& value)
|
||||
{
|
||||
std::lock_guard<std::mutex> _(get_synchronization_mutex());
|
||||
get_localized_overrides()[key] = value;
|
||||
}
|
||||
|
||||
class component final : public component_interface
|
||||
{
|
||||
public:
|
||||
void post_unpack() override
|
||||
{
|
||||
// Change some localized strings
|
||||
seh_string_ed_get_string_hook.create(SELECT_VALUE(0x140339CF0, 0x140474FC0), &seh_string_ed_get_string);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
REGISTER_COMPONENT(localized_strings::component)
|
6
src/client/component/localized_strings.hpp
Normal file
6
src/client/component/localized_strings.hpp
Normal file
@ -0,0 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
namespace localized_strings
|
||||
{
|
||||
void override(const std::string& key, const std::string& value);
|
||||
}
|
@ -6,6 +6,8 @@
|
||||
#include "game/dvars.hpp"
|
||||
#include "scheduler.hpp"
|
||||
|
||||
#include "dvars.hpp"
|
||||
|
||||
#include <utils/hook.hpp>
|
||||
|
||||
namespace patches
|
||||
@ -19,22 +21,11 @@ namespace patches
|
||||
return game::Dvar_FindVar("name")->current.string;
|
||||
}
|
||||
|
||||
utils::hook::detour dvar_register_string_hook;
|
||||
|
||||
game::dvar_t* dvar_register_string(const char* name, const char* value, unsigned int flags, const char* description)
|
||||
{
|
||||
if (name == "name"s)
|
||||
{
|
||||
flags = 0x1;
|
||||
}
|
||||
return dvar_register_string_hook.invoke<game::dvar_t*>(name, value, flags, description);
|
||||
}
|
||||
|
||||
game::dvar_t* register_com_maxfps_stub(const char* name, int /*value*/, int /*min*/, int /*max*/,
|
||||
const unsigned int /*flags*/,
|
||||
const char* description)
|
||||
{
|
||||
return game::Dvar_RegisterInt(name, 125, 0, 1000, 0x1, description);
|
||||
return game::Dvar_RegisterInt(name, 0, 0, 1000, 0x1, description);
|
||||
}
|
||||
|
||||
game::dvar_t* register_cg_fov_stub(const char* name, float value, float min, float /*max*/,
|
||||
@ -94,8 +85,7 @@ namespace patches
|
||||
LoadLibraryA("PhysXDevice64.dll");
|
||||
LoadLibraryA("PhysXUpdateLoader64.dll");
|
||||
|
||||
// Edit dvars on create
|
||||
dvar_register_string_hook.create(SELECT_VALUE(0x140372050, 0x1404C1450), &dvar_register_string);
|
||||
dvars::override::Dvar_RegisterString("name", "Unknown Soldier", 1);
|
||||
|
||||
// Unlock fps in main menu
|
||||
utils::hook::set<BYTE>(SELECT_VALUE(0x140144F5B, 0x140213C3B), 0xEB);
|
||||
|
@ -2,10 +2,6 @@
|
||||
|
||||
#define PROTOCOL 1
|
||||
|
||||
#define GAME_TITLE_MP "Call of Duty® Advanced Warfare Multiplayer"
|
||||
#define GAME_TITLE_SP "Call of Duty® Advanced Singleplayer"
|
||||
#define GAME_TITLE_DS "Call of Duty® Advanced Dedicated Server"
|
||||
|
||||
namespace game
|
||||
{
|
||||
typedef float vec_t;
|
||||
@ -711,75 +707,75 @@ namespace game
|
||||
|
||||
enum XAssetType
|
||||
{
|
||||
ASSET_TYPE_PHYSPRESET = 0x0,
|
||||
ASSET_TYPE_PHYSCOLLMAP = 0x1,
|
||||
ASSET_TYPE_PHYSWATERPRESET = 0x2,
|
||||
ASSET_TYPE_PHYSWORLDMAP = 0x3,
|
||||
ASSET_TYPE_PHYSCONSTRAINT = 0x4,
|
||||
ASSET_TYPE_XANIMPARTS = 0x5,
|
||||
ASSET_TYPE_XMODELSURFS = 0x6,
|
||||
ASSET_TYPE_XMODEL = 0x7,
|
||||
ASSET_TYPE_MATERIAL = 0x8,
|
||||
ASSET_TYPE_COMPUTESHADER = 0x9,
|
||||
ASSET_TYPE_VERTEXSHADER = 0xA,
|
||||
ASSET_TYPE_HULLSHADER = 0xB,
|
||||
ASSET_TYPE_DOMAINSHADER = 0xC,
|
||||
ASSET_TYPE_PIXELSHADER = 0xD,
|
||||
ASSET_TYPE_VERTEXDECL = 0xE,
|
||||
ASSET_TYPE_TECHNIQUE_SET = 0xF,
|
||||
ASSET_TYPE_IMAGE = 0x10,
|
||||
ASSET_TYPE_SOUND = 0x11,
|
||||
ASSET_TYPE_SOUND_CURVE = 0x12,
|
||||
ASSET_TYPE_LPF_CURVE = 0x13,
|
||||
ASSET_TYPE_REVERB_CURVE = 0x14,
|
||||
ASSET_TYPE_SOUND_CONTEXT = 0x15,
|
||||
ASSET_TYPE_LOADED_SOUND = 0x16,
|
||||
ASSET_TYPE_CLIPMAP = 0x17,
|
||||
ASSET_TYPE_COMWORLD = 0x18,
|
||||
ASSET_TYPE_GLASSWORLD = 0x19,
|
||||
ASSET_TYPE_PATHDATA = 0x1A,
|
||||
ASSET_TYPE_VEHICLE_TRACK = 0x1B,
|
||||
ASSET_TYPE_MAP_ENTS = 0x1C,
|
||||
ASSET_TYPE_FXWORLD = 0x1D,
|
||||
ASSET_TYPE_GFXWORLD = 0x1E,
|
||||
ASSET_TYPE_LIGHT_DEF = 0x1F,
|
||||
ASSET_TYPE_UI_MAP = 0x20,
|
||||
ASSET_TYPE_FONT = 0x21,
|
||||
ASSET_TYPE_MENULIST = 0x22,
|
||||
ASSET_TYPE_MENU = 0x23,
|
||||
ASSET_TYPE_ANIMCLASS = 0x24,
|
||||
ASSET_TYPE_LOCALIZE_ENTRY = 0x25,
|
||||
ASSET_TYPE_ATTACHMENT = 0x26,
|
||||
ASSET_TYPE_WEAPON = 0x27,
|
||||
ASSET_TYPE_SNDDRIVER_GLOBALS = 0x28,
|
||||
ASSET_TYPE_FX = 0x29,
|
||||
ASSET_TYPE_IMPACT_FX = 0x2A,
|
||||
ASSET_TYPE_SURFACE_FX = 0x2B,
|
||||
ASSET_TYPE_AITYPE = 0x2C,
|
||||
ASSET_TYPE_MPTYPE = 0x2D,
|
||||
ASSET_TYPE_CHARACTER = 0x2E,
|
||||
ASSET_TYPE_XMODELALIAS = 0x2F,
|
||||
ASSET_TYPE_RAWFILE = 0x30,
|
||||
ASSET_TYPE_SCRIPTFILE = 0x31,
|
||||
ASSET_TYPE_STRINGTABLE = 0x32,
|
||||
ASSET_TYPE_LEADERBOARD = 0x33,
|
||||
ASSET_TYPE_STRUCTURED_DATA_DEF = 0x34,
|
||||
ASSET_TYPE_TRACER = 0x35,
|
||||
ASSET_TYPE_VEHICLE = 0x36,
|
||||
ASSET_TYPE_ADDON_MAP_ENTS = 0x37,
|
||||
ASSET_TYPE_NET_CONST_STRINGS = 0x38,
|
||||
ASSET_TYPE_REVERB_PRESET = 0x39,
|
||||
ASSET_TYPE_LUA_FILE = 0x3A,
|
||||
ASSET_TYPE_SCRIPTABLE = 0x3B,
|
||||
ASSET_TYPE_EQUIPMENT_SND_TABLE = 0x3C,
|
||||
ASSET_TYPE_VECTORFIELD = 0x3D,
|
||||
ASSET_TYPE_DOPPLER_PRESET = 0x3E,
|
||||
ASSET_TYPE_PARTICLE_SIM_ANIMATION = 0x3F,
|
||||
ASSET_TYPE_LASER = 0x40,
|
||||
ASSET_TYPE_SKELETON_SCRIPT = 0x41,
|
||||
ASSET_TYPE_CLUT = 0x42,
|
||||
ASSET_TYPE_WATER_DEFAULT = 0x43,
|
||||
ASSET_TYPE_COUNT = 0x44,
|
||||
ASSET_TYPE_PHYSPRESET,
|
||||
ASSET_TYPE_PHYSCOLLMAP,
|
||||
ASSET_TYPE_PHYSWATERPRESET,
|
||||
ASSET_TYPE_PHYSWORLDMAP,
|
||||
ASSET_TYPE_PHYSCONSTRAINT,
|
||||
ASSET_TYPE_XANIMPARTS,
|
||||
ASSET_TYPE_XMODELSURFS,
|
||||
ASSET_TYPE_XMODEL,
|
||||
ASSET_TYPE_MATERIAL,
|
||||
ASSET_TYPE_COMPUTESHADER,
|
||||
ASSET_TYPE_VERTEXSHADER,
|
||||
ASSET_TYPE_HULLSHADER,
|
||||
ASSET_TYPE_DOMAINSHADER,
|
||||
ASSET_TYPE_PIXELSHADER,
|
||||
ASSET_TYPE_VERTEXDECL,
|
||||
ASSET_TYPE_TECHNIQUE_SET,
|
||||
ASSET_TYPE_IMAGE,
|
||||
ASSET_TYPE_SOUND,
|
||||
ASSET_TYPE_SOUND_SUBMIX,
|
||||
ASSET_TYPE_SOUND_CURVE,
|
||||
ASSET_TYPE_LPF_CURVE,
|
||||
ASSET_TYPE_REVERB_CURVE,
|
||||
ASSET_TYPE_SOUND_CONTEXT,
|
||||
ASSET_TYPE_LOADED_SOUND,
|
||||
ASSET_TYPE_CLIPMAP, // col_map
|
||||
ASSET_TYPE_COMWORLD,
|
||||
ASSET_TYPE_GLASSWORLD,
|
||||
ASSET_TYPE_PATHDATA,
|
||||
ASSET_TYPE_VEHICLE_TRACK,
|
||||
ASSET_TYPE_MAP_ENTS,
|
||||
ASSET_TYPE_FXWORLD,
|
||||
ASSET_TYPE_GFXWORLD,
|
||||
ASSET_TYPE_LIGHT_DEF,
|
||||
ASSET_TYPE_UI_MAP,
|
||||
ASSET_TYPE_FONT,
|
||||
ASSET_TYPE_MENULIST,
|
||||
ASSET_TYPE_MENU,
|
||||
ASSET_TYPE_ANIMCLASS,
|
||||
ASSET_TYPE_LOCALIZE_ENTRY,
|
||||
ASSET_TYPE_ATTACHMENT,
|
||||
ASSET_TYPE_WEAPON,
|
||||
ASSET_TYPE_SNDDRIVER_GLOBALS,
|
||||
ASSET_TYPE_FX,
|
||||
ASSET_TYPE_IMPACT_FX,
|
||||
ASSET_TYPE_SURFACE_FX,
|
||||
ASSET_TYPE_AITYPE,
|
||||
ASSET_TYPE_MPTYPE,
|
||||
ASSET_TYPE_CHARACTER,
|
||||
ASSET_TYPE_XMODELALIAS,
|
||||
ASSET_TYPE_RAWFILE,
|
||||
ASSET_TYPE_SCRIPTFILE,
|
||||
ASSET_TYPE_STRINGTABLE,
|
||||
ASSET_TYPE_LEADERBOARD,
|
||||
ASSET_TYPE_STRUCTURED_DATA_DEF,
|
||||
ASSET_TYPE_TRACER,
|
||||
ASSET_TYPE_VEHICLE,
|
||||
ASSET_TYPE_ADDON_MAP_ENTS,
|
||||
ASSET_TYPE_NET_CONST_STRINGS,
|
||||
ASSET_TYPE_REVERB_PRESET,
|
||||
ASSET_TYPE_LUA_FILE,
|
||||
ASSET_TYPE_SCRIPTABLE,
|
||||
ASSET_TYPE_EQUIPMENT_SND_TABLE,
|
||||
ASSET_TYPE_VECTORFIELD,
|
||||
ASSET_TYPE_DOPPLER_PRESET,
|
||||
ASSET_TYPE_PARTICLE_SIM_ANIMATION,
|
||||
ASSET_TYPE_LASER,
|
||||
ASSET_TYPE_SKELETON_SCRIPT,
|
||||
ASSET_TYPE_CLUT,
|
||||
ASSET_TYPE_COUNT,
|
||||
};
|
||||
|
||||
enum GfxDrawSceneMethod
|
||||
|
@ -23,6 +23,8 @@ namespace game
|
||||
WEAK symbol<void(int localClientNum, int controllerIndex, const char* buffer,
|
||||
void(int, int, const char*))> Cbuf_ExecuteBufferInternal{ 0x1402ED9A0, 0x1403AEE80 };
|
||||
|
||||
WEAK symbol<bool()> CL_IsCgameInitialized{ 0x140136560, 0x1401FD510 };
|
||||
|
||||
WEAK symbol<void(int localClientNum, const char* message)> CG_GameMessage{ 0x1401A3050, 0x1400EE500 };
|
||||
|
||||
WEAK symbol<void(XAssetType type, void(__cdecl* func)(XAssetHeader, void*), void* inData, bool includeOverride)> DB_EnumXAssets_FastFile{ 0x14017D7C0, 0x14026EC10 };
|
||||
@ -98,6 +100,7 @@ namespace game
|
||||
|
||||
WEAK symbol<void*> DB_XAssetPool{ 0x140804690, 0x1409B40D0 };
|
||||
WEAK symbol<int> g_poolSize{ 0x140804140, 0x1409B4B90 };
|
||||
WEAK symbol<const char*> g_assetNames{ 0x140803C90 , 0x1409B3180 };
|
||||
|
||||
WEAK symbol<GfxDrawMethod_s> gfxDrawMethod{ 0x14CDFAFE8, 0x14D80FD98 };
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user