From d0209228467f548e748146e1c72e72ac9cccc89f Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 17 May 2011 15:50:11 +0200 Subject: [PATCH] SCUMM: Make REDUCE_MEMORY_USAGE slightly more effecive (saving ~1kb ram) --- engines/scumm/script.cpp | 4 ++++ engines/scumm/script.h | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/engines/scumm/script.cpp b/engines/scumm/script.cpp index cd9a0ed1c85..cfc4b3c419d 100644 --- a/engines/scumm/script.cpp +++ b/engines/scumm/script.cpp @@ -494,7 +494,11 @@ void ScummEngine::executeOpcode(byte i) { } const char *ScummEngine::getOpcodeDesc(byte i) { +#ifndef REDUCE_MEMORY_USAGE return _opcodes[i].desc; +#else + return ""; +#endif } byte ScummEngine::fetchScriptByte() { diff --git a/engines/scumm/script.h b/engines/scumm/script.h index e576c9b09b7..7b2c625144b 100644 --- a/engines/scumm/script.h +++ b/engines/scumm/script.h @@ -27,14 +27,19 @@ namespace Scumm { - typedef Common::Functor0 Opcode; struct OpcodeEntry : Common::NonCopyable { Opcode *proc; +#ifndef REDUCE_MEMORY_USAGE const char *desc; +#endif +#ifndef REDUCE_MEMORY_USAGE OpcodeEntry() : proc(0), desc(0) {} +#else + OpcodeEntry() : proc(0) {} +#endif ~OpcodeEntry() { setProc(0, 0); } @@ -44,7 +49,9 @@ struct OpcodeEntry : Common::NonCopyable { delete proc; proc = p; } +#ifndef REDUCE_MEMORY_USAGE desc = d; +#endif } };