mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 09:44:10 +00:00
chore: Eradicate C-style casts and further clean up some code (#1361)
* cast and code cleanup * cast cleanup * bug fixes and improvements * no getBoolField method exists * fixes * unbroke sg cannon scoring * removing comments * Remove the c-style cast warning I added from CMakeLists now that they're gone (it triggers on 3rd party dependencies and slows down compilation) * (Hopefully) fix MacOS compilation error * partially-implemented feedback * more updates to account for feedback * change bool default --------- Co-authored-by: jadebenn <jonahebenn@yahoo.com>
This commit is contained in:
@@ -20,40 +20,40 @@ RawChunk::RawChunk(std::ifstream& stream) {
|
||||
|
||||
uint32_t colorMapSize;
|
||||
BinaryIO::BinaryRead(stream, colorMapSize);
|
||||
stream.seekg((uint32_t)stream.tellg() + (colorMapSize * colorMapSize * 4));
|
||||
stream.seekg(static_cast<uint32_t>(stream.tellg()) + (colorMapSize * colorMapSize * 4));
|
||||
|
||||
uint32_t lightmapSize;
|
||||
BinaryIO::BinaryRead(stream, lightmapSize);
|
||||
stream.seekg((uint32_t)stream.tellg() + (lightmapSize));
|
||||
stream.seekg(static_cast<uint32_t>(stream.tellg()) + (lightmapSize));
|
||||
|
||||
uint32_t colorMapSize2;
|
||||
BinaryIO::BinaryRead(stream, colorMapSize2);
|
||||
stream.seekg((uint32_t)stream.tellg() + (colorMapSize2 * colorMapSize2 * 4));
|
||||
stream.seekg(static_cast<uint32_t>(stream.tellg()) + (colorMapSize2 * colorMapSize2 * 4));
|
||||
|
||||
uint8_t unknown;
|
||||
BinaryIO::BinaryRead(stream, unknown);
|
||||
|
||||
uint32_t blendmapSize;
|
||||
BinaryIO::BinaryRead(stream, blendmapSize);
|
||||
stream.seekg((uint32_t)stream.tellg() + (blendmapSize));
|
||||
stream.seekg(static_cast<uint32_t>(stream.tellg()) + (blendmapSize));
|
||||
|
||||
uint32_t pointSize;
|
||||
BinaryIO::BinaryRead(stream, pointSize);
|
||||
stream.seekg((uint32_t)stream.tellg() + (pointSize * 9 * 4));
|
||||
stream.seekg(static_cast<uint32_t>(stream.tellg()) + (pointSize * 9 * 4));
|
||||
|
||||
stream.seekg((uint32_t)stream.tellg() + (colorMapSize * colorMapSize));
|
||||
stream.seekg(static_cast<uint32_t>(stream.tellg()) + (colorMapSize * colorMapSize));
|
||||
|
||||
uint32_t endCounter;
|
||||
BinaryIO::BinaryRead(stream, endCounter);
|
||||
stream.seekg((uint32_t)stream.tellg() + (endCounter * 2));
|
||||
stream.seekg(static_cast<uint32_t>(stream.tellg()) + (endCounter * 2));
|
||||
|
||||
if (endCounter != 0) {
|
||||
stream.seekg((uint32_t)stream.tellg() + (32));
|
||||
stream.seekg(static_cast<uint32_t>(stream.tellg()) + (32));
|
||||
|
||||
for (int i = 0; i < 0x10; i++) {
|
||||
uint16_t finalCountdown;
|
||||
BinaryIO::BinaryRead(stream, finalCountdown);
|
||||
stream.seekg((uint32_t)stream.tellg() + (finalCountdown * 2));
|
||||
stream.seekg(static_cast<uint32_t>(stream.tellg()) + (finalCountdown * 2));
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user