[Scummvm-git-logs] scummvm master -> 8451569f83a44813974af8b0d949f3693592a2d2

aquadran noreply at scummvm.org
Sun Jan 16 19:40:52 UTC 2022


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
8451569f83 GRIM: Implemented Lua_V1::JustLoaded opcode


Commit: 8451569f83a44813974af8b0d949f3693592a2d2
    https://github.com/scummvm/scummvm/commit/8451569f83a44813974af8b0d949f3693592a2d2
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2022-01-16T20:40:47+01:00

Commit Message:
GRIM: Implemented Lua_V1::JustLoaded opcode

Changed paths:
    engines/grim/grim.cpp
    engines/grim/grim.h
    engines/grim/lua_v1.cpp


diff --git a/engines/grim/grim.cpp b/engines/grim/grim.cpp
index a6fa23c411a..50ad26154ac 100644
--- a/engines/grim/grim.cpp
+++ b/engines/grim/grim.cpp
@@ -152,6 +152,7 @@ GrimEngine::GrimEngine(OSystem *syst, uint32 gameFlags, GrimGameType gameType, C
 	_fps[0] = 0;
 	_iris = new Iris();
 	_buildActiveActorsList = false;
+	_justSaveLoaded = false;
 
 	Color c(0, 0, 0);
 
@@ -1232,6 +1233,8 @@ void GrimEngine::savegameRestore() {
 
 	delete _savedState;
 
+	_justSaveLoaded = true;
+
 	//Re-read the values, since we may have been in some state that changed them when loading the savegame,
 	//e.g. running a cutscene, which sets the sfx volume to 0.
 	_mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
diff --git a/engines/grim/grim.h b/engines/grim/grim.h
index fde1763c8b0..36e669961c1 100644
--- a/engines/grim/grim.h
+++ b/engines/grim/grim.h
@@ -95,6 +95,8 @@ public:
 	void setSpeechMode(SpeechMode mode) { _speechMode = mode; }
 	SpeechMode getSpeechMode() { return _speechMode; }
 	SaveGame *savedState() { return _savedState; }
+	bool getJustSaveLoaded() { return _justSaveLoaded; }
+	void setJustSaveLoaded(bool state) { _justSaveLoaded = state; }
 
 	void handleDebugLoadResource();
 	void luaUpdate();
@@ -228,6 +230,7 @@ protected:
 	bool _savegameSaveRequest;
 	Common::String _savegameFileName;
 	SaveGame *_savedState;
+	bool _justSaveLoaded;
 
 	Set *_currSet;
 	EngineMode _mode, _previousMode;
diff --git a/engines/grim/lua_v1.cpp b/engines/grim/lua_v1.cpp
index 281e441a7b5..dc0048cf026 100644
--- a/engines/grim/lua_v1.cpp
+++ b/engines/grim/lua_v1.cpp
@@ -699,6 +699,14 @@ void Lua_V1::LockFont() {
 	lua_pushnil();
 }
 
+void Lua_V1::JustLoaded() {
+	if (g_grim->getJustSaveLoaded())
+		lua_pushnumber(1.0f);
+	else
+		lua_pushnil();
+	g_grim->setJustSaveLoaded(false);
+}
+
 void Lua_V1::EnableDebugKeys() {
 }
 
@@ -712,10 +720,6 @@ void Lua_V1::LightMgrStartup() {
 	// lights manager for game debug purpose only
 }
 
-void Lua_V1::JustLoaded() {
-	Debug::error("OPCODE USAGE VERIFICATION: JustLoaded");
-}
-
 void Lua_V1::SetEmergencyFont() {
 	// nothing to implement
 	// originally this is used only for CD changing which is not supported here




More information about the Scummvm-git-logs mailing list