mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-05-31 11:45:58 +00:00
Replace remaining WinAPI types with standard C++ equivalents
DWORD→uint32_t, BYTE→uint8_t, HRESULT→int32_t, HANDLE→void*, UINT→uint32_t, INT→int32_t, WORD→uint16_t, LONG→int32_t, SHORT→int16_t, LONGLONG→int64_t, ULONG_PTR→uintptr_t, PBYTE→uint8_t*, LPWSTR/PWSTR→wchar_t*, FLOAT→float, CHAR→char, boolean→bool, CONST→const, TRUE→true, FALSE→false across 176 files (excluding vendor libs and Linux stubs).
This commit is contained in:
@@ -31,14 +31,14 @@ CustomLevelSource::CustomLevelSource(Level* level, int64_t seed,
|
||||
std::string path = "GAME:\\GameRules\\heightmap.bin";
|
||||
#endif
|
||||
#endif
|
||||
HANDLE file = CreateFile(path.c_str(), GENERIC_READ, 0, nullptr, OPEN_EXISTING,
|
||||
void* file = CreateFile(path.c_str(), GENERIC_READ, 0, nullptr, OPEN_EXISTING,
|
||||
FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
if (file == INVALID_HANDLE_VALUE) {
|
||||
app.FatalLoadError();
|
||||
DWORD error = GetLastError();
|
||||
uint32_t error = GetLastError();
|
||||
assert(false);
|
||||
} else {
|
||||
DWORD bytesRead, dwFileSize = GetFileSize(file, nullptr);
|
||||
uint32_t bytesRead, dwFileSize = GetFileSize(file, nullptr);
|
||||
if (dwFileSize > m_heightmapOverride.length) {
|
||||
app.DebugPrintf("Heightmap binary is too large!!\n");
|
||||
__debugbreak();
|
||||
@@ -46,7 +46,7 @@ CustomLevelSource::CustomLevelSource(Level* level, int64_t seed,
|
||||
bool bSuccess = ReadFile(file, m_heightmapOverride.data, dwFileSize,
|
||||
&bytesRead, nullptr);
|
||||
|
||||
if (bSuccess == FALSE) {
|
||||
if (bSuccess == false) {
|
||||
app.FatalLoadError();
|
||||
}
|
||||
CloseHandle(file);
|
||||
@@ -67,12 +67,12 @@ CustomLevelSource::CustomLevelSource(Level* level, int64_t seed,
|
||||
file = CreateFile(waterHeightPath.c_str(), GENERIC_READ, 0, nullptr,
|
||||
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, nullptr);
|
||||
if (file == INVALID_HANDLE_VALUE) {
|
||||
DWORD error = GetLastError();
|
||||
uint32_t error = GetLastError();
|
||||
// assert(false);
|
||||
memset(m_waterheightOverride.data, level->seaLevel,
|
||||
m_waterheightOverride.length);
|
||||
} else {
|
||||
DWORD bytesRead, dwFileSize = GetFileSize(file, nullptr);
|
||||
uint32_t bytesRead, dwFileSize = GetFileSize(file, nullptr);
|
||||
if (dwFileSize > m_waterheightOverride.length) {
|
||||
app.DebugPrintf("waterheight binary is too large!!\n");
|
||||
__debugbreak();
|
||||
@@ -80,7 +80,7 @@ CustomLevelSource::CustomLevelSource(Level* level, int64_t seed,
|
||||
bool bSuccess = ReadFile(file, m_waterheightOverride.data, dwFileSize,
|
||||
&bytesRead, nullptr);
|
||||
|
||||
if (bSuccess == FALSE) {
|
||||
if (bSuccess == false) {
|
||||
app.FatalLoadError();
|
||||
}
|
||||
CloseHandle(file);
|
||||
|
||||
Reference in New Issue
Block a user