@@ -663,12 +663,15 @@ bool Client::loadMedia(const std::string &data, const std::string &filename,
663
663
io::IFileSystem *irrfs = RenderingEngine::get_filesystem ();
664
664
video::IVideoDriver *vdrv = RenderingEngine::get_video_driver ();
665
665
666
+ #if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR > 8
667
+ io::IReadFile *rfile = irrfs->createMemoryReadFile (
668
+ data.c_str (), data.size (), " _tempreadfile" );
669
+ #else
666
670
// Silly irrlicht's const-incorrectness
667
671
Buffer<char > data_rw (data.c_str (), data.size ());
668
-
669
- // Create an irrlicht memory file
670
672
io::IReadFile *rfile = irrfs->createMemoryReadFile (
671
673
*data_rw, data_rw.getSize (), " _tempreadfile" );
674
+ #endif
672
675
673
676
FATAL_ERROR_IF (!rfile, " Could not create irrlicht memory file." );
674
677
@@ -1914,9 +1917,14 @@ scene::IAnimatedMesh* Client::getMesh(const std::string &filename, bool cache)
1914
1917
1915
1918
// Create the mesh, remove it from cache and return it
1916
1919
// This allows unique vertex colors and other properties for each instance
1920
+ #if IRRLICHT_VERSION_MAJOR == 1 && IRRLICHT_VERSION_MINOR > 8
1921
+ io::IReadFile *rfile = RenderingEngine::get_filesystem ()->createMemoryReadFile (
1922
+ data.c_str (), data.size (), filename.c_str ());
1923
+ #else
1917
1924
Buffer<char > data_rw (data.c_str (), data.size ()); // Const-incorrect Irrlicht
1918
- io::IReadFile *rfile = RenderingEngine::get_filesystem ()->createMemoryReadFile (
1925
+ io::IReadFile *rfile = RenderingEngine::get_filesystem ()->createMemoryReadFile (
1919
1926
*data_rw, data_rw.getSize (), filename.c_str ());
1927
+ #endif
1920
1928
FATAL_ERROR_IF (!rfile, " Could not create/open RAM file" );
1921
1929
1922
1930
scene::IAnimatedMesh *mesh = RenderingEngine::get_scene_manager ()->getMesh (rfile);
0 commit comments