Commits

Bart van Strien committed b9ec45e

Add love.filesystem.getIdentity

  • Participants
  • Parent commits 85e543d

Comments (0)

Files changed (4)

File src/modules/filesystem/physfs/Filesystem.cpp

 		return true;
 	}
 
+	const char * Filesystem::getIdentity() const
+	{
+		return save_identity.c_str();
+	}
+
 	bool Filesystem::setSource(const char * source)
 	{
 		if (!isInited)

File src/modules/filesystem/physfs/Filesystem.h

 		* to create the folder in the LOVE data folder.
 		**/
 		bool setIdentity(const char * ident);
+		const char * getIdentity() const;
 
 		/**
 		* Sets the path to the game source.

File src/modules/filesystem/physfs/wrap_Filesystem.cpp

 		return 0;
 	}
 
+	int w_getIdentity(lua_State * L)
+	{
+		lua_pushstring(L, instance->getIdentity());
+		return 1;
+	}
+
 	int w_setSource(lua_State * L)
 	{
 		const char * arg = luaL_checkstring(L, 1);
 		{ "init",  w_init },
 		{ "setRelease", w_setRelease },
 		{ "setIdentity",  w_setIdentity },
+		{ "getIdentity", w_getIdentity },
 		{ "setSource",  w_setSource },
 		{ "newFile",  w_newFile },
 		{ "getWorkingDirectory",  w_getWorkingDirectory },

File src/modules/filesystem/physfs/wrap_Filesystem.h

 	int w_init(lua_State * L);
 	int w_setRelease(lua_State * L);
 	int w_setIdentity(lua_State * L);
+	int w_getIdentity(lua_State * L);
 	int w_setSource(lua_State * L);
 	int w_newFile(lua_State * L);
 	int w_newFileData(lua_State * L);