aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2011-01-28 17:29:08 +0000
committerFilippos Karapetis2011-01-28 17:29:08 +0000
commit5978d8f63d5f67ece8d275f7959d99ccc92ac171 (patch)
tree98835aa8f976ce9fdf0d239b09552af4d17f8e37
parenteb59444d1e4f2c986a6fe05b9d6be691ae2e28bd (diff)
downloadscummvm-rg350-5978d8f63d5f67ece8d275f7959d99ccc92ac171.tar.gz
scummvm-rg350-5978d8f63d5f67ece8d275f7959d99ccc92ac171.tar.bz2
scummvm-rg350-5978d8f63d5f67ece8d275f7959d99ccc92ac171.zip
SWORD25: Marked several unused LUA callbacks as dummy functions. Some cleanup.
svn-id: r55597
-rw-r--r--engines/sword25/kernel/filesystemutil.h7
-rw-r--r--engines/sword25/package/packagemanager.cpp4
-rw-r--r--engines/sword25/package/packagemanager.h2
-rw-r--r--engines/sword25/package/packagemanager_script.cpp54
4 files changed, 12 insertions, 55 deletions
diff --git a/engines/sword25/kernel/filesystemutil.h b/engines/sword25/kernel/filesystemutil.h
index 38a3fdaa12..b75454c1c8 100644
--- a/engines/sword25/kernel/filesystemutil.h
+++ b/engines/sword25/kernel/filesystemutil.h
@@ -77,13 +77,6 @@ public:
/**
* @param Filename The path to a file.
- * @return Returns the size of the specified file. If the size could not be
- * determined, or the file does not exist, returns -1
- */
- static int32 getFileSize(const Common::String &filename);
-
- /**
- * @param Filename The path to a file.
* @return Returns true if the file exists.
*/
static bool fileExists(const Common::String &filename);
diff --git a/engines/sword25/package/packagemanager.cpp b/engines/sword25/package/packagemanager.cpp
index 91bd6eb855..7a64fe2e29 100644
--- a/engines/sword25/package/packagemanager.cpp
+++ b/engines/sword25/package/packagemanager.cpp
@@ -199,10 +199,6 @@ Common::SeekableReadStream *PackageManager::getStream(const Common::String &file
return in;
}
-Common::String PackageManager::getCurrentDirectory() {
- return _currentDirectory;
-}
-
bool PackageManager::changeDirectory(const Common::String &directory) {
// Get the path elements for the file
_currentDirectory = normalizePath(directory, _currentDirectory);
diff --git a/engines/sword25/package/packagemanager.h b/engines/sword25/package/packagemanager.h
index 03598012a6..3a976b32fa 100644
--- a/engines/sword25/package/packagemanager.h
+++ b/engines/sword25/package/packagemanager.h
@@ -161,7 +161,7 @@ public:
* If the path could not be determined, an empty string is returned.
* @remark For cutting path elements '\' is used rather than '/' elements.
*/
- Common::String getCurrentDirectory();
+ Common::String getCurrentDirectory() { return _currentDirectory; }
/**
* Changes the current directory.
* @param Directory The path to the new directory. The path can be relative.
diff --git a/engines/sword25/package/packagemanager_script.cpp b/engines/sword25/package/packagemanager_script.cpp
index 1c9c973d45..eab66f7531 100644
--- a/engines/sword25/package/packagemanager_script.cpp
+++ b/engines/sword25/package/packagemanager_script.cpp
@@ -65,44 +65,6 @@ static int loadDirectoryAsPackage(lua_State *L) {
return 1;
}
-static int getCurrentDirectory(lua_State *L) {
- PackageManager *pPM = getPM();
-
- lua_pushstring(L, pPM->getCurrentDirectory().c_str());
-
- return 1;
-}
-
-static int changeDirectory(lua_State *L) {
- PackageManager *pPM = getPM();
-
- lua_pushbooleancpp(L, pPM->changeDirectory(luaL_checkstring(L, 1)));
-
- return 1;
-}
-
-static int getAbsolutePath(lua_State *L) {
- PackageManager *pPM = getPM();
-
- lua_pushstring(L, pPM->getAbsolutePath(luaL_checkstring(L, 1)).c_str());
-
- return 1;
-}
-
-static int getFileSize(lua_State *L) {
- // This function apparently is not used by the game scripts
- lua_pushnumber(L, 0);
-
- return 1;
-}
-
-static int getFileType(lua_State *L) {
- // This function apparently is not used by the game scripts
- lua_pushnumber(L, 0);
-
- return 1;
-}
-
static void splitSearchPath(const Common::String &path, Common::String &directory, Common::String &filter) {
// Scan backwards for a trailing slash
const char *sPath = path.c_str();
@@ -177,16 +139,22 @@ static int fileExists(lua_State *L) {
return 1;
}
+// Marks a function that should never be used
+static int dummyFuncError(lua_State *L) {
+ error("Dummy function invoked by LUA");
+ return 1;
+}
+
static const char *PACKAGE_LIBRARY_NAME = "Package";
static const luaL_reg PACKAGE_FUNCTIONS[] = {
{"LoadPackage", loadPackage},
{"LoadDirectoryAsPackage", loadDirectoryAsPackage},
- {"GetCurrentDirectory", getCurrentDirectory},
- {"ChangeDirectory", changeDirectory},
- {"GetAbsolutePath", getAbsolutePath},
- {"GetFileSize", getFileSize},
- {"GetFileType", getFileType},
+ {"GetCurrentDirectory", dummyFuncError},
+ {"ChangeDirectory", dummyFuncError},
+ {"GetAbsolutePath", dummyFuncError},
+ {"GetFileSize", dummyFuncError},
+ {"GetFileType", dummyFuncError},
{"FindFiles", findFiles},
{"FindDirectories", findDirectories},
{"GetFileAsString", getFileAsString},