Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mSctex->mMenuUI->AddMenuItem(0, "Save", ICON_LC_SAVE, "", nullptr,
- [&]() -> void
- {
- std::string filename;
- bool save = Engine::FileDialog::Show(mSctex->mLog, "Save Compressed Image", "Skye Cuillin Texture\0*.sctex\0All Files\0*.*\0", Engine::FileDialog::Type::SAVE_FILE_DIALOG, filename);
- if (save)
- {
- Engine::LoaderSctex* sctexLoader = new Engine::LoaderSctex(mSctex->mLog);
- std::vector<Engine::LoaderSctex::Image> data;
- for (size_t i = 0; i < mSctex->mCompressedLevels; i++)
- {
- Engine::LoaderSctex::Image image;
- image.mWidth = mSctex->mCompressedWidth[i];
- image.mHeight = mSctex->mCompressedHeight[i];
- image.mData = mSctex->mCompressedData[i];
- data.push_back(image);
- }
- sctexLoader->Save(filename, mSctex->mCompressedFormat, data);
- delete sctexLoader;
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement