[Scummvm-cvs-logs] SF.net SVN: scummvm:[55597] scummvm/trunk/engines/sword25

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Jan 28 18:29:08 CET 2011


Revision: 55597
          http://scummvm.svn.sourceforge.net/scummvm/?rev=55597&view=rev
Author:   thebluegr
Date:     2011-01-28 17:29:08 +0000 (Fri, 28 Jan 2011)

Log Message:
-----------
SWORD25: Marked several unused LUA callbacks as dummy functions. Some cleanup.

Modified Paths:
--------------
    scummvm/trunk/engines/sword25/kernel/filesystemutil.h
    scummvm/trunk/engines/sword25/package/packagemanager.cpp
    scummvm/trunk/engines/sword25/package/packagemanager.h
    scummvm/trunk/engines/sword25/package/packagemanager_script.cpp

Modified: scummvm/trunk/engines/sword25/kernel/filesystemutil.h
===================================================================
--- scummvm/trunk/engines/sword25/kernel/filesystemutil.h	2011-01-28 17:03:15 UTC (rev 55596)
+++ scummvm/trunk/engines/sword25/kernel/filesystemutil.h	2011-01-28 17:29:08 UTC (rev 55597)
@@ -77,13 +77,6 @@
 
 	/**
 	 * @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);

Modified: scummvm/trunk/engines/sword25/package/packagemanager.cpp
===================================================================
--- scummvm/trunk/engines/sword25/package/packagemanager.cpp	2011-01-28 17:03:15 UTC (rev 55596)
+++ scummvm/trunk/engines/sword25/package/packagemanager.cpp	2011-01-28 17:29:08 UTC (rev 55597)
@@ -199,10 +199,6 @@
 	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);

Modified: scummvm/trunk/engines/sword25/package/packagemanager.h
===================================================================
--- scummvm/trunk/engines/sword25/package/packagemanager.h	2011-01-28 17:03:15 UTC (rev 55596)
+++ scummvm/trunk/engines/sword25/package/packagemanager.h	2011-01-28 17:29:08 UTC (rev 55597)
@@ -161,7 +161,7 @@
 	 * 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.

Modified: scummvm/trunk/engines/sword25/package/packagemanager_script.cpp
===================================================================
--- scummvm/trunk/engines/sword25/package/packagemanager_script.cpp	2011-01-28 17:03:15 UTC (rev 55596)
+++ scummvm/trunk/engines/sword25/package/packagemanager_script.cpp	2011-01-28 17:29:08 UTC (rev 55597)
@@ -65,44 +65,6 @@
 	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 @@
 	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},


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list