Files
gMod/header/Defines.h
T
Marc 4fa1d8e2c5 1.8.0 (#35)
* change tpfconvert functionality to backup into backup folder

* use vcpkg for more packages

* update readme, bump to 1.7.0.2

* rework dll path

* https://github.com/gwdevhub/gMod/issues/33

* v1.7.0.3

* debug mode enabled

* fix... something... somehow??? @STL can you explain this???

* safety

* 1.8.0.0
2026-01-09 00:43:28 +01:00

72 lines
1.6 KiB
C++

#pragma once
//using HashType = DWORD32;
using HashType = DWORD64;
struct HashTuple {
HashType crc32;
HashType crc64;
bool operator==(const HashTuple& other) const noexcept
{
return (other.crc32 == crc32) || (other.crc64 == crc64);
}
explicit operator bool() const noexcept
{
return crc32 != 0 || crc64 != 0;
}
explicit operator HashType() const noexcept
{
return crc32 ? crc32 : crc64;
}
};
struct TexEntry {
std::vector<BYTE> data{};
HashType crc_hash = 0; // hash value
std::string ext{};
};
struct TextureFileStruct {
std::vector<BYTE> data{};
HashType crc_hash = 0; // hash value
};
inline void Message([[maybe_unused]] const char* format, ...)
{
#ifdef _DEBUG
//const HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
//[[maybe_unused]] const auto success = SetConsoleTextAttribute(hConsole, 0); // white
va_list args;
va_start(args, format);
vprintf(format, args);
va_end(args);
#endif
}
inline void Info([[maybe_unused]] const char* format, ...)
{
#ifdef _DEBUG
//const HANDLE hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
//[[maybe_unused]] const auto success = SetConsoleTextAttribute(hConsole, 0); // white
va_list args;
va_start(args, format);
vprintf(format, args);
va_end(args);
#endif
}
inline void Warning([[maybe_unused]] const char* format, ...)
{
#ifdef _DEBUG
const HANDLE hConsole = GetStdHandle(STD_ERROR_HANDLE);
[[maybe_unused]] const auto success = SetConsoleTextAttribute(hConsole, 6); // yellow
va_list args;
va_start(args, format);
vfprintf(stderr, format, args);
va_end(args);
#endif
}