| 174 | }; |
| 175 | |
| 176 | void Texture::loadFile() { |
| 177 | auto file = std::ifstream(DecodeUTF8Path(filepath).c_str(), std::ios::binary | std::ios::in | std::ios::ate); |
| 178 | if (!file) |
| 179 | error(EXIT_CODE_ERROR, "ktxdiff error \"{}\": Failed to open file: {}\n", filepath, errnoMessage()); |
| 180 | |
| 181 | const auto fileSize = file.tellg(); |
| 182 | file.seekg(0); |
| 183 | if (file.fail()) |
| 184 | error(EXIT_CODE_ERROR, "ktxdiff error \"{}\": Failed to seek file: {}\n", filepath, errnoMessage()); |
| 185 | |
| 186 | rawData.resize(fileSize); |
| 187 | file.read(reinterpret_cast<char*>(rawData.data()), fileSize); |
| 188 | if (file.fail()) |
| 189 | error(EXIT_CODE_ERROR, "ktxdiff error \"{}\": Failed to read file: {}\n", filepath, errnoMessage()); |
| 190 | } |
| 191 | |
| 192 | void Texture::loadKTX() { |
| 193 | KTX_error_code ec = KTX_SUCCESS; |
nothing calls this directly
no test coverage detected