From 56f0821876b20da1c20afde9799bb22829cc537d Mon Sep 17 00:00:00 2001 From: Simei Yin Date: Thu, 31 May 2018 19:33:57 +0200 Subject: SLUDGE: Move save/loadVariable() to struct Variable --- engines/sludge/function.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/sludge/function.cpp') diff --git a/engines/sludge/function.cpp b/engines/sludge/function.cpp index 7ed6207526..232a040417 100644 --- a/engines/sludge/function.cpp +++ b/engines/sludge/function.cpp @@ -749,14 +749,14 @@ void saveFunction(LoadedFunction *fun, Common::WriteStream *stream) { stream->writeByte(fun->cancelMe); stream->writeByte(fun->returnSomething); stream->writeByte(fun->isSpeech); - saveVariable(&(fun->reg), stream); + fun->reg.save(stream); if (fun->freezerLevel) { fatal(ERROR_GAME_SAVE_FROZEN); } saveStack(fun->stack, stream); for (a = 0; a < fun->numLocals; a++) { - saveVariable(&(fun->localVars[a]), stream); + fun->localVars[a].save(stream); } } @@ -785,13 +785,13 @@ LoadedFunction *loadFunction(Common::SeekableReadStream *stream) { buildFunc->cancelMe = stream->readByte(); buildFunc->returnSomething = stream->readByte(); buildFunc->isSpeech = stream->readByte(); - loadVariable(&(buildFunc->reg), stream); + buildFunc->reg.load(stream); loadFunctionCode(buildFunc); buildFunc->stack = loadStack(stream, NULL); for (a = 0; a < buildFunc->numLocals; a++) { - loadVariable(&(buildFunc->localVars[a]), stream); + buildFunc->localVars[a].load(stream); } return buildFunc; -- cgit v1.2.3