1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-20 02:42:42 +01:00

Codechange: Use std::endian instead of TTD_ENDIAN where trivial. (#12778)

This commit is contained in:
Peter Nelson
2024-06-15 10:24:17 +01:00
committed by GitHub
parent f9f07e9001
commit b68172c225
4 changed files with 19 additions and 25 deletions

View File

@@ -71,7 +71,7 @@ struct ScreenshotFormat {
ScreenshotHandlerProc *proc; ///< Function for writing the screenshot.
};
#define MKCOLOUR(x) TO_LE32X(x)
#define MKCOLOUR(x) TO_LE32(x)
/*************************************************
**** SCREENSHOT CODE FOR WINDOWS BITMAP (.BMP)
@@ -360,12 +360,12 @@ static bool MakePNGImage(const char *name, ScreenshotCallback *callb, void *user
sig_bit.gray = 8;
png_set_sBIT(png_ptr, info_ptr, &sig_bit);
#if TTD_ENDIAN == TTD_LITTLE_ENDIAN
png_set_bgr(png_ptr);
png_set_filler(png_ptr, 0, PNG_FILLER_AFTER);
#else
png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE);
#endif /* TTD_ENDIAN == TTD_LITTLE_ENDIAN */
if constexpr (std::endian::native == std::endian::little) {
png_set_bgr(png_ptr);
png_set_filler(png_ptr, 0, PNG_FILLER_AFTER);
} else {
png_set_filler(png_ptr, 0, PNG_FILLER_BEFORE);
}
}
/* use by default 64k temp memory */