Compare commits

..

1 Commits

Author SHA1 Message Date
VDm
16841d9ce8
Merge 236f0372e4 into f1d1dad08b 2025-03-10 22:12:20 +00:00
6 changed files with 41 additions and 149 deletions

View File

@ -6,7 +6,6 @@
#include "console/Client.hpp" #include "console/Client.hpp"
#include "console/Device.hpp" #include "console/Device.hpp"
#include "console/Screen.hpp" #include "console/Screen.hpp"
#include "console/Command.hpp"
#include "db/Db.hpp" #include "db/Db.hpp"
#include "glue/CGlueMgr.hpp" #include "glue/CGlueMgr.hpp"
#include "gx/Screen.hpp" #include "gx/Screen.hpp"
@ -24,15 +23,7 @@
#include <bc/os/Path.hpp> #include <bc/os/Path.hpp>
#include <bc/file/File.hpp> #include <bc/file/File.hpp>
CVar* Client::g_accountNameVar;
CVar* Client::g_accountListVar; CVar* Client::g_accountListVar;
CVar* Client::g_accountUsesTokenVar;
CVar* Client::g_movieVar;
CVar* Client::g_expansionMovieVar;
CVar* Client::g_movieSubtitleVar;
HEVENTCONTEXT Client::g_clientEventContext; HEVENTCONTEXT Client::g_clientEventContext;
char Client::g_currentLocaleName[5] = {}; char Client::g_currentLocaleName[5] = {};
@ -45,16 +36,6 @@ static char* s_localeArray[12] = {
}; };
int32_t CCommand_ReloadUI(const char*, const char*) {
// TODO:
return 1;
}
int32_t CCommand_Perf(const char*, const char*) {
return 1;
}
void AsyncFileInitialize() { void AsyncFileInitialize() {
// TODO // TODO
AsyncFileReadInitialize(0, 100); AsyncFileReadInitialize(0, 100);
@ -66,20 +47,18 @@ void BaseInitializeGlobal() {
void ClientMiscInitialize() { void ClientMiscInitialize() {
// TODO // TODO
}
void ClientRegisterConsoleCommands() { Client::g_accountListVar = CVar::Register(
ConsoleCommandRegister("reloadUI", &CCommand_ReloadUI, CATEGORY::GRAPHICS, nullptr); "accountList",
ConsoleCommandRegister("perf", &CCommand_Perf, CATEGORY::DEBUG, nullptr); "List of wow accounts for saved Blizzard account",
0,
const auto game = CATEGORY::GAME; "",
nullptr,
Client::g_accountNameVar = CVar::Register("accountName", "Saved account name", 64, "", nullptr, game); 4,
Client::g_accountListVar = CVar::Register("accountList", "List of wow accounts for saved Blizzard account", 0, "", nullptr, game); false,
Client::g_accountUsesTokenVar = CVar::Register("g_accountUsesToken", "Saved whether uses authenticator", 0, "0", nullptr, game); nullptr,
Client::g_movieVar = CVar::Register("movie", "Show movie on startup", 0, "1", nullptr, game); false
Client::g_expansionMovieVar = CVar::Register("expansionMovie", "Show expansion movie on startup", 0, "1", nullptr, game); );
Client::g_movieSubtitleVar = CVar::Register("movieSubtitle", "Show movie subtitles", 0, "0", nullptr, game);
// TODO // TODO
} }
@ -580,7 +559,7 @@ void WowClientInit() {
ClientMiscInitialize(); ClientMiscInitialize();
ClientRegisterConsoleCommands(); // sub_401B60();
ClientDBInitialize(); ClientDBInitialize();
@ -638,22 +617,27 @@ void WowClientInit() {
// sub_421630(); // sub_421630();
// } // }
if (s_expansionLevel != 1) { // TODO
if (Client::g_movieVar->GetInt()) { // if (byte_B2F9E1 != 1) {
Client::g_movieVar->Set("0", true, false, false, true); // if ((g_playIntroMovie + 48) == 1) {
CGlueMgr::SetScreen("movie"); // CVar::Set(g_playIntroMovie, "0", 1, 0, 0, 1);
} else { // CGlueMgr::SetScreen("movie");
CGlueMgr::SetScreen("login"); // } else {
} // CGlueMgr::SetScreen("login");
} else { // }
if (Client::g_expansionMovieVar->GetInt()) { // } else {
Client::g_expansionMovieVar->Set("0", true, false, false, true); // if ((dword_B2F980 + 48) == 1) {
Client::g_movieVar->Set("0", true, false, false, true); // CVar::Set(dword_B2F980, "0", 1, 0, 0, 1);
CGlueMgr::SetScreen("movie"); // CVar::Set(g_playIntroMovie, "0", 1, 0, 0, 1);
} else { // CGlueMgr::SetScreen("movie");
CGlueMgr::SetScreen("login"); // } else {
} // CGlueMgr::SetScreen("login");
} // }
// }
// TODO
// - temporary until above logic is implemented
CGlueMgr::SetScreen("login");
// TODO // TODO
// CGlueMgr::m_pendingTimerAlert = dword_B2F9D8; // CGlueMgr::m_pendingTimerAlert = dword_B2F9D8;

View File

@ -7,12 +7,7 @@
class CVar; class CVar;
namespace Client { namespace Client {
extern CVar* g_accountNameVar;
extern CVar* g_accountListVar; extern CVar* g_accountListVar;
extern CVar* g_accountUsesTokenVar;
extern CVar* g_movieVar;
extern CVar* g_expansionMovieVar;
extern CVar* g_movieSubtitleVar;
extern HEVENTCONTEXT g_clientEventContext; extern HEVENTCONTEXT g_clientEventContext;
extern char g_currentLocaleName[5]; extern char g_currentLocaleName[5];
} }

View File

@ -43,8 +43,6 @@ unsigned char InterfaceKey[256] = {
int32_t CGlueMgr::m_acceptedEULA = 1; // TODO int32_t CGlueMgr::m_acceptedEULA = 1; // TODO
int32_t CGlueMgr::m_acceptedTerminationWithoutNotice; int32_t CGlueMgr::m_acceptedTerminationWithoutNotice;
int32_t CGlueMgr::m_acceptedTOS = 1; // TODO int32_t CGlueMgr::m_acceptedTOS = 1; // TODO
int32_t CGlueMgr::m_processServerAlert = 1;
int32_t CGlueMgr::m_pendingTimerAlert;
int32_t CGlueMgr::m_accountMsgAvailable; int32_t CGlueMgr::m_accountMsgAvailable;
char CGlueMgr::m_accountName[1280]; char CGlueMgr::m_accountName[1280];
float CGlueMgr::m_aspect; float CGlueMgr::m_aspect;
@ -201,30 +199,7 @@ int32_t CGlueMgr::HandleDisplaySizeChanged(const CSizeEvent& event) {
// TODO a1: const EVENT_DATA_IDLE* // TODO a1: const EVENT_DATA_IDLE*
int32_t CGlueMgr::Idle(const void* a1, void* a2) { int32_t CGlueMgr::Idle(const void* a1, void* a2) {
// TODO: // TODO
// if (gxDevice->IsStereoEnabled) {
// CGlueMgr::SetUIDepth(gxDevice->StereoGetConvergence);
// }
auto loginConnection = ClientServices::LoginConnection();
if (loginConnection) {
// Virtual call (loginConnection + 184) leads to nullsub
// Checked by tracing in debugger
}
if (CGlueMgr::m_processServerAlert) {
// TODO:
// v2 = SStrLen("SERVERALERT:");
// FrameScript_SignalEvent(0x15u, "%s", &CGlueMgr::m_serverAlert[(_DWORD)&v2[CGlueMgr::m_serverAlert[0] != -17 ? 0 : 3]]);
CGlueMgr::m_processServerAlert = 0;
}
if (CGlueMgr::m_pendingTimerAlert) {
FrameScript_SignalEvent(0x21u, "%d", CGlueMgr::m_pendingTimerAlert);
CGlueMgr::m_pendingTimerAlert = 0;
}
// TODO: CKBPage::UpdateLoadingQueue();
if (CGlueMgr::m_idleState == IDLE_NONE) { if (CGlueMgr::m_idleState == IDLE_NONE) {
if (CGlueMgr::m_reload) { if (CGlueMgr::m_reload) {
@ -238,17 +213,18 @@ int32_t CGlueMgr::Idle(const void* a1, void* a2) {
CGlueMgr::m_reload = 0; CGlueMgr::m_reload = 0;
} }
if (CGlueMgr::m_accountMsgAvailable) { // TODO
FrameScript_SignalEvent(0x22u, 0); // if (CGlueMgr::m_accountMsgAvailable) {
CGlueMgr::m_accountMsgAvailable = 0; // FrameScript_SignalEvent(0x22u, 0);
} // CGlueMgr::m_accountMsgAvailable = 0;
// }
// TODO CGlueMgr::HandleBattlenetDisconnect(); // TODO sub_4D84A0();
return 1; return 1;
} }
// TODO: LOOP { ConsoleWrite(GRUNT DEBUG MESSAGE) } // TODO
WOWCS_OPS op; WOWCS_OPS op;
const char* msg; const char* msg;

View File

@ -32,8 +32,6 @@ class CGlueMgr {
static int32_t m_acceptedEULA; static int32_t m_acceptedEULA;
static int32_t m_acceptedTerminationWithoutNotice; static int32_t m_acceptedTerminationWithoutNotice;
static int32_t m_acceptedTOS; static int32_t m_acceptedTOS;
static int32_t m_processServerAlert;
static int32_t m_pendingTimerAlert;
static int32_t m_accountMsgAvailable; static int32_t m_accountMsgAvailable;
static char m_accountName[]; static char m_accountName[];
static float m_aspect; static float m_aspect;

View File

@ -1,50 +1,3 @@
#include "gx/CGxFormat.hpp" #include "gx/CGxFormat.hpp"
const char* CGxFormat::formatToColorBitsString[Formats_Last] = { "16", "24", "24", "30", "16", "24", "24", "32" }; const char* CGxFormat::formatToColorBitsString[Formats_Last] = { "16", "24", "24", "30", "16", "24", "24", "32" };
CGxFormat::CGxFormat() {
this->size.x = 0;
this->size.y = 0;
this->pos.x = 0;
this->pos.y = 0;
this->sampleQuality = 0.0;
this->maximize = 0;
this->stereoEnabled = false;
this->sampleCount = 1;
this->aspect = 1;
this->unk1 = -1;
this->unk2 = -1;
this->unk3 = -1;
this->unk4 = -1;
this->unk5 = -1;
this->unk6 = -1;
}
CGxFormat::CGxFormat(bool p_window, const C2iVector& p_size, Format p_colorFormat, Format p_depthFormat, uint32_t p_refreshRate, uint32_t p_vsync, bool p_hwTnl, bool p_fixLag, bool p_hwCursor, bool p_aspect, bool p_maximize) {
this->size.x = 0;
this->size.y = 0;
this->pos.x = 0;
this->pos.y = 0;
this->hwTnL = p_hwTnl;
this->hwCursor = p_hwCursor;
this->fixLag = p_fixLag;
this->window = p_window;
this->depthFormat = p_depthFormat;
this->size.x = p_size.x;
this->size.y = p_size.y;
this->sampleQuality = 0.0;
this->colorFormat = p_colorFormat;
this->refreshRate = p_refreshRate;
this->vsync = p_vsync;
this->aspect = p_aspect;
this->stereoEnabled = 0;
this->maximize = p_maximize;
this->backbuffers = 1;
this->sampleCount = 1;
this->unk1 = -1;
this->unk2 = -1;
this->unk3 = -1;
this->unk4 = -1;
this->unk5 = -1;
this->unk6 = -1;
}

View File

@ -19,34 +19,20 @@ class CGxFormat {
Formats_Last = 8 Formats_Last = 8
}; };
CGxFormat();
CGxFormat(bool p_window, const C2iVector& p_size, Format p_colorFormat, Format p_depthFormat, uint32_t p_refreshRate, uint32_t p_vsync, bool p_hwTnl, bool p_fixLag, bool p_hwCursor, bool p_aspect, bool p_maximize);
static const char* formatToColorBitsString[Formats_Last]; static const char* formatToColorBitsString[Formats_Last];
// Member variables // Member variables
uint32_t apiSpecificModeID;
bool hwTnL; bool hwTnL;
bool hwCursor; bool hwCursor;
bool fixLag; bool fixLag;
int8_t window; int8_t window;
int8_t aspect;
int32_t maximize; int32_t maximize;
Format depthFormat; Format depthFormat;
C2iVector size; C2iVector size;
uint32_t backbuffers;
uint32_t sampleCount; uint32_t sampleCount;
float sampleQuality;
Format colorFormat; Format colorFormat;
uint32_t refreshRate; uint32_t refreshRate;
uint32_t vsync; uint32_t vsync;
bool stereoEnabled;
uint32_t unk1;
uint32_t unk2;
uint32_t unk3;
uint32_t unk4;
uint32_t unk5;
uint32_t unk6;
C2iVector pos; C2iVector pos;
}; };