diff options
| author | Hannes Schulze <haschu0103@outlook.de> | 2025-02-06 20:03:40 +0100 |
|---|---|---|
| committer | Hannes Schulze <haschu0103@outlook.de> | 2025-02-06 20:03:40 +0100 |
| commit | a1fd97365f528ce297a7cba2ee965667bf3ea3f6 (patch) | |
| tree | be97ae499b9c13acd34b6023d91f6a28f51ecc19 /tools/generate-tiles/main.cc | |
| parent | 3fda9b37cbec22cd3c438dea6268422b32405f4b (diff) | |
fix codegen with gcc
Diffstat (limited to 'tools/generate-tiles/main.cc')
| -rw-r--r-- | tools/generate-tiles/main.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/generate-tiles/main.cc b/tools/generate-tiles/main.cc index 82cf38a..dbee3fa 100644 --- a/tools/generate-tiles/main.cc +++ b/tools/generate-tiles/main.cc @@ -38,10 +38,10 @@ namespace static auto from_hex(std::uint32_t const hex) -> rgba { auto res = rgba{}; - res.r = (hex & 0xFF000000) >> 24; - res.g = (hex & 0x00FF0000) >> 16; - res.b = (hex & 0x0000FF00) >> 8; - res.a = (hex & 0x000000FF) >> 0; + res.r = static_cast<std::uint8_t>((hex & 0xFF000000) >> 24); + res.g = static_cast<std::uint8_t>((hex & 0x00FF0000) >> 16); + res.b = static_cast<std::uint8_t>((hex & 0x0000FF00) >> 8); + res.a = static_cast<std::uint8_t>((hex & 0x000000FF) >> 0); return res; } @@ -285,11 +285,11 @@ int main(int const argc, char** const argv) source << "} // namespace nes::app::tiles\n"; - auto header_file = std::ofstream{ output_header }; + auto header_file = std::ofstream{ std::string{ output_header } }; header_file << header.str(); header_file.flush(); - auto source_file = std::ofstream{ output_source }; + auto source_file = std::ofstream{ std::string{ output_source } }; source_file << source.str(); source_file.flush(); |
