- OFFSETs/reconstruction from 12340: System::getDriverName, setRecordDriver, getRecordDriverName; Sound/SoundI/Codec::readyForRelease (new, non-virtual); SoundI::getNumTags; OutputWASAPI::getDriverName; OutputWavWriter::getHandleCallback (folded with WASAPI's recordGetPositionCallback); LocalCriticalSection::enter; ASIO stopCallback. - fmodex in the wowdecomp CMake build (Win32 + x64, NASM on Win32, WIN32_LEAN_AND_MEAN/NOMINMAX removed for SoundEngine, LoadOAL.cpp); x64 portability casts; libFLAC fseeko/ftello -> fseek/ftell on MSVC. - CGxDevice::Log(va_list), SysMsgPrintf, SysMsgVPrintf: _vsnprintf as in 12340 (were C99 vsnprintf; hidden by a harness overload-pairing bug). - VERIFY stamps. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
79 lines
1.8 KiB
C++
79 lines
1.8 KiB
C++
#include <cstdarg>
|
|
#include <cstdint>
|
|
#include <cstdio>
|
|
#include "Engine/Source/Services/SysMessage.h"
|
|
#include "Engine/Source/Storm/H/storm.h"
|
|
|
|
// VERIFY: e98afe5a manual
|
|
// OFFSET: 0x004B4F60
|
|
int32_t SysMsgAdd(const char* text, STATUS_TYPE severity) {
|
|
if (!text || severity >= STATUS_NUMTYPES) {
|
|
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
|
return 0;
|
|
}
|
|
|
|
return 1;
|
|
}
|
|
|
|
// VERIFY: 852e1d4d manual
|
|
// OFFSET: 0x004B4F90
|
|
int32_t SysMsgAdd(CStatus* status) {
|
|
if (status->IsEmpty()) {
|
|
return 1;
|
|
}
|
|
|
|
char* text = status->GetErrorStrAlloc(STATUS_INFO, nullptr);
|
|
int32_t result = SysMsgAdd(text, status->m_highestSeverity);
|
|
SMemFree(text, __FILE__, __LINE__, 0);
|
|
|
|
return result;
|
|
}
|
|
|
|
// VERIFY: 9315395b manual
|
|
// OFFSET: 0x004B4FF0
|
|
int32_t SysMsgVPrintf(STATUS_TYPE severity, uint32_t flags, const char* format, va_list args) {
|
|
char buffer[256];
|
|
_vsnprintf(buffer, sizeof(buffer), format, args);
|
|
buffer[255] = '\0';
|
|
|
|
if (severity < STATUS_NUMTYPES) {
|
|
return 1;
|
|
}
|
|
|
|
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
|
|
|
return 0;
|
|
}
|
|
|
|
// VERIFY: 82062d21 manual
|
|
// OFFSET: 0x004B5040
|
|
int32_t SysMsgPrintf(STATUS_TYPE severity, uint32_t flags, const char* format, ...) {
|
|
va_list args;
|
|
va_start(args, format);
|
|
|
|
if (format) {
|
|
char buffer[256];
|
|
_vsnprintf(buffer, sizeof(buffer), format, args);
|
|
buffer[255] = '\0';
|
|
|
|
if (severity < STATUS_NUMTYPES) {
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
SErrSetLastError(STORM_ERROR_INVALID_PARAMETER);
|
|
|
|
return 0;
|
|
}
|
|
|
|
// VERIFY: fe511d8e auto
|
|
// OFFSET: 0x004D8520
|
|
int32_t SysMsgPrintf(STATUS_TYPE severity, const char* format, ...) {
|
|
va_list args;
|
|
va_start(args, format);
|
|
int32_t result = SysMsgVPrintf(severity, 1, format, args);
|
|
va_end(args);
|
|
|
|
return result;
|
|
}
|