SCUMM: Make REDUCE_MEMORY_USAGE slightly more effecive (saving ~1kb ram)

This commit is contained in:
Max Horn 2011-05-17 15:50:11 +02:00
parent 183e018c19
commit d020922846
2 changed files with 12 additions and 1 deletions

View File

@ -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() {

View File

@ -27,14 +27,19 @@
namespace Scumm {
typedef Common::Functor0<void> 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
}
};