Compare commits

..

No commits in common. "f79fbad472e98c685040ea4ad01e59fb2ea7d40f" and "d76e6142b735b38d66d0ace8959d99c6f5279197" have entirely different histories.

3755 changed files with 558839 additions and 873241 deletions

View File

@ -30,18 +30,6 @@ include(lib/system/cmake/system.cmake)
# Build options # Build options
set(WHOA_VERSION_BUILD 12340)
set(WHOA_VERSION_MAJOR 3)
set(WHOA_VERSION_MINOR 3)
set(WHOA_VERSION_PATCH 5)
set(WHOA_VERSION_HOTFIX a)
add_definitions(-DWHOA_VERSION_BUILD="${WHOA_VERSION_BUILD}")
add_definitions(-DWHOA_VERSION_MAJOR="${WHOA_VERSION_MAJOR}")
add_definitions(-DWHOA_VERSION_MINOR="${WHOA_VERSION_MINOR}")
add_definitions(-DWHOA_VERSION_PATCH="${WHOA_VERSION_PATCH}")
add_definitions(-DWHOA_VERSION_HOTFIX="${WHOA_VERSION_HOTFIX}")
# UBsan # UBsan
set(WHOA_UB_SAN_HELP_TEXT "Disable/Enable the Undefined Behavior Sanitizer. This is turned on by default in Debug build types. Has no effect when using MSVC.") set(WHOA_UB_SAN_HELP_TEXT "Disable/Enable the Undefined Behavior Sanitizer. This is turned on by default in Debug build types. Has no effect when using MSVC.")
if (CMAKE_BUILD_TYPE STREQUAL "Debug") if (CMAKE_BUILD_TYPE STREQUAL "Debug")

@ -1 +1 @@
Subproject commit 7fa49919037fe35eae3ff7908dbe00b56cfac212 Subproject commit 9a3b3aeafd7e48194d0a5a3fbe459b965f5d12fa

@ -1 +1 @@
Subproject commit 12ab8f77215e07fc0e505b56760536883276d2cb Subproject commit af834cafa755de27a87b3400adb89b205e567166

@ -1 +1 @@
Subproject commit 2e824bfdc3e4a97057751d4ff7403d08de39745f Subproject commit 328613d0e8ebc0ed46af63a1248d213be4fbf601

View File

@ -12,7 +12,6 @@ add_subdirectory(gx)
add_subdirectory(math) add_subdirectory(math)
add_subdirectory(model) add_subdirectory(model)
add_subdirectory(net) add_subdirectory(net)
add_subdirectory(os)
add_subdirectory(sound) add_subdirectory(sound)
add_subdirectory(ui) add_subdirectory(ui)
add_subdirectory(util) add_subdirectory(util)

View File

@ -8,9 +8,7 @@
#include "console/Device.hpp" #include "console/Device.hpp"
#include "console/Screen.hpp" #include "console/Screen.hpp"
#include "console/Command.hpp" #include "console/Command.hpp"
#include "console/Console.hpp"
#include "db/Db.hpp" #include "db/Db.hpp"
#include "db/Startup_Strings.hpp"
#include "glue/CGlueMgr.hpp" #include "glue/CGlueMgr.hpp"
#include "gameui/CGGameUI.hpp" #include "gameui/CGGameUI.hpp"
#include "gx/Screen.hpp" #include "gx/Screen.hpp"
@ -24,14 +22,10 @@
#include <bc/Debug.hpp> #include <bc/Debug.hpp>
#include <common/Prop.hpp> #include <common/Prop.hpp>
#include <common/Time.hpp> #include <common/Time.hpp>
#include <common/Processor.hpp>
#include <storm/Error.hpp> #include <storm/Error.hpp>
#include <storm/Log.hpp> #include <storm/Log.hpp>
#include <storm/Registry.hpp>
#include <storm/Option.hpp>
#include <bc/os/Path.hpp> #include <bc/os/Path.hpp>
#include <bc/File.hpp> #include <bc/File.hpp>
#include <cstdio>
CVar* Client::g_accountNameVar; CVar* Client::g_accountNameVar;
CVar* Client::g_accountListVar; CVar* Client::g_accountListVar;
@ -46,14 +40,13 @@ HEVENTCONTEXT Client::g_clientEventContext;
char Client::g_currentLocaleName[5] = {}; char Client::g_currentLocaleName[5] = {};
static uint8_t s_expansionLevel; static uint8_t s_expansionLevel = 0;
static bool g_hasIsoLocale[12]; static bool g_hasIsoLocale[12] = {};
static const char* s_localeArray[12] = { static char* s_localeArray[12] = {
"deDE", "enGB", "enUS", "esES", "frFR", "koKR", "deDE", "enGB", "enUS", "esES", "frFR", "koKR",
"zhCN", "zhTW", "enCN", "enTW", "esMX", "ruRU" "zhCN", "zhTW", "enCN", "enTW", "esMX", "ruRU"
}; };
static int32_t s_timeTestError;
int32_t CCommand_ReloadUI(const char*, const char*) { int32_t CCommand_ReloadUI(const char*, const char*) {
CGlueMgr::m_reload = 1; CGlueMgr::m_reload = 1;
@ -65,21 +58,6 @@ int32_t CCommand_Perf(const char*, const char*) {
return 1; return 1;
} }
#if defined(WHOA_SYSTEM_WIN)
int32_t CCommand_TimingInfo(const char* command, const char* arguments) {
auto desiredTimingMethod = static_cast<TimingMethod>(CVar::LookupRegistered("timingMethod")->GetInt());
auto timingTestError = CVar::LookupRegistered("timingTestError")->GetInt();
auto selectedTimingMethod = OsTimeGetTimingMethod();
ConsolePrintf("Timing method desired: %d - %s", desiredTimingMethod, OsTimeGetTimingMethodName(desiredTimingMethod));
ConsolePrintf("Timing method selected: %d - %s", selectedTimingMethod, OsTimeGetTimingMethodName(selectedTimingMethod));
ConsolePrintf("Timing test error: %d", timingTestError);
return 1;
}
#endif
void AsyncFileInitialize() { void AsyncFileInitialize() {
// TODO // TODO
@ -95,90 +73,19 @@ void ClientMiscInitialize() {
} }
void ClientRegisterConsoleCommands() { void ClientRegisterConsoleCommands() {
ConsoleCommandRegister("reloadUI", CCommand_ReloadUI, GRAPHICS, nullptr); ConsoleCommandRegister("reloadUI", &CCommand_ReloadUI, CATEGORY::GRAPHICS, nullptr);
ConsoleCommandRegister("perf", CCommand_Perf, DEBUG, nullptr); ConsoleCommandRegister("perf", &CCommand_Perf, CATEGORY::DEBUG, nullptr);
Client::g_accountNameVar = CVar::Register( const auto game = CATEGORY::GAME;
"accountName",
"Saved account name",
64,
"",
nullptr,
GAME,
false,
nullptr,
false
);
Client::g_accountListVar = CVar::Register( Client::g_accountNameVar = CVar::Register("accountName", "Saved account name", 64, "", nullptr, game);
"accountList", Client::g_accountListVar = CVar::Register("accountList", "List of wow accounts for saved Blizzard account", 0, "", nullptr, game);
"List of wow accounts for saved Blizzard account", Client::g_accountUsesTokenVar = CVar::Register("g_accountUsesToken", "Saved whether uses authenticator", 0, "0", nullptr, game);
0, Client::g_movieVar = CVar::Register("movie", "Show movie on startup", 0, "1", nullptr, game);
"", Client::g_expansionMovieVar = CVar::Register("expansionMovie", "Show expansion movie on startup", 0, "1", nullptr, game);
nullptr, Client::g_movieSubtitleVar = CVar::Register("movieSubtitle", "Show movie subtitles", 0, "0", nullptr, game);
GAME, Client::g_lastCharacterIndex = CVar::Register("lastCharacterIndex", "Last character selected", 0, "0", nullptr, game);
false,
nullptr,
false
);
Client::g_accountUsesTokenVar = CVar::Register(
"g_accountUsesToken",
"Saved whether uses authenticator",
0,
"0",
nullptr,
GAME,
false,
nullptr,
false
);
Client::g_movieVar = CVar::Register(
"movie",
"Show movie on startup",
0,
"1",
nullptr,
GAME,
false,
nullptr,
false
);
Client::g_expansionMovieVar = CVar::Register(
"expansionMovie",
"Show expansion movie on startup",
0,
"1",
nullptr,
GAME,
false,
nullptr,
false
);
Client::g_movieSubtitleVar = CVar::Register(
"movieSubtitle",
"Show movie subtitles",
0,
"0",
nullptr,
GAME,
false,
nullptr,
false
);
Client::g_lastCharacterIndex = CVar::Register(
"lastCharacterIndex",
"Last character selected",
0,
"0",
nullptr,
GAME,
false,
nullptr,
false);
// TODO // TODO
} }
@ -189,6 +96,7 @@ void ClientPostClose(int32_t a1) {
int32_t DestroyEngineCallback(const void* a1, void* a2) { int32_t DestroyEngineCallback(const void* a1, void* a2) {
// TODO // TODO
return 1; return 1;
} }
@ -410,34 +318,6 @@ bool LocaleChangedCallback(CVar*, const char*, const char* value, void*) {
return true; return true;
} }
#if defined(WHOA_SYSTEM_WIN)
bool TimingMethodCallback(CVar* h, const char* oldValue, const char* newValue, void* param) {
auto cv = static_cast<CVar*>(param);
auto newMethod = static_cast<TimingMethod>(atol(newValue));
if (newMethod < TimingMethods) {
if (oldValue) {
auto oldMethod = static_cast<TimingMethod>(atol(oldValue));
if ((newMethod != oldMethod) && cv->GetInt()) {
cv->SetReadOnly(false);
cv->Set("0", true, false, false, true);
cv->SetReadOnly(true);
}
}
return true;
}
ConsolePrintf("\'%s\' is not a valid timing method. Valid methods are:", newValue);
auto method = Timing_BestAvailable;
while (method < TimingMethods) {
ConsolePrintf(" %d - %s", method, OsTimeGetTimingMethodName(method));
method = static_cast<TimingMethod>(static_cast<int32_t>(method) + 1);
}
return false;
}
#endif
int32_t InitializeGlobal() { int32_t InitializeGlobal() {
ProcessCommandLine(); ProcessCommandLine();
SetPaths(); SetPaths();
@ -565,55 +445,68 @@ int32_t InitializeGlobal() {
EventInitialize(1, 0); EventInitialize(1, 0);
#if defined(WHOA_SYSTEM_WIN) // CVar* v6 = CVar::Register(
// "timingTestError",
// "Error reported by the timing validation system",
// 6,
// "0",
// 0,
// 5,
// 0,
// 0,
// 0
// );
// v7 = v6;
auto cvTimingTestError = CVar::Register( // CVar* v8 = CVar::Register(
"timingTestError", // "timingMethod",
"Error reported by the timing validation system", // "Desired method for game timing",
0x2 | 0x4, // 2,
"0", // "0",
0, // &sub_403200,
DEFAULT, // 5,
false, // 0,
nullptr, // v6,
false // 0
); // );
auto cvTimingMethod = CVar::Register(
"timingMethod",
"Desired method for game timing",
0x2,
"0",
TimingMethodCallback,
DEFAULT,
false,
cvTimingTestError,
false
);
OsTimeStartup(static_cast<TimingMethod>(cvTimingMethod->GetInt()));
ConsoleCommandRegister("timingInfo", CCommand_TimingInfo, DEBUG, nullptr);
s_timeTestError = OsTimeGetTestError();
if (s_timeTestError != cvTimingTestError->GetInt()) {
char value[16];
sprintf(value, "%d", s_timeTestError);
cvTimingTestError->SetReadOnly(false);
cvTimingTestError->Set(value, true, false, false, true);
cvTimingTestError->Update();
cvTimingTestError->SetReadOnly(true);
ConsolePrintf("Timing test error: %d", s_timeTestError);
}
#else // sub_86D430(v8->m_intValue);
OsTimeStartup(Timing_QueryPerformanceCounter);
OsTimeStartup(Timing_BestAvailable); // ConsoleCommandRegister("timingInfo", (int)sub_4032A0, 0, 0);
#endif // v9 = sub_86AD50();
g_Startup_StringsDB.Load(__FILE__, __LINE__); // v10 = v9 == v7->m_intValue;
// dword_B2F9D8 = v9;
// if (!v10) {
// sprintf(&v17, "%d", v9);
// CVar::SetReadOnly((int)v7, 0);
// CVar::Set(v7, &v17, 1, 0, 0, 1);
// CVar::Update((int)v7);
// CVar::SetReadOnly((int)v7, 1);
// ConsolePrintf("Timing test error: %d", (int)v7);
// }
// WowClientDB<Startup_StringsRec>::Load(&g_Startup_StringsDB, 0, ".\\Client.cpp", 0x12E3u);
// Startup_StringsRec* v11 = g_Startup_StringsDB.GetRecordByIndex(1);
// const char* v12;
// if (v11) {
// v12 = v11->m_text;
// } else {
// v12 = "World of Warcraft";
// }
// TODO
// - replace with above logic for loading from Startup_Strings.dbc
const char* v12 = "World of Warcraft";
auto titleRecord = g_Startup_StringsDB.GetRecord(MSG_TITLE_WOW);
auto title = titleRecord ? titleRecord->m_message : "World of Warcraft";
char v15[260]; char v15[260];
SStrCopy(v15, title, 0x7FFFFFFF);
SStrCopy(v15, v12, 0x7FFFFFFF);
ConsoleDeviceInitialize(v15); ConsoleDeviceInitialize(v15);
@ -633,48 +526,24 @@ int32_t InitializeGlobal() {
return 1; return 1;
} }
void DestroyGlobal() {
// TODO
OsTimeShutdown();
EventDestroy();
ConsoleDeviceDestroy();
CVar::Destroy();
// TODO
}
void StormDestroy() {
// TODO
SRegDestroy();
}
void CommonMain() { void CommonMain() {
StormInitialize(); StormInitialize();
// TODO: // TODO:
// SErrCatchUnhandledExceptions(); // SErrCatchUnhandledExceptions();
// OsSystemInitialize("Blizzard Entertainment World of Warcraft", 0); // OsSystemInitialize("Blizzard Entertainment World of Warcraft", 0);
int32_t option = 1; // int option = 1;
StormSetOption(10, &option, sizeof(option)); // StormSetOption(10, &option, sizeof(option));
StormSetOption(11, &option, sizeof(option)); // StormSetOption(11, &option, sizeof(option));
// OsSystemEnableCpuLog();
// QoL: enable debug logs
#if !defined(NDEBUG)
option = 1;
StormSetOption(5, &option, sizeof(option));
#endif
OsSystemEnableCpuLog();
// SetPaths() moved into InitializeGlobal() // SetPaths() moved into InitializeGlobal()
uint32_t sendErrorLogs = 1; // int sendErrorLogs = 1;
if (!SRegLoadValue("World of Warcraft\\Client", "SendErrorLogs", 0, &sendErrorLogs)) { // if (!SRegLoadValue("World of Warcraft\\Client", "SendErrorLogs", 0, &sendErrorLogs)) {
sendErrorLogs = 1; // sendErrorLogs = 1;
SRegSaveValue("World of Warcraft\\Client", "SendErrorLogs", 0, sendErrorLogs); // SRegSaveValue("World of Warcraft\\Client", "SendErrorLogs", 0, sendErrorLogs);
} // }
// SErrSetLogTitleString("World of WarCraft (build 12340)"); // SErrSetLogTitleString("World of WarCraft (build 12340)");
// SErrSetLogTitleCallback(WowLogHeader); // SErrSetLogTitleCallback(WowLogHeader);
@ -684,12 +553,11 @@ void CommonMain() {
if (InitializeGlobal()) { if (InitializeGlobal()) {
EventDoMessageLoop(); EventDoMessageLoop();
DestroyGlobal(); // TODO: DestroyGlobal();
} }
StormDestroy();
// TODO: // TODO:
// StormDestroy();
// Misc Cleanup // Misc Cleanup
} }

View File

@ -3,7 +3,7 @@
#include <storm/Error.hpp> #include <storm/Error.hpp>
#include <common/DataStore.hpp> #include <common/DataStore.hpp>
#include "console/Console.hpp" #include "console/Line.hpp"
#include "world/World.hpp" #include "world/World.hpp"

View File

@ -57,7 +57,7 @@ void ProcessCommandLine() {
} }
const char* CmdLineGetString(CMDOPT opt) { const char* CmdLineGetString(CMDOPT opt) {
static char buffer[260]; static char buffer[260] = {0};
SCmdGetString(opt, buffer, 260); SCmdGetString(opt, buffer, 260);

6
src/client/Gui.hpp Normal file
View File

@ -0,0 +1,6 @@
#ifndef CLIENT_GUI_HPP
#define CLIENT_GUI_HPP
#include "client/gui/OsGui.hpp"
#endif

14
src/client/gui/OsGui.hpp Normal file
View File

@ -0,0 +1,14 @@
#ifndef CLIENT_GUI_OS_GUI_HPP
#define CLIENT_GUI_OS_GUI_HPP
#include <cstdint>
void* OsGuiGetWindow(int32_t type);
bool OsGuiIsModifierKeyDown(int32_t key);
int32_t OsGuiProcessMessage(void* message);
void OsGuiSetGxWindow(void* window);
#endif

View File

@ -0,0 +1,25 @@
#include "client/gui/OsGui.hpp"
static void* s_GxDevWindow = nullptr;
void* OsGuiGetWindow(int32_t type) {
switch (type) {
case 0:
return s_GxDevWindow;
default:
return nullptr;
}
}
bool OsGuiIsModifierKeyDown(int32_t key) {
// TODO
return false;
}
int32_t OsGuiProcessMessage(void* message) {
return 0;
}
void OsGuiSetGxWindow(void* window) {
s_GxDevWindow = window;
}

View File

@ -0,0 +1,18 @@
#include "client/gui/OsGui.hpp"
void* OsGuiGetWindow(int32_t type) {
return nullptr;
}
bool OsGuiIsModifierKeyDown(int32_t key) {
// TODO
return false;
}
int32_t OsGuiProcessMessage(void* message) {
return 0;
}
void OsGuiSetGxWindow(void* window) {
// TODO
}

View File

@ -0,0 +1,31 @@
#include "client/gui/OsGui.hpp"
#include <windows.h>
static void* s_GxDevWindow;
void* OsGuiGetWindow(int32_t type) {
switch (type) {
case 0:
return s_GxDevWindow;
case 1:
return GetActiveWindow();
case 2:
return GetForegroundWindow();
default:
return nullptr;
}
}
bool OsGuiIsModifierKeyDown(int32_t key) {
// TODO
return false;
}
int32_t OsGuiProcessMessage(void* message) {
// TODO
return 0;
}
void OsGuiSetGxWindow(void* window) {
s_GxDevWindow = window;
}

View File

@ -1,7 +1,6 @@
file(GLOB PRIVATE_SOURCES file(GLOB PRIVATE_SOURCES
"*.cpp" "*.cpp"
"command/*/*.cpp" "command/*/*.cpp"
"cvar/*.cpp"
) )
add_library(console STATIC add_library(console STATIC
@ -15,6 +14,7 @@ target_include_directories(console
target_link_libraries(console target_link_libraries(console
PUBLIC PUBLIC
bc
common common
gx gx
storm storm

View File

@ -1,6 +1,7 @@
#include "console/CVar.hpp" #include "console/CVar.hpp"
#include "console/Command.hpp"
#include "console/Types.hpp" #include "console/Types.hpp"
#include "console/Console.hpp" #include "console/Line.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
#include <bc/os/File.hpp> #include <bc/os/File.hpp>
@ -8,7 +9,6 @@
const char* s_filename = nullptr; const char* s_filename = nullptr;
bool CVar::m_needsSave; bool CVar::m_needsSave;
bool CVar::m_initialized;
TSHashTable<CVar, HASHKEY_STRI> CVar::s_registeredCVars; TSHashTable<CVar, HASHKEY_STRI> CVar::s_registeredCVars;
CVar* CVar::Lookup(const char* name) { CVar* CVar::Lookup(const char* name) {
@ -17,89 +17,68 @@ CVar* CVar::Lookup(const char* name) {
: nullptr; : nullptr;
} }
CVar* CVar::LookupRegistered(const char* name) { CVar* CVar::Register(const char* name, const char* help, uint32_t flags, const char* value, bool (*fcn)(CVar*, const char*, const char*, void*), uint32_t category, bool setCommand, void* arg, bool a9) {
if (!name) { CVar* var = CVar::s_registeredCVars.Ptr(name);
return nullptr;
}
auto cv = s_registeredCVars.Ptr(name);
if (!cv) {
return nullptr;
}
if (cv->m_flags & 0x80000000) {
return cv;
}
if (cv->m_flags & 0x80) {
return cv;
}
return nullptr;
}
CVar* CVar::Register(const char* name, const char* help, uint32_t flags, const char* value, HANDLER_FUNC fcn, uint32_t category, bool a7, void* arg, bool a9) { if (var) {
if (!name || !*name || !value) { bool setReset = var->m_resetValue.GetString() == nullptr;
return nullptr; bool setDefault = var->m_defaultValue.GetString() == nullptr;
}
auto cv = s_registeredCVars.Ptr(name); var->m_flags |= (var->m_flags & 0xFFFFFFCF);
if (cv) { var->m_callback = fcn;
bool setReset = cv->m_resetValue.GetString() == nullptr; var->m_arg = arg;
bool setDefault = cv->m_defaultValue.GetString() == nullptr;
cv->m_flags |= (cv->m_flags & 0xFFFFFFCF);
cv->m_callback = fcn;
cv->m_arg = arg;
bool setValue = false; bool setValue = false;
if (fcn && !fcn(cv, cv->GetString(), cv->GetString(), arg)) { if (fcn && !fcn(var, var->GetString(), var->GetString(), arg)) {
setValue = true; setValue = true;
} }
cv->Set(value, setValue, setReset, setDefault, false); var->Set(value, setValue, setReset, setDefault, false);
if (!a7) { if (!setCommand) {
cv->m_flags |= 0x80000000; var->m_flags |= 0x80000000;
} }
if (a9 && cv->m_flags) { if (a9 && var->m_flags) {
cv->m_flags |= 0x80; var->m_flags |= 0x80;
} }
} else { } else {
cv = s_registeredCVars.New(name, 0, 0); var = CVar::s_registeredCVars.New(name, 0, 0);
cv->m_stringValue.Copy(nullptr); var->m_stringValue.Copy(nullptr);
cv->m_floatValue = 0.0f; var->m_floatValue = 0.0f;
cv->m_intValue = 0; var->m_intValue = 0;
cv->m_modified = 0; var->m_modified = 0;
cv->m_category = category; var->m_category = category;
cv->m_defaultValue.Copy(nullptr); var->m_defaultValue.Copy(nullptr);
cv->m_resetValue.Copy(nullptr); var->m_resetValue.Copy(nullptr);
cv->m_latchedValue.Copy(nullptr); var->m_latchedValue.Copy(nullptr);
cv->m_callback = fcn; var->m_callback = fcn;
cv->m_flags = 0; var->m_flags = 0;
cv->m_arg = arg; var->m_arg = arg;
cv->m_help.Copy(help); var->m_help.Copy(help);
if (a7) { if (setCommand) {
cv->Set(value, true, true, false, false); var->Set(value, true, true, false, false);
} else { } else {
cv->Set(value, true, false, true, false); var->Set(value, true, false, true, false);
} }
cv->m_flags = flags | 0x1; var->m_flags = flags | 0x1;
if (!a7) { if (!setCommand) {
cv->m_flags |= 0x8000000; var->m_flags |= 0x8000000;
} }
if (a9 && cv->m_flags) { if (a9 && var->m_flags) {
cv->m_flags |= 0x80; var->m_flags |= 0x80;
} }
ConsoleCommandRegister(name, CvarCommandHandler, CATEGORY(category), help); ConsoleCommandRegister(name, CvarCommandHandler, CATEGORY(category), help);
} }
return cv; return var;
} }
CVar::CVar() : TSHashObject<CVar, HASHKEY_STRI>() { CVar::CVar() : TSHashObject<CVar, HASHKEY_STRI>() {
@ -174,14 +153,6 @@ bool CVar::Set(const char* value, bool setValue, bool setReset, bool setDefault,
return true; return true;
} }
void CVar::SetReadOnly(bool readonly) {
if (readonly) {
this->m_flags |= 0x4;
} else {
this->m_flags &= ~(0x4);
}
}
bool CVar::Reset() { bool CVar::Reset() {
auto value = this->m_resetValue; auto value = this->m_resetValue;
if (value.GetString() == nullptr) { if (value.GetString() == nullptr) {
@ -222,44 +193,53 @@ static int32_t s_CreatePathDirectories(const char* szPath) {
} }
int32_t CVar::Load(HOSFILE file) { int32_t CVar::Load(HOSFILE file) {
char fastData[CONSOLE_CVAR_MAX_LINE]; char fastData[2048] = {0};
char line[CONSOLE_CVAR_MAX_LINE]; char line[2048] = {0};
uint32_t bytesRead;
auto size = OsGetFileSize(file); auto size = OsGetFileSize(file);
auto data = size >= CONSOLE_CVAR_MAX_LINE ? reinterpret_cast<char*>(ALLOC(size + 1)) : fastData;
if (!OsReadFile(file, data, size, &bytesRead)) { char* data = nullptr;
if (fastData != data) {
FREE(data); if (0x1fff < size) {
} data = reinterpret_cast<char*>(SMemAlloc(size + 1, __FILE__, __LINE__, 0));
return 0; } else {
data = fastData;
} }
const char* curr = data; auto grown = 0x1fff < size;
data[size] = '\0'; int32_t result = 0;
// Skip over UTF-8 byte order mark uint32_t bytesRead = 0;
if (data && bytesRead >= 3) {
if (data[0] == '\xEF' && data[1] == '\xBB' && data[2] == '\xBF') { if (OsReadFile(file, data, size, &bytesRead) == 0) {
curr += 3; result = 0;
} else {
data[size] = '\0';
const char* curr = data;
// Skip over UTF-8 byte order mark
if ((((data != nullptr) && (2 < bytesRead)) && (data[0] == 0xef)) && ((data[1] == 0xbb && (data[2] == 0xbf)))) {
curr = data + 3;
} }
do {
SStrTokenize(&curr, line, 0x800, "\r\n", 0);
// Do not execute commands other than "set ..."
if (SStrCmpI(line, "SET ", 4) == 0) {
// Execute without adding to history
ConsoleCommandExecute(line, 0);
}
result = 1;
} while ((curr != nullptr) && (*curr != '\0'));
} }
do { if (grown) {
SStrTokenize(&curr, line, CONSOLE_CVAR_MAX_LINE, "\r\n", 0); SMemFree(data, __FILE__, __LINE__, 0);
// Do not execute commands other than "set ..."
if (SStrCmpI(line, "SET ", 4) == 0) {
// Execute without adding to history
ConsoleCommandExecute(line, 0);
}
} while (curr && *curr);
if (fastData != data) {
FREE(data);
} }
return 1; return result;
} }
int32_t CVar::Load(const char* filename) { int32_t CVar::Load(const char* filename) {
@ -285,7 +265,6 @@ int32_t CVar::Load(const char* filename) {
void CVar::Initialize(const char* filename) { void CVar::Initialize(const char* filename) {
STORM_ASSERT(filename); STORM_ASSERT(filename);
s_filename = filename; s_filename = filename;
m_initialized = 1;
// Get data path // Get data path
char path[STORM_MAX_PATH] = {0}; char path[STORM_MAX_PATH] = {0};
@ -294,80 +273,18 @@ void CVar::Initialize(const char* filename) {
s_CreatePathDirectories(path); s_CreatePathDirectories(path);
ConsoleCommandRegister("set", SetCommandHandler, DEFAULT, "Set the value of a CVar"); static ConsoleCommandList baseCommands[] = {
ConsoleCommandRegister("cvar_reset", CvarResetCommandHandler, DEFAULT, "Set the value of a CVar to it's startup value"); { "set", SetCommandHandler, "Set the value of a CVar" },
ConsoleCommandRegister("cvar_default", CvarDefaultCommandHandler, DEFAULT, "Set the value of a CVar to it's coded default value"); { "cvar_reset", CvarResetCommandHandler, "Set the value of a CVar to it's startup value" },
ConsoleCommandRegister("cvarlist", CvarListCommandHandler, DEFAULT, "List cvars"); { "cvar_default", CvarDefaultCommandHandler, "Set the value of a CVar to it's coded default value" },
{ "cvarlist", CvarListCommandHandler, "List cvars" }
};
CONSOLE_REGISTER_LIST(DEFAULT, baseCommands);
CVar::Load(s_filename); CVar::Load(s_filename);
} }
int32_t CVar::IterateForArchive(uint32_t a1, uint32_t a2, ITERATE_FUNC cb, void* param) {
auto cvar = s_registeredCVars.Head();
while (cvar) {
if (cvar->m_flags & 0x1) {
if (!(cvar->m_flags & 0x80) && (cvar->m_flags & 0x30) == a1 && (cvar->m_flags & a2) == 0) {
const char* value;
if ((value = cvar->m_latchedValue.GetString()) ||
(value = cvar->m_stringValue.GetString()) ||
(value = cvar->m_defaultValue.GetString())) {
auto defaultvalue = cvar->m_defaultValue.GetString();
if (!defaultvalue || SStrCmp(value, defaultvalue, STORM_MAX_STR)) {
if (!cb(cvar->m_key.m_str, value, param)) {
return 0;
}
}
}
}
}
cvar = s_registeredCVars.Next(cvar);
}
return 1;
}
bool CVar::SaveCvar(const char* key, const char* value, void* param) {
char buffer[STORM_MAX_PATH];
SStrPrintf(buffer, sizeof(buffer), "SET %s \"%s\"\n", key, value);
uint32_t byteswritten = 0;
OsWriteFile(static_cast<HOSFILE>(param), buffer, SStrLen(buffer), &byteswritten);
return byteswritten != 0;
}
int32_t CVarSaveFile() {
if (!CVar::m_needsSave) {
return 1;
}
char name[STORM_MAX_PATH];
CVar::m_needsSave = false;
SStrCopy(name, "WTF\\", sizeof(name));
SStrPack(name, s_filename, sizeof(name));
int32_t result = 0;
auto file = OsCreateFile(name, OS_GENERIC_WRITE, 0, OS_CREATE_ALWAYS, OS_FILE_ATTRIBUTE_NORMAL, OS_FILE_TYPE_DEFAULT);
if (file != HOSFILE_INVALID) {
result = CVar::IterateForArchive(0, 0, CVar::SaveCvar, file);
OsCloseFile(file);
}
return result;
}
void CVar::Destroy() {
m_initialized = 0;
CVarSaveFile();
ConsoleCommandUnregister("set");
ConsoleCommandUnregister("cvar_reset");
ConsoleCommandUnregister("cvar_default");
ConsoleCommandUnregister("cvarlist");
s_registeredCVars.Clear();
}
int32_t CvarResetCommandHandler(const char* command, const char* arguments) { int32_t CvarResetCommandHandler(const char* command, const char* arguments) {
char cvarName[256] = {0}; char cvarName[256] = {0};
auto string = arguments; auto string = arguments;
@ -452,33 +369,11 @@ int32_t SetCommandHandler(const char* command, const char* arguments) {
SStrTokenize(&str, cvarName, sizeof(cvarName), " ,;\t\"\r\n", nullptr); SStrTokenize(&str, cvarName, sizeof(cvarName), " ,;\t\"\r\n", nullptr);
SStrTokenize(&str, cvarValue, sizeof(cvarValue), " ,;\t\"\r\n", nullptr); SStrTokenize(&str, cvarValue, sizeof(cvarValue), " ,;\t\"\r\n", nullptr);
auto cvar = CVar::s_registeredCVars.Ptr(cvarName); auto var = CVar::Lookup(cvarName);
if (var) {
if (!cvar) { var->Set(cvarValue, true, false, false, true);
} else {
CVar::Register(cvarName, "", 0, cvarValue, nullptr, DEFAULT, true, nullptr, false); CVar::Register(cvarName, "", 0, cvarValue, nullptr, DEFAULT, true, nullptr, false);
return 1;
}
if (cvar->m_callback) {
// FUN_0086b5a0(cv->m_callback);
if (!cvar->m_callback(cvar, cvar->GetString(), cvarValue, cvar->m_arg)) {
return 1;
}
}
cvar->m_modified++;
if ((cvar->m_flags & 0x2)) {
cvar->m_latchedValue.Copy(cvarValue);
CVar::m_needsSave = true;
} else if (!(cvar->m_flags & 0x4)) {
if (cvar->GetString() && !SStrCmpI(cvarValue, cvar->GetString(), STORM_MAX_STR)) {
return 1;
}
cvar->m_stringValue.Copy(cvarValue);
cvar->m_intValue = SStrToInt(cvarValue);
cvar->m_floatValue = SStrToFloat(cvarValue);
CVar::m_needsSave = true;
} }
return 1; return 1;

View File

@ -1,36 +1,38 @@
#ifndef CONSOLE_CVAR_HPP #ifndef CONSOLE_C_VAR_HPP
#define CONSOLE_CVAR_HPP #define CONSOLE_C_VAR_HPP
#include <bc/os/File.hpp>
#include <common/String.hpp>
#include <cstdint> #include <cstdint>
#include <common/String.hpp>
#include <storm/Hash.hpp> #include <storm/Hash.hpp>
#include <bc/os/File.hpp>
#define CONSOLE_CVAR_MAX_LINE 2048 #include "console/Types.hpp"
class CVar : public TSHashObject<CVar, HASHKEY_STRI> { class CVar : public TSHashObject<CVar, HASHKEY_STRI> {
public: public:
typedef bool (*ITERATE_FUNC)(const char*, const char*, void*);
typedef bool (*HANDLER_FUNC)(CVar*, const char*, const char*, void*);
// Static variables // Static variables
static TSHashTable<CVar, HASHKEY_STRI> s_registeredCVars; static TSHashTable<CVar, HASHKEY_STRI> s_registeredCVars;
static bool m_needsSave; static bool m_needsSave;
static bool m_initialized;
// Static functions // Static functions
static CVar* Lookup(const char* name); static CVar* Lookup(const char* name);
static CVar* LookupRegistered(const char* name); static CVar* Register(
static CVar* Register(const char* name, const char* help, uint32_t flags, const char* value, HANDLER_FUNC fcn, uint32_t category, bool a7, void* arg, bool a9); const char* name,
static void Initialize(const char* filename); const char* help,
static int32_t IterateForArchive(uint32_t a1, uint32_t a2, ITERATE_FUNC cb, void* param); uint32_t flags,
static void Destroy(); const char* value,
bool (*fcn)(CVar*, const char*, const char*, void*) = nullptr,
uint32_t category = CATEGORY::DEFAULT,
bool setCommand = false,
void* arg = nullptr,
bool a9 = false
);
static void Initialize(const char* filename);
static int32_t Load(const char* filename); static int32_t Load(const char* filename);
static int32_t Load(HOSFILE fileHandle); static int32_t Load(HOSFILE fileHandle);
static bool SaveCvar(const char* key, const char* value, void* param);
// Member variables // Member variables
uint32_t m_category = 0; uint32_t m_category = 0;
uint32_t m_flags = 0; uint32_t m_flags = 0;
RCString m_stringValue; RCString m_stringValue;
float m_floatValue = 0.0; float m_floatValue = 0.0;
int32_t m_intValue = 0; int32_t m_intValue = 0;
@ -40,20 +42,20 @@ class CVar : public TSHashObject<CVar, HASHKEY_STRI> {
RCString m_latchedValue; RCString m_latchedValue;
RCString m_help; RCString m_help;
bool (*m_callback)(CVar*, const char*, const char*, void*) = nullptr; bool (*m_callback)(CVar*, const char*, const char*, void*) = nullptr;
void* m_arg = nullptr; void* m_arg = nullptr;
// Member functions // Member functions
CVar(); CVar();
int32_t GetInt(); int32_t GetInt();
const char* GetString(void); const char* GetString(void);
void InternalSet(const char*, bool, bool, bool, bool); void InternalSet(const char*, bool, bool, bool, bool);
bool Set(const char*, bool, bool, bool, bool); bool Set(const char* value, bool setValue, bool setReset, bool setDefault, bool a6);
void SetReadOnly(bool readonly);
bool Reset(); bool Reset();
bool Default(); bool Default();
int32_t Update(); int32_t Update();
}; };
int32_t SetCommandHandler(const char* command, const char* arguments); int32_t SetCommandHandler(const char* command, const char* arguments);
int32_t CvarResetCommandHandler(const char* command, const char* arguments); int32_t CvarResetCommandHandler(const char* command, const char* arguments);
int32_t CvarDefaultCommandHandler(const char* command, const char* arguments); int32_t CvarDefaultCommandHandler(const char* command, const char* arguments);

View File

@ -1,7 +1,6 @@
#include "console/Client.hpp" #include "console/Client.hpp"
#include "console/Command.hpp" #include "console/Command.hpp"
#include "console/CVar.hpp" #include "console/CVar.hpp"
#include "console/Console.hpp"
void ConsoleInitializeClientCommand() { void ConsoleInitializeClientCommand() {
ConsoleCommandInitialize(); ConsoleCommandInitialize();
@ -16,7 +15,3 @@ void ConsoleInitializeClientCVar(const char* a1) {
int32_t ConsoleLoadClientCVar(const char* a1) { int32_t ConsoleLoadClientCVar(const char* a1) {
return CVar::Load(a1); return CVar::Load(a1);
} }
void ConsoleDestroyClientCommand() {
ConsoleCommandDestroy();
}

View File

@ -9,6 +9,4 @@ void ConsoleInitializeClientCVar(const char* a1);
int32_t ConsoleLoadClientCVar(const char* a1); int32_t ConsoleLoadClientCVar(const char* a1);
void ConsoleDestroyClientCommand();
#endif #endif

View File

@ -1,26 +1,11 @@
#include "console/Command.hpp" #include "console/Command.hpp"
#include "console/Console.hpp"
#include "console/Line.hpp" #include "console/Line.hpp"
#include "console/Types.hpp"
#include "console/command/Commands.hpp"
#include <cctype>
#include <storm/Error.hpp> #include <storm/Error.hpp>
#include <storm/Unicode.hpp> #include <storm/Unicode.hpp>
int32_t s_completionMode = 0; #include <cctype>
const char* s_completedCmd = nullptr; #include <algorithm>
char s_partial[256];
char s_repeatBuffer[64];
uint32_t s_repeatCount = 0;
TSHashTable<CONSOLECOMMAND, HASHKEY_STRI> g_consoleCommandHash;
char g_commandHistory[CONSOLE_COMMAND_HISTORY_DEPTH][CONSOLE_COMMAND_BUFFER_SIZE];
uint32_t g_commandHistoryIndex;
char g_ExecBuffer[CONSOLE_COMMAND_EXEC_BUFFER_SIZE] = { 0 };
EXECMODE g_ExecCreateMode = EM_NOTACTIVE;
int32_t ValidateFileName(const char* filename) { int32_t ValidateFileName(const char* filename) {
if (SStrStr(filename, "..") || SStrStr(filename, "\\")) { if (SStrStr(filename, "..") || SStrStr(filename, "\\")) {
@ -40,6 +25,12 @@ int32_t ValidateFileName(const char* filename) {
return 1; return 1;
} }
TSHashTable<CONSOLECOMMAND, HASHKEY_STRI> g_consoleCommandHash;
char g_commandHistory[CONSOLE_HISTORY_DEPTH][CONSOLE_CMD_BUFFER_SIZE];
uint32_t g_commandHistoryIndex;
char g_ExecBuffer[CONSOLE_EXEC_BUFFER_SIZE] = {0};
EXECMODE g_ExecCreateMode = EM_NOTACTIVE;
int32_t AddLineToExecFile(const char* currentLine) { int32_t AddLineToExecFile(const char* currentLine) {
char stringToWrite[STORM_MAX_PATH]; char stringToWrite[STORM_MAX_PATH];
@ -54,7 +45,7 @@ int32_t AddLineToExecFile(const char* currentLine) {
SStrPrintf(stringToWrite, sizeof(stringToWrite), "%s\n", currentLine); SStrPrintf(stringToWrite, sizeof(stringToWrite), "%s\n", currentLine);
if (((CONSOLE_COMMAND_EXEC_BUFFER_SIZE - 1) - SStrLen(g_ExecBuffer)) != SStrLen(stringToWrite)) { if (((sizeof(g_ExecBuffer)-1) - SStrLen(g_ExecBuffer)) != SStrLen(stringToWrite)){
SStrPack(g_ExecBuffer, stringToWrite, sizeof(g_ExecBuffer)); SStrPack(g_ExecBuffer, stringToWrite, sizeof(g_ExecBuffer));
} }
@ -73,89 +64,37 @@ int32_t AddLineToExecFile(const char* currentLine) {
return 0; return 0;
} }
ConsoleWrite("Begin Typing the commands", ECHO_COLOR); // TODO
g_ExecCreateMode = EM_RECORDING;
return 1; return 1;
} }
CONSOLECOMMAND* ParseCommand(const char* commandLine, const char** command, char* arguments, size_t argsize) {
STORM_ASSERT(commandLine);
auto string = commandLine;
static char cmd[32] = { 0 };
auto cmdptr = &cmd[0];
int32_t i = 0;
while (i < CONSOLE_COMMAND_MAX_LENGTH) {
int32_t chars;
auto code = SUniSGetUTF8(reinterpret_cast<const uint8_t*>(string), &chars);
if (code == -1 || code == ' ' || chars > CONSOLE_COMMAND_MAX_LENGTH) {
break;
}
if (chars) {
for (size_t j = 0; j < chars; j++) {
*cmdptr++ = *string++;
}
}
i += chars;
}
*cmdptr = '\0';
if (command) {
*command = cmd;
}
auto argptr = arguments;
if (argptr) {
int32_t chars;
auto code = SUniSGetUTF8(reinterpret_cast<const uint8_t*>(string), &chars);
// Discard space
while (code != -1 && code == ' ') {
string += chars;
code = SUniSGetUTF8(reinterpret_cast<const uint8_t*>(string), &chars);
}
SStrCopy(argptr, string, argsize);
auto len = SStrLen(argptr);
while (len > 0 && (argptr[len - 1] == ' ')) {
len--;
argptr[len] = '\0';
}
}
return g_consoleCommandHash.Ptr(cmd);
}
void ConsoleCommandDestroy() { void ConsoleCommandDestroy() {
g_consoleCommandHash.Clear(); g_consoleCommandHash.Clear();
} }
const char* ConsoleCommandHistory(uint32_t index) { char* ConsoleCommandHistory(uint32_t index) {
return g_commandHistory[((g_commandHistoryIndex - index) - 1) & (CONSOLE_COMMAND_HISTORY_DEPTH - 1)]; // Return a pointer to the buffer at the specified index
return g_commandHistory[((g_commandHistoryIndex + (CONSOLE_HISTORY_DEPTH - 1) - index) & (CONSOLE_HISTORY_DEPTH - 1))];
} }
void AddToHistory(const char* command) { void AddToHistory(const char* command) {
SStrCopy(g_commandHistory[g_commandHistoryIndex], command, CONSOLE_LINE_LENGTH); SStrCopy(g_commandHistory[g_commandHistoryIndex], command, CONSOLE_LINE_LENGTH);
g_commandHistoryIndex = (g_commandHistoryIndex + 1) & (CONSOLE_COMMAND_HISTORY_DEPTH - 1); g_commandHistoryIndex = (g_commandHistoryIndex + 1) & (CONSOLE_HISTORY_DEPTH-1);
} }
uint32_t ConsoleCommandHistoryDepth() { uint32_t ConsoleCommandHistoryDepth() {
return CONSOLE_COMMAND_HISTORY_DEPTH; return CONSOLE_HISTORY_DEPTH;
} }
int32_t ConsoleCommandRegister(const char* command, COMMANDHANDLER handler, CATEGORY category, const char* helpText) { int32_t ConsoleCommandRegister(const char* command, COMMANDHANDLER handler, CATEGORY category, const char* helpText) {
STORM_ASSERT(command); STORM_ASSERT(command);
STORM_ASSERT(handler); STORM_ASSERT(handler);
if (SStrLen(command) >= CONSOLE_COMMAND_MAX_LENGTH || g_consoleCommandHash.Ptr(command)) { if (SStrLen(command) > (CONSOLE_MAX_CMD_LENGTH - 1) || g_consoleCommandHash.Ptr(command)) {
// The command name exceeds CONSOLE_MAX_CMD_LENGTH, minus the null terminator
// or it has already been registered
return 0; return 0;
} }
@ -177,21 +116,106 @@ void ConsoleCommandUnregister(const char* command) {
} }
} }
void ConsoleCommandExecute(const char* commandLine, int32_t addToHistory) { CONSOLECOMMAND* ParseCommand(const char* commandLine, const char** command, char* arguments, size_t argsize) {
STORM_ASSERT(commandLine);
auto string = commandLine;
static char cmd[32] = { 0 };
auto cmdptr = &cmd[0];
int32_t end = CONSOLE_MAX_CMD_LENGTH;
int32_t i = 0;
while (i < end) {
int32_t chars;
auto code = SUniSGetUTF8(reinterpret_cast<const uint8_t*>(string), &chars);
if (code == -1 || code == ' ' || chars > CONSOLE_MAX_CMD_LENGTH) {
break;
}
if (chars) {
for (size_t c = 0; c < chars; c++) {
*cmdptr = *string;
cmdptr += chars;
string += chars;
}
}
i += chars;
}
*cmdptr = '\0';
if (command) {
*command = cmd;
}
auto argptr = arguments;
if (arguments) {
int32_t chars;
auto code = SUniSGetUTF8(reinterpret_cast<const uint8_t*>(string), &chars);
// Discard space
while (code != -1 && code == ' ') {
string += chars;
code = SUniSGetUTF8(reinterpret_cast<const uint8_t*>(string), &chars);
}
SStrCopy(argptr, string, argsize);
auto len = SStrLen(argptr);
while (len > 0 && (argptr[len-1] == ' ')) {
len--;
argptr[len] = '\0';
}
}
return g_consoleCommandHash.Ptr(cmd);
}
void MakeCommandCurrent(CONSOLELINE* lineptr, char* command) {
auto len = lineptr->inputstart;
lineptr->inputpos = len;
lineptr->chars = len;
lineptr->buffer[len] = '\0';
len = SStrLen(command);
ReserveInputSpace(lineptr, len);
SStrCopy(lineptr->buffer + lineptr->inputpos, command, STORM_MAX_STR);
len = lineptr->inputpos + len;
lineptr->inputpos = len;
lineptr->chars = len;
}
void ConsoleCommandExecute(char* commandLine, int32_t addToHistory) {
auto em = g_ExecCreateMode; auto em = g_ExecCreateMode;
if (em == EM_RECORDING || em == EM_PROMPTOVERWRITE || em == EM_APPEND) { if (em == EM_RECORDING || em == EM_PROMPTOVERWRITE || em == EM_APPEND) {
AddLineToExecFile(commandLine); AddLineToExecFile(commandLine);
return; return;
} }
auto history = ConsoleCommandHistory(0); auto history = ConsoleCommandHistory(0);
if (addToHistory && (history == nullptr || SStrCmp(commandLine, history, STORM_MAX_STR))) { if (addToHistory && (history == nullptr || SStrCmp(commandLine, history, STORM_MAX_STR))) {
AddToHistory(commandLine); AddToHistory(commandLine);
} }
const char* command = nullptr; const char* command = nullptr;
auto arguments = reinterpret_cast<char*>(ALLOC(CONSOLE_COMMAND_BUFFER_SIZE)); auto arguments = reinterpret_cast<char*>(SMemAlloc(CONSOLE_CMD_BUFFER_SIZE, __FILE__, __LINE__, 0));
auto cmd = ParseCommand(commandLine, &command, arguments, CONSOLE_CMD_BUFFER_SIZE);
auto cmd = ParseCommand(commandLine, &command, arguments, CONSOLE_COMMAND_BUFFER_SIZE);
if (cmd) { if (cmd) {
cmd->m_handler(command, arguments); cmd->m_handler(command, arguments);
} else { } else {
@ -199,25 +223,45 @@ void ConsoleCommandExecute(const char* commandLine, int32_t addToHistory) {
} }
if (arguments) { if (arguments) {
FREE(arguments); SMemFree(arguments, __FILE__, __LINE__, 0);
}
}
static ConsoleCommandList s_consoleSpecificCommands[] = {
{ "fontcolor", ConsoleCommand_FontColor, "[ColorClassName] [Red 0-255] [Green 0-255] [Blue 0-255]" },
{ "bgcolor", ConsoleCommand_BackGroundColor, "[alpha 0-255] [Red 0-255] [Green 0-255] [Blue 0-255]" },
{ "highlightcolor", ConsoleCommand_HighLightColor, "[alpha 0-255] [Red 0-255] [Green 0-255] [Blue 0-255]" },
{ "fontsize", ConsoleCommand_FontSize, "[15-50] arbitrary font size" },
{ "font", ConsoleCommand_Font, "[fontname] make sure to use the .ttf file name" },
{ "consolelines", ConsoleCommand_BufferSize, "[number] number of lines to show in the console" },
{ "clear", ConsoleCommand_ClearConsole, "Clears the console buffer" },
{ "proportionaltext", ConsoleCommand_Proportional, "Toggles fixed-width text characters" },
{ "spacing", ConsoleCommand_CharSpacing, "[float] specifies inter-character spacing, in pixels" },
{ "settings", ConsoleCommand_CurrentSettings, "Shows current font and console settings" },
{ "default", ConsoleCommand_DefaultSettings, "Resets all the font and console settings" },
{ "closeconsole", ConsoleCommand_CloseConsole, "Closes the Console window" },
{ "repeat", ConsoleCommand_RepeatHandler, "Repeats a command" },
{ "AppendLogToFile", ConsoleCommand_AppendLogToFile, "[filename = ConsoleLogs/Log<Timestamp>.txt] [numLines = all]" }
};
static ConsoleCommandList s_commonCommands[] = {
{ "quit", ConsoleCommand_Quit, nullptr },
{ "ver", ConsoleCommand_Ver, nullptr },
{ "setmap", ConsoleCommand_SetMap, nullptr }
};
void RegisterConsoleCommandList(CATEGORY category, ConsoleCommandList list[], size_t count) {
size_t i = 0;
while (i < count) {
auto& cmd = list[i];
ConsoleCommandRegister(cmd.m_command, cmd.m_handler, category, cmd.m_helpText);
i++;
} }
} }
void ConsoleInitializeScreenCommand() { void ConsoleInitializeScreenCommand() {
ConsoleCommandRegister("fontcolor", ConsoleCommand_FontColor, CONSOLE, "[ColorClassName] [Red 0-255] [Green 0-255] [Blue 0-255]"); CONSOLE_REGISTER_LIST(CONSOLE, s_consoleSpecificCommands);
ConsoleCommandRegister("bgcolor", ConsoleCommand_BackGroundColor, CONSOLE, "[alpha 0-255] [Red 0-255] [Green 0-255] [Blue 0-255]");
ConsoleCommandRegister("highlightcolor", ConsoleCommand_HighLightColor, CONSOLE, "[alpha 0-255] [Red 0-255] [Green 0-255] [Blue 0-255]");
ConsoleCommandRegister("fontsize", ConsoleCommand_FontSize, CONSOLE, "[15-50] arbitrary font size");
ConsoleCommandRegister("font", ConsoleCommand_Font, CONSOLE, "[fontname] make sure to use the .ttf file name");
ConsoleCommandRegister("consolelines", ConsoleCommand_BufferSize, CONSOLE, "[number] number of lines to show in the console");
ConsoleCommandRegister("clear", ConsoleCommand_ClearConsole, CONSOLE, "Clears the console buffer");
ConsoleCommandRegister("proportionaltext", ConsoleCommand_Proportional, CONSOLE, "Toggles fixed-width text characters");
ConsoleCommandRegister("spacing", ConsoleCommand_CharSpacing, CONSOLE, "[float] specifies inter-character spacing, in pixels");
ConsoleCommandRegister("settings", ConsoleCommand_CurrentSettings, CONSOLE, "Shows current font and console settings");
ConsoleCommandRegister("default", ConsoleCommand_DefaultSettings, CONSOLE, "Resets all the font and console settings");
ConsoleCommandRegister("closeconsole", ConsoleCommand_CloseConsole, CONSOLE, "Closes the Console window");
ConsoleCommandRegister("repeat", ConsoleCommand_RepeatHandler, CONSOLE, "Repeats a command");
ConsoleCommandRegister("AppendLogToFile", ConsoleCommand_AppendLogToFile, CONSOLE, "[filename = ConsoleLogs/Log<Timestamp>.txt] [numLines = all]");
} }
void ConsoleCommandInitialize() { void ConsoleCommandInitialize() {
@ -225,36 +269,9 @@ void ConsoleCommandInitialize() {
} }
void ConsoleInitializeCommonCommand() { void ConsoleInitializeCommonCommand() {
ConsoleCommandRegister("quit", ConsoleCommand_Quit, DEFAULT, nullptr); CONSOLE_REGISTER_LIST(DEFAULT, s_commonCommands);
ConsoleCommandRegister("ver", ConsoleCommand_Ver, DEFAULT, nullptr);
ConsoleCommandRegister("setmap", ConsoleCommand_SetMap, DEFAULT, nullptr);
} }
void ConsoleInitializeDebugCommand() { void ConsoleInitializeDebugCommand() {
// TODO // TODO
} }
int32_t ConsoleCommandComplete(const char* partial, const char** previous, int32_t direction) {
auto current = g_consoleCommandHash.Head();
if (*previous) {
auto cmd = g_consoleCommandHash.Ptr(*previous);
if (!cmd) {
return 0;
}
// TODO: double check this
current = g_consoleCommandHash.Next(direction ? cmd : cmd->m_linktoslot.Prev());
}
auto len = SStrLen(partial);
while (current) {
// console command found
if (SStrCmpI(partial, current->m_key.m_str, len) == 0) {
*previous = current->m_key.m_str;
return 1;
}
current = g_consoleCommandHash.Next(current);
}
return 0;
}

View File

@ -2,41 +2,67 @@
#define CONSOLE_COMMAND_HPP #define CONSOLE_COMMAND_HPP
#include "console/Types.hpp" #include "console/Types.hpp"
#include <cstdint>
#include <storm/Hash.hpp> #include <storm/Hash.hpp>
#include <cstdint>
#define CONSOLE_COMMAND_EXEC_BUFFER_SIZE 8192 #define CONSOLE_REGISTER_LIST(category, list) RegisterConsoleCommandList(category, list, sizeof(list) / sizeof(ConsoleCommandList))
#define CONSOLE_COMMAND_BUFFER_SIZE 1024
#define CONSOLE_COMMAND_MAX_LENGTH 64
#define CONSOLE_COMMAND_HISTORY_DEPTH 32
class CONSOLECOMMAND : public TSHashObject<CONSOLECOMMAND, HASHKEY_STRI> { #define CONSOLE_EXEC_BUFFER_SIZE 8192
public: #define CONSOLE_CMD_BUFFER_SIZE 1024
COMMANDHANDLER m_handler; #define CONSOLE_MAX_CMD_LENGTH 64
const char* m_helpText; #define CONSOLE_HISTORY_DEPTH 32
CATEGORY m_category; #define CONSOLE_NOHELP nullptr
};
extern int32_t s_completionMode;
extern const char* s_completedCmd;
extern char s_partial[256];
extern char s_repeatBuffer[64];
extern uint32_t s_repeatCount;
extern TSHashTable<CONSOLECOMMAND, HASHKEY_STRI> g_consoleCommandHash; extern TSHashTable<CONSOLECOMMAND, HASHKEY_STRI> g_consoleCommandHash;
extern char g_commandHistory[CONSOLE_HISTORY_DEPTH][CONSOLE_CMD_BUFFER_SIZE];
extern uint32_t g_commandHistoryIndex;
extern char g_ExecBuffer[CONSOLE_EXEC_BUFFER_SIZE];
void ConsoleCommandInitialize(); void ConsoleCommandDestroy();
const char* ConsoleCommandHistory(uint32_t index); char* ConsoleCommandHistory(uint32_t index);
uint32_t ConsoleCommandHistoryDepth(); uint32_t ConsoleCommandHistoryDepth();
int32_t ConsoleCommandRegister(const char* command, COMMANDHANDLER handler, CATEGORY category, const char* helpText);
void ConsoleCommandInitialize();
void ConsoleInitializeCommonCommand(); void ConsoleInitializeCommonCommand();
void ConsoleInitializeDebugCommand(); void ConsoleInitializeDebugCommand();
void ConsoleInitializeScreenCommand(); void ConsoleInitializeScreenCommand();
int32_t ConsoleCommandComplete(const char* partial, const char** previous, int32_t direction); void RegisterConsoleCommandList(CATEGORY category, ConsoleCommandList list[], size_t count);
void ConsoleCommandUnregister(const char* command);
void ConsoleCommandExecute(char* commandLine, int32_t addToHistory);
void MakeCommandCurrent(CONSOLELINE* lineptr, char* command);
// Commands
int32_t ConsoleCommand_Quit(const char* command, const char* arguments);
int32_t ConsoleCommand_Ver(const char* command, const char* arguments);
int32_t ConsoleCommand_SetMap(const char* command, const char* arguments);
int32_t ConsoleCommand_Help(const char* command, const char* arguments);
int32_t ConsoleCommand_FontColor(const char* command, const char* arguments);
int32_t ConsoleCommand_BackGroundColor(const char* command, const char* arguments);
int32_t ConsoleCommand_HighLightColor(const char* command, const char* arguments);
int32_t ConsoleCommand_FontSize(const char* command, const char* arguments);
int32_t ConsoleCommand_Font(const char* command, const char* arguments);
int32_t ConsoleCommand_BufferSize(const char* command, const char* arguments);
int32_t ConsoleCommand_ClearConsole(const char* command, const char* arguments);
int32_t ConsoleCommand_Proportional(const char* command, const char* arguments);
int32_t ConsoleCommand_CharSpacing(const char* command, const char* arguments);
int32_t ConsoleCommand_CurrentSettings(const char* command, const char* arguments);
int32_t ConsoleCommand_DefaultSettings(const char* command, const char* arguments);
int32_t ConsoleCommand_CloseConsole(const char* command, const char* arguments);
int32_t ConsoleCommand_RepeatHandler(const char* command, const char* arguments);
int32_t ConsoleCommand_AppendLogToFile(const char* command, const char* arguments);
#endif #endif

View File

@ -1,9 +1,13 @@
#include "console/Console.hpp" #include "console/Console.hpp"
#include "event/Context.hpp"
#include "event/Event.hpp" #include "event/Event.hpp"
static int32_t s_active; static int32_t s_active;
static int32_t s_consoleAccessEnabled; static int32_t s_consoleAccessEnabled;
static KEY s_consoleKey = KEY_TILDE; static KEY s_consoleKey = KEY_TILDE;
static float s_consoleLines = 10.0f;
static float s_fontHeight = 0.02f;
static float s_consoleHeight = s_consoleLines * s_fontHeight;
static CONSOLERESIZESTATE s_consoleResizeState = CS_NONE; static CONSOLERESIZESTATE s_consoleResizeState = CS_NONE;
int32_t ConsoleAccessGetEnabled() { int32_t ConsoleAccessGetEnabled() {
@ -18,6 +22,18 @@ int32_t ConsoleGetActive() {
return s_active; return s_active;
} }
float ConsoleGetFontHeight() {
return s_fontHeight;
}
float ConsoleGetHeight() {
return s_consoleHeight;
}
float ConsoleGetLines() {
return s_consoleLines;
}
KEY ConsoleGetHotKey() { KEY ConsoleGetHotKey() {
return s_consoleKey; return s_consoleKey;
} }
@ -34,6 +50,14 @@ void ConsoleSetHotKey(KEY hotkey) {
s_consoleKey = hotkey; s_consoleKey = hotkey;
} }
void ConsolePostClose() { void ConsoleSetResizeState(CONSOLERESIZESTATE state) {
EventPostClose(); s_consoleResizeState = state;
}
void ConsoleSetHeight(float height) {
s_consoleHeight = height;
}
void ConsolePostClose() {
EventPostCloseEx(EventGetCurrentContext());
} }

View File

@ -1,6 +1,7 @@
#ifndef CONSOLE_CONSOLE_HPP #ifndef CONSOLE_CONSOLE_HPP
#define CONSOLE_CONSOLE_HPP #define CONSOLE_CONSOLE_HPP
#include "console/Line.hpp"
#include "console/Types.hpp" #include "console/Types.hpp"
#include "event/Types.hpp" #include "event/Types.hpp"
#include <cstdint> #include <cstdint>
@ -11,28 +12,24 @@ void ConsoleAccessSetEnabled(int32_t enable);
int32_t ConsoleGetActive(); int32_t ConsoleGetActive();
float ConsoleGetFontHeight();
float ConsoleGetLines();
float ConsoleGetHeight();
KEY ConsoleGetHotKey(); KEY ConsoleGetHotKey();
CONSOLERESIZESTATE ConsoleGetResizeState();
void ConsoleSetActive(int32_t active); void ConsoleSetActive(int32_t active);
void ConsoleSetHotKey(KEY hotkey); void ConsoleSetHotKey(KEY hotkey);
void ConsoleCommandDestroy(); void ConsoleSetHeight(float height);
int32_t ConsoleCommandRegister(const char* command, COMMANDHANDLER handler, CATEGORY category, const char* helpText); void ConsoleSetResizeState(CONSOLERESIZESTATE state);
void ConsoleCommandUnregister(const char* command);
void ConsoleCommandExecute(const char* commandLine, int32_t addToHistory);
void ConsolePostClose(); void ConsolePostClose();
void ConsoleWrite(const char* str, COLOR_T color); #endif // ifndef CONSOLE_CONSOLE_HPP
void ConsolePrintf(const char* str, ...);
void ConsoleWriteA(const char* str, COLOR_T color, ...);
void ConsoleClear();
#endif

View File

@ -1,467 +0,0 @@
#include "console/Detect.hpp"
#include "db/Db.hpp"
#include "db/Startup_Strings.hpp"
#include "gx/CGxFormat.hpp"
#include "gx/Device.hpp"
#include "os/Debug.hpp"
#include "os/Gui.hpp"
#include <common/Processor.hpp>
#include <storm/Registry.hpp>
#if defined(WHOA_SYSTEM_MAC)
#include <OpenGL/gl.h>
#include <sys/sysctl.h>
#endif
WowClientDB<VideoHardwareRec> g_videoHardwareDB;
CGxFormat s_formats[7] = {
{ 0, { 640, 480 }, CGxFormat::Fmt_Rgb565, CGxFormat::Fmt_Ds160, 60, 1, true, false, true, true, false },
{ 0, { 800, 600 }, CGxFormat::Fmt_Rgb565, CGxFormat::Fmt_Ds160, 60, 1, true, false, true, true, false },
{ 0, { 640, 480 }, CGxFormat::Fmt_ArgbX888, CGxFormat::Fmt_Ds24X, 60, 1, true, false, true, true, false },
{ 0, { 800, 600 }, CGxFormat::Fmt_ArgbX888, CGxFormat::Fmt_Ds24X, 60, 1, true, false, true, true, false },
{ 0, { 1024, 768 }, CGxFormat::Fmt_ArgbX888, CGxFormat::Fmt_Ds24X, 60, 1, true, false, true, true, false },
{ 0, { 1280, 1024 }, CGxFormat::Fmt_ArgbX888, CGxFormat::Fmt_Ds24X, 60, 1, true, false, true, true, false },
{ 0, { 1600, 1200 }, CGxFormat::Fmt_ArgbX888, CGxFormat::Fmt_Ds24X, 60, 1, true, false, true, true, false }
};
CpuHardware s_cpuHwSettings[2] = {
{ 0, 0, 0, 0, 0, 0 },
{ 1, 1, 1, 1, 1, 1 }
};
SoundHardware s_soundHwSettings[1] = {
{ 1, false }
};
uint32_t s_detailDoodadDensity[4] = {
8,
12,
16,
24
};
bool s_animatingDoodads[2][2] = {
{ false, false },
{ false, true }
};
uint32_t s_waterLOD[2][2] = {
{ 0, 0 },
{ 0, 1 }
};
float s_particleDensity[4][2] = {
{ 0.3f, 0.4f },
{ 0.5f, 0.6f },
{ 0.9f, 1.0f },
{ 1.0f, 1.0f }
};
float s_unitDrawDist[4][2] = {
{ 35.0f, 50.0f },
{ 50.0f, 75.0f },
{ 75.0f, 300.0f },
{ 300.0f, 300.0f }
};
float s_smallCull[4][2] = {
{ 0.08f, 0.08f },
{ 0.07f, 0.07f },
{ 0.07f, 0.07f },
{ 0.04f, 0.04f }
};
float s_distCull[4][2] = {
{ 350.0f, 350.0f },
{ 400.0f, 400.0f },
{ 450.0f, 450.0f },
{ 500.0f, 500.0f },
};
float s_farClip[5][2] = {
{ 200.0f, 277.0f },
{ 300.0f, 350.0f },
{ 350.0f, 400.0f },
{ 450.0f, 550.0f },
{ 450.0f, 777.0f }
};
void AddResolution(TSGrowableArray<C2iVector>& resolutions, const C2iVector& resolution) {
resolutions.Add(1, &resolution);
}
void ConsoleDetectGetResolutions(TSGrowableArray<C2iVector>& resolutions, int32_t widescreen) {
if (widescreen) {
TSGrowableArray<CGxMonitorMode> modes;
GxAdapterMonitorModes(modes);
C2iVector prev = { 0, 0 };
for (uint32_t i = 0; i < modes.Count(); i++) {
auto& mode = modes[i];
if ((static_cast<float>(mode.size.x) / static_cast<float>(mode.size.y)) > 1.248f &&
mode.size.x >= 640 &&
mode.size.y >= 480 &&
mode.size.x != prev.x && mode.size.y != prev.y) {
AddResolution(resolutions, mode.size);
prev = mode.size;
}
}
}
if (!resolutions.Count() || !widescreen) {
// Add generic 4:3 fallback resolutions
AddResolution(resolutions, { 640, 480 });
AddResolution(resolutions, { 800, 600 });
AddResolution(resolutions, { 1024, 768 });
AddResolution(resolutions, { 1152, 864 });
AddResolution(resolutions, { 1280, 960 });
AddResolution(resolutions, { 1280, 1024 });
AddResolution(resolutions, { 1600, 1200 });
}
}
void ConsoleDetectSaveHardware(Hardware& hardware, bool& hwChanged) {
uint32_t cpuIdx;
uint32_t memIdx;
uint32_t videoID;
uint32_t soundIdx;
if (!SRegLoadValue("World of Warcraft\\Client", "HWCpuIdx", 0, &cpuIdx)) {
cpuIdx = hardware.cpuIdx;
}
if (!SRegLoadValue("World of Warcraft\\Client", "HWMemIdx", 0, &memIdx)) {
memIdx = hardware.memIdx;
}
if (!SRegLoadValue("World of Warcraft\\Client", "HWVideoID", 0, &videoID)) {
videoID = hardware.videoID;
}
if (!SRegLoadValue("World of Warcraft\\Client", "HWSoundIdx", 0, &soundIdx)) {
soundIdx = hardware.soundIdx;
}
bool v2 = (((videoID == 1 || videoID == 168) || (videoID == 169)) || videoID == 170);
if (hardware.cpuIdx == cpuIdx && hardware.memIdx == memIdx && (v2 || hardware.videoID == videoID) && hardware.soundIdx == soundIdx) {
hwChanged = false;
} else {
#if defined(WHOA_SYSTEM_WIN) || defined(WHOA_SYSTEM_LINUX)
auto titleRecord = g_Startup_StringsDB.GetRecord(MSG_TITLE_WOW);
auto title = titleRecord ? titleRecord->m_message : "World of Warcraft";
auto hwChangedMessageRecord = g_Startup_StringsDB.GetRecord(MSG_HW_CHANGED);
auto message = hwChangedMessageRecord ? hwChangedMessageRecord->m_message : "Hardware changed. Reload default settings?";
hwChanged = !OsGuiMessageBox(OsGuiGetWindow(2), 2, message, title);
#endif
#if defined(WHOA_SYSTEM_MAC)
hwChanged = true;
#endif
}
SRegSaveValue("World of Warcraft\\Client", "HWCpuIdx", 0, hardware.cpuIdx);
SRegSaveValue("World of Warcraft\\Client", "HWMemIdx", 0, hardware.memIdx);
SRegSaveValue("World of Warcraft\\Client", "HWVideoID", 0, hardware.videoID);
SRegSaveValue("World of Warcraft\\Client", "HWSoundIdx", 0, hardware.soundIdx);
}
[[noreturn]] void PrintStartupError(int32_t messageID, const char* fallbackMessage) {
auto titleRecord = g_Startup_StringsDB.GetRecord(MSG_TITLE_WOW);
auto title = titleRecord ? titleRecord->m_message : "World of Warcraft";
auto messageRecord = g_Startup_StringsDB.GetRecord(messageID);
auto message = messageRecord ? messageRecord->m_message : fallbackMessage;
OsGuiMessageBox(OsGuiGetWindow(2), 0, message, title);
exit(0);
}
void SetVideoIdx(Hardware& hardware) {
int32_t index = 1;
while (index < g_videoHardwareDB.m_numRecords) {
auto videoHw = g_videoHardwareDB.GetRecordByIndex(index);
if (hardware.videoDevice.vendorID == videoHw->m_vendorID &&
hardware.videoDevice.deviceID == videoHw->m_deviceID) {
hardware.videoID = videoHw->m_ID;
}
index++;
}
}
#if defined(WHOA_SYSTEM_WIN) || defined(WHOA_SYSTEM_LINUX)
void ConsoleDetectDetectHardware(Hardware& hardware, bool& hwChanged) {
// anti-feature
// if (OsIsRemoteSession()) {
// PrintStartupError(12, "Running World of Warcraft through a Remote Desktop connection is not supported. Exiting program.");
// }
//
g_videoHardwareDB.Load(__FILE__, __LINE__);
hardware.cpuIdx = (static_cast<float>(OsGetProcessorTicksPerSecond()) * 0.000001f) > 1500.0f;
hardware.memIdx = 0;
hardware.videoID = 0;
if (GxAdapterID(hardware.videoDevice.vendorID,
hardware.videoDevice.deviceID,
hardware.videoDevice.driverVersionHi,
hardware.videoDevice.driverVersionLo)) {
SetVideoIdx(hardware);
}
if (!hardware.videoID) {
hardware.videoDevice.vendorID = 0xFFFF;
if (GxAdapterInfer(hardware.videoDevice.deviceID)) {
SetVideoIdx(hardware);
}
if (!hardware.videoID) {
PrintStartupError(MSG_GX_NO_DEVICE, "Failed to find a suitable display device. Exiting program.");
}
}
hardware.cpuHw = &s_cpuHwSettings[hardware.cpuIdx];
hardware.videoHw = g_videoHardwareDB.GetRecord(hardware.videoID);
hardware.soundHw = &s_soundHwSettings[hardware.soundIdx];
ConsoleDetectSaveHardware(hardware, hwChanged);
char str[1024];
GxLog("ConsoleDetectDetectHardware():");
SStrPrintf(str, 1024, "\tcpuIdx: %d", hardware.cpuIdx);
GxLog(str);
SStrPrintf(str, 1024, "\tvideoID: %d", hardware.videoID);
GxLog(str);
SStrPrintf(str, 1024, "\tsoundIdx: %d", hardware.soundIdx);
GxLog(str);
SStrPrintf(str, 1024, "\tmemIdx: %d", hardware.memIdx);
GxLog(str);
}
#endif
#if defined(WHOA_SYSTEM_MAC)
uint32_t FindVRAMSize() {
CGDirectDisplayID activeDisplays[32];
uint32_t displayCount;
if (CGGetActiveDisplayList(32, activeDisplays, &displayCount)) {
return 0;
}
CGLRendererInfoObj rend;
GLint nrend;
GLint accelerated;
GLint vram_size;
auto display_mask = CGDisplayIDToOpenGLDisplayMask(activeDisplays[0]);
if (!CGLQueryRendererInfo(display_mask, &rend, &nrend)) {
CGLDescribeRenderer(rend, 0, kCGLRPRendererCount, &nrend);
for (int32_t i = 0; i < nrend; i++) {
CGLDescribeRenderer(rend, i, kCGLRPAccelerated, &accelerated);
if (accelerated) {
CGLDescribeRenderer(rend, i, kCGLRPVideoMemory, &vram_size);
CGLDestroyRendererInfo(rend);
return static_cast<uint32_t>(vram_size);
}
}
}
CGLDestroyRendererInfo(rend);
return 0;
}
void ConsoleDetectDetectHardware(Hardware& hardware, bool& hwChanged) {
g_videoHardwareDB.Load(__FILE__, __LINE__);
if (GxAdapterID(hardware.videoDevice.vendorID,
hardware.videoDevice.deviceID,
hardware.videoDevice.driverVersionHi,
hardware.videoDevice.driverVersionLo)) {
SetVideoIdx(hardware);
}
if (!hardware.videoIdx) {
hardware.videoDevice.vendorID = 0xFFFF;
if (GxAdapterInfer(hardware.videoDevice.deviceID)) {
SetVideoIdx(hardware);
}
}
uint32_t hw_cputype = 0;
uint32_t hw_cpusubtype = 0;
uint32_t hw_ncpu = 0;
uint64_t hw_cpufrequency_max = 0;
uint64_t hw_busfrequency_max = 0;
uint64_t hw_l2cachesize = 0;
uint64_t hw_l3cachesize = 0;
size_t size32 = sizeof(uint32_t);
size_t size64 = sizeof(uint64_t);
uint32_t hw_cputype;
auto hw_cputype_error = sysctlbyname("hw.cputype", &hw_cputype, &size32, nullptr, 0);
if (hw_cputype_error) {
OsOutputDebugString("[Mac sys detect] ! error %d reading hw.cputype\n", hw_cputype_error);
}
auto hw_cpusubtype_error = sysctlbyname("hw.cpusubtype", &hw_cpusubtype, &size32, nullptr, 0);
if (hw_cpusubtype_error) {
OsOutputDebugString("[Mac sys detect] ! error %d reading hw.cpusubtype\n", hw_cpusubtype_error);
}
auto hw_ncpu_error = sysctlbyname("hw.ncpu", &hw_ncpu, &size32, nullptr, 0);
if (hw_ncpu_error) {
OsOutputDebugString("[Mac sys detect] ! error %d reading hw.ncpu\n", hw_ncpu_error);
}
auto hw_cpufrequency_max_error = sysctlbyname("hw.cpufrequency_max", &hw_cpufrequency_max, &size64, nullptr, 0);
if (hw_cpufrequency_max_error) {
OsOutputDebugString("[Mac sys detect] ! error %d reading hw.cpufrequency_max\n", hw_cpufrequency_max_error);
}
auto hw_busfrequency_max_error = sysctlbyname("hw.busfrequency_max", hw_busfrequency_max, &size64, nullptr, 0);
if (hw_busfrequency_max_error) {
OsOutputDebugString("[Mac sys detect] ! error %d reading hw.busfrequency_max\n", iVar6);
}
auto hw_l2cachesize_error = sysctlbyname("hw.l2cachesize", &hw_l2cachesize, &size64, nullptr, 0);
if (hw_l2cachesize_error) {
hw_l2cachesize_error = 0;
OsOutputDebugString("[Mac sys detect] ! error %d reading hw.l2cachesize\n", hw_l2cachesize_error);
}
auto hw_l3cachesize_error = sysctlbyname("hw.l3cachesize", &hw_l3cachesize, &size64, nullptr, 0);
if (hw_l3cachesize_error) {
hw_l3cachesize_error = 0;
OsOutputDebugString("[Mac sys detect] ! error %d reading hw.l3cachesize\n", iVar8);
}
auto hw_memsize_error = sysctlbyname("hw.memsize", &hw_memsize, &size64, nullptr, 0);
if (hw_memsize_error) {
OsOutputDebugString("[Mac sys detect] ! error %d reading hw.memsize\n", hw_memsize_error);
}
auto vram_size = FindVRAMSize();
bool ddr_ram;
if (hw_busfrequency_max > 110000000 && (hw_busfrequency_max > 140000000 || h2_l3cachesize > 0xFFFFF && hw_l2cachesize > 0x7FFFF)) {
OsOutputDebugString("[Mac sys detect] - DDR RAM\n");
ddr_ram = true;
} else {
OsOutputDebugString("[Mac sys detect] - non DDR RAM\n");
ddr_ram = false;
}
uint32_t cpuIdx;
uint32_t macTier;
if (hw_cpusubtype_error || hw_cputype_error || hw_ncpu_error || hw_cpufrequency_max_error || hw_busfrequency_max_error || hw_l2cachesize_error || hw_l3cachesize_error || hw_memsize_error) {
OsOutputDebugString("[Mac sys detect] ! error reading specs, down to tier 0\n", v27);
cpuIdx = 0;
macTier = 0;
} else {
macTier = 3;
if (hw_ncpu < 2) {
OsOutputDebugString("[Mac sys detect] - non dual proc, down to tier 2\n");
macTier = 2;
}
if (hw_busfrequency_max < 500000000) {
OsOutputDebugString("[Mac sys detect] - sub 500MHz FSB, down to tier 2\n");
macTier = 2;
}
if (hw_memsize < 0x30000000) {
OsOutputDebugString("[Mac sys detect] - under 768MB RAM, down to tier 2\n");
macTier = 2;
}
if (hw_cpufrequency_max < 1100000000) {
OsOutputDebugString("[Mac sys detect] - under 1.1GHz CPU, down to tier 1\n");
macTier = 1;
}
if (vram_size < 0x4000000) {
OsOutputDebugString("[Mac sys detect] - < 64MB VRAM, down to tier 1\n");
macTier = 1;
}
if (hw_cputype == 18 && hw_cpusubtype < 11) {
OsOutputDebugString("[Mac sys detect] - G3 or G4, down to tier 0\n");
macTier = 0;
}
if (vram_size <= 0x2000000) {
OsOutputDebugString("[Mac sys detect] - <= 32 MB VRAM, down to tier 0\n");
macTier = 0;
}
if (!ddr_ram) {
OsOutputDebugString("[Mac sys detect] - no DDR RAM, down to tier 0\n");
macTier = 0;
}
if (hw_l2cachesize <= 0x40000 && hw_l3cachesize <= 0xFFFFF) {
OsOutputDebugString("[Mac sys detect] - L2 <= 256K and L3 <= 1MB, down to tier 0\n");
macTier = 0;
}
if (hw_memsize < 0x20000000) {
OsOutputDebugString("[Mac sys detect] - < 512MB RAM, down to tier 0\n");
cpuIdx = 0;
macTier = 0;
} else {
cpuIdx = macTier / 2;
}
}
hardware.cpuIdx = cpuIdx;
hardware.memIdx = 0;
hardware.soundIdx = 0;
hardware.macTierIdx = macTier;
hardware.macVramMB = vram_size / 0x100000;
hardware.cpuHw = s_cpuHwSettings[cpuIdx];
hardware.videoHw = g_videoHardwareDB.GetRecord(hardware.videoID);
hardware.soundHw = s_soundHwSettings[hardware.soundIdx];
ConsoleDetectSaveHardware(hardware, hwChanged);
char str[1024];
GxLog("ConsoleDetectDetectHardware [Mac] ():");
SStrPrintf(str, 1024, "\tcpuIdx: %d", hardware.cpuIdx);
GxLog(str);
SStrPrintf(str, 1024, "\tvideoID: %d", hardware.videoIdx);
GxLog(str);
SStrPrintf(str, 1024, "\tsoundIdx: %d", hardware.soundIdx);
GxLog(str);
SStrPrintf(str, 1024, "\tmemIdx: %d", hardware.memIdx);
GxLog(str);
SStrPrintf(str, 1024, "\tmacTierIdx: %d", hardware.macTierIdx);
GxLog(str);
SStrPrintf(str, 1024, "\tmacVramMB: %d", hardware.macVramMB);
GxLog(str);
}
#endif
void ConsoleDetectSetDefaultsFormat(DefaultSettings& defaults, const Hardware& hardware) {
defaults.format = &s_formats[hardware.videoHw->m_resolutionIdx];
}
void ConsoleDetectSetDefaults(DefaultSettings& defaults, const Hardware& hw) {
defaults.farClip = s_farClip[hw.videoHw->m_farclipIdx][hw.cpuHw->farclipIdx];
defaults.terrainShadowLOD = hw.videoHw->m_terrainShadowLod;
defaults.detailDoodadDensity = s_detailDoodadDensity[hw.videoHw->m_detailDoodadDensityIdx];
defaults.detailDoodadAlpha = hw.videoHw->m_detailDoodadAlpha;
defaults.animatingDoodads = s_animatingDoodads[hw.videoHw->m_animatingDoodadIdx][hw.cpuHw->animatingDoodadIdx];
defaults.trilinear = hw.videoHw->m_trilinear != 0;
defaults.numLights = hw.videoHw->m_numLights;
auto specularity = hw.videoHw->m_specularity != 0;
defaults.unk1A = specularity;
defaults.specularity = specularity;
defaults.waterLOD = s_waterLOD[hw.videoHw->m_waterLodidx][hw.cpuHw->waterLODIdx];
defaults.particleDensity = s_particleDensity[hw.videoHw->m_particleDensityIdx][hw.cpuHw->particleDensityIdx];
defaults.unitDrawDist = s_unitDrawDist[hw.videoHw->m_unitDrawDistIdx][hw.cpuHw->unitDrawDistIdx];
defaults.smallCull = s_smallCull[hw.videoHw->m_smallCullDistIdx][hw.cpuHw->smallCullDistIdx];
defaults.distCull = s_distCull[hw.videoHw->m_smallCullDistIdx][hw.cpuHw->smallCullDistIdx];
defaults.format = s_formats + hw.videoHw->m_resolutionIdx;
defaults.baseMipLevel = hw.videoHw->m_baseMipLevel;
defaults.unk19 = true;
defaults.numChannels = 0;
defaults.fivePointOne = false;
}

View File

@ -1,74 +0,0 @@
#ifndef CONSOLE_DETECT_HPP
#define CONSOLE_DETECT_HPP
#include <storm/Array.hpp>
#include <tempest/Vector.hpp>
#include "gx/CGxFormat.hpp"
#include "db/rec/VideoHardwareRec.hpp"
struct CpuHardware {
uint32_t farclipIdx;
uint32_t animatingDoodadIdx;
uint32_t waterLODIdx;
uint32_t particleDensityIdx;
uint32_t smallCullDistIdx;
uint32_t unitDrawDistIdx;
};
struct SoundHardware {
uint32_t numChannels;
bool fivePointOne;
};
struct Hardware {
struct Device {
uint16_t vendorID;
uint16_t deviceID;
uint32_t driverVersionHi;
uint32_t driverVersionLo;
};
Device videoDevice;
Device soundDevice;
uint32_t cpuIdx;
uint32_t videoID;
uint32_t soundIdx;
uint32_t memIdx;
VideoHardwareRec* videoHw;
CpuHardware* cpuHw;
SoundHardware* soundHw;
};
struct DefaultSettings {
float farClip;
uint32_t terrainShadowLOD;
uint32_t detailDoodadDensity;
uint32_t detailDoodadAlpha;
bool animatingDoodads;
bool trilinear;
uint32_t numLights;
bool specularity;
bool unk19;
bool unk1A;
uint32_t waterLOD;
float particleDensity;
float unitDrawDist;
float smallCull;
float distCull;
CGxFormat* format;
uint32_t baseMipLevel;
uint32_t numChannels;
bool fivePointOne;
};
void ConsoleDetectGetResolutions(TSGrowableArray<C2iVector>& list, int32_t widescreen);
void ConsoleDetectDetectHardware(Hardware& hardware, bool& hwChanged);
void ConsoleDetectSetDefaultsFormat(DefaultSettings& defaults, const Hardware& hardware);
void ConsoleDetectSetDefaults(DefaultSettings& defaults, const Hardware& hw);
#endif

View File

@ -1,345 +1,445 @@
#include "console/Device.hpp" #include "console/Device.hpp"
#include "client/CmdLine.hpp" #include "client/CmdLine.hpp"
#include "os/Gui.hpp" #include "client/Gui.hpp"
#include "console/CVar.hpp"
#include "console/Console.hpp" #include "console/Console.hpp"
#include "console/Detect.hpp" #include "console/CVar.hpp"
#include "console/Gx.hpp" #include "console/Command.hpp"
#include "console/cvar/Gx.hpp" #include "event/Input.hpp"
#include "os/Input.hpp" #include "gx/Gx.hpp"
#include "gx/CGxFormat.hpp"
#include "gx/Device.hpp" #include "gx/Device.hpp"
#include "gx/Types.hpp"
#include "console/command/Commands.hpp"
#include "db/Startup_Strings.hpp"
#include <storm/String.hpp>
#include <tempest/Vector.hpp>
#include <cstdio>
#include <cstring> #include <cstring>
#include <cstdio>
CVar* s_cvHwDetect; CVar* s_cvHwDetect;
CVar* s_cvGxFixedFunction;
CVar* s_cvGxWindowResizeLock;
CVar* s_cvGxVideoOptionsVersion;
CVar* s_cvGxMaxFPSBk;
CVar* s_cvGxMaxFPS;
CVar* s_cvGxOverride;
CVar* s_cvGxStereoEnabled;
CVar* s_cvGxFixLag;
CVar* s_cvGxMultisampleQuality;
CVar* s_cvGxMultisample;
CVar* s_cvGxCursor;
CVar* s_cvGxAspect;
CVar* s_cvGxVSync;
CVar* s_cvGxTripleBuffer;
CVar* s_cvGxRefresh;
CVar* s_cvGxDepthBits;
CVar* s_cvGxColorBits;
CVar* s_cvGxMaximize;
CVar* s_cvGxResolution;
CVar* s_cvGxWidescreen;
CVar* s_cvGxWindow;
CVar* s_cvGxApi;
DefaultSettings s_defaults; DefaultSettings s_defaults;
Hardware s_hardware;
bool s_hardwareDetected;
bool s_hwChanged;
bool s_hwDetect; bool s_hwDetect;
TSGrowableArray<CGxMonitorMode> s_gxMonitorModes; bool s_hwChanged;
CGxDevice* s_device;
char s_windowTitle[256];
CGxFormat s_requestedFormat; CGxFormat s_requestedFormat;
CGxFormat s_fallbackFormat = { 0, { 640, 480 }, CGxFormat::Fmt_Rgb565, CGxFormat::Fmt_Ds160, 60, true, true, false, true, true, false };
CGxFormat s_lastGoodFormat;
CGxFormat s_desktopFormat = { 0, { 800, 600 }, CGxFormat::Fmt_Rgb565, CGxFormat::Fmt_Ds24X, 60, true, true, false, true, true, false };
uint32_t s_FormatTobpp[4] = { const char* g_gxApiNames[GxApis_Last] = {
16, "OpenGL", // GxApi_OpenGl
32, "D3D9", // GxApi_D3d9
32, "D3D9Ex", // GxApi_D3d9Ex
32 "D3D10", // GxApi_D3d10
"D3D11", // GxApi_D3d11
"GLL", // GxApi_GLL
"GLSDL" // GxApi_GLSDL
}; };
void OnGxStereoChanged() { EGxApi g_gxApiSupported[] = {
// ??? #if defined(WHOA_SYSTEM_WIN)
GxApi_D3d9,
#endif
#if defined(WHOA_SYSTEM_MAC)
GxApi_GLL,
#endif
#if defined(WHOA_BUILD_GLSDL)
GxApi_GLSDL,
#endif
};
size_t g_numGxApiSupported = sizeof(g_gxApiSupported) / sizeof(EGxApi);
bool CVGxWindowResizeLockCallback(CVar*, const char*, const char*, void*) {
// TODO
return true;
} }
void ValidateFormatMonitor(CGxFormat& fmt) { bool GxVideoOptionsVersionCallback(CVar*, const char*, const char*, void*) {
static C2iVector standardSizes[] = { return true;
{ 1600, 1200 }, }
{ 1280, 1024 },
{ 1280, 960 },
{ 1152, 864 },
{ 1024, 768 },
{ 800, 600 },
{ 640, 480 }
};
auto fmtbpp = s_FormatTobpp[fmt.colorFormat]; bool CVGxMaxFPSBkCallback(CVar*, const char*, const char*, void*) {
// TODO
return true;
}
int32_t lowRate = 9999; bool CVGxMaxFPSCallback(CVar*, const char*, const char*, void*) {
// TODO
return true;
}
int32_t i = 0; bool CVGxOverrideCallback(CVar*, const char*, const char*, void*) {
while (i < s_gxMonitorModes.Count()) { // TODO
auto& size = s_gxMonitorModes[i].size; return true;
}
if (fmt.size.x == size.x && fmt.size.y == size.y && fmtbpp == s_gxMonitorModes[i].bpp) { bool CVGxStereoEnabledCallback(CVar*, const char*, const char*, void*) {
uint32_t refreshRate = s_gxMonitorModes[i].refreshRate; // TODO
if (refreshRate < lowRate) { return true;
lowRate = refreshRate; }
}
if (fmt.refreshRate == refreshRate) { bool CVGxFixLagCallback(CVar*, const char*, const char*, void*) {
return; // TODO
} return true;
}
bool CVGxMultisampleQualityCallback(CVar*, const char*, const char*, void*) {
// TODO
return true;
}
bool CVGxMultisampleCallback(CVar*, const char*, const char*, void*) {
// TODO
return true;
}
bool CVGxCursorCallback(CVar*, const char*, const char* value, void*) {
s_requestedFormat.hwCursor = SStrToInt(value) != 0;
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
return true;
}
bool CVGxAspectCallback(CVar*, const char*, const char*, void*) {
// TODO
return true;
}
bool CVGxVSyncCallback(CVar*, const char*, const char*, void*) {
// TODO
return true;
}
bool CVGxTripleBufferCallback(CVar*, const char*, const char*, void*) {
// TODO
return true;
}
bool CVGxRefreshCallback(CVar*, const char*, const char*, void*) {
// TODO
return true;
}
bool CVGxDepthBitsCallback(CVar*, const char*, const char*, void*) {
// TODO
return true;
}
bool CVGxColorBitsCallback(CVar*, const char*, const char*, void*) {
// TODO
return true;
}
bool CVGxMaximizeCallback(CVar*, const char*, const char*, void*) {
// TODO
return true;
}
bool CVGxResolutionCallback(CVar*, const char*, const char*, void*) {
// static C2iVector legalSizes[] = {
// {}
// }
// TODO
return true;
}
bool CVGxWindowCallback(CVar*, const char*, const char*, void*) {
// TODO
return true;
}
bool CVGxApiCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
for (size_t api = 0; api < g_numGxApiSupported; api++) {
auto apiString = g_gxApiNames[g_gxApiSupported[api]];
if (SStrCmpI(newValue, apiString, STORM_MAX_STR) == 0) {
// New gxApi is supported, pass
ConsoleWrite("GxApi set pending gxRestart", DEFAULT_COLOR);
return true;
} }
i++;
} }
auto rate = lowRate; // Supported gxApi not supplied, show available apis
if (lowRate == 9999) { constexpr size_t msgsize = 1024;
GxLog("ValidateFormatMonitor(): unable to find monitor refresh"); char msg[msgsize] = {0};
rate = 60; SStrPack(msg, "unsupported api, must be one of ", msgsize);
for (size_t api = 0; api < g_numGxApiSupported; api++) {
if (api > 0) {
SStrPack(msg, ", ", msgsize);
}
auto apiString = g_gxApiNames[g_gxApiSupported[api]];
SStrPack(msg, "'", msgsize);
SStrPack(msg, apiString, msgsize);
SStrPack(msg, "'", msgsize);
} }
GxLog("ValidateFormatMonitor(): invalid refresh rate %d, set to %d", fmt.refreshRate, rate); ConsoleWrite(msg, DEFAULT_COLOR);
fmt.refreshRate = rate; return false;
} }
void ConsoleDeviceStereoInitialize() { int32_t CCGxRestart(const char*, const char*) {
s_cvGxStereoConvergence = CVar::Register( // TODO
"gxStereoConvergence", return 1;
"Set stereoscopic rendering convergence depth", }
0x1,
"1",
CVGxStereoConvergenceCallback,
GRAPHICS,
false,
nullptr,
false
);
s_cvGxStereoSeparation = CVar::Register(
"gxStereoSeparation",
"Set stereoscopic rendering separation percentage",
0x1,
"25",
CVGxStereoSeparationCallback,
GRAPHICS,
false,
nullptr,
false
);
// g_theGxDevicePtr->AddStereoChangedCallback(nullsub_3); void RegisterGxCVars() {
GxAddStereoChangedCallback(OnGxStereoChanged); const auto& format = s_defaults.format;
// TODO: bool isChinese = s_currentLocaleIndex == 4 (zhCN)
bool isChinese = false;
const uint32_t graphics = CATEGORY::GRAPHICS;
s_cvGxWidescreen = CVar::Register("widescreen", "Allow widescreen support", 0x0, "1", nullptr, graphics);
s_cvGxWindow = CVar::Register("gxWindow", "toggle fullscreen/window", 0x1 | 0x2, isChinese ? "1" : "0", &CVGxWindowCallback, graphics);
s_cvGxMaximize = CVar::Register("gxMaximize", "maximize game window", 0x1 | 0x2, isChinese ? "1" : "0", &CVGxMaximizeCallback, graphics);
char value[260] = {};
SStrPrintf(value, sizeof(value), "%s", CGxFormat::formatToColorBitsString[format.colorFormat]);
s_cvGxColorBits = CVar::Register("gxColorBits", "color bits", 0x1 | 0x2, value, &CVGxColorBitsCallback, graphics);
SStrPrintf(value, sizeof(value), "%s", CGxFormat::formatToColorBitsString[format.depthFormat]);
s_cvGxDepthBits = CVar::Register("gxDepthBits", "depth bits", 0x1 | 0x2, value, &CVGxDepthBitsCallback, graphics);
SStrPrintf(value, 260, "%dx%d", format.size.x, format.size.y);
s_cvGxResolution = CVar::Register("gxResolution", "resolution", 0x1 | 0x2, value, &CVGxResolutionCallback, graphics);
s_cvGxRefresh = CVar::Register("gxRefresh", "refresh rate", 0x1 | 0x2, "75", &CVGxRefreshCallback, graphics);
s_cvGxTripleBuffer = CVar::Register("gxTripleBuffer", "triple buffer", 0x1 | 0x2, "0", &CVGxTripleBufferCallback, graphics);
s_cvGxApi = CVar::Register("gxApi", "graphics api", 0x1 | 0x2, g_gxApiNames[GxApiDefault()], &CVGxApiCallback, graphics);
s_cvGxVSync = CVar::Register("gxVSync", "vsync on or off", 0x1 | 0x2, "1", &CVGxVSyncCallback, graphics);
s_cvGxAspect = CVar::Register("gxAspect", "constrain window aspect", 0x1 | 0x2, "1", &CVGxAspectCallback, graphics);
s_cvGxCursor = CVar::Register("gxCursor", "toggle hardware cursor", 0x1 | 0x2, "1", &CVGxCursorCallback, graphics);
// TODO: v10 = *(_DWORD*)(dword_CABB60 + 84);
int v10 = 0;
SStrPrintf(value, sizeof(value), "%d", v10);
s_cvGxMultisample = CVar::Register("gxMultisample", "multisample", 0x1 | 0x2, value, &CVGxMultisampleCallback, graphics);
s_cvGxMultisampleQuality = CVar::Register("gxMultisampleQuality", "multisample quality", 0x1 | 0x2, "0.0", &CVGxMultisampleQualityCallback, graphics);
// TODO: v10 = *(_DWORD*)(dword_CABB60 + 80);
SStrPrintf(value, sizeof(value), "%d", v10);
s_cvGxFixLag = CVar::Register("gxFixLag", "prevent cursor lag", 0x1 | 0x2, value, &CVGxFixLagCallback, graphics);
s_cvGxStereoEnabled = CVar::Register("gxStereoEnabled", "Enable stereoscopic rendering", 0x1, "0", &CVGxStereoEnabledCallback, graphics);
s_cvGxOverride = CVar::Register("gxOverride", "gx overrides", 0x1, "", &CVGxOverrideCallback, graphics);
s_cvGxMaxFPS = CVar::Register("maxFPS", "Set FPS limit", 0x1, "200", &CVGxMaxFPSCallback, graphics);
s_cvGxMaxFPSBk = CVar::Register("maxFPSBk", "Set background FPS limit", 0x1, "30", &CVGxMaxFPSBkCallback, graphics);
s_cvGxVideoOptionsVersion = CVar::Register("videoOptionsVersion", "Video options version", 0x1 | 0x2, "0", &GxVideoOptionsVersionCallback, graphics);
s_cvGxWindowResizeLock = CVar::Register("windowResizeLock", "prevent resizing in windowed mode", 1, "0", &CVGxWindowResizeLockCallback, graphics);
s_cvGxFixedFunction = CVar::Register("fixedFunction", "Force fixed function rendering", 0x1 | 0x2, "0", 0, graphics);
}
void UpdateGxCVars() {
s_cvGxColorBits->Update();
s_cvGxDepthBits->Update();
s_cvGxWindow->Update();
s_cvGxResolution->Update();
s_cvGxRefresh->Update();
s_cvGxTripleBuffer->Update();
s_cvGxApi->Update();
s_cvGxVSync->Update();
s_cvGxAspect->Update();
s_cvGxMaximize->Update();
s_cvGxCursor->Update();
s_cvGxMultisample->Update();
s_cvGxMultisampleQuality->Update();
s_cvGxFixLag->Update();
}
void SetGxCVars(const CGxFormat& format) {
char value[1024] = {};
s_cvGxColorBits->Set(CGxFormat::formatToColorBitsString[format.colorFormat], true, false, false, true);
s_cvGxDepthBits->Set(CGxFormat::formatToColorBitsString[format.depthFormat], true, false, false, true);
SStrPrintf(value, sizeof(value), "%d", format.window);
s_cvGxWindow->Set(value, true, false, false, true);
SStrPrintf(value, sizeof(value), "%dx%d", format.size.x, format.size.y);
s_cvGxResolution->Set(value, true, false, false, true);
SStrPrintf(value, sizeof(value), "%d", format.refreshRate);
s_cvGxRefresh->Set(value, true, false, false, true);
// TODO: (format + 28) > 1
s_cvGxTripleBuffer->Set("0", true, false, false, true);
SStrPrintf(value, sizeof(value), "%d", format.vsync);
s_cvGxVSync->Set(value, true, false, false, true);
// TODO: format.aspectRatio
SStrPrintf(value, sizeof(value), "%d", 0);
s_cvGxAspect->Set(value, true, false, false, true);
SStrPrintf(value, sizeof(value), "%d", format.maximize);
s_cvGxMaximize->Set(value, true, false, false, true);
SStrPrintf(value, sizeof(value), "%d", format.hwCursor);
s_cvGxCursor->Set(value, true, false, false, true);
SStrPrintf(value, sizeof(value), "%d", format.sampleCount);
s_cvGxMultisample->Set(value, true, false, false, true);
// TODO: format.multisampleQuality
SStrPrintf(value, sizeof(value), "%f", 0.0f);
s_cvGxMultisampleQuality->Set(value, true, false, false, true);
SStrPrintf(value, sizeof(value), "%d", format.fixLag);
s_cvGxFixLag->Set(value, true, false, false, true);
UpdateGxCVars();
} }
void ConsoleDeviceInitialize(const char* title) { void ConsoleDeviceInitialize(const char* title) {
GxLogOpen(); GxLogOpen();
s_cvHwDetect = CVar::Register( s_cvHwDetect = CVar::Register("hwDetect", "do hardware detection", 0x1, "1", nullptr, CATEGORY::GRAPHICS);
"hwDetect",
"do hardware detection",
0x1,
"1",
nullptr,
GRAPHICS,
false,
nullptr,
false
);
ConsoleDetectDetectHardware(s_hardware, s_hwChanged); // TODO: sub_76BA30(&unk_CABB38, &byte_CABCBD); << ConsoleDetect
s_hardwareDetected = true; // TODO: byte_CABCBC = 1;
if (CmdLineGetBool(CMD_HW_DETECT) == 1 || s_cvHwDetect->GetInt() != 0) { if (CmdLineGetBool(CMD_HW_DETECT) || s_cvHwDetect->GetInt() != 0) {
s_hwDetect = true; s_hwDetect = true;
s_cvHwDetect->Set("0", true, false, false, true); s_cvHwDetect->Set("0", true, false, false, true);
} else { } else {
s_hwDetect = false; s_hwDetect = false;
} }
ConsoleAccessSetEnabled(CmdLineGetBool(CMD_CONSOLE) == 1);
ConsoleDetectSetDefaultsFormat(s_defaults, s_hardware); ConsoleAccessSetEnabled(CmdLineGetBool(CMD_CONSOLE));
// TODO: sub_76B520(&unk_CABAF0, &unk_CABB38);
// CHANGE: Remove this when the rest will be ready
s_defaults.format.size.x = 1024;
s_defaults.format.size.y = 768;
s_defaults.format.colorFormat = CGxFormat::Fmt_Argb8888;
s_defaults.format.depthFormat = CGxFormat::Fmt_Ds248;
RegisterGxCVars(); RegisterGxCVars();
ConsoleCommandRegister("gxRestart", &CCGxRestart, CATEGORY::GRAPHICS, nullptr);
ConsoleCommandRegister("gxRestart", CCGxRestart, GRAPHICS, nullptr); // TODO: GxAdapterMonitorModes((int)&unk_CABCC8);
// TODO: ValidateFormatMonitor(&unk_CABDA8);
GxAdapterMonitorModes(s_gxMonitorModes); // TODO: if ( GxAdapterDesktopMode(&v28) )
ValidateFormatMonitor(s_fallbackFormat); if (true) {
s_requestedFormat.size.x = 1024;
CGxMonitorMode mode; s_requestedFormat.size.y = 768;
mode.size = { 0, 0 }; s_requestedFormat.colorFormat = CGxFormat::Fmt_Argb8888;
if (GxAdapterDesktopMode(mode)) { s_requestedFormat.depthFormat = CGxFormat::Fmt_Ds248;
s_desktopFormat.size = mode.size;
s_desktopFormat.colorFormat = mode.bpp > 16 ? CGxFormat::Fmt_ArgbX888 : CGxFormat::Fmt_Rgb565;
s_desktopFormat.refreshRate = mode.refreshRate;
} }
GxLog("ConsoleDeviceInitialize(): hwDetect = %d, hwChanged = %d", s_hwDetect, s_hwChanged); GxLog("ConsoleDeviceInitialize(): hwDetect = %d, hwChanged = %d", s_hwDetect, s_hwChanged);
if (CmdLineGetBool(CMD_RES_800x600)) { if (CmdLineGetBool(CMD_RES_800x600)) {
s_requestedFormat.size = { 800, 600 }; s_requestedFormat.size.x = 800;
s_requestedFormat.size.y = 600;
} else if (CmdLineGetBool(CMD_RES_1024x768)) { } else if (CmdLineGetBool(CMD_RES_1024x768)) {
s_requestedFormat.size = { 1024, 768 }; s_requestedFormat.size.x = 1024;
s_requestedFormat.size.y = 768;
} else if (CmdLineGetBool(CMD_RES_1280x960)) { } else if (CmdLineGetBool(CMD_RES_1280x960)) {
s_requestedFormat.size = { 1280, 960 }; s_requestedFormat.size.x = 1280;
s_requestedFormat.size.y = 960;
} else if (CmdLineGetBool(CMD_RES_1280x1024)) { } else if (CmdLineGetBool(CMD_RES_1280x1024)) {
s_requestedFormat.size = { 1280, 1024 }; s_requestedFormat.size.x = 1280;
s_requestedFormat.size.y = 1024;
} else if (CmdLineGetBool(CMD_RES_1600x1200)) { } else if (CmdLineGetBool(CMD_RES_1600x1200)) {
s_requestedFormat.size = { 1600, 1200 }; s_requestedFormat.size.x = 1600;
s_requestedFormat.size.y = 1200;
} }
// TODO: fixed function rendering!!! if (s_cvGxFixedFunction->GetInt() != 0) {
if (s_cvFixedFunction->GetInt()) { // TODO: (dword_CABD20 = 0) s_requestedFormat.unknown_field = 0;
// TODO: IMPORTANT: figure out what these are called s_requestedFormat.pos.y = 0; // <--- CHECK THIS
s_requestedFormat.unk48 = 0; s_requestedFormat.pos.x = 0;
s_requestedFormat.unk38 = 0;
} }
if (s_hwDetect || s_hwChanged) { if (s_hwDetect || s_hwChanged) {
ConsoleDetectSetDefaults(s_defaults, s_hardware); // TODO Sub76B3F0(&UnkCABAF0, &UnkCABB38);
s_cvFixedFunction->Set("0", true, false, false, true); s_cvGxFixedFunction->Set("0", true, false, false, true);
memcpy(&s_requestedFormat, s_defaults.format, sizeof(CGxFormat)); // TODO memcpy(&s_requestedFormat, &s_defaults.format, sizeof(s_requestedFormat));
s_requestedFormat.window = s_cvGxWindow->GetInt() != 0; s_requestedFormat.window = s_cvGxWindow->GetInt() != 0;
s_requestedFormat.maximize = s_cvGxMaximize->GetInt() != 0; s_requestedFormat.maximize = s_cvGxMaximize->GetInt() != 0;
// TODO temporary override
s_requestedFormat.maximize = 0;
SetGxCVars(s_requestedFormat); SetGxCVars(s_requestedFormat);
} }
auto gxApi = GxDefaultApi(); EGxApi api = GxApiDefault();
auto cvGxApi = CVar::Lookup("gxApi");
if (cvGxApi) { auto gxApiName = s_cvGxApi->GetString();
auto requestedGxApi = cvGxApi->GetString();
for (auto api = GxApi_OpenGl; api < GxApis_Last; api = static_cast<EGxApi>(static_cast<int32_t>(api) + 1)) { auto gxOverride = CmdLineGetString(CMD_GX_OVERRIDE);
if (GxApiSupported(api) && !SStrCmpI(requestedGxApi, g_gxApiNames[api], STORM_MAX_STR)) { if (*gxOverride != '\0') {
gxApi = api; gxApiName = gxOverride;
break; } else if (CmdLineGetBool(CMD_OPENGL)) {
} gxApiName = g_gxApiNames[GxApi_OpenGl];
} else if (CmdLineGetBool(CMD_D3D)) {
gxApiName = g_gxApiNames[GxApi_D3d9];
} else if (CmdLineGetBool(CMD_D3D9EX)) {
gxApiName = g_gxApiNames[GxApi_D3d9Ex];
}
// Sanitize chosen gxApi against list of supported gxApis
for (size_t i = 0; i < g_numGxApiSupported; i++) {
EGxApi supportedApi = g_gxApiSupported[i];
if (SStrCmpI(gxApiName, g_gxApiNames[supportedApi], STORM_MAX_STR) == 0) {
api = supportedApi;
break;
} }
} }
if (CmdLineGetBool(CMD_OPENGL) && GxApiSupported(GxApi_OpenGl)) {
gxApi = GxApi_OpenGl;
}
if (CmdLineGetBool(CMD_D3D) && GxApiSupported(GxApi_D3d9)) {
gxApi = GxApi_D3d9;
}
if (CmdLineGetBool(CMD_D3D9EX) && GxApiSupported(GxApi_D3d9Ex)) {
gxApi = GxApi_D3d9Ex;
}
s_requestedFormat.fixLag = s_cvGxFixLag->GetInt() != 0; s_requestedFormat.fixLag = s_cvGxFixLag->GetInt() != 0;
s_requestedFormat.hwTnL = CmdLineGetBool(CMD_SW_TNL) == 0; s_requestedFormat.hwTnL = !CmdLineGetBool(CMD_SW_TNL);
bool window = s_cvGxWindow->GetInt() != 0;
bool windowed = s_cvGxWindow->GetInt() != 0;
if (CmdLineGetBool(CMD_FULL_SCREEN)) { if (CmdLineGetBool(CMD_FULL_SCREEN)) {
window = false; windowed = false;
} else if (CmdLineGetBool(CMD_WINDOWED)) { } else if (CmdLineGetBool(CMD_WINDOWED)) {
window = true; windowed = true;
}
s_requestedFormat.window = window;
s_desktopFormat.window = window;
bool bVar1 = false;
CGxFormat apiFormat = s_requestedFormat;
ValidateFormatMonitor(apiFormat);
s_device = GxDevCreate(gxApi, OsWindowProc, apiFormat);
while (!s_device) {
if (apiFormat.sampleCount < 2) {
auto colorFormat = apiFormat.colorFormat;
if (colorFormat <= CGxFormat::Fmt_Rgb565) {
if (bVar1) {
GxLog("ConsoleDeviceInitialize(): no output device available!");
auto titleRecord = g_Startup_StringsDB.GetRecord(MSG_TITLE_WOW);
auto title = titleRecord ? titleRecord->m_message : "World of Warcraft";
const char* message;
if (gxApi == GxApi_D3d9 || gxApi == GxApi_D3d9Ex) {
auto messageRecord = g_Startup_StringsDB.GetRecord(MSG_GX_INIT_FAILED_D3D);
message = messageRecord ? messageRecord->m_message : "World of Warcraft was unable to start up 3D acceleration. Please make sure DirectX 9.0c is installed and your video drivers are up-to-date.";
} else {
auto messageRecord = g_Startup_StringsDB.GetRecord(MSG_GX_INIT_FAILED);
message = messageRecord ? messageRecord->m_message : "World of Warcraft was unable to start up 3D acceleration.";
}
OsGuiMessageBox(nullptr, 0, message, title);
GxLogClose();
exit(0);
}
apiFormat = s_desktopFormat;
bVar1 = true;
} else if (apiFormat.depthFormat <= CGxFormat::Fmt_Ds160) {
apiFormat.colorFormat = static_cast<CGxFormat::Format>(static_cast<int32_t>(apiFormat.colorFormat - 1));
apiFormat.depthFormat = colorFormat != CGxFormat::Fmt_ArgbX888 ? CGxFormat::Fmt_Ds320 : CGxFormat::Fmt_Ds160;
} else {
apiFormat.depthFormat = static_cast<CGxFormat::Format>(static_cast<int32_t>(apiFormat.depthFormat - 1));
}
} else {
apiFormat.sampleCount = std::max(apiFormat.sampleCount - 2, static_cast<uint32_t>(1));
}
ValidateFormatMonitor(apiFormat);
s_device = GxDevCreate(gxApi, OsWindowProc, apiFormat);
}
memcpy(&s_requestedFormat, &apiFormat, sizeof(CGxFormat));
memcpy(&s_lastGoodFormat, &apiFormat, sizeof(CGxFormat));
SetGxCVars(apiFormat);
if (GxCaps().m_numTmus < 2) {
GxDevDestroy(s_device);
GxLog("ConsoleDeviceInitialize(): output device does not have dual TMUs!");
auto titleRecord = g_Startup_StringsDB.GetRecord(MSG_TITLE_WOW);
auto title = titleRecord ? titleRecord->m_message : "World of Warcraft";
auto messageRecord = g_Startup_StringsDB.GetRecord(MSG_HW_UNSUPPORTED);
auto message = messageRecord ? messageRecord->m_message : "Your 3D accelerator card is not supported by World of Warcraft. Please install a 3D acceler ator card with dual-TMU support.";
OsGuiMessageBox(nullptr, 0, message, title);
GxLogClose();
exit(0);
} }
if (!GxCaps().m_numStreams) { s_requestedFormat.window = windowed;
GxDevDestroy(s_device); // TODO: byte_CABD47 = windowed;
GxLog("ConsoleDeviceInitialize(): output device has 0 streams");
auto titleRecord = g_Startup_StringsDB.GetRecord(MSG_TITLE_WOW);
auto title = titleRecord ? titleRecord->m_message : "World of Warcraft";
auto messageRecord = g_Startup_StringsDB.GetRecord(MSG_HW_UNSUPPORTED);
auto message = messageRecord ? messageRecord->m_message : "Your 3D accelerator card is not supported by World of Warcraft. Please install a 3D acceler ator card with dual-TMU support.";
OsGuiMessageBox(nullptr, 0, message, title);
GxLogClose();
exit(0);
}
switch (GxDevApi()) { GxLog("GxApi_%s selected\n", g_gxApiNames[api]);
case GxApi_OpenGl:
case GxApi_GLL:
case GxApi_GLSDL:
ConsoleGxOverride(s_hardware.videoHw->m_oglOverrides);
break;
case GxApi_D3d9:
case GxApi_D3d9Ex:
ConsoleGxOverride(s_hardware.videoHw->m_d3DOverrides);
break;
default:
break;
}
ConsoleGxOverride(CmdLineGetString(CMD_GX_OVERRIDE));
for (auto override = GxOverride_PixelShader; override < GxOverrides_Last; override = static_cast<EGxOverride>(static_cast<int32_t>(override) + 1)) {
if (s_consoleGxOverrideSet[override]) {
GxDevOverride(override, s_consoleGxOverrideVal[override]);
}
}
OsGuiSetGxWindow(GxDevWindow()); // Set internally (CVar value reflects the current gxApi at launch),
if (!title) { // this will not Set() as CVar gxApi is latched
title = ""; s_cvGxApi->InternalSet(g_gxApiNames[api], true, false, false, true);
}
SStrCopy(s_windowTitle, title, sizeof(s_windowTitle));
auto gxWindow = GxDevWindow();
if (gxWindow) {
OsGuiSetWindowTitle(gxWindow, s_windowTitle);
}
if (s_hwDetect || s_hwChanged) {
// TODO: IMPORTANT: find out what the real name is
s_defaults.unk19 = GxCaps().m_shaderTargets[GxSh_Pixel] != 0;
}
char videoOptionsVersion[32]; CGxFormat format;
SStrPrintf(videoOptionsVersion, sizeof(videoOptionsVersion), "%d", 3); memcpy(&format, &s_requestedFormat, sizeof(s_requestedFormat));
s_cvVideoOptionsVersion->Set(videoOptionsVersion, true, false, false, true); CGxDevice* device = GxDevCreate(api, OsWindowProc, format);
ConsoleDeviceStereoInitialize();
// TODO // TODO
// OsSetSleepInBackground(1);
// OsSetBackgroundSleepMs(250);
}
bool ConsoleDeviceExists() { auto gxWindow = GxDevWindow();
return s_device != nullptr; OsGuiSetGxWindow(gxWindow);
}
void ConsoleDeviceDestroy() { // TODO
GxRemoveStereoChangedCallback(OnGxStereoChanged);
s_cvVideoOptionsVersion->Update();
GxDevDestroy(s_device);
s_device = nullptr;
GxLogClose();
} }

View File

@ -3,18 +3,10 @@
#include "gx/CGxFormat.hpp" #include "gx/CGxFormat.hpp"
#include "console/Detect.hpp" struct DefaultSettings {
CGxFormat format;
extern DefaultSettings s_defaults; };
extern Hardware s_hardware;
extern bool s_hwChanged;
extern bool s_hwDetect;
extern CGxFormat s_requestedFormat;
void ConsoleDeviceInitialize(const char* title); void ConsoleDeviceInitialize(const char* title);
bool ConsoleDeviceExists();
void ConsoleDeviceDestroy();
#endif #endif

View File

@ -1,72 +0,0 @@
#include "console/Gx.hpp"
#include <storm/String.hpp>
#include <cstdlib>
const char* g_gxApiNames[GxApis_Last] = {
"OpenGL", // GxApi_OpenGl
"D3D9", // GxApi_D3d9
"D3D9Ex", // GxApi_D3d9Ex
"D3D10", // GxApi_D3d10
"D3D11", // GxApi_D3d11
"GLL", // GxApi_GLL
"GLSDL" // GxApi_GLSDL
};
int32_t s_consoleGxOverrideSet[GxOverrides_Last];
uint32_t s_consoleGxOverrideVal[GxOverrides_Last];
void ConsoleGxOverride(const char* str) {
char value[256];
char override[256];
while (*str) {
SStrTokenize(&str, override, 256, " ,", 0);
SStrTokenize(&str, value, 256, " ;", 0);
if (override[0] && value[0]) {
auto gxOverride = static_cast<EGxOverride>(std::atol(override));
auto gxValue = std::atol(value);
if (gxOverride < GxOverrides_Last) {
if (gxOverride == 0) {
switch (gxValue) {
case 0:
case 1:
case 2:
gxValue = 1;
break;
case 3:
gxValue = 2;
break;
case 4:
gxValue = 3;
break;
case 5:
gxValue = 7;
break;
case 6:
gxValue = 8;
break;
case 7:
gxValue = 9;
break;
case 8:
gxValue = 10;
break;
case 10:
gxValue = 12;
break;
case 11:
gxValue = 13;
break;
default:
break;
}
}
s_consoleGxOverrideSet[gxOverride] = 1;
s_consoleGxOverrideVal[gxOverride] = gxValue;
}
}
}
}

View File

@ -1,14 +0,0 @@
#ifndef CONSOLE_GX_HPP
#define CONSOLE_GX_HPP
#include <cstdint>
#include "gx/Types.hpp"
extern const char* g_gxApiNames[GxApis_Last];
extern int32_t s_consoleGxOverrideSet[GxOverrides_Last];
extern uint32_t s_consoleGxOverrideVal[GxOverrides_Last];
void ConsoleGxOverride(const char* str);
#endif

View File

@ -1,17 +1,12 @@
#include <cstdint>
#include <storm/String.hpp>
#include "console/Handlers.hpp" #include "console/Handlers.hpp"
#include "console/Line.hpp" #include "console/Line.hpp"
#include "console/Console.hpp" #include "console/Console.hpp"
#include "console/Command.hpp" #include "console/Command.hpp"
#include "console/Screen.hpp" #include "console/Screen.hpp"
#include "console/Text.hpp"
#include "console/Highlight.hpp"
#include "event/Event.hpp" #include "event/Event.hpp"
#include "event/Types.hpp" #include <cstdint>
#define SHIFT_MODIFIER(data) ((data->metaKeyState & ((1 << KEY_LSHIFT) | (1 << KEY_RSHIFT))) != 0) static int32_t s_historyIndex = 0;
#define CTRL_MODIFIER(data) ((data->metaKeyState & ((1 << KEY_LCONTROL) | (1 << KEY_RCONTROL))) != 0)
namespace { namespace {
@ -26,22 +21,19 @@ int32_t OnChar(const EVENT_DATA_CHAR* data, void* param) {
character[0] = char(data->ch); character[0] = char(data->ch);
character[1] = 0; character[1] = 0;
// TODO: add custom behavior to support non-ASCII commands?
// SUniSPutUTF8(data->ch, character);
PasteInInputLine(character); PasteInInputLine(character);
ResetHighlight(); ResetHighlight();
return 0; return 0;
} }
// SUniSPutUTF8(data->ch, character);
return 1; return 1;
} }
int32_t OnIdle(const EVENT_DATA_IDLE* data, void* param) { int32_t OnIdle(const EVENT_DATA_IDLE* data, void* param) {
if (s_repeatCount && (*s_repeatBuffer)) { // TODO repeat buffer logic
ConsoleCommandExecute(s_repeatBuffer, 0);
s_repeatCount--;
}
ConsoleScreenAnimate(data->elapsedSec); ConsoleScreenAnimate(data->elapsedSec);
@ -66,108 +58,71 @@ int32_t OnKeyDown(const EVENT_DATA_KEY* data, void* param) {
return 1; return 1;
} }
auto lineptr = GetInputLine(); auto anyControl = (1 << KEY_LCONTROL) | (1 << KEY_RCONTROL);
auto line = GetInputLine();
switch (data->key) { switch (data->key) {
case KEY_ESCAPE: case KEY_ESCAPE:
if (lineptr->inputstart < lineptr->inputpos) { if (line->inputpos < line->inputstart || line->inputpos == line->inputstart) {
ConsoleSetActive(0); ConsoleSetActive(0);
} else { } else {
lineptr->inputpos = lineptr->inputstart; line->inputpos = line->inputstart;
lineptr->chars = lineptr->inputstart; line->chars = line->inputstart;
lineptr->buffer[lineptr->inputstart] = '\0'; line->buffer[line->inputstart] = '\0';
SetInputString(lineptr->buffer); SetInputString(line->buffer);
}
break;
case KEY_C:
if (CTRL_MODIFIER(data)) {
CopyHighlightToClipboard();
}
break;
case KEY_V:
if (CTRL_MODIFIER(data)) {
PasteClipboardInInputLine();
}
break;
case KEY_ENTER:
if (lineptr->inputstart < lineptr->inputpos) {
lineptr->inputpos = 0;
GenerateNodeString(lineptr);
ConsoleCommandExecute(lineptr->buffer + lineptr->inputstart, 1);
s_historyIndex = -1;
}
break;
case KEY_BACKSPACE:
lineptr->Backspace();
break;
case KEY_TAB:
if (s_completionMode == 0) {
s_completedCmd = nullptr;
s_completionMode = 1;
SStrCopy(s_partial, lineptr->buffer + lineptr->inputstart, STORM_MAX_STR);
}
if (ConsoleCommandComplete(s_partial, &s_completedCmd, SHIFT_MODIFIER(data))) {
MakeCommandCurrent(lineptr, s_completedCmd);
}
SetInputString(lineptr->buffer);
break;
case KEY_LEFT:
if (lineptr->inputstart < lineptr->inputpos) {
lineptr->inputpos--;
}
break;
case KEY_UP:
lineptr->Up();
break;
case KEY_RIGHT:
if (lineptr->inputpos < lineptr->chars) {
lineptr->inputpos++;
}
break;
case KEY_DOWN:
lineptr->Down();
break;
case KEY_DELETE:
lineptr->Delete();
break;
case KEY_HOME:
if (CTRL_MODIFIER(data)) {
s_currlineptr = s_linelist.Tail();
} else {
if (lineptr->inputpos > lineptr->inputstart) {
lineptr->inputpos = lineptr->inputstart;
}
}
break;
case KEY_END:
if (CTRL_MODIFIER(data)) {
s_currlineptr = s_linelist.Head();
} else {
if (lineptr->inputpos < lineptr->chars) {
lineptr->inputpos = lineptr->chars;
}
} }
break; break;
case KEY_PAGEUP: case KEY_PAGEUP:
MoveLinePtr(1, SHIFT_MODIFIER(data)); MoveLinePtr(1, data->metaKeyState);
break; break;
case KEY_PAGEDOWN: case KEY_PAGEDOWN:
MoveLinePtr(0, SHIFT_MODIFIER(data)); MoveLinePtr(0, data->metaKeyState);
break; break;
default: case KEY_ENTER:
if (line->inputstart <= line->inputpos && line->inputpos != line->inputstart) {
line->inputpos = 0;
GenerateNodeString(line);
ConsoleCommandExecute(line->buffer + line->inputstart, 1);
s_historyIndex = -1;
}
break;
case KEY_HOME:
break;
case KEY_END:
break;
case KEY_C:
if (data->metaKeyState & anyControl) {
CutHighlightToClipboard();
}
break;
case KEY_V:
if (data->metaKeyState & anyControl) {
PasteClipboardToHighlight();
}
break;
case KEY_LEFT:
if (line->inputstart <= line->inputpos && line->inputpos != line->inputstart) {
line->inputpos--;
}
break;
case KEY_RIGHT:
if (line->inputpos < line->chars) {
line->inputpos++;
}
break;
case KEY_BACKSPACE:
BackspaceLine(line);
break; break;
} }
if (data->key != KEY_TAB if (data->key != KEY_TAB && data->key != KEY_LSHIFT && data->key != KEY_RSHIFT && data->key != KEY_LALT && data->key != KEY_RALT && !(data->metaKeyState & anyControl)) {
&& data->key != KEY_LSHIFT // s_completionMode = 0;
&& data->key != KEY_RSHIFT
&& data->key != KEY_LALT
&& data->key != KEY_RALT
&& !(CTRL_MODIFIER(data))) {
s_completionMode = 0;
ResetHighlight(); ResetHighlight();
} }
// TODO
return 0; return 0;
} }
@ -177,52 +132,34 @@ int32_t OnKeyDownRepeat(const EVENT_DATA_KEY* data, void* param) {
return 0; return 0;
} }
if (EventIsKeyDown(ConsoleGetHotKey()) || !ConsoleGetActive()) { auto anyControl = (1 << KEY_LCONTROL) | (1 << KEY_RCONTROL);
return 1;
}
auto lineptr = GetInputLine(); auto line = GetInputLine();
switch (data->key) { switch (data->key) {
case KEY_BACKSPACE:
lineptr->Backspace();
break;
case KEY_LEFT:
if (lineptr->inputstart < lineptr->inputpos) {
lineptr->inputpos--;
}
break;
case KEY_UP:
lineptr->Up();
break;
case KEY_RIGHT:
if (lineptr->inputstart < lineptr->inputpos) {
lineptr->inputpos++;
}
break;
case KEY_DOWN:
lineptr->Down();
break;
case KEY_DELETE:
lineptr->Delete();
break;
case KEY_PAGEUP: case KEY_PAGEUP:
MoveLinePtr(1, SHIFT_MODIFIER(data)); MoveLinePtr(1, data->metaKeyState);
break; break;
case KEY_PAGEDOWN: case KEY_PAGEDOWN:
MoveLinePtr(0, SHIFT_MODIFIER(data)); MoveLinePtr(0, data->metaKeyState);
break; break;
default: case KEY_LEFT:
if (line->inputstart <= line->inputpos && line->inputpos != line->inputstart) {
line->inputpos--;
}
break;
case KEY_RIGHT:
if (line->inputpos < line->chars) {
line->inputpos++;
}
break;
case KEY_BACKSPACE:
BackspaceLine(line);
break; break;
} }
if (data->key != KEY_TAB if (data->key != KEY_TAB && data->key != KEY_LSHIFT && data->key != KEY_RSHIFT && data->key != KEY_LALT && data->key != KEY_RALT && !(data->metaKeyState & anyControl)) {
&& data->key != KEY_LSHIFT // s_completionMode = 0;
&& data->key != KEY_RSHIFT
&& data->key != KEY_LALT
&& data->key != KEY_RALT
&& !(CTRL_MODIFIER(data))) {
s_completionMode = 0;
ResetHighlight(); ResetHighlight();
} }
@ -230,50 +167,51 @@ int32_t OnKeyDownRepeat(const EVENT_DATA_KEY* data, void* param) {
} }
int32_t OnKeyUp(const EVENT_DATA_KEY* data, void* param) { int32_t OnKeyUp(const EVENT_DATA_KEY* data, void* param) {
if (data->key == ConsoleGetHotKey()) { // TODO
if (ConsoleAccessGetEnabled()) { return 1;
return 0;
}
}
return !ConsoleGetActive();
} }
int32_t OnMouseDown(const EVENT_DATA_MOUSE* data, void* param) { int32_t OnMouseDown(const EVENT_DATA_MOUSE* data, void* param) {
if (EventIsKeyDown(ConsoleGetHotKey()) || !ConsoleGetActive() || (1.0f - s_consoleHeight) > data->y) { auto consoleHeight = ConsoleGetHeight();
auto fontHeight = ConsoleGetFontHeight();
if (EventIsKeyDown(ConsoleGetHotKey()) || !ConsoleGetActive() || (1.0f - consoleHeight) > data->y) {
return 1; return 1;
} }
float clickPos = 1.0f - data->y; float clickPos = 1.0f - data->y;
if (clickPos < (std::min(s_consoleHeight, 1.0f) - (s_fontHeight * 0.75f)) || clickPos > s_consoleHeight) { if (clickPos < (std::min(consoleHeight, 1.0f) - (fontHeight * 0.75f)) || clickPos > consoleHeight) {
ResetHighlight(); ResetHighlight();
auto lineptr = GetLineAtMousePosition(data->y); auto line = GetLineAtMousePosition(data->y);
if (lineptr) { if (line) {
SStrCopy(s_copyText, lineptr->buffer, CONSOLE_HIGHLIGHT_CLIPBOARD_SIZE); SetHighlightCopyText(line->buffer);
s_highlightState = HS_HIGHLIGHTING; SetHighlightState(HS_HIGHLIGHTING);
float v7 = 1.0f - (s_consoleHeight - (s_fontHeight * 0.75f) - (s_fontHeight) - ((s_consoleHeight - clickPos) / s_fontHeight - 1.0) * s_fontHeight); float v7 = 1.0f - (consoleHeight - (fontHeight * 0.75f) - (fontHeight) - ((consoleHeight - clickPos) / fontHeight - 1.0) * fontHeight);
s_hRect.bottom = v7; auto hRect = GetHighlightRect();
s_hRect.top = v7 - s_fontHeight;
s_highlightHStart = v7; hRect.bottom = v7;
s_highlightHEnd = v7; hRect.top = v7 - fontHeight;
SetHighlightStart(v7);
SetHighlightEnd(v7);
UpdateHighlight(); UpdateHighlight();
return 0; return 0;
} }
s_copyText[0] = '\0'; ResetHighlightCopyText();
return 0; return 0;
} }
ResetHighlight(); ResetHighlight();
s_consoleResizeState = CS_STRETCH;
ConsoleSetResizeState(CS_STRETCH);
return 1; return 1;
} }
@ -283,16 +221,16 @@ int32_t OnMouseMove(const EVENT_DATA_MOUSE* data, void* param) {
return 1; return 1;
} }
if (s_consoleResizeState == CS_STRETCH) { if (ConsoleGetResizeState() == CS_STRETCH) {
auto newHeight = std::max(1.0f - data->y, s_fontHeight); auto newHeight = std::max(1.0f - data->y, ConsoleGetFontHeight());
s_consoleHeight = newHeight; ConsoleSetHeight(newHeight);
} else if ((1.0f - s_consoleHeight) > data->y) { } else if ((1.0f - ConsoleGetHeight()) > data->y) {
return 1; return 1;
} }
s_highlightHEnd = data->x; SetHighlightEnd(data->x);
if (s_highlightState == HS_HIGHLIGHTING) { if (GetHighlightState() == HS_HIGHLIGHTING) {
UpdateHighlight(); UpdateHighlight();
} }
@ -304,8 +242,8 @@ int32_t OnMouseUp(const EVENT_DATA_MOUSE* data, void* param) {
return 1; return 1;
} }
s_highlightState = HS_ENDHIGHLIGHT; SetHighlightState(HS_ENDHIGHLIGHT);
s_consoleResizeState = CS_NONE; ConsoleSetResizeState(CS_NONE);
return 1; return 1;
} }

View File

@ -1,59 +0,0 @@
#include "console/Highlight.hpp"
#include "console/Text.hpp"
#include "os/Clipboard.hpp"
HIGHLIGHTSTATE s_highlightState = HS_NONE;
RECTF s_hRect = { 0.0f, 0.0f, 0.0f, 0.0f };
float s_highlightHStart = 0.0f;
float s_highlightHEnd = 0.0f;
uint32_t s_highlightLeftCharIndex = 0;
uint32_t s_highlightRightCharIndex = 0;
int32_t s_highlightInput = 0;
char s_copyText[CONSOLE_HIGHLIGHT_CLIPBOARD_SIZE] = { 0 };
void ResetHighlight() {
s_highlightState = HS_NONE;
s_hRect = { 0.0f, 0.0f, 0.0f, 0.0f };
}
void UpdateHighlight() {
auto font = TextBlockGetFontPtr(s_textFont);
STORM_ASSERT(font);
auto len = SStrLen(s_copyText);
float left = std::min(s_highlightHStart, s_highlightHEnd);
float right = std::max(s_highlightHStart, s_highlightHEnd);
auto chars = GxuFontGetMaxCharsWithinWidth(font, s_copyText, s_fontHeight, left, len, &s_hRect.left, 0.0f, 1.0f, s_charSpacing, s_baseTextFlags);
s_highlightLeftCharIndex = chars;
if (chars) {
s_highlightRightCharIndex = chars - 1;
}
if (s_hRect.left < 0.015f) {
s_hRect.left = 0.0f;
}
s_highlightRightCharIndex = GxuFontGetMaxCharsWithinWidth(font, s_copyText, s_fontHeight, right, len, &s_hRect.right, 0.0f, 1.0f, s_charSpacing, s_baseTextFlags);
}
void CopyHighlightToClipboard() {
char buffer[CONSOLE_HIGHLIGHT_CLIPBOARD_SIZE];
if (s_copyText[0] != '\0') {
auto highlightWidth = s_highlightRightCharIndex - s_highlightLeftCharIndex;
if (highlightWidth >= (CONSOLE_HIGHLIGHT_CLIPBOARD_SIZE-1)) {
highlightWidth = CONSOLE_HIGHLIGHT_CLIPBOARD_SIZE-1;
}
SStrCopy(buffer, &s_copyText[s_highlightLeftCharIndex], highlightWidth);
buffer[highlightWidth] = '\0';
OsClipboardPutString(buffer);
}
ResetHighlight();
}

View File

@ -1,31 +0,0 @@
#ifndef CONSOLE_HIGHLIGHT_HPP
#define CONSOLE_HIGHLIGHT_HPP
#include <cstdint>
#include <storm/Region.hpp>
#define CONSOLE_HIGHLIGHT_CLIPBOARD_SIZE 128
enum HIGHLIGHTSTATE {
HS_NONE = 0,
HS_HIGHLIGHTING = 1,
HS_ENDHIGHLIGHT = 2,
NUM_HIGHLIGHTSTATES
};
extern HIGHLIGHTSTATE s_highlightState;
extern RECTF s_hRect;
extern float s_highlightHStart;
extern float s_highlightHEnd;
extern uint32_t s_highlightLeftCharIndex;
extern uint32_t s_highlightRightCharIndex;
extern int32_t s_highlightInput;
extern char s_copyText[CONSOLE_HIGHLIGHT_CLIPBOARD_SIZE];
void ResetHighlight();
void UpdateHighlight();
void CopyHighlightToClipboard();
#endif

View File

@ -1,203 +1,24 @@
#include "console/Console.hpp"
#include "console/Highlight.hpp"
#include "console/Line.hpp" #include "console/Line.hpp"
#include "console/Command.hpp" #include "console/Types.hpp"
#include "console/Text.hpp" #include "console/Console.hpp"
#include "console/Screen.hpp" #include "console/Screen.hpp"
#include "gx/Device.hpp" #include "gx/Device.hpp"
#include "os/Clipboard.hpp"
#include <bc/Memory.hpp> #include <storm/List.hpp>
#include <storm/Thread.hpp> #include <storm/thread/SCritSect.hpp>
#include <cstdarg>
#include <cstdio> #include <cstdio>
#include <cstdarg>
int32_t s_historyIndex = 0; static SCritSect s_critsect;
// in this list // In this list:
// head = the input line // The head = the input line.
// tail = the oldest line // The tail = the oldest line printed.
STORM_LIST(CONSOLELINE) s_linelist; static STORM_LIST(CONSOLELINE) s_linelist;
CONSOLELINE* s_currlineptr; // Pointer to the current line. Determines what region of the console history gets rendered.
uint32_t s_NumLines = 0; static CONSOLELINE* s_currlineptr = nullptr;
SCritSect s_critsect; static uint32_t s_NumLines = 0;
void CONSOLELINE::Up() {
if ((ConsoleCommandHistoryDepth() - 1) == s_historyIndex) {
return;
}
auto previous = ConsoleCommandHistory(s_historyIndex + 1);
if (previous) {
MakeCommandCurrent(this, previous);
s_historyIndex++;
SetInputString(this->buffer);
}
}
void CONSOLELINE::Down() {
if (s_historyIndex == -1) {
return;
}
const char* next;
if (s_historyIndex == 0) {
next = "";
} else {
if (!(next = ConsoleCommandHistory(s_historyIndex - 1))) {
return;
}
}
MakeCommandCurrent(this, next);
s_historyIndex--;
SetInputString(this->buffer);
}
void CONSOLELINE::Delete() {
if (this->inputpos > this->chars) {
return;
}
auto pos = this->inputpos;
memmove(this->buffer + pos, this->buffer + pos + 1, this->chars - pos);
this->chars--;
SetInputString(this->buffer);
}
void CONSOLELINE::Backspace() {
auto pos = this->inputpos;
if (this->inputstart >= pos) {
return;
}
if (pos < this->chars) {
memmove(this->buffer + pos - 1, this->buffer + pos, (this->chars - pos) + 1);
} else {
this->buffer[pos - 1] = '\0';
}
this->inputpos--;
this->chars--;
SetInputString(this->buffer);
}
CONSOLELINE::~CONSOLELINE() {
if (this->buffer) {
FREE(this->buffer);
}
if (this->fontPointer) {
GxuFontDestroyString(this->fontPointer);
}
}
void GenerateNodeString(CONSOLELINE* node) {
auto font = TextBlockGetFontPtr(s_textFont);
if (font && node && node->buffer && node->buffer[0] != '\0') {
if (node->fontPointer) {
GxuFontDestroyString(node->fontPointer);
}
C3Vector pos = {
0.0f, 0.0f, 1.0f
};
GxuFontCreateString(
font,
node->buffer,
s_fontHeight,
pos,
1.0f,
s_fontHeight,
0.0f,
node->fontPointer,
GxVJ_Middle, GxHJ_Left,
s_baseTextFlags,
s_colorArray[node->colorType],
s_charSpacing,
1.0f);
STORM_ASSERT(node->fontPointer);
}
}
void SetInputString(const char* buffer) {
if (s_inputString) {
GxuFontDestroyString(s_inputString);
}
s_inputString = nullptr;
if (buffer && buffer[0] != '\0') {
C3Vector pos = { 0.0f, 0.0f, 1.0f };
auto font = TextBlockGetFontPtr(s_textFont);
GxuFontCreateString(
font,
buffer,
s_fontHeight,
pos,
1.0f,
s_fontHeight,
0.0f,
s_inputString,
GxVJ_Middle, GxHJ_Left,
s_baseTextFlags,
s_colorArray[INPUT_COLOR],
s_charSpacing,
1.0f);
}
}
void ReserveInputSpace(CONSOLELINE* line, uint32_t chars) {
size_t newsize = line->chars + chars;
if (newsize >= line->charsalloc) {
while (line->charsalloc <= newsize) {
line->charsalloc += CONSOLE_LINE_EXTRA_BYTES;
}
auto buffer = reinterpret_cast<char*>(ALLOC(line->charsalloc));
SStrCopy(buffer, line->buffer, line->charsalloc);
FREE(line->buffer);
line->buffer = buffer;
}
}
void MoveLinePtr(int32_t direction, int32_t modifier) {
auto lineptr = s_currlineptr;
if (modifier == 1) {
for (int32_t i = 0; i < 10 && lineptr != nullptr; i++) {
lineptr = direction == 1 ? lineptr->m_link.Next() : lineptr->m_link.Prev();
}
} else {
lineptr = direction == 1 ? lineptr->m_link.Next() : lineptr->m_link.Prev();
}
if (lineptr) {
s_currlineptr = lineptr;
}
}
void MakeCommandCurrent(CONSOLELINE* lineptr, const char* command) {
auto len = lineptr->inputstart;
lineptr->inputpos = len;
lineptr->chars = len;
lineptr->buffer[len] = '\0';
len = SStrLen(command);
ReserveInputSpace(lineptr, len);
SStrCopy(lineptr->buffer + lineptr->inputpos, command, STORM_MAX_STR);
len = lineptr->inputpos + len;
lineptr->inputpos = len;
lineptr->chars = len;
}
void EnforceMaxLines() { void EnforceMaxLines() {
if (s_NumLines <= CONSOLE_LINES_MAX) { if (s_NumLines <= CONSOLE_LINES_MAX) {
@ -206,11 +27,17 @@ void EnforceMaxLines() {
// Pop oldest line off the list // Pop oldest line off the list
auto lineptr = s_linelist.Tail(); auto lineptr = s_linelist.Tail();
if (lineptr == s_currlineptr) {
s_currlineptr = lineptr->Prev(); if (lineptr == nullptr) {
lineptr = s_currlineptr;
} }
// Clean up oldest line if (lineptr == nullptr) {
return;
}
// Clean up oldest line.
s_linelist.UnlinkNode(lineptr);
s_linelist.DeleteNode(lineptr); s_linelist.DeleteNode(lineptr);
s_NumLines--; s_NumLines--;
@ -220,36 +47,37 @@ CONSOLELINE* GetInputLine() {
auto head = s_linelist.Head(); auto head = s_linelist.Head();
// If the list is empty, or the list's head is an entered input-line, // If the list is empty, or the list's head is an entered input-line,
// Create a fresh input line, with "> " prefixed before the caret // Create a fresh input line, with "> " prefixed before the caret.
if (head && head->inputpos != 0) { if (!head || head->inputpos == 0) {
return head; auto l = SMemAlloc(sizeof(CONSOLELINE), __FILE__, __LINE__, 0);
auto line = new(l) CONSOLELINE();
line->buffer = reinterpret_cast<char*>(SMemAlloc(CONSOLE_LINE_PREALLOC, __FILE__, __LINE__, 0));
line->charsalloc = CONSOLE_LINE_PREALLOC;
s_linelist.LinkToHead(line);
SStrCopy(line->buffer, "> ", line->charsalloc);
SetInputString(line->buffer);
auto chars = SStrLen(line->buffer);
s_NumLines++;
line->inputstart = chars;
line->inputpos = chars;
line->chars = chars;
line->colorType = INPUT_COLOR;
s_currlineptr = line;
EnforceMaxLines();
return line;
} }
auto line = NEW(CONSOLELINE); return head;
line->buffer = reinterpret_cast<char*>(ALLOC(CONSOLE_LINE_EXTRA_BYTES));
line->charsalloc = CONSOLE_LINE_EXTRA_BYTES;
s_linelist.LinkToHead(line);
s_NumLines++;
SStrCopy(line->buffer, "> ", line->charsalloc);
SetInputString(line->buffer);
auto chars = SStrLen(line->buffer);
line->inputstart = chars;
line->inputpos = chars;
line->chars = chars;
line->colorType = INPUT_COLOR;
s_currlineptr = line;
EnforceMaxLines();
return line;
} }
CONSOLELINE* GetLineAtMousePosition(float y) { CONSOLELINE* GetLineAtMousePosition(float y) {
// Loop through linelist to find line at mouse position // Loop through linelist to find line at mouse position
auto linePos = static_cast<int32_t>((s_consoleHeight - (1.0 - y)) / s_fontHeight); int32_t linePos = static_cast<int32_t>((ConsoleGetHeight() - (1.0 - y)) / ConsoleGetFontHeight());
if (linePos == 1) { if (linePos == 1) {
return s_linelist.Head(); return s_linelist.Head();
@ -259,7 +87,7 @@ CONSOLELINE* GetLineAtMousePosition(float y) {
linePos--; linePos--;
} }
auto line = s_currlineptr; CONSOLELINE* line = s_currlineptr;
while (linePos > 1) { while (linePos > 1) {
linePos--; linePos--;
@ -278,73 +106,32 @@ CONSOLELINE* GetLineAtMousePosition(float y) {
return line; return line;
} }
void PasteInInputLine(const char* characters) { void ReserveInputSpace(CONSOLELINE* line, size_t len) {
auto len = SStrLen(characters); size_t newsize = line->chars + len;
if (newsize >= line->charsalloc) {
if (!len) { while (line->charsalloc <= newsize) {
return; line->charsalloc += CONSOLE_LINE_PREALLOC;
}
auto line = GetInputLine();
ReserveInputSpace(line, len);
if (line->inputpos < line->chars) {
if (len <= 1) {
memmove(&line->buffer[line->inputpos + 1], &line->buffer[line->inputpos], line->chars - (line->inputpos + 1));
line->buffer[line->inputpos] = *characters;
line->inputpos++;
line->chars++;
} else {
auto input = reinterpret_cast<char*>(ALLOC(line->charsalloc));
SStrCopy(input, &line->buffer[line->inputpos], STORM_MAX_STR);
auto buffer = reinterpret_cast<char*>(ALLOC(line->charsalloc));
SStrCopy(buffer, line->buffer, STORM_MAX_STR);
buffer[line->inputpos] = '\0';
SStrPack(buffer, characters, line->charsalloc);
auto len = SStrLen(buffer);
line->inputpos = len;
SStrPack(buffer, input, line->charsalloc);
SStrCopy(line->buffer, buffer, STORM_MAX_STR);
line->chars = SStrLen(line->buffer);
if (input) {
FREE(input);
}
if (buffer) {
FREE(buffer);
}
}
} else {
for (int32_t i = 0; i < len; i++) {
line->buffer[line->inputpos++] = characters[i];
} }
line->buffer[line->inputpos] = '\0'; auto buffer = reinterpret_cast<char*>(SMemAlloc(line->charsalloc, __FILE__, __LINE__, 0));
line->chars = line->inputpos; SStrCopy(buffer, line->buffer, line->charsalloc);
SMemFree(line->buffer, __FILE__, __LINE__, 0x0);
line->buffer = buffer;
} }
SetInputString(line->buffer);
} }
void ConsoleWrite(const char* str, COLOR_T color) { void ConsoleWrite(const char* str, COLOR_T color) {
if (!str || !*str || !GxDevExists() || !s_textFont) { if (g_theGxDevicePtr == nullptr || str[0] == '\0') {
return; return;
} }
s_critsect.Enter(); s_critsect.Enter();
auto lineptr = NEW(CONSOLELINE); auto l = reinterpret_cast<char*>(SMemAlloc(sizeof(CONSOLELINE), __FILE__, __LINE__, 0));
auto lineptr = new(l) CONSOLELINE();
auto head = s_linelist.Head(); auto head = s_linelist.Head();
if (head == nullptr || head->inputpos == 0) { if (head == nullptr || head->inputpos == 0) {
// Attach console line to head // Attach console line to head
s_linelist.LinkToHead(lineptr); s_linelist.LinkToHead(lineptr);
@ -356,31 +143,21 @@ void ConsoleWrite(const char* str, COLOR_T color) {
size_t len = SStrLen(str) + 1; size_t len = SStrLen(str) + 1;
lineptr->chars = len; lineptr->chars = len;
lineptr->charsalloc = len; lineptr->charsalloc = len;
lineptr->buffer = reinterpret_cast<char*>(ALLOC(len)); lineptr->buffer = reinterpret_cast<char*>(SMemAlloc(len, __FILE__, __LINE__, 0));
lineptr->colorType = color; lineptr->colorType = color;
SStrCopy(lineptr->buffer, str, STORM_MAX_STR); SStrCopy(lineptr->buffer, str, STORM_MAX_STR);
GenerateNodeString(lineptr); GenerateNodeString(lineptr);
s_NumLines++; s_NumLines++;
EnforceMaxLines(); EnforceMaxLines();
//
s_critsect.Leave(); s_critsect.Leave();
} }
void ConsolePrintf(const char* str, ...) {
char buffer[1024] = {0};
if (str != nullptr && str[0] != '\0') {
va_list list;
va_start(list, str);
vsnprintf(buffer, sizeof(buffer), str, list);
va_end(list);
ConsoleWrite(buffer, DEFAULT_COLOR);
}
}
void ConsoleWriteA(const char* str, COLOR_T color, ...) { void ConsoleWriteA(const char* str, COLOR_T color, ...) {
char buffer[1024] = {0}; char buffer[1024] = {0};
@ -394,16 +171,91 @@ void ConsoleWriteA(const char* str, COLOR_T color, ...) {
} }
} }
void PasteClipboardInInputLine() { void ConsolePrintf(char const* str, ...) {
auto str = OsClipboardGetString(); char buffer[4096] = { 0 };
if (str) {
PasteInInputLine(str); if (str != nullptr && str[0] != '\0') {
FREE(str); va_list list;
ResetHighlight(); va_start(list, str);
vsnprintf(buffer, sizeof(buffer), str, list);
va_end(list);
ConsoleWrite(buffer, DEFAULT_COLOR);
}
}
void MoveLinePtr(int32_t direction, int32_t modifier) {
CONSOLELINE* lineptr = s_currlineptr;
auto anyControl = (1 << KEY_LCONTROL) | (1 << KEY_RCONTROL);
if (modifier & anyControl) {
for (int32_t i = 0; i < 10 && lineptr != nullptr; i++) {
CONSOLELINE* next;
if (direction == 1) {
next = lineptr->m_link.Next();
} else {
next = lineptr->m_link.Prev();
}
if (next != nullptr) {
lineptr = next;
}
}
} else {
// if (s_currlineptr == s_linelist.Head()) {
// s_currlineptr = s_currlineptr->Prev();
// }
if (direction == 1) {
lineptr = lineptr->m_link.Next();
} else {
lineptr = lineptr->m_link.Prev();
}
}
if (lineptr) {
s_currlineptr = lineptr;
}
}
void BackspaceLine(CONSOLELINE* line) {
if (line->inputstart <= line->inputpos && line->inputpos != line->inputstart) {
if (line->inputpos < line->chars) {
memmove(line->buffer + line->inputpos + -1, line->buffer + line->inputpos, (line->chars - line->inputpos) + 1);
} else {
line->buffer[line->inputpos - 1] = '\0';
}
line->chars--;
line->inputpos--;
SetInputString(line->buffer);
}
}
CONSOLELINE* GetCurrentLine() {
return s_currlineptr;
}
CONSOLELINE::~CONSOLELINE() {
if (this->buffer) {
SMemFree(this->buffer, __FILE__, __LINE__, 0);
}
if (this->fontPointer) {
GxuFontDestroyString(this->fontPointer);
} }
} }
void ConsoleClear() { void ConsoleClear() {
s_NumLines = 0; s_NumLines = 0;
s_linelist.Clear();
auto ptr = s_linelist.Head();
while (ptr) {
s_linelist.UnlinkNode(ptr);
s_linelist.DeleteNode(ptr);
ptr = s_linelist.Head();
}
} }

View File

@ -4,59 +4,28 @@
#include "console/Types.hpp" #include "console/Types.hpp"
#include <storm/List.hpp> #include <storm/List.hpp>
#include <storm/Thread.hpp>
#define CONSOLE_LINES_MAX 256 #define CONSOLE_LINES_MAX 256
#define CONSOLE_LINE_LENGTH 1024 #define CONSOLE_LINE_LENGTH 1024
#define CONSOLE_LINE_EXTRA_BYTES 16 #define CONSOLE_LINE_PREALLOC 16
class CONSOLELINE : public TSLinkedNode<CONSOLELINE> { void ConsoleWrite(const char* str, COLOR_T color);
public: void ConsoleWriteA(const char* str, COLOR_T color, ...);
char* buffer = nullptr; void ConsolePrintf(char const* str, ...);
uint32_t chars = 0;
uint32_t charsalloc = 0;
uint32_t inputpos = 0;
uint32_t inputstart = 0;
COLOR_T colorType = DEFAULT_COLOR;
CGxString* fontPointer = nullptr;
void Up(); void PasteInInputLine(char* characters);
void Down();
void Delete();
void Backspace();
~CONSOLELINE();
};
extern int32_t s_historyIndex;
extern STORM_LIST(CONSOLELINE) s_linelist;
extern CONSOLELINE* s_currlineptr;
extern uint32_t s_NumLines;
extern SCritSect s_critsect;
void GenerateNodeString(CONSOLELINE* node);
void SetInputString(const char* buffer);
void ReserveInputSpace(CONSOLELINE* lineptr, uint32_t len);
void MoveLinePtr(int32_t direction, int32_t modifier); void MoveLinePtr(int32_t direction, int32_t modifier);
void MakeCommandCurrent(CONSOLELINE* lineptr, const char* command); void BackspaceLine(CONSOLELINE* line);
void ReserveInputSpace(CONSOLELINE* line, size_t len);
CONSOLELINE* GetInputLine(); CONSOLELINE* GetInputLine();
CONSOLELINE* GetCurrentLine();
CONSOLELINE* GetLineAtMousePosition(float y); CONSOLELINE* GetLineAtMousePosition(float y);
void PasteInInputLine(const char* characters); void ConsoleClear();
void PasteClipboardInInputLine();
// void BackspaceLine(CONSOLELINE* line);
// CONSOLELINE* GetCurrentLine();
// CONSOLELINE* GetLineAtMousePosition(float y);
// void ConsoleClear();
#endif #endif

View File

@ -2,9 +2,7 @@
#include "console/Console.hpp" #include "console/Console.hpp"
#include "console/Command.hpp" #include "console/Command.hpp"
#include "console/Handlers.hpp" #include "console/Handlers.hpp"
#include "console/Highlight.hpp"
#include "console/Line.hpp" #include "console/Line.hpp"
#include "console/Text.hpp"
#include "console/Types.hpp" #include "console/Types.hpp"
#include "gx/Buffer.hpp" #include "gx/Buffer.hpp"
#include "gx/Coordinate.hpp" #include "gx/Coordinate.hpp"
@ -19,15 +17,30 @@
#include <tempest/Rect.hpp> #include <tempest/Rect.hpp>
#include <algorithm> #include <algorithm>
static CGxStringBatch* s_batch;
static uint32_t s_baseTextFlags = 0x8;
static int32_t s_caret = 0;
static float s_caretpixwidth;
static float s_caretpixheight;
static float s_charSpacing = 0.0f;
static CGxString* s_inputString = nullptr;
static char s_fontName[STORM_MAX_PATH];
static HLAYER s_layerBackground; static HLAYER s_layerBackground;
static HLAYER s_layerText; static HLAYER s_layerText;
static RECTF s_rect = { 0.0f, 1.0f, 1.0f, 1.0f }; static RECTF s_rect = { 0.0f, 1.0f, 1.0f, 1.0f };
static HTEXTFONT s_textFont;
float s_consoleLines = 10.0f; static HIGHLIGHTSTATE s_highlightState = HS_NONE;
float s_consoleHeight = s_consoleLines * s_fontHeight; static RECTF s_hRect = { 0.0f, 0.0f, 0.0f, 0.0f };
CONSOLERESIZESTATE s_consoleResizeState = CS_NONE; static float s_highlightHStart = 0.0f;
static float s_highlightHEnd = 0.0f;
static uint32_t s_highlightLeftCharIndex = 0;
static uint32_t s_highlightRightCharIndex = 0;
static int32_t s_highlightInput = 0;
static char s_copyText[HIGHLIGHT_COPY_SIZE] = { 0 };
CImVector s_colorArray[NUM_COLORTYPES] = { static CImVector s_colorArray[] = {
{ 0xFF, 0xFF, 0xFF, 0xFF }, // DEFAULT_COLOR { 0xFF, 0xFF, 0xFF, 0xFF }, // DEFAULT_COLOR
{ 0xFF, 0xFF, 0xFF, 0xFF }, // INPUT_COLOR { 0xFF, 0xFF, 0xFF, 0xFF }, // INPUT_COLOR
{ 0x80, 0x80, 0x80, 0xFF }, // ECHO_COLOR { 0x80, 0x80, 0x80, 0xFF }, // ECHO_COLOR
@ -103,7 +116,7 @@ void DrawCaret(C3Vector& caretpos) {
float minY = caretpos.y; float minY = caretpos.y;
float maxX = caretpos.x + (s_caretpixwidth * 2); float maxX = caretpos.x + (s_caretpixwidth * 2);
float maxY = caretpos.y + s_fontHeight; float maxY = caretpos.y + ConsoleGetFontHeight();
C3Vector position[] = { C3Vector position[] = {
{ minX, minY, 0.0f }, { minX, minY, 0.0f },
@ -140,6 +153,107 @@ void PaintBackground(void* param, const RECTF* rect, const RECTF* visible, float
} }
} }
void SetInputString(char* buffer) {
// s_highlightState = HS_NONE;
// s_hRect = { 0.0f, 0.0f, 0.0f, 0.0f };
// s_highlightLeftCharIndex = 0;
// s_highlightRightCharIndex = 0;
// s_highlightInput = 0;
if (s_inputString) {
GxuFontDestroyString(s_inputString);
}
s_inputString = nullptr;
auto fontHeight = ConsoleGetFontHeight();
if (buffer && buffer[0] != '\0') {
C3Vector pos = { 0.0f, 0.0f, 1.0f };
auto font = TextBlockGetFontPtr(s_textFont);
GxuFontCreateString(font, buffer, fontHeight, pos, 1.0f, fontHeight, 0.0f, s_inputString, GxVJ_Middle, GxHJ_Left, s_baseTextFlags, s_colorArray[INPUT_COLOR], s_charSpacing, 1.0f);
}
}
void PasteInInputLine(char* characters) {
auto len = SStrLen(characters);
if (!len) {
return;
}
auto line = GetInputLine();
ReserveInputSpace(line, len);
if (line->inputpos < line->chars) {
if (len <= 1) {
memmove(&line->buffer[line->inputpos + 1], &line->buffer[line->inputpos], line->chars - (line->inputpos + 1));
line->buffer[line->inputpos] = *characters;
line->inputpos++;
line->chars++;
} else {
auto input = reinterpret_cast<char*>(SMemAlloc(line->charsalloc, __FILE__, __LINE__, 0x0));
SStrCopy(input, &line->buffer[line->inputpos], STORM_MAX_STR);
auto buffer = reinterpret_cast<char*>(SMemAlloc(line->charsalloc, __FILE__, __LINE__, 0x0));
SStrCopy(buffer, line->buffer, STORM_MAX_STR);
buffer[line->inputpos] = '\0';
SStrPack(buffer, characters, line->charsalloc);
auto len = SStrLen(buffer);
line->inputpos = len;
SStrPack(buffer, input, line->charsalloc);
SStrCopy(line->buffer, buffer, STORM_MAX_STR);
line->chars = SStrLen(line->buffer);
if (input) {
SMemFree(input, __FILE__, __LINE__, 0);
}
if (buffer) {
SMemFree(input, __FILE__, __LINE__, 0);
}
}
} else {
for (int32_t i = 0; i < len; i++) {
line->buffer[line->inputpos++] = characters[i];
}
line->buffer[line->inputpos] = '\0';
line->chars = line->inputpos;
}
SetInputString(line->buffer);
}
void GenerateNodeString(CONSOLELINE* node) {
auto font = TextBlockGetFontPtr(s_textFont);
if (font && node && node->buffer && node->buffer[0] != '\0') {
if (node->fontPointer) {
GxuFontDestroyString(node->fontPointer);
}
C3Vector pos = {
0.0f, 0.0f, 1.0f
};
auto fontHeight = ConsoleGetFontHeight();
GxuFontCreateString(font, node->buffer, fontHeight, pos, 1.0f, fontHeight, 0.0f, node->fontPointer, GxVJ_Middle, GxHJ_Left, s_baseTextFlags, s_colorArray[node->colorType], s_charSpacing, 1.0f);
BC_ASSERT(node->fontPointer);
}
}
void PaintText(void* param, const RECTF* rect, const RECTF* visible, float elapsedSec) { void PaintText(void* param, const RECTF* rect, const RECTF* visible, float elapsedSec) {
if (s_rect.bottom >= 1.0f) { if (s_rect.bottom >= 1.0f) {
return; return;
@ -159,7 +273,7 @@ void PaintText(void* param, const RECTF* rect, const RECTF* visible, float elaps
C3Vector pos = { C3Vector pos = {
s_rect.left, s_rect.left,
(s_fontHeight * 0.75f) + s_rect.bottom, (ConsoleGetFontHeight() * 0.75f) + s_rect.bottom,
1.0f 1.0f
}; };
@ -175,14 +289,14 @@ void PaintText(void* param, const RECTF* rect, const RECTF* visible, float elaps
if (line->inputpos) { if (line->inputpos) {
caretpos = pos; caretpos = pos;
GxuFontGetTextExtent(font, line->buffer, line->inputpos, s_fontHeight, &caretpos.x, 0.0f, 1.0f, s_charSpacing, s_baseTextFlags); GxuFontGetTextExtent(font, line->buffer, line->inputpos, ConsoleGetFontHeight(), &caretpos.x, 0.0f, 1.0f, s_charSpacing, s_baseTextFlags);
DrawCaret(caretpos); DrawCaret(caretpos);
} }
pos.y += s_fontHeight; pos.y += ConsoleGetFontHeight();
for (auto lineptr = s_currlineptr; (lineptr && pos.y < 1.0); lineptr = lineptr->Next()) { for (auto lineptr = GetCurrentLine(); (lineptr && pos.y < 1.0); lineptr = lineptr->Next()) {
if (lineptr != line) { if (lineptr != line) {
if (lineptr->fontPointer == nullptr) { if (lineptr->fontPointer == nullptr) {
GenerateNodeString(lineptr); GenerateNodeString(lineptr);
@ -190,15 +304,101 @@ void PaintText(void* param, const RECTF* rect, const RECTF* visible, float elaps
GxuFontSetStringPosition(lineptr->fontPointer, pos); GxuFontSetStringPosition(lineptr->fontPointer, pos);
GxuFontAddToBatch(s_batch, lineptr->fontPointer); GxuFontAddToBatch(s_batch, lineptr->fontPointer);
pos.y += s_fontHeight; pos.y += ConsoleGetFontHeight();
} }
} }
GxuFontRenderBatch(s_batch); GxuFontRenderBatch(s_batch);
} }
void UpdateHighlight() {
auto font = TextBlockGetFontPtr(s_textFont);
BC_ASSERT(font);
auto len = SStrLen(s_copyText);
float left = std::min(s_highlightHStart, s_highlightHEnd);
float right = std::max(s_highlightHStart, s_highlightHEnd);
auto chars = GxuFontGetMaxCharsWithinWidth(font, s_copyText, ConsoleGetFontHeight(), left, len, &s_hRect.left, 0.0f, 1.0f, s_charSpacing, s_baseTextFlags);
s_highlightLeftCharIndex = chars;
if (chars) {
s_highlightRightCharIndex = chars - 1;
}
if (s_hRect.left < 0.015f) {
s_hRect.left = 0.0f;
}
s_highlightRightCharIndex = GxuFontGetMaxCharsWithinWidth(font, s_copyText, ConsoleGetFontHeight(), right, len, &s_hRect.right, 0.0f, 1.0f, s_charSpacing, s_baseTextFlags);
}
void ResetHighlight() {
s_highlightState = HS_NONE;
s_hRect = { 0.0f, 0.0f, 0.0f, 0.0f };
}
HIGHLIGHTSTATE GetHighlightState() {
return s_highlightState;
}
void SetHighlightState(HIGHLIGHTSTATE hs) {
s_highlightState = hs;
}
char* GetHighlightCopyText() {
return s_copyText;
}
void SetHighlightCopyText(char* text) {
SStrCopy(s_copyText, text, HIGHLIGHT_COPY_SIZE);
}
void ResetHighlightCopyText() {
s_copyText[0] = '\0';
}
RECTF& GetHighlightRect() {
return s_hRect;
}
void SetHighlightStart(float start) {
s_highlightHStart = start;
}
void SetHighlightEnd(float end) {
s_highlightHEnd = end;
}
void CutHighlightToClipboard() {
char buffer[HIGHLIGHT_COPY_SIZE];
if (s_copyText[0] != '\0') {
uint32_t size = s_highlightRightCharIndex - s_highlightLeftCharIndex;
uint32_t capsize = HIGHLIGHT_COPY_SIZE-1;
size = std::min(size, capsize);
SStrCopy(buffer, &s_copyText[s_highlightLeftCharIndex], size);
buffer[size] = '\0';
// OsClipboardPutString(buffer);
}
ResetHighlight();
}
void PasteClipboardToHighlight() {
// auto buffer = OsClipboardGetString();
// PasteInInputLine(buffer);
// SMemFree(buffer, __FILE__, __LINE__, 0);
// ResetHighlight();
}
void ConsoleScreenAnimate(float elapsedSec) { void ConsoleScreenAnimate(float elapsedSec) {
auto finalPos = ConsoleGetActive() ? std::min(1.0f - s_consoleHeight, 1.0f) : 1.0f; auto finalPos = ConsoleGetActive() ? std::min(1.0f - ConsoleGetHeight(), 1.0f) : 1.0f;
finalPos = std::max(finalPos, 0.0f); finalPos = std::max(finalPos, 0.0f);
if (s_rect.bottom == finalPos) { if (s_rect.bottom == finalPos) {
@ -207,7 +407,7 @@ void ConsoleScreenAnimate(float elapsedSec) {
auto currentPos = finalPos; auto currentPos = finalPos;
if (s_consoleResizeState == CS_NONE) { if (ConsoleGetResizeState() == CS_NONE) {
auto direction = s_rect.bottom <= finalPos ? 1.0f : -1.0f; auto direction = s_rect.bottom <= finalPos ? 1.0f : -1.0f;
currentPos = s_rect.bottom + direction * elapsedSec * 5.0f; currentPos = s_rect.bottom + direction * elapsedSec * 5.0f;
@ -230,7 +430,7 @@ void ConsoleScreenInitialize(const char* title) {
s_caretpixheight = height == 0.0f ? 1.0f : 1.0f / height; s_caretpixheight = height == 0.0f ? 1.0f : 1.0f / height;
SStrCopy(s_fontName, "Fonts\\ARIALN.ttf", sizeof(s_fontName)); SStrCopy(s_fontName, "Fonts\\ARIALN.ttf", sizeof(s_fontName));
s_textFont = TextBlockGenerateFont(s_fontName, 0, NDCToDDCHeight(s_fontHeight)); s_textFont = TextBlockGenerateFont(s_fontName, 0, NDCToDDCHeight(ConsoleGetFontHeight()));
ScrnLayerCreate(&s_rect, 6.0f, 0x1 | 0x2, nullptr, PaintBackground, &s_layerBackground); ScrnLayerCreate(&s_rect, 6.0f, 0x1 | 0x2, nullptr, PaintBackground, &s_layerBackground);
ScrnLayerCreate(&s_rect, 7.0f, 0x1 | 0x2, nullptr, PaintText, &s_layerText); ScrnLayerCreate(&s_rect, 7.0f, 0x1 | 0x2, nullptr, PaintText, &s_layerText);

View File

@ -1,15 +1,46 @@
#ifndef CONSOLE_SCREEN_HPP #ifndef CONSOLE_SCREEN_HPP
#define CONSOLE_SCREEN_HPP #define CONSOLE_SCREEN_HPP
#include "console/Types.hpp" #define HIGHLIGHT_COPY_SIZE 128
extern float s_consoleLines; #include "console/Line.hpp"
extern float s_consoleHeight; #include <storm/region/Types.hpp>
extern CONSOLERESIZESTATE s_consoleResizeState;
extern CImVector s_colorArray[NUM_COLORTYPES]; enum HIGHLIGHTSTATE {
HS_NONE = 0,
HS_HIGHLIGHTING = 1,
HS_ENDHIGHLIGHT = 2,
NUM_HIGHLIGHTSTATES
};
void ConsoleScreenAnimate(float elapsedSec); void ConsoleScreenAnimate(float elapsedSec);
void ConsoleScreenInitialize(const char* title); void ConsoleScreenInitialize(const char* title);
void SetInputString(char* buffer);
void ResetHighlight();
void UpdateHighlight();
HIGHLIGHTSTATE GetHighlightState();
void SetHighlightState(HIGHLIGHTSTATE hs);
void SetHighlightCopyText(char* text);
char* GetHighlightCopyText();
void ResetHighlightCopyText();
void SetHighlightStart(float start);
void SetHighlightEnd(float end);
RECTF& GetHighlightRect();
void CutHighlightToClipboard();
void PasteClipboardToHighlight();
void GenerateNodeString(CONSOLELINE* node);
#endif #endif

View File

@ -1,12 +0,0 @@
#include "console/Text.hpp"
CGxStringBatch* s_batch;
uint32_t s_baseTextFlags = 0x8;
int32_t s_caret = 0;
float s_caretpixwidth;
float s_caretpixheight;
float s_charSpacing = 0.0f;
CGxString* s_inputString = nullptr;
char s_fontName[STORM_MAX_PATH];
float s_fontHeight = 0.02f;
HTEXTFONT s_textFont;

View File

@ -1,18 +0,0 @@
#ifndef CONSOLE_TEXT_HPP
#define CONSOLE_TEXT_HPP
#include "gx/Font.hpp"
#include "storm/String.hpp"
extern CGxStringBatch* s_batch;
extern uint32_t s_baseTextFlags;
extern int32_t s_caret;
extern float s_caretpixwidth;
extern float s_caretpixheight;
extern float s_charSpacing;
extern CGxString* s_inputString;
extern char s_fontName[STORM_MAX_PATH];
extern float s_fontHeight;
extern HTEXTFONT s_textFont;
#endif

View File

@ -2,6 +2,7 @@
#define CONSOLE_TYPES_HPP #define CONSOLE_TYPES_HPP
#include "gx/Font.hpp" #include "gx/Font.hpp"
#include <storm/Hash.hpp> #include <storm/Hash.hpp>
#include <storm/List.hpp> #include <storm/List.hpp>
@ -49,4 +50,32 @@ enum CONSOLERESIZESTATE {
typedef int32_t (*COMMANDHANDLER)(const char*, const char*); typedef int32_t (*COMMANDHANDLER)(const char*, const char*);
class CONSOLECOMMAND : public TSHashObject<CONSOLECOMMAND, HASHKEY_STRI> {
public:
COMMANDHANDLER m_handler;
const char* m_helpText;
CATEGORY m_category;
};
class CONSOLELINE : public TSLinkedNode<CONSOLELINE> {
public:
char* buffer;
uint32_t chars;
uint32_t charsalloc;
uint32_t inputpos;
uint32_t inputstart;
COLOR_T colorType;
CGxString* fontPointer;
~CONSOLELINE();
};
class ConsoleCommandList {
public:
const char* m_command;
COMMANDHANDLER m_handler;
const char* m_helpText;
};
#endif #endif

View File

@ -1,32 +0,0 @@
#ifndef CONSOLE_COMMAND_COMMANDS_HPP
#define CONSOLE_COMMAND_COMMANDS_HPP
#include <cstdint>
#include "console/Types.hpp"
#define DECLARE_COMMAND(x) int32_t ConsoleCommand_##x(const char* command, const char* arguments)
int32_t CCGxRestart(const char* command, const char* argument);
DECLARE_COMMAND(Quit);
DECLARE_COMMAND(Ver);
DECLARE_COMMAND(SetMap);
DECLARE_COMMAND(Help);
DECLARE_COMMAND(FontColor);
DECLARE_COMMAND(BackGroundColor);
DECLARE_COMMAND(HighLightColor);
DECLARE_COMMAND(FontSize);
DECLARE_COMMAND(Font);
DECLARE_COMMAND(BufferSize);
DECLARE_COMMAND(ClearConsole);
DECLARE_COMMAND(Proportional);
DECLARE_COMMAND(CharSpacing);
DECLARE_COMMAND(CurrentSettings);
DECLARE_COMMAND(DefaultSettings);
DECLARE_COMMAND(CloseConsole);
DECLARE_COMMAND(RepeatHandler);
DECLARE_COMMAND(AppendLogToFile);
#endif

View File

@ -1,6 +1,6 @@
#include "console/command/Commands.hpp" #include "console/Command.hpp"
#include "util/Unimplemented.hpp"
DECLARE_COMMAND(AppendLogToFile) { int32_t ConsoleCommand_AppendLogToFile(const char* command, const char* arguments) {
WHOA_UNIMPLEMENTED(1); // TODO
return 1;
} }

View File

@ -1,6 +1,6 @@
#include "console/command/Commands.hpp" #include "console/Command.hpp"
#include "util/Unimplemented.hpp"
DECLARE_COMMAND(BackGroundColor) { int32_t ConsoleCommand_BackGroundColor(const char* command, const char* arguments) {
WHOA_UNIMPLEMENTED(1); // TODO
return 1;
} }

View File

@ -1,6 +1,6 @@
#include "console/command/Commands.hpp" #include "console/Command.hpp"
#include "util/Unimplemented.hpp"
DECLARE_COMMAND(BufferSize) { int32_t ConsoleCommand_BufferSize(const char* command, const char* arguments) {
WHOA_UNIMPLEMENTED(1); // TODO
return 1;
} }

View File

@ -1,6 +1,6 @@
#include "console/command/Commands.hpp" #include "console/Command.hpp"
#include "util/Unimplemented.hpp"
DECLARE_COMMAND(CharSpacing) { int32_t ConsoleCommand_CharSpacing(const char* command, const char* arguments) {
WHOA_UNIMPLEMENTED(1); // TODO
return 1;
} }

View File

@ -1,7 +1,7 @@
#include "console/Command.hpp"
#include "console/Console.hpp" #include "console/Console.hpp"
#include "console/command/Commands.hpp"
DECLARE_COMMAND(ClearConsole) { int32_t ConsoleCommand_ClearConsole(const char* command, const char* arguments) {
ConsoleClear(); ConsoleClear();
return 1; return 1;
} }

View File

@ -1,7 +1,7 @@
#include "console/Command.hpp"
#include "console/Console.hpp" #include "console/Console.hpp"
#include "console/command/Commands.hpp"
DECLARE_COMMAND(CloseConsole) { int32_t ConsoleCommand_CloseConsole(const char* command, const char* arguments) {
ConsoleSetActive(false); ConsoleSetActive(false);
return 1; return 1;
} }

View File

@ -1,6 +1,6 @@
#include "console/command/Commands.hpp" #include "console/Command.hpp"
#include "util/Unimplemented.hpp"
DECLARE_COMMAND(CurrentSettings) { int32_t ConsoleCommand_CurrentSettings(const char* command, const char* arguments) {
WHOA_UNIMPLEMENTED(1); // TODO
return 1;
} }

View File

@ -1,6 +1,6 @@
#include "console/command/Commands.hpp" #include "console/Command.hpp"
#include "util/Unimplemented.hpp"
DECLARE_COMMAND(DefaultSettings) { int32_t ConsoleCommand_DefaultSettings(const char* command, const char* arguments) {
WHOA_UNIMPLEMENTED(1); // TODO
return 1;
} }

View File

@ -1,6 +1,6 @@
#include "console/command/Commands.hpp" #include "console/Command.hpp"
#include "util/Unimplemented.hpp"
DECLARE_COMMAND(Font) { int32_t ConsoleCommand_Font(const char* command, const char* arguments) {
WHOA_UNIMPLEMENTED(1); // TODO
return 1;
} }

View File

@ -1,6 +1,6 @@
#include "console/command/Commands.hpp" #include "console/Command.hpp"
#include "util/Unimplemented.hpp"
DECLARE_COMMAND(FontColor) { int32_t ConsoleCommand_FontColor(const char* command, const char* arguments) {
WHOA_UNIMPLEMENTED(1); // TODO
return 1;
} }

View File

@ -1,6 +1,6 @@
#include "console/command/Commands.hpp" #include "console/Command.hpp"
#include "util/Unimplemented.hpp"
DECLARE_COMMAND(FontSize) { int32_t ConsoleCommand_FontSize(const char* command, const char* arguments) {
WHOA_UNIMPLEMENTED(1); // TODO
return 1;
} }

View File

@ -1,6 +1,5 @@
#include "console/Console.hpp"
#include "console/Command.hpp" #include "console/Command.hpp"
#include "console/command/Commands.hpp" #include "console/Line.hpp"
struct CategoryTranslation { struct CategoryTranslation {
CATEGORY categoryValue; CATEGORY categoryValue;
@ -8,18 +7,18 @@ struct CategoryTranslation {
}; };
CategoryTranslation s_translation[] = { CategoryTranslation s_translation[] = {
{ DEBUG, "debug" }, { DEBUG, "debug" },
{ GRAPHICS, "graphics" }, { GRAPHICS, "graphics" },
{ CONSOLE, "console" }, { CONSOLE, "console" },
{ COMBAT, "combat" }, { COMBAT, "combat" },
{ GAME, "game" }, { GAME, "game" },
{ DEFAULT, "default" }, { DEFAULT, "default" },
{ NET, "net" }, { NET, "net" },
{ SOUND, "sound" }, { SOUND, "sound" },
{ GM, "gm" } { GM, "gm" }
}; };
DECLARE_COMMAND(Help) { int32_t ConsoleCommand_Help(const char* command, const char* arguments) {
char buffer[128]; char buffer[128];
bool showCategories = *arguments == '\0'; bool showCategories = *arguments == '\0';
@ -43,72 +42,70 @@ DECLARE_COMMAND(Help) {
ConsoleWrite(buffer, WARNING_COLOR); ConsoleWrite(buffer, WARNING_COLOR);
ConsoleWrite("For more information type 'help [command] or [category]'", WARNING_COLOR); ConsoleWrite("For more information type 'help [command] or [category]'", WARNING_COLOR);
} else {
for (size_t i = 0; i < numTranslation; i++) {
auto& translation = s_translation[i];
return 1; if (SStrCmpI(translation.categoryString, arguments, STORM_MAX_STR) == 0) {
} if (translation.categoryValue != NONE) {
memset(buffer, 0, sizeof(buffer));
SStrPrintf(buffer, sizeof(buffer), "Commands registered for the category %s:", arguments);
for (size_t i = 0; i < numTranslation; i++) { ConsoleWrite(buffer, WARNING_COLOR);
auto& translation = s_translation[i];
if (SStrCmpI(translation.categoryString, arguments, STORM_MAX_STR) == 0) { buffer[0] = '\0';
if (translation.categoryValue != NONE) {
memset(buffer, 0, sizeof(buffer));
SStrPrintf(buffer, sizeof(buffer), "Commands registered for the category %s:", arguments);
ConsoleWrite(buffer, WARNING_COLOR); uint32_t counter = 0;
buffer[0] = '\0'; for (auto cmd = g_consoleCommandHash.Head(); cmd; cmd = g_consoleCommandHash.Next(cmd)) {
if (cmd->m_category == translation.categoryValue) {
SStrPack(buffer, cmd->m_key.m_str, sizeof(buffer));
SStrPack(buffer, ", ", sizeof(buffer));
uint32_t counter = 0; if (++counter == 8) {
ConsoleWrite(buffer, DEFAULT_COLOR);
for (auto cmd = g_consoleCommandHash.Head(); cmd; cmd = g_consoleCommandHash.Next(cmd)) { buffer[0] = '\0';
if (cmd->m_category == translation.categoryValue) { counter = 0;
SStrPack(buffer, cmd->m_key.m_str, sizeof(buffer)); }
SStrPack(buffer, ", ", sizeof(buffer));
if (++counter == 8) {
ConsoleWrite(buffer, DEFAULT_COLOR);
buffer[0] = '\0';
counter = 0;
} }
} }
}
const char* wr = nullptr; const char* wr = nullptr;
if (buffer[0]) { if (buffer[0]) {
auto comma = reinterpret_cast<char*>(SStrChrR(buffer, ',')); auto comma = reinterpret_cast<char*>(SStrChrR(buffer, ','));
if (comma) { if (comma) {
*comma = '\0'; *comma = 0x00;
}
wr = buffer;
} else {
wr = "NONE";
} }
wr = buffer; ConsoleWrite(wr, DEFAULT_COLOR);
} else { break;
wr = "NONE";
} }
ConsoleWrite(wr, DEFAULT_COLOR);
break;
} }
} }
auto cmd = g_consoleCommandHash.Ptr(arguments);
if (cmd == nullptr) {
return 1;
}
SStrPrintf(buffer, 0xa5, "Help for command %s:", arguments);
ConsoleWrite(buffer, WARNING_COLOR);
auto help = cmd->m_helpText;
if (help == nullptr) {
help = "No help yet";
}
SStrPrintf(buffer, 0xa5, " %s %s", arguments, help);
ConsoleWrite(buffer, DEFAULT_COLOR);
} }
auto cmd = g_consoleCommandHash.Ptr(arguments);
if (cmd == nullptr) {
return 1;
}
SStrPrintf(buffer, 0xA5, "Help for command %s:", arguments);
ConsoleWrite(buffer, WARNING_COLOR);
auto help = cmd->m_helpText;
if (help == nullptr) {
help = "No help yet";
}
SStrPrintf(buffer, 0xA5, " %s %s", arguments, help);
ConsoleWrite(buffer, DEFAULT_COLOR);
return 1; return 1;
} }

View File

@ -1,6 +1,6 @@
#include "console/command/Commands.hpp" #include "console/Command.hpp"
#include "util/Unimplemented.hpp"
DECLARE_COMMAND(HighLightColor) { int32_t ConsoleCommand_HighLightColor(const char* command, const char* arguments) {
WHOA_UNIMPLEMENTED(1); // TODO
return 1;
} }

View File

@ -1,6 +1,6 @@
#include "console/command/Commands.hpp" #include "console/Command.hpp"
#include "util/Unimplemented.hpp"
DECLARE_COMMAND(Proportional) { int32_t ConsoleCommand_Proportional(const char* command, const char* arguments) {
WHOA_UNIMPLEMENTED(1); // TODO
return 1;
} }

View File

@ -1,6 +1,7 @@
#include "console/command/Commands.hpp" #include "console/Command.hpp"
#include "util/Unimplemented.hpp" #include "console/Console.hpp"
DECLARE_COMMAND(RepeatHandler) { int32_t ConsoleCommand_RepeatHandler(const char* command, const char* arguments) {
WHOA_UNIMPLEMENTED(1); // TODO
return 1;
} }

View File

@ -1,21 +1,7 @@
#include "console/Console.hpp" #include "console/Command.hpp"
#include "console/command/Commands.hpp" #include "console/Line.hpp"
#if defined(NDEBUG)
#define WHOA_BUILD_TYPE "Release"
#else
#define WHOA_BUILD_TYPE "Debug"
#endif
#define WHOA_BRAND_STRING "Whoa"
#define WHOA_PROJECT_URL "https://github.com/thunderbrewhq/thunderbrew"
#define WHOA_VERSION_STRING WHOA_BRAND_STRING " [" WHOA_BUILD_TYPE "] Build " WHOA_VERSION_BUILD " (" __DATE__ ") <" WHOA_PROJECT_URL ">"
DECLARE_COMMAND(Ver) {
// ConsoleWrite("Thunderbrew <https://github.com/thunderbrewhq/thunderbrew>", ADMIN_COLOR);
ConsoleWrite(WHOA_VERSION_STRING, DEFAULT_COLOR);
int32_t ConsoleCommand_Ver(const char* command, const char* arguments) {
ConsoleWrite("Whoa <https://github.com/whoahq/whoa>", DEFAULT_COLOR);
return 1; return 1;
} }

View File

@ -1,16 +0,0 @@
#include "console/command/Commands.hpp"
#include "util/Unimplemented.hpp"
int32_t CCGxRestart(const char* command, const char* argument) {
// sub_512900();
// ValidateFormatMonitor(s_requestedFormat);
// if (!GxDevSetFormat(s_requestedFormat)) {
// ConsoleWrite("unable to set requested display mode", DEFAULT_COLOR);
// memcpy(&s_requestedFormat, &s_lastGoodFormat, sizeof(CGxFormat));
// if (!GxDevSetFormat())
// }
WHOA_UNIMPLEMENTED(1);
}

View File

@ -1,7 +1,7 @@
#include "console/Command.hpp"
#include "console/Console.hpp" #include "console/Console.hpp"
#include "console/command/Commands.hpp"
DECLARE_COMMAND(Quit) { int32_t ConsoleCommand_Quit(const char* command, const char* arguments) {
ConsolePostClose(); ConsolePostClose();
return 1; return 1;
} }

View File

@ -1,7 +1,5 @@
#include "console/Command.hpp" #include "console/Command.hpp"
#include "console/command/Commands.hpp"
#include "util/Unimplemented.hpp"
DECLARE_COMMAND(SetMap) { int32_t ConsoleCommand_SetMap(const char* command, const char* arguments) {
WHOA_UNIMPLEMENTED(1); return 1;
} }

View File

@ -1,641 +0,0 @@
#include "console/cvar/Gx.hpp"
#include "console/Gx.hpp"
#include "console/Console.hpp"
#include "console/Detect.hpp"
#include "console/Device.hpp"
#include "console/Types.hpp"
#include "gx/CGxFormat.hpp"
#include "gx/CGxMonitorMode.hpp"
#include "gx/Device.hpp"
#include "gx/Types.hpp"
#include "gx/Gx.hpp"
#include "os/Input.hpp"
#include "storm/String.hpp"
#include <storm/Array.hpp>
#include <cstdio>
CVar* s_cvGxStereoEnabled;
CVar* s_cvGxRefresh;
CVar* s_cvGxMaximize;
CVar* s_cvGxMultisample;
CVar* s_cvGxCursor;
CVar* s_cvGxStereoSeparation;
CVar* s_cvGxMultisampleQuality;
CVar* s_cvGxResolution;
CVar* s_cvGxOverride;
CVar* s_cvGxFixLag;
CVar* s_cvMaxFPS;
CVar* s_cvGxVSync;
CVar* s_cvVideoOptionsVersion;
CVar* s_cvGxStereoConvergence;
CVar* s_cvMaxFPSBk;
CVar* s_cvGxTripleBuffer;
CVar* s_cvGxDepthBits;
CVar* s_cvGxColorBits;
CVar* s_cvGxApi;
CVar* s_cvGxAspect;
CVar* s_cvFixedFunction;
CVar* s_cvWidescreen;
CVar* s_cvGxWindow;
CVar* s_cvWindowResizeLock;
static const char* formatToInt[CGxFormat::Formats_Last] = {
"16",
"24",
"24",
"30",
"16",
"24",
"24",
"32"
};
bool CVGxColorBitsCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
auto colorBits = SStrToInt(newValue);
switch (colorBits) {
case 16:
s_requestedFormat.colorFormat = CGxFormat::Fmt_Rgb565;
break;
case 24:
s_requestedFormat.colorFormat = CGxFormat::Fmt_ArgbX888;
break;
case 30:
s_requestedFormat.colorFormat = CGxFormat::Fmt_Argb2101010;
break;
default:
ConsoleWrite("Color bits must be 16, 24, or 30", DEFAULT_COLOR);
return false;
}
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
return true;
}
bool CVGxDepthBitsCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
auto depthBits = SStrToInt(newValue);
switch (depthBits) {
case 16:
s_requestedFormat.depthFormat = CGxFormat::Fmt_Ds160;
break;
case 24:
s_requestedFormat.depthFormat = CGxFormat::Fmt_Ds24X;
break;
case 32:
s_requestedFormat.depthFormat = CGxFormat::Fmt_Ds320;
break;
default:
ConsoleWrite("Depth bits must be 16, 24, or 32", DEFAULT_COLOR);
return false;
}
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
return true;
}
bool CVGxTripleBufferCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
auto tripleBuffer = SStrToInt(newValue);
if (tripleBuffer > 1) {
ConsoleWrite("TripleBuffer must be 0 or 1", DEFAULT_COLOR);
return false;
}
// TODO
// s_requestedFormat.unk1C = (tripleBuffer != 0) + 1;
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
return 1;
}
bool CVGxApiCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
for (EGxApi api = GxApi_OpenGl; api < GxApis_Last; api = static_cast<EGxApi>(static_cast<int32_t>(api) + 1)) {
if (GxApiSupported(api)) {
if (!SStrCmpI(newValue, g_gxApiNames[api], STORM_MAX_STR)) {
ConsoleWrite("GxApi set pending gxRestart", DEFAULT_COLOR);
return true;
}
}
}
// User supplied an unknown gxApi string
// display list of available gxApis
char message[1024];
SStrCopy(message, "unsupported api, must be one of ", sizeof(message));
uint32_t i = 0;
for (EGxApi api = GxApi_OpenGl; api < GxApis_Last; api = static_cast<EGxApi>(static_cast<int32_t>(api) + 1)) {
if (GxApiSupported(api)) {
if (i) {
SStrPack(message, ", ", sizeof(message));
}
SStrPack(message, "'", sizeof(message));
SStrPack(message, g_gxApiNames[api], sizeof(message));
SStrPack(message, "'", sizeof(message));
i++;
}
}
ConsoleWrite(message, DEFAULT_COLOR);
return false;
}
bool CVGxVSyncCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
s_requestedFormat.vsync = SStrToInt(newValue);
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
return true;
}
bool CVGxWindowCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
s_requestedFormat.window = SStrToInt(newValue) != 0;
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
return true;
}
bool CVGxAspectCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
s_requestedFormat.aspect = SStrToInt(newValue) != 0;
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
return true;
}
bool CVGxMaximizeCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
s_requestedFormat.maximize = SStrToInt(newValue) != 0;
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
return true;
}
bool CVGxCursorCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
s_requestedFormat.hwCursor = SStrToInt(newValue) != 0;
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
return true;
}
bool CVGxMultisampleCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
auto sampleCount = SStrToInt(newValue);
s_requestedFormat.sampleCount = std::max(1, std::min(sampleCount, 16));
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
return true;
}
bool CVGxMultisampleQualityCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
auto sampleQuality = SStrToFloat(newValue);
s_requestedFormat.sampleQuality = std::max(0.0f, std::min(sampleQuality, 1.0f));
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
return true;
}
bool CVGxFixLagCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
s_requestedFormat.fixLag = SStrToInt(newValue) != 0;
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
return true;
}
bool CVGxOverrideCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
ConsoleGxOverride(newValue);
return true;
}
bool CVGxMaxFPSCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
auto maxFPS = SStrToInt(newValue);
GxSetMaxFPS(std::max(8, maxFPS));
return true;
}
bool CVGxMaxFPSBkCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
auto maxFPSBk = SStrToInt(newValue);
GxSetMaxFPSBk(std::max(8, maxFPSBk));
return true;
}
bool CVGxWindowResizeLockCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
OsInputSetWindowResizeLock(SStrToInt(newValue));
return true;
}
bool CVGxStereoEnabledCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
s_requestedFormat.stereoEnabled = SStrToInt(newValue) == 1;
return true;
}
bool CVGxStereoConvergenceCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
GxStereoSetConvergence(SStrToFloat(newValue));
return true;
}
bool CVGxStereoSeparationCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
GxStereoSetSeparation(SStrToFloat(newValue));
return true;
}
bool CVGxResolutionCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
C2iVector size = { -1, -1 };
uint8_t x;
sscanf(newValue, "%d%c%d", &size.x, &x, &size.y);
if (s_requestedFormat.window) {
s_requestedFormat.size = size;
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
return true;
}
TSGrowableArray<C2iVector> resolutions;
ConsoleDetectGetResolutions(resolutions, s_cvWidescreen->GetInt());
uint32_t i;
for (i = 0; i < resolutions.Count(); i++) {
if (size.x == resolutions[i].x && size.y == resolutions[i].y) {
break;
}
}
char str[256];
char rez[16];
if (i == resolutions.Count()) {
SStrCopy(str, "invalid resolution, must be one of ", sizeof(str));
for (uint32_t i = 0; i < resolutions.Count(); i++) {
if (i) {
SStrPack(str, ", ", sizeof(str));
}
// flush line
if (SStrLen(str) > 100) {
ConsoleWrite(str, DEFAULT_COLOR);
*str = '\0';
}
SStrPrintf(rez, sizeof(rez), "%dx%d", resolutions[i].x, resolutions[i].y);
SStrPack(str, rez, sizeof(str));
}
ConsoleWrite(str, DEFAULT_COLOR);
return 0;
}
s_requestedFormat.size = size;
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
return true;
}
bool CVGxRefreshCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
auto refreshRate = SStrToUnsigned(newValue);
TSGrowableArray<CGxMonitorMode> modes;
GxAdapterMonitorModes(modes);
uint32_t i;
for (i = 0; i < modes.Count(); i++) {
if (modes[i].refreshRate == refreshRate) {
break;
}
}
if (i == modes.Count()) {
ConsoleWrite("Unsupported refresh rate", DEFAULT_COLOR);
return false;
}
s_requestedFormat.refreshRate = refreshRate;
ConsoleWrite("set pending gxRestart", DEFAULT_COLOR);
return true;
}
bool CVGxVideoOptionsVersionCallback(CVar* h, const char* oldValue, const char* newValue, void* arg) {
return true;
}
void RegisterGxCVars() {
auto format = s_defaults.format;
// TODO CURRENT_LANGUAGE check
auto v1 = true;
s_cvWidescreen = CVar::Register(
"widescreen",
"Allow widescreen support",
0,
"1",
nullptr,
GRAPHICS,
false,
nullptr,
false
);
s_cvGxWindow = CVar::Register(
"gxWindow",
"toggle fullscreen/window",
0x1 | 0x2,
v1 ? "1" : "0",
CVGxWindowCallback,
GRAPHICS,
false,
nullptr,
false
);
s_cvGxMaximize = CVar::Register(
"gxMaximize",
"maximize game window",
0x1 | 0x2,
v1 ? "1" : "0",
CVGxMaximizeCallback,
GRAPHICS,
false,
nullptr,
false
);
char colorBits[260];
SStrPrintf(colorBits, 260, "%s", formatToInt[format->colorFormat]);
s_cvGxColorBits = CVar::Register(
"gxColor",
"color bits",
0x1 | 0x2,
colorBits,
CVGxColorBitsCallback,
GRAPHICS,
false,
nullptr,
false
);
char depthBits[260];
SStrPrintf(depthBits, 260, "%s", formatToInt[format->depthFormat]);
s_cvGxDepthBits = CVar::Register(
"gxDepthBits",
"depth bits",
0x1 | 0x2,
colorBits,
CVGxDepthBitsCallback,
GRAPHICS,
false,
nullptr,
false);
char resolution[260];
SStrPrintf(resolution, 260, "%dx%d", format->size.x, format->size.y);
s_cvGxResolution = CVar::Register(
"gxResolution",
"resolution",
0x1 | 0x2,
resolution,
CVGxResolutionCallback,
GRAPHICS,
false,
nullptr,
false
);
s_cvGxRefresh = CVar::Register(
"gxRefresh",
"refresh rate",
0x1 | 0x2,
"75",
CVGxRefreshCallback,
GRAPHICS,
false,
nullptr,
false
);
s_cvGxTripleBuffer = CVar::Register(
"gxTripleBuffer",
"triple buffer",
0x1 | 0x2,
"0",
CVGxTripleBufferCallback,
GRAPHICS,
false,
nullptr,
false
);
s_cvGxApi = CVar::Register(
"gxApi",
"graphics api",
0x1 | 0x2,
g_gxApiNames[GxDefaultApi()],
CVGxApiCallback,
GRAPHICS,
false,
nullptr,
false
);
s_cvGxVSync = CVar::Register(
"gxVSync",
"vsync on or off",
0x1 | 0x2,
"1",
CVGxVSyncCallback,
GRAPHICS,
false,
nullptr,
false
);
s_cvGxAspect = CVar::Register(
"gxAspect",
"constrain window aspect",
0x1 | 0x2,
"1",
CVGxAspectCallback,
GRAPHICS,
false,
nullptr,
false
);
s_cvGxCursor = CVar::Register(
"gxCursor",
"toggle hardware cursor",
0x1 | 0x2,
"1",
CVGxCursorCallback,
GRAPHICS,
false,
nullptr,
false
);
char multisample[260];
SStrPrintf(multisample, 260, "%d", s_hardware.videoHw->m_multisample);
s_cvGxMultisample = CVar::Register(
"gxMultisample",
"multisample",
0x1 | 0x2,
multisample,
CVGxMultisampleCallback,
GRAPHICS,
false,
nullptr,
false
);
s_cvGxMultisampleQuality = CVar::Register(
"gxMultisampleQuality",
"multisample quality",
0x1 | 0x2,
"0.0",
CVGxMultisampleQualityCallback,
GRAPHICS,
false,
nullptr,
false
);
char fixLag[260];
SStrPrintf(fixLag, 260, "%d", s_hardware.videoHw->m_fixLag);
s_cvGxFixLag = CVar::Register(
"gxFixLag",
"prevent cursor lag",
0x1 | 0x2,
fixLag,
CVGxFixLagCallback,
GRAPHICS,
false,
nullptr,
false
);
s_cvGxStereoEnabled = CVar::Register(
"gxStereoEnabled",
"Enable stereoscopic rendering",
0x1,
"0",
CVGxStereoEnabledCallback,
GRAPHICS,
false,
nullptr,
false
);
s_cvGxOverride = CVar::Register(
"gxOverride",
"gx overrides",
0x1,
"",
CVGxOverrideCallback,
GRAPHICS,
false,
nullptr,
false
);
s_cvMaxFPS = CVar::Register(
"maxFPS",
"Set FPS limit",
0x1,
"200",
CVGxMaxFPSCallback,
GRAPHICS,
false,
nullptr,
false
);
s_cvMaxFPSBk = CVar::Register(
"maxFPSBk",
"Set background FPS limit",
0x1,
"30",
CVGxMaxFPSBkCallback,
GRAPHICS,
false,
nullptr,
false
);
s_cvVideoOptionsVersion = CVar::Register(
"videoOptionsVersion",
"Video options version",
0x1 | 0x2,
"0",
CVGxVideoOptionsVersionCallback,
GRAPHICS,
false,
nullptr,
false
);
s_cvWindowResizeLock = CVar::Register(
"windowResizeLock",
"prevent resizing in windowed mode",
0x1,
"0",
CVGxWindowResizeLockCallback,
GRAPHICS,
false,
nullptr,
false
);
s_cvFixedFunction = CVar::Register(
"fixedFunction",
"Force fixed function rendering",
0x1 | 0x2,
"0",
nullptr,
GRAPHICS,
false,
nullptr,
false
);
}
void UpdateGxCVars() {
s_cvGxColorBits->Update();
s_cvGxDepthBits->Update();
s_cvGxWindow->Update();
s_cvGxResolution->Update();
s_cvGxRefresh->Update();
s_cvGxTripleBuffer->Update();
s_cvGxApi->Update();
s_cvGxVSync->Update();
s_cvGxAspect->Update();
s_cvGxMaximize->Update();
s_cvGxCursor->Update();
s_cvGxMultisample->Update();
s_cvGxMultisampleQuality->Update();
s_cvGxFixLag->Update();
}
void SetGxCVars(const CGxFormat& format) {
char value[1024];
s_cvGxColorBits->Set(formatToInt[format.colorFormat], true, false, false, true);
s_cvGxDepthBits->Set(formatToInt[format.depthFormat], true, false, false, true);
SStrPrintf(value, 1024, "%d", format.window);
s_cvGxWindow->Set(value, true, false, false, true);
SStrPrintf(value, 1024, "%dx%d", format.size.x, format.size.y);
s_cvGxResolution->Set(value, true, false, false, true);
SStrPrintf(value, 1024, "%d", format.refreshRate);
s_cvGxRefresh->Set(value, true, false, false, true);
s_cvGxTripleBuffer->Set(format.backbuffers > 1 ? "1" : "0", true, false, false, true);
SStrPrintf(value, 1024, "%d", format.vsync);
s_cvGxVSync->Set(value, true, false, false, true);
SStrPrintf(value, 1024, "%d", format.aspect);
s_cvGxAspect->Set(value, true, false, false, true);
SStrPrintf(value, 1024, "%d", format.maximize);
s_cvGxMaximize->Set(value, true, false, false, true);
SStrPrintf(value, 1024, "%d", format.hwCursor);
s_cvGxCursor->Set(value, true, false, false, true);
SStrPrintf(value, 1024, "%d", format.sampleCount);
s_cvGxMultisample->Set(value, true, false, false, true);
SStrPrintf(value, 1024, "%f", format.sampleQuality);
s_cvGxMultisampleQuality->Set(value, true, false, false, true);
SStrPrintf(value, 1024, "%d", format.fixLag);
s_cvGxFixLag->Set(value, true, false, false, true);
UpdateGxCVars();
}

View File

@ -1,43 +0,0 @@
#ifndef CONSOLE_C_VAR_GX_HPP
#define CONSOLE_C_VAR_GX_HPP
#include "gx/CGxFormat.hpp"
#include "console/CVar.hpp"
extern CVar* s_cvGxStereoEnabled;
extern CVar* s_cvGxRefresh;
extern CVar* s_cvGxMaximize;
extern CVar* s_cvGxMultisample;
extern CVar* s_cvGxCursor;
extern CVar* s_cvGxStereoSeparation;
extern CVar* s_cvGxMultisampleQuality;
extern CVar* s_cvGxResolution;
extern CVar* s_cvHwDetect;
extern CVar* s_cvGxOverride;
extern CVar* s_cvGxFixLag;
extern CVar* s_cvMaxFPS;
extern CVar* s_cvGxVSync;
extern CVar* s_cvVideoOptionsVersion;
extern CVar* s_cvGxStereoConvergence;
extern CVar* s_cvMaxFPSBk;
extern CVar* s_cvGxTripleBuffer;
extern CVar* s_cvGxDepthBits;
extern CVar* s_cvGxColorBits;
extern CVar* s_cvGxApi;
extern CVar* s_cvGxAspect;
extern CVar* s_cvFixedFunction;
extern CVar* s_cvWidescreen;
extern CVar* s_cvGxWindow;
extern CVar* s_cvWindowResizeLock;
void RegisterGxCVars();
void UpdateGxCVars();
void SetGxCVars(const CGxFormat& format);
bool CVGxStereoConvergenceCallback(CVar* h, const char* oldValue, const char* newValue, void* arg);
bool CVGxStereoSeparationCallback(CVar* h, const char* oldValue, const char* newValue, void* arg);
#endif

View File

@ -1,11 +1,7 @@
#include "db/Db.hpp" #include "db/Db.hpp"
#include "db/WowClientDB_Base.hpp"
#include <cstdio>
void LoadDB(WowClientDB_Base* db, const char* filename, int32_t linenumber) { void LoadDB(WowClientDB_Base* db, const char* filename, int32_t linenumber) {
db->Load(filename, linenumber); db->Load(filename, linenumber);
printf("load %s:%d\n", filename, linenumber);
}; };
void ClientDBInitialize() { void ClientDBInitialize() {

View File

@ -1,9 +1,7 @@
#ifndef DB_DB_HPP #ifndef DB_DB_HPP
#define DB_DB_HPP #define DB_DB_HPP
#include "db/WowClientDB.hpp"
#include "db/StaticDb.hpp" #include "db/StaticDb.hpp"
#include "db/Locale.hpp"
void ClientDBInitialize(); void ClientDBInitialize();

View File

@ -1,3 +0,0 @@
#include "db/Locale.hpp"
WOW_LOCALE CURRENT_LANGUAGE = DEFAULT_LANGUAGE;

View File

@ -1,20 +0,0 @@
#ifndef DB_LOCALE_HPP
#define DB_LOCALE_HPP
enum WOW_LOCALE {
LOCALE_en_US = 0,
LOCALE_ko_KR = 1,
LOCALE_fr_FR = 2,
LOCALE_de_DE = 3,
LOCALE_zh_CN = 4,
LOCALE_zh_TW = 5,
LOCALE_es_ES = 6,
LOCALE_es_MX = 7,
LOCALE_ru_RU = 8,
NUM_LOCALES = 9,
DEFAULT_LANGUAGE = 0,
};
extern WOW_LOCALE CURRENT_LANGUAGE;
#endif

View File

@ -1,3 +0,0 @@
#include "db/Startup_Strings.hpp"
WowClientDB<Startup_StringsRec> g_Startup_StringsDB;

View File

@ -1,19 +0,0 @@
#ifndef DB_MESSAGE_HPP
#define DB_MESSAGE_HPP
#include "db/WowClientDB.hpp"
#include "db/rec/Startup_StringsRec.hpp"
#define MSG_TITLE_WOW 1
#define MSG_GX_INIT_FAILED_D3D 2
#define MSG_GX_INIT_FAILED 3
#define MSG_HW_UNSUPPORTED 4
#define MSG_HW_CHANGED 5
#define MSG_GLUEXML_UI_CORRUPT 9
#define MSG_FRAMEXML_UI_CORRUPT 10
#define MSG_GX_NO_DEVICE 11
#define MSG_REMOTE_DESKTOP 12
extern WowClientDB<Startup_StringsRec> g_Startup_StringsDB;
#endif

View File

@ -2,28 +2,42 @@
#include "db/StaticDb.hpp" #include "db/StaticDb.hpp"
WowClientDB<AchievementRec> g_achievementDB; WowClientDB<AchievementRec> g_achievementDB;
WowClientDB<Achievement_CriteriaRec> g_achievement_CriteriaDB;
WowClientDB<Achievement_CategoryRec> g_achievement_CategoryDB; WowClientDB<Achievement_CategoryRec> g_achievement_CategoryDB;
WowClientDB<Achievement_CriteriaRec> g_achievement_CriteriaDB;
WowClientDB<AnimKitRec> g_animKitDB;
WowClientDB<AnimKitBoneSetRec> g_animKitBoneSetDB;
WowClientDB<AnimKitBoneSetAliasRec> g_animKitBoneSetAliasDB;
WowClientDB<AnimKitConfigRec> g_animKitConfigDB;
WowClientDB<AnimKitConfigBoneSetRec> g_animKitConfigBoneSetDB;
WowClientDB<AnimKitPriorityRec> g_animKitPriorityDB;
WowClientDB<AnimKitSegmentRec> g_animKitSegmentDB;
WowClientDB<AnimReplacementRec> g_animReplacementDB;
WowClientDB<AnimReplacementSetRec> g_animReplacementSetDB;
WowClientDB<AnimationDataRec> g_animationDataDB; WowClientDB<AnimationDataRec> g_animationDataDB;
WowClientDB<AreaAssignmentRec> g_areaAssignmentDB;
WowClientDB<AreaGroupRec> g_areaGroupDB; WowClientDB<AreaGroupRec> g_areaGroupDB;
WowClientDB<AreaPOIRec> g_areaPOIDB; WowClientDB<AreaPOIRec> g_areaPOIDB;
WowClientDB<AreaTableRec> g_areaTableDB; WowClientDB<AreaTableRec> g_areaTableDB;
WowClientDB<AreaTriggerRec> g_areaTriggerDB; WowClientDB<AreaTriggerRec> g_areaTriggerDB;
WowClientDB<ArmorLocationRec> g_armorLocationDB;
WowClientDB<AttackAnimKitsRec> g_attackAnimKitsDB; WowClientDB<AttackAnimKitsRec> g_attackAnimKitsDB;
WowClientDB<AttackAnimTypesRec> g_attackAnimTypesDB; WowClientDB<AttackAnimTypesRec> g_attackAnimTypesDB;
WowClientDB<AuctionHouseRec> g_auctionHouseDB; WowClientDB<AuctionHouseRec> g_auctionHouseDB;
WowClientDB<BankBagSlotPricesRec> g_bankBagSlotPricesDB; WowClientDB<BankBagSlotPricesRec> g_bankBagSlotPricesDB;
WowClientDB<BannedAddOnsRec> g_bannedAddOnsDB; WowClientDB<BannedAddonsRec> g_bannedAddonsDB;
WowClientDB<BarberShopStyleRec> g_barberShopStyleDB; WowClientDB<BarberShopStyleRec> g_barberShopStyleDB;
WowClientDB<BattlemasterListRec> g_battlemasterListDB; WowClientDB<BattlemasterListRec> g_battlemasterListDB;
WowClientDB<CameraModeRec> g_cameraModeDB;
WowClientDB<CameraShakesRec> g_cameraShakesDB; WowClientDB<CameraShakesRec> g_cameraShakesDB;
WowClientDB<Cfg_CategoriesRec> g_cfg_CategoriesDB; WowClientDB<Cfg_CategoriesRec> g_cfg_CategoriesDB;
WowClientDB<Cfg_ConfigsRec> g_cfg_ConfigsDB; WowClientDB<Cfg_ConfigsRec> g_cfg_ConfigsDB;
WowClientDB<CharBaseInfoRec> g_charBaseInfoDB; WowClientDB<CharBaseInfoRec> g_charBaseInfoDB;
WowClientDB<CharHairGeosetsRec> g_charHairGeosetsDB; WowClientDB<CharHairGeosetsRec> g_charHairGeosetsDB;
WowClientDB<CharHairTexturesRec> g_charHairTexturesDB;
WowClientDB<CharSectionsRec> g_charSectionsDB; WowClientDB<CharSectionsRec> g_charSectionsDB;
WowClientDB<CharStartOutfitRec> g_charStartOutfitDB; WowClientDB<CharStartOutfitRec> g_charStartOutfitDB;
WowClientDB<CharTitlesRec> g_charTitlesDB; WowClientDB<CharTitlesRec> g_charTitlesDB;
WowClientDB<CharVariationsRec> g_charVariationsDB;
WowClientDB<CharacterFacialHairStylesRec> g_characterFacialHairStylesDB; WowClientDB<CharacterFacialHairStylesRec> g_characterFacialHairStylesDB;
WowClientDB<ChatChannelsRec> g_chatChannelsDB; WowClientDB<ChatChannelsRec> g_chatChannelsDB;
WowClientDB<ChatProfanityRec> g_chatProfanityDB; WowClientDB<ChatProfanityRec> g_chatProfanityDB;
@ -39,10 +53,12 @@ WowClientDB<CreatureMovementInfoRec> g_creatureMovementInfoDB;
WowClientDB<CreatureSoundDataRec> g_creatureSoundDataDB; WowClientDB<CreatureSoundDataRec> g_creatureSoundDataDB;
WowClientDB<CreatureSpellDataRec> g_creatureSpellDataDB; WowClientDB<CreatureSpellDataRec> g_creatureSpellDataDB;
WowClientDB<CreatureTypeRec> g_creatureTypeDB; WowClientDB<CreatureTypeRec> g_creatureTypeDB;
WowClientDB<CurrencyTypesRec> g_currencyTypesDB;
WowClientDB<CurrencyCategoryRec> g_currencyCategoryDB; WowClientDB<CurrencyCategoryRec> g_currencyCategoryDB;
WowClientDB<CurrencyTypesRec> g_currencyTypesDB;
WowClientDB<DanceMovesRec> g_danceMovesDB; WowClientDB<DanceMovesRec> g_danceMovesDB;
WowClientDB<DeathThudLookupsRec> g_deathThudLookupsDB; WowClientDB<DeathThudLookupsRec> g_deathThudLookupsDB;
WowClientDB<DeclinedWordRec> g_declinedWordDB;
WowClientDB<DeclinedWordCasesRec> g_declinedWordCasesDB;
WowClientDB<DestructibleModelDataRec> g_destructibleModelDataDB; WowClientDB<DestructibleModelDataRec> g_destructibleModelDataDB;
WowClientDB<DungeonEncounterRec> g_dungeonEncounterDB; WowClientDB<DungeonEncounterRec> g_dungeonEncounterDB;
WowClientDB<DungeonMapRec> g_dungeonMapDB; WowClientDB<DungeonMapRec> g_dungeonMapDB;
@ -61,40 +77,41 @@ WowClientDB<FactionTemplateRec> g_factionTemplateDB;
WowClientDB<FileDataRec> g_fileDataDB; WowClientDB<FileDataRec> g_fileDataDB;
WowClientDB<FootprintTexturesRec> g_footprintTexturesDB; WowClientDB<FootprintTexturesRec> g_footprintTexturesDB;
WowClientDB<FootstepTerrainLookupRec> g_footstepTerrainLookupDB; WowClientDB<FootstepTerrainLookupRec> g_footstepTerrainLookupDB;
WowClientDB<GameObjectArtKitRec> g_gameObjectArtKitDB;
WowClientDB<GameObjectDisplayInfoRec> g_gameObjectDisplayInfoDB;
WowClientDB<GameTablesRec> g_gameTablesDB;
WowClientDB<GameTipsRec> g_gameTipsDB;
WowClientDB<GemPropertiesRec> g_gemPropertiesDB;
WowClientDB<GlyphPropertiesRec> g_glyphPropertiesDB;
WowClientDB<GlyphSlotRec> g_glyphSlotDB;
WowClientDB<GMSurveyAnswersRec> g_gMSurveyAnswersDB; WowClientDB<GMSurveyAnswersRec> g_gMSurveyAnswersDB;
WowClientDB<GMSurveyCurrentSurveyRec> g_gMSurveyCurrentSurveyDB; WowClientDB<GMSurveyCurrentSurveyRec> g_gMSurveyCurrentSurveyDB;
WowClientDB<GMSurveyQuestionsRec> g_gMSurveyQuestionsDB; WowClientDB<GMSurveyQuestionsRec> g_gMSurveyQuestionsDB;
WowClientDB<GMSurveySurveysRec> g_gMSurveySurveysDB; WowClientDB<GMSurveySurveysRec> g_gMSurveySurveysDB;
WowClientDB<GMTicketCategoryRec> g_gMTicketCategoryDB; WowClientDB<GMTicketCategoryRec> g_gMTicketCategoryDB;
WowClientDB<GameObjectArtKitRec> g_gameObjectArtKitDB;
WowClientDB<GameObjectDisplayInfoRec> g_gameObjectDisplayInfoDB;
WowClientDB<GameTablesRec> g_gameTablesDB;
WowClientDB<GameTipsRec> g_gameTipsDB;
WowClientDB<GemPropertiesRec> g_gemPropertiesDB;
WowClientDB<GlueScreenEmoteRec> g_glueScreenEmoteDB;
WowClientDB<GlyphPropertiesRec> g_glyphPropertiesDB;
WowClientDB<GlyphSlotRec> g_glyphSlotDB;
WowClientDB<GroundEffectDoodadRec> g_groundEffectDoodadDB; WowClientDB<GroundEffectDoodadRec> g_groundEffectDoodadDB;
WowClientDB<GroundEffectTextureRec> g_groundEffectTextureDB; WowClientDB<GroundEffectTextureRec> g_groundEffectTextureDB;
WowClientDB<gtBarberShopCostBaseRec> g_gtBarberShopCostBaseDB; WowClientDB<GuildPerkSpellsRec> g_guildPerkSpellsDB;
WowClientDB<gtCombatRatingsRec> g_gtCombatRatingsDB;
WowClientDB<gtChanceToMeleeCritRec> g_gtChanceToMeleeCritDB;
WowClientDB<gtChanceToMeleeCritBaseRec> g_gtChanceToMeleeCritBaseDB;
WowClientDB<gtChanceToSpellCritRec> g_gtChanceToSpellCritDB;
WowClientDB<gtChanceToSpellCritBaseRec> g_gtChanceToSpellCritBaseDB;
WowClientDB<gtNPCManaCostScalerRec> g_gtNPCManaCostScalerDB;
WowClientDB<gtOCTClassCombatRatingScalarRec> g_gtOCTClassCombatRatingScalarDB;
WowClientDB<gtOCTRegenHPRec> g_gtOCTRegenHPDB;
WowClientDB<gtOCTRegenMPRec> g_gtOCTRegenMPDB;
WowClientDB<gtRegenHPPerSptRec> g_gtRegenHPPerSptDB;
WowClientDB<gtRegenMPPerSptRec> g_gtRegenMPPerSptDB;
WowClientDB<HelmetGeosetVisDataRec> g_helmetGeosetVisDataDB; WowClientDB<HelmetGeosetVisDataRec> g_helmetGeosetVisDataDB;
WowClientDB<HolidayDescriptionsRec> g_holidayDescriptionsDB; WowClientDB<HolidayDescriptionsRec> g_holidayDescriptionsDB;
WowClientDB<HolidayNamesRec> g_holidayNamesDB; WowClientDB<HolidayNamesRec> g_holidayNamesDB;
WowClientDB<HolidaysRec> g_holidaysDB; WowClientDB<HolidaysRec> g_holidaysDB;
WowClientDB<ItemRec> g_itemDB; WowClientDB<ItemRec> g_itemDB;
WowClientDB<ItemArmorQualityRec> g_itemArmorQualityDB;
WowClientDB<ItemArmorShieldRec> g_itemArmorShieldDB;
WowClientDB<ItemArmorTotalRec> g_itemArmorTotalDB;
WowClientDB<ItemBagFamilyRec> g_itemBagFamilyDB; WowClientDB<ItemBagFamilyRec> g_itemBagFamilyDB;
WowClientDB<ItemClassRec> g_itemClassDB; WowClientDB<ItemClassRec> g_itemClassDB;
WowClientDB<ItemCondExtCostsRec> g_itemCondExtCostsDB; WowClientDB<ItemCondExtCostsRec> g_itemCondExtCostsDB;
WowClientDB<ItemDamageAmmoRec> g_itemDamageAmmoDB;
WowClientDB<ItemDamageOneHandRec> g_itemDamageOneHandDB;
WowClientDB<ItemDamageOneHandCasterRec> g_itemDamageOneHandCasterDB;
WowClientDB<ItemDamageRangedRec> g_itemDamageRangedDB;
WowClientDB<ItemDamageThrownRec> g_itemDamageThrownDB;
WowClientDB<ItemDamageTwoHandRec> g_itemDamageTwoHandDB;
WowClientDB<ItemDamageTwoHandCasterRec> g_itemDamageTwoHandCasterDB;
WowClientDB<ItemDamageWandRec> g_itemDamageWandDB;
WowClientDB<ItemDisplayInfoRec> g_itemDisplayInfoDB; WowClientDB<ItemDisplayInfoRec> g_itemDisplayInfoDB;
WowClientDB<ItemExtendedCostRec> g_itemExtendedCostDB; WowClientDB<ItemExtendedCostRec> g_itemExtendedCostDB;
WowClientDB<ItemGroupSoundsRec> g_itemGroupSoundsDB; WowClientDB<ItemGroupSoundsRec> g_itemGroupSoundsDB;
@ -103,96 +120,130 @@ WowClientDB<ItemPetFoodRec> g_itemPetFoodDB;
WowClientDB<ItemPurchaseGroupRec> g_itemPurchaseGroupDB; WowClientDB<ItemPurchaseGroupRec> g_itemPurchaseGroupDB;
WowClientDB<ItemRandomPropertiesRec> g_itemRandomPropertiesDB; WowClientDB<ItemRandomPropertiesRec> g_itemRandomPropertiesDB;
WowClientDB<ItemRandomSuffixRec> g_itemRandomSuffixDB; WowClientDB<ItemRandomSuffixRec> g_itemRandomSuffixDB;
WowClientDB<ItemReforgeRec> g_itemReforgeDB;
WowClientDB<ItemSetRec> g_itemSetDB; WowClientDB<ItemSetRec> g_itemSetDB;
WowClientDB<ItemSubClassRec> g_itemSubClassDB; WowClientDB<ItemSubClassRec> g_itemSubClassDB;
WowClientDB<ItemSubClassMaskRec> g_itemSubClassMaskDB; WowClientDB<ItemSubClassMaskRec> g_itemSubClassMaskDB;
WowClientDB<ItemVisualEffectsRec> g_itemVisualEffectsDB; WowClientDB<ItemVisualEffectsRec> g_itemVisualEffectsDB;
WowClientDB<ItemVisualsRec> g_itemVisualsDB; WowClientDB<ItemVisualsRec> g_itemVisualsDB;
WowClientDB<LFGDungeonExpansionRec> g_lFGDungeonExpansionDB;
WowClientDB<LFGDungeonGroupRec> g_lFGDungeonGroupDB;
WowClientDB<LFGDungeonsRec> g_lFGDungeonsDB;
WowClientDB<LanguageWordsRec> g_languageWordsDB; WowClientDB<LanguageWordsRec> g_languageWordsDB;
WowClientDB<LanguagesRec> g_languagesDB; WowClientDB<LanguagesRec> g_languagesDB;
WowClientDB<LfgDungeonExpansionRec> g_lfgDungeonExpansionDB;
WowClientDB<LfgDungeonGroupRec> g_lfgDungeonGroupDB;
WowClientDB<LfgDungeonsRec> g_lfgDungeonsDB;
WowClientDB<LightRec> g_lightDB; WowClientDB<LightRec> g_lightDB;
WowClientDB<LightFloatBandRec> g_lightFloatBandDB; WowClientDB<LightFloatBandRec> g_lightFloatBandDB;
WowClientDB<LightIntBandRec> g_lightIntBandDB; WowClientDB<LightIntBandRec> g_lightIntBandDB;
WowClientDB<LightParamsRec> g_lightParamsDB; WowClientDB<LightParamsRec> g_lightParamsDB;
WowClientDB<LightSkyboxRec> g_lightSkyboxDB; WowClientDB<LightSkyboxRec> g_lightSkyboxDB;
WowClientDB<LiquidTypeRec> g_liquidTypeDB;
WowClientDB<LiquidMaterialRec> g_liquidMaterialDB; WowClientDB<LiquidMaterialRec> g_liquidMaterialDB;
WowClientDB<LoadingScreensRec> g_loadingScreensDB; WowClientDB<LiquidObjectRec> g_liquidObjectDB;
WowClientDB<LiquidTypeRec> g_liquidTypeDB;
WowClientDB<LoadingScreenTaxiSplinesRec> g_loadingScreenTaxiSplinesDB; WowClientDB<LoadingScreenTaxiSplinesRec> g_loadingScreenTaxiSplinesDB;
WowClientDB<LoadingScreensRec> g_loadingScreensDB;
WowClientDB<LockRec> g_lockDB; WowClientDB<LockRec> g_lockDB;
WowClientDB<LockTypeRec> g_lockTypeDB; WowClientDB<LockTypeRec> g_lockTypeDB;
WowClientDB<MailTemplateRec> g_mailTemplateDB; WowClientDB<MailTemplateRec> g_mailTemplateDB;
WowClientDB<MapRec> g_mapDB; WowClientDB<MapRec> g_mapDB;
WowClientDB<MapDifficultyRec> g_mapDifficultyDB; WowClientDB<MapDifficultyRec> g_mapDifficultyDB;
WowClientDB<MaterialRec> g_materialDB; WowClientDB<MaterialRec> g_materialDB;
WowClientDB<MountTypeRec> g_mountTypeDB;
WowClientDB<MovieRec> g_movieDB; WowClientDB<MovieRec> g_movieDB;
WowClientDB<MovieFileDataRec> g_movieFileDataDB; WowClientDB<MovieFileDataRec> g_movieFileDataDB;
WowClientDB<MovieVariationRec> g_movieVariationDB; WowClientDB<MovieVariationRec> g_movieVariationDB;
WowClientDB<NameGenRec> g_nameGenDB;
WowClientDB<NPCSoundsRec> g_nPCSoundsDB; WowClientDB<NPCSoundsRec> g_nPCSoundsDB;
WowClientDB<NameGenRec> g_nameGenDB;
WowClientDB<NamesProfanityRec> g_namesProfanityDB; WowClientDB<NamesProfanityRec> g_namesProfanityDB;
WowClientDB<NamesReservedRec> g_namesReservedDB; WowClientDB<NamesReservedRec> g_namesReservedDB;
WowClientDB<ObjectEffectRec> g_objectEffectDB;
WowClientDB<ObjectEffectGroupRec> g_objectEffectGroupDB;
WowClientDB<ObjectEffectModifierRec> g_objectEffectModifierDB;
WowClientDB<ObjectEffectPackageRec> g_objectEffectPackageDB;
WowClientDB<ObjectEffectPackageElemRec> g_objectEffectPackageElemDB;
WowClientDB<OverrideSpellDataRec> g_overrideSpellDataDB; WowClientDB<OverrideSpellDataRec> g_overrideSpellDataDB;
WowClientDB<PVPDifficultyRec> g_pVPDifficultyDB;
WowClientDB<PackageRec> g_packageDB; WowClientDB<PackageRec> g_packageDB;
WowClientDB<PageTextMaterialRec> g_pageTextMaterialDB; WowClientDB<PageTextMaterialRec> g_pageTextMaterialDB;
WowClientDB<PaperDollItemFrameRec> g_paperDollItemFrameDB; WowClientDB<PaperDollItemFrameRec> g_paperDollItemFrameDB;
WowClientDB<ParticleColorRec> g_particleColorDB; WowClientDB<ParticleColorRec> g_particleColorDB;
WowClientDB<PetPersonalityRec> g_petPersonalityDB; WowClientDB<PetPersonalityRec> g_petPersonalityDB;
WowClientDB<PetitionTypeRec> g_petitionTypeDB;
WowClientDB<PhaseRec> g_phaseDB;
WowClientDB<PhaseShiftZoneSoundsRec> g_phaseShiftZoneSoundsDB;
WowClientDB<PhaseXPhaseGroupRec> g_phaseXPhaseGroupDB;
WowClientDB<PowerDisplayRec> g_powerDisplayDB; WowClientDB<PowerDisplayRec> g_powerDisplayDB;
WowClientDB<PvpDifficultyRec> g_pvpDifficultyDB;
WowClientDB<QuestFactionRewardRec> g_questFactionRewardDB; WowClientDB<QuestFactionRewardRec> g_questFactionRewardDB;
WowClientDB<QuestInfoRec> g_questInfoDB; WowClientDB<QuestInfoRec> g_questInfoDB;
WowClientDB<QuestSortRec> g_questSortDB; WowClientDB<QuestSortRec> g_questSortDB;
WowClientDB<QuestXPRec> g_questXPDB; WowClientDB<QuestXPRec> g_questXPDB;
WowClientDB<ResistancesRec> g_resistancesDB;
WowClientDB<RandPropPointsRec> g_randPropPointsDB; WowClientDB<RandPropPointsRec> g_randPropPointsDB;
WowClientDB<ResearchBranchRec> g_researchBranchDB;
WowClientDB<ResistancesRec> g_resistancesDB;
WowClientDB<ScalingStatDistributionRec> g_scalingStatDistributionDB; WowClientDB<ScalingStatDistributionRec> g_scalingStatDistributionDB;
WowClientDB<ScalingStatValuesRec> g_scalingStatValuesDB; WowClientDB<ScalingStatValuesRec> g_scalingStatValuesDB;
WowClientDB<ScreenEffectRec> g_screenEffectDB; WowClientDB<ScreenEffectRec> g_screenEffectDB;
WowClientDB<ServerMessagesRec> g_serverMessagesDB; WowClientDB<ServerMessagesRec> g_serverMessagesDB;
WowClientDB<SheatheSoundLookupsRec> g_sheatheSoundLookupsDB; WowClientDB<SheatheSoundLookupsRec> g_sheatheSoundLookupsDB;
WowClientDB<SkillCostsDataRec> g_skillCostsDataDB; WowClientDB<SkillCostsDataRec> g_skillCostsDataDB;
WowClientDB<SkillLineRec> g_skillLineDB;
WowClientDB<SkillLineAbilityRec> g_skillLineAbilityDB; WowClientDB<SkillLineAbilityRec> g_skillLineAbilityDB;
WowClientDB<SkillLineCategoryRec> g_skillLineCategoryDB; WowClientDB<SkillLineCategoryRec> g_skillLineCategoryDB;
WowClientDB<SkillLineRec> g_skillLineDB;
WowClientDB<SkillRaceClassInfoRec> g_skillRaceClassInfoDB; WowClientDB<SkillRaceClassInfoRec> g_skillRaceClassInfoDB;
WowClientDB<SkillTiersRec> g_skillTiersDB; WowClientDB<SkillTiersRec> g_skillTiersDB;
WowClientDB<SoundAmbienceRec> g_soundAmbienceDB; WowClientDB<SoundAmbienceRec> g_soundAmbienceDB;
WowClientDB<SoundEmittersRec> g_soundEmittersDB; WowClientDB<SoundEmittersRec> g_soundEmittersDB;
WowClientDB<SoundEntriesRec> g_soundEntriesDB; WowClientDB<SoundEntriesRec> g_soundEntriesDB;
WowClientDB<SoundEntriesAdvancedRec> g_soundEntriesAdvancedDB;
WowClientDB<SoundFilterRec> g_soundFilterDB;
WowClientDB<SoundFilterElemRec> g_soundFilterElemDB;
WowClientDB<SoundProviderPreferencesRec> g_soundProviderPreferencesDB; WowClientDB<SoundProviderPreferencesRec> g_soundProviderPreferencesDB;
WowClientDB<SoundSamplePreferencesRec> g_soundSamplePreferencesDB; WowClientDB<SoundSamplePreferencesRec> g_soundSamplePreferencesDB;
WowClientDB<SoundWaterTypeRec> g_soundWaterTypeDB; WowClientDB<SoundWaterTypeRec> g_soundWaterTypeDB;
WowClientDB<SpamMessagesRec> g_spamMessagesDB; WowClientDB<SpamMessagesRec> g_spamMessagesDB;
WowClientDB<SpellRec> g_spellDB;
WowClientDB<SpellAuraOptionsRec> g_spellAuraOptionsDB;
WowClientDB<SpellAuraRestrictionsRec> g_spellAuraRestrictionsDB;
WowClientDB<SpellCastTimesRec> g_spellCastTimesDB; WowClientDB<SpellCastTimesRec> g_spellCastTimesDB;
WowClientDB<SpellCastingRequirementsRec> g_spellCastingRequirementsDB;
WowClientDB<SpellCategoriesRec> g_spellCategoriesDB;
WowClientDB<SpellCategoryRec> g_spellCategoryDB; WowClientDB<SpellCategoryRec> g_spellCategoryDB;
WowClientDB<SpellChainEffectsRec> g_spellChainEffectsDB; WowClientDB<SpellChainEffectsRec> g_spellChainEffectsDB;
WowClientDB<SpellRec> g_spellDB; WowClientDB<SpellClassOptionsRec> g_spellClassOptionsDB;
WowClientDB<SpellCooldownsRec> g_spellCooldownsDB;
WowClientDB<SpellDescriptionVariablesRec> g_spellDescriptionVariablesDB; WowClientDB<SpellDescriptionVariablesRec> g_spellDescriptionVariablesDB;
WowClientDB<SpellDifficultyRec> g_spellDifficultyDB; WowClientDB<SpellDifficultyRec> g_spellDifficultyDB;
WowClientDB<SpellDispelTypeRec> g_spellDispelTypeDB; WowClientDB<SpellDispelTypeRec> g_spellDispelTypeDB;
WowClientDB<SpellDurationRec> g_spellDurationDB; WowClientDB<SpellDurationRec> g_spellDurationDB;
WowClientDB<SpellEffectRec> g_spellEffectDB;
WowClientDB<SpellEffectCameraShakesRec> g_spellEffectCameraShakesDB; WowClientDB<SpellEffectCameraShakesRec> g_spellEffectCameraShakesDB;
WowClientDB<SpellEquippedItemsRec> g_spellEquippedItemsDB;
WowClientDB<SpellFocusObjectRec> g_spellFocusObjectDB; WowClientDB<SpellFocusObjectRec> g_spellFocusObjectDB;
WowClientDB<SpellIconRec> g_spellIconDB; WowClientDB<SpellIconRec> g_spellIconDB;
WowClientDB<SpellInterruptsRec> g_spellInterruptsDB;
WowClientDB<SpellItemEnchantmentRec> g_spellItemEnchantmentDB; WowClientDB<SpellItemEnchantmentRec> g_spellItemEnchantmentDB;
WowClientDB<SpellItemEnchantmentConditionRec> g_spellItemEnchantmentConditionDB; WowClientDB<SpellItemEnchantmentConditionRec> g_spellItemEnchantmentConditionDB;
WowClientDB<SpellLevelsRec> g_spellLevelsDB;
WowClientDB<SpellMechanicRec> g_spellMechanicDB; WowClientDB<SpellMechanicRec> g_spellMechanicDB;
WowClientDB<SpellMissileRec> g_spellMissileDB; WowClientDB<SpellMissileRec> g_spellMissileDB;
WowClientDB<SpellMissileMotionRec> g_spellMissileMotionDB; WowClientDB<SpellMissileMotionRec> g_spellMissileMotionDB;
WowClientDB<SpellPowerRec> g_spellPowerDB;
WowClientDB<SpellRadiusRec> g_spellRadiusDB; WowClientDB<SpellRadiusRec> g_spellRadiusDB;
WowClientDB<SpellRangeRec> g_spellRangeDB; WowClientDB<SpellRangeRec> g_spellRangeDB;
WowClientDB<SpellReagentsRec> g_spellReagentsDB;
WowClientDB<SpellRuneCostRec> g_spellRuneCostDB; WowClientDB<SpellRuneCostRec> g_spellRuneCostDB;
WowClientDB<SpellScalingRec> g_spellScalingDB;
WowClientDB<SpellShapeshiftRec> g_spellShapeshiftDB;
WowClientDB<SpellShapeshiftFormRec> g_spellShapeshiftFormDB; WowClientDB<SpellShapeshiftFormRec> g_spellShapeshiftFormDB;
WowClientDB<SpellTargetRestrictionsRec> g_spellTargetRestrictionsDB;
WowClientDB<SpellTotemsRec> g_spellTotemsDB;
WowClientDB<SpellVisualRec> g_spellVisualDB; WowClientDB<SpellVisualRec> g_spellVisualDB;
WowClientDB<SpellVisualEffectNameRec> g_spellVisualEffectNameDB; WowClientDB<SpellVisualEffectNameRec> g_spellVisualEffectNameDB;
WowClientDB<SpellVisualKitRec> g_spellVisualKitDB; WowClientDB<SpellVisualKitRec> g_spellVisualKitDB;
WowClientDB<SpellVisualKitAreaModelRec> g_spellVisualKitAreaModelDB; WowClientDB<SpellVisualKitAreaModelRec> g_spellVisualKitAreaModelDB;
WowClientDB<SpellVisualKitModelAttachRec> g_spellVisualKitModelAttachDB; WowClientDB<SpellVisualKitModelAttachRec> g_spellVisualKitModelAttachDB;
WowClientDB<SpellVisualPrecastTransitionsRec> g_spellVisualPrecastTransitionsDB;
WowClientDB<StableSlotPricesRec> g_stableSlotPricesDB; WowClientDB<StableSlotPricesRec> g_stableSlotPricesDB;
WowClientDB<Startup_StringsRec> g_startup_StringsDB;
WowClientDB<StationeryRec> g_stationeryDB; WowClientDB<StationeryRec> g_stationeryDB;
WowClientDB<StringLookupsRec> g_stringLookupsDB; WowClientDB<StringLookupsRec> g_stringLookupsDB;
WowClientDB<SummonPropertiesRec> g_summonPropertiesDB; WowClientDB<SummonPropertiesRec> g_summonPropertiesDB;
@ -202,6 +253,7 @@ WowClientDB<TaxiNodesRec> g_taxiNodesDB;
WowClientDB<TaxiPathRec> g_taxiPathDB; WowClientDB<TaxiPathRec> g_taxiPathDB;
WowClientDB<TaxiPathNodeRec> g_taxiPathNodeDB; WowClientDB<TaxiPathNodeRec> g_taxiPathNodeDB;
WowClientDB<TeamContributionPointsRec> g_teamContributionPointsDB; WowClientDB<TeamContributionPointsRec> g_teamContributionPointsDB;
WowClientDB<TerrainMaterialRec> g_terrainMaterialDB;
WowClientDB<TerrainTypeRec> g_terrainTypeDB; WowClientDB<TerrainTypeRec> g_terrainTypeDB;
WowClientDB<TerrainTypeSoundsRec> g_terrainTypeSoundsDB; WowClientDB<TerrainTypeSoundsRec> g_terrainTypeSoundsDB;
WowClientDB<TotemCategoryRec> g_totemCategoryDB; WowClientDB<TotemCategoryRec> g_totemCategoryDB;
@ -213,269 +265,338 @@ WowClientDB<UnitBloodRec> g_unitBloodDB;
WowClientDB<UnitBloodLevelsRec> g_unitBloodLevelsDB; WowClientDB<UnitBloodLevelsRec> g_unitBloodLevelsDB;
WowClientDB<VehicleRec> g_vehicleDB; WowClientDB<VehicleRec> g_vehicleDB;
WowClientDB<VehicleSeatRec> g_vehicleSeatDB; WowClientDB<VehicleSeatRec> g_vehicleSeatDB;
WowClientDB<VehicleUIIndicatorRec> g_vehicleUIIndicatorDB;
WowClientDB<VehicleUIIndSeatRec> g_vehicleUIIndSeatDB; WowClientDB<VehicleUIIndSeatRec> g_vehicleUIIndSeatDB;
WowClientDB<VehicleUIIndicatorRec> g_vehicleUIIndicatorDB;
WowClientDB<VideoHardwareRec> g_videoHardwareDB;
WowClientDB<VocalUISoundsRec> g_vocalUISoundsDB; WowClientDB<VocalUISoundsRec> g_vocalUISoundsDB;
WowClientDB<WMOAreaTableRec> g_wMOAreaTableDB; WowClientDB<WMOAreaTableRec> g_wMOAreaTableDB;
WowClientDB<WeaponImpactSoundsRec> g_weaponImpactSoundsDB; WowClientDB<WeaponImpactSoundsRec> g_weaponImpactSoundsDB;
WowClientDB<WeaponSwingSounds2Rec> g_weaponSwingSounds2DB; WowClientDB<WeaponSwingSounds2Rec> g_weaponSwingSounds2DB;
WowClientDB<WeatherRec> g_weatherDB; WowClientDB<WeatherRec> g_weatherDB;
WowClientDB<WorldChunkSoundsRec> g_worldChunkSoundsDB;
WowClientDB<WorldMapAreaRec> g_worldMapAreaDB; WowClientDB<WorldMapAreaRec> g_worldMapAreaDB;
WowClientDB<WorldMapTransformsRec> g_worldMapTransformsDB;
WowClientDB<WorldMapContinentRec> g_worldMapContinentDB; WowClientDB<WorldMapContinentRec> g_worldMapContinentDB;
WowClientDB<WorldMapOverlayRec> g_worldMapOverlayDB; WowClientDB<WorldMapOverlayRec> g_worldMapOverlayDB;
WowClientDB<WorldMapTransformsRec> g_worldMapTransformsDB;
WowClientDB<WorldSafeLocsRec> g_worldSafeLocsDB; WowClientDB<WorldSafeLocsRec> g_worldSafeLocsDB;
WowClientDB<WorldStateUIRec> g_worldStateUIDB; WowClientDB<WorldStateUIRec> g_worldStateUIDB;
WowClientDB<ZoneIntroMusicTableRec> g_zoneIntroMusicTableDB;
WowClientDB<ZoneMusicRec> g_zoneMusicDB;
WowClientDB<WorldStateZoneSoundsRec> g_worldStateZoneSoundsDB; WowClientDB<WorldStateZoneSoundsRec> g_worldStateZoneSoundsDB;
WowClientDB<WorldChunkSoundsRec> g_worldChunkSoundsDB; WowClientDB<WowError_StringsRec> g_wowError_StringsDB;
WowClientDB<SoundEntriesAdvancedRec> g_soundEntriesAdvancedDB; WowClientDB<ZoneIntroMusicTableRec> g_zoneIntroMusicTableDB;
WowClientDB<ObjectEffectRec> g_objectEffectDB; WowClientDB<ZoneLightRec> g_zoneLightDB;
WowClientDB<ObjectEffectGroupRec> g_objectEffectGroupDB; WowClientDB<ZoneLightPointRec> g_zoneLightPointDB;
WowClientDB<ObjectEffectModifierRec> g_objectEffectModifierDB; WowClientDB<ZoneMusicRec> g_zoneMusicDB;
WowClientDB<ObjectEffectPackageRec> g_objectEffectPackageDB; WowClientDB<gtBarberShopCostBaseRec> g_gtBarberShopCostBaseDB;
WowClientDB<ObjectEffectPackageElemRec> g_objectEffectPackageElemDB; WowClientDB<gtChanceToMeleeCritRec> g_gtChanceToMeleeCritDB;
WowClientDB<SoundFilterRec> g_soundFilterDB; WowClientDB<gtChanceToMeleeCritBaseRec> g_gtChanceToMeleeCritBaseDB;
WowClientDB<SoundFilterElemRec> g_soundFilterElemDB; WowClientDB<gtChanceToSpellCritRec> g_gtChanceToSpellCritDB;
WowClientDB<gtChanceToSpellCritBaseRec> g_gtChanceToSpellCritBaseDB;
WowClientDB<gtCombatRatingsRec> g_gtCombatRatingsDB;
WowClientDB<gtNPCManaCostScalerRec> g_gtNPCManaCostScalerDB;
WowClientDB<gtOCTClassCombatRatingScalarRec> g_gtOCTClassCombatRatingScalarDB;
WowClientDB<gtOCTRegenHPRec> g_gtOCTRegenHPDB;
WowClientDB<gtOCTRegenMPRec> g_gtOCTRegenMPDB;
WowClientDB<gtRegenHPPerSptRec> g_gtRegenHPPerSptDB;
WowClientDB<gtRegenMPPerSptRec> g_gtRegenMPPerSptDB;
WowClientDB<gtSpellScalingRec> g_gtSpellScalingDB;
void StaticDBLoadAll(void (*load)(WowClientDB_Base*, const char*, int32_t)) { void StaticDBLoadAll(void (*loadFn)(WowClientDB_Base*, const char*, int32_t)) {
load(&g_achievementDB, __FILE__, __LINE__); loadFn(&g_achievementDB, __FILE__, __LINE__);
load(&g_achievement_CriteriaDB, __FILE__, __LINE__); //loadFn(&g_achievement_CategoryDB, __FILE__, __LINE__);
load(&g_achievement_CategoryDB, __FILE__, __LINE__); //loadFn(&g_achievement_CriteriaDB, __FILE__, __LINE__);
load(&g_animationDataDB, __FILE__, __LINE__); //loadFn(&g_animKitDB, __FILE__, __LINE__);
load(&g_areaGroupDB, __FILE__, __LINE__); //loadFn(&g_animKitBoneSetDB, __FILE__, __LINE__);
load(&g_areaPOIDB, __FILE__, __LINE__); //loadFn(&g_animKitBoneSetAliasDB, __FILE__, __LINE__);
load(&g_areaTableDB, __FILE__, __LINE__); //loadFn(&g_animKitConfigDB, __FILE__, __LINE__);
load(&g_areaTriggerDB, __FILE__, __LINE__); //loadFn(&g_animKitConfigBoneSetDB, __FILE__, __LINE__);
load(&g_attackAnimKitsDB, __FILE__, __LINE__); //loadFn(&g_animKitPriorityDB, __FILE__, __LINE__);
load(&g_attackAnimTypesDB, __FILE__, __LINE__); //loadFn(&g_animKitSegmentDB, __FILE__, __LINE__);
load(&g_auctionHouseDB, __FILE__, __LINE__); //loadFn(&g_animReplacementDB, __FILE__, __LINE__);
load(&g_bankBagSlotPricesDB, __FILE__, __LINE__); //loadFn(&g_animReplacementSetDB, __FILE__, __LINE__);
load(&g_bannedAddOnsDB, __FILE__, __LINE__); //loadFn(&g_animationDataDB, __FILE__, __LINE__);
load(&g_barberShopStyleDB, __FILE__, __LINE__); //loadFn(&g_areaAssignmentDB, __FILE__, __LINE__);
load(&g_battlemasterListDB, __FILE__, __LINE__); //loadFn(&g_areaGroupDB, __FILE__, __LINE__);
load(&g_cameraShakesDB, __FILE__, __LINE__); //loadFn(&g_areaPOIDB, __FILE__, __LINE__);
load(&g_cfg_CategoriesDB, __FILE__, __LINE__); loadFn(&g_areaTableDB, __FILE__, __LINE__);
load(&g_cfg_ConfigsDB, __FILE__, __LINE__); //loadFn(&g_areaTriggerDB, __FILE__, __LINE__);
load(&g_charBaseInfoDB, __FILE__, __LINE__); //loadFn(&g_armorLocationDB, __FILE__, __LINE__);
load(&g_charHairGeosetsDB, __FILE__, __LINE__); //loadFn(&g_attackAnimKitsDB, __FILE__, __LINE__);
load(&g_charSectionsDB, __FILE__, __LINE__); //loadFn(&g_attackAnimTypesDB, __FILE__, __LINE__);
load(&g_charStartOutfitDB, __FILE__, __LINE__); //loadFn(&g_auctionHouseDB, __FILE__, __LINE__);
load(&g_charTitlesDB, __FILE__, __LINE__); //loadFn(&g_bankBagSlotPricesDB, __FILE__, __LINE__);
load(&g_characterFacialHairStylesDB, __FILE__, __LINE__); //loadFn(&g_bannedAddonsDB, __FILE__, __LINE__);
load(&g_chatChannelsDB, __FILE__, __LINE__); //loadFn(&g_barberShopStyleDB, __FILE__, __LINE__);
load(&g_chatProfanityDB, __FILE__, __LINE__); //loadFn(&g_battlemasterListDB, __FILE__, __LINE__);
load(&g_chrClassesDB, __FILE__, __LINE__); //loadFn(&g_cameraModeDB, __FILE__, __LINE__);
load(&g_chrRacesDB, __FILE__, __LINE__); //loadFn(&g_cameraShakesDB, __FILE__, __LINE__);
load(&g_cinematicCameraDB, __FILE__, __LINE__); loadFn(&g_cfg_CategoriesDB, __FILE__, __LINE__);
load(&g_cinematicSequencesDB, __FILE__, __LINE__); loadFn(&g_cfg_ConfigsDB, __FILE__, __LINE__);
load(&g_creatureDisplayInfoDB, __FILE__, __LINE__); //loadFn(&g_charBaseInfoDB, __FILE__, __LINE__);
load(&g_creatureDisplayInfoExtraDB, __FILE__, __LINE__); //loadFn(&g_charHairGeosetsDB, __FILE__, __LINE__);
load(&g_creatureFamilyDB, __FILE__, __LINE__); //loadFn(&g_charHairTexturesDB, __FILE__, __LINE__);
load(&g_creatureModelDataDB, __FILE__, __LINE__); //loadFn(&g_charSectionsDB, __FILE__, __LINE__);
load(&g_creatureMovementInfoDB, __FILE__, __LINE__); //loadFn(&g_charStartOutfitDB, __FILE__, __LINE__);
load(&g_creatureSoundDataDB, __FILE__, __LINE__); //loadFn(&g_charTitlesDB, __FILE__, __LINE__);
load(&g_creatureSpellDataDB, __FILE__, __LINE__); //loadFn(&g_charVariationsDB, __FILE__, __LINE__);
load(&g_creatureTypeDB, __FILE__, __LINE__); //loadFn(&g_characterFacialHairStylesDB, __FILE__, __LINE__);
load(&g_currencyTypesDB, __FILE__, __LINE__); //loadFn(&g_chatChannelsDB, __FILE__, __LINE__);
load(&g_currencyCategoryDB, __FILE__, __LINE__); //loadFn(&g_chatProfanityDB, __FILE__, __LINE__);
load(&g_danceMovesDB, __FILE__, __LINE__); loadFn(&g_chrClassesDB, __FILE__, __LINE__);
load(&g_deathThudLookupsDB, __FILE__, __LINE__); loadFn(&g_chrRacesDB, __FILE__, __LINE__);
load(&g_destructibleModelDataDB, __FILE__, __LINE__); //loadFn(&g_cinematicCameraDB, __FILE__, __LINE__);
load(&g_dungeonEncounterDB, __FILE__, __LINE__); //loadFn(&g_cinematicSequencesDB, __FILE__, __LINE__);
load(&g_dungeonMapDB, __FILE__, __LINE__); loadFn(&g_creatureDisplayInfoDB, __FILE__, __LINE__);
load(&g_dungeonMapChunkDB, __FILE__, __LINE__); //loadFn(&g_creatureDisplayInfoExtraDB, __FILE__, __LINE__);
load(&g_durabilityCostsDB, __FILE__, __LINE__); //loadFn(&g_creatureFamilyDB, __FILE__, __LINE__);
load(&g_durabilityQualityDB, __FILE__, __LINE__); loadFn(&g_creatureModelDataDB, __FILE__, __LINE__);
load(&g_emotesDB, __FILE__, __LINE__); //loadFn(&g_creatureMovementInfoDB, __FILE__, __LINE__);
load(&g_emotesTextDB, __FILE__, __LINE__); //loadFn(&g_creatureSoundDataDB, __FILE__, __LINE__);
load(&g_emotesTextDataDB, __FILE__, __LINE__); //loadFn(&g_creatureSpellDataDB, __FILE__, __LINE__);
load(&g_emotesTextSoundDB, __FILE__, __LINE__); //loadFn(&g_creatureTypeDB, __FILE__, __LINE__);
load(&g_environmentalDamageDB, __FILE__, __LINE__); //loadFn(&g_currencyCategoryDB, __FILE__, __LINE__);
load(&g_exhaustionDB, __FILE__, __LINE__); //loadFn(&g_currencyTypesDB, __FILE__, __LINE__);
load(&g_factionDB, __FILE__, __LINE__); //loadFn(&g_danceMovesDB, __FILE__, __LINE__);
load(&g_factionGroupDB, __FILE__, __LINE__); //loadFn(&g_deathThudLookupsDB, __FILE__, __LINE__);
load(&g_factionTemplateDB, __FILE__, __LINE__); //loadFn(&g_declinedWordDB, __FILE__, __LINE__);
load(&g_fileDataDB, __FILE__, __LINE__); //loadFn(&g_declinedWordCasesDB, __FILE__, __LINE__);
load(&g_footprintTexturesDB, __FILE__, __LINE__); //loadFn(&g_destructibleModelDataDB, __FILE__, __LINE__);
load(&g_footstepTerrainLookupDB, __FILE__, __LINE__); //loadFn(&g_dungeonEncounterDB, __FILE__, __LINE__);
load(&g_gameObjectArtKitDB, __FILE__, __LINE__); //loadFn(&g_dungeonMapDB, __FILE__, __LINE__);
load(&g_gameObjectDisplayInfoDB, __FILE__, __LINE__); //loadFn(&g_dungeonMapChunkDB, __FILE__, __LINE__);
load(&g_gameTablesDB, __FILE__, __LINE__); //loadFn(&g_durabilityCostsDB, __FILE__, __LINE__);
load(&g_gameTipsDB, __FILE__, __LINE__); //loadFn(&g_durabilityQualityDB, __FILE__, __LINE__);
load(&g_gemPropertiesDB, __FILE__, __LINE__); //loadFn(&g_emotesDB, __FILE__, __LINE__);
load(&g_glyphPropertiesDB, __FILE__, __LINE__); //loadFn(&g_emotesTextDB, __FILE__, __LINE__);
load(&g_glyphSlotDB, __FILE__, __LINE__); //loadFn(&g_emotesTextDataDB, __FILE__, __LINE__);
load(&g_gMSurveyAnswersDB, __FILE__, __LINE__); //loadFn(&g_emotesTextSoundDB, __FILE__, __LINE__);
load(&g_gMSurveyCurrentSurveyDB, __FILE__, __LINE__); //loadFn(&g_environmentalDamageDB, __FILE__, __LINE__);
load(&g_gMSurveyQuestionsDB, __FILE__, __LINE__); //loadFn(&g_exhaustionDB, __FILE__, __LINE__);
load(&g_gMSurveySurveysDB, __FILE__, __LINE__); //loadFn(&g_factionDB, __FILE__, __LINE__);
load(&g_gMTicketCategoryDB, __FILE__, __LINE__); //loadFn(&g_factionGroupDB, __FILE__, __LINE__);
load(&g_groundEffectDoodadDB, __FILE__, __LINE__); //loadFn(&g_factionTemplateDB, __FILE__, __LINE__);
load(&g_groundEffectTextureDB, __FILE__, __LINE__); //loadFn(&g_fileDataDB, __FILE__, __LINE__);
load(&g_gtBarberShopCostBaseDB, __FILE__, __LINE__); //loadFn(&g_footprintTexturesDB, __FILE__, __LINE__);
load(&g_gtCombatRatingsDB, __FILE__, __LINE__); //loadFn(&g_footstepTerrainLookupDB, __FILE__, __LINE__);
load(&g_gtChanceToMeleeCritDB, __FILE__, __LINE__); //loadFn(&g_gMSurveyAnswersDB, __FILE__, __LINE__);
load(&g_gtChanceToMeleeCritBaseDB, __FILE__, __LINE__); //loadFn(&g_gMSurveyCurrentSurveyDB, __FILE__, __LINE__);
load(&g_gtChanceToSpellCritDB, __FILE__, __LINE__); //loadFn(&g_gMSurveyQuestionsDB, __FILE__, __LINE__);
load(&g_gtChanceToSpellCritBaseDB, __FILE__, __LINE__); //loadFn(&g_gMSurveySurveysDB, __FILE__, __LINE__);
load(&g_gtNPCManaCostScalerDB, __FILE__, __LINE__); //loadFn(&g_gMTicketCategoryDB, __FILE__, __LINE__);
load(&g_gtOCTClassCombatRatingScalarDB, __FILE__, __LINE__); //loadFn(&g_gameObjectArtKitDB, __FILE__, __LINE__);
load(&g_gtOCTRegenHPDB, __FILE__, __LINE__); //loadFn(&g_gameObjectDisplayInfoDB, __FILE__, __LINE__);
load(&g_gtOCTRegenMPDB, __FILE__, __LINE__); //loadFn(&g_gameTablesDB, __FILE__, __LINE__);
load(&g_gtRegenHPPerSptDB, __FILE__, __LINE__); //loadFn(&g_gameTipsDB, __FILE__, __LINE__);
load(&g_gtRegenMPPerSptDB, __FILE__, __LINE__); //loadFn(&g_gemPropertiesDB, __FILE__, __LINE__);
load(&g_helmetGeosetVisDataDB, __FILE__, __LINE__); //loadFn(&g_glueScreenEmoteDB, __FILE__, __LINE__);
load(&g_holidayDescriptionsDB, __FILE__, __LINE__); //loadFn(&g_glyphPropertiesDB, __FILE__, __LINE__);
load(&g_holidayNamesDB, __FILE__, __LINE__); //loadFn(&g_glyphSlotDB, __FILE__, __LINE__);
load(&g_holidaysDB, __FILE__, __LINE__); //loadFn(&g_groundEffectDoodadDB, __FILE__, __LINE__);
load(&g_itemDB, __FILE__, __LINE__); //loadFn(&g_groundEffectTextureDB, __FILE__, __LINE__);
load(&g_itemBagFamilyDB, __FILE__, __LINE__); //loadFn(&g_guildPerkSpellsDB, __FILE__, __LINE__);
load(&g_itemClassDB, __FILE__, __LINE__); //loadFn(&g_helmetGeosetVisDataDB, __FILE__, __LINE__);
load(&g_itemCondExtCostsDB, __FILE__, __LINE__); //loadFn(&g_holidayDescriptionsDB, __FILE__, __LINE__);
load(&g_itemDisplayInfoDB, __FILE__, __LINE__); //loadFn(&g_holidayNamesDB, __FILE__, __LINE__);
load(&g_itemExtendedCostDB, __FILE__, __LINE__); //loadFn(&g_holidaysDB, __FILE__, __LINE__);
load(&g_itemGroupSoundsDB, __FILE__, __LINE__); //loadFn(&g_itemDB, __FILE__, __LINE__);
load(&g_itemLimitCategoryDB, __FILE__, __LINE__); //loadFn(&g_itemArmorQualityDB, __FILE__, __LINE__);
load(&g_itemPetFoodDB, __FILE__, __LINE__); //loadFn(&g_itemArmorShieldDB, __FILE__, __LINE__);
load(&g_itemPurchaseGroupDB, __FILE__, __LINE__); //loadFn(&g_itemArmorTotalDB, __FILE__, __LINE__);
load(&g_itemRandomPropertiesDB, __FILE__, __LINE__); //loadFn(&g_itemBagFamilyDB, __FILE__, __LINE__);
load(&g_itemRandomSuffixDB, __FILE__, __LINE__); //loadFn(&g_itemClassDB, __FILE__, __LINE__);
load(&g_itemSetDB, __FILE__, __LINE__); //loadFn(&g_itemCondExtCostsDB, __FILE__, __LINE__);
load(&g_itemSubClassDB, __FILE__, __LINE__); //loadFn(&g_itemDamageAmmoDB, __FILE__, __LINE__);
load(&g_itemSubClassMaskDB, __FILE__, __LINE__); //loadFn(&g_itemDamageOneHandDB, __FILE__, __LINE__);
load(&g_itemVisualEffectsDB, __FILE__, __LINE__); //loadFn(&g_itemDamageOneHandCasterDB, __FILE__, __LINE__);
load(&g_itemVisualsDB, __FILE__, __LINE__); //loadFn(&g_itemDamageRangedDB, __FILE__, __LINE__);
load(&g_languageWordsDB, __FILE__, __LINE__); //loadFn(&g_itemDamageThrownDB, __FILE__, __LINE__);
load(&g_languagesDB, __FILE__, __LINE__); //loadFn(&g_itemDamageTwoHandDB, __FILE__, __LINE__);
load(&g_lfgDungeonExpansionDB, __FILE__, __LINE__); //loadFn(&g_itemDamageTwoHandCasterDB, __FILE__, __LINE__);
load(&g_lfgDungeonGroupDB, __FILE__, __LINE__); //loadFn(&g_itemDamageWandDB, __FILE__, __LINE__);
load(&g_lfgDungeonsDB, __FILE__, __LINE__); //loadFn(&g_itemDisplayInfoDB, __FILE__, __LINE__);
load(&g_lightDB, __FILE__, __LINE__); //loadFn(&g_itemExtendedCostDB, __FILE__, __LINE__);
load(&g_lightFloatBandDB, __FILE__, __LINE__); //loadFn(&g_itemGroupSoundsDB, __FILE__, __LINE__);
load(&g_lightIntBandDB, __FILE__, __LINE__); //loadFn(&g_itemLimitCategoryDB, __FILE__, __LINE__);
load(&g_lightParamsDB, __FILE__, __LINE__); //loadFn(&g_itemPetFoodDB, __FILE__, __LINE__);
load(&g_lightSkyboxDB, __FILE__, __LINE__); //loadFn(&g_itemPurchaseGroupDB, __FILE__, __LINE__);
load(&g_liquidTypeDB, __FILE__, __LINE__); //loadFn(&g_itemRandomPropertiesDB, __FILE__, __LINE__);
load(&g_liquidMaterialDB, __FILE__, __LINE__); //loadFn(&g_itemRandomSuffixDB, __FILE__, __LINE__);
load(&g_loadingScreensDB, __FILE__, __LINE__); //loadFn(&g_itemReforgeDB, __FILE__, __LINE__);
load(&g_loadingScreenTaxiSplinesDB, __FILE__, __LINE__); //loadFn(&g_itemSetDB, __FILE__, __LINE__);
load(&g_lockDB, __FILE__, __LINE__); //loadFn(&g_itemSubClassDB, __FILE__, __LINE__);
load(&g_lockTypeDB, __FILE__, __LINE__); //loadFn(&g_itemSubClassMaskDB, __FILE__, __LINE__);
load(&g_mailTemplateDB, __FILE__, __LINE__); //loadFn(&g_itemVisualEffectsDB, __FILE__, __LINE__);
load(&g_mapDB, __FILE__, __LINE__); //loadFn(&g_itemVisualsDB, __FILE__, __LINE__);
load(&g_mapDifficultyDB, __FILE__, __LINE__); //loadFn(&g_lFGDungeonExpansionDB, __FILE__, __LINE__);
load(&g_materialDB, __FILE__, __LINE__); //loadFn(&g_lFGDungeonGroupDB, __FILE__, __LINE__);
load(&g_movieDB, __FILE__, __LINE__); //loadFn(&g_lFGDungeonsDB, __FILE__, __LINE__);
load(&g_movieFileDataDB, __FILE__, __LINE__); //loadFn(&g_languageWordsDB, __FILE__, __LINE__);
load(&g_movieVariationDB, __FILE__, __LINE__); //loadFn(&g_languagesDB, __FILE__, __LINE__);
load(&g_nameGenDB, __FILE__, __LINE__); //loadFn(&g_lightDB, __FILE__, __LINE__);
load(&g_nPCSoundsDB, __FILE__, __LINE__); //loadFn(&g_lightFloatBandDB, __FILE__, __LINE__);
load(&g_namesProfanityDB, __FILE__, __LINE__); //loadFn(&g_lightIntBandDB, __FILE__, __LINE__);
load(&g_namesReservedDB, __FILE__, __LINE__); //loadFn(&g_lightParamsDB, __FILE__, __LINE__);
load(&g_overrideSpellDataDB, __FILE__, __LINE__); //loadFn(&g_lightSkyboxDB, __FILE__, __LINE__);
load(&g_packageDB, __FILE__, __LINE__); //loadFn(&g_liquidMaterialDB, __FILE__, __LINE__);
load(&g_pageTextMaterialDB, __FILE__, __LINE__); //loadFn(&g_liquidObjectDB, __FILE__, __LINE__);
load(&g_paperDollItemFrameDB, __FILE__, __LINE__); //loadFn(&g_liquidTypeDB, __FILE__, __LINE__);
load(&g_particleColorDB, __FILE__, __LINE__); //loadFn(&g_loadingScreenTaxiSplinesDB, __FILE__, __LINE__);
load(&g_petPersonalityDB, __FILE__, __LINE__); //loadFn(&g_loadingScreensDB, __FILE__, __LINE__);
load(&g_powerDisplayDB, __FILE__, __LINE__); //loadFn(&g_lockDB, __FILE__, __LINE__);
load(&g_pvpDifficultyDB, __FILE__, __LINE__); //loadFn(&g_lockTypeDB, __FILE__, __LINE__);
load(&g_questFactionRewardDB, __FILE__, __LINE__); //loadFn(&g_mailTemplateDB, __FILE__, __LINE__);
load(&g_questInfoDB, __FILE__, __LINE__); //loadFn(&g_mapDB, __FILE__, __LINE__);
load(&g_questSortDB, __FILE__, __LINE__); //loadFn(&g_mapDifficultyDB, __FILE__, __LINE__);
load(&g_questXPDB, __FILE__, __LINE__); //loadFn(&g_materialDB, __FILE__, __LINE__);
load(&g_resistancesDB, __FILE__, __LINE__); //loadFn(&g_mountTypeDB, __FILE__, __LINE__);
load(&g_randPropPointsDB, __FILE__, __LINE__); //loadFn(&g_movieDB, __FILE__, __LINE__);
load(&g_scalingStatDistributionDB, __FILE__, __LINE__); //loadFn(&g_movieFileDataDB, __FILE__, __LINE__);
load(&g_scalingStatValuesDB, __FILE__, __LINE__); //loadFn(&g_movieVariationDB, __FILE__, __LINE__);
load(&g_screenEffectDB, __FILE__, __LINE__); //loadFn(&g_nPCSoundsDB, __FILE__, __LINE__);
load(&g_serverMessagesDB, __FILE__, __LINE__); //loadFn(&g_nameGenDB, __FILE__, __LINE__);
load(&g_sheatheSoundLookupsDB, __FILE__, __LINE__); //loadFn(&g_namesProfanityDB, __FILE__, __LINE__);
load(&g_skillCostsDataDB, __FILE__, __LINE__); //loadFn(&g_namesReservedDB, __FILE__, __LINE__);
load(&g_skillLineAbilityDB, __FILE__, __LINE__); //loadFn(&g_objectEffectDB, __FILE__, __LINE__);
load(&g_skillLineCategoryDB, __FILE__, __LINE__); //loadFn(&g_objectEffectGroupDB, __FILE__, __LINE__);
load(&g_skillLineDB, __FILE__, __LINE__); //loadFn(&g_objectEffectModifierDB, __FILE__, __LINE__);
load(&g_skillRaceClassInfoDB, __FILE__, __LINE__); //loadFn(&g_objectEffectPackageDB, __FILE__, __LINE__);
load(&g_skillTiersDB, __FILE__, __LINE__); //loadFn(&g_objectEffectPackageElemDB, __FILE__, __LINE__);
load(&g_soundAmbienceDB, __FILE__, __LINE__); //loadFn(&g_overrideSpellDataDB, __FILE__, __LINE__);
load(&g_soundEmittersDB, __FILE__, __LINE__); //loadFn(&g_pVPDifficultyDB, __FILE__, __LINE__);
load(&g_soundEntriesDB, __FILE__, __LINE__); //loadFn(&g_packageDB, __FILE__, __LINE__);
load(&g_soundProviderPreferencesDB, __FILE__, __LINE__); //loadFn(&g_pageTextMaterialDB, __FILE__, __LINE__);
load(&g_soundSamplePreferencesDB, __FILE__, __LINE__); //loadFn(&g_paperDollItemFrameDB, __FILE__, __LINE__);
load(&g_soundWaterTypeDB, __FILE__, __LINE__); //loadFn(&g_particleColorDB, __FILE__, __LINE__);
load(&g_spamMessagesDB, __FILE__, __LINE__); //loadFn(&g_petPersonalityDB, __FILE__, __LINE__);
load(&g_spellCastTimesDB, __FILE__, __LINE__); //loadFn(&g_petitionTypeDB, __FILE__, __LINE__);
load(&g_spellCategoryDB, __FILE__, __LINE__); //loadFn(&g_phaseDB, __FILE__, __LINE__);
load(&g_spellChainEffectsDB, __FILE__, __LINE__); //loadFn(&g_phaseShiftZoneSoundsDB, __FILE__, __LINE__);
load(&g_spellDB, __FILE__, __LINE__); //loadFn(&g_phaseXPhaseGroupDB, __FILE__, __LINE__);
load(&g_spellDescriptionVariablesDB, __FILE__, __LINE__); //loadFn(&g_powerDisplayDB, __FILE__, __LINE__);
load(&g_spellDifficultyDB, __FILE__, __LINE__); //loadFn(&g_questFactionRewardDB, __FILE__, __LINE__);
load(&g_spellDispelTypeDB, __FILE__, __LINE__); //loadFn(&g_questInfoDB, __FILE__, __LINE__);
load(&g_spellDurationDB, __FILE__, __LINE__); //loadFn(&g_questSortDB, __FILE__, __LINE__);
load(&g_spellEffectCameraShakesDB, __FILE__, __LINE__); //loadFn(&g_questXPDB, __FILE__, __LINE__);
load(&g_spellFocusObjectDB, __FILE__, __LINE__); //loadFn(&g_randPropPointsDB, __FILE__, __LINE__);
load(&g_spellIconDB, __FILE__, __LINE__); //loadFn(&g_researchBranchDB, __FILE__, __LINE__);
load(&g_spellItemEnchantmentDB, __FILE__, __LINE__); //loadFn(&g_resistancesDB, __FILE__, __LINE__);
load(&g_spellItemEnchantmentConditionDB, __FILE__, __LINE__); //loadFn(&g_scalingStatDistributionDB, __FILE__, __LINE__);
load(&g_spellMechanicDB, __FILE__, __LINE__); //loadFn(&g_scalingStatValuesDB, __FILE__, __LINE__);
load(&g_spellMissileDB, __FILE__, __LINE__); //loadFn(&g_screenEffectDB, __FILE__, __LINE__);
load(&g_spellMissileMotionDB, __FILE__, __LINE__); //loadFn(&g_serverMessagesDB, __FILE__, __LINE__);
load(&g_spellRadiusDB, __FILE__, __LINE__); //loadFn(&g_sheatheSoundLookupsDB, __FILE__, __LINE__);
load(&g_spellRangeDB, __FILE__, __LINE__); //loadFn(&g_skillCostsDataDB, __FILE__, __LINE__);
load(&g_spellRuneCostDB, __FILE__, __LINE__); //loadFn(&g_skillLineDB, __FILE__, __LINE__);
load(&g_spellShapeshiftFormDB, __FILE__, __LINE__); //loadFn(&g_skillLineAbilityDB, __FILE__, __LINE__);
load(&g_spellVisualDB, __FILE__, __LINE__); //loadFn(&g_skillLineCategoryDB, __FILE__, __LINE__);
load(&g_spellVisualEffectNameDB, __FILE__, __LINE__); //loadFn(&g_skillRaceClassInfoDB, __FILE__, __LINE__);
load(&g_spellVisualKitDB, __FILE__, __LINE__); //loadFn(&g_skillTiersDB, __FILE__, __LINE__);
load(&g_spellVisualKitAreaModelDB, __FILE__, __LINE__); //loadFn(&g_soundAmbienceDB, __FILE__, __LINE__);
load(&g_spellVisualKitModelAttachDB, __FILE__, __LINE__); //loadFn(&g_soundEmittersDB, __FILE__, __LINE__);
load(&g_stableSlotPricesDB, __FILE__, __LINE__); //loadFn(&g_soundEntriesDB, __FILE__, __LINE__);
load(&g_stationeryDB, __FILE__, __LINE__); //loadFn(&g_soundEntriesAdvancedDB, __FILE__, __LINE__);
load(&g_stringLookupsDB, __FILE__, __LINE__); //loadFn(&g_soundFilterDB, __FILE__, __LINE__);
load(&g_summonPropertiesDB, __FILE__, __LINE__); //loadFn(&g_soundFilterElemDB, __FILE__, __LINE__);
load(&g_talentDB, __FILE__, __LINE__); //loadFn(&g_soundProviderPreferencesDB, __FILE__, __LINE__);
load(&g_talentTabDB, __FILE__, __LINE__); //loadFn(&g_soundSamplePreferencesDB, __FILE__, __LINE__);
load(&g_taxiNodesDB, __FILE__, __LINE__); //loadFn(&g_soundWaterTypeDB, __FILE__, __LINE__);
load(&g_taxiPathDB, __FILE__, __LINE__); //loadFn(&g_spamMessagesDB, __FILE__, __LINE__);
load(&g_taxiPathNodeDB, __FILE__, __LINE__); //loadFn(&g_spellDB, __FILE__, __LINE__);
load(&g_teamContributionPointsDB, __FILE__, __LINE__); //loadFn(&g_spellAuraOptionsDB, __FILE__, __LINE__);
load(&g_terrainTypeDB, __FILE__, __LINE__); //loadFn(&g_spellAuraRestrictionsDB, __FILE__, __LINE__);
load(&g_terrainTypeSoundsDB, __FILE__, __LINE__); //loadFn(&g_spellCastTimesDB, __FILE__, __LINE__);
load(&g_totemCategoryDB, __FILE__, __LINE__); //loadFn(&g_spellCastingRequirementsDB, __FILE__, __LINE__);
load(&g_transportAnimationDB, __FILE__, __LINE__); //loadFn(&g_spellCategoriesDB, __FILE__, __LINE__);
load(&g_transportPhysicsDB, __FILE__, __LINE__); //loadFn(&g_spellCategoryDB, __FILE__, __LINE__);
load(&g_transportRotationDB, __FILE__, __LINE__); //loadFn(&g_spellChainEffectsDB, __FILE__, __LINE__);
load(&g_uISoundLookupsDB, __FILE__, __LINE__); //loadFn(&g_spellClassOptionsDB, __FILE__, __LINE__);
load(&g_unitBloodDB, __FILE__, __LINE__); //loadFn(&g_spellCooldownsDB, __FILE__, __LINE__);
load(&g_unitBloodLevelsDB, __FILE__, __LINE__); //loadFn(&g_spellDescriptionVariablesDB, __FILE__, __LINE__);
load(&g_vehicleDB, __FILE__, __LINE__); //loadFn(&g_spellDifficultyDB, __FILE__, __LINE__);
load(&g_vehicleSeatDB, __FILE__, __LINE__); //loadFn(&g_spellDispelTypeDB, __FILE__, __LINE__);
load(&g_vehicleUIIndicatorDB, __FILE__, __LINE__); //loadFn(&g_spellDurationDB, __FILE__, __LINE__);
load(&g_vehicleUIIndSeatDB, __FILE__, __LINE__); //loadFn(&g_spellEffectDB, __FILE__, __LINE__);
load(&g_vocalUISoundsDB, __FILE__, __LINE__); //loadFn(&g_spellEffectCameraShakesDB, __FILE__, __LINE__);
load(&g_wMOAreaTableDB, __FILE__, __LINE__); //loadFn(&g_spellEquippedItemsDB, __FILE__, __LINE__);
load(&g_weaponImpactSoundsDB, __FILE__, __LINE__); //loadFn(&g_spellFocusObjectDB, __FILE__, __LINE__);
load(&g_weaponSwingSounds2DB, __FILE__, __LINE__); //loadFn(&g_spellIconDB, __FILE__, __LINE__);
load(&g_weatherDB, __FILE__, __LINE__); //loadFn(&g_spellInterruptsDB, __FILE__, __LINE__);
load(&g_worldMapAreaDB, __FILE__, __LINE__); //loadFn(&g_spellItemEnchantmentDB, __FILE__, __LINE__);
load(&g_worldMapTransformsDB, __FILE__, __LINE__); //loadFn(&g_spellItemEnchantmentConditionDB, __FILE__, __LINE__);
load(&g_worldMapContinentDB, __FILE__, __LINE__); //loadFn(&g_spellLevelsDB, __FILE__, __LINE__);
load(&g_worldMapOverlayDB, __FILE__, __LINE__); //loadFn(&g_spellMechanicDB, __FILE__, __LINE__);
load(&g_worldSafeLocsDB, __FILE__, __LINE__); //loadFn(&g_spellMissileDB, __FILE__, __LINE__);
load(&g_worldStateUIDB, __FILE__, __LINE__); //loadFn(&g_spellMissileMotionDB, __FILE__, __LINE__);
load(&g_zoneIntroMusicTableDB, __FILE__, __LINE__); //loadFn(&g_spellPowerDB, __FILE__, __LINE__);
load(&g_zoneMusicDB, __FILE__, __LINE__); //loadFn(&g_spellRadiusDB, __FILE__, __LINE__);
load(&g_worldStateZoneSoundsDB, __FILE__, __LINE__); //loadFn(&g_spellRangeDB, __FILE__, __LINE__);
load(&g_worldChunkSoundsDB, __FILE__, __LINE__); //loadFn(&g_spellReagentsDB, __FILE__, __LINE__);
load(&g_soundEntriesAdvancedDB, __FILE__, __LINE__); //loadFn(&g_spellRuneCostDB, __FILE__, __LINE__);
load(&g_objectEffectDB, __FILE__, __LINE__); //loadFn(&g_spellScalingDB, __FILE__, __LINE__);
load(&g_objectEffectGroupDB, __FILE__, __LINE__); //loadFn(&g_spellShapeshiftDB, __FILE__, __LINE__);
load(&g_objectEffectModifierDB, __FILE__, __LINE__); //loadFn(&g_spellShapeshiftFormDB, __FILE__, __LINE__);
load(&g_objectEffectPackageDB, __FILE__, __LINE__); //loadFn(&g_spellTargetRestrictionsDB, __FILE__, __LINE__);
load(&g_objectEffectPackageElemDB, __FILE__, __LINE__); //loadFn(&g_spellTotemsDB, __FILE__, __LINE__);
load(&g_soundFilterDB, __FILE__, __LINE__); //loadFn(&g_spellVisualDB, __FILE__, __LINE__);
load(&g_soundFilterElemDB, __FILE__, __LINE__); //loadFn(&g_spellVisualEffectNameDB, __FILE__, __LINE__);
//loadFn(&g_spellVisualKitDB, __FILE__, __LINE__);
//loadFn(&g_spellVisualKitAreaModelDB, __FILE__, __LINE__);
//loadFn(&g_spellVisualKitModelAttachDB, __FILE__, __LINE__);
//loadFn(&g_spellVisualPrecastTransitionsDB, __FILE__, __LINE__);
//loadFn(&g_stableSlotPricesDB, __FILE__, __LINE__);
//loadFn(&g_stationeryDB, __FILE__, __LINE__);
//loadFn(&g_stringLookupsDB, __FILE__, __LINE__);
//loadFn(&g_summonPropertiesDB, __FILE__, __LINE__);
//loadFn(&g_talentDB, __FILE__, __LINE__);
//loadFn(&g_talentTabDB, __FILE__, __LINE__);
//loadFn(&g_taxiNodesDB, __FILE__, __LINE__);
//loadFn(&g_taxiPathDB, __FILE__, __LINE__);
//loadFn(&g_taxiPathNodeDB, __FILE__, __LINE__);
//loadFn(&g_teamContributionPointsDB, __FILE__, __LINE__);
//loadFn(&g_terrainMaterialDB, __FILE__, __LINE__);
//loadFn(&g_terrainTypeDB, __FILE__, __LINE__);
//loadFn(&g_terrainTypeSoundsDB, __FILE__, __LINE__);
//loadFn(&g_totemCategoryDB, __FILE__, __LINE__);
//loadFn(&g_transportAnimationDB, __FILE__, __LINE__);
//loadFn(&g_transportPhysicsDB, __FILE__, __LINE__);
//loadFn(&g_transportRotationDB, __FILE__, __LINE__);
//loadFn(&g_uISoundLookupsDB, __FILE__, __LINE__);
//loadFn(&g_unitBloodDB, __FILE__, __LINE__);
//loadFn(&g_unitBloodLevelsDB, __FILE__, __LINE__);
//loadFn(&g_vehicleDB, __FILE__, __LINE__);
//loadFn(&g_vehicleSeatDB, __FILE__, __LINE__);
//loadFn(&g_vehicleUIIndSeatDB, __FILE__, __LINE__);
//loadFn(&g_vehicleUIIndicatorDB, __FILE__, __LINE__);
//loadFn(&g_videoHardwareDB, __FILE__, __LINE__);
//loadFn(&g_vocalUISoundsDB, __FILE__, __LINE__);
//loadFn(&g_wMOAreaTableDB, __FILE__, __LINE__);
//loadFn(&g_weaponImpactSoundsDB, __FILE__, __LINE__);
//loadFn(&g_weaponSwingSounds2DB, __FILE__, __LINE__);
//loadFn(&g_weatherDB, __FILE__, __LINE__);
//loadFn(&g_worldChunkSoundsDB, __FILE__, __LINE__);
//loadFn(&g_worldMapAreaDB, __FILE__, __LINE__);
//loadFn(&g_worldMapContinentDB, __FILE__, __LINE__);
//loadFn(&g_worldMapOverlayDB, __FILE__, __LINE__);
//loadFn(&g_worldMapTransformsDB, __FILE__, __LINE__);
//loadFn(&g_worldSafeLocsDB, __FILE__, __LINE__);
//loadFn(&g_worldStateUIDB, __FILE__, __LINE__);
//loadFn(&g_worldStateZoneSoundsDB, __FILE__, __LINE__);
//loadFn(&g_wowError_StringsDB, __FILE__, __LINE__);
//loadFn(&g_zoneIntroMusicTableDB, __FILE__, __LINE__);
//loadFn(&g_zoneLightDB, __FILE__, __LINE__);
//loadFn(&g_zoneLightPointDB, __FILE__, __LINE__);
//loadFn(&g_zoneMusicDB, __FILE__, __LINE__);
//loadFn(&g_gtBarberShopCostBaseDB, __FILE__, __LINE__);
//loadFn(&g_gtChanceToMeleeCritDB, __FILE__, __LINE__);
//loadFn(&g_gtChanceToMeleeCritBaseDB, __FILE__, __LINE__);
//loadFn(&g_gtChanceToSpellCritDB, __FILE__, __LINE__);
//loadFn(&g_gtChanceToSpellCritBaseDB, __FILE__, __LINE__);
//loadFn(&g_gtCombatRatingsDB, __FILE__, __LINE__);
//loadFn(&g_gtNPCManaCostScalerDB, __FILE__, __LINE__);
//loadFn(&g_gtOCTClassCombatRatingScalarDB, __FILE__, __LINE__);
//loadFn(&g_gtOCTRegenHPDB, __FILE__, __LINE__);
//loadFn(&g_gtOCTRegenMPDB, __FILE__, __LINE__);
//loadFn(&g_gtRegenHPPerSptDB, __FILE__, __LINE__);
//loadFn(&g_gtRegenMPPerSptDB, __FILE__, __LINE__);
//loadFn(&g_gtSpellScalingDB, __FILE__, __LINE__);
} }

View File

@ -5,28 +5,42 @@
#include "db/WowClientDB_Base.hpp" #include "db/WowClientDB_Base.hpp"
#include "db/WowClientDB.hpp" #include "db/WowClientDB.hpp"
#include "db/rec/AchievementRec.hpp" #include "db/rec/AchievementRec.hpp"
#include "db/rec/Achievement_CriteriaRec.hpp"
#include "db/rec/Achievement_CategoryRec.hpp" #include "db/rec/Achievement_CategoryRec.hpp"
#include "db/rec/Achievement_CriteriaRec.hpp"
#include "db/rec/AnimKitRec.hpp"
#include "db/rec/AnimKitBoneSetRec.hpp"
#include "db/rec/AnimKitBoneSetAliasRec.hpp"
#include "db/rec/AnimKitConfigRec.hpp"
#include "db/rec/AnimKitConfigBoneSetRec.hpp"
#include "db/rec/AnimKitPriorityRec.hpp"
#include "db/rec/AnimKitSegmentRec.hpp"
#include "db/rec/AnimReplacementRec.hpp"
#include "db/rec/AnimReplacementSetRec.hpp"
#include "db/rec/AnimationDataRec.hpp" #include "db/rec/AnimationDataRec.hpp"
#include "db/rec/AreaAssignmentRec.hpp"
#include "db/rec/AreaGroupRec.hpp" #include "db/rec/AreaGroupRec.hpp"
#include "db/rec/AreaPOIRec.hpp" #include "db/rec/AreaPOIRec.hpp"
#include "db/rec/AreaTableRec.hpp" #include "db/rec/AreaTableRec.hpp"
#include "db/rec/AreaTriggerRec.hpp" #include "db/rec/AreaTriggerRec.hpp"
#include "db/rec/ArmorLocationRec.hpp"
#include "db/rec/AttackAnimKitsRec.hpp" #include "db/rec/AttackAnimKitsRec.hpp"
#include "db/rec/AttackAnimTypesRec.hpp" #include "db/rec/AttackAnimTypesRec.hpp"
#include "db/rec/AuctionHouseRec.hpp" #include "db/rec/AuctionHouseRec.hpp"
#include "db/rec/BankBagSlotPricesRec.hpp" #include "db/rec/BankBagSlotPricesRec.hpp"
#include "db/rec/BannedAddOnsRec.hpp" #include "db/rec/BannedAddonsRec.hpp"
#include "db/rec/BarberShopStyleRec.hpp" #include "db/rec/BarberShopStyleRec.hpp"
#include "db/rec/BattlemasterListRec.hpp" #include "db/rec/BattlemasterListRec.hpp"
#include "db/rec/CameraModeRec.hpp"
#include "db/rec/CameraShakesRec.hpp" #include "db/rec/CameraShakesRec.hpp"
#include "db/rec/Cfg_CategoriesRec.hpp" #include "db/rec/Cfg_CategoriesRec.hpp"
#include "db/rec/Cfg_ConfigsRec.hpp" #include "db/rec/Cfg_ConfigsRec.hpp"
#include "db/rec/CharBaseInfoRec.hpp" #include "db/rec/CharBaseInfoRec.hpp"
#include "db/rec/CharHairGeosetsRec.hpp" #include "db/rec/CharHairGeosetsRec.hpp"
#include "db/rec/CharHairTexturesRec.hpp"
#include "db/rec/CharSectionsRec.hpp" #include "db/rec/CharSectionsRec.hpp"
#include "db/rec/CharStartOutfitRec.hpp" #include "db/rec/CharStartOutfitRec.hpp"
#include "db/rec/CharTitlesRec.hpp" #include "db/rec/CharTitlesRec.hpp"
#include "db/rec/CharVariationsRec.hpp"
#include "db/rec/CharacterFacialHairStylesRec.hpp" #include "db/rec/CharacterFacialHairStylesRec.hpp"
#include "db/rec/ChatChannelsRec.hpp" #include "db/rec/ChatChannelsRec.hpp"
#include "db/rec/ChatProfanityRec.hpp" #include "db/rec/ChatProfanityRec.hpp"
@ -42,10 +56,12 @@
#include "db/rec/CreatureSoundDataRec.hpp" #include "db/rec/CreatureSoundDataRec.hpp"
#include "db/rec/CreatureSpellDataRec.hpp" #include "db/rec/CreatureSpellDataRec.hpp"
#include "db/rec/CreatureTypeRec.hpp" #include "db/rec/CreatureTypeRec.hpp"
#include "db/rec/CurrencyTypesRec.hpp"
#include "db/rec/CurrencyCategoryRec.hpp" #include "db/rec/CurrencyCategoryRec.hpp"
#include "db/rec/CurrencyTypesRec.hpp"
#include "db/rec/DanceMovesRec.hpp" #include "db/rec/DanceMovesRec.hpp"
#include "db/rec/DeathThudLookupsRec.hpp" #include "db/rec/DeathThudLookupsRec.hpp"
#include "db/rec/DeclinedWordRec.hpp"
#include "db/rec/DeclinedWordCasesRec.hpp"
#include "db/rec/DestructibleModelDataRec.hpp" #include "db/rec/DestructibleModelDataRec.hpp"
#include "db/rec/DungeonEncounterRec.hpp" #include "db/rec/DungeonEncounterRec.hpp"
#include "db/rec/DungeonMapRec.hpp" #include "db/rec/DungeonMapRec.hpp"
@ -64,40 +80,41 @@
#include "db/rec/FileDataRec.hpp" #include "db/rec/FileDataRec.hpp"
#include "db/rec/FootprintTexturesRec.hpp" #include "db/rec/FootprintTexturesRec.hpp"
#include "db/rec/FootstepTerrainLookupRec.hpp" #include "db/rec/FootstepTerrainLookupRec.hpp"
#include "db/rec/GameObjectArtKitRec.hpp"
#include "db/rec/GameObjectDisplayInfoRec.hpp"
#include "db/rec/GameTablesRec.hpp"
#include "db/rec/GameTipsRec.hpp"
#include "db/rec/GemPropertiesRec.hpp"
#include "db/rec/GlyphPropertiesRec.hpp"
#include "db/rec/GlyphSlotRec.hpp"
#include "db/rec/GMSurveyAnswersRec.hpp" #include "db/rec/GMSurveyAnswersRec.hpp"
#include "db/rec/GMSurveyCurrentSurveyRec.hpp" #include "db/rec/GMSurveyCurrentSurveyRec.hpp"
#include "db/rec/GMSurveyQuestionsRec.hpp" #include "db/rec/GMSurveyQuestionsRec.hpp"
#include "db/rec/GMSurveySurveysRec.hpp" #include "db/rec/GMSurveySurveysRec.hpp"
#include "db/rec/GMTicketCategoryRec.hpp" #include "db/rec/GMTicketCategoryRec.hpp"
#include "db/rec/GameObjectArtKitRec.hpp"
#include "db/rec/GameObjectDisplayInfoRec.hpp"
#include "db/rec/GameTablesRec.hpp"
#include "db/rec/GameTipsRec.hpp"
#include "db/rec/GemPropertiesRec.hpp"
#include "db/rec/GlueScreenEmoteRec.hpp"
#include "db/rec/GlyphPropertiesRec.hpp"
#include "db/rec/GlyphSlotRec.hpp"
#include "db/rec/GroundEffectDoodadRec.hpp" #include "db/rec/GroundEffectDoodadRec.hpp"
#include "db/rec/GroundEffectTextureRec.hpp" #include "db/rec/GroundEffectTextureRec.hpp"
#include "db/rec/gtBarberShopCostBaseRec.hpp" #include "db/rec/GuildPerkSpellsRec.hpp"
#include "db/rec/gtCombatRatingsRec.hpp"
#include "db/rec/gtChanceToMeleeCritRec.hpp"
#include "db/rec/gtChanceToMeleeCritBaseRec.hpp"
#include "db/rec/gtChanceToSpellCritRec.hpp"
#include "db/rec/gtChanceToSpellCritBaseRec.hpp"
#include "db/rec/gtNPCManaCostScalerRec.hpp"
#include "db/rec/gtOCTClassCombatRatingScalarRec.hpp"
#include "db/rec/gtOCTRegenHPRec.hpp"
#include "db/rec/gtOCTRegenMPRec.hpp"
#include "db/rec/gtRegenHPPerSptRec.hpp"
#include "db/rec/gtRegenMPPerSptRec.hpp"
#include "db/rec/HelmetGeosetVisDataRec.hpp" #include "db/rec/HelmetGeosetVisDataRec.hpp"
#include "db/rec/HolidayDescriptionsRec.hpp" #include "db/rec/HolidayDescriptionsRec.hpp"
#include "db/rec/HolidayNamesRec.hpp" #include "db/rec/HolidayNamesRec.hpp"
#include "db/rec/HolidaysRec.hpp" #include "db/rec/HolidaysRec.hpp"
#include "db/rec/ItemRec.hpp" #include "db/rec/ItemRec.hpp"
#include "db/rec/ItemArmorQualityRec.hpp"
#include "db/rec/ItemArmorShieldRec.hpp"
#include "db/rec/ItemArmorTotalRec.hpp"
#include "db/rec/ItemBagFamilyRec.hpp" #include "db/rec/ItemBagFamilyRec.hpp"
#include "db/rec/ItemClassRec.hpp" #include "db/rec/ItemClassRec.hpp"
#include "db/rec/ItemCondExtCostsRec.hpp" #include "db/rec/ItemCondExtCostsRec.hpp"
#include "db/rec/ItemDamageAmmoRec.hpp"
#include "db/rec/ItemDamageOneHandRec.hpp"
#include "db/rec/ItemDamageOneHandCasterRec.hpp"
#include "db/rec/ItemDamageRangedRec.hpp"
#include "db/rec/ItemDamageThrownRec.hpp"
#include "db/rec/ItemDamageTwoHandRec.hpp"
#include "db/rec/ItemDamageTwoHandCasterRec.hpp"
#include "db/rec/ItemDamageWandRec.hpp"
#include "db/rec/ItemDisplayInfoRec.hpp" #include "db/rec/ItemDisplayInfoRec.hpp"
#include "db/rec/ItemExtendedCostRec.hpp" #include "db/rec/ItemExtendedCostRec.hpp"
#include "db/rec/ItemGroupSoundsRec.hpp" #include "db/rec/ItemGroupSoundsRec.hpp"
@ -106,96 +123,130 @@
#include "db/rec/ItemPurchaseGroupRec.hpp" #include "db/rec/ItemPurchaseGroupRec.hpp"
#include "db/rec/ItemRandomPropertiesRec.hpp" #include "db/rec/ItemRandomPropertiesRec.hpp"
#include "db/rec/ItemRandomSuffixRec.hpp" #include "db/rec/ItemRandomSuffixRec.hpp"
#include "db/rec/ItemReforgeRec.hpp"
#include "db/rec/ItemSetRec.hpp" #include "db/rec/ItemSetRec.hpp"
#include "db/rec/ItemSubClassRec.hpp" #include "db/rec/ItemSubClassRec.hpp"
#include "db/rec/ItemSubClassMaskRec.hpp" #include "db/rec/ItemSubClassMaskRec.hpp"
#include "db/rec/ItemVisualEffectsRec.hpp" #include "db/rec/ItemVisualEffectsRec.hpp"
#include "db/rec/ItemVisualsRec.hpp" #include "db/rec/ItemVisualsRec.hpp"
#include "db/rec/LFGDungeonExpansionRec.hpp"
#include "db/rec/LFGDungeonGroupRec.hpp"
#include "db/rec/LFGDungeonsRec.hpp"
#include "db/rec/LanguageWordsRec.hpp" #include "db/rec/LanguageWordsRec.hpp"
#include "db/rec/LanguagesRec.hpp" #include "db/rec/LanguagesRec.hpp"
#include "db/rec/LfgDungeonExpansionRec.hpp"
#include "db/rec/LfgDungeonGroupRec.hpp"
#include "db/rec/LfgDungeonsRec.hpp"
#include "db/rec/LightRec.hpp" #include "db/rec/LightRec.hpp"
#include "db/rec/LightFloatBandRec.hpp" #include "db/rec/LightFloatBandRec.hpp"
#include "db/rec/LightIntBandRec.hpp" #include "db/rec/LightIntBandRec.hpp"
#include "db/rec/LightParamsRec.hpp" #include "db/rec/LightParamsRec.hpp"
#include "db/rec/LightSkyboxRec.hpp" #include "db/rec/LightSkyboxRec.hpp"
#include "db/rec/LiquidTypeRec.hpp"
#include "db/rec/LiquidMaterialRec.hpp" #include "db/rec/LiquidMaterialRec.hpp"
#include "db/rec/LoadingScreensRec.hpp" #include "db/rec/LiquidObjectRec.hpp"
#include "db/rec/LiquidTypeRec.hpp"
#include "db/rec/LoadingScreenTaxiSplinesRec.hpp" #include "db/rec/LoadingScreenTaxiSplinesRec.hpp"
#include "db/rec/LoadingScreensRec.hpp"
#include "db/rec/LockRec.hpp" #include "db/rec/LockRec.hpp"
#include "db/rec/LockTypeRec.hpp" #include "db/rec/LockTypeRec.hpp"
#include "db/rec/MailTemplateRec.hpp" #include "db/rec/MailTemplateRec.hpp"
#include "db/rec/MapRec.hpp" #include "db/rec/MapRec.hpp"
#include "db/rec/MapDifficultyRec.hpp" #include "db/rec/MapDifficultyRec.hpp"
#include "db/rec/MaterialRec.hpp" #include "db/rec/MaterialRec.hpp"
#include "db/rec/MountTypeRec.hpp"
#include "db/rec/MovieRec.hpp" #include "db/rec/MovieRec.hpp"
#include "db/rec/MovieFileDataRec.hpp" #include "db/rec/MovieFileDataRec.hpp"
#include "db/rec/MovieVariationRec.hpp" #include "db/rec/MovieVariationRec.hpp"
#include "db/rec/NameGenRec.hpp"
#include "db/rec/NPCSoundsRec.hpp" #include "db/rec/NPCSoundsRec.hpp"
#include "db/rec/NameGenRec.hpp"
#include "db/rec/NamesProfanityRec.hpp" #include "db/rec/NamesProfanityRec.hpp"
#include "db/rec/NamesReservedRec.hpp" #include "db/rec/NamesReservedRec.hpp"
#include "db/rec/ObjectEffectRec.hpp"
#include "db/rec/ObjectEffectGroupRec.hpp"
#include "db/rec/ObjectEffectModifierRec.hpp"
#include "db/rec/ObjectEffectPackageRec.hpp"
#include "db/rec/ObjectEffectPackageElemRec.hpp"
#include "db/rec/OverrideSpellDataRec.hpp" #include "db/rec/OverrideSpellDataRec.hpp"
#include "db/rec/PVPDifficultyRec.hpp"
#include "db/rec/PackageRec.hpp" #include "db/rec/PackageRec.hpp"
#include "db/rec/PageTextMaterialRec.hpp" #include "db/rec/PageTextMaterialRec.hpp"
#include "db/rec/PaperDollItemFrameRec.hpp" #include "db/rec/PaperDollItemFrameRec.hpp"
#include "db/rec/ParticleColorRec.hpp" #include "db/rec/ParticleColorRec.hpp"
#include "db/rec/PetPersonalityRec.hpp" #include "db/rec/PetPersonalityRec.hpp"
#include "db/rec/PetitionTypeRec.hpp"
#include "db/rec/PhaseRec.hpp"
#include "db/rec/PhaseShiftZoneSoundsRec.hpp"
#include "db/rec/PhaseXPhaseGroupRec.hpp"
#include "db/rec/PowerDisplayRec.hpp" #include "db/rec/PowerDisplayRec.hpp"
#include "db/rec/PvpDifficultyRec.hpp"
#include "db/rec/QuestFactionRewardRec.hpp" #include "db/rec/QuestFactionRewardRec.hpp"
#include "db/rec/QuestInfoRec.hpp" #include "db/rec/QuestInfoRec.hpp"
#include "db/rec/QuestSortRec.hpp" #include "db/rec/QuestSortRec.hpp"
#include "db/rec/QuestXPRec.hpp" #include "db/rec/QuestXPRec.hpp"
#include "db/rec/ResistancesRec.hpp"
#include "db/rec/RandPropPointsRec.hpp" #include "db/rec/RandPropPointsRec.hpp"
#include "db/rec/ResearchBranchRec.hpp"
#include "db/rec/ResistancesRec.hpp"
#include "db/rec/ScalingStatDistributionRec.hpp" #include "db/rec/ScalingStatDistributionRec.hpp"
#include "db/rec/ScalingStatValuesRec.hpp" #include "db/rec/ScalingStatValuesRec.hpp"
#include "db/rec/ScreenEffectRec.hpp" #include "db/rec/ScreenEffectRec.hpp"
#include "db/rec/ServerMessagesRec.hpp" #include "db/rec/ServerMessagesRec.hpp"
#include "db/rec/SheatheSoundLookupsRec.hpp" #include "db/rec/SheatheSoundLookupsRec.hpp"
#include "db/rec/SkillCostsDataRec.hpp" #include "db/rec/SkillCostsDataRec.hpp"
#include "db/rec/SkillLineRec.hpp"
#include "db/rec/SkillLineAbilityRec.hpp" #include "db/rec/SkillLineAbilityRec.hpp"
#include "db/rec/SkillLineCategoryRec.hpp" #include "db/rec/SkillLineCategoryRec.hpp"
#include "db/rec/SkillLineRec.hpp"
#include "db/rec/SkillRaceClassInfoRec.hpp" #include "db/rec/SkillRaceClassInfoRec.hpp"
#include "db/rec/SkillTiersRec.hpp" #include "db/rec/SkillTiersRec.hpp"
#include "db/rec/SoundAmbienceRec.hpp" #include "db/rec/SoundAmbienceRec.hpp"
#include "db/rec/SoundEmittersRec.hpp" #include "db/rec/SoundEmittersRec.hpp"
#include "db/rec/SoundEntriesRec.hpp" #include "db/rec/SoundEntriesRec.hpp"
#include "db/rec/SoundEntriesAdvancedRec.hpp"
#include "db/rec/SoundFilterRec.hpp"
#include "db/rec/SoundFilterElemRec.hpp"
#include "db/rec/SoundProviderPreferencesRec.hpp" #include "db/rec/SoundProviderPreferencesRec.hpp"
#include "db/rec/SoundSamplePreferencesRec.hpp" #include "db/rec/SoundSamplePreferencesRec.hpp"
#include "db/rec/SoundWaterTypeRec.hpp" #include "db/rec/SoundWaterTypeRec.hpp"
#include "db/rec/SpamMessagesRec.hpp" #include "db/rec/SpamMessagesRec.hpp"
#include "db/rec/SpellRec.hpp"
#include "db/rec/SpellAuraOptionsRec.hpp"
#include "db/rec/SpellAuraRestrictionsRec.hpp"
#include "db/rec/SpellCastTimesRec.hpp" #include "db/rec/SpellCastTimesRec.hpp"
#include "db/rec/SpellCastingRequirementsRec.hpp"
#include "db/rec/SpellCategoriesRec.hpp"
#include "db/rec/SpellCategoryRec.hpp" #include "db/rec/SpellCategoryRec.hpp"
#include "db/rec/SpellChainEffectsRec.hpp" #include "db/rec/SpellChainEffectsRec.hpp"
#include "db/rec/SpellRec.hpp" #include "db/rec/SpellClassOptionsRec.hpp"
#include "db/rec/SpellCooldownsRec.hpp"
#include "db/rec/SpellDescriptionVariablesRec.hpp" #include "db/rec/SpellDescriptionVariablesRec.hpp"
#include "db/rec/SpellDifficultyRec.hpp" #include "db/rec/SpellDifficultyRec.hpp"
#include "db/rec/SpellDispelTypeRec.hpp" #include "db/rec/SpellDispelTypeRec.hpp"
#include "db/rec/SpellDurationRec.hpp" #include "db/rec/SpellDurationRec.hpp"
#include "db/rec/SpellEffectRec.hpp"
#include "db/rec/SpellEffectCameraShakesRec.hpp" #include "db/rec/SpellEffectCameraShakesRec.hpp"
#include "db/rec/SpellEquippedItemsRec.hpp"
#include "db/rec/SpellFocusObjectRec.hpp" #include "db/rec/SpellFocusObjectRec.hpp"
#include "db/rec/SpellIconRec.hpp" #include "db/rec/SpellIconRec.hpp"
#include "db/rec/SpellInterruptsRec.hpp"
#include "db/rec/SpellItemEnchantmentRec.hpp" #include "db/rec/SpellItemEnchantmentRec.hpp"
#include "db/rec/SpellItemEnchantmentConditionRec.hpp" #include "db/rec/SpellItemEnchantmentConditionRec.hpp"
#include "db/rec/SpellLevelsRec.hpp"
#include "db/rec/SpellMechanicRec.hpp" #include "db/rec/SpellMechanicRec.hpp"
#include "db/rec/SpellMissileRec.hpp" #include "db/rec/SpellMissileRec.hpp"
#include "db/rec/SpellMissileMotionRec.hpp" #include "db/rec/SpellMissileMotionRec.hpp"
#include "db/rec/SpellPowerRec.hpp"
#include "db/rec/SpellRadiusRec.hpp" #include "db/rec/SpellRadiusRec.hpp"
#include "db/rec/SpellRangeRec.hpp" #include "db/rec/SpellRangeRec.hpp"
#include "db/rec/SpellReagentsRec.hpp"
#include "db/rec/SpellRuneCostRec.hpp" #include "db/rec/SpellRuneCostRec.hpp"
#include "db/rec/SpellScalingRec.hpp"
#include "db/rec/SpellShapeshiftRec.hpp"
#include "db/rec/SpellShapeshiftFormRec.hpp" #include "db/rec/SpellShapeshiftFormRec.hpp"
#include "db/rec/SpellTargetRestrictionsRec.hpp"
#include "db/rec/SpellTotemsRec.hpp"
#include "db/rec/SpellVisualRec.hpp" #include "db/rec/SpellVisualRec.hpp"
#include "db/rec/SpellVisualEffectNameRec.hpp" #include "db/rec/SpellVisualEffectNameRec.hpp"
#include "db/rec/SpellVisualKitRec.hpp" #include "db/rec/SpellVisualKitRec.hpp"
#include "db/rec/SpellVisualKitAreaModelRec.hpp" #include "db/rec/SpellVisualKitAreaModelRec.hpp"
#include "db/rec/SpellVisualKitModelAttachRec.hpp" #include "db/rec/SpellVisualKitModelAttachRec.hpp"
#include "db/rec/SpellVisualPrecastTransitionsRec.hpp"
#include "db/rec/StableSlotPricesRec.hpp" #include "db/rec/StableSlotPricesRec.hpp"
#include "db/rec/Startup_StringsRec.hpp"
#include "db/rec/StationeryRec.hpp" #include "db/rec/StationeryRec.hpp"
#include "db/rec/StringLookupsRec.hpp" #include "db/rec/StringLookupsRec.hpp"
#include "db/rec/SummonPropertiesRec.hpp" #include "db/rec/SummonPropertiesRec.hpp"
@ -205,6 +256,7 @@
#include "db/rec/TaxiPathRec.hpp" #include "db/rec/TaxiPathRec.hpp"
#include "db/rec/TaxiPathNodeRec.hpp" #include "db/rec/TaxiPathNodeRec.hpp"
#include "db/rec/TeamContributionPointsRec.hpp" #include "db/rec/TeamContributionPointsRec.hpp"
#include "db/rec/TerrainMaterialRec.hpp"
#include "db/rec/TerrainTypeRec.hpp" #include "db/rec/TerrainTypeRec.hpp"
#include "db/rec/TerrainTypeSoundsRec.hpp" #include "db/rec/TerrainTypeSoundsRec.hpp"
#include "db/rec/TotemCategoryRec.hpp" #include "db/rec/TotemCategoryRec.hpp"
@ -216,55 +268,78 @@
#include "db/rec/UnitBloodLevelsRec.hpp" #include "db/rec/UnitBloodLevelsRec.hpp"
#include "db/rec/VehicleRec.hpp" #include "db/rec/VehicleRec.hpp"
#include "db/rec/VehicleSeatRec.hpp" #include "db/rec/VehicleSeatRec.hpp"
#include "db/rec/VehicleUIIndicatorRec.hpp"
#include "db/rec/VehicleUIIndSeatRec.hpp" #include "db/rec/VehicleUIIndSeatRec.hpp"
#include "db/rec/VehicleUIIndicatorRec.hpp"
#include "db/rec/VideoHardwareRec.hpp"
#include "db/rec/VocalUISoundsRec.hpp" #include "db/rec/VocalUISoundsRec.hpp"
#include "db/rec/WMOAreaTableRec.hpp" #include "db/rec/WMOAreaTableRec.hpp"
#include "db/rec/WeaponImpactSoundsRec.hpp" #include "db/rec/WeaponImpactSoundsRec.hpp"
#include "db/rec/WeaponSwingSounds2Rec.hpp" #include "db/rec/WeaponSwingSounds2Rec.hpp"
#include "db/rec/WeatherRec.hpp" #include "db/rec/WeatherRec.hpp"
#include "db/rec/WorldChunkSoundsRec.hpp"
#include "db/rec/WorldMapAreaRec.hpp" #include "db/rec/WorldMapAreaRec.hpp"
#include "db/rec/WorldMapTransformsRec.hpp"
#include "db/rec/WorldMapContinentRec.hpp" #include "db/rec/WorldMapContinentRec.hpp"
#include "db/rec/WorldMapOverlayRec.hpp" #include "db/rec/WorldMapOverlayRec.hpp"
#include "db/rec/WorldMapTransformsRec.hpp"
#include "db/rec/WorldSafeLocsRec.hpp" #include "db/rec/WorldSafeLocsRec.hpp"
#include "db/rec/WorldStateUIRec.hpp" #include "db/rec/WorldStateUIRec.hpp"
#include "db/rec/ZoneIntroMusicTableRec.hpp"
#include "db/rec/ZoneMusicRec.hpp"
#include "db/rec/WorldStateZoneSoundsRec.hpp" #include "db/rec/WorldStateZoneSoundsRec.hpp"
#include "db/rec/WorldChunkSoundsRec.hpp" #include "db/rec/WowError_StringsRec.hpp"
#include "db/rec/SoundEntriesAdvancedRec.hpp" #include "db/rec/ZoneIntroMusicTableRec.hpp"
#include "db/rec/ObjectEffectRec.hpp" #include "db/rec/ZoneLightRec.hpp"
#include "db/rec/ObjectEffectGroupRec.hpp" #include "db/rec/ZoneLightPointRec.hpp"
#include "db/rec/ObjectEffectModifierRec.hpp" #include "db/rec/ZoneMusicRec.hpp"
#include "db/rec/ObjectEffectPackageRec.hpp" #include "db/rec/gtBarberShopCostBaseRec.hpp"
#include "db/rec/ObjectEffectPackageElemRec.hpp" #include "db/rec/gtChanceToMeleeCritRec.hpp"
#include "db/rec/SoundFilterRec.hpp" #include "db/rec/gtChanceToMeleeCritBaseRec.hpp"
#include "db/rec/SoundFilterElemRec.hpp" #include "db/rec/gtChanceToSpellCritRec.hpp"
#include "db/rec/gtChanceToSpellCritBaseRec.hpp"
#include "db/rec/gtCombatRatingsRec.hpp"
#include "db/rec/gtNPCManaCostScalerRec.hpp"
#include "db/rec/gtOCTClassCombatRatingScalarRec.hpp"
#include "db/rec/gtOCTRegenHPRec.hpp"
#include "db/rec/gtOCTRegenMPRec.hpp"
#include "db/rec/gtRegenHPPerSptRec.hpp"
#include "db/rec/gtRegenMPPerSptRec.hpp"
#include "db/rec/gtSpellScalingRec.hpp"
extern WowClientDB<AchievementRec> g_achievementDB; extern WowClientDB<AchievementRec> g_achievementDB;
extern WowClientDB<Achievement_CriteriaRec> g_achievement_CriteriaDB;
extern WowClientDB<Achievement_CategoryRec> g_achievement_CategoryDB; extern WowClientDB<Achievement_CategoryRec> g_achievement_CategoryDB;
extern WowClientDB<Achievement_CriteriaRec> g_achievement_CriteriaDB;
extern WowClientDB<AnimKitRec> g_animKitDB;
extern WowClientDB<AnimKitBoneSetRec> g_animKitBoneSetDB;
extern WowClientDB<AnimKitBoneSetAliasRec> g_animKitBoneSetAliasDB;
extern WowClientDB<AnimKitConfigRec> g_animKitConfigDB;
extern WowClientDB<AnimKitConfigBoneSetRec> g_animKitConfigBoneSetDB;
extern WowClientDB<AnimKitPriorityRec> g_animKitPriorityDB;
extern WowClientDB<AnimKitSegmentRec> g_animKitSegmentDB;
extern WowClientDB<AnimReplacementRec> g_animReplacementDB;
extern WowClientDB<AnimReplacementSetRec> g_animReplacementSetDB;
extern WowClientDB<AnimationDataRec> g_animationDataDB; extern WowClientDB<AnimationDataRec> g_animationDataDB;
extern WowClientDB<AreaAssignmentRec> g_areaAssignmentDB;
extern WowClientDB<AreaGroupRec> g_areaGroupDB; extern WowClientDB<AreaGroupRec> g_areaGroupDB;
extern WowClientDB<AreaPOIRec> g_areaPOIDB; extern WowClientDB<AreaPOIRec> g_areaPOIDB;
extern WowClientDB<AreaTableRec> g_areaTableDB; extern WowClientDB<AreaTableRec> g_areaTableDB;
extern WowClientDB<AreaTriggerRec> g_areaTriggerDB; extern WowClientDB<AreaTriggerRec> g_areaTriggerDB;
extern WowClientDB<ArmorLocationRec> g_armorLocationDB;
extern WowClientDB<AttackAnimKitsRec> g_attackAnimKitsDB; extern WowClientDB<AttackAnimKitsRec> g_attackAnimKitsDB;
extern WowClientDB<AttackAnimTypesRec> g_attackAnimTypesDB; extern WowClientDB<AttackAnimTypesRec> g_attackAnimTypesDB;
extern WowClientDB<AuctionHouseRec> g_auctionHouseDB; extern WowClientDB<AuctionHouseRec> g_auctionHouseDB;
extern WowClientDB<BankBagSlotPricesRec> g_bankBagSlotPricesDB; extern WowClientDB<BankBagSlotPricesRec> g_bankBagSlotPricesDB;
extern WowClientDB<BannedAddOnsRec> g_bannedAddOnsDB; extern WowClientDB<BannedAddonsRec> g_bannedAddonsDB;
extern WowClientDB<BarberShopStyleRec> g_barberShopStyleDB; extern WowClientDB<BarberShopStyleRec> g_barberShopStyleDB;
extern WowClientDB<BattlemasterListRec> g_battlemasterListDB; extern WowClientDB<BattlemasterListRec> g_battlemasterListDB;
extern WowClientDB<CameraModeRec> g_cameraModeDB;
extern WowClientDB<CameraShakesRec> g_cameraShakesDB; extern WowClientDB<CameraShakesRec> g_cameraShakesDB;
extern WowClientDB<Cfg_CategoriesRec> g_cfg_CategoriesDB; extern WowClientDB<Cfg_CategoriesRec> g_cfg_CategoriesDB;
extern WowClientDB<Cfg_ConfigsRec> g_cfg_ConfigsDB; extern WowClientDB<Cfg_ConfigsRec> g_cfg_ConfigsDB;
extern WowClientDB<CharBaseInfoRec> g_charBaseInfoDB; extern WowClientDB<CharBaseInfoRec> g_charBaseInfoDB;
extern WowClientDB<CharHairGeosetsRec> g_charHairGeosetsDB; extern WowClientDB<CharHairGeosetsRec> g_charHairGeosetsDB;
extern WowClientDB<CharHairTexturesRec> g_charHairTexturesDB;
extern WowClientDB<CharSectionsRec> g_charSectionsDB; extern WowClientDB<CharSectionsRec> g_charSectionsDB;
extern WowClientDB<CharStartOutfitRec> g_charStartOutfitDB; extern WowClientDB<CharStartOutfitRec> g_charStartOutfitDB;
extern WowClientDB<CharTitlesRec> g_charTitlesDB; extern WowClientDB<CharTitlesRec> g_charTitlesDB;
extern WowClientDB<CharVariationsRec> g_charVariationsDB;
extern WowClientDB<CharacterFacialHairStylesRec> g_characterFacialHairStylesDB; extern WowClientDB<CharacterFacialHairStylesRec> g_characterFacialHairStylesDB;
extern WowClientDB<ChatChannelsRec> g_chatChannelsDB; extern WowClientDB<ChatChannelsRec> g_chatChannelsDB;
extern WowClientDB<ChatProfanityRec> g_chatProfanityDB; extern WowClientDB<ChatProfanityRec> g_chatProfanityDB;
@ -280,10 +355,12 @@ extern WowClientDB<CreatureMovementInfoRec> g_creatureMovementInfoDB;
extern WowClientDB<CreatureSoundDataRec> g_creatureSoundDataDB; extern WowClientDB<CreatureSoundDataRec> g_creatureSoundDataDB;
extern WowClientDB<CreatureSpellDataRec> g_creatureSpellDataDB; extern WowClientDB<CreatureSpellDataRec> g_creatureSpellDataDB;
extern WowClientDB<CreatureTypeRec> g_creatureTypeDB; extern WowClientDB<CreatureTypeRec> g_creatureTypeDB;
extern WowClientDB<CurrencyTypesRec> g_currencyTypesDB;
extern WowClientDB<CurrencyCategoryRec> g_currencyCategoryDB; extern WowClientDB<CurrencyCategoryRec> g_currencyCategoryDB;
extern WowClientDB<CurrencyTypesRec> g_currencyTypesDB;
extern WowClientDB<DanceMovesRec> g_danceMovesDB; extern WowClientDB<DanceMovesRec> g_danceMovesDB;
extern WowClientDB<DeathThudLookupsRec> g_deathThudLookupsDB; extern WowClientDB<DeathThudLookupsRec> g_deathThudLookupsDB;
extern WowClientDB<DeclinedWordRec> g_declinedWordDB;
extern WowClientDB<DeclinedWordCasesRec> g_declinedWordCasesDB;
extern WowClientDB<DestructibleModelDataRec> g_destructibleModelDataDB; extern WowClientDB<DestructibleModelDataRec> g_destructibleModelDataDB;
extern WowClientDB<DungeonEncounterRec> g_dungeonEncounterDB; extern WowClientDB<DungeonEncounterRec> g_dungeonEncounterDB;
extern WowClientDB<DungeonMapRec> g_dungeonMapDB; extern WowClientDB<DungeonMapRec> g_dungeonMapDB;
@ -302,40 +379,41 @@ extern WowClientDB<FactionTemplateRec> g_factionTemplateDB;
extern WowClientDB<FileDataRec> g_fileDataDB; extern WowClientDB<FileDataRec> g_fileDataDB;
extern WowClientDB<FootprintTexturesRec> g_footprintTexturesDB; extern WowClientDB<FootprintTexturesRec> g_footprintTexturesDB;
extern WowClientDB<FootstepTerrainLookupRec> g_footstepTerrainLookupDB; extern WowClientDB<FootstepTerrainLookupRec> g_footstepTerrainLookupDB;
extern WowClientDB<GameObjectArtKitRec> g_gameObjectArtKitDB;
extern WowClientDB<GameObjectDisplayInfoRec> g_gameObjectDisplayInfoDB;
extern WowClientDB<GameTablesRec> g_gameTablesDB;
extern WowClientDB<GameTipsRec> g_gameTipsDB;
extern WowClientDB<GemPropertiesRec> g_gemPropertiesDB;
extern WowClientDB<GlyphPropertiesRec> g_glyphPropertiesDB;
extern WowClientDB<GlyphSlotRec> g_glyphSlotDB;
extern WowClientDB<GMSurveyAnswersRec> g_gMSurveyAnswersDB; extern WowClientDB<GMSurveyAnswersRec> g_gMSurveyAnswersDB;
extern WowClientDB<GMSurveyCurrentSurveyRec> g_gMSurveyCurrentSurveyDB; extern WowClientDB<GMSurveyCurrentSurveyRec> g_gMSurveyCurrentSurveyDB;
extern WowClientDB<GMSurveyQuestionsRec> g_gMSurveyQuestionsDB; extern WowClientDB<GMSurveyQuestionsRec> g_gMSurveyQuestionsDB;
extern WowClientDB<GMSurveySurveysRec> g_gMSurveySurveysDB; extern WowClientDB<GMSurveySurveysRec> g_gMSurveySurveysDB;
extern WowClientDB<GMTicketCategoryRec> g_gMTicketCategoryDB; extern WowClientDB<GMTicketCategoryRec> g_gMTicketCategoryDB;
extern WowClientDB<GameObjectArtKitRec> g_gameObjectArtKitDB;
extern WowClientDB<GameObjectDisplayInfoRec> g_gameObjectDisplayInfoDB;
extern WowClientDB<GameTablesRec> g_gameTablesDB;
extern WowClientDB<GameTipsRec> g_gameTipsDB;
extern WowClientDB<GemPropertiesRec> g_gemPropertiesDB;
extern WowClientDB<GlueScreenEmoteRec> g_glueScreenEmoteDB;
extern WowClientDB<GlyphPropertiesRec> g_glyphPropertiesDB;
extern WowClientDB<GlyphSlotRec> g_glyphSlotDB;
extern WowClientDB<GroundEffectDoodadRec> g_groundEffectDoodadDB; extern WowClientDB<GroundEffectDoodadRec> g_groundEffectDoodadDB;
extern WowClientDB<GroundEffectTextureRec> g_groundEffectTextureDB; extern WowClientDB<GroundEffectTextureRec> g_groundEffectTextureDB;
extern WowClientDB<gtBarberShopCostBaseRec> g_gtBarberShopCostBaseDB; extern WowClientDB<GuildPerkSpellsRec> g_guildPerkSpellsDB;
extern WowClientDB<gtCombatRatingsRec> g_gtCombatRatingsDB;
extern WowClientDB<gtChanceToMeleeCritRec> g_gtChanceToMeleeCritDB;
extern WowClientDB<gtChanceToMeleeCritBaseRec> g_gtChanceToMeleeCritBaseDB;
extern WowClientDB<gtChanceToSpellCritRec> g_gtChanceToSpellCritDB;
extern WowClientDB<gtChanceToSpellCritBaseRec> g_gtChanceToSpellCritBaseDB;
extern WowClientDB<gtNPCManaCostScalerRec> g_gtNPCManaCostScalerDB;
extern WowClientDB<gtOCTClassCombatRatingScalarRec> g_gtOCTClassCombatRatingScalarDB;
extern WowClientDB<gtOCTRegenHPRec> g_gtOCTRegenHPDB;
extern WowClientDB<gtOCTRegenMPRec> g_gtOCTRegenMPDB;
extern WowClientDB<gtRegenHPPerSptRec> g_gtRegenHPPerSptDB;
extern WowClientDB<gtRegenMPPerSptRec> g_gtRegenMPPerSptDB;
extern WowClientDB<HelmetGeosetVisDataRec> g_helmetGeosetVisDataDB; extern WowClientDB<HelmetGeosetVisDataRec> g_helmetGeosetVisDataDB;
extern WowClientDB<HolidayDescriptionsRec> g_holidayDescriptionsDB; extern WowClientDB<HolidayDescriptionsRec> g_holidayDescriptionsDB;
extern WowClientDB<HolidayNamesRec> g_holidayNamesDB; extern WowClientDB<HolidayNamesRec> g_holidayNamesDB;
extern WowClientDB<HolidaysRec> g_holidaysDB; extern WowClientDB<HolidaysRec> g_holidaysDB;
extern WowClientDB<ItemRec> g_itemDB; extern WowClientDB<ItemRec> g_itemDB;
extern WowClientDB<ItemArmorQualityRec> g_itemArmorQualityDB;
extern WowClientDB<ItemArmorShieldRec> g_itemArmorShieldDB;
extern WowClientDB<ItemArmorTotalRec> g_itemArmorTotalDB;
extern WowClientDB<ItemBagFamilyRec> g_itemBagFamilyDB; extern WowClientDB<ItemBagFamilyRec> g_itemBagFamilyDB;
extern WowClientDB<ItemClassRec> g_itemClassDB; extern WowClientDB<ItemClassRec> g_itemClassDB;
extern WowClientDB<ItemCondExtCostsRec> g_itemCondExtCostsDB; extern WowClientDB<ItemCondExtCostsRec> g_itemCondExtCostsDB;
extern WowClientDB<ItemDamageAmmoRec> g_itemDamageAmmoDB;
extern WowClientDB<ItemDamageOneHandRec> g_itemDamageOneHandDB;
extern WowClientDB<ItemDamageOneHandCasterRec> g_itemDamageOneHandCasterDB;
extern WowClientDB<ItemDamageRangedRec> g_itemDamageRangedDB;
extern WowClientDB<ItemDamageThrownRec> g_itemDamageThrownDB;
extern WowClientDB<ItemDamageTwoHandRec> g_itemDamageTwoHandDB;
extern WowClientDB<ItemDamageTwoHandCasterRec> g_itemDamageTwoHandCasterDB;
extern WowClientDB<ItemDamageWandRec> g_itemDamageWandDB;
extern WowClientDB<ItemDisplayInfoRec> g_itemDisplayInfoDB; extern WowClientDB<ItemDisplayInfoRec> g_itemDisplayInfoDB;
extern WowClientDB<ItemExtendedCostRec> g_itemExtendedCostDB; extern WowClientDB<ItemExtendedCostRec> g_itemExtendedCostDB;
extern WowClientDB<ItemGroupSoundsRec> g_itemGroupSoundsDB; extern WowClientDB<ItemGroupSoundsRec> g_itemGroupSoundsDB;
@ -344,96 +422,130 @@ extern WowClientDB<ItemPetFoodRec> g_itemPetFoodDB;
extern WowClientDB<ItemPurchaseGroupRec> g_itemPurchaseGroupDB; extern WowClientDB<ItemPurchaseGroupRec> g_itemPurchaseGroupDB;
extern WowClientDB<ItemRandomPropertiesRec> g_itemRandomPropertiesDB; extern WowClientDB<ItemRandomPropertiesRec> g_itemRandomPropertiesDB;
extern WowClientDB<ItemRandomSuffixRec> g_itemRandomSuffixDB; extern WowClientDB<ItemRandomSuffixRec> g_itemRandomSuffixDB;
extern WowClientDB<ItemReforgeRec> g_itemReforgeDB;
extern WowClientDB<ItemSetRec> g_itemSetDB; extern WowClientDB<ItemSetRec> g_itemSetDB;
extern WowClientDB<ItemSubClassRec> g_itemSubClassDB; extern WowClientDB<ItemSubClassRec> g_itemSubClassDB;
extern WowClientDB<ItemSubClassMaskRec> g_itemSubClassMaskDB; extern WowClientDB<ItemSubClassMaskRec> g_itemSubClassMaskDB;
extern WowClientDB<ItemVisualEffectsRec> g_itemVisualEffectsDB; extern WowClientDB<ItemVisualEffectsRec> g_itemVisualEffectsDB;
extern WowClientDB<ItemVisualsRec> g_itemVisualsDB; extern WowClientDB<ItemVisualsRec> g_itemVisualsDB;
extern WowClientDB<LFGDungeonExpansionRec> g_lFGDungeonExpansionDB;
extern WowClientDB<LFGDungeonGroupRec> g_lFGDungeonGroupDB;
extern WowClientDB<LFGDungeonsRec> g_lFGDungeonsDB;
extern WowClientDB<LanguageWordsRec> g_languageWordsDB; extern WowClientDB<LanguageWordsRec> g_languageWordsDB;
extern WowClientDB<LanguagesRec> g_languagesDB; extern WowClientDB<LanguagesRec> g_languagesDB;
extern WowClientDB<LfgDungeonExpansionRec> g_lfgDungeonExpansionDB;
extern WowClientDB<LfgDungeonGroupRec> g_lfgDungeonGroupDB;
extern WowClientDB<LfgDungeonsRec> g_lfgDungeonsDB;
extern WowClientDB<LightRec> g_lightDB; extern WowClientDB<LightRec> g_lightDB;
extern WowClientDB<LightFloatBandRec> g_lightFloatBandDB; extern WowClientDB<LightFloatBandRec> g_lightFloatBandDB;
extern WowClientDB<LightIntBandRec> g_lightIntBandDB; extern WowClientDB<LightIntBandRec> g_lightIntBandDB;
extern WowClientDB<LightParamsRec> g_lightParamsDB; extern WowClientDB<LightParamsRec> g_lightParamsDB;
extern WowClientDB<LightSkyboxRec> g_lightSkyboxDB; extern WowClientDB<LightSkyboxRec> g_lightSkyboxDB;
extern WowClientDB<LiquidTypeRec> g_liquidTypeDB;
extern WowClientDB<LiquidMaterialRec> g_liquidMaterialDB; extern WowClientDB<LiquidMaterialRec> g_liquidMaterialDB;
extern WowClientDB<LoadingScreensRec> g_loadingScreensDB; extern WowClientDB<LiquidObjectRec> g_liquidObjectDB;
extern WowClientDB<LiquidTypeRec> g_liquidTypeDB;
extern WowClientDB<LoadingScreenTaxiSplinesRec> g_loadingScreenTaxiSplinesDB; extern WowClientDB<LoadingScreenTaxiSplinesRec> g_loadingScreenTaxiSplinesDB;
extern WowClientDB<LoadingScreensRec> g_loadingScreensDB;
extern WowClientDB<LockRec> g_lockDB; extern WowClientDB<LockRec> g_lockDB;
extern WowClientDB<LockTypeRec> g_lockTypeDB; extern WowClientDB<LockTypeRec> g_lockTypeDB;
extern WowClientDB<MailTemplateRec> g_mailTemplateDB; extern WowClientDB<MailTemplateRec> g_mailTemplateDB;
extern WowClientDB<MapRec> g_mapDB; extern WowClientDB<MapRec> g_mapDB;
extern WowClientDB<MapDifficultyRec> g_mapDifficultyDB; extern WowClientDB<MapDifficultyRec> g_mapDifficultyDB;
extern WowClientDB<MaterialRec> g_materialDB; extern WowClientDB<MaterialRec> g_materialDB;
extern WowClientDB<MountTypeRec> g_mountTypeDB;
extern WowClientDB<MovieRec> g_movieDB; extern WowClientDB<MovieRec> g_movieDB;
extern WowClientDB<MovieFileDataRec> g_movieFileDataDB; extern WowClientDB<MovieFileDataRec> g_movieFileDataDB;
extern WowClientDB<MovieVariationRec> g_movieVariationDB; extern WowClientDB<MovieVariationRec> g_movieVariationDB;
extern WowClientDB<NameGenRec> g_nameGenDB;
extern WowClientDB<NPCSoundsRec> g_nPCSoundsDB; extern WowClientDB<NPCSoundsRec> g_nPCSoundsDB;
extern WowClientDB<NameGenRec> g_nameGenDB;
extern WowClientDB<NamesProfanityRec> g_namesProfanityDB; extern WowClientDB<NamesProfanityRec> g_namesProfanityDB;
extern WowClientDB<NamesReservedRec> g_namesReservedDB; extern WowClientDB<NamesReservedRec> g_namesReservedDB;
extern WowClientDB<ObjectEffectRec> g_objectEffectDB;
extern WowClientDB<ObjectEffectGroupRec> g_objectEffectGroupDB;
extern WowClientDB<ObjectEffectModifierRec> g_objectEffectModifierDB;
extern WowClientDB<ObjectEffectPackageRec> g_objectEffectPackageDB;
extern WowClientDB<ObjectEffectPackageElemRec> g_objectEffectPackageElemDB;
extern WowClientDB<OverrideSpellDataRec> g_overrideSpellDataDB; extern WowClientDB<OverrideSpellDataRec> g_overrideSpellDataDB;
extern WowClientDB<PVPDifficultyRec> g_pVPDifficultyDB;
extern WowClientDB<PackageRec> g_packageDB; extern WowClientDB<PackageRec> g_packageDB;
extern WowClientDB<PageTextMaterialRec> g_pageTextMaterialDB; extern WowClientDB<PageTextMaterialRec> g_pageTextMaterialDB;
extern WowClientDB<PaperDollItemFrameRec> g_paperDollItemFrameDB; extern WowClientDB<PaperDollItemFrameRec> g_paperDollItemFrameDB;
extern WowClientDB<ParticleColorRec> g_particleColorDB; extern WowClientDB<ParticleColorRec> g_particleColorDB;
extern WowClientDB<PetPersonalityRec> g_petPersonalityDB; extern WowClientDB<PetPersonalityRec> g_petPersonalityDB;
extern WowClientDB<PetitionTypeRec> g_petitionTypeDB;
extern WowClientDB<PhaseRec> g_phaseDB;
extern WowClientDB<PhaseShiftZoneSoundsRec> g_phaseShiftZoneSoundsDB;
extern WowClientDB<PhaseXPhaseGroupRec> g_phaseXPhaseGroupDB;
extern WowClientDB<PowerDisplayRec> g_powerDisplayDB; extern WowClientDB<PowerDisplayRec> g_powerDisplayDB;
extern WowClientDB<PvpDifficultyRec> g_pvpDifficultyDB;
extern WowClientDB<QuestFactionRewardRec> g_questFactionRewardDB; extern WowClientDB<QuestFactionRewardRec> g_questFactionRewardDB;
extern WowClientDB<QuestInfoRec> g_questInfoDB; extern WowClientDB<QuestInfoRec> g_questInfoDB;
extern WowClientDB<QuestSortRec> g_questSortDB; extern WowClientDB<QuestSortRec> g_questSortDB;
extern WowClientDB<QuestXPRec> g_questXPDB; extern WowClientDB<QuestXPRec> g_questXPDB;
extern WowClientDB<ResistancesRec> g_resistancesDB;
extern WowClientDB<RandPropPointsRec> g_randPropPointsDB; extern WowClientDB<RandPropPointsRec> g_randPropPointsDB;
extern WowClientDB<ResearchBranchRec> g_researchBranchDB;
extern WowClientDB<ResistancesRec> g_resistancesDB;
extern WowClientDB<ScalingStatDistributionRec> g_scalingStatDistributionDB; extern WowClientDB<ScalingStatDistributionRec> g_scalingStatDistributionDB;
extern WowClientDB<ScalingStatValuesRec> g_scalingStatValuesDB; extern WowClientDB<ScalingStatValuesRec> g_scalingStatValuesDB;
extern WowClientDB<ScreenEffectRec> g_screenEffectDB; extern WowClientDB<ScreenEffectRec> g_screenEffectDB;
extern WowClientDB<ServerMessagesRec> g_serverMessagesDB; extern WowClientDB<ServerMessagesRec> g_serverMessagesDB;
extern WowClientDB<SheatheSoundLookupsRec> g_sheatheSoundLookupsDB; extern WowClientDB<SheatheSoundLookupsRec> g_sheatheSoundLookupsDB;
extern WowClientDB<SkillCostsDataRec> g_skillCostsDataDB; extern WowClientDB<SkillCostsDataRec> g_skillCostsDataDB;
extern WowClientDB<SkillLineRec> g_skillLineDB;
extern WowClientDB<SkillLineAbilityRec> g_skillLineAbilityDB; extern WowClientDB<SkillLineAbilityRec> g_skillLineAbilityDB;
extern WowClientDB<SkillLineCategoryRec> g_skillLineCategoryDB; extern WowClientDB<SkillLineCategoryRec> g_skillLineCategoryDB;
extern WowClientDB<SkillLineRec> g_skillLineDB;
extern WowClientDB<SkillRaceClassInfoRec> g_skillRaceClassInfoDB; extern WowClientDB<SkillRaceClassInfoRec> g_skillRaceClassInfoDB;
extern WowClientDB<SkillTiersRec> g_skillTiersDB; extern WowClientDB<SkillTiersRec> g_skillTiersDB;
extern WowClientDB<SoundAmbienceRec> g_soundAmbienceDB; extern WowClientDB<SoundAmbienceRec> g_soundAmbienceDB;
extern WowClientDB<SoundEmittersRec> g_soundEmittersDB; extern WowClientDB<SoundEmittersRec> g_soundEmittersDB;
extern WowClientDB<SoundEntriesRec> g_soundEntriesDB; extern WowClientDB<SoundEntriesRec> g_soundEntriesDB;
extern WowClientDB<SoundEntriesAdvancedRec> g_soundEntriesAdvancedDB;
extern WowClientDB<SoundFilterRec> g_soundFilterDB;
extern WowClientDB<SoundFilterElemRec> g_soundFilterElemDB;
extern WowClientDB<SoundProviderPreferencesRec> g_soundProviderPreferencesDB; extern WowClientDB<SoundProviderPreferencesRec> g_soundProviderPreferencesDB;
extern WowClientDB<SoundSamplePreferencesRec> g_soundSamplePreferencesDB; extern WowClientDB<SoundSamplePreferencesRec> g_soundSamplePreferencesDB;
extern WowClientDB<SoundWaterTypeRec> g_soundWaterTypeDB; extern WowClientDB<SoundWaterTypeRec> g_soundWaterTypeDB;
extern WowClientDB<SpamMessagesRec> g_spamMessagesDB; extern WowClientDB<SpamMessagesRec> g_spamMessagesDB;
extern WowClientDB<SpellRec> g_spellDB;
extern WowClientDB<SpellAuraOptionsRec> g_spellAuraOptionsDB;
extern WowClientDB<SpellAuraRestrictionsRec> g_spellAuraRestrictionsDB;
extern WowClientDB<SpellCastTimesRec> g_spellCastTimesDB; extern WowClientDB<SpellCastTimesRec> g_spellCastTimesDB;
extern WowClientDB<SpellCastingRequirementsRec> g_spellCastingRequirementsDB;
extern WowClientDB<SpellCategoriesRec> g_spellCategoriesDB;
extern WowClientDB<SpellCategoryRec> g_spellCategoryDB; extern WowClientDB<SpellCategoryRec> g_spellCategoryDB;
extern WowClientDB<SpellChainEffectsRec> g_spellChainEffectsDB; extern WowClientDB<SpellChainEffectsRec> g_spellChainEffectsDB;
extern WowClientDB<SpellRec> g_spellDB; extern WowClientDB<SpellClassOptionsRec> g_spellClassOptionsDB;
extern WowClientDB<SpellCooldownsRec> g_spellCooldownsDB;
extern WowClientDB<SpellDescriptionVariablesRec> g_spellDescriptionVariablesDB; extern WowClientDB<SpellDescriptionVariablesRec> g_spellDescriptionVariablesDB;
extern WowClientDB<SpellDifficultyRec> g_spellDifficultyDB; extern WowClientDB<SpellDifficultyRec> g_spellDifficultyDB;
extern WowClientDB<SpellDispelTypeRec> g_spellDispelTypeDB; extern WowClientDB<SpellDispelTypeRec> g_spellDispelTypeDB;
extern WowClientDB<SpellDurationRec> g_spellDurationDB; extern WowClientDB<SpellDurationRec> g_spellDurationDB;
extern WowClientDB<SpellEffectRec> g_spellEffectDB;
extern WowClientDB<SpellEffectCameraShakesRec> g_spellEffectCameraShakesDB; extern WowClientDB<SpellEffectCameraShakesRec> g_spellEffectCameraShakesDB;
extern WowClientDB<SpellEquippedItemsRec> g_spellEquippedItemsDB;
extern WowClientDB<SpellFocusObjectRec> g_spellFocusObjectDB; extern WowClientDB<SpellFocusObjectRec> g_spellFocusObjectDB;
extern WowClientDB<SpellIconRec> g_spellIconDB; extern WowClientDB<SpellIconRec> g_spellIconDB;
extern WowClientDB<SpellInterruptsRec> g_spellInterruptsDB;
extern WowClientDB<SpellItemEnchantmentRec> g_spellItemEnchantmentDB; extern WowClientDB<SpellItemEnchantmentRec> g_spellItemEnchantmentDB;
extern WowClientDB<SpellItemEnchantmentConditionRec> g_spellItemEnchantmentConditionDB; extern WowClientDB<SpellItemEnchantmentConditionRec> g_spellItemEnchantmentConditionDB;
extern WowClientDB<SpellLevelsRec> g_spellLevelsDB;
extern WowClientDB<SpellMechanicRec> g_spellMechanicDB; extern WowClientDB<SpellMechanicRec> g_spellMechanicDB;
extern WowClientDB<SpellMissileRec> g_spellMissileDB; extern WowClientDB<SpellMissileRec> g_spellMissileDB;
extern WowClientDB<SpellMissileMotionRec> g_spellMissileMotionDB; extern WowClientDB<SpellMissileMotionRec> g_spellMissileMotionDB;
extern WowClientDB<SpellPowerRec> g_spellPowerDB;
extern WowClientDB<SpellRadiusRec> g_spellRadiusDB; extern WowClientDB<SpellRadiusRec> g_spellRadiusDB;
extern WowClientDB<SpellRangeRec> g_spellRangeDB; extern WowClientDB<SpellRangeRec> g_spellRangeDB;
extern WowClientDB<SpellReagentsRec> g_spellReagentsDB;
extern WowClientDB<SpellRuneCostRec> g_spellRuneCostDB; extern WowClientDB<SpellRuneCostRec> g_spellRuneCostDB;
extern WowClientDB<SpellScalingRec> g_spellScalingDB;
extern WowClientDB<SpellShapeshiftRec> g_spellShapeshiftDB;
extern WowClientDB<SpellShapeshiftFormRec> g_spellShapeshiftFormDB; extern WowClientDB<SpellShapeshiftFormRec> g_spellShapeshiftFormDB;
extern WowClientDB<SpellTargetRestrictionsRec> g_spellTargetRestrictionsDB;
extern WowClientDB<SpellTotemsRec> g_spellTotemsDB;
extern WowClientDB<SpellVisualRec> g_spellVisualDB; extern WowClientDB<SpellVisualRec> g_spellVisualDB;
extern WowClientDB<SpellVisualEffectNameRec> g_spellVisualEffectNameDB; extern WowClientDB<SpellVisualEffectNameRec> g_spellVisualEffectNameDB;
extern WowClientDB<SpellVisualKitRec> g_spellVisualKitDB; extern WowClientDB<SpellVisualKitRec> g_spellVisualKitDB;
extern WowClientDB<SpellVisualKitAreaModelRec> g_spellVisualKitAreaModelDB; extern WowClientDB<SpellVisualKitAreaModelRec> g_spellVisualKitAreaModelDB;
extern WowClientDB<SpellVisualKitModelAttachRec> g_spellVisualKitModelAttachDB; extern WowClientDB<SpellVisualKitModelAttachRec> g_spellVisualKitModelAttachDB;
extern WowClientDB<SpellVisualPrecastTransitionsRec> g_spellVisualPrecastTransitionsDB;
extern WowClientDB<StableSlotPricesRec> g_stableSlotPricesDB; extern WowClientDB<StableSlotPricesRec> g_stableSlotPricesDB;
extern WowClientDB<Startup_StringsRec> g_startup_StringsDB;
extern WowClientDB<StationeryRec> g_stationeryDB; extern WowClientDB<StationeryRec> g_stationeryDB;
extern WowClientDB<StringLookupsRec> g_stringLookupsDB; extern WowClientDB<StringLookupsRec> g_stringLookupsDB;
extern WowClientDB<SummonPropertiesRec> g_summonPropertiesDB; extern WowClientDB<SummonPropertiesRec> g_summonPropertiesDB;
@ -443,6 +555,7 @@ extern WowClientDB<TaxiNodesRec> g_taxiNodesDB;
extern WowClientDB<TaxiPathRec> g_taxiPathDB; extern WowClientDB<TaxiPathRec> g_taxiPathDB;
extern WowClientDB<TaxiPathNodeRec> g_taxiPathNodeDB; extern WowClientDB<TaxiPathNodeRec> g_taxiPathNodeDB;
extern WowClientDB<TeamContributionPointsRec> g_teamContributionPointsDB; extern WowClientDB<TeamContributionPointsRec> g_teamContributionPointsDB;
extern WowClientDB<TerrainMaterialRec> g_terrainMaterialDB;
extern WowClientDB<TerrainTypeRec> g_terrainTypeDB; extern WowClientDB<TerrainTypeRec> g_terrainTypeDB;
extern WowClientDB<TerrainTypeSoundsRec> g_terrainTypeSoundsDB; extern WowClientDB<TerrainTypeSoundsRec> g_terrainTypeSoundsDB;
extern WowClientDB<TotemCategoryRec> g_totemCategoryDB; extern WowClientDB<TotemCategoryRec> g_totemCategoryDB;
@ -454,31 +567,40 @@ extern WowClientDB<UnitBloodRec> g_unitBloodDB;
extern WowClientDB<UnitBloodLevelsRec> g_unitBloodLevelsDB; extern WowClientDB<UnitBloodLevelsRec> g_unitBloodLevelsDB;
extern WowClientDB<VehicleRec> g_vehicleDB; extern WowClientDB<VehicleRec> g_vehicleDB;
extern WowClientDB<VehicleSeatRec> g_vehicleSeatDB; extern WowClientDB<VehicleSeatRec> g_vehicleSeatDB;
extern WowClientDB<VehicleUIIndicatorRec> g_vehicleUIIndicatorDB;
extern WowClientDB<VehicleUIIndSeatRec> g_vehicleUIIndSeatDB; extern WowClientDB<VehicleUIIndSeatRec> g_vehicleUIIndSeatDB;
extern WowClientDB<VehicleUIIndicatorRec> g_vehicleUIIndicatorDB;
extern WowClientDB<VideoHardwareRec> g_videoHardwareDB;
extern WowClientDB<VocalUISoundsRec> g_vocalUISoundsDB; extern WowClientDB<VocalUISoundsRec> g_vocalUISoundsDB;
extern WowClientDB<WMOAreaTableRec> g_wMOAreaTableDB; extern WowClientDB<WMOAreaTableRec> g_wMOAreaTableDB;
extern WowClientDB<WeaponImpactSoundsRec> g_weaponImpactSoundsDB; extern WowClientDB<WeaponImpactSoundsRec> g_weaponImpactSoundsDB;
extern WowClientDB<WeaponSwingSounds2Rec> g_weaponSwingSounds2DB; extern WowClientDB<WeaponSwingSounds2Rec> g_weaponSwingSounds2DB;
extern WowClientDB<WeatherRec> g_weatherDB; extern WowClientDB<WeatherRec> g_weatherDB;
extern WowClientDB<WorldChunkSoundsRec> g_worldChunkSoundsDB;
extern WowClientDB<WorldMapAreaRec> g_worldMapAreaDB; extern WowClientDB<WorldMapAreaRec> g_worldMapAreaDB;
extern WowClientDB<WorldMapTransformsRec> g_worldMapTransformsDB;
extern WowClientDB<WorldMapContinentRec> g_worldMapContinentDB; extern WowClientDB<WorldMapContinentRec> g_worldMapContinentDB;
extern WowClientDB<WorldMapOverlayRec> g_worldMapOverlayDB; extern WowClientDB<WorldMapOverlayRec> g_worldMapOverlayDB;
extern WowClientDB<WorldMapTransformsRec> g_worldMapTransformsDB;
extern WowClientDB<WorldSafeLocsRec> g_worldSafeLocsDB; extern WowClientDB<WorldSafeLocsRec> g_worldSafeLocsDB;
extern WowClientDB<WorldStateUIRec> g_worldStateUIDB; extern WowClientDB<WorldStateUIRec> g_worldStateUIDB;
extern WowClientDB<ZoneIntroMusicTableRec> g_zoneIntroMusicTableDB;
extern WowClientDB<ZoneMusicRec> g_zoneMusicDB;
extern WowClientDB<WorldStateZoneSoundsRec> g_worldStateZoneSoundsDB; extern WowClientDB<WorldStateZoneSoundsRec> g_worldStateZoneSoundsDB;
extern WowClientDB<WorldChunkSoundsRec> g_worldChunkSoundsDB; extern WowClientDB<WowError_StringsRec> g_wowError_StringsDB;
extern WowClientDB<SoundEntriesAdvancedRec> g_soundEntriesAdvancedDB; extern WowClientDB<ZoneIntroMusicTableRec> g_zoneIntroMusicTableDB;
extern WowClientDB<ObjectEffectRec> g_objectEffectDB; extern WowClientDB<ZoneLightRec> g_zoneLightDB;
extern WowClientDB<ObjectEffectGroupRec> g_objectEffectGroupDB; extern WowClientDB<ZoneLightPointRec> g_zoneLightPointDB;
extern WowClientDB<ObjectEffectModifierRec> g_objectEffectModifierDB; extern WowClientDB<ZoneMusicRec> g_zoneMusicDB;
extern WowClientDB<ObjectEffectPackageRec> g_objectEffectPackageDB; extern WowClientDB<gtBarberShopCostBaseRec> g_gtBarberShopCostBaseDB;
extern WowClientDB<ObjectEffectPackageElemRec> g_objectEffectPackageElemDB; extern WowClientDB<gtChanceToMeleeCritRec> g_gtChanceToMeleeCritDB;
extern WowClientDB<SoundFilterRec> g_soundFilterDB; extern WowClientDB<gtChanceToMeleeCritBaseRec> g_gtChanceToMeleeCritBaseDB;
extern WowClientDB<SoundFilterElemRec> g_soundFilterElemDB; extern WowClientDB<gtChanceToSpellCritRec> g_gtChanceToSpellCritDB;
extern WowClientDB<gtChanceToSpellCritBaseRec> g_gtChanceToSpellCritBaseDB;
extern WowClientDB<gtCombatRatingsRec> g_gtCombatRatingsDB;
extern WowClientDB<gtNPCManaCostScalerRec> g_gtNPCManaCostScalerDB;
extern WowClientDB<gtOCTClassCombatRatingScalarRec> g_gtOCTClassCombatRatingScalarDB;
extern WowClientDB<gtOCTRegenHPRec> g_gtOCTRegenHPDB;
extern WowClientDB<gtOCTRegenMPRec> g_gtOCTRegenMPDB;
extern WowClientDB<gtRegenHPPerSptRec> g_gtRegenHPPerSptDB;
extern WowClientDB<gtRegenMPPerSptRec> g_gtRegenMPPerSptDB;
extern WowClientDB<gtSpellScalingRec> g_gtSpellScalingDB;
void StaticDBLoadAll(void (*loadFn)(WowClientDB_Base*, const char*, int32_t)); void StaticDBLoadAll(void (*loadFn)(WowClientDB_Base*, const char*, int32_t));

View File

@ -159,10 +159,6 @@ void WowClientDB<T>::LoadRecords(SFile* f, const char* filename, int32_t linenum
auto record = &this->m_records[i]; auto record = &this->m_records[i];
record->Read(f, this->m_strings); record->Read(f, this->m_strings);
if (T::NeedIDAssigned()) {
record->SetID(i);
}
this->m_maxID = record->GetID() > this->m_maxID ? record->GetID() : this->m_maxID; this->m_maxID = record->GetID() > this->m_maxID ? record->GetID() : this->m_maxID;
this->m_minID = record->GetID() < this->m_minID ? record->GetID() : this->m_minID; this->m_minID = record->GetID() < this->m_minID ? record->GetID() : this->m_minID;
} }

1
src/db/rec/AchievementRec.cpp Executable file → Normal file
View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AchievementRec.hpp" #include "db/rec/AchievementRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AchievementRec::GetFilename() { const char* AchievementRec::GetFilename() {

0
src/db/rec/AchievementRec.hpp Executable file → Normal file
View File

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/Achievement_CategoryRec.hpp" #include "db/rec/Achievement_CategoryRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* Achievement_CategoryRec::GetFilename() { const char* Achievement_CategoryRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/Achievement_CriteriaRec.hpp" #include "db/rec/Achievement_CriteriaRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* Achievement_CriteriaRec::GetFilename() { const char* Achievement_CriteriaRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AnimKitBoneSetAliasRec.hpp" #include "db/rec/AnimKitBoneSetAliasRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AnimKitBoneSetAliasRec::GetFilename() { const char* AnimKitBoneSetAliasRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AnimKitBoneSetRec.hpp" #include "db/rec/AnimKitBoneSetRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AnimKitBoneSetRec::GetFilename() { const char* AnimKitBoneSetRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AnimKitConfigBoneSetRec.hpp" #include "db/rec/AnimKitConfigBoneSetRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AnimKitConfigBoneSetRec::GetFilename() { const char* AnimKitConfigBoneSetRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AnimKitConfigRec.hpp" #include "db/rec/AnimKitConfigRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AnimKitConfigRec::GetFilename() { const char* AnimKitConfigRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AnimKitPriorityRec.hpp" #include "db/rec/AnimKitPriorityRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AnimKitPriorityRec::GetFilename() { const char* AnimKitPriorityRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AnimKitRec.hpp" #include "db/rec/AnimKitRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AnimKitRec::GetFilename() { const char* AnimKitRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AnimKitSegmentRec.hpp" #include "db/rec/AnimKitSegmentRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AnimKitSegmentRec::GetFilename() { const char* AnimKitSegmentRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AnimReplacementRec.hpp" #include "db/rec/AnimReplacementRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AnimReplacementRec::GetFilename() { const char* AnimReplacementRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AnimReplacementSetRec.hpp" #include "db/rec/AnimReplacementSetRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AnimReplacementSetRec::GetFilename() { const char* AnimReplacementSetRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AnimationDataRec.hpp" #include "db/rec/AnimationDataRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AnimationDataRec::GetFilename() { const char* AnimationDataRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AreaAssignmentRec.hpp" #include "db/rec/AreaAssignmentRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AreaAssignmentRec::GetFilename() { const char* AreaAssignmentRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AreaGroupRec.hpp" #include "db/rec/AreaGroupRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AreaGroupRec::GetFilename() { const char* AreaGroupRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AreaPOIRec.hpp" #include "db/rec/AreaPOIRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AreaPOIRec::GetFilename() { const char* AreaPOIRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AreaTableRec.hpp" #include "db/rec/AreaTableRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AreaTableRec::GetFilename() { const char* AreaTableRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AreaTriggerRec.hpp" #include "db/rec/AreaTriggerRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AreaTriggerRec::GetFilename() { const char* AreaTriggerRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/ArmorLocationRec.hpp" #include "db/rec/ArmorLocationRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* ArmorLocationRec::GetFilename() { const char* ArmorLocationRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AttackAnimKitsRec.hpp" #include "db/rec/AttackAnimKitsRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AttackAnimKitsRec::GetFilename() { const char* AttackAnimKitsRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AttackAnimTypesRec.hpp" #include "db/rec/AttackAnimTypesRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AttackAnimTypesRec::GetFilename() { const char* AttackAnimTypesRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/AuctionHouseRec.hpp" #include "db/rec/AuctionHouseRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* AuctionHouseRec::GetFilename() { const char* AuctionHouseRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/BankBagSlotPricesRec.hpp" #include "db/rec/BankBagSlotPricesRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* BankBagSlotPricesRec::GetFilename() { const char* BankBagSlotPricesRec::GetFilename() {

View File

@ -1,48 +0,0 @@
// DO NOT EDIT: generated by whoa-autocode
#include "db/rec/BannedAddOnsRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp"
const char* BannedAddOnsRec::GetFilename() {
return "DBFilesClient\\BannedAddOns.dbc";
}
uint32_t BannedAddOnsRec::GetNumColumns() {
return 11;
}
uint32_t BannedAddOnsRec::GetRowSize() {
return 44;
}
bool BannedAddOnsRec::NeedIDAssigned() {
return false;
}
int32_t BannedAddOnsRec::GetID() {
return this->m_ID;
}
void BannedAddOnsRec::SetID(int32_t id) {
this->m_ID = id;
}
bool BannedAddOnsRec::Read(SFile* f, const char* stringBuffer) {
if (
!SFile::Read(f, &this->m_ID, sizeof(this->m_ID), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &this->m_nameMd5[0], sizeof(m_nameMd5[0]), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &this->m_nameMd5[1], sizeof(m_nameMd5[0]), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &this->m_nameMd5[2], sizeof(m_nameMd5[0]), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &this->m_nameMd5[3], sizeof(m_nameMd5[0]), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &this->m_versionMd5[0], sizeof(m_versionMd5[0]), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &this->m_versionMd5[1], sizeof(m_versionMd5[0]), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &this->m_versionMd5[2], sizeof(m_versionMd5[0]), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &this->m_versionMd5[3], sizeof(m_versionMd5[0]), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &this->m_lastModified, sizeof(this->m_lastModified), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &this->m_flags, sizeof(this->m_flags), nullptr, nullptr, nullptr)
) {
return false;
}
return true;
}

View File

@ -1,26 +0,0 @@
// DO NOT EDIT: generated by whoa-autocode
#ifndef DB_REC_BANNED_ADD_ONS_REC_HPP
#define DB_REC_BANNED_ADD_ONS_REC_HPP
#include <cstdint>
class SFile;
class BannedAddOnsRec {
public:
int32_t m_ID;
int32_t m_nameMd5[4];
int32_t m_versionMd5[4];
int32_t m_lastModified;
int32_t m_flags;
static const char* GetFilename();
static uint32_t GetNumColumns();
static uint32_t GetRowSize();
static bool NeedIDAssigned();
int32_t GetID();
void SetID(int32_t id);
bool Read(SFile* f, const char* stringBuffer);
};
#endif

View File

@ -1,33 +1,32 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/BannedAddOnsRec.hpp" #include "db/rec/BannedAddonsRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* BannedAddOnsRec::GetFilename() { const char* BannedAddonsRec::GetFilename() {
return "DBFilesClient\\BannedAddOns.dbc"; return "DBFilesClient\\BannedAddons.dbc";
} }
uint32_t BannedAddOnsRec::GetNumColumns() { uint32_t BannedAddonsRec::GetNumColumns() {
return 11; return 11;
} }
uint32_t BannedAddOnsRec::GetRowSize() { uint32_t BannedAddonsRec::GetRowSize() {
return 44; return 44;
} }
bool BannedAddOnsRec::NeedIDAssigned() { bool BannedAddonsRec::NeedIDAssigned() {
return false; return false;
} }
int32_t BannedAddOnsRec::GetID() { int32_t BannedAddonsRec::GetID() {
return this->m_ID; return this->m_ID;
} }
void BannedAddOnsRec::SetID(int32_t id) { void BannedAddonsRec::SetID(int32_t id) {
this->m_ID = id; this->m_ID = id;
} }
bool BannedAddOnsRec::Read(SFile* f, const char* stringBuffer) { bool BannedAddonsRec::Read(SFile* f, const char* stringBuffer) {
if ( if (
!SFile::Read(f, &this->m_ID, sizeof(this->m_ID), nullptr, nullptr, nullptr) !SFile::Read(f, &this->m_ID, sizeof(this->m_ID), nullptr, nullptr, nullptr)
|| !SFile::Read(f, &this->m_nameMd5[0], sizeof(m_nameMd5[0]), nullptr, nullptr, nullptr) || !SFile::Read(f, &this->m_nameMd5[0], sizeof(m_nameMd5[0]), nullptr, nullptr, nullptr)

View File

@ -1,12 +1,12 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#ifndef DB_REC_BANNED_ADD_ONS_REC_HPP #ifndef DB_REC_BANNED_ADDONS_REC_HPP
#define DB_REC_BANNED_ADD_ONS_REC_HPP #define DB_REC_BANNED_ADDONS_REC_HPP
#include <cstdint> #include <cstdint>
class SFile; class SFile;
class BannedAddOnsRec { class BannedAddonsRec {
public: public:
int32_t m_ID; int32_t m_ID;
int32_t m_nameMd5[4]; int32_t m_nameMd5[4];

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/BarberShopStyleRec.hpp" #include "db/rec/BarberShopStyleRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* BarberShopStyleRec::GetFilename() { const char* BarberShopStyleRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/BattlemasterListRec.hpp" #include "db/rec/BattlemasterListRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* BattlemasterListRec::GetFilename() { const char* BattlemasterListRec::GetFilename() {

View File

@ -1,6 +1,5 @@
// DO NOT EDIT: generated by whoa-autocode // DO NOT EDIT: generated by whoa-autocode
#include "db/rec/CameraModeRec.hpp" #include "db/rec/CameraModeRec.hpp"
#include "db/Locale.hpp"
#include "util/SFile.hpp" #include "util/SFile.hpp"
const char* CameraModeRec::GetFilename() { const char* CameraModeRec::GetFilename() {

Some files were not shown because too many files have changed in this diff Show More