aboutsummaryrefslogtreecommitdiff
path: root/engines/cryomni3d
diff options
context:
space:
mode:
authorLe Philousophe2019-05-03 00:01:35 +0200
committerEugene Sandulenko2019-06-01 22:43:48 +0200
commitac5d392a76eeb3e1d09bc4c585d6e29f5c9f47d8 (patch)
treec415cd0822dac1035474b759ac9e0c269beeeee5 /engines/cryomni3d
parent349201ba153bd80597a0c4154afea4d9499166c6 (diff)
downloadscummvm-rg350-ac5d392a76eeb3e1d09bc4c585d6e29f5c9f47d8.tar.gz
scummvm-rg350-ac5d392a76eeb3e1d09bc4c585d6e29f5c9f47d8.tar.bz2
scummvm-rg350-ac5d392a76eeb3e1d09bc4c585d6e29f5c9f47d8.zip
CRYOMNI3D: Add a function to load a set of BMP files
Diffstat (limited to 'engines/cryomni3d')
-rw-r--r--engines/cryomni3d/versailles/engine.cpp20
-rw-r--r--engines/cryomni3d/versailles/engine.h2
2 files changed, 22 insertions, 0 deletions
diff --git a/engines/cryomni3d/versailles/engine.cpp b/engines/cryomni3d/versailles/engine.cpp
index a227a2676d..608da9c1b5 100644
--- a/engines/cryomni3d/versailles/engine.cpp
+++ b/engines/cryomni3d/versailles/engine.cpp
@@ -1537,5 +1537,25 @@ void CryOmni3DEngine_Versailles::playInGameVideo(const Common::String &filename,
g_system->showMouse(true);
}
+void CryOmni3DEngine_Versailles::loadBMPs(const char *pattern, Graphics::Surface *bmps,
+ unsigned int count) {
+ Image::BitmapDecoder bmpDecoder;
+ Common::File file;
+
+ for (unsigned int i = 0; i < count; i++) {
+ Common::String bmp = Common::String::format(pattern, i);
+
+ if (!file.open(bmp)) {
+ error("Failed to open BMP file: %s", bmp.c_str());
+ }
+ if (!bmpDecoder.loadStream(file)) {
+ error("Failed to load BMP file: %s", bmp.c_str());
+ }
+ bmps[i].copyFrom(*bmpDecoder.getSurface());
+ bmpDecoder.destroy();
+ file.close();
+ }
+}
+
} // End of namespace Versailles
} // End of namespace CryOmni3D
diff --git a/engines/cryomni3d/versailles/engine.h b/engines/cryomni3d/versailles/engine.h
index 9d0b7acbd3..438ae16395 100644
--- a/engines/cryomni3d/versailles/engine.h
+++ b/engines/cryomni3d/versailles/engine.h
@@ -327,6 +327,8 @@ private:
void playInGameVideo(const Common::String &filename, bool restoreCursorPalette = true);
+ void loadBMPs(const char *pattern, Graphics::Surface *bmps, unsigned int count);
+
unsigned int getMusicId(unsigned int level, unsigned int placeId) const;
bool musicWouldChange(unsigned int level, unsigned int placeId) const;
void musicUpdate();