Skip to content

Commit 3d95134

Browse files
committed
File export validation is better
1 parent c30ee3d commit 3d95134

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

NormalMapGeneratorTool/src/MainApp.cpp

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ enum class LoadingOption
5454
MODEL, TEXTURE, NONE
5555
};
5656

57-
const std::string VERSION_NAME = "v0.95 Alpha";
57+
const std::string VERSION_NAME = "v1.0 Beta";
5858
const std::string FONTS_PATH = "Resources\\Fonts\\";
5959
const std::string TEXTURES_PATH = "Resources\\Textures\\";
6060
const std::string CUBEMAP_TEXTURES_PATH = "Resources\\Cubemap Textures\\";
@@ -409,6 +409,22 @@ int main(void)
409409
imageFormat = ImageFormat::PNG;
410410
else if (fileExt == ".jpg")
411411
imageFormat = ImageFormat::JPEG;
412+
else //Un-supported format
413+
{
414+
//SaveNormalMapToFile(saveLocation, imageFormat);
415+
shouldSaveNormalMap = false;
416+
if (fileExt == "")
417+
{
418+
modalWindow.setModalDialog("ERROR", "The provided path : " + path + "\nIs incomplete, Check if the path is valid");
419+
420+
}
421+
else
422+
{
423+
modalWindow.setModalDialog("ERROR", "The extension '" + fileExt + "' is not supported\n Choose from .png, .jpg, .tga or .bmp");
424+
}
425+
fbs.updateTextureDimensions(windowSys.GetWindowRes().x, windowSys.GetWindowRes().y);
426+
continue;
427+
}
412428
//Image validation stage over
413429
SaveNormalMapToFile(saveLocation, imageFormat);
414430
shouldSaveNormalMap = false;

0 commit comments

Comments
 (0)