| 162 | } |
| 163 | |
| 164 | std::optional<Image> SpriteImageLoad(u8string_view path, ImageImportMeta meta) |
| 165 | { |
| 166 | try |
| 167 | { |
| 168 | auto format = ImageFormat::png32; |
| 169 | if (meta.palette == Palette::KeepIndices) |
| 170 | { |
| 171 | format = ImageFormat::png; |
| 172 | } |
| 173 | return Imaging::ReadFromFile(path, format); |
| 174 | } |
| 175 | catch (const std::exception& e) |
| 176 | { |
| 177 | fprintf(stderr, "%s\n", e.what()); |
| 178 | return std::nullopt; |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | // TODO: Remove when C++20 is enabled and std::format can be used |
| 183 | std::string PopStr(std::ostringstream& oss) |
no test coverage detected