From 1028167aa73464fef78d1efc0b1aba07633a4da8 Mon Sep 17 00:00:00 2001 From: Jerome St-Louis Date: Sat, 5 Nov 2022 21:41:02 -0400 Subject: [PATCH] ecere/gfx/Bitmap: Added CubeMap::LoadFromFiles() --- ecere/src/gfx/Bitmap.ec | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/ecere/src/gfx/Bitmap.ec b/ecere/src/gfx/Bitmap.ec index 6f68de9673..38350d8734 100644 --- a/ecere/src/gfx/Bitmap.ec +++ b/ecere/src/gfx/Bitmap.ec @@ -1267,4 +1267,27 @@ public: } return result; } + + bool LoadFromFiles(DisplaySystem displaySystem, File files[6], const String extension, bool oldStyle) + { + int i; + bool result = true; + for(i = 0; result && i < 6; i++) + { + Bitmap face = i > 0 ? { sRGB2Linear = sRGB2Linear } : this; + if(face.LoadFromFile(files[i], extension, null)) + { + face.driverData = driverData; + result = displaySystem.driver.MakeDDBitmap(displaySystem, face, true, (i + 1) | (oldStyle << 3)); + } + else + result = false; + if(i > 0) + { + face.driverData = 0; + delete face; + } + } + return result; + } };