aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2009-02-21 19:54:15 +0000
committerMax Horn2009-02-21 19:54:15 +0000
commit041869ed360551d9ebc435a1e7dac418578f6a3b (patch)
treedef2637f27381baf46d35b1dcf3c5bc483565167
parenta25c7debe1d730cbbb5509b81fe8d26bfd412d39 (diff)
downloadscummvm-rg350-041869ed360551d9ebc435a1e7dac418578f6a3b.tar.gz
scummvm-rg350-041869ed360551d9ebc435a1e7dac418578f6a3b.tar.bz2
scummvm-rg350-041869ed360551d9ebc435a1e7dac418578f6a3b.zip
SCI: Untangling #include dependencies a bit
svn-id: r38740
-rw-r--r--engines/sci/engine/message.cpp1
-rw-r--r--engines/sci/engine/sys_strings.cpp1
-rw-r--r--engines/sci/include/engine.h4
-rw-r--r--engines/sci/include/sci_memory.h1
-rw-r--r--engines/sci/include/sciresource.h8
-rw-r--r--engines/sci/include/script.h19
-rw-r--r--engines/sci/include/sys_strings.h24
-rw-r--r--engines/sci/include/vm.h14
-rw-r--r--engines/sci/include/vocabulary.h2
-rw-r--r--engines/sci/scicore/decompress0.cpp5
-rw-r--r--engines/sci/scicore/decompress1.cpp2
-rw-r--r--engines/sci/scicore/decompress11.cpp2
-rw-r--r--engines/sci/scicore/resource.cpp1
-rw-r--r--engines/sci/scicore/sci_memory.cpp3
-rw-r--r--engines/sci/sfx/mixer/soft.cpp1
15 files changed, 53 insertions, 35 deletions
diff --git a/engines/sci/engine/message.cpp b/engines/sci/engine/message.cpp
index 65679bb2d1..4f539b270a 100644
--- a/engines/sci/engine/message.cpp
+++ b/engines/sci/engine/message.cpp
@@ -24,6 +24,7 @@
*/
#include "sci/engine/message.h"
+#include "sci/tools.h"
namespace Sci {
diff --git a/engines/sci/engine/sys_strings.cpp b/engines/sci/engine/sys_strings.cpp
index 5b9c32c4fc..601b94a4b5 100644
--- a/engines/sci/engine/sys_strings.cpp
+++ b/engines/sci/engine/sys_strings.cpp
@@ -23,6 +23,7 @@
*
*/
+#include "sci/tools.h"
#include "sci/include/sys_strings.h"
#include "sci/include/sci_memory.h"
diff --git a/engines/sci/include/engine.h b/engines/sci/include/engine.h
index 27416b3beb..e7425c6929 100644
--- a/engines/sci/include/engine.h
+++ b/engines/sci/include/engine.h
@@ -33,15 +33,15 @@ namespace Common {
class WriteStream;
}
-#include "sci/tools.h"
+#include "sci/include/vocabulary.h"
#include "sci/include/sciresource.h"
#include "sci/include/script.h"
-#include "sci/include/vocabulary.h"
#include "sci/include/sciconsole.h"
#include "sci/include/vm.h"
#include "sci/include/menubar.h"
#include "sci/include/versions.h"
#include "sci/include/kernel.h"
+#include "sci/engine/seg_manager.h"
#include "sci/gfx/gfx_state_internal.h"
#include "sci/sfx/sfx_engine.h"
diff --git a/engines/sci/include/sci_memory.h b/engines/sci/include/sci_memory.h
index 85a23a1fc6..d9ba069719 100644
--- a/engines/sci/include/sci_memory.h
+++ b/engines/sci/include/sci_memory.h
@@ -44,7 +44,6 @@
#define _SCI_MEMORY_H
#include "common/scummsys.h"
-#include "sci/tools.h"
namespace Sci {
diff --git a/engines/sci/include/sciresource.h b/engines/sci/include/sciresource.h
index 8d885d9d9b..1dd35b5d8d 100644
--- a/engines/sci/include/sciresource.h
+++ b/engines/sci/include/sciresource.h
@@ -29,11 +29,13 @@
/*#define _SCI_RESOURCE_DEBUG */
/*#define _SCI_DECOMPRESS_DEBUG*/
-#include "common/stream.h"
#include "common/str.h"
-#include "sci/tools.h"
-#include "sci/include/versions.h"
+namespace Common {
+ class ReadStream;
+}
+
+#include "sci/include/scitypes.h"
namespace Sci {
diff --git a/engines/sci/include/script.h b/engines/sci/include/script.h
index 9d3d7ee22a..eb53e1d5aa 100644
--- a/engines/sci/include/script.h
+++ b/engines/sci/include/script.h
@@ -30,18 +30,21 @@
namespace Sci {
+struct EngineState;
+struct ResourceManager;
+
/*#define SCRIPT_DEBUG */
#define SCI_SCRIPTS_NR 1000
-typedef struct script_opcode_ {
+struct script_opcode {
unsigned opcode;
int arg1, arg2, arg3;
int pos, size;
-} script_opcode;
+};
-typedef enum {
+enum script_object_types {
sci_obj_terminator,
sci_obj_object,
sci_obj_code,
@@ -53,12 +56,12 @@ typedef enum {
sci_obj_pointers,
sci_obj_preload_text, /* This is really just a flag. */
sci_obj_localvars
-} script_object_types;
+};
void script_dissect(ResourceManager *resmgr, int res_no, char **snames, int snames_nr);
/* Opcode formats as used by script.c */
-typedef enum {
+enum opcode_format {
Script_Invalid = -1,
Script_None = 0,
Script_Byte,
@@ -75,9 +78,9 @@ typedef enum {
Script_Param,
Script_Offset,
Script_End
-} opcode_format;
+};
-typedef enum { /* FIXME */
+enum sci_opcodes { /* FIXME */
op_bnot = 0,
op_add,
op_sub,
@@ -201,7 +204,7 @@ typedef enum { /* FIXME */
op_minussli,
op_minussti,
op_minusspi
-} sci_opcodes;
+};
extern opcode_format formats[128][4];
diff --git a/engines/sci/include/sys_strings.h b/engines/sci/include/sys_strings.h
index b9586268f2..2d89a263d8 100644
--- a/engines/sci/include/sys_strings.h
+++ b/engines/sci/include/sys_strings.h
@@ -23,27 +23,29 @@
*
*/
-#ifndef _FREESCI_SYSTEM_STRINGS_H_
-#define _FREESCI_SYSTEM_STRINGS_H_
+#ifndef SCI_SYS_STRINGS_H
+#define SCI_SYS_STRINGS_H
namespace Sci {
-#define SYS_STRINGS_MAX 4
+enum {
+ SYS_STRINGS_MAX = 4,
-#define SYS_STRING_SAVEDIR 0
-#define SYS_STRING_PARSER_BASE 1
+ SYS_STRING_SAVEDIR = 0,
+ SYS_STRING_PARSER_BASE = 1,
-#define MAX_PARSER_BASE 64
+ MAX_PARSER_BASE = 64
+};
-typedef struct {
+struct sys_string_t {
char *name;
int max_size;
char *value;
-} sys_string_t;
+};
-typedef struct {
+struct sys_strings_t {
sys_string_t strings[SYS_STRINGS_MAX];
-} sys_strings_t;
+};
void sys_string_acquire(sys_strings_t *strings, int index, const char *name, int max_len);
/* Reserves a new system string
@@ -75,4 +77,4 @@ void sys_string_free_all(sys_strings_t *strings);
} // End of namespace Sci
-#endif /* !_FREESCI_SYSTEM_STRINGS_H_ */
+#endif // SCI_SYS_STRINGS_H
diff --git a/engines/sci/include/vm.h b/engines/sci/include/vm.h
index 6771e04c06..690c29dbdc 100644
--- a/engines/sci/include/vm.h
+++ b/engines/sci/include/vm.h
@@ -23,19 +23,17 @@
*
*/
-/* VM and kernel declarations */
+#ifndef _SCI_VM_H
+#define _SCI_VM_H
+/* VM and kernel declarations */
-#include "sci/include/script.h"
-#include "sci/include/vocabulary.h"
-#include "sci/include/versions.h"
-#include "sci/engine/seg_manager.h"
-#include "sci/include/vm_types.h"
+#include "sci/include/versions.h" // for sci_version_t
+#include "sci/include/vm_types.h" // for reg_t
#include "sci/include/sys_strings.h"
#include "sci/include/heapmgr.h"
-#ifndef _SCI_VM_H
-#define _SCI_VM_H
+#include "sci/engine/int_hashmap.h"
namespace Sci {
diff --git a/engines/sci/include/vocabulary.h b/engines/sci/include/vocabulary.h
index 74f745d39d..25f68bce78 100644
--- a/engines/sci/include/vocabulary.h
+++ b/engines/sci/include/vocabulary.h
@@ -31,6 +31,8 @@
namespace Sci {
+struct ResourceManager;
+
/*#define VOCABULARY_DEBUG */
/*#define SCI_SIMPLE_SAID_CODE */ /* Whether the simplified Said() matching should be used */
/*#define SCI_SIMPLE_SAID_DEBUG */ /* uncomment to enable simple said debugging */
diff --git a/engines/sci/scicore/decompress0.cpp b/engines/sci/scicore/decompress0.cpp
index aa6dd0c286..701c70e639 100644
--- a/engines/sci/scicore/decompress0.cpp
+++ b/engines/sci/scicore/decompress0.cpp
@@ -27,6 +27,9 @@
** This is for SCI version 0 style compression.
*/
+#include "common/stream.h"
+#include "common/endian.h"
+
#include "sci/include/sci_memory.h"
#include "sci/include/sciresource.h"
@@ -188,7 +191,7 @@ gint16 getc2(guint8 *node, guint8 *src, guint16 *bytectr, guint16 *bitctr, int c
node += next << 1;
}
- return getInt16(node);
+ return (int16)READ_UINT16(node);
}
// Huffman token decryptor
diff --git a/engines/sci/scicore/decompress1.cpp b/engines/sci/scicore/decompress1.cpp
index ab26033083..b1daad7b5d 100644
--- a/engines/sci/scicore/decompress1.cpp
+++ b/engines/sci/scicore/decompress1.cpp
@@ -25,7 +25,9 @@
// Reads data from a resource file and stores the result in memory
+#include "common/stream.h"
#include "common/util.h"
+
#include "sci/include/sci_memory.h"
#include "sci/include/sciresource.h"
diff --git a/engines/sci/scicore/decompress11.cpp b/engines/sci/scicore/decompress11.cpp
index 8f54fb6278..ec1e7ce444 100644
--- a/engines/sci/scicore/decompress11.cpp
+++ b/engines/sci/scicore/decompress11.cpp
@@ -25,6 +25,8 @@
// Reads data from a resource file and stores the result in memory
+#include "common/stream.h"
+
#include "sci/include/sci_memory.h"
#include "sci/include/sciresource.h"
diff --git a/engines/sci/scicore/resource.cpp b/engines/sci/scicore/resource.cpp
index 34dd9d4647..d12d261c01 100644
--- a/engines/sci/scicore/resource.cpp
+++ b/engines/sci/scicore/resource.cpp
@@ -29,6 +29,7 @@
#include "common/file.h"
#include "common/util.h"
+#include "sci/tools.h"
#include "sci/include/sci_memory.h"
#include "sci/include/sciresource.h"
#include "sci/include/vocabulary.h"
diff --git a/engines/sci/scicore/sci_memory.cpp b/engines/sci/scicore/sci_memory.cpp
index 693f90848f..2b27a1c3c7 100644
--- a/engines/sci/scicore/sci_memory.cpp
+++ b/engines/sci/scicore/sci_memory.cpp
@@ -23,8 +23,9 @@
*
*/
-#include "sci/include/sci_memory.h"
#include "common/util.h"
+#include "sci/tools.h"
+#include "sci/include/sci_memory.h"
namespace Sci {
diff --git a/engines/sci/sfx/mixer/soft.cpp b/engines/sci/sfx/mixer/soft.cpp
index 5aadf40cf1..db991b5332 100644
--- a/engines/sci/sfx/mixer/soft.cpp
+++ b/engines/sci/sfx/mixer/soft.cpp
@@ -25,6 +25,7 @@
#include "common/mutex.h"
+#include "sci/tools.h"
#include "sci/sfx/mixer.h"
#include "sci/include/sci_memory.h"