mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/4jcraft.git
synced 2026-09-23 09:22:32 +00:00
format everything
This commit is contained in:
@@ -25,14 +25,14 @@ inline std::int64_t QueryPerformanceCounter() {
|
||||
|
||||
// Ticks per second for the high-resolution counter.
|
||||
inline std::int64_t QueryPerformanceFrequency() {
|
||||
return static_cast<std::int64_t>(std::chrono::steady_clock::period::den)
|
||||
/ static_cast<std::int64_t>(std::chrono::steady_clock::period::num);
|
||||
return static_cast<std::int64_t>(std::chrono::steady_clock::period::den) /
|
||||
static_cast<std::int64_t>(std::chrono::steady_clock::period::num);
|
||||
}
|
||||
|
||||
// Elapsed seconds between two counter values.
|
||||
inline double ElapsedSeconds(std::int64_t start, std::int64_t end) {
|
||||
return static_cast<double>(end - start)
|
||||
/ static_cast<double>(QueryPerformanceFrequency());
|
||||
return static_cast<double>(end - start) /
|
||||
static_cast<double>(QueryPerformanceFrequency());
|
||||
}
|
||||
|
||||
} // namespace PlatformTime
|
||||
|
||||
@@ -15,5 +15,5 @@ void PerformanceTimer::PrintElapsedTime(const std::wstring& description) {
|
||||
std::chrono::steady_clock::now() - m_startTime;
|
||||
|
||||
fprintf(stderr, "TIMER: %ls: Elapsed time %f\n", description.c_str(),
|
||||
elapsedTime.count());
|
||||
elapsedTime.count());
|
||||
}
|
||||
|
||||
@@ -64,7 +64,7 @@ int32_t Compression::CompressLZXRLE(void* pDestination, unsigned int* pDestSize,
|
||||
// 0 - 254 - encodes a single byte
|
||||
// 255 followed by 0, 1, 2 - encodes a 1, 2, or 3 255s
|
||||
// 255 followed by 3-255, followed by a byte - encodes a run of n + 1 bytes
|
||||
do {
|
||||
do {
|
||||
unsigned char thisOne = *pucIn++;
|
||||
|
||||
unsigned int count = 1;
|
||||
@@ -89,10 +89,9 @@ int32_t Compression::CompressLZXRLE(void* pDestination, unsigned int* pDestSize,
|
||||
}
|
||||
} while (pucIn != pucEnd);
|
||||
unsigned int rleSize = (unsigned int)(pucOut - rleCompressBuf);
|
||||
|
||||
|
||||
Compress(pDestination, pDestSize, rleCompressBuf, rleSize);
|
||||
|
||||
Compress(pDestination, pDestSize, rleCompressBuf, rleSize);
|
||||
|
||||
// printf("Compressed from %d to %d to %d\n",SrcSize,rleSize,*pDestSize);
|
||||
|
||||
return 0;
|
||||
@@ -114,7 +113,7 @@ int32_t Compression::CompressRLE(void* pDestination, unsigned int* pDestSize,
|
||||
// 255 followed by 0, 1, 2 - encodes a 1, 2, or 3 255s
|
||||
// 255 followed by 3-255, followed by a byte - encodes a run of n + 1
|
||||
// bytes
|
||||
do {
|
||||
do {
|
||||
unsigned char thisOne = *pucIn++;
|
||||
|
||||
unsigned int count = 1;
|
||||
@@ -139,7 +138,6 @@ int32_t Compression::CompressRLE(void* pDestination, unsigned int* pDestSize,
|
||||
}
|
||||
} while (pucIn != pucEnd);
|
||||
rleSize = (unsigned int)(pucOut - rleCompressBuf);
|
||||
|
||||
}
|
||||
|
||||
// Return
|
||||
|
||||
Reference in New Issue
Block a user