[General]: Cleanup usage of outputdebugstring (#733)

This commit is contained in:
Edo 2023-01-25 18:59:15 +00:00 committed by GitHub
parent bd7d2fe059
commit 024440a55e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 17 additions and 10 deletions

View File

@ -134,7 +134,9 @@ namespace Components
if (!MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, static_cast<MINIDUMP_TYPE>(MiniDumpType), &ex, nullptr, nullptr)) if (!MiniDumpWriteDump(GetCurrentProcess(), GetCurrentProcessId(), hFile, static_cast<MINIDUMP_TYPE>(MiniDumpType), &ex, nullptr, nullptr))
{ {
MessageBoxA(nullptr, Utils::String::Format("There was an error creating the minidump ({})! Hit OK to close the program.", Utils::GetLastWindowsError()), "ERROR", MB_OK | MB_ICONERROR); MessageBoxA(nullptr, Utils::String::Format("There was an error creating the minidump ({})! Hit OK to close the program.", Utils::GetLastWindowsError()), "ERROR", MB_OK | MB_ICONERROR);
#ifdef _DEBUG
OutputDebugStringA("Failed to create new minidump!"); OutputDebugStringA("Failed to create new minidump!");
#endif
Utils::OutputDebugLastError(); Utils::OutputDebugLastError();
TerminateProcess(GetCurrentProcess(), ExceptionInfo->ExceptionRecord->ExceptionCode); TerminateProcess(GetCurrentProcess(), ExceptionInfo->ExceptionRecord->ExceptionCode);
} }

View File

@ -1979,11 +1979,6 @@ namespace Components
//material->drawSurf[9] = material359.drawSurf[1]; //material->drawSurf[9] = material359.drawSurf[1];
//material->drawSurf[10] = material359.drawSurf[2]; //material->drawSurf[10] = material359.drawSurf[2];
//material->drawSurf[11] = material359.drawSurf[3]; //material->drawSurf[11] = material359.drawSurf[3];
if (material359.sGameFlags & 0x100)
{
//OutputDebugStringA("");
}
} }
return result; return result;

View File

@ -16,7 +16,9 @@ namespace Steam
int RemoteStorage::FileRead(const char *pchFile, void *pvData, int cubDataToRead) int RemoteStorage::FileRead(const char *pchFile, void *pvData, int cubDataToRead)
{ {
#ifdef _DEBUG
OutputDebugStringA(pchFile); OutputDebugStringA(pchFile);
#endif
return 0; return 0;
} }

View File

@ -158,14 +158,18 @@ namespace Steam
{ {
if (!this->interfacePtr) if (!this->interfacePtr)
{ {
OutputDebugStringA(::Utils::String::VA("Steam interface pointer is invalid (%s)!\n", methodName.data())); #ifdef _DEBUG
OutputDebugStringA(::Utils::String::Format("Steam interface pointer is invalid '{}'!\n", methodName));
#endif
return T(); return T();
} }
auto method = this->getMethod(methodName); auto method = this->getMethod(methodName);
if (!method.first) if (!method.first)
{ {
OutputDebugStringA(::Utils::String::VA("Steam interface method %s not found!\n", methodName.data())); #ifdef _DEBUG
OutputDebugStringA(::Utils::String::Format("Steam interface method '{}' not found!\n", methodName));
#endif
return T(); return T();
} }
@ -173,7 +177,9 @@ namespace Steam
constexpr std::size_t passedArgc = Interface::AddSizes<sizeof(Args)...>::value; constexpr std::size_t passedArgc = Interface::AddSizes<sizeof(Args)...>::value;
if (passedArgc != argc) if (passedArgc != argc)
{ {
OutputDebugStringA(::Utils::String::VA("Steam interface arguments for method %s do not match (expected %d bytes, but got %d bytes)!\n", methodName.data(), argc, passedArgc)); #ifdef _DEBUG
OutputDebugStringA(::Utils::String::Format("Steam interface arguments for method '{}' do not match (expected {} bytes, but got {} bytes)!\n", methodName, argc, passedArgc));
#endif
return T(); return T();
} }

View File

@ -123,7 +123,9 @@ namespace Steam
if (!Proxy::Inititalize()) if (!Proxy::Inititalize())
{ {
#ifdef _DEBUG
OutputDebugStringA("Steam proxy not initialized properly"); OutputDebugStringA("Steam proxy not initialized properly");
#endif
Components::StartupMessages::AddMessage("Warning:\nUnable to connect to Steam. Steam features will be unavailable"); Components::StartupMessages::AddMessage("Warning:\nUnable to connect to Steam. Steam features will be unavailable");
} }
else else