| 44 | #include "core/io/stream_peer.h" |
| 45 | |
| 46 | Error save_dds(const String &p_path, const Ref<Image> &p_img) { |
| 47 | Vector<uint8_t> buffer = save_dds_buffer(p_img); |
| 48 | |
| 49 | Ref<FileAccess> file = FileAccess::open(p_path, FileAccess::WRITE); |
| 50 | if (file.is_null()) { |
| 51 | return ERR_CANT_CREATE; |
| 52 | } |
| 53 | |
| 54 | file->store_buffer(buffer.ptr(), buffer.size()); |
| 55 | |
| 56 | return OK; |
| 57 | } |
| 58 | |
| 59 | enum DDSFormatType { |
| 60 | DDFT_BITMASK, |
no test coverage detected