[Scummvm-git-logs] scummvm master -> 6e462b1f9c5904836a40e7512d20891b06fbe13f
OMGPizzaGuy
48367439+OMGPizzaGuy at users.noreply.github.com
Sun Feb 21 15:36:04 UTC 2021
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a012bb42f0 ULTIMA8: Remove dead code in FileSystem manager
6e462b1f9c ULTIMA8: Remove IDataSource from FileSystem manager
Commit: a012bb42f0b681ffbbd48fc795f4fe21e978698b
https://github.com/scummvm/scummvm/commit/a012bb42f0b681ffbbd48fc795f4fe21e978698b
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2021-02-21T09:35:50-06:00
Commit Message:
ULTIMA8: Remove dead code in FileSystem manager
Changed paths:
engines/ultima/ultima8/filesys/file_system.cpp
engines/ultima/ultima8/filesys/file_system.h
diff --git a/engines/ultima/ultima8/filesys/file_system.cpp b/engines/ultima/ultima8/filesys/file_system.cpp
index e69c6a1ae7..e675af8c3e 100644
--- a/engines/ultima/ultima8/filesys/file_system.cpp
+++ b/engines/ultima/ultima8/filesys/file_system.cpp
@@ -116,20 +116,5 @@ bool FileSystem::base_to_uppercase(string &str, int count) {
return (todo <= 0);
}
-
-bool FileSystem::IsDir(const string &path) {
- Common::FSNode node(path);
- return node.isDirectory();
-}
-
-/*
- * Create a directory
- */
-
-bool FileSystem::MkDir(const string &path) {
- Common::FSNode newDir(path);
- return newDir.createDirectory();
-}
-
} // End of namespace Ultima8
} // End of namespace Ultima
diff --git a/engines/ultima/ultima8/filesys/file_system.h b/engines/ultima/ultima8/filesys/file_system.h
index 481e43de4d..2c27834368 100644
--- a/engines/ultima/ultima8/filesys/file_system.h
+++ b/engines/ultima/ultima8/filesys/file_system.h
@@ -52,16 +52,9 @@ public:
//! \return a new writestream, or nullptr on failure
Common::WriteStream *WriteFile(const Std::string &vfn, bool is_text = false);
- //! Create a directory
- //! \param path the directory to create. (Can be virtual)
- //! \return true if successful; otherwise, false.
- bool MkDir(const Std::string &path); // can handle both paths and vpaths
-
private:
static bool base_to_uppercase(Std::string &str, int count);
- static bool IsDir(const Std::string &path);
-
static FileSystem *_fileSystem;
/**
Commit: 6e462b1f9c5904836a40e7512d20891b06fbe13f
https://github.com/scummvm/scummvm/commit/6e462b1f9c5904836a40e7512d20891b06fbe13f
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2021-02-21T09:35:50-06:00
Commit Message:
ULTIMA8: Remove IDataSource from FileSystem manager
Changed paths:
engines/ultima/ultima8/conf/config_file_manager.cpp
engines/ultima/ultima8/filesys/file_system.cpp
engines/ultima/ultima8/filesys/file_system.h
engines/ultima/ultima8/games/game_data.cpp
engines/ultima/ultima8/graphics/shape.cpp
engines/ultima/ultima8/graphics/shape.h
diff --git a/engines/ultima/ultima8/conf/config_file_manager.cpp b/engines/ultima/ultima8/conf/config_file_manager.cpp
index 42c94075af..6f172d4f64 100644
--- a/engines/ultima/ultima8/conf/config_file_manager.cpp
+++ b/engines/ultima/ultima8/conf/config_file_manager.cpp
@@ -45,7 +45,7 @@ ConfigFileManager::~ConfigFileManager() {
}
bool ConfigFileManager::readConfigFile(string fname, const istring &category) {
- IDataSource *f = FileSystem::get_instance()->ReadFile(fname, true);
+ Common::SeekableReadStream *f = FileSystem::get_instance()->ReadFile(fname, true);
if (!f) return false;
ConfigFile *configFile = new ConfigFile();
diff --git a/engines/ultima/ultima8/filesys/file_system.cpp b/engines/ultima/ultima8/filesys/file_system.cpp
index e675af8c3e..a0395874c3 100644
--- a/engines/ultima/ultima8/filesys/file_system.cpp
+++ b/engines/ultima/ultima8/filesys/file_system.cpp
@@ -45,12 +45,12 @@ FileSystem::~FileSystem() {
// Open a streaming file as readable. Streamed (0 on failure)
-IDataSource *FileSystem::ReadFile(const string &vfn, bool is_text) {
+Common::SeekableReadStream *FileSystem::ReadFile(const string &vfn, bool is_text) {
Common::SeekableReadStream *readStream;
if (!rawOpen(readStream, vfn))
return nullptr;
- return new IFileDataSource(readStream);
+ return readStream;
}
// Open a streaming file as writeable. Streamed (0 on failure)
diff --git a/engines/ultima/ultima8/filesys/file_system.h b/engines/ultima/ultima8/filesys/file_system.h
index 2c27834368..8cc2114b33 100644
--- a/engines/ultima/ultima8/filesys/file_system.h
+++ b/engines/ultima/ultima8/filesys/file_system.h
@@ -44,7 +44,7 @@ public:
//! \param vfn the (virtual) filename
//! \param is_text open in text mode?
//! \return nullptr on failure
- IDataSource *ReadFile(const Std::string &vfn, bool is_text = false);
+ Common::SeekableReadStream *ReadFile(const Std::string &vfn, bool is_text = false);
//! Open a file as writable. Streamed.
//! \param vfn the (virtual) filename
diff --git a/engines/ultima/ultima8/games/game_data.cpp b/engines/ultima/ultima8/games/game_data.cpp
index cb58bb309c..abcdf15d61 100644
--- a/engines/ultima/ultima8/games/game_data.cpp
+++ b/engines/ultima/ultima8/games/game_data.cpp
@@ -326,7 +326,7 @@ void GameData::loadU8Data() {
_fonts->setHVLeads();
// Load \mouse
- IDataSource *msds = filesystem->ReadFile("static/u8mouse.shp");
+ Common::SeekableReadStream *msds = filesystem->ReadFile("static/u8mouse.shp");
if (!msds)
error("Unable to load static/u8mouse.shp");
@@ -606,7 +606,7 @@ void GameData::loadRemorseData() {
_fonts->setHVLeads();
// Load mouse
- IDataSource *msds = filesystem->ReadFile("static/mouse.shp");
+ Common::SeekableReadStream *msds = filesystem->ReadFile("static/mouse.shp");
if (!msds)
error("Unable to load static/mouse.shp");
diff --git a/engines/ultima/ultima8/graphics/shape.cpp b/engines/ultima/ultima8/graphics/shape.cpp
index e65bbbb616..6c60a5965c 100644
--- a/engines/ultima/ultima8/graphics/shape.cpp
+++ b/engines/ultima/ultima8/graphics/shape.cpp
@@ -43,7 +43,7 @@ Shape::Shape(const uint8 *data, uint32 size, const ConvertShapeFormat *format,
delete[] const_cast<uint8 *>(data);
}
-Shape::Shape(IDataSource *src, const ConvertShapeFormat *format)
+Shape::Shape(Common::SeekableReadStream *src, const ConvertShapeFormat *format)
: _flexId(0), _shapeNum(0), _palette(nullptr) {
// NB: U8 style!
uint32 size = src->size();
diff --git a/engines/ultima/ultima8/graphics/shape.h b/engines/ultima/ultima8/graphics/shape.h
index dc5a8ef958..a1a6393ac9 100644
--- a/engines/ultima/ultima8/graphics/shape.h
+++ b/engines/ultima/ultima8/graphics/shape.h
@@ -42,7 +42,7 @@ public:
// If format is not specified it will be autodetected
Shape(const uint8 *data, uint32 size, const ConvertShapeFormat *format,
const uint16 flexId, const uint32 shapenum);
- Shape(IDataSource *src, const ConvertShapeFormat *format);
+ Shape(Common::SeekableReadStream *src, const ConvertShapeFormat *format);
virtual ~Shape();
void setPalette(const Palette *pal) {
_palette = pal;
More information about the Scummvm-git-logs
mailing list