iw4x-client/src/STDInclude.hpp

187 lines
4.3 KiB
C++
Raw Normal View History

2017-01-19 16:23:59 -05:00
#pragma once
// Version number
#include "version.h"
#ifndef RC_INVOKED
#define VC_EXTRALEAN
#define WIN32_LEAN_AND_MEAN
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
2017-01-19 16:23:59 -05:00
// Requires Visual Leak Detector plugin: http://vld.codeplex.com/
2017-06-02 09:36:20 -04:00
#define VLD_FORCE_ENABLE
//#include <vld.h>
#include <Windows.h>
2022-08-01 13:15:03 -04:00
#include <WinSock2.h>
#include <ShlObj.h>
2017-01-19 16:23:59 -05:00
#include <timeapi.h>
#include <shellapi.h>
2022-06-12 17:07:53 -04:00
#include <WinInet.h>
2017-01-19 16:23:59 -05:00
#include <d3d9.h>
2022-06-12 17:07:53 -04:00
#include <AclAPI.h>
#include <Psapi.h>
2022-06-12 17:07:53 -04:00
#include <TlHelp32.h>
2017-06-07 05:22:38 -04:00
#include <Shlwapi.h>
2017-01-19 16:23:59 -05:00
#pragma warning(push)
#pragma warning(disable: 4091)
#pragma warning(disable: 4244)
#include <DbgHelp.h>
2017-01-19 16:23:59 -05:00
#include <sstream>
#include <fstream>
#include <cctype>
#include <regex>
#include <thread>
#include <future>
#include <unordered_map>
#include <queue>
2021-04-04 12:04:28 -04:00
#include <algorithm>
#include <limits>
#include <cmath>
2017-01-19 16:23:59 -05:00
#include <filesystem>
2017-06-13 09:35:12 -04:00
#include <optional>
2021-11-16 13:21:06 -05:00
#include <random>
#include <chrono>
2022-06-12 17:07:53 -04:00
#include <format>
#include <source_location>
2017-01-19 16:23:59 -05:00
#pragma warning(pop)
2017-01-20 08:36:52 -05:00
#include <d3dx9tex.h>
2017-01-19 16:23:59 -05:00
#pragma comment(lib, "D3dx9.lib")
#include <XInput.h>
2021-01-02 02:17:37 -05:00
#pragma comment (lib, "xinput.lib")
// Ignore the warnings
2017-01-19 16:23:59 -05:00
#pragma warning(push)
#pragma warning(disable: 4005)
#pragma warning(disable: 4091)
2017-01-19 16:23:59 -05:00
#pragma warning(disable: 4100)
#pragma warning(disable: 4244)
2017-01-19 16:23:59 -05:00
#pragma warning(disable: 4389)
#pragma warning(disable: 4702)
2017-05-04 06:45:08 -04:00
#pragma warning(disable: 4800)
#pragma warning(disable: 5054)
2017-01-19 16:23:59 -05:00
#pragma warning(disable: 6001)
#pragma warning(disable: 6011)
#pragma warning(disable: 6031)
#pragma warning(disable: 6255)
#pragma warning(disable: 6258)
#pragma warning(disable: 6386)
#pragma warning(disable: 6387)
#pragma warning(disable: 26812)
2017-01-19 16:23:59 -05:00
#include <curses.h>
#include <gsl/gsl>
2017-01-19 16:23:59 -05:00
#include <tomcrypt.h>
#include <udis86.h>
#include <zlib.h>
// Enable additional literals
using namespace std::literals;
2017-01-19 16:23:59 -05:00
#ifdef max
#undef max
2017-01-19 16:23:59 -05:00
#endif
#ifdef min
#undef min
2017-01-19 16:23:59 -05:00
#endif
// Needs to be included after the nominmax above ^
#ifdef snprintf
#undef snprintf
#endif
#include <json.hpp>
#define AssertSize(x, size) \
static_assert(sizeof(x) == (size), \
"Structure has an invalid size. " #x " must be " #size " bytes")
#define AssertOffset(x, y, offset) \
static_assert(offsetof(x, y) == (offset), \
#x "::" #y " is not at the right offset. Must be at " #offset)
#define AssertIn(x, y) assert(static_cast<unsigned int>(x) < static_cast<unsigned int>(y))
#define AssertUnreachable assert(0 && "unreachable")
2017-01-19 16:23:59 -05:00
// Protobuf
2018-10-09 04:53:15 -04:00
#include "proto/session.pb.h"
2017-01-19 16:23:59 -05:00
#include "proto/party.pb.h"
#include "proto/auth.pb.h"
2018-10-09 04:53:15 -04:00
#include "proto/node.pb.h"
2017-01-19 16:23:59 -05:00
#include "proto/rcon.pb.h"
#include "proto/ipc.pb.h"
#include "proto/friends.pb.h"
2017-01-19 16:23:59 -05:00
#pragma warning(pop)
#include "Utils/Memory.hpp" // Breaks order on purpose
2017-01-20 08:36:52 -05:00
#include "Utils/Cache.hpp"
#include "Utils/Chain.hpp"
#include "Utils/Compression.hpp"
#include "Utils/Concurrency.hpp"
2017-01-20 08:36:52 -05:00
#include "Utils/Cryptography.hpp"
#include "Utils/CSV.hpp"
#include "Utils/Entities.hpp"
#include "Utils/Hooking.hpp"
#include "Utils/InfoString.hpp"
#include "Utils/IO.hpp"
2022-06-12 17:07:53 -04:00
#include "Utils/Json.hpp"
#include "Utils/Library.hpp"
#include "Utils/Maths.hpp"
2022-06-28 03:26:43 -04:00
#include "Utils/NamedMutex.hpp"
#include "Utils/String.hpp"
#include "Utils/Thread.hpp"
#include "Utils/Time.hpp"
#include "Utils/Utils.hpp"
#include "Utils/WebIO.hpp"
2017-01-20 08:36:52 -05:00
#include "Steam/Steam.hpp" // Some definitions are used in functions and structs
2017-01-20 08:36:52 -05:00
#include "Game/Structs.hpp"
#include "Game/Dvars.hpp"
2017-01-20 08:36:52 -05:00
#include "Game/Functions.hpp"
2022-06-14 14:43:19 -04:00
#include <Game/Scripting/Function.hpp>
2022-06-30 11:07:39 -04:00
#include <Game/Scripting/StackIsolation.hpp>
2017-01-20 08:36:52 -05:00
#include "Utils/Stream.hpp" // Breaks order on purpose
2017-01-20 08:36:52 -05:00
#include "Components/Loader.hpp"
2017-01-19 16:23:59 -05:00
// Libraries
#pragma comment(lib, "Winmm.lib")
#pragma comment(lib, "Crypt32.lib")
#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "d3d9.lib")
#pragma comment(lib, "Wininet.lib")
#pragma comment(lib, "shlwapi.lib")
#pragma comment(lib, "Urlmon.lib")
#pragma comment(lib, "Advapi32.lib")
#pragma comment(lib, "rpcrt4.lib")
#pragma comment(lib, "dbghelp.lib")
2021-07-18 12:11:20 -04:00
#pragma comment(lib, "ntdll.lib")
2017-01-19 16:23:59 -05:00
#endif
#define BASEGAME "iw4x"
#define CLIENT_CONFIG "iw4x_config.cfg"
// Resource stuff
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
// Defines below make accessing the resources from the code easier.
#define _APS_NEXT_RESOURCE_VALUE 102
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1001
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif