aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/include
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci/include')
-rw-r--r--engines/sci/include/engine.h4
-rw-r--r--engines/sci/include/kernel.h12
-rw-r--r--engines/sci/include/menubar.h12
-rw-r--r--engines/sci/include/sciconsole.h4
-rw-r--r--engines/sci/include/vm.h66
-rw-r--r--engines/sci/include/vm_types.h9
-rw-r--r--engines/sci/include/vocabulary.h34
7 files changed, 69 insertions, 72 deletions
diff --git a/engines/sci/include/engine.h b/engines/sci/include/engine.h
index e7425c6929..37c52d8af1 100644
--- a/engines/sci/include/engine.h
+++ b/engines/sci/include/engine.h
@@ -79,10 +79,10 @@ namespace Sci {
#define SCI_GAME_IS_RESTARTING_NOW 2
#define SCI_GAME_WAS_RESTARTED_AT_LEAST_ONCE 4
-typedef struct {
+struct drawn_pic_t {
int nr;
int palette;
-} drawn_pic_t;
+};
// Savegame metadata
struct SavegameMetadata {
diff --git a/engines/sci/include/kernel.h b/engines/sci/include/kernel.h
index 906e864522..d1c54d1994 100644
--- a/engines/sci/include/kernel.h
+++ b/engines/sci/include/kernel.h
@@ -47,9 +47,9 @@ extern int _debug_step_running;
#define AVOIDPATH_DYNMEM_STRING "AvoidPath polyline"
-typedef struct {
+struct abs_rect_t {
int x, y, xend, yend;
-} abs_rect_t;
+};
/* Formerly, the heap macros were here; they have been deprecated, however. */
@@ -315,22 +315,22 @@ typedef reg_t kfunct(EngineState *s, int funct_nr, int argc, reg_t *argv);
#define FREESCI_KFUNCT_GLUTTON 1
-typedef struct {
+struct kfunct_sig_pair_t {
kfunct *fun; /* The actual function */
const char *signature; /* kfunct signature */
const char *orig_name; /* Original name, in case we couldn't map it */
-} kfunct_sig_pair_t;
+};
#define KF_OLD 0
#define KF_NEW 1
#define KF_NONE -1 /* No mapping, but name is known */
#define KF_TERMINATOR -42 /* terminates kfunct_mappers */
-typedef struct {
+struct sci_kernel_function_t {
int type; /* KF_* */
const char *name;
kfunct_sig_pair_t sig_pair;
-} sci_kernel_function_t;
+};
extern sci_kernel_function_t kfunct_mappers[];
diff --git a/engines/sci/include/menubar.h b/engines/sci/include/menubar.h
index e437bddcf5..aed7b2de73 100644
--- a/engines/sci/include/menubar.h
+++ b/engines/sci/include/menubar.h
@@ -82,7 +82,7 @@ namespace Sci {
#define MENU_ATTRIBUTE_FLAGS_KEY 0x01
#define MENU_ATTRIBUTE_FLAGS_SAID 0x02
-typedef struct {
+struct menu_item_t {
int type; /* Normal or hbar */
char *keytext; /* right-centered part of the text (the key) */
int keytext_size; /* Width of the right-centered text */
@@ -96,10 +96,10 @@ typedef struct {
int enabled;
int tag;
-} menu_item_t;
+};
-typedef struct {
+struct menu_t {
char *title;
int title_width; /* Width of the title in pixels */
@@ -108,16 +108,16 @@ typedef struct {
int items_nr; /* Window height equals to intems_nr * 10 */
menu_item_t *items; /* Actual entries into the menu */
-} menu_t;
+};
-typedef struct {
+struct menubar_t {
int menus_nr;
menu_t *menus; /* The actual menus */
-} menubar_t;
+};
struct gfx_port;
struct gfx_picture; /* forward declarations for graphics.h */
diff --git a/engines/sci/include/sciconsole.h b/engines/sci/include/sciconsole.h
index c3b93a4671..8888e5927d 100644
--- a/engines/sci/include/sciconsole.h
+++ b/engines/sci/include/sciconsole.h
@@ -51,11 +51,11 @@ extern FILE *con_file;
** directly to the con_file variable.
*/
-typedef union {
+union cmd_param_t {
int32 val;
char *str;
reg_t reg;
-} cmd_param_t;
+};
extern unsigned int cmd_paramlength;
/* The number of parameters passed to a function called from the parser */
diff --git a/engines/sci/include/vm.h b/engines/sci/include/vm.h
index 67561b76ed..05585632e8 100644
--- a/engines/sci/include/vm.h
+++ b/engines/sci/include/vm.h
@@ -106,10 +106,10 @@ namespace Sci {
#define SELECTOR_METHOD 2
/* Types of selectors as returned by grep_selector() below */
-typedef struct {
+struct class_t {
int script; /* number of the script the class is in, -1 for non-existing */
reg_t reg; /* offset; script-relative offset, segment: 0 if not instantiated */
-} class_t;
+};
#define RAW_GET_CLASS_INDEX(scr, reg) ((scr)->obj_indices->check_value(reg.offset, false))
#define RAW_IS_OBJECT(datablock) (getUInt16(((byte *) datablock) + SCRIPT_OBJECT_MAGIC_OFFSET) == SCRIPT_OBJECT_MAGIC_NUMBER)
@@ -117,7 +117,7 @@ typedef struct {
#define IS_CLASS(obj) (obj->variables[SCRIPT_INFO_SELECTOR].offset & SCRIPT_INFO_CLASS)
/* This struct is used to buffer the list of send calls in send_selector() */
-typedef struct {
+struct calls_struct_t {
union {
reg_t func;
reg_t *var;
@@ -127,17 +127,17 @@ typedef struct {
selector_t selector;
stack_ptr_t sp; /* Stack pointer */
int type; /* Same as exec_stack_t.type */
-} calls_struct_t;
+};
-typedef struct {
+struct local_variables_t {
int script_id; /* Script ID this local variable block belongs to */
reg_t *locals;
int nr;
-} local_variables_t;
+};
#define OBJECT_FLAG_FREED (0x1 << 0) /* Clone has been marked as 'freed' */
-typedef struct {
+struct object_t {
int flags;
reg_t pos; /* Object offset within its script; for clones, this is their base */
int variables_nr;
@@ -148,12 +148,12 @@ typedef struct {
uint16 *base_method; /* Pointer to the method selector area for this object */
uint16 *base_vars; /* Pointer to the varselector area for this object */
reg_t *variables;
-} object_t;
+};
-typedef struct {
+struct code_block_t {
reg_t pos;
int size;
-} code_block_t;
+};
#define VM_OBJECT_GET_VARSELECTOR(obj, i) \
(s->version < SCI_VERSION(1,001,000) ? \
@@ -180,7 +180,7 @@ typedef struct {
//#define VM_OBJECT_SET_INDEX(ptr, index) { ((byte *) (ptr))[0] = (index) & 0xff; ((byte *) (ptr))[1] = ((index) >> 8) & 0xff; }
//#define VM_OBJECT_GET_INDEX(scr, reg) (int_hash_map_check_value(scr->obj_indices, reg.offset, 0, NULL))
-typedef struct {
+struct script_t {
int nr; /* Script number */
byte* buf; /* Static data buffer, or NULL if not used */
size_t buf_size;
@@ -212,34 +212,34 @@ typedef struct {
int code_blocks_allocated;
int relocated;
int marked_as_deleted;
-} script_t;
+};
-typedef struct {
+struct dstack_t {
int nr; /* Number of stack entries */
reg_t *entries;
-} dstack_t; /* Data stack */
+}; /* Data stack */
#define CLONE_USED -1
#define CLONE_NONE -1
typedef object_t clone_t;
-typedef struct _node_struct {
+struct node_t {
reg_t pred, succ; /* Predecessor, successor */
reg_t key;
reg_t value;
-} node_t; /* List nodes */
+}; /* List nodes */
-typedef struct _list_struct {
+struct list_t {
reg_t first;
reg_t last;
-} list_t;
+};
-typedef struct {
+struct hunk_t {
void *mem;
unsigned int size;
const char *type;
-} hunk_t;
+};
/* clone_table_t */
DECLARE_HEAPENTRY(clone)
@@ -250,13 +250,13 @@ DECLARE_HEAPENTRY(list) /* list entries */
/* hunk_table_t */
DECLARE_HEAPENTRY(hunk)
-typedef struct {
+struct dynmem_t {
int size;
const char *description;
byte *buf;
-} dynmem_t; /* Free-style memory */
+}; /* Free-style memory */
-typedef struct _mem_obj {
+struct mem_obj_t {
int type;
int segmgr_id; /* Internal value used by the seg_manager's hash map */
union {
@@ -271,11 +271,11 @@ typedef struct _mem_obj {
dynmem_t dynmem;
char *reserved;
} data;
-} mem_obj_t;
+};
-typedef struct {
+struct selector_map_t {
selector_t init; /* Init function */
selector_t play; /* Play function (first function to be called) */
selector_t replay; /* Replay function */
@@ -347,9 +347,9 @@ typedef struct {
selector_t flags;
selector_t points; /* Used by AvoidPath() */
-} selector_map_t; /* Contains selector IDs for a few selected selectors */
+}; /* Contains selector IDs for a few selected selectors */
-typedef struct {
+struct view_object_t {
reg_t obj;
reg_t *signalp; /* Used only indirectly */
reg_t *underBitsp; /* The same goes for the handle storage */
@@ -361,7 +361,7 @@ typedef struct {
int view_nr, loop, cel; /* view_nr is ised for save/restore */
int nsTop, nsLeft, nsRight, nsBottom;
int real_y, z, index_nr; /* Used for sorting */
-} view_object_t;
+};
#define VAR_GLOBAL 0
#define VAR_LOCAL 1
@@ -372,7 +372,7 @@ typedef struct {
#define EXEC_STACK_TYPE_KERNEL 1
#define EXEC_STACK_TYPE_VARSELECTOR 2
-typedef struct {
+struct exec_stack_t {
reg_t objp;
reg_t sendp; /* Pointer to the object containing the invoked method */
union {
@@ -392,16 +392,16 @@ typedef struct {
** was the initial call. */
byte type; /* EXEC_STACK_TYPE* */
-} exec_stack_t;
+};
-typedef struct _breakpoint {
+struct breakpoint_t {
int type;
union {
uint32 address; /* Breakpoints on exports */
char *name; /* Breakpoints on selector names */
} data;
- struct _breakpoint *next;
-} breakpoint_t;
+ breakpoint_t *next;
+};
#define BREAK_SELECTOR 1
/* Break when selector is executed. data contains (char *) selector name
diff --git a/engines/sci/include/vm_types.h b/engines/sci/include/vm_types.h
index 64fe330189..8ffb0b19be 100644
--- a/engines/sci/include/vm_types.h
+++ b/engines/sci/include/vm_types.h
@@ -23,16 +23,13 @@
*
*/
-#ifndef _SCI_VM_TYPES_H_
-#define _SCI_VM_TYPES_H_
+#ifndef SCI_VM_TYPES_H
+#define SCI_VM_TYPES_H
#include "common/scummsys.h"
namespace Sci {
-#define SCI_REG_SIZE 16;
-#define SCI_SEG_SIZE 16;
-
typedef int seg_id_t; /* Segment ID type */
struct reg_t {
@@ -64,4 +61,4 @@ extern reg_t NULL_REG;
} // End of namespace Sci
-#endif /* !_SCI_VM_TYPES_H_ */
+#endif // SCI_VM_TYPES_H
diff --git a/engines/sci/include/vocabulary.h b/engines/sci/include/vocabulary.h
index 25f68bce78..3e2239b952 100644
--- a/engines/sci/include/vocabulary.h
+++ b/engines/sci/include/vocabulary.h
@@ -110,32 +110,32 @@ extern const char *class_names[]; /* Vocabulary class names */
#define SAID_LONG(x) ((x) << 8)
-typedef struct {
+struct word_t {
int w_class; /* Word class */
int group; /* Word group */
char word[1]; /* The actual word */
-} word_t;
+};
-typedef struct {
+struct parse_rule_t {
int id; /* non-terminal ID */
int first_special; /* first terminal or non-terminal */
int specials_nr; /* number of terminals and non-terminals */
int length;
int data[1]; /* actual data (size 1 to avoid compiler warnings) */
-} parse_rule_t;
+};
-typedef struct _parse_rule_list {
+struct parse_rule_list_t {
int terminal; /* Terminal character this rule matches against or 0 for a non-terminal rule */
parse_rule_t *rule;
- struct _parse_rule_list *next;
-} parse_rule_list_t;
+ parse_rule_list_t *next;
+};
-typedef struct {
+struct suffix_t {
int class_mask; /* the word class this suffix applies to */
int result_class; /* the word class a word is morphed to if it doesn't fail this check */
@@ -146,36 +146,36 @@ typedef struct {
char *alt_suffix; /* The alternative suffix */
char *word_suffix; /* The suffix as used in the word vocabulary */
-} suffix_t;
+};
-typedef struct {
+struct result_word_t {
int w_class; /* Word class */
int group; /* Word group */
-} result_word_t;
+};
-typedef struct {
+struct synonym_t {
int replaceant; /* The word group to replace */
int replacement; /* The replacement word group for this one */
-} synonym_t;
+};
-typedef struct {
+struct parse_tree_branch_t {
int id;
int data[10];
-} parse_tree_branch_t;
+};
#define PARSE_TREE_NODE_LEAF 0
#define PARSE_TREE_NODE_BRANCH 1
-typedef struct {
+struct parse_tree_node_t {
short type; /* leaf or branch */
@@ -186,7 +186,7 @@ typedef struct {
} content;
-} parse_tree_node_t;
+};