[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))
{
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!");
#endif
Utils::OutputDebugLastError();
TerminateProcess(GetCurrentProcess(), ExceptionInfo->ExceptionRecord->ExceptionCode);
}

View File

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

View File

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

View File

@ -156,24 +156,30 @@ namespace Steam
template<typename T, typename... Args>
T invoke(const std::string& methodName, Args... args)
{
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();
}
auto method = this->getMethod(methodName);
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();
}
std::size_t argc = method.second;
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();
}

View File

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