2022-06-02 04:14:44 -04:00
|
|
|
#pragma once
|
|
|
|
|
2022-08-10 05:26:19 -04:00
|
|
|
#include "structs.hpp"
|
2022-11-09 11:10:08 -05:00
|
|
|
#include "loader/component_loader.hpp"
|
2022-06-02 04:14:44 -04:00
|
|
|
|
|
|
|
namespace game
|
|
|
|
{
|
2022-11-09 11:10:08 -05:00
|
|
|
#define Com_Error(code, fmt, ...) \
|
2022-08-10 05:26:19 -04:00
|
|
|
Com_Error_(__FILE__, __LINE__, code, fmt, ##__VA_ARGS__)
|
|
|
|
|
2022-06-02 07:49:43 -04:00
|
|
|
int Conbuf_CleanText(const char* source, char* target);
|
2022-10-28 16:16:14 -04:00
|
|
|
game::eModes Com_SessionMode_GetMode();
|
2022-06-02 07:49:43 -04:00
|
|
|
|
2022-06-02 04:14:44 -04:00
|
|
|
template <typename T>
|
|
|
|
class symbol
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
symbol(const size_t address)
|
2022-11-09 11:10:08 -05:00
|
|
|
: address_(address)
|
2022-06-02 04:14:44 -04:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
T* get() const
|
|
|
|
{
|
2022-11-09 11:10:08 -05:00
|
|
|
return reinterpret_cast<T*>(get_game_address(this->address_));
|
2022-06-02 04:14:44 -04:00
|
|
|
}
|
|
|
|
|
2022-11-09 11:10:08 -05:00
|
|
|
operator T*() const
|
2022-06-02 04:14:44 -04:00
|
|
|
{
|
|
|
|
return this->get();
|
|
|
|
}
|
|
|
|
|
|
|
|
T* operator->() const
|
|
|
|
{
|
|
|
|
return this->get();
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2022-11-09 11:10:08 -05:00
|
|
|
size_t address_;
|
2022-06-02 04:14:44 -04:00
|
|
|
};
|
|
|
|
|
2022-08-10 05:26:19 -04:00
|
|
|
// Global game definitions
|
|
|
|
constexpr auto CMD_MAX_NESTING = 8;
|
2022-06-02 04:14:44 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
#include "symbols.hpp"
|