aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Apers2004-10-19 12:30:42 +0000
committerChris Apers2004-10-19 12:30:42 +0000
commit1ac29aae1ea2137743afedf588dca0c9aae8df39 (patch)
tree261326ebd601d88b238af814cf3b00cb3dfdd274
parent61e438df2287d83dfe17e2497da0a41672e6df05 (diff)
downloadscummvm-rg350-1ac29aae1ea2137743afedf588dca0c9aae8df39.tar.gz
scummvm-rg350-1ac29aae1ea2137743afedf588dca0c9aae8df39.tar.bz2
scummvm-rg350-1ac29aae1ea2137743afedf588dca0c9aae8df39.zip
Help PalmOS (and more ?) to save memory
svn-id: r15611
-rw-r--r--scumm/intern.h8
-rw-r--r--scumm/script_v100he.cpp2
-rw-r--r--scumm/script_v2.cpp2
-rw-r--r--scumm/script_v5.cpp2
-rw-r--r--scumm/script_v6.cpp2
-rw-r--r--scumm/script_v6he.cpp2
-rw-r--r--scumm/script_v72he.cpp2
-rw-r--r--scumm/script_v7he.cpp2
-rw-r--r--scumm/script_v8.cpp2
-rw-r--r--scumm/script_v80he.cpp2
-rw-r--r--scumm/script_v90he.cpp2
11 files changed, 18 insertions, 10 deletions
diff --git a/scumm/intern.h b/scumm/intern.h
index af325a9bd2..810d690243 100644
--- a/scumm/intern.h
+++ b/scumm/intern.h
@@ -31,6 +31,14 @@ namespace Scumm {
class NutRenderer; // V8 Font Renderer
struct ArrayHeader;
+// This is to help devices with small memory (PDA, smartphones, ...)
+// to save abit of memory used by opcode names in the Scumm engine.
+#ifndef REDUCE_MEMORY_USAGE
+# define _OPCODE(ver, x) { &ver::x, #x }
+#else
+# define _OPCODE(ver, x) { &ver::x, "" }
+#endif
+
class ScummEngine_v5 : public ScummEngine {
protected:
typedef void (ScummEngine_v5::*OpcodeProcV5)();
diff --git a/scumm/script_v100he.cpp b/scumm/script_v100he.cpp
index c37ae2948f..88ab4436b8 100644
--- a/scumm/script_v100he.cpp
+++ b/scumm/script_v100he.cpp
@@ -39,7 +39,7 @@
namespace Scumm {
-#define OPCODE(x) { &ScummEngine_v100he::x, #x }
+#define OPCODE(x) _OPCODE(ScummEngine_v100he, x)
void ScummEngine_v100he::setupOpcodes() {
static const OpcodeEntryV100he opcodes[256] = {
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp
index 583513c05e..67c6ca0470 100644
--- a/scumm/script_v2.cpp
+++ b/scumm/script_v2.cpp
@@ -31,7 +31,7 @@
namespace Scumm {
-#define OPCODE(x) { &ScummEngine_v2::x, #x }
+#define OPCODE(x) _OPCODE(ScummEngine_v2, x)
void ScummEngine_v2::setupOpcodes() {
static const OpcodeEntryV2 opcodes[256] = {
diff --git a/scumm/script_v5.cpp b/scumm/script_v5.cpp
index 09ff7250d1..4703b25d90 100644
--- a/scumm/script_v5.cpp
+++ b/scumm/script_v5.cpp
@@ -31,7 +31,7 @@
namespace Scumm {
-#define OPCODE(x) { &ScummEngine_v5::x, #x }
+#define OPCODE(x) _OPCODE(ScummEngine_v5, x)
void ScummEngine_v5::setupOpcodes() {
static const OpcodeEntryV5 opcodes[256] = {
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index 1df9e227e9..b5be67b581 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -45,7 +45,7 @@
namespace Scumm {
-#define OPCODE(x) { &ScummEngine_v6::x, #x }
+#define OPCODE(x) _OPCODE(ScummEngine_v6, x)
void ScummEngine_v6::setupOpcodes() {
static const OpcodeEntryV6 opcodes[256] = {
diff --git a/scumm/script_v6he.cpp b/scumm/script_v6he.cpp
index 6ac7abc17b..9ac4019aee 100644
--- a/scumm/script_v6he.cpp
+++ b/scumm/script_v6he.cpp
@@ -63,7 +63,7 @@ static int virtScreenSavePack(byte *dst, byte *src, int len, int unk);
// transparency in akos.cpp
// negative size in file read/write
-#define OPCODE(x) { &ScummEngine_v60he::x, #x }
+#define OPCODE(x) _OPCODE(ScummEngine_v60he, x)
void ScummEngine_v60he::setupOpcodes() {
static const OpcodeEntryv60he opcodes[256] = {
diff --git a/scumm/script_v72he.cpp b/scumm/script_v72he.cpp
index 4d713da78a..c3ffda90d9 100644
--- a/scumm/script_v72he.cpp
+++ b/scumm/script_v72he.cpp
@@ -40,7 +40,7 @@
namespace Scumm {
-#define OPCODE(x) { &ScummEngine_v72he::x, #x }
+#define OPCODE(x) _OPCODE(ScummEngine_v72he, x)
void ScummEngine_v72he::setupOpcodes() {
static const OpcodeEntryV72he opcodes[256] = {
diff --git a/scumm/script_v7he.cpp b/scumm/script_v7he.cpp
index 811ced88f5..0cbdbc9e50 100644
--- a/scumm/script_v7he.cpp
+++ b/scumm/script_v7he.cpp
@@ -41,7 +41,7 @@
namespace Scumm {
-#define OPCODE(x) { &ScummEngine_v70he::x, #x }
+#define OPCODE(x) _OPCODE(ScummEngine_v70he, x)
void ScummEngine_v70he::setupOpcodes() {
static const OpcodeEntryv70he opcodes[256] = {
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp
index e334717385..024c661411 100644
--- a/scumm/script_v8.cpp
+++ b/scumm/script_v8.cpp
@@ -36,7 +36,7 @@
namespace Scumm {
-#define OPCODE(x) { &ScummEngine_v8::x, #x }
+#define OPCODE(x) _OPCODE(ScummEngine_v8, x)
void ScummEngine_v8::setupOpcodes() {
static const OpcodeEntryV8 opcodes[256] = {
diff --git a/scumm/script_v80he.cpp b/scumm/script_v80he.cpp
index d21f342493..be82d5054e 100644
--- a/scumm/script_v80he.cpp
+++ b/scumm/script_v80he.cpp
@@ -39,7 +39,7 @@
namespace Scumm {
-#define OPCODE(x) { &ScummEngine_v80he::x, #x }
+#define OPCODE(x) _OPCODE(ScummEngine_v80he, x)
void ScummEngine_v80he::setupOpcodes() {
static const OpcodeEntryV80he opcodes[256] = {
diff --git a/scumm/script_v90he.cpp b/scumm/script_v90he.cpp
index c6fdbdfd66..c4c7e306d1 100644
--- a/scumm/script_v90he.cpp
+++ b/scumm/script_v90he.cpp
@@ -39,7 +39,7 @@
namespace Scumm {
-#define OPCODE(x) { &ScummEngine_v90he::x, #x }
+#define OPCODE(x) _OPCODE(ScummEngine_v90he, x)
void ScummEngine_v90he::setupOpcodes() {
static const OpcodeEntryV90he opcodes[256] = {