aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/console.cpp2
-rw-r--r--engines/sci/detection.cpp10
-rw-r--r--engines/sci/engine/game.cpp2
-rw-r--r--engines/sci/engine/grammar.cpp4
-rw-r--r--engines/sci/engine/int_hashmap.h4
-rw-r--r--engines/sci/engine/kernel.cpp2
-rw-r--r--engines/sci/engine/kernel_types.h2
-rw-r--r--engines/sci/engine/kfile.cpp6
-rw-r--r--engines/sci/engine/kgraphics.cpp48
-rw-r--r--engines/sci/engine/kmenu.cpp4
-rw-r--r--engines/sci/engine/kpathing.cpp4
-rw-r--r--engines/sci/engine/kscripts.cpp4
-rw-r--r--engines/sci/engine/ksound.cpp62
-rw-r--r--engines/sci/engine/said.cpp14
-rw-r--r--engines/sci/engine/said.y16
-rw-r--r--engines/sci/engine/savegame.cfsml18
-rw-r--r--engines/sci/engine/savegame.cpp124
-rw-r--r--engines/sci/engine/scriptdebug.cpp16
-rw-r--r--engines/sci/engine/seg_manager.cpp10
-rw-r--r--engines/sci/engine/seg_manager.h32
-rw-r--r--engines/sci/engine/vm.cpp404
-rw-r--r--engines/sci/gfx/font.cpp6
-rw-r--r--engines/sci/gfx/gfx_crossblit.cpp8
-rw-r--r--engines/sci/gfx/gfx_driver.cpp6
-rw-r--r--engines/sci/gfx/gfx_operations.h30
-rw-r--r--engines/sci/gfx/gfx_pixmap_scale.cpp18
-rw-r--r--engines/sci/gfx/gfx_resmgr.h12
-rw-r--r--engines/sci/gfx/gfx_resource.h16
-rw-r--r--engines/sci/gfx/gfx_state_internal.h60
-rw-r--r--engines/sci/gfx/gfx_support.cpp32
-rw-r--r--engines/sci/gfx/gfx_system.h2
-rw-r--r--engines/sci/gfx/gfx_test.cpp4
-rw-r--r--engines/sci/gfx/gfx_tools.cpp4
-rw-r--r--engines/sci/gfx/gfx_tools.h14
-rw-r--r--engines/sci/gfx/gfx_widgets.h13
-rw-r--r--engines/sci/gfx/operations.cpp38
-rw-r--r--engines/sci/gfx/resmgr.cpp32
-rw-r--r--engines/sci/gfx/resource/sci_pic_0.cpp56
-rw-r--r--engines/sci/gfx/resource/sci_picfill.cpp4
-rw-r--r--engines/sci/gfx/resource/sci_picfill_aux.cpp4
-rw-r--r--engines/sci/gfx/resource/sci_resmgr.cpp2
-rw-r--r--engines/sci/gfx/resource/sci_view_1.cpp8
-rw-r--r--engines/sci/gfx/sbtree.h2
-rw-r--r--engines/sci/gfx/sci_widgets.cpp8
-rw-r--r--engines/sci/gfx/widgets.cpp36
-rw-r--r--engines/sci/include/kernel.h24
-rw-r--r--engines/sci/include/list.h2
-rw-r--r--engines/sci/include/sci_widgets.h12
-rw-r--r--engines/sci/include/sciresource.h6
-rw-r--r--engines/sci/include/vm.h43
-rw-r--r--engines/sci/include/vocabulary.h11
-rw-r--r--engines/sci/scicore/decompress0.cpp2
-rw-r--r--engines/sci/scicore/resource.cpp2
-rw-r--r--engines/sci/scicore/resource_map.cpp48
-rw-r--r--engines/sci/scicore/resource_patch.cpp2
-rw-r--r--engines/sci/scicore/vocab.cpp6
-rw-r--r--engines/sci/sfx/core.cpp4
-rw-r--r--engines/sci/sfx/device/camd-midi.cpp2
-rw-r--r--engines/sci/sfx/iterator.cpp38
-rw-r--r--engines/sci/sfx/mixer/soft.cpp16
-rw-r--r--engines/sci/sfx/pcm_device.cpp2
-rw-r--r--engines/sci/sfx/seq/oss-adlib.cpp4
-rw-r--r--engines/sci/sfx/sfx_iterator.h16
-rw-r--r--engines/sci/sfx/sfx_iterator_internal.h3
-rw-r--r--engines/sci/sfx/sfx_songlib.h2
-rw-r--r--engines/sci/sfx/softseq/SN76496.cpp2
-rw-r--r--engines/sci/sfx/softseq/fluidsynth.cpp2
-rw-r--r--engines/sci/sfx/softseq/opl2.cpp6
-rw-r--r--engines/sci/sfx/softseq/pcspeaker.cpp2
69 files changed, 718 insertions, 742 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index aad4480539..30ae55f801 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -47,7 +47,7 @@ bool Console::cmdGetVersion(int argc, const char **argv) {
DebugPrintf("Resource file version: %s\n", sci_version_types[_vm->getResMgr()->sci_version]);
- DebugPrintf("Emulated interpreter version: %d.%03d.%03d\n",
+ DebugPrintf("Emulated interpreter version: %d.%03d.%03d\n",
SCI_VERSION_MAJOR(ver), SCI_VERSION_MINOR(ver), SCI_VERSION_PATCHLEVEL(ver));
return true;
diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp
index 90a202e329..292037ec00 100644
--- a/engines/sci/detection.cpp
+++ b/engines/sci/detection.cpp
@@ -173,7 +173,7 @@ static const struct SciGameDescription SciGameDescriptions[] = {
SCI_VERSION_AUTODETECT,
SCI_VERSION(0, 0, 294)
},
-
+
// Christmas Card 1990: The Seasoned Professional - English DOS (16 Colors)
{{"christmas1990", "16 Colors", {
{"resource.map", 0, "8f656714a05b94423ac6eb10ee8797d0", 600},
@@ -183,7 +183,7 @@ static const struct SciGameDescription SciGameDescriptions[] = {
SCI_VERSION_AUTODETECT,
SCI_VERSION(1, 0, 172)
},
-
+
// Christmas Card 1990: The Seasoned Professional - English DOS (256 Colors)
{{"christmas1990", "256 Colors", {
{"resource.map", 0, "44b8f45b841b9b5e17e939a35e443988", 600},
@@ -193,7 +193,7 @@ static const struct SciGameDescription SciGameDescriptions[] = {
SCI_VERSION_AUTODETECT,
SCI_VERSION(1, 0, 174)
},
-
+
// Christmas Card 1992 - English DOS
{{"christmas1992", "", {
{"resource.map", 0, "f1f8c8a8443f523422af70b4ec85b71c", 318},
@@ -1041,8 +1041,8 @@ static const struct SciGameDescription SciGameDescriptions[] = {
SCI_VERSION(1, 001, 115)
},
- // Larry 6 - English/German DOS CD - HIRES
- {{"lsl6", "", {
+ // Larry 6 - English/German DOS CD - HIRES
+ {{"lsl6", "", {
{"resource.map", 0, "0c0804434ea62278dd15032b1947426c", 8872},
{"resource.000", 0, "9a9f4870504444cda863dd14d077a680", 18520872},
{NULL, 0, NULL, 0}}, Common::EN_ANY, Common::kPlatformPC, 0},
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index 6d0dd3b925..5c7bd07f3e 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -415,7 +415,7 @@ static int create_class_table_sci0(EngineState *s) {
s->classtable = (class_t*)sci_realloc(s->classtable, sizeof(class_t) * (classnr + 1));
// Clear after resize
- memset(&(s->classtable[s->classtable_size]), 0, sizeof(class_t) * (1 + classnr - s->classtable_size));
+ memset(&(s->classtable[s->classtable_size]), 0, sizeof(class_t) * (1 + classnr - s->classtable_size));
s->classtable_size = classnr + 1; // Adjust maximum number of entries
}
diff --git a/engines/sci/engine/grammar.cpp b/engines/sci/engine/grammar.cpp
index 5d72dcd8ad..f3a3d2c33b 100644
--- a/engines/sci/engine/grammar.cpp
+++ b/engines/sci/engine/grammar.cpp
@@ -417,7 +417,7 @@ void vocab_gnf_dump(parse_tree_branch_t *branches, int branches_nr) {
}
int vocab_build_parse_tree(parse_tree_node_t *nodes, result_word_t *words, int words_nr,
- parse_tree_branch_t *branch0, parse_rule_list_t *rules) {
+ parse_tree_branch_t *branch0, parse_rule_list_t *rules) {
return vocab_gnf_parse(nodes, words, words_nr, branch0, rules, 0);
}
@@ -488,7 +488,7 @@ static int _vbpt_write_subexpression(parse_tree_node_t *nodes, int *pos, parse_r
}
int vocab_gnf_parse(parse_tree_node_t *nodes, result_word_t *words, int words_nr,
- parse_tree_branch_t *branch0, parse_rule_list_t *tlist, int verbose) {
+ parse_tree_branch_t *branch0, parse_rule_list_t *tlist, int verbose) {
// Get the start rules:
parse_rule_list_t *work = _vocab_clone_rule_list_by_id(tlist, branch0->data[1]);
parse_rule_list_t *results = NULL;
diff --git a/engines/sci/engine/int_hashmap.h b/engines/sci/engine/int_hashmap.h
index c677079211..e191f76c0f 100644
--- a/engines/sci/engine/int_hashmap.h
+++ b/engines/sci/engine/int_hashmap.h
@@ -50,7 +50,7 @@ struct int_hash_map_t {
node_t *next;
};
- int base_value; // Starts at zero, counts upwards
+ int base_value; // Starts at zero, counts upwards
node_t *nodes[DCS_INT_HASH_MAX + 1];
node_t *holes; /* List of freed entries to minimize
** memory operations and modifications
@@ -61,7 +61,7 @@ struct int_hash_map_t {
public:
int_hash_map_t();
~int_hash_map_t();
-
+
/**
* Checks whether a value is in the map, adds it if neccessary.
* @param value The value to check for/add
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp
index 5c5cf51a04..62fc356857 100644
--- a/engines/sci/engine/kernel.cpp
+++ b/engines/sci/engine/kernel.cpp
@@ -557,7 +557,7 @@ reg_t kGetTime(EngineState *s, int funct_nr, int argc, reg_t *argv) {
return make_reg(0, retval);
}
-#define K_MEMORY_ALLOCATE_CRITICAL 1
+#define K_MEMORY_ALLOCATE_CRITICAL 1
#define K_MEMORY_ALLOCATE_NONCRITICAL 2
#define K_MEMORY_FREE 3
#define K_MEMORY_MEMCPY 4
diff --git a/engines/sci/engine/kernel_types.h b/engines/sci/engine/kernel_types.h
index 7065b595a6..473d6afe09 100644
--- a/engines/sci/engine/kernel_types.h
+++ b/engines/sci/engine/kernel_types.h
@@ -41,7 +41,7 @@ namespace Sci {
#define KSIG_SPEC_ARITHMETIC 'i'
#define KSIG_SPEC_NULL 'z'
#define KSIG_SPEC_ANY '.'
-#define KSIG_SPEC_ALLOW_INV '!' // Allow invalid pointers
+#define KSIG_SPEC_ALLOW_INV '!' // Allow invalid pointers
#define KSIG_SPEC_ELLIPSIS '*' // Arbitrarily more TYPED arguments
#define KSIG_SPEC_SUM_DONE ('a' - 'A') // Use small letters to indicate end of sum type
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 33461cb6a4..231b62831a 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -207,7 +207,7 @@ static FILE *getFileFromHandle(EngineState *s, int handle) {
SCIkwarn(SCIkERROR, "Attempt to use invalid/unused file handle %d\n", handle);
return 0;
}
-
+
return s->file_handles[handle];
}
@@ -628,7 +628,7 @@ reg_t kGetSaveFiles(EngineState *s, int funct_nr, int argc, reg_t *argv) {
char namebuf[SCI_MAX_SAVENAME_LENGTH]; // Save game name buffer
strncpy(namebuf, meta.savegame_name, SCI_MAX_SAVENAME_LENGTH);
namebuf[SCI_MAX_SAVENAME_LENGTH-1] = 0;
-
+
if (strlen(namebuf) > 0) {
if (namebuf[strlen(namebuf) - 1] == '\n')
namebuf[strlen(namebuf) - 1] = 0; // Remove trailing newline
@@ -772,7 +772,7 @@ reg_t kValidPath(EngineState *s, int funct_nr, int argc, reg_t *argv) {
return s->r_acc;
}
-#define K_FILEIO_OPEN 0
+#define K_FILEIO_OPEN 0
#define K_FILEIO_CLOSE 1
#define K_FILEIO_READ_RAW 2
#define K_FILEIO_WRITE_RAW 3
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index ff31b4b2bd..887053c8e8 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -58,34 +58,34 @@ namespace Sci {
#define ADD_TO_CURRENT_PORT(widget) \
- {if (s->port) \
- s->port->add(GFXWC(s->port), GFXW(widget)); \
- else \
- s->picture_port->add(GFXWC(s->visual), GFXW(widget));}
+ {if (s->port) \
+ s->port->add(GFXWC(s->port), GFXW(widget)); \
+ else \
+ s->picture_port->add(GFXWC(s->visual), GFXW(widget));}
#define ADD_TO_CURRENT_PICTURE_PORT(widget) \
- {if (s->port) \
- s->port->add(GFXWC(s->port), GFXW(widget)); \
- else \
- s->picture_port->add(GFXWC(s->picture_port), GFXW(widget));}
+ {if (s->port) \
+ s->port->add(GFXWC(s->port), GFXW(widget)); \
+ else \
+ s->picture_port->add(GFXWC(s->picture_port), GFXW(widget));}
#define ADD_TO_WINDOW_PORT(widget) \
- s->wm_port->add(GFXWC(s->wm_port), GFXW(widget));
+ s->wm_port->add(GFXWC(s->wm_port), GFXW(widget));
#define ADD_TO_CURRENT_FG_WIDGETS(widget) \
- ADD_TO_CURRENT_PICTURE_PORT(widget)
+ ADD_TO_CURRENT_PICTURE_PORT(widget)
#define ADD_TO_CURRENT_BG_WIDGETS(widget) \
- ADD_TO_CURRENT_PICTURE_PORT(widget)
+ ADD_TO_CURRENT_PICTURE_PORT(widget)
#define FULL_REDRAW()\
- if (s->visual) \
- s->visual->draw(GFXW(s->visual), gfxw_point_zero); \
- gfxop_update(s->gfx_state);
+ if (s->visual) \
+ s->visual->draw(GFXW(s->visual), gfxw_point_zero); \
+ gfxop_update(s->gfx_state);
#define FULL_INSPECTION()\
- if (s->visual) \
- s->visual->print(GFXW(s->visual), 0);
+ if (s->visual) \
+ s->visual->print(GFXW(s->visual), 0);
#define GFX_ASSERT(x) { \
@@ -949,7 +949,7 @@ reg_t kNumCels(EngineState *s, int funct_nr, int argc, reg_t *argv) {
int cel = 0xffff;
- if (gfxop_check_cel(s->gfx_state, view, &loop, &cel)) {
+ if (gfxop_check_cel(s->gfx_state, view, &loop, &cel)) {
// OK, this is a hack and there's a
// real function to calculate cel numbers...
SCIkwarn(SCIkERROR, "view.%d (0x%x) not found\n", view, view);
@@ -1250,7 +1250,7 @@ static void _k_set_now_seen(EngineState *s, reg_t object) {
abs_rect_t absrect = get_nsrect(s, object, 0);
if (lookup_selector(s, object, s->selector_map.nsTop, NULL, NULL) != SELECTOR_VARIABLE) {
- return;
+ return;
} // This isn't fatal
PUT_SEL32V(object, nsLeft, absrect.x);
@@ -1463,7 +1463,7 @@ reg_t kEditControl(EngineState *s, int funct_nr, int argc, reg_t *argv) {
cursor = textlen;
break;
case SCI_K_RIGHT:
- if (cursor + 1 <= textlen)
+ if (cursor + 1 <= textlen)
++cursor;
break;
case SCI_K_LEFT:
@@ -1663,7 +1663,7 @@ static void draw_rect_to_control_map(EngineState *s, abs_rect_t abs_zone) {
SCIkdebug(SCIkGRAPHICS, " adding control block (%d,%d)to(%d,%d)\n", abs_zone.x, abs_zone.y, abs_zone.xend, abs_zone.yend);
- box = gfxw_new_box(s->gfx_state, gfx_rect(abs_zone.x, abs_zone.y, abs_zone.xend - abs_zone.x,
+ box = gfxw_new_box(s->gfx_state, gfx_rect(abs_zone.x, abs_zone.y, abs_zone.xend - abs_zone.x,
abs_zone.yend - abs_zone.y), color, color, GFX_BOX_SHADE_FLAT);
assert_primary_widget_lists(s);
@@ -1725,7 +1725,7 @@ static void _k_view_list_do_postdraw(EngineState *s, gfxw_list_t *list) {
#endif
}
#ifdef DEBUG_LSRECT
- else
+ else
fprintf(stderr, "Not lsRecting "PREG" because %d\n", PRINT_REG(obj), lookup_selector(s, obj, s->selector_map.nsBottom, NULL, NULL));
#endif
@@ -2501,7 +2501,7 @@ reg_t kNewWindow(EngineState *s, int funct_nr, int argc, reg_t *argv) {
lWhite.alpha = 0;
window = sciw_new_window(s, gfx_rect(x, y, xl, yl), s->titlebar_port->font_nr, fgcolor, bgcolor,
- s->titlebar_port->font_nr, lWhite, black, argv[4 + argextra].segment ?
+ s->titlebar_port->font_nr, lWhite, black, argv[4 + argextra].segment ?
kernel_dereference_char_pointer(s, argv[4 + argextra], 0) : NULL, flags);
// PQ3 has the interpreter store underBits implicitly.
@@ -2548,10 +2548,10 @@ reg_t kNewWindow(EngineState *s, int funct_nr, int argc, reg_t *argv) {
#define K_ANIMATE_OPEN_SIMPLE 100 // No animation
#define GRAPH_BLANK_BOX(s, x, y, xl, yl, color) GFX_ASSERT(gfxop_fill_box(s->gfx_state, \
- gfx_rect(x, (((y) < 10)? 10 : (y)), xl, (((y) < 10)? ((y) - 10) : 0) + (yl)), s->ega_colors[color]));
+ gfx_rect(x, (((y) < 10)? 10 : (y)), xl, (((y) < 10)? ((y) - 10) : 0) + (yl)), s->ega_colors[color]));
#define GRAPH_UPDATE_BOX(s, x, y, xl, yl) GFX_ASSERT(gfxop_draw_pixmap(s->gfx_state, newscreen, \
- gfx_rect(x, (((y) < 10)? 10 : (y)) - 10, xl, (((y) < 10)? ((y) - 10) : 0) + (yl)), Common::Point(x, ((y) < 10)? 10 : (y) )));
+ gfx_rect(x, (((y) < 10)? 10 : (y)) - 10, xl, (((y) < 10)? ((y) - 10) : 0) + (yl)), Common::Point(x, ((y) < 10)? 10 : (y) )));
static void animate_do_animation(EngineState *s, int funct_nr, int argc, reg_t *argv) {
int i, remaining_checkers;
diff --git a/engines/sci/engine/kmenu.cpp b/engines/sci/engine/kmenu.cpp
index 7546c8b712..24e19bd3b2 100644
--- a/engines/sci/engine/kmenu.cpp
+++ b/engines/sci/engine/kmenu.cpp
@@ -301,8 +301,8 @@ _menu_go_down(EngineState *s, int menu_nr, int item_nr) {
}
#define FULL_REDRAW \
- s->visual->draw(GFXW(s->visual), Common::Point(0, 0)); \
- gfxop_update(s->gfx_state);
+ s->visual->draw(GFXW(s->visual), Common::Point(0, 0)); \
+ gfxop_update(s->gfx_state);
reg_t
diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp
index 204dae4258..a5546389be 100644
--- a/engines/sci/engine/kpathing.cpp
+++ b/engines/sci/engine/kpathing.cpp
@@ -65,9 +65,9 @@ namespace Sci {
// Visibility matrix
#define VIS_MATRIX_ROW_SIZE(N) (((N) / 8) + ((N) % 8 ? 1 : 0))
#define SET_VISIBLE(S, P, Q) ((S)->vis_matrix)[(P) * VIS_MATRIX_ROW_SIZE((S)->vertices) \
- + (Q) / 8] |= (1 << ((Q) % 8))
+ + (Q) / 8] |= (1 << ((Q) % 8))
#define IS_VISIBLE(S, P, Q) (((S)->vis_matrix[(P) * VIS_MATRIX_ROW_SIZE((S)->vertices) \
- + (Q) / 8] & (1 << ((Q) % 8))) != 0)
+ + (Q) / 8] & (1 << ((Q) % 8))) != 0)
#define VERTEX_HAS_EDGES(V) ((V) != CLIST_NEXT(V, entries))
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp
index d3fb235120..e231a213da 100644
--- a/engines/sci/engine/kscripts.cpp
+++ b/engines/sci/engine/kscripts.cpp
@@ -55,7 +55,7 @@ void write_selector(EngineState *s, reg_t object, selector_t selector_id, reg_t
}
int invoke_selector(EngineState *s, reg_t object, int selector_id, int noinvalid, int kfunct,
- stack_ptr_t k_argp, int k_argc, const char *fname, int line, int argc, ...) {
+ stack_ptr_t k_argp, int k_argc, const char *fname, int line, int argc, ...) {
va_list argp;
int i;
int framesize = 2 + 1 * argc;
@@ -224,7 +224,7 @@ reg_t kDisposeClone(EngineState *s, int funct_nr, int argc, reg_t *argv) {
victim_obj->flags |= OBJECT_FLAG_FREED;
- _k_view_list_mark_free(s, victim_addr); // Free on view list, if neccessary
+ _k_view_list_mark_free(s, victim_addr); // Free on view list, if neccessary
return s->r_acc;
}
diff --git a/engines/sci/engine/ksound.cpp b/engines/sci/engine/ksound.cpp
index f103631bbe..2f6f3e8eab 100644
--- a/engines/sci/engine/ksound.cpp
+++ b/engines/sci/engine/ksound.cpp
@@ -363,7 +363,7 @@ kDoSound_SCI0(EngineState *s, int funct_nr, int argc, reg_t *argv) {
int
sfx_send_midi(sfx_state_t *self, song_handle_t handle, int channel,
- int command, int arg1, int arg2);
+ int command, int arg1, int arg2);
reg_t
kDoSound_SCI01(EngineState *s, int funct_nr, int argc, reg_t *argv) {
@@ -472,7 +472,7 @@ kDoSound_SCI01(EngineState *s, int funct_nr, int argc, reg_t *argv) {
int looping = GET_SEL32V(obj, loop);
//int vol = GET_SEL32V(obj, vol);
int pri = GET_SEL32V(obj, pri);
- RESTORE_BEHAVIOR rb = (RESTORE_BEHAVIOR) UKPV(2); /* Too lazy to look up a default value for this */
+ RESTORE_BEHAVIOR rb = (RESTORE_BEHAVIOR) UKPV(2); /* Too lazy to look up a default value for this */
if (obj.segment) {
sfx_song_set_status(&s->sound,
@@ -609,33 +609,33 @@ kDoSound_SCI01(EngineState *s, int funct_nr, int argc, reg_t *argv) {
break; /* Doesn't happen */
}
- /* switch (signal) */
- /* { */
- /* case 0x00: */
- /* if (dataInc!=GET_SEL32V(obj, dataInc)) */
- /* { */
- /* PUT_SEL32V(obj, dataInc, dataInc); */
- /* PUT_SEL32V(obj, signal, dataInc+0x7f); */
- /* } else */
- /* { */
- /* PUT_SEL32V(obj, signal, signal); */
- /* } */
- /* break; */
- /* case 0xFF: /\* May be unnecessary *\/ */
- /* sfx_song_set_status(&s->sound, */
- /* handle, SOUND_STATUS_STOPPED); */
- /* break; */
- /* default : */
- /* if (dataInc!=GET_SEL32V(obj, dataInc)) */
- /* { */
- /* PUT_SEL32V(obj, dataInc, dataInc); */
- /* PUT_SEL32V(obj, signal, dataInc+0x7f); */
- /* } else */
- /* { */
- /* PUT_SEL32V(obj, signal, signal); */
- /* } */
- /* break; */
- /* } */
+ /* switch (signal) */
+ /* { */
+ /* case 0x00: */
+ /* if (dataInc!=GET_SEL32V(obj, dataInc)) */
+ /* { */
+ /* PUT_SEL32V(obj, dataInc, dataInc); */
+ /* PUT_SEL32V(obj, signal, dataInc+0x7f); */
+ /* } else */
+ /* { */
+ /* PUT_SEL32V(obj, signal, signal); */
+ /* } */
+ /* break; */
+ /* case 0xFF: /\* May be unnecessary *\/ */
+ /* sfx_song_set_status(&s->sound, */
+ /* handle, SOUND_STATUS_STOPPED); */
+ /* break; */
+ /* default : */
+ /* if (dataInc!=GET_SEL32V(obj, dataInc)) */
+ /* { */
+ /* PUT_SEL32V(obj, dataInc, dataInc); */
+ /* PUT_SEL32V(obj, signal, dataInc+0x7f); */
+ /* } else */
+ /* { */
+ /* PUT_SEL32V(obj, signal, signal); */
+ /* } */
+ /* break; */
+ /* } */
PUT_SEL32V(obj, min, min);
PUT_SEL32V(obj, sec, sec);
@@ -668,7 +668,7 @@ kDoSound_SCI01(EngineState *s, int funct_nr, int argc, reg_t *argv) {
int
sfx_send_midi(sfx_state_t *self, song_handle_t handle, int channel,
- int command, int arg1, int arg2);
+ int command, int arg1, int arg2);
reg_t
kDoSound_SCI1(EngineState *s, int funct_nr, int argc, reg_t *argv) {
@@ -772,7 +772,7 @@ kDoSound_SCI1(EngineState *s, int funct_nr, int argc, reg_t *argv) {
s->acc = s->sound_server->command(s, SOUND_COMMAND_SET_VOLUME, 0, vol);
else
s->acc = s->sound_server->command(s, SOUND_COMMAND_GET_VOLUME, 0, 0);
- break;*/
+ break;*/
}
case _K_SCI1_SOUND_MUTE_SOUND : {
/* if there's a parameter, we're setting it. Otherwise,
diff --git a/engines/sci/engine/said.cpp b/engines/sci/engine/said.cpp
index 1e47ad3966..15110bd44c 100644
--- a/engines/sci/engine/said.cpp
+++ b/engines/sci/engine/said.cpp
@@ -899,7 +899,7 @@ yy_reduce_print (yyvsp, yyrule)
fprintf (stderr, " $%d = ", yyi + 1);
yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
&(yyvsp[(yyi + 1) - (yynrhs)])
- );
+ );
fprintf (stderr, "\n");
}
}
@@ -1237,7 +1237,7 @@ yyparse ()
#endif
#endif
{
-
+
int yystate;
int yyn;
int yyresult;
@@ -1939,7 +1939,7 @@ static tree_t said_paren(tree_t t1, tree_t t2) {
static tree_t said_value(int val, tree_t t) {
return said_branch_node(SAID_NEXT_NODE, said_leaf_node(SAID_NEXT_NODE, val), t);
-
+
}
static tree_t said_terminal(int val) {
@@ -2138,7 +2138,7 @@ static void aug_find_words_recursively(parse_tree_node_t *tree, int startpos, in
while (pos) {
if ((word = aug_get_wgroup(tree, pos))) { // found a word
- if (!refbranch && major == WORD_TYPE_BASE) {
+ if (!refbranch && major == WORD_TYPE_BASE) {
if ((*base_words_nr) == maxwords) {
sciprintf("Out of regular words\n");
return; // return gracefully
@@ -2160,9 +2160,9 @@ static void aug_find_words_recursively(parse_tree_node_t *tree, int startpos, in
}
if (major != WORD_TYPE_SYNTACTIC_SUGAR && major != WORD_TYPE_BASE && major != WORD_TYPE_REF)
sciprintf("aug_find_words_recursively(): Unknown word type %03x\n", major);
-
+
} else // Did NOT find a word group: Attempt to recurse
- aug_find_words_recursively(tree, pos, base_words, base_words_nr,
+ aug_find_words_recursively(tree, pos, base_words, base_words_nr,
ref_words, ref_words_nr, maxwords, refbranch || major == WORD_TYPE_REF);
pos = aug_get_next_sibling(tree, pos, &major, &minor);
@@ -2404,7 +2404,7 @@ static int augment_parse_nodes(parse_tree_node_t *parset, parse_tree_node_t *sai
sciprintf("augment_parse_nodes(): Parse tree is corrupt\n");
return 0;
}
-
+
augment_basepos = aug_get_base_node(saidt);
if (!augment_basepos) {
sciprintf("augment_parse_nodes(): Said tree is corrupt\n");
diff --git a/engines/sci/engine/said.y b/engines/sci/engine/said.y
index 0663387f24..8ecb0a20c8 100644
--- a/engines/sci/engine/said.y
+++ b/engines/sci/engine/said.y
@@ -118,8 +118,8 @@ static int yyerror(const char *s) {
%%
-saidspec : leftspec optcont
- { $$ = said_top_branch(said_attach_branch($1, $2)); }
+saidspec : leftspec optcont
+ { $$ = said_top_branch(said_attach_branch($1, $2)); }
| leftspec midspec optcont
{ $$ = said_top_branch(said_attach_branch($1, said_attach_branch($2, $3))); }
| leftspec midspec rightspec optcont
@@ -180,7 +180,7 @@ wordset : word
{ $$ = $1; }
| wordset YY_COMMA wordset
{ $$ = said_attach_branch($1, $3); }
- | wordset YY_BRACKETSO_LT wordrefset YY_BRACKETSC
+ | wordset YY_BRACKETSO_LT wordrefset YY_BRACKETSC
{ $$ = said_attach_branch($1, $3); }
| wordset YY_COMMA YY_BRACKETSO wordset YY_BRACKETSC
{ $$ = said_attach_branch($1, $3); }
@@ -295,7 +295,7 @@ static tree_t said_paren(tree_t t1, tree_t t2) {
static tree_t said_value(int val, tree_t t) {
return said_branch_node(SAID_NEXT_NODE, said_leaf_node(SAID_NEXT_NODE, val), t);
-
+
}
static tree_t said_terminal(int val) {
@@ -494,7 +494,7 @@ static void aug_find_words_recursively(parse_tree_node_t *tree, int startpos, in
while (pos) {
if ((word = aug_get_wgroup(tree, pos))) { // found a word
- if (!refbranch && major == WORD_TYPE_BASE) {
+ if (!refbranch && major == WORD_TYPE_BASE) {
if ((*base_words_nr) == maxwords) {
sciprintf("Out of regular words\n");
return; // return gracefully
@@ -516,9 +516,9 @@ static void aug_find_words_recursively(parse_tree_node_t *tree, int startpos, in
}
if (major != WORD_TYPE_SYNTACTIC_SUGAR && major != WORD_TYPE_BASE && major != WORD_TYPE_REF)
sciprintf("aug_find_words_recursively(): Unknown word type %03x\n", major);
-
+
} else // Did NOT find a word group: Attempt to recurse
- aug_find_words_recursively(tree, pos, base_words, base_words_nr,
+ aug_find_words_recursively(tree, pos, base_words, base_words_nr,
ref_words, ref_words_nr, maxwords, refbranch || major == WORD_TYPE_REF);
pos = aug_get_next_sibling(tree, pos, &major, &minor);
@@ -760,7 +760,7 @@ static int augment_parse_nodes(parse_tree_node_t *parset, parse_tree_node_t *sai
sciprintf("augment_parse_nodes(): Parse tree is corrupt\n");
return 0;
}
-
+
augment_basepos = aug_get_base_node(saidt);
if (!augment_basepos) {
sciprintf("augment_parse_nodes(): Said tree is corrupt\n");
diff --git a/engines/sci/engine/savegame.cfsml b/engines/sci/engine/savegame.cfsml
index e61925329d..b4b043ae6b 100644
--- a/engines/sci/engine/savegame.cfsml
+++ b/engines/sci/engine/savegame.cfsml
@@ -251,7 +251,7 @@ RECORD song_t "song_t" {
int loops;
int hold;
}
-
+
RECORD int_hash_map_t "int_hash_map_t" {
int base_value;
int_hash_map_node_tp nodes[STATIC DCS_INT_HASH_MAX+1];
@@ -481,7 +481,7 @@ int read_songlib_t(Common::SeekableReadStream *fh, songlib_t *songlib, const cha
for (i = 0; i < songcount; i++) {
%CFSMLREAD song_tp &newsong FROM fh ERRVAR *hiteof FIRSTTOKEN lastval LINECOUNTER *line;
song_lib_add(*songlib, newsong);
- }
+ }
l = fh->readLine(); // "]"
l = fh->readLine(); // "}"
*line += 2;
@@ -567,7 +567,7 @@ int read_int_hash_map_node_tp(Common::SeekableReadStream *fh, int_hash_map_t::no
sciprintf("Expected opening bracket in hash_map_node_t on line %d\n", *line);
return 1;
}
-
+
do {
(*line)++;
SRSgets(buffer, 80, fh);
@@ -612,7 +612,7 @@ int read_menubar_tp(Common::SeekableReadStream *fh, menubar_t **foo, const char
}
void write_mem_obj_t(Common::WriteStream *fh, mem_obj_t *foo) {
- WSprintf(fh, "%s\n", mem_obj_string_names[foo->type].name);
+ WSprintf(fh, "%s\n", mem_obj_string_names[foo->type].name);
%CFSMLWRITE int &foo->segmgr_id INTO fh;
switch (foo->type) {
case MEM_OBJ_SCRIPT:
@@ -632,10 +632,10 @@ void write_mem_obj_t(Common::WriteStream *fh, mem_obj_t *foo) {
break;
case MEM_OBJ_HUNK:
break;
- case MEM_OBJ_LISTS:
+ case MEM_OBJ_LISTS:
%CFSMLWRITE list_table_t &foo->data.lists INTO fh;
break;
- case MEM_OBJ_NODES:
+ case MEM_OBJ_NODES:
%CFSMLWRITE node_table_t &foo->data.nodes INTO fh;
break;
case MEM_OBJ_DYNMEM:
@@ -857,7 +857,7 @@ static void reconstruct_scripts(EngineState *s, SegManager *self) {
if (!self->isSci1_1)
scr->export_table += 3;
-
+
for (j = 0; j < scr->objects_nr; j++) {
byte *data = scr->buf + scr->objects[j].pos.offset;
scr->objects[j].base = scr->buf;
@@ -926,7 +926,7 @@ void reconstruct_clones(EngineState *s, SegManager *self) {
case MEM_OBJ_CLONES: {
int j;
clone_entry_t *seeker = mobj->data.clones.table;
-
+
sciprintf("Free list: ");
for (j = mobj->data.clones.first_free; j != HEAPENTRY_INVALID; j = mobj->data.clones.table[j].next_free) {
sciprintf("%d ", j);
@@ -941,7 +941,7 @@ void reconstruct_clones(EngineState *s, SegManager *self) {
sciprintf("\n");
for (j = 0; j < mobj->data.clones.max_entry; j++) {
- object_t *base_obj;
+ object_t *base_obj;
if (!clone_entry_used(&mobj->data.clones, j)) {
seeker++;
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index 76ef6f7710..881c13faf8 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -326,7 +326,7 @@ static char *_cfsml_unmangle_string(const char *s, unsigned int length) {
while ((source != end) && (c = *source++) && (c > 31)) {
if (c == '\\') { // Escaped character?
- c = *source++;
+ c = *source++;
if ((c != '\\') && (c != '"')) // Un-escape 0-31 only
c -= ('a' - 1);
}
@@ -606,7 +606,7 @@ _cfsml_read_sfx_state_t(Common::SeekableReadStream *fh, sfx_state_t* save_struc,
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -674,7 +674,7 @@ _cfsml_read_clone_entry_t(Common::SeekableReadStream *fh, clone_entry_t* save_st
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -771,7 +771,7 @@ _cfsml_read_object_t(Common::SeekableReadStream *fh, object_t* save_struc, const
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -860,10 +860,10 @@ _cfsml_read_object_t(Common::SeekableReadStream *fh, object_t* save_struc, const
_cfsml_error("Token expected by read_reg_t() for variables[i++] at line %d\n", *line);
return CFSML_FAILURE;
}
- } else
+ } else
done = 1;
} while (!done);
- save_struc->variables_nr = max ; // Set array size accordingly
+ save_struc->variables_nr = max ; // Set array size accordingly
} else
#line 699 "engines/sci/engine/savegame.cfsml"
{
@@ -962,7 +962,7 @@ _cfsml_read_menubar_t(Common::SeekableReadStream *fh, menubar_t* save_struc, con
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -1016,10 +1016,10 @@ _cfsml_read_menubar_t(Common::SeekableReadStream *fh, menubar_t* save_struc, con
_cfsml_error("Token expected by _cfsml_read_menu_t() for menus[i++] at line %d\n", *line);
return CFSML_FAILURE;
}
- } else
+ } else
done = 1;
} while (!done);
- save_struc->menus_nr = max ; // Set array size accordingly
+ save_struc->menus_nr = max ; // Set array size accordingly
} else
#line 699 "engines/sci/engine/savegame.cfsml"
{
@@ -1094,7 +1094,7 @@ _cfsml_read_list_entry_t(Common::SeekableReadStream *fh, list_entry_t* save_stru
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -1177,7 +1177,7 @@ _cfsml_read_int_hash_map_t(Common::SeekableReadStream *fh, int_hash_map_t* save_
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -1224,7 +1224,7 @@ _cfsml_read_int_hash_map_t(Common::SeekableReadStream *fh, int_hash_map_t* save_
_cfsml_error("Token expected by read_int_hash_map_node_tp() for nodes[i++] at line %d\n", *line);
return CFSML_FAILURE;
}
- } else
+ } else
done = 1;
} while (!done);
} else
@@ -1312,7 +1312,7 @@ _cfsml_read_SegManager(Common::SeekableReadStream *fh, SegManager* save_struc, c
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -1373,10 +1373,10 @@ _cfsml_read_SegManager(Common::SeekableReadStream *fh, SegManager* save_struc, c
_cfsml_error("Token expected by read_mem_obj_tp() for heap[i++] at line %d\n", *line);
return CFSML_FAILURE;
}
- } else
+ } else
done = 1;
} while (!done);
- save_struc->heap_size = max ; // Set array size accordingly
+ save_struc->heap_size = max ; // Set array size accordingly
} else
if (!strcmp(token, "heap_size")) {
#line 690 "engines/sci/engine/savegame.cfsml"
@@ -1506,7 +1506,7 @@ _cfsml_read_song_t(Common::SeekableReadStream *fh, song_t* save_struc, const cha
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -1661,7 +1661,7 @@ _cfsml_read_menu_item_t(Common::SeekableReadStream *fh, menu_item_t* save_struc,
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -1729,7 +1729,7 @@ _cfsml_read_menu_item_t(Common::SeekableReadStream *fh, menu_item_t* save_struc,
_cfsml_error("Token expected by _cfsml_read_byte() for said[i++] at line %d\n", *line);
return CFSML_FAILURE;
}
- } else
+ } else
done = 1;
} while (!done);
} else
@@ -1829,7 +1829,7 @@ _cfsml_read_node_entry_t(Common::SeekableReadStream *fh, node_entry_t* save_stru
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -1943,7 +1943,7 @@ _cfsml_read_dynmem_t(Common::SeekableReadStream *fh, dynmem_t* save_struc, const
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -2011,10 +2011,10 @@ _cfsml_read_dynmem_t(Common::SeekableReadStream *fh, dynmem_t* save_struc, const
_cfsml_error("Token expected by _cfsml_read_byte() for buf[i++] at line %d\n", *line);
return CFSML_FAILURE;
}
- } else
+ } else
done = 1;
} while (!done);
- save_struc->size = max ; // Set array size accordingly
+ save_struc->size = max ; // Set array size accordingly
} else
#line 699 "engines/sci/engine/savegame.cfsml"
{
@@ -2076,7 +2076,7 @@ _cfsml_read_local_variables_t(Common::SeekableReadStream *fh, local_variables_t*
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -2144,10 +2144,10 @@ _cfsml_read_local_variables_t(Common::SeekableReadStream *fh, local_variables_t*
_cfsml_error("Token expected by read_reg_t() for locals[i++] at line %d\n", *line);
return CFSML_FAILURE;
}
- } else
+ } else
done = 1;
} while (!done);
- save_struc->nr = max ; // Set array size accordingly
+ save_struc->nr = max ; // Set array size accordingly
} else
#line 699 "engines/sci/engine/savegame.cfsml"
{
@@ -2215,7 +2215,7 @@ _cfsml_read_node_table_t(Common::SeekableReadStream *fh, node_table_t* save_stru
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -2297,10 +2297,10 @@ _cfsml_read_node_table_t(Common::SeekableReadStream *fh, node_table_t* save_stru
_cfsml_error("Token expected by _cfsml_read_node_entry_t() for table[i++] at line %d\n", *line);
return CFSML_FAILURE;
}
- } else
+ } else
done = 1;
} while (!done);
- save_struc->entries_nr = max ; // Set array size accordingly
+ save_struc->entries_nr = max ; // Set array size accordingly
} else
#line 699 "engines/sci/engine/savegame.cfsml"
{
@@ -2354,7 +2354,7 @@ _cfsml_read_sys_strings_t(Common::SeekableReadStream *fh, sys_strings_t* save_st
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -2394,7 +2394,7 @@ _cfsml_read_sys_strings_t(Common::SeekableReadStream *fh, sys_strings_t* save_st
_cfsml_error("Token expected by _cfsml_read_sys_string_t() for strings[i++] at line %d\n", *line);
return CFSML_FAILURE;
}
- } else
+ } else
done = 1;
} while (!done);
} else
@@ -2477,7 +2477,7 @@ _cfsml_read_node_t(Common::SeekableReadStream *fh, node_t* save_struc, const cha
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -2585,7 +2585,7 @@ _cfsml_read_list_table_t(Common::SeekableReadStream *fh, list_table_t* save_stru
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -2667,10 +2667,10 @@ _cfsml_read_list_table_t(Common::SeekableReadStream *fh, list_table_t* save_stru
_cfsml_error("Token expected by _cfsml_read_list_entry_t() for table[i++] at line %d\n", *line);
return CFSML_FAILURE;
}
- } else
+ } else
done = 1;
} while (!done);
- save_struc->entries_nr = max ; // Set array size accordingly
+ save_struc->entries_nr = max ; // Set array size accordingly
} else
#line 699 "engines/sci/engine/savegame.cfsml"
{
@@ -2719,7 +2719,7 @@ _cfsml_read_class_t(Common::SeekableReadStream *fh, class_t* save_struc, const c
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -2880,7 +2880,7 @@ _cfsml_read_EngineState(Common::SeekableReadStream *fh, EngineState* save_struc,
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -2990,10 +2990,10 @@ _cfsml_read_EngineState(Common::SeekableReadStream *fh, EngineState* save_struc,
_cfsml_error("Token expected by _cfsml_read_class_t() for classtable[i++] at line %d\n", *line);
return CFSML_FAILURE;
}
- } else
+ } else
done = 1;
} while (!done);
- save_struc->classtable_size = max ; // Set array size accordingly
+ save_struc->classtable_size = max ; // Set array size accordingly
} else
if (!strcmp(token, "sound")) {
#line 690 "engines/sci/engine/savegame.cfsml"
@@ -3061,7 +3061,7 @@ _cfsml_read_SavegameMetadata(Common::SeekableReadStream *fh, SavegameMetadata* s
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -3180,7 +3180,7 @@ _cfsml_read_menu_t(Common::SeekableReadStream *fh, menu_t* save_struc, const cha
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -3255,10 +3255,10 @@ _cfsml_read_menu_t(Common::SeekableReadStream *fh, menu_t* save_struc, const cha
_cfsml_error("Token expected by _cfsml_read_menu_item_t() for items[i++] at line %d\n", *line);
return CFSML_FAILURE;
}
- } else
+ } else
done = 1;
} while (!done);
- save_struc->items_nr = max ; // Set array size accordingly
+ save_struc->items_nr = max ; // Set array size accordingly
} else
#line 699 "engines/sci/engine/savegame.cfsml"
{
@@ -3326,7 +3326,7 @@ _cfsml_read_clone_table_t(Common::SeekableReadStream *fh, clone_table_t* save_st
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -3408,10 +3408,10 @@ _cfsml_read_clone_table_t(Common::SeekableReadStream *fh, clone_table_t* save_st
_cfsml_error("Token expected by _cfsml_read_clone_entry_t() for table[i++] at line %d\n", *line);
return CFSML_FAILURE;
}
- } else
+ } else
done = 1;
} while (!done);
- save_struc->entries_nr = max ; // Set array size accordingly
+ save_struc->entries_nr = max ; // Set array size accordingly
} else
#line 699 "engines/sci/engine/savegame.cfsml"
{
@@ -3482,7 +3482,7 @@ _cfsml_read_clone_t(Common::SeekableReadStream *fh, clone_t* save_struc, const c
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -3571,10 +3571,10 @@ _cfsml_read_clone_t(Common::SeekableReadStream *fh, clone_t* save_struc, const c
_cfsml_error("Token expected by read_reg_t() for variables[i++] at line %d\n", *line);
return CFSML_FAILURE;
}
- } else
+ } else
done = 1;
} while (!done);
- save_struc->variables_nr = max ; // Set array size accordingly
+ save_struc->variables_nr = max ; // Set array size accordingly
} else
#line 699 "engines/sci/engine/savegame.cfsml"
{
@@ -3623,7 +3623,7 @@ _cfsml_read_list_t(Common::SeekableReadStream *fh, list_t* save_struc, const cha
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -3701,7 +3701,7 @@ _cfsml_read_sys_string_t(Common::SeekableReadStream *fh, sys_string_t* save_stru
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -3829,7 +3829,7 @@ _cfsml_read_script_t(Common::SeekableReadStream *fh, script_t* save_struc, const
return CFSML_FAILURE;
}
if (!assignment) {
- if (!strcmp(token, "}"))
+ if (!strcmp(token, "}"))
closed = 1;
else {
_cfsml_error("Expected assignment or closing braces in line %d\n", *line);
@@ -3953,10 +3953,10 @@ _cfsml_read_script_t(Common::SeekableReadStream *fh, script_t* save_struc, const
_cfsml_error("Token expected by _cfsml_read_object_t() for objects[i++] at line %d\n", *line);
return CFSML_FAILURE;
}
- } else
+ } else
done = 1;
} while (!done);
- save_struc->objects_allocated = max ; // Set array size accordingly
+ save_struc->objects_allocated = max ; // Set array size accordingly
} else
if (!strcmp(token, "locals_offset")) {
#line 690 "engines/sci/engine/savegame.cfsml"
@@ -3991,7 +3991,7 @@ _cfsml_read_script_t(Common::SeekableReadStream *fh, script_t* save_struc, const
// Auto-generated CFSML declaration and function block ends here
-// Auto-generation performed by cfsml.pl 0.8.2
+// Auto-generation performed by cfsml.pl 0.8.2
#line 447 "engines/sci/engine/savegame.cfsml"
void write_songlib_t(Common::WriteStream *fh, songlib_t *songlib) {
@@ -4057,7 +4057,7 @@ int read_songlib_t(Common::SeekableReadStream *fh, songlib_t *songlib, const cha
// End of auto-generated CFSML data reader code
#line 483 "engines/sci/engine/savegame.cfsml"
song_lib_add(*songlib, newsong);
- }
+ }
l = fh->readLine(); // "]"
l = fh->readLine(); // "}"
*line += 2;
@@ -4202,7 +4202,7 @@ int read_int_hash_map_node_tp(Common::SeekableReadStream *fh, int_hash_map_t::no
sciprintf("Expected opening bracket in hash_map_node_t on line %d\n", *line);
return 1;
}
-
+
do {
(*line)++;
SRSgets(buffer, 80, fh);
@@ -4274,7 +4274,7 @@ int read_menubar_tp(Common::SeekableReadStream *fh, menubar_t **foo, const char
}
void write_mem_obj_t(Common::WriteStream *fh, mem_obj_t *foo) {
- WSprintf(fh, "%s\n", mem_obj_string_names[foo->type].name);
+ WSprintf(fh, "%s\n", mem_obj_string_names[foo->type].name);
#line 814 "engines/sci/engine/savegame.cfsml"
// Auto-generated CFSML data writer code
_cfsml_write_int(fh, &foo->segmgr_id);
@@ -4324,7 +4324,7 @@ void write_mem_obj_t(Common::WriteStream *fh, mem_obj_t *foo) {
break;
case MEM_OBJ_HUNK:
break;
- case MEM_OBJ_LISTS:
+ case MEM_OBJ_LISTS:
#line 814 "engines/sci/engine/savegame.cfsml"
// Auto-generated CFSML data writer code
_cfsml_write_list_table_t(fh, &foo->data.lists);
@@ -4332,7 +4332,7 @@ void write_mem_obj_t(Common::WriteStream *fh, mem_obj_t *foo) {
// End of auto-generated CFSML data writer code
#line 637 "engines/sci/engine/savegame.cfsml"
break;
- case MEM_OBJ_NODES:
+ case MEM_OBJ_NODES:
#line 814 "engines/sci/engine/savegame.cfsml"
// Auto-generated CFSML data writer code
_cfsml_write_node_table_t(fh, &foo->data.nodes);
@@ -4808,7 +4808,7 @@ static void reconstruct_scripts(EngineState *s, SegManager *self) {
if (!self->isSci1_1)
scr->export_table += 3;
-
+
for (j = 0; j < scr->objects_nr; j++) {
byte *data = scr->buf + scr->objects[j].pos.offset;
scr->objects[j].base = scr->buf;
@@ -4877,7 +4877,7 @@ void reconstruct_clones(EngineState *s, SegManager *self) {
case MEM_OBJ_CLONES: {
int j;
clone_entry_t *seeker = mobj->data.clones.table;
-
+
sciprintf("Free list: ");
for (j = mobj->data.clones.first_free; j != HEAPENTRY_INVALID; j = mobj->data.clones.table[j].next_free) {
sciprintf("%d ", j);
@@ -4892,7 +4892,7 @@ void reconstruct_clones(EngineState *s, SegManager *self) {
sciprintf("\n");
for (j = 0; j < mobj->data.clones.max_entry; j++) {
- object_t *base_obj;
+ object_t *base_obj;
if (!clone_entry_used(&mobj->data.clones, j)) {
seeker++;
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index b5b8da4c0b..abaae46879 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -78,7 +78,7 @@ char inputbuf[256] = "";
#define LOOKUP_SPECIES(species) (\
(species >= 1000) ? species : *(s->classtable[species].scriptposp) \
- + s->classtable[species].class_offset)
+ + s->classtable[species].class_offset)
const char *_debug_get_input_default() {
char newinpbuf[256];
@@ -2784,9 +2784,9 @@ int c_sci_version(EngineState *s) {
}
// int c_sleep(EngineState *s) {
-// sleep(cmd_params[0].val);
-//
-// return 0;
+// sleep(cmd_params[0].val);
+//
+// return 0;
// }
static void _print_address(void * _, reg_t addr) {
@@ -2860,7 +2860,7 @@ static int c_gc_list_reachable(EngineState *s) {
}
void script_debug(EngineState *s, reg_t *pc, stack_ptr_t *sp, stack_ptr_t *pp, reg_t *objp, int *restadjust,
- seg_id_t *segids, reg_t **variables, reg_t **variables_base, int *variables_nr, int bp) {
+ seg_id_t *segids, reg_t **variables, reg_t **variables_base, int *variables_nr, int bp) {
// Do we support a separate console?
if (sci_debug_flags & _DEBUG_FLAG_LOGGING) {
@@ -2936,7 +2936,7 @@ void script_debug(EngineState *s, reg_t *pc, stack_ptr_t *sp, stack_ptr_t *pp, r
}
- _debug_seeking = _DEBUG_SEEK_NOTHING;
+ _debug_seeking = _DEBUG_SEEK_NOTHING;
// OK, found whatever we were looking for
}
}
@@ -3166,8 +3166,8 @@ void script_debug(EngineState *s, reg_t *pc, stack_ptr_t *sp, stack_ptr_t *pp, r
" sfx-01-track <song> <offset>\n\n"
"SEE ALSO\n\n"
" sfx-01-header.1\n\n");
-// con_hook_command(c_sleep, "sleep", "i", "Suspends everything for the\n"
-// " specified number of seconds");
+// con_hook_command(c_sleep, "sleep", "i", "Suspends everything for the\n"
+// " specified number of seconds");
con_hook_command(c_gc_show_reachable, "gc-list-reachable", "!a",
"Prints all addresses directly reachable from\n"
" the memory object specified as parameter.\n\n"
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index ebdfc61b28..7713ab6dd4 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -37,7 +37,7 @@ namespace Sci {
#undef DEBUG_SEG_MANAGER // Define to turn on debugging
-#define GET_SEGID() \
+#define GET_SEGID() \
if (flag == SCRIPT_ID) \
id = segGet(id); \
VERIFY(check(id), "invalid seg id");
@@ -383,10 +383,10 @@ mem_obj_t *SegManager::memObjAllocate(seg_id_t segid, int hash_id, memObjType ty
/* No longer in use?
void SegManager::sm_object_init(object_t *object) {
- if (!object)
+ if (!object)
return;
- object->variables_nr = 0;
- object->variables = NULL;
+ object->variables_nr = 0;
+ object->variables = NULL;
};*/
void SegManager::freeScript(mem_obj_t *mem) {
@@ -634,7 +634,7 @@ int SegManager::sm_hash_segment_data(int id) {
return 0;
if (heap[id]->type == MEM_OBJ_NODES)
return 0;
- if (heap[id]->type == MEM_OBJ_CLONES)
+ if (heap[id]->type == MEM_OBJ_CLONES)
return 0;
buf = (char *)dereference(make_reg(id, 0), &len);
diff --git a/engines/sci/engine/seg_manager.h b/engines/sci/engine/seg_manager.h
index 1671619368..31bad21398 100644
--- a/engines/sci/engine/seg_manager.h
+++ b/engines/sci/engine/seg_manager.h
@@ -158,11 +158,11 @@ public:
int getSynonymsNr(int id, idFlag flag);
- // 1b. Script Initialisation
+ // 1b. Script Initialisation
- // The set of functions below are intended
- // to be used during script instantiation,
- // i.e. loading and linking.
+ // The set of functions below are intended
+ // to be used during script instantiation,
+ // i.e. loading and linking.
// Initializes a script's local variable block
// Parameters: (seg_id_t) seg: Segment containing the script to initialize
@@ -187,7 +187,7 @@ public:
void scriptAddCodeBlock(reg_t location);
// Tells the segment manager whether exports are wide (32-bit) or not.
- // Parameters: (int) flag: 1 if exports are wide, 0 otherwise
+ // Parameters: (int) flag: 1 if exports are wide, 0 otherwise
void setExportWidth(int flag);
// Processes a relocation block witin a script
@@ -249,7 +249,7 @@ public:
int scriptIsMarkedAsDeleted(seg_id_t seg);
- // 2. Clones
+ // 2. Clones
// Allocate a fresh clone
// Returns : (clone_t*): Reference to the memory allocated for the clone
@@ -261,9 +261,9 @@ public:
void free_clone(reg_t addr);
- // 3. Objects (static, from Scripts, and dynmic, from Clones)
+ // 3. Objects (static, from Scripts, and dynmic, from Clones)
- // Not all of these functions are fully operational for clones ATM
+ // Not all of these functions are fully operational for clones ATM
// Retrieves a 16 bit value from within a script's heap representation
// Parameters: (reg_t) reg: The address to read from
@@ -287,7 +287,7 @@ public:
void mcpyInOut(int dst, const void *src, size_t n, int id, int flag);
- // 4. Stack
+ // 4. Stack
// Allocates a data stack
// Parameters: (int) size: Number of stack entries to reserve
@@ -296,7 +296,7 @@ public:
dstack_t *allocateStack(int size, seg_id_t *segid);
- // 5. System Strings
+ // 5. System Strings
// Allocates a system string table
// Returns : (dstack_t *): The physical stack
@@ -305,7 +305,7 @@ public:
sys_strings_t *allocateSysStrings(seg_id_t *segid);
- // 6, 7. Lists and Nodes
+ // 6, 7. Lists and Nodes
// Allocate a fresh list
// Returns : (listY_t*): Reference to the memory allocated for the list
@@ -362,7 +362,7 @@ public:
const char *getDescription(reg_t addr);
- // 10. Reserved segments
+ // 10. Reserved segments
// Reserves a special-purpose segment
// Parameters: (char *) name: A string name identifying the segment (the string is cloned and retained)
@@ -372,7 +372,7 @@ public:
//seg_id_t sm_allocate_reserved_segment(char *name);
- // Generic Operations on Segments and Addresses
+ // Generic Operations on Segments and Addresses
// Dereferences a raw memory pointer
// Parameters: (reg_t) reg: The reference to dereference
@@ -449,7 +449,7 @@ private:
};
-// 11. Segment interface, primarily for GC
+// 11. Segment interface, primarily for GC
class SegInterface {
protected:
@@ -464,7 +464,7 @@ public:
// For each valid address a, there exists a canonic address c(a) such that c(a) = c(c(a)).
// This address "governs" a in the sense that deallocating c(a) will deallocate a.
virtual reg_t findCanonicAddress(reg_t sub_addr);
-
+
// Deallocates all memory associated with the specified address
// Parameters: (reg_t) sub_addr: The address (within the given segment) to deallocate
virtual void freeAtAddress(reg_t sub_addr);
@@ -474,7 +474,7 @@ public:
// makes sense
// (void *) param: Parameter passed to 'note'
virtual void listAllDeallocatable(void *param, void (*note)(void *param, reg_t addr));
-
+
// Iterates over all references reachable from the specified object
// Parameters: (reg_t) object: The object (within the current segment) to analyse
// (void *) param: Parameter passed to 'note'
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index ef57b73214..29ac898abb 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -292,7 +292,7 @@ inline exec_stack_t *execute_method(EngineState *s, uint16 script, uint16 pubfun
}
-static void _exec_varselectors(EngineState *s) {
+static void _exec_varselectors(EngineState *s) {
// Executes all varselector read/write ops on the TOS
// Now check the TOS to execute all varselector entries
if (s->execution_stack_pos >= 0)
@@ -461,7 +461,7 @@ exec_stack_t *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj, stac
// placed on the TOS; as soon as it returns, it will cause the second call to be executed.
for (; send_calls_nr >= 0; send_calls_nr--)
if (send_calls[send_calls_nr].type == EXEC_STACK_TYPE_VARSELECTOR) // Write/read variable?
- retval = add_exec_stack_varselector(s, work_obj, send_calls[send_calls_nr].argc, send_calls[send_calls_nr].argp,
+ retval = add_exec_stack_varselector(s, work_obj, send_calls[send_calls_nr].argc, send_calls[send_calls_nr].argp,
send_calls[send_calls_nr].selector, send_calls[send_calls_nr].address.var, origin);
else
retval = add_exec_stack_entry(s, send_calls[send_calls_nr].address.func, send_calls[send_calls_nr].sp, work_obj,
@@ -600,7 +600,7 @@ void run_vm(EngineState *s, int restoring) {
object_t *obj = obj_get(s, xs->objp);
script_t *local_script = script_locate_by_segment(s, xs->local_segment);
int old_execution_stack_base = s->execution_stack_base;
- // Used to detect the stack bottom, for "physical" returns
+ // Used to detect the stack bottom, for "physical" returns
byte *code_buf = NULL; // (Avoid spurious warning)
if (!local_script) {
@@ -886,7 +886,7 @@ void run_vm(EngineState *s, int restoring) {
case 0x0c: // not
s->r_acc = make_reg(0, !(s->r_acc.offset || s->r_acc.segment));
- // Must allow pointers to be negated, as this is used for checking whether objects exist
+ // Must allow pointers to be negated, as this is used for checking whether objects exist
break;
case 0x0d: // eq?
@@ -913,76 +913,76 @@ void run_vm(EngineState *s, int restoring) {
s->r_acc = ACC_ARITHMETIC_L((int16)POP() >= (int16)/*acc*/);
break;
- case 0x11: // lt?
+ case 0x11: // lt?
s->r_prev = s->r_acc;
s->r_acc = ACC_ARITHMETIC_L((int16)POP() < (int16)/*acc*/);
break;
- case 0x12: // le?
+ case 0x12: // le?
s->r_prev = s->r_acc;
s->r_acc = ACC_ARITHMETIC_L((int16)POP() <= (int16)/*acc*/);
break;
- case 0x13: // ugt?
+ case 0x13: // ugt?
s->r_prev = s->r_acc;
r_temp = POP32();
s->r_acc = make_reg(0, (r_temp.segment == s->r_acc.segment) && r_temp.offset > s->r_acc.offset);
break;
- case 0x14: // uge?
+ case 0x14: // uge?
s->r_prev = s->r_acc;
r_temp = POP32();
s->r_acc = make_reg(0, (r_temp.segment == s->r_acc.segment) && r_temp.offset >= s->r_acc.offset);
break;
- case 0x15: // ult?
+ case 0x15: // ult?
s->r_prev = s->r_acc;
r_temp = POP32();
s->r_acc = make_reg(0, (r_temp.segment == s->r_acc.segment) && r_temp.offset < s->r_acc.offset);
break;
- case 0x16: // ule?
+ case 0x16: // ule?
s->r_prev = s->r_acc;
r_temp = POP32();
s->r_acc = make_reg(0, (r_temp.segment == s->r_acc.segment) && r_temp.offset <= s->r_acc.offset);
break;
- case 0x17: // bt
+ case 0x17: // bt
if (s->r_acc.offset || s->r_acc.segment)
xs->addr.pc.offset += opparams[0];
break;
- case 0x18: // bnt
+ case 0x18: // bnt
if (!(s->r_acc.offset || s->r_acc.segment))
xs->addr.pc.offset += opparams[0];
break;
- case 0x19: // jmp
+ case 0x19: // jmp
xs->addr.pc.offset += opparams[0];
break;
- case 0x1a: // ldi
+ case 0x1a: // ldi
s->r_acc = make_reg(0, opparams[0]);
break;
- case 0x1b: // push
+ case 0x1b: // push
PUSH32(s->r_acc);
break;
- case 0x1c: // pushi
+ case 0x1c: // pushi
PUSH(opparams[0]);
break;
- case 0x1d: // toss
+ case 0x1d: // toss
xs->sp--;
break;
- case 0x1e: // dup
+ case 0x1e: // dup
r_temp = xs->sp[-1];
PUSH32(r_temp);
break;
- case 0x1f: { // link
+ case 0x1f: { // link
int i;
for (i = 0; i < opparams[0]; i++)
xs->sp[i] = NULL_REG;
@@ -990,8 +990,8 @@ void run_vm(EngineState *s, int restoring) {
break;
}
- case 0x20: { // call
- int argc = (opparams[1] >> 1) // Given as offset, but we need count
+ case 0x20: { // call
+ int argc = (opparams[1] >> 1) // Given as offset, but we need count
+ 1 + restadjust;
stack_ptr_t call_base = xs->sp - argc;
@@ -999,20 +999,20 @@ void run_vm(EngineState *s, int restoring) {
xs_new = add_exec_stack_entry(s, make_reg(xs->addr.pc.segment, xs->addr.pc.offset + opparams[0]),
xs->sp, xs->objp, (validate_arithmetic(*call_base)) + restadjust,
call_base, NULL_SELECTOR, xs->objp, s->execution_stack_pos, xs->local_segment);
- restadjust = 0; // Used up the &rest adjustment
+ restadjust = 0; // Used up the &rest adjustment
xs->sp = call_base;
s->execution_stack_pos_changed = 1;
break;
}
- case 0x21: // callk
+ case 0x21: // callk
gc_countdown(s);
xs->sp -= (opparams[1] >> 1) + 1;
if (s->version >= SCI_VERSION_FTU_NEW_SCRIPT_HEADER) {
xs->sp -= restadjust;
- s->r_amp_rest = 0; // We just used up the restadjust, remember?
+ s->r_amp_rest = 0; // We just used up the restadjust, remember?
}
if (opparams[0] >= s->kfunct_nr) {
@@ -1031,10 +1031,10 @@ void run_vm(EngineState *s, int restoring) {
} else {
s->r_acc = s->kfunct_table[opparams[0]].fun(s, opparams[0], argc, xs->sp + 1);
}
- // Call kernel function
+ // Call kernel function
// Calculate xs again: The kernel function might
- // have spawned a new VM
+ // have spawned a new VM
xs_new = s->execution_stack + s->execution_stack_pos;
s->execution_stack_pos_changed = 1;
@@ -1045,77 +1045,77 @@ void run_vm(EngineState *s, int restoring) {
}
break;
- case 0x22: // callb
+ case 0x22: // callb
temp = ((opparams[1] >> 1) + restadjust + 1);
s_temp = xs->sp;
xs->sp -= temp;
xs->sp[0].offset += restadjust;
xs_new = execute_method(s, 0, opparams[0], s_temp, xs->objp, xs->sp[0].offset, xs->sp);
- restadjust = 0; // Used up the &rest adjustment
- if (xs_new) // in case of error, keep old stack
+ restadjust = 0; // Used up the &rest adjustment
+ if (xs_new) // in case of error, keep old stack
s->execution_stack_pos_changed = 1;
break;
- case 0x23: // calle
+ case 0x23: // calle
temp = ((opparams[2] >> 1) + restadjust + 1);
s_temp = xs->sp;
xs->sp -= temp;
xs->sp[0].offset += restadjust;
xs_new = execute_method(s, opparams[0], opparams[1], s_temp, xs->objp, xs->sp[0].offset, xs->sp);
- restadjust = 0; // Used up the &rest adjustment
+ restadjust = 0; // Used up the &rest adjustment
- if (xs_new) // in case of error, keep old stack
+ if (xs_new) // in case of error, keep old stack
s->execution_stack_pos_changed = 1;
break;
- case 0x24: // ret
+ case 0x24: // ret
do {
stack_ptr_t old_sp2 = xs->sp;
stack_ptr_t old_fp = xs->fp;
exec_stack_t *old_xs = s->execution_stack + s->execution_stack_pos;
- if (s->execution_stack_pos == s->execution_stack_base) { // Have we reached the base?
- s->execution_stack_base = old_execution_stack_base; // Restore stack base
+ if (s->execution_stack_pos == s->execution_stack_base) { // Have we reached the base?
+ s->execution_stack_base = old_execution_stack_base; // Restore stack base
--(s->execution_stack_pos);
s->execution_stack_pos_changed = 1;
- s->r_amp_rest = restadjust; // Update &rest
- return; // "Hard" return
+ s->r_amp_rest = restadjust; // Update &rest
+ return; // "Hard" return
}
if (old_xs->type == EXEC_STACK_TYPE_VARSELECTOR) {
- // varselector access?
- if (old_xs->argc) // write?
+ // varselector access?
+ if (old_xs->argc) // write?
*(old_xs->addr.varp) = old_xs->variables_argp[1];
- else // No, read
+ else // No, read
s->r_acc = *(old_xs->addr.varp);
}
- // Not reached the base, so let's do a soft return
+ // Not reached the base, so let's do a soft return
--(s->execution_stack_pos);
xs = old_xs - 1;
s->execution_stack_pos_changed = 1;
xs = s->execution_stack + s->execution_stack_pos;
- if (xs->sp == CALL_SP_CARRY // Used in sends to 'carry' the stack pointer
+ if (xs->sp == CALL_SP_CARRY // Used in sends to 'carry' the stack pointer
|| xs->type != EXEC_STACK_TYPE_CALL) {
xs->sp = old_sp2;
xs->fp = old_fp;
}
} while (xs->type == EXEC_STACK_TYPE_VARSELECTOR);
- // Iterate over all varselector accesses
+ // Iterate over all varselector accesses
s->execution_stack_pos_changed = 1;
xs_new = xs;
break;
- case 0x25: // send
+ case 0x25: // send
s_temp = xs->sp;
- xs->sp -= ((opparams[0] >> 1) + restadjust); // Adjust stack
+ xs->sp -= ((opparams[0] >> 1) + restadjust); // Adjust stack
xs->sp[1].offset += restadjust;
xs_new = send_selector(s, s->r_acc, s->r_acc, s_temp, (int)(opparams[0] >> 1) + (uint16)restadjust, xs->sp);
@@ -1127,13 +1127,13 @@ void run_vm(EngineState *s, int restoring) {
break;
- case 0x28: // class
+ case 0x28: // class
s->r_acc = get_class_address(s, (unsigned)opparams[0], SCRIPT_GET_LOCK, xs->addr.pc);
break;
- case 0x2a: // self
+ case 0x2a: // self
s_temp = xs->sp;
- xs->sp -= ((opparams[0] >> 1) + restadjust); // Adjust stack
+ xs->sp -= ((opparams[0] >> 1) + restadjust); // Adjust stack
xs->sp[1].offset += restadjust;
xs_new = send_selector(s, xs->objp, xs->objp, s_temp, (int)(opparams[0] >> 1) + (uint16)restadjust, xs->sp);
@@ -1144,14 +1144,14 @@ void run_vm(EngineState *s, int restoring) {
restadjust = 0;
break;
- case 0x2b: // super
+ case 0x2b: // super
r_temp = get_class_address(s, opparams[0], SCRIPT_GET_LOAD, xs->addr.pc);
if (!r_temp.segment)
CORE_ERROR("VM", "Invalid superclass in object");
else {
s_temp = xs->sp;
- xs->sp -= ((opparams[1] >> 1) + restadjust); // Adjust stack
+ xs->sp -= ((opparams[1] >> 1) + restadjust); // Adjust stack
xs->sp[1].offset += restadjust;
xs_new = send_selector(s, r_temp, xs->objp, s_temp, (int)(opparams[1] >> 1) + (uint16)restadjust, xs->sp);
@@ -1164,9 +1164,9 @@ void run_vm(EngineState *s, int restoring) {
break;
- case 0x2c: // &rest
- temp = (uint16) opparams[0]; // First argument
- restadjust = xs->argc - temp + 1; // +1 because temp counts the paramcount while argc doesn't
+ case 0x2c: // &rest
+ temp = (uint16) opparams[0]; // First argument
+ restadjust = xs->argc - temp + 1; // +1 because temp counts the paramcount while argc doesn't
if (restadjust < 0)
restadjust = 0;
@@ -1175,72 +1175,72 @@ void run_vm(EngineState *s, int restoring) {
break;
- case 0x2d: // lea
+ case 0x2d: // lea
temp = (uint16) opparams[0] >> 1;
- var_number = temp & 0x03; // Get variable type
+ var_number = temp & 0x03; // Get variable type
- // Get variable block offset
+ // Get variable block offset
r_temp.segment = variables_seg[var_number];
r_temp.offset = variables[var_number] - variables_base[var_number];
- if (temp & 0x08) // Add accumulator offset if requested
+ if (temp & 0x08) // Add accumulator offset if requested
r_temp.offset += signed_validate_arithmetic(s->r_acc);
- r_temp.offset += opparams[1]; // Add index
+ r_temp.offset += opparams[1]; // Add index
r_temp.offset *= sizeof(reg_t);
- // That's the immediate address now
+ // That's the immediate address now
s->r_acc = r_temp;
break;
- case 0x2e: // selfID
+ case 0x2e: // selfID
s->r_acc = xs->objp;
break;
- case 0x30: // pprev
+ case 0x30: // pprev
PUSH32(s->r_prev);
break;
- case 0x31: // pToa
+ case 0x31: // pToa
s->r_acc = OBJ_PROPERTY(obj, (opparams[0] >> 1));
break;
- case 0x32: // aTop
+ case 0x32: // aTop
OBJ_PROPERTY(obj, (opparams[0] >> 1)) = s->r_acc;
break;
- case 0x33: // pTos
+ case 0x33: // pTos
PUSH32(OBJ_PROPERTY(obj, opparams[0] >> 1));
break;
- case 0x34: // sTop
+ case 0x34: // sTop
OBJ_PROPERTY(obj, (opparams[0] >> 1)) = POP32();
break;
- case 0x35: // ipToa
+ case 0x35: // ipToa
s->r_acc = OBJ_PROPERTY(obj, (opparams[0] >> 1));
s->r_acc = OBJ_PROPERTY(obj, (opparams[0] >> 1)) = ACC_ARITHMETIC_L(1 + /*acc*/);
break;
- case 0x36: // dpToa
+ case 0x36: // dpToa
s->r_acc = OBJ_PROPERTY(obj, (opparams[0] >> 1));
s->r_acc = OBJ_PROPERTY(obj, (opparams[0] >> 1)) = ACC_ARITHMETIC_L(-1 + /*acc*/);
break;
- case 0x37: // ipTos
+ case 0x37: // ipTos
ASSERT_ARITHMETIC(OBJ_PROPERTY(obj, (opparams[0] >> 1)));
temp = ++OBJ_PROPERTY(obj, (opparams[0] >> 1)).offset;
PUSH(temp);
break;
- case 0x38: // dpTos
+ case 0x38: // dpTos
ASSERT_ARITHMETIC(OBJ_PROPERTY(obj, (opparams[0] >> 1)));
temp = --OBJ_PROPERTY(obj, (opparams[0] >> 1)).offset;
PUSH(temp);
break;
- case 0x39: // lofsa
+ case 0x39: // lofsa
s->r_acc.segment = xs->addr.pc.segment;
if (s->version >= SCI_VERSION(1, 001, 000))
@@ -1259,7 +1259,7 @@ void run_vm(EngineState *s, int restoring) {
#endif
break;
- case 0x3a: // lofss
+ case 0x3a: // lofss
r_temp.segment = xs->addr.pc.segment;
if (s->version >= SCI_VERSION_FTU_LOFS_ABSOLUTE)
@@ -1276,175 +1276,175 @@ void run_vm(EngineState *s, int restoring) {
PUSH32(r_temp);
break;
- case 0x3b: // push0
+ case 0x3b: // push0
PUSH(0);
break;
- case 0x3c: // push1
+ case 0x3c: // push1
PUSH(1);
break;
- case 0x3d: // push2
+ case 0x3d: // push2
PUSH(2);
break;
- case 0x3e: // pushSelf
+ case 0x3e: // pushSelf
PUSH32(xs->objp);
break;
- case 0x40: // lag
- case 0x41: // lal
- case 0x42: // lat
- case 0x43: // lap
- var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
+ case 0x40: // lag
+ case 0x41: // lal
+ case 0x42: // lat
+ case 0x43: // lap
+ var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
var_number = opparams[0];
s->r_acc = READ_VAR(var_type, var_number, s->r_acc);
break;
- case 0x44: // lsg
- case 0x45: // lsl
- case 0x46: // lst
- case 0x47: // lsp
- var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
+ case 0x44: // lsg
+ case 0x45: // lsl
+ case 0x46: // lst
+ case 0x47: // lsp
+ var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
var_number = opparams[0];
PUSH32(READ_VAR(var_type, var_number, s->r_acc));
break;
- case 0x48: // lagi
- case 0x49: // lali
- case 0x4a: // lati
- case 0x4b: // lapi
- var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
+ case 0x48: // lagi
+ case 0x49: // lali
+ case 0x4a: // lati
+ case 0x4b: // lapi
+ var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
var_number = opparams[0] + signed_validate_arithmetic(s->r_acc);
s->r_acc = READ_VAR(var_type, var_number, s->r_acc);
break;
- case 0x4c: // lsgi
- case 0x4d: // lsli
- case 0x4e: // lsti
- case 0x4f: // lspi
- var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
+ case 0x4c: // lsgi
+ case 0x4d: // lsli
+ case 0x4e: // lsti
+ case 0x4f: // lspi
+ var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
var_number = opparams[0] + signed_validate_arithmetic(s->r_acc);
PUSH32(READ_VAR(var_type, var_number, s->r_acc));
break;
- case 0x50: // sag
- case 0x51: // sal
- case 0x52: // sat
- case 0x53: // sap
- var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
+ case 0x50: // sag
+ case 0x51: // sal
+ case 0x52: // sat
+ case 0x53: // sap
+ var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
var_number = opparams[0];
WRITE_VAR(var_type, var_number, s->r_acc);
break;
- case 0x54: // ssg
- case 0x55: // ssl
- case 0x56: // sst
- case 0x57: // ssp
- var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
+ case 0x54: // ssg
+ case 0x55: // ssl
+ case 0x56: // sst
+ case 0x57: // ssp
+ var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
var_number = opparams[0];
WRITE_VAR(var_type, var_number, POP32());
break;
- case 0x58: // sagi
- case 0x59: // sali
- case 0x5a: // sati
- case 0x5b: // sapi
+ case 0x58: // sagi
+ case 0x59: // sali
+ case 0x5a: // sati
+ case 0x5b: // sapi
// Special semantics because it wouldn't really make a whole lot
// of sense otherwise, with acc being used for two things
- // simultaneously...
- var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
+ // simultaneously...
+ var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
var_number = opparams[0] + signed_validate_arithmetic(s->r_acc);
WRITE_VAR(var_type, var_number, s->r_acc = POP32());
break;
- case 0x5c: // ssgi
- case 0x5d: // ssli
- case 0x5e: // ssti
- case 0x5f: // sspi
- var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
+ case 0x5c: // ssgi
+ case 0x5d: // ssli
+ case 0x5e: // ssti
+ case 0x5f: // sspi
+ var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
var_number = opparams[0] + signed_validate_arithmetic(s->r_acc);
WRITE_VAR(var_type, var_number, POP32());
break;
- case 0x60: // +ag
- case 0x61: // +al
- case 0x62: // +at
- case 0x63: // +ap
- var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
+ case 0x60: // +ag
+ case 0x61: // +al
+ case 0x62: // +at
+ case 0x63: // +ap
+ var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
var_number = opparams[0];
s->r_acc = make_reg(0, 1 + validate_arithmetic(READ_VAR(var_type, var_number, s->r_acc)));
WRITE_VAR(var_type, var_number, s->r_acc);
break;
- case 0x64: // +sg
- case 0x65: // +sl
- case 0x66: // +st
- case 0x67: // +sp
- var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
+ case 0x64: // +sg
+ case 0x65: // +sl
+ case 0x66: // +st
+ case 0x67: // +sp
+ var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
var_number = opparams[0];
r_temp = make_reg(0, 1 + validate_arithmetic(READ_VAR(var_type, var_number, s->r_acc)));
PUSH32(r_temp);
WRITE_VAR(var_type, var_number, r_temp);
break;
- case 0x68: // +agi
- case 0x69: // +ali
- case 0x6a: // +ati
- case 0x6b: // +api
- var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
+ case 0x68: // +agi
+ case 0x69: // +ali
+ case 0x6a: // +ati
+ case 0x6b: // +api
+ var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
var_number = opparams[0] + signed_validate_arithmetic(s->r_acc);
s->r_acc = make_reg(0, 1 + validate_arithmetic(READ_VAR(var_type, var_number, s->r_acc)));
WRITE_VAR(var_type, var_number, s->r_acc);
break;
- case 0x6c: // +sgi
- case 0x6d: // +sli
- case 0x6e: // +sti
- case 0x6f: // +spi
- var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
+ case 0x6c: // +sgi
+ case 0x6d: // +sli
+ case 0x6e: // +sti
+ case 0x6f: // +spi
+ var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
var_number = opparams[0] + signed_validate_arithmetic(s->r_acc);
r_temp = make_reg(0, 1 + validate_arithmetic(READ_VAR(var_type, var_number, s->r_acc)));
PUSH32(r_temp);
WRITE_VAR(var_type, var_number, r_temp);
break;
- case 0x70: // -ag
- case 0x71: // -al
- case 0x72: // -at
- case 0x73: // -ap
- var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
+ case 0x70: // -ag
+ case 0x71: // -al
+ case 0x72: // -at
+ case 0x73: // -ap
+ var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
var_number = opparams[0];
s->r_acc = make_reg(0, -1 + validate_arithmetic(READ_VAR(var_type, var_number, s->r_acc)));
WRITE_VAR(var_type, var_number, s->r_acc);
break;
- case 0x74: // -sg
- case 0x75: // -sl
- case 0x76: // -st
- case 0x77: // -sp
- var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
+ case 0x74: // -sg
+ case 0x75: // -sl
+ case 0x76: // -st
+ case 0x77: // -sp
+ var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
var_number = opparams[0];
r_temp = make_reg(0, -1 + validate_arithmetic(READ_VAR(var_type, var_number, s->r_acc)));
PUSH32(r_temp);
WRITE_VAR(var_type, var_number, r_temp);
break;
- case 0x78: // -agi
- case 0x79: // -ali
- case 0x7a: // -ati
- case 0x7b: // -api
- var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
+ case 0x78: // -agi
+ case 0x79: // -ali
+ case 0x7a: // -ati
+ case 0x7b: // -api
+ var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
var_number = opparams[0] + signed_validate_arithmetic(s->r_acc);
s->r_acc = make_reg(0, -1 + validate_arithmetic(READ_VAR(var_type, var_number, s->r_acc)));
WRITE_VAR(var_type, var_number, s->r_acc);
break;
- case 0x7c: // -sgi
- case 0x7d: // -sli
- case 0x7e: // -sti
- case 0x7f: // -spi
- var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
+ case 0x7c: // -sgi
+ case 0x7d: // -sli
+ case 0x7e: // -sti
+ case 0x7f: // -spi
+ var_type = (opcode >> 1) & 0x3; // Gets the variable type: g, l, t or p
var_number = opparams[0] + signed_validate_arithmetic(s->r_acc);
r_temp = make_reg(0, -1 + validate_arithmetic(READ_VAR(var_type, var_number, s->r_acc)));
PUSH32(r_temp);
@@ -1454,9 +1454,9 @@ void run_vm(EngineState *s, int restoring) {
default:
script_error(s, __FILE__, __LINE__, "Illegal opcode");
- } // switch(opcode >> 1)
+ } // switch(opcode >> 1)
- if (s->execution_stack_pos_changed) // Force initialization
+ if (s->execution_stack_pos_changed) // Force initialization
xs = xs_new;
#ifndef DISABLE_VALIDATIONS
@@ -1465,8 +1465,8 @@ void run_vm(EngineState *s, int restoring) {
}
#endif
if (script_error_flag) {
- _debug_step_running = 0; // Stop multiple execution
- _debug_seeking = 0; // Stop special seeks
+ _debug_step_running = 0; // Stop multiple execution
+ _debug_seeking = 0; // Stop special seeks
xs->addr.pc.offset = old_pc_offset;
xs->sp = old_sp;
} else
@@ -1475,8 +1475,8 @@ void run_vm(EngineState *s, int restoring) {
}
static inline int _obj_locate_varselector(EngineState *s, object_t *obj, selector_t slc) {
- // Determines if obj explicitly defines slc as a varselector
- // Returns -1 if not found
+ // Determines if obj explicitly defines slc as a varselector
+ // Returns -1 if not found
if (s->version < SCI_VERSION(1, 001, 000)) {
int varnum = obj->variable_names_nr;
@@ -1487,10 +1487,10 @@ static inline int _obj_locate_varselector(EngineState *s, object_t *obj, selecto
obj->base_vars = (uint16 *) buf;
for (i = 0; i < varnum; i++)
- if (getUInt16(buf + (i << 1)) == slc) // Found it?
- return i; // report success
+ if (getUInt16(buf + (i << 1)) == slc) // Found it?
+ return i; // report success
- return -1; // Failed
+ return -1; // Failed
} else {
byte *buf = (byte *) obj->base_vars;
int i;
@@ -1500,31 +1500,31 @@ static inline int _obj_locate_varselector(EngineState *s, object_t *obj, selecto
buf = ((byte *) obj_get(s, obj->variables[SCRIPT_SUPERCLASS_SELECTOR])->base_vars);
for (i = 0; i < varnum; i++)
- if (getUInt16(buf + (i << 1)) == slc) // Found it?
- return i; // report success
+ if (getUInt16(buf + (i << 1)) == slc) // Found it?
+ return i; // report success
- return -1; // Failed
+ return -1; // Failed
}
}
static inline int _class_locate_funcselector(EngineState *s, object_t *obj, selector_t slc) {
- // Determines if obj is a class and explicitly defines slc as a funcselector
+ // Determines if obj is a class and explicitly defines slc as a funcselector
// Does NOT say anything about obj's superclasses, i.e. failure may be
- // returned even if one of the superclasses defines the funcselector.
+ // returned even if one of the superclasses defines the funcselector.
int funcnum = obj->methods_nr;
int i;
for (i = 0; i < funcnum; i++)
- if (VM_OBJECT_GET_FUNCSELECTOR(obj, i) == slc) // Found it?
- return i; // report success
+ if (VM_OBJECT_GET_FUNCSELECTOR(obj, i) == slc) // Found it?
+ return i; // report success
- return -1; // Failed
+ return -1; // Failed
}
static inline int _lookup_selector_function(EngineState *s, int seg_id, object_t *obj, selector_t selector_id, reg_t *fptr) {
int index;
- // "recursive" lookup
+ // "recursive" lookup
while (obj) {
index = _class_locate_funcselector(s, obj, selector_id);
@@ -1553,7 +1553,7 @@ int lookup_selector(EngineState *s, reg_t obj_location, selector_t selector_id,
int index;
// Early SCI versions used the LSB in the selector ID as a read/write
- // toggle, meaning that we must remove it for selector lookup.
+ // toggle, meaning that we must remove it for selector lookup.
if (s->version < SCI_VERSION_FTU_NEW_SCRIPT_HEADER)
selector_id &= ~1;
@@ -1579,7 +1579,7 @@ int lookup_selector(EngineState *s, reg_t obj_location, selector_t selector_id,
index = _obj_locate_varselector(s, obj, selector_id);
if (index >= 0) {
- // Found it as a variable
+ // Found it as a variable
if (vptr)
*vptr = obj->variables + index;
return SELECTOR_VARIABLE;
@@ -1588,7 +1588,7 @@ int lookup_selector(EngineState *s, reg_t obj_location, selector_t selector_id,
return _lookup_selector_function(s, obj_location.segment, obj, selector_id, fptr);
}
-// Detects SCI versions by their different script header
+// Detects SCI versions by their different script header
void script_detect_versions(EngineState *s) {
int c;
resource_t *script = {0};
@@ -1683,7 +1683,7 @@ int script_instantiate_common(EngineState *s, int script_nr, resource_t **script
if (!*script || (s->version >= SCI_VERSION(1, 001, 000) && !heap)) {
sciprintf("Script 0x%x requested but not found\n", script_nr);
- //script_debug_flag = script_error_flag = 1;
+ //script_debug_flag = script_error_flag = 1;
if (s->version >= SCI_VERSION(1, 001, 000)) {
if (*heap)
sciprintf("Inconsistency: heap resource WAS found\n");
@@ -1709,7 +1709,7 @@ int script_instantiate_common(EngineState *s, int script_nr, resource_t **script
mem = s->seg_manager->heap[seg];
s->seg_manager->freeScript(mem);
}
- } else if (!(mem = s->seg_manager->allocateScript(s, script_nr, &seg_id))) { // ALL YOUR SCRIPT BASE ARE BELONG TO US
+ } else if (!(mem = s->seg_manager->allocateScript(s, script_nr, &seg_id))) { // ALL YOUR SCRIPT BASE ARE BELONG TO US
sciprintf("Not enough heap space for script size 0x%x of script 0x%x, should this happen?`\n", (*script)->size, script_nr);
script_debug_flag = script_error_flag = 1;
return 0;
@@ -1720,7 +1720,7 @@ int script_instantiate_common(EngineState *s, int script_nr, resource_t **script
reg.segment = seg_id;
reg.offset = 0;
- // Set heap position (beyond the size word)
+ // Set heap position (beyond the size word)
s->seg_manager->setLockers(1, reg.segment, SEG_ID);
s->seg_manager->setExportTableOffset(0, reg.segment, SEG_ID);
s->seg_manager->setSynonymsOffset(0, reg.segment, SEG_ID);
@@ -1737,7 +1737,7 @@ int script_instantiate_sci0(EngineState *s, int script_nr) {
reg_t reg, reg_tmp;
int seg_id;
int relocation = -1;
- int magic_pos_adder; // Usually 0; 2 for older SCI versions
+ int magic_pos_adder; // Usually 0; 2 for older SCI versions
resource_t *script;
int was_new;
@@ -1753,13 +1753,13 @@ int script_instantiate_sci0(EngineState *s, int script_nr) {
//
int locals_nr = getUInt16(script->data);
- // Old script block
- // There won't be a localvar block in this case
+ // Old script block
+ // There won't be a localvar block in this case
// Instead, the script starts with a 16 bit int specifying the
- // number of locals we need; these are then allocated and zeroed.
+ // number of locals we need; these are then allocated and zeroed.
s->seg_manager->mcpyInOut(0, script->data, script->size, reg.segment, SEG_ID);
- magic_pos_adder = 2; // Step over the funny prefix
+ magic_pos_adder = 2; // Step over the funny prefix
if (locals_nr)
s->seg_manager->scriptInitialiseLocalsZero(reg.segment, locals_nr);
@@ -1779,7 +1779,7 @@ int script_instantiate_sci0(EngineState *s, int script_nr) {
do {
reg_t data_base;
reg_t addr;
- reg.offset += objlength; // Step over the last checked object
+ reg.offset += objlength; // Step over the last checked object
objtype = SEG_GET_HEAP(s, reg);
if (!objtype) break;
@@ -1797,7 +1797,7 @@ int script_instantiate_sci0(EngineState *s, int script_nr) {
break;
case sci_obj_synonyms:
- s->seg_manager->setSynonymsOffset(addr.offset, reg.segment, SEG_ID); // +4 is to step over the header
+ s->seg_manager->setSynonymsOffset(addr.offset, reg.segment, SEG_ID); // +4 is to step over the header
s->seg_manager->setSynonymsNr((objlength) / 4, reg.segment, SEG_ID);
break;
@@ -1822,7 +1822,7 @@ int script_instantiate_sci0(EngineState *s, int script_nr) {
s->classtable[species].script = script_nr;
s->classtable[species].reg = addr;
s->classtable[species].reg.offset = classpos;
- // Set technical class position-- into the block allocated for it
+ // Set technical class position-- into the block allocated for it
}
break;
@@ -1830,18 +1830,18 @@ int script_instantiate_sci0(EngineState *s, int script_nr) {
break;
}
} while (objtype != 0);
- // And now a second pass to adjust objects and class pointers, and the general pointers
+ // And now a second pass to adjust objects and class pointers, and the general pointers
objlength = 0;
- reg.offset = magic_pos_adder; // Reset counter
+ reg.offset = magic_pos_adder; // Reset counter
do {
reg_t addr;
- reg.offset += objlength; // Step over the last checked object
+ reg.offset += objlength; // Step over the last checked object
objtype = SEG_GET_HEAP(s, reg);
if (!objtype) break;
objlength = SEG_GET_HEAP(s, make_reg(reg.segment, reg.offset + 2));
- reg.offset += 4; // Step over header
+ reg.offset += 4; // Step over header
addr = reg;
@@ -1850,22 +1850,22 @@ int script_instantiate_sci0(EngineState *s, int script_nr) {
s->seg_manager->scriptAddCodeBlock(addr);
break;
case sci_obj_object:
- case sci_obj_class: { // object or class?
+ case sci_obj_class: { // object or class?
object_t *obj = s->seg_manager->scriptObjInit(s, addr);
object_t *base_obj;
- // Instantiate the superclass, if neccessary
+ // Instantiate the superclass, if neccessary
obj->variables[SCRIPT_SPECIES_SELECTOR] = INST_LOOKUP_CLASS(obj->variables[SCRIPT_SPECIES_SELECTOR].offset);
base_obj = obj_get(s, obj->variables[SCRIPT_SPECIES_SELECTOR]);
obj->variable_names_nr = base_obj->variables_nr;
obj->base_obj = base_obj->base_obj;
- // Copy base from species class, as we need its selector IDs
+ // Copy base from species class, as we need its selector IDs
obj->variables[SCRIPT_SUPERCLASS_SELECTOR] = INST_LOOKUP_CLASS(obj->variables[SCRIPT_SUPERCLASS_SELECTOR].offset);
- } // if object or class
+ } // if object or class
break;
- case sci_obj_pointers: // A relocation table
+ case sci_obj_pointers: // A relocation table
relocation = addr.offset;
break;
@@ -1873,7 +1873,7 @@ int script_instantiate_sci0(EngineState *s, int script_nr) {
break;
}
- reg.offset -= 4; // Step back on header
+ reg.offset -= 4; // Step back on header
} while ((objtype != 0) && (((unsigned)reg.offset) < script->size - 2));
@@ -1882,7 +1882,7 @@ int script_instantiate_sci0(EngineState *s, int script_nr) {
s->seg_manager->scriptFreeUnusedObjects(reg.segment);
- return reg.segment; // instantiation successful
+ return reg.segment; // instantiation successful
}
int script_instantiate_sci11(EngineState *s, int script_nr) {
@@ -1931,15 +1931,15 @@ void script_uninstantiate_sci0(EngineState *s, int script_nr, seg_id_t seg) {
reg_t reg = make_reg(seg, (s->version < SCI_VERSION_FTU_NEW_SCRIPT_HEADER) ? 2 : 0);
int objtype, objlength;
- // Make a pass over the object in order uninstantiate all superclasses
+ // Make a pass over the object in order uninstantiate all superclasses
objlength = 0;
do {
- reg.offset += objlength; // Step over the last checked object
+ reg.offset += objlength; // Step over the last checked object
objtype = SEG_GET_HEAP(s, reg);
if (!objtype) break;
- objlength = SEG_GET_HEAP(s, make_reg(reg.segment, reg.offset + 2)); // use SEG_UGET_HEAP ??
+ objlength = SEG_GET_HEAP(s, make_reg(reg.segment, reg.offset + 2)); // use SEG_UGET_HEAP ??
reg.offset += 4; // Step over header
diff --git a/engines/sci/gfx/font.cpp b/engines/sci/gfx/font.cpp
index dcc140b948..2bda51f050 100644
--- a/engines/sci/gfx/font.cpp
+++ b/engines/sci/gfx/font.cpp
@@ -133,8 +133,8 @@ gfx_bitmap_font_t *gfxr_scale_font(gfx_bitmap_font_t *orig_font, gfx_mode_t *mod
}
}
-text_fragment_t *gfxr_font_calculate_size(gfx_bitmap_font_t *font, int max_width, const char *text, int *width, int *height,
- int *lines, int *line_height_p, int *last_offset_p, int flags) {
+text_fragment_t *gfxr_font_calculate_size(gfx_bitmap_font_t *font, int max_width, const char *text, int *width, int *height,
+ int *lines, int *line_height_p, int *last_offset_p, int flags) {
int est_char_width = font->widths[(font->chars_nr > 'M')? 'M' : font->chars_nr - 1];
// 'M' is typically among the widest chars
int fragments_nr;
@@ -282,7 +282,7 @@ static inline void render_char(byte *dest, byte *src, int width, int line_width,
}
gfx_pixmap_t *gfxr_draw_font(gfx_bitmap_font_t *font, const char *stext, int characters,
- gfx_pixmap_color_t *fg0, gfx_pixmap_color_t *fg1, gfx_pixmap_color_t *bg) {
+ gfx_pixmap_color_t *fg0, gfx_pixmap_color_t *fg1, gfx_pixmap_color_t *bg) {
unsigned char *text = (unsigned char *)stext;
int height = font->height;
int width = 0;
diff --git a/engines/sci/gfx/gfx_crossblit.cpp b/engines/sci/gfx/gfx_crossblit.cpp
index d861b8ac25..03bda7a23e 100644
--- a/engines/sci/gfx/gfx_crossblit.cpp
+++ b/engines/sci/gfx/gfx_crossblit.cpp
@@ -52,12 +52,12 @@
namespace Sci {
static void FUNCTION_NAME(byte *dest, byte *src, int bytes_per_dest_line, int bytes_per_src_line,
- int xl, int yl, byte *alpha, int bytes_per_alpha_line, int bytes_per_alpha_pixel,
- unsigned int alpha_test_mask, unsigned int alpha_min
+ int xl, int yl, byte *alpha, int bytes_per_alpha_line, int bytes_per_alpha_pixel,
+ unsigned int alpha_test_mask, unsigned int alpha_min
#ifdef USE_PRIORITY
- , byte *priority_buffer, int bytes_per_priority_line, int bytes_per_priority_pixel, int priority
+ , byte *priority_buffer, int bytes_per_priority_line, int bytes_per_priority_pixel, int priority
#endif /* USE_PRIORITY */
- ) {
+ ) {
int x, y;
int alpha_end = xl * bytes_per_alpha_pixel;
diff --git a/engines/sci/gfx/gfx_driver.cpp b/engines/sci/gfx/gfx_driver.cpp
index 69aa88396a..fc4848b283 100644
--- a/engines/sci/gfx/gfx_driver.cpp
+++ b/engines/sci/gfx/gfx_driver.cpp
@@ -157,7 +157,7 @@ static void lineColor2(byte *dst, int16 x1, int16 y1, int16 x2, int16 y2, uint32
}
static int scummvm_draw_line(gfx_driver_t *drv, Common::Point start, Common::Point end,
- gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style) {
+ gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style) {
uint32 scolor = color.visual.global_index;
int xsize = S->xsize;
int ysize = S->ysize;
@@ -181,7 +181,7 @@ static int scummvm_draw_line(gfx_driver_t *drv, Common::Point start, Common::Poi
}
static int scummvm_draw_filled_rect(gfx_driver_t *drv, rect_t rect, gfx_color_t color1, gfx_color_t color2,
- gfx_rectangle_fill_t shade_mode) {
+ gfx_rectangle_fill_t shade_mode) {
if (color1.mask & GFX_MASK_VISUAL) {
for (int i = rect.y; i < rect.y + rect.yl; i++) {
memset(S->visual[1] + i * S->xsize + rect.x, color1.visual.global_index, rect.xl);
@@ -196,7 +196,7 @@ static int scummvm_draw_filled_rect(gfx_driver_t *drv, rect_t rect, gfx_color_t
// Pixmap operations
-static int scummvm_draw_pixmap(gfx_driver_t *drv, gfx_pixmap_t *pxm, int priority,
+static int scummvm_draw_pixmap(gfx_driver_t *drv, gfx_pixmap_t *pxm, int priority,
rect_t src, rect_t dest, gfx_buffer_t buffer) {
int bufnr = (buffer == GFX_BUFFER_STATIC) ? 2 : 1;
int pribufnr = bufnr - 1;
diff --git a/engines/sci/gfx/gfx_operations.h b/engines/sci/gfx/gfx_operations.h
index 5cfebb831c..253a2fabb3 100644
--- a/engines/sci/gfx/gfx_operations.h
+++ b/engines/sci/gfx/gfx_operations.h
@@ -164,7 +164,7 @@ int gfxop_init_default(gfx_state_t *state, gfx_options_t *options, void *misc_in
*/
int gfxop_init(gfx_state_t *state, int xfact, int yfact, gfx_color_mode_t bpp,
- gfx_options_t *options, void *misc_info);
+ gfx_options_t *options, void *misc_info);
/* Initializes a custom graphics mode
** Parameters: (gfx_state_t *) state: The state to initialize
** (int x int) xfact, yfact: Horizontal and vertical scale factors
@@ -230,9 +230,8 @@ int gfxop_set_clip_zone(gfx_state_t *state, rect_t zone);
/******************************/
int gfxop_draw_line(gfx_state_t *state,
- Common::Point start, Common::Point end,
- gfx_color_t color, gfx_line_mode_t line_mode,
- gfx_line_style_t line_style);
+ Common::Point start, Common::Point end, gfx_color_t color,
+ gfx_line_mode_t line_mode, gfx_line_style_t line_style);
/* Renders a clipped line to the back buffer
** Parameters: (gfx_state_t *) state: The state affected
** (Common::Point) start: Starting point of the line
@@ -244,7 +243,7 @@ int gfxop_draw_line(gfx_state_t *state,
*/
int gfxop_draw_rectangle(gfx_state_t *state, rect_t rect, gfx_color_t color, gfx_line_mode_t line_mode,
- gfx_line_style_t line_style);
+ gfx_line_style_t line_style);
/* Draws a non-filled rectangular box to the back buffer
** Parameters: (gfx_state_t *) state: The affected state
** (rect_t) rect: The rectangular area the box is drawn to
@@ -256,7 +255,7 @@ int gfxop_draw_rectangle(gfx_state_t *state, rect_t rect, gfx_color_t color, gfx
*/
int gfxop_draw_box(gfx_state_t *state, rect_t box, gfx_color_t color1, gfx_color_t color2,
- gfx_box_shade_t shade_type);
+ gfx_box_shade_t shade_type);
/* Draws a filled box to the back buffer
** Parameters: (gfx_state_t *) state: The affected state
** (rect_t) box: The area to draw to
@@ -326,7 +325,7 @@ int gfxop_disable_dirty_frames(gfx_state_t *state);
/********************/
int gfxop_set_color(gfx_state_t *state, gfx_color_t *color, int r, int g, int b, int a,
- int priority, int control);
+ int priority, int control);
/* Maps an r/g/b value to a color and sets a gfx_color_t structure
** Parameters: (gfx_state_t *) state: The current state
** (gfx_color_t *) color: Pointer to the structure to write to
@@ -468,7 +467,7 @@ int gfxop_overflow_cel(gfx_state_t *state, int nr, int *loop, int *cel);
*/
int gfxop_get_cel_parameters(gfx_state_t *state, int nr, int loop, int cel,
- int *width, int *height, Common::Point *offset);
+ int *width, int *height, Common::Point *offset);
/* Retreives the width and height of a cel
** Parameters: (gfx_state_t *) state: The state to use
** (int) nr: Number of the view
@@ -482,7 +481,7 @@ int gfxop_get_cel_parameters(gfx_state_t *state, int nr, int loop, int cel,
*/
int gfxop_draw_cel(gfx_state_t *state, int nr, int loop, int cel, Common::Point pos,
- gfx_color_t color, int palette);
+ gfx_color_t color, int palette);
/* Draws (part of) a cel to the back buffer
** Parameters: (gfx_state_t *) state: The state encapsulating the driver to draw with
** (int) nr: Number of the view to draw
@@ -496,7 +495,7 @@ int gfxop_draw_cel(gfx_state_t *state, int nr, int loop, int cel, Common::Point
int gfxop_draw_cel_static(gfx_state_t *state, int nr, int loop, int cel, Common::Point pos,
- gfx_color_t color, int palette);
+ gfx_color_t color, int palette);
/* Draws a cel to the static buffer; no clipping is performed
** Parameters: (gfx_state_t *) state: The state encapsulating the driver to draw with
** (int) nr: Number of the view to draw
@@ -511,7 +510,7 @@ int gfxop_draw_cel_static(gfx_state_t *state, int nr, int loop, int cel, Common:
int gfxop_draw_cel_static_clipped(gfx_state_t *state, int nr, int loop, int cel, Common::Point pos,
- gfx_color_t color, int palette);
+ gfx_color_t color, int palette);
/* Draws (part of) a clipped cel to the static buffer
** Parameters: (gfx_state_t *) state: The state encapsulating the driver to draw with
** (int) nr: Number of the view to draw
@@ -574,8 +573,8 @@ int gfxop_get_font_height(gfx_state_t *state, int font_nr);
*/
int gfxop_get_text_params(gfx_state_t *state, int font_nr, const char *text,
- int maxwidth, int *width, int *height, int flags,
- int *lines_nr, int *lineheight, int *lastline_width);
+ int maxwidth, int *width, int *height, int flags,
+ int *lines_nr, int *lineheight, int *lastline_width);
/* Calculates the width and height of a specified text in a specified font
** Parameters: (gfx_state_t *) state: The state to use
** (int) font_nr: Font number to use for the calculation
@@ -592,9 +591,8 @@ int gfxop_get_text_params(gfx_state_t *state, int font_nr, const char *text,
*/
gfx_text_handle_t *gfxop_new_text(gfx_state_t *state, int font_nr, char *text, int maxwidth,
- gfx_alignment_t halign, gfx_alignment_t valign,
- gfx_color_t color1, gfx_color_t color2, gfx_color_t bg_color,
- int flags);
+ gfx_alignment_t halign, gfx_alignment_t valign, gfx_color_t color1,
+ gfx_color_t color2, gfx_color_t bg_color, int flags);
/* Generates a new text handle that can be used to draw any text
** Parameters: (gfx_state_t *) state: The state to use
** (int) font_nr: Font number to use for the calculation
diff --git a/engines/sci/gfx/gfx_pixmap_scale.cpp b/engines/sci/gfx/gfx_pixmap_scale.cpp
index 215be8c4d5..139e35d24b 100644
--- a/engines/sci/gfx/gfx_pixmap_scale.cpp
+++ b/engines/sci/gfx/gfx_pixmap_scale.cpp
@@ -128,7 +128,7 @@ void FUNCNAME(gfx_mode_t *mode, gfx_pixmap_t *pxm, int scale) {
#define WRITE_XPART(X_CALC_INTENSITY, DO_X_STEP) \
for (subx = 0; subx < ((DO_X_STEP) ? (xfact >> 1) : 1); subx++) { \
- unsigned int intensity; \
+ unsigned int intensity; \
wrcolor = 0; \
for (i = 0; i < 3; i++) { \
intensity = X_CALC_INTENSITY; \
@@ -137,17 +137,17 @@ void FUNCNAME(gfx_mode_t *mode, gfx_pixmap_t *pxm, int scale) {
i = 3; \
intensity = X_CALC_INTENSITY; \
if (inverse_alpha) \
- intensity = ~intensity; \
- wrcolor |= (intensity >> shifts[i]) & masks[i]; \
- if (separate_alpha_map) \
- *alpha_wrpos++ = intensity >> 24; \
+ intensity = ~intensity; \
+ wrcolor |= (intensity >> shifts[i]) & masks[i]; \
+ if (separate_alpha_map) \
+ *alpha_wrpos++ = intensity >> 24; \
wrcolor <<= (EXTRA_BYTE_OFFSET * 8); \
memcpy(wrpos, &wrcolor, COPY_BYTES); \
wrpos += COPY_BYTES; \
if (DO_X_STEP) \
- column_valuator -= column_step; \
+ column_valuator -= column_step; \
} \
- if (DO_X_STEP) \
+ if (DO_X_STEP) \
column_step = -column_step
// End of macro definition
@@ -163,7 +163,7 @@ void FUNCNAME(gfx_mode_t *mode, gfx_pixmap_t *pxm, int scale) {
int i; \
SIZETYPE wrcolor; \
wrpos = sublinepos; \
- alpha_wrpos = alpha_sublinepos; \
+ alpha_wrpos = alpha_sublinepos; \
for (i = 0; i < 4; i++) \
linecolor[i] = LINE_COLOR; \
/*-- left half --*/ \
@@ -178,7 +178,7 @@ void FUNCNAME(gfx_mode_t *mode, gfx_pixmap_t *pxm, int scale) {
MAKE_PIXEL((x + 1 == pxm->index_xl), othercolumn, ctexel, src[+1]); \
WRITE_XPART(X_CALC_INTENSITY_NORMAL, 1); \
if (DO_Y_STEP) \
- line_valuator -= line_step; \
+ line_valuator -= line_step; \
sublinepos += pxm->xl * bytespp; \
alpha_sublinepos += pxm->xl; \
} \
diff --git a/engines/sci/gfx/gfx_resmgr.h b/engines/sci/gfx/gfx_resmgr.h
index 12f7da4cb8..17a15590e3 100644
--- a/engines/sci/gfx/gfx_resmgr.h
+++ b/engines/sci/gfx/gfx_resmgr.h
@@ -96,7 +96,7 @@ struct gfx_resstate_t {
gfx_resstate_t *gfxr_new_resource_manager(int version, gfx_options_t *options,
- gfx_driver_t *driver, void *misc_payload);
+ gfx_driver_t *driver, void *misc_payload);
/* Allocates and initializes a new resource manager
** Parameters: (int) version: Interpreter version
** (gfx_options_t *): Pointer to all relevant drawing options
@@ -145,7 +145,7 @@ void gfxr_free_tagged_resources(gfx_driver_t *driver, gfx_resstate_t *state);
gfxr_pic_t *gfxr_get_pic(gfx_resstate_t *state, int nr, int maps, int flags,
- int default_palette, int scaled);
+ int default_palette, int scaled);
/* Retreives a displayable (translated) pic resource
** Parameters: (gfx_resstate_t *) state: The resource state
** (int) nr: Number of the pic resource
@@ -159,7 +159,7 @@ gfxr_pic_t *gfxr_get_pic(gfx_resstate_t *state, int nr, int maps, int flags,
*/
gfxr_pic_t *gfxr_add_to_pic(gfx_resstate_t *state, int old_nr, int new_nr, int maps, int flags,
- int old_default_palette, int default_palette, int scaled);
+ int old_default_palette, int default_palette, int scaled);
/* Retreives a displayable (translated) pic resource written ontop of an existing pic
** Parameters: (gfx_resstate_t *) state: The resource state
** (int) old_nr: Number of the pic resource to write on
@@ -218,7 +218,7 @@ gfx_pixmap_color_t *gfxr_get_palette(gfx_resstate_t *state, int nr);
int gfxr_interpreter_options_hash(gfx_resource_type_t type, int version,
- gfx_options_t *options, void *internal, int palette);
+ gfx_options_t *options, void *internal, int palette);
/* Calculates a unique hash value for the specified options/type setup
** Parameters: (gfx_resource_type_t) type: The type the hash is to be generated for
** (int) version: The interpreter type and version
@@ -236,7 +236,7 @@ int gfxr_interpreter_options_hash(gfx_resource_type_t type, int version,
*/
int *gfxr_interpreter_get_resources(gfx_resstate_t *state, gfx_resource_type_t type,
- int version, int *entries_nr, void *internal);
+ int version, int *entries_nr, void *internal);
/* Retreives all resources of a specified type that are available from the interpreter
** Parameters: (gfx_resstate_t *) state: The relevant resource state
** (gfx_respirce_type_t) type: The resource type to query
@@ -270,7 +270,7 @@ void gfxr_interpreter_clear_pic(int version, gfxr_pic_t *pic, void *internal);
*/
int gfxr_interpreter_calculate_pic(gfx_resstate_t *state, gfxr_pic_t *scaled_pic, gfxr_pic_t *unscaled_pic,
- int flags, int default_palette, int nr, void *internal);
+ int flags, int default_palette, int nr, void *internal);
/* Instructs the interpreter-specific code to calculate a picture
** Parameters: (gfx_resstate_t *) state: The resource state, containing options and version information
** (gfxr_pic_t *) scaled_pic: The pic structure that is to be written to
diff --git a/engines/sci/gfx/gfx_resource.h b/engines/sci/gfx/gfx_resource.h
index 0fcd7aa68d..8fc26d2d2c 100644
--- a/engines/sci/gfx/gfx_resource.h
+++ b/engines/sci/gfx/gfx_resource.h
@@ -201,9 +201,7 @@ gfx_bitmap_font_t *gfxr_scale_font(gfx_bitmap_font_t *font, gfx_mode_t *mode, gf
*/
text_fragment_t *gfxr_font_calculate_size(gfx_bitmap_font_t *font, int max_width, const char *text,
- int *width, int *height,
- int *lines, int *line_height, int *last_offset,
- int flags);
+ int *width, int *height, int *lines, int *line_height, int *last_offset, int flags);
/* Calculates the size that would be occupied by drawing a specified text
** Parameters: (gfx_bitmap_font_t *) font: The font to calculate with
** (int) max_width: Maximum pixel width allowed for the output
@@ -221,7 +219,7 @@ text_fragment_t *gfxr_font_calculate_size(gfx_bitmap_font_t *font, int max_width
*/
gfx_pixmap_t *gfxr_draw_font(gfx_bitmap_font_t *font, const char *text, int characters,
- gfx_pixmap_color_t *fg0, gfx_pixmap_color_t *fg1, gfx_pixmap_color_t *bg);
+ gfx_pixmap_color_t *fg0, gfx_pixmap_color_t *fg1, gfx_pixmap_color_t *bg);
/* Draws text in a specific font to a pixmap
** Parameters: (gfx_bitmap_font_t *) font: The font to use for drawing
** (char *) text: The start of the text to draw
@@ -254,8 +252,8 @@ void gfxr_clear_pic0(gfxr_pic_t *pic, int sci_titlebar_size);
void gfxr_draw_pic01(gfxr_pic_t *pic, int fill_normally, int default_palette,
- int size, byte *resource, gfxr_pic0_params_t *style, int resid, int sci1,
- gfx_pixmap_color_t *static_pal, int static_pal_nr);
+ int size, byte *resource, gfxr_pic0_params_t *style, int resid, int sci1,
+ gfx_pixmap_color_t *static_pal, int static_pal_nr);
/* Draws a pic resource (all formats prior to SCI1.1)
** Parameters: (gfxr_pic_t *) pic: The pic to draw to
** (int) fill_normally: If 1, the pic is drawn normally; if 0, all
@@ -275,8 +273,8 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int fill_normally, int default_palette,
*/
void gfxr_draw_pic11(gfxr_pic_t *pic, int fill_normally, int default_palette,
- int size, byte *resource, gfxr_pic0_params_t *style, int resid,
- gfx_pixmap_color_t *static_pal, int static_pal_nr);
+ int size, byte *resource, gfxr_pic0_params_t *style, int resid,
+ gfx_pixmap_color_t *static_pal, int static_pal_nr);
/* Draws a pic resource (SCI1.1)
** Parameters: (gfxr_pic_t *) pic: The pic to draw to
** (int) fill_normally: If 1, the pic is drawn normally; if 0, all
@@ -376,7 +374,7 @@ gfx_pixmap_color_t *gfxr_read_pal11(int id, int *colors_nr, byte *resource, int
*/
gfxr_view_t *gfxr_draw_view1(int id, byte *resource, int size, gfx_pixmap_color_t *static_pal,
- int static_pal_nr);
+ int static_pal_nr);
/* Calculates an SCI1 view
** Parameters: (int) id: Resource ID of the view
** (byte *) resource: Pointer to the resource to read
diff --git a/engines/sci/gfx/gfx_state_internal.h b/engines/sci/gfx/gfx_state_internal.h
index c5a03ce1b4..8168510d4e 100644
--- a/engines/sci/gfx/gfx_state_internal.h
+++ b/engines/sci/gfx/gfx_state_internal.h
@@ -89,26 +89,26 @@ typedef int gfxw_op_int(gfxw_widget_t *, int);
typedef int gfxw_bin_op(gfxw_widget_t *, gfxw_widget_t *);
#define WIDGET_COMMON \
- int magic; /* Extra check after typecasting */ \
- int serial; /* Serial number */ \
- int flags; /* Widget flags */ \
- gfxw_widget_type_t type; \
- rect_t bounds; /* Boundaries */ \
- gfxw_widget_t *next; /* Next widget in widget list */ \
- int ID; /* Unique ID or GFXW_NO_ID */ \
- int subID; /* A 'sub-ID', or GFXW_NO_ID */ \
- gfxw_container_t *parent; /* The parent widget, or NULL if not owned */ \
- gfxw_visual_t *visual; /* The owner visual */ \
- int widget_priority; /* Drawing priority, or -1 */ \
- gfxw_point_op *draw; /* Draw widget (if dirty) and anything else required for the display to be consistant */ \
- gfxw_op *widfree; /* Remove widget (and any sub-widgets it may contain) */ \
- gfxw_op *tag; /* Tag the specified widget */ \
- gfxw_op_int *print; /* Prints the widget's contents, using sciprintf. Second parameter is indentation. */ \
- gfxw_bin_op *compare_to; /* a.compare_to(a, b) returns <0 if a<b, =0 if a=b and >0 if a>b */ \
- gfxw_bin_op *equals; /* a equals b if both cause the same data to be displayed */ \
- gfxw_bin_op *should_replace; /* (only if a equals b) Whether b should replace a even though they are equivalent */ \
- gfxw_bin_op *superarea_of; /* a superarea_of b <=> for each pixel of b there exists an opaque pixel in a at the same location */ \
- gfxw_visual_op *set_visual /* Sets the visual the widget belongs to */
+ int magic; /* Extra check after typecasting */ \
+ int serial; /* Serial number */ \
+ int flags; /* Widget flags */ \
+ gfxw_widget_type_t type; \
+ rect_t bounds; /* Boundaries */ \
+ gfxw_widget_t *next; /* Next widget in widget list */ \
+ int ID; /* Unique ID or GFXW_NO_ID */ \
+ int subID; /* A 'sub-ID', or GFXW_NO_ID */ \
+ gfxw_container_t *parent; /* The parent widget, or NULL if not owned */ \
+ gfxw_visual_t *visual; /* The owner visual */ \
+ int widget_priority; /* Drawing priority, or -1 */ \
+ gfxw_point_op *draw; /* Draw widget (if dirty) and anything else required for the display to be consistant */ \
+ gfxw_op *widfree; /* Remove widget (and any sub-widgets it may contain) */ \
+ gfxw_op *tag; /* Tag the specified widget */ \
+ gfxw_op_int *print; /* Prints the widget's contents, using sciprintf. Second parameter is indentation. */ \
+ gfxw_bin_op *compare_to; /* a.compare_to(a, b) returns <0 if a<b, =0 if a=b and >0 if a>b */ \
+ gfxw_bin_op *equals; /* a equals b if both cause the same data to be displayed */ \
+ gfxw_bin_op *should_replace; /* (only if a equals b) Whether b should replace a even though they are equivalent */ \
+ gfxw_bin_op *superarea_of; /* a superarea_of b <=> for each pixel of b there exists an opaque pixel in a at the same location */ \
+ gfxw_visual_op *set_visual /* Sets the visual the widget belongs to */
struct gfxw_widget_t {
WIDGET_COMMON;
@@ -181,16 +181,16 @@ typedef int gfxw_container_op(gfxw_container_t *, gfxw_widget_t *);
typedef int gfxw_rect_op(gfxw_container_t *, rect_t, int);
#define WIDGET_CONTAINER \
- WIDGET_COMMON; \
- rect_t zone; /* The writeable zone (absolute) for contained objects */ \
- gfx_dirty_rect_t *dirty; /* List of dirty rectangles */ \
- gfxw_widget_t *contents; \
- gfxw_widget_t **nextpp; /* Pointer to the 'next' pointer in the last entry in contents */ \
- gfxw_unary_container_op *free_tagged; /* Free all tagged contained widgets */ \
- gfxw_unary_container_op *free_contents; /* Free all contained widgets */ \
- gfxw_rect_op *add_dirty_abs; /* Add an absolute dirty rectangle */ \
- gfxw_rect_op *add_dirty_rel; /* Add a relative dirty rectangle */ \
- gfxw_container_op *add /* Append widget to an appropriate position (for view and control lists) */
+ WIDGET_COMMON; \
+ rect_t zone; /* The writeable zone (absolute) for contained objects */ \
+ gfx_dirty_rect_t *dirty; /* List of dirty rectangles */ \
+ gfxw_widget_t *contents; \
+ gfxw_widget_t **nextpp; /* Pointer to the 'next' pointer in the last entry in contents */ \
+ gfxw_unary_container_op *free_tagged; /* Free all tagged contained widgets */ \
+ gfxw_unary_container_op *free_contents; /* Free all contained widgets */ \
+ gfxw_rect_op *add_dirty_abs; /* Add an absolute dirty rectangle */ \
+ gfxw_rect_op *add_dirty_rel; /* Add a relative dirty rectangle */ \
+ gfxw_container_op *add /* Append widget to an appropriate position (for view and control lists) */
struct gfxw_container_t {
diff --git a/engines/sci/gfx/gfx_support.cpp b/engines/sci/gfx/gfx_support.cpp
index 26acf988f5..9768bf67ba 100644
--- a/engines/sci/gfx/gfx_support.cpp
+++ b/engines/sci/gfx/gfx_support.cpp
@@ -229,31 +229,31 @@ void gfx_draw_box_pixmap_i(gfx_pixmap_t *pxm, rect_t box, int color) {
namespace Sci {
static void (*crossblit_fns[5])(byte *, byte *, int, int, int, int, byte *, int, int, unsigned int, unsigned int) = { NULL,
- _gfx_crossblit_8,
- _gfx_crossblit_16,
- _gfx_crossblit_24,
- _gfx_crossblit_32
+ _gfx_crossblit_8,
+ _gfx_crossblit_16,
+ _gfx_crossblit_24,
+ _gfx_crossblit_32
};
static void (*crossblit_fns_P[5])(byte *, byte *, int, int, int, int, byte *, int, int, unsigned int, unsigned int, byte *, int, int, int) = { NULL,
- _gfx_crossblit_8_P,
- _gfx_crossblit_16_P,
- _gfx_crossblit_24_P,
- _gfx_crossblit_32_P
+ _gfx_crossblit_8_P,
+ _gfx_crossblit_16_P,
+ _gfx_crossblit_24_P,
+ _gfx_crossblit_32_P
};
static void (*crossblit_fns_RA[5])(byte *, byte *, int, int, int, int, byte *, int, int, unsigned int, unsigned int) = { NULL,
- _gfx_crossblit_8_RA,
- _gfx_crossblit_16_RA,
- _gfx_crossblit_24_RA,
- _gfx_crossblit_32_RA
+ _gfx_crossblit_8_RA,
+ _gfx_crossblit_16_RA,
+ _gfx_crossblit_24_RA,
+ _gfx_crossblit_32_RA
};
static void (*crossblit_fns_P_RA[5])(byte *, byte *, int, int, int, int, byte *, int, int, unsigned int, unsigned int, byte *, int, int, int) = { NULL,
- _gfx_crossblit_8_P_RA,
- _gfx_crossblit_16_P_RA,
- _gfx_crossblit_24_P_RA,
- _gfx_crossblit_32_P_RA
+ _gfx_crossblit_8_P_RA,
+ _gfx_crossblit_16_P_RA,
+ _gfx_crossblit_24_P_RA,
+ _gfx_crossblit_32_P_RA
};
void _gfx_crossblit_simple(byte *dest, byte *src, int dest_line_width, int src_line_width, int xl, int yl, int bpp) {
diff --git a/engines/sci/gfx/gfx_system.h b/engines/sci/gfx/gfx_system.h
index 95d6c72534..b433d4f77a 100644
--- a/engines/sci/gfx/gfx_system.h
+++ b/engines/sci/gfx/gfx_system.h
@@ -52,7 +52,7 @@ namespace Sci {
/** Palette color description */
-struct gfx_palette_color_t {
+struct gfx_palette_color_t {
int lockers; /* Number of pixmaps holding a lock on that color.
** 0 means that the color is unused, -1 means that it is
diff --git a/engines/sci/gfx/gfx_test.cpp b/engines/sci/gfx/gfx_test.cpp
index 6a4e476f89..2987aab47e 100644
--- a/engines/sci/gfx/gfx_test.cpp
+++ b/engines/sci/gfx/gfx_test.cpp
@@ -192,7 +192,7 @@ arrdup(int *src, int count) {
int *
gfxr_interpreter_get_resources(gfx_resstate_t *resstate, gfx_resource_type_t type,
- int version, int *entries_nr, void *internal) {
+ int version, int *entries_nr, void *internal) {
switch (type) {
case GFX_RESOURCE_TYPE_VIEW:
@@ -295,7 +295,7 @@ gfxr_interpreter_clear_pic(int version, gfxr_pic_t *pic, void *internal) {
int
gfxr_interpreter_calculate_pic(gfx_resstate_t *state, gfxr_pic_t *scaled_pic, gfxr_pic_t *unscaled_pic,
- int flags, int default_palette, int nr, void *internal) {
+ int flags, int default_palette, int nr, void *internal) {
gfxr_pic_t *pic = scaled_pic;
int i, x, y, pos;
int xfact = pic->mode->xfact;
diff --git a/engines/sci/gfx/gfx_tools.cpp b/engines/sci/gfx/gfx_tools.cpp
index 99232e55ab..56338f4440 100644
--- a/engines/sci/gfx/gfx_tools.cpp
+++ b/engines/sci/gfx/gfx_tools.cpp
@@ -45,8 +45,8 @@ void gfx_clip_box_basic(rect_t *box, int maxx, int maxy) {
}
gfx_mode_t *gfx_new_mode(int xfact, int yfact, int bytespp, unsigned int red_mask, unsigned int green_mask,
- unsigned int blue_mask, unsigned int alpha_mask, int red_shift, int green_shift,
- int blue_shift, int alpha_shift, int palette, int flags) {
+ unsigned int blue_mask, unsigned int alpha_mask, int red_shift, int green_shift,
+ int blue_shift, int alpha_shift, int palette, int flags) {
gfx_mode_t *mode = (gfx_mode_t *)sci_malloc(sizeof(gfx_mode_t));
mode->xfact = xfact;
diff --git a/engines/sci/gfx/gfx_tools.h b/engines/sci/gfx/gfx_tools.h
index b02e437c26..b02b8bd88f 100644
--- a/engines/sci/gfx/gfx_tools.h
+++ b/engines/sci/gfx/gfx_tools.h
@@ -47,12 +47,12 @@ typedef enum {
extern int gfx_crossblit_alpha_threshold; /* Crossblitting functions use this value as threshold
- ** for distinguishing between transparent and opaque
+ ** for distinguishing between transparent and opaque
** wrt alpha values */
gfx_mode_t *gfx_new_mode(int xfact, int yfact, int bytespp, unsigned int red_mask, unsigned int green_mask,
- unsigned int blue_mask, unsigned int alpha_mask, int red_shift, int green_shift,
- int blue_shift, int alpha_shift, int palette, int flags);
+ unsigned int blue_mask, unsigned int alpha_mask, int red_shift, int green_shift,
+ int blue_shift, int alpha_shift, int palette, int flags);
/* Allocates a new gfx_mode_t structure with the specified parameters
** Parameters: (int x int) xfact x yfact: Horizontal and vertical scaling factors
** (int) bytespp: Bytes per pixel
@@ -150,7 +150,7 @@ void gfx_draw_line_pixmap_i(gfx_pixmap_t *pxm, Common::Point start, Common::Poin
*/
void gfx_draw_line_buffer(byte *buffer, int linewidth, int pixelwidth,
- Common::Point start, Common::Point end, unsigned int color);
+ Common::Point start, Common::Point end, unsigned int color);
/* Draws a line to a linear pixel buffer
** Parameters: (byte *) buffer: Pointer to the start of the buffer to draw to
** (int) linewidth: Number of bytes per pixel line in the buffer
@@ -202,10 +202,8 @@ void gfxr_antialiase(gfx_pixmap_t *pixmap, gfx_mode_t *mode, gfxr_antialiasing_t
** point corresponding to (dest.x, dest.y) */
int gfx_crossblit_pixmap(gfx_mode_t *mode, gfx_pixmap_t *pxm, int priority,
- rect_t src_coords, rect_t dest_coords, byte *dest,
- int dest_line_width, byte *priority_dest,
- int priority_line_width, int priority_skip,
- int flags);
+ rect_t src_coords, rect_t dest_coords, byte *dest, int dest_line_width,
+ byte *priority_dest, int priority_line_width, int priority_skip, int flags);
/* Transfers the non-transparent part of a pixmap to a linear pixel buffer
** Parameters: (gfx_mode_t *) mode: The graphics mode of the target buffer
** (gfx_pixmap_t *) pxm: The pixmap to transfer
diff --git a/engines/sci/gfx/gfx_widgets.h b/engines/sci/gfx/gfx_widgets.h
index 1c853648a6..ec2fc1612d 100644
--- a/engines/sci/gfx/gfx_widgets.h
+++ b/engines/sci/gfx/gfx_widgets.h
@@ -277,7 +277,7 @@ gfxw_primitive_t *gfxw_new_line(Common::Point start, Common::Point end, gfx_colo
#define GFXW_VIEW_FLAG_DONT_MODIFY_OFFSET (1 << 1)
gfxw_view_t *gfxw_new_view(gfx_state_t *state, Common::Point pos, int view, int loop, int cel, int palette, int priority, int control,
- gfx_alignment_t halign, gfx_alignment_t valign, int flags);
+ gfx_alignment_t halign, gfx_alignment_t valign, int flags);
/* Creates a new view (a cel, actually)
** Parameters: (gfx_state_t *) state: The graphics state
** (Common::Point) pos: The position to place the view at
@@ -291,8 +291,7 @@ gfxw_view_t *gfxw_new_view(gfx_state_t *state, Common::Point pos, int view, int
*/
gfxw_dyn_view_t *gfxw_new_dyn_view(gfx_state_t *state, Common::Point pos, int z, int view, int loop, int cel, int palette,
- int priority, int control, gfx_alignment_t halign, gfx_alignment_t valign,
- int sequence);
+ int priority, int control, gfx_alignment_t halign, gfx_alignment_t valign, int sequence);
/* Creates a new dyn view
** Parameters: (gfx_state_t *) state: The graphics state
** (Common::Point) pos: The position to place the dynamic view at
@@ -310,8 +309,8 @@ gfxw_dyn_view_t *gfxw_new_dyn_view(gfx_state_t *state, Common::Point pos, int z,
*/
gfxw_text_t *gfxw_new_text(gfx_state_t *state, rect_t area, int font, const char *text, gfx_alignment_t halign,
- gfx_alignment_t valign, gfx_color_t color1, gfx_color_t color2,
- gfx_color_t bgcolor, int flags);
+ gfx_alignment_t valign, gfx_color_t color1, gfx_color_t color2,
+ gfx_color_t bgcolor, int flags);
/* Creates a new text widget
** Parameters: (gfx_state_t *) state: The state the text is to be calculated from
** (rect_t) area: The area the text is to be confined to (the yl value is only
@@ -327,7 +326,7 @@ gfxw_text_t *gfxw_new_text(gfx_state_t *state, rect_t area, int font, const char
*/
void gfxw_text_info(gfx_state_t *state, gfxw_text_t *text, int *lines_nr,
- int *lineheight, int *offset);
+ int *lineheight, int *offset);
/* Determines text widget meta-information
** Parameters: (gfx_state_t *) state: The state to operate on
** (gfx_text_t *) text: The widget to query
@@ -438,7 +437,7 @@ gfxw_port_t *gfxw_find_default_port(gfxw_visual_t *visual);
void gfxw_port_set_auto_restore(gfxw_visual_t *visual, gfxw_port_t *window, rect_t auto_rect);
/* Sets rectangle to be restored upon port removal
** Parameters: (state_t *) s: The state to operate on
- (gfxw_port_t *) window: The affected window
+** (gfxw_port_t *) window: The affected window
** (rect_t) auto_rect: The area to restore
** Returns : (void)
*/
diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp
index 70734cc3d5..16fbdec4a1 100644
--- a/engines/sci/gfx/operations.cpp
+++ b/engines/sci/gfx/operations.cpp
@@ -36,7 +36,7 @@ namespace Sci {
#define PRECISE_PRIORITY_MAP // Duplicate all operations on the local priority map as appropriate
-#undef GFXW_DEBUG_DIRTY
+#undef GFXW_DEBUG_DIRTY
// Enable to debug stuff relevant for dirty rectsin widget management
#ifdef GFXW_DEBUG_DIRTY
@@ -251,7 +251,7 @@ static int _gfxop_install_pixmap(gfx_driver_t *driver, gfx_pixmap_t *pxm) {
}
static int _gfxop_draw_pixmap(gfx_driver_t *driver, gfx_pixmap_t *pxm, int priority, int control,
- rect_t src, rect_t dest, rect_t clip, int static_buf, gfx_pixmap_t *control_map, gfx_pixmap_t *priority_map) {
+ rect_t src, rect_t dest, rect_t clip, int static_buf, gfx_pixmap_t *control_map, gfx_pixmap_t *priority_map) {
int error;
rect_t clipped_dest = gfx_rect(dest.x, dest.y, dest.xl, dest.yl);
@@ -577,7 +577,7 @@ int gfxop_init_default(gfx_state_t *state, gfx_options_t *options, void *misc_in
}
int gfxop_init(gfx_state_t *state, int xfact, int yfact, gfx_color_mode_t bpp,
- gfx_options_t *options, void *misc_info) {
+ gfx_options_t *options, void *misc_info) {
int color_depth = bpp ? bpp : 1;
int initialized = 0;
@@ -974,7 +974,7 @@ static int simulate_stippled_line_draw(gfx_driver_t *driver, int skipone, Common
}
static int _gfxop_draw_line_clipped(gfx_state_t *state, Common::Point start, Common::Point end, gfx_color_t color, gfx_line_mode_t line_mode,
- gfx_line_style_t line_style) {
+ gfx_line_style_t line_style) {
int retval;
int skipone = (start.x ^ end.y) & 1; // Used for simulated line stippling
@@ -1013,7 +1013,7 @@ static int _gfxop_draw_line_clipped(gfx_state_t *state, Common::Point start, Com
}
int gfxop_draw_line(gfx_state_t *state, Common::Point start, Common::Point end,
- gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style) {
+ gfx_color_t color, gfx_line_mode_t line_mode, gfx_line_style_t line_style) {
int xfact, yfact;
BASIC_CHECKS(GFX_FATAL);
@@ -1077,7 +1077,7 @@ int gfxop_draw_rectangle(gfx_state_t *state, rect_t rect, gfx_color_t color, gfx
lower_left = Common::Point(x, y + yl);
lower_right = Common::Point(x + xl, y + yl);
-#define PARTIAL_LINE(pt1, pt2) \
+#define PARTIAL_LINE(pt1, pt2) \
retval |= _gfxop_draw_line_clipped(state, pt1, pt2, color, line_mode, line_style); \
draw_line_to_control_map(state, pt1##_u, pt2##_u, color); \
_gfxop_add_dirty_x(state, gfx_rect(pt1##_u.x, pt1##_u.y, pt2##_u.x - pt1##_u.x, pt2##_u.y - pt1##_u.y))
@@ -1222,7 +1222,7 @@ static int _gfxop_buffer_propagate_box(gfx_state_t *state, rect_t box, gfx_buffe
return GFX_OK;
}
-extern int sci0_palette;
+extern int sci0_palette;
int gfxop_clear_box(gfx_state_t *state, rect_t box) {
BASIC_CHECKS(GFX_FATAL);
@@ -1932,18 +1932,18 @@ int gfxop_get_text_params(gfx_state_t *state, int font_nr, const char *text, int
}
#define COL_XLATE(des,src) \
- des = src.visual; /* The new gfx_color_t structure makes things a lot easier :-) */ /* \
- if (gfxop_set_color(state, &src, \
- src.visual.r, \
- src.visual.g, \
- src.visual.b, \
- src.alpha, \
- src.priority, \
- src.control)) \
- { \
- GFXERROR("Unable to set up colors"); \
- return NULL; \
- }
+ des = src.visual; /* The new gfx_color_t structure makes things a lot easier :-) */ /* \
+ if (gfxop_set_color(state, &src, \
+ src.visual.r, \
+ src.visual.g, \
+ src.visual.b, \
+ src.alpha, \
+ src.priority, \
+ src.control)) \
+ { \
+ GFXERROR("Unable to set up colors"); \
+ return NULL; \
+ }
*/
gfx_text_handle_t *gfxop_new_text(gfx_state_t *state, int font_nr, char *text, int maxwidth, gfx_alignment_t halign,
diff --git a/engines/sci/gfx/resmgr.cpp b/engines/sci/gfx/resmgr.cpp
index c722175b12..9b61aa4028 100644
--- a/engines/sci/gfx/resmgr.cpp
+++ b/engines/sci/gfx/resmgr.cpp
@@ -81,20 +81,20 @@ gfx_resstate_t *gfxr_new_resource_manager(int version, gfx_options_t *options, g
}
#define FREEALL(freecmd, type) \
- if (resource->scaled_data.type) \
- freecmd(driver, resource->scaled_data.type); \
- resource->scaled_data.type = NULL; \
- if (resource->unscaled_data.type) \
- freecmd(driver, resource->unscaled_data.type); \
- resource->unscaled_data.type = NULL;
+ if (resource->scaled_data.type) \
+ freecmd(driver, resource->scaled_data.type); \
+ resource->scaled_data.type = NULL; \
+ if (resource->unscaled_data.type) \
+ freecmd(driver, resource->unscaled_data.type); \
+ resource->unscaled_data.type = NULL;
#define FREEALL_SIMPLE(freecmd, type) \
- if (resource->scaled_data.type) \
- freecmd(resource->scaled_data.type); \
- resource->scaled_data.type = NULL; \
- if (resource->unscaled_data.type) \
- freecmd(resource->unscaled_data.type); \
- resource->unscaled_data.type = NULL;
+ if (resource->scaled_data.type) \
+ freecmd(resource->scaled_data.type); \
+ resource->scaled_data.type = NULL; \
+ if (resource->unscaled_data.type) \
+ freecmd(resource->unscaled_data.type); \
+ resource->unscaled_data.type = NULL;
void gfxr_free_resource(gfx_driver_t *driver, gfx_resource_t *resource, int type) {
if (!resource)
@@ -227,13 +227,13 @@ void gfxr_free_tagged_resources(gfx_driver_t *driver, gfx_resstate_t *state) {
if (maps & key) { \
if (res->unscaled_data.pic&& (force || !res->unscaled_data.pic->entry->data)) { \
if (key == GFX_MASK_VISUAL) \
- gfx_get_res_config(options, res->unscaled_data.pic->entry); \
+ gfx_get_res_config(options, res->unscaled_data.pic->entry); \
gfx_xlate_pixmap(res->unscaled_data.pic->entry, mode, filter); \
} if (scaled && res->scaled_data.pic && (force || !res->scaled_data.pic->entry->data)) { \
if (key == GFX_MASK_VISUAL) \
- gfx_get_res_config(options, res->scaled_data.pic->entry); \
- gfx_xlate_pixmap(res->scaled_data.pic->entry, mode, filter); \
- } \
+ gfx_get_res_config(options, res->scaled_data.pic->entry); \
+ gfx_xlate_pixmap(res->scaled_data.pic->entry, mode, filter); \
+ } \
}
static gfxr_pic_t *gfxr_pic_xlate_common(gfx_resource_t *res, int maps, int scaled, int force, gfx_mode_t *mode,
diff --git a/engines/sci/gfx/resource/sci_pic_0.cpp b/engines/sci/gfx/resource/sci_pic_0.cpp
index 392996d4e5..d64e46f32d 100644
--- a/engines/sci/gfx/resource/sci_pic_0.cpp
+++ b/engines/sci/gfx/resource/sci_pic_0.cpp
@@ -45,7 +45,7 @@ int sci0_palette = 0;
// Copied from include/kernel.h
#define SCI0_PRIORITY_BAND_FIRST_14_ZONES(nr) ((((nr) == 0)? 0 : \
- ((first) + (((nr)-1) * (last - first)) / 14)))
+ ((first) + (((nr)-1) * (last - first)) / 14)))
// Default color maps
gfx_pixmap_color_t gfx_sci0_image_colors[SCI0_MAX_PALETTE+1][GFX_SCI0_IMAGE_COLORS_NR] = {
@@ -202,22 +202,22 @@ void gfxr_clear_pic0(gfxr_pic_t *pic, int sci_titlebar_size) {
#define LINEMACRO(startx, starty, deltalinear, deltanonlinear, linearvar, nonlinearvar, \
linearend, nonlinearstart, linearmod, nonlinearmod, operation) \
- x = (startx); y = (starty); \
- incrNE = ((deltalinear) > 0)? (deltalinear) : -(deltalinear); \
- incrNE <<= 1; \
- deltanonlinear <<= 1; \
- incrE = ((deltanonlinear) > 0) ? -(deltanonlinear) : (deltanonlinear); \
- d = nonlinearstart-1; \
- while (linearvar != (linearend)) { \
- buffer[linewidth * y + x] operation color; \
+ x = (startx); y = (starty); \
+ incrNE = ((deltalinear) > 0)? (deltalinear) : -(deltalinear); \
+ incrNE <<= 1; \
+ deltanonlinear <<= 1; \
+ incrE = ((deltanonlinear) > 0) ? -(deltanonlinear) : (deltanonlinear); \
+ d = nonlinearstart-1; \
+ while (linearvar != (linearend)) { \
+ buffer[linewidth * y + x] operation color; \
/* color ^= color2; color2 ^= color; color ^= color2; */ /* Swap colors */ \
- linearvar += linearmod; \
- if ((d+=incrE) < 0) { \
- d += incrNE; \
- nonlinearvar += nonlinearmod; \
- }; \
- }; \
- buffer[linewidth * y + x] operation color;
+ linearvar += linearmod; \
+ if ((d+=incrE) < 0) { \
+ d += incrNE; \
+ nonlinearvar += nonlinearmod; \
+ }; \
+ }; \
+ buffer[linewidth * y + x] operation color;
static void _gfxr_auxbuf_line_draw(gfxr_pic_t *pic, rect_t line, int color, int color2, int sci_titlebar_size) {
int dx, dy, incrE, incrNE, d, finalx, finaly;
@@ -556,7 +556,7 @@ enum {
};
static void _gfxr_fill_ellipse(gfxr_pic_t *pic, byte *buffer, int linewidth, int x, int y,
- int rad_x, int rad_y, int color, int fillstyle) {
+ int rad_x, int rad_y, int color, int fillstyle) {
int xx = 0, yy = rad_y;
int i, x_i, y_i;
int xr = 2 * rad_x * rad_x;
@@ -621,7 +621,7 @@ static void _gfxr_fill_ellipse(gfxr_pic_t *pic, byte *buffer, int linewidth, int
}
static inline void _gfxr_auxplot_brush(gfxr_pic_t *pic, byte *buffer, int yoffset, int offset, int plot,
- int color, gfx_brush_mode_t brush_mode, int randseed) {
+ int color, gfx_brush_mode_t brush_mode, int randseed) {
// yoffset 63680, offset 320, plot 1, color 34, brush_mode 0, randseed 432)*/
// Auxplot: Used by plot_aux_pattern to plot to visual and priority
int xc, yc;
@@ -690,7 +690,7 @@ static inline void _gfxr_auxplot_brush(gfxr_pic_t *pic, byte *buffer, int yoffse
#define PLOT_AUX_PATTERN_NO_RANDOM -1
static void _gfxr_plot_aux_pattern(gfxr_pic_t *pic, int x, int y, int size, int circle, int random,
- int mask, int color, int priority, int control, gfx_brush_mode_t brush_mode, int map_nr) {
+ int mask, int color, int priority, int control, gfx_brush_mode_t brush_mode, int map_nr) {
// Plots an appropriate pattern to the aux buffer and the control buffer,
// if mask & GFX_MASK_CONTROL
// random should be set to the random index, or -1 to disable
@@ -813,7 +813,7 @@ static void _gfxr_plot_aux_pattern(gfxr_pic_t *pic, int x, int y, int size, int
}
static void _gfxr_draw_pattern(gfxr_pic_t *pic, int x, int y, int color, int priority, int control, int drawenable,
- int pattern_code, int pattern_size, int pattern_nr, gfx_brush_mode_t brush_mode, int sci_titlebar_size) {
+ int pattern_code, int pattern_size, int pattern_nr, gfx_brush_mode_t brush_mode, int sci_titlebar_size) {
int xsize = (pattern_size + 1) * pic->mode->xfact - 1;
int ysize = (pattern_size + 1) * pic->mode->yfact - 1;
int scaled_x, scaled_y;
@@ -928,7 +928,7 @@ static inline void _gfxr_draw_subline(gfxr_pic_t *pic, int x, int y, int ex, int
}
static void _gfxr_draw_line(gfxr_pic_t *pic, int x, int y, int ex, int ey, int color,
- int priority, int control, int drawenable, int line_mode, int cmd, int sci_titlebar_size) {
+ int priority, int control, int drawenable, int line_mode, int cmd, int sci_titlebar_size) {
int scale_x = pic->mode->xfact;
int scale_y = pic->mode->yfact;
int xc, yc;
@@ -1060,7 +1060,7 @@ static void _gfxr_draw_line(gfxr_pic_t *pic, int x, int y, int ex, int ey, int c
}
static inline int _gfxr_find_fill_point(gfxr_pic_t *pic, int min_x, int min_y, int max_x, int max_y, int x_320,
- int y_200, int color, int drawenable, int *x, int *y) {
+ int y_200, int color, int drawenable, int *x, int *y) {
// returns -1 on failure, 0 on success
int linewidth = pic->mode->xfact * 320;
int mpos, ix, iy;
@@ -1083,7 +1083,7 @@ static inline int _gfxr_find_fill_point(gfxr_pic_t *pic, int min_x, int min_y, i
test_map = pic->visual_map->index_data;
if ((color & 0xf) == 0xf // When dithering with white, do more
- // conservative checks
+ // conservative checks
|| (color & 0xf0) == 0xf0)
legalcolor = 0xff;
else
@@ -1127,7 +1127,7 @@ static inline int _gfxr_find_fill_point(gfxr_pic_t *pic, int min_x, int min_y, i
#undef TEST_POINT
} // End of namespace Sci
-
+
// Now include the actual filling code (with scaling support)
#define FILL_FUNCTION _gfxr_fill_any
#define FILL_FUNCTION_RECURSIVE _gfxr_fill_any_recursive
@@ -1145,9 +1145,9 @@ static inline int _gfxr_find_fill_point(gfxr_pic_t *pic, int min_x, int min_y, i
namespace Sci {
#endif // defined(WITH_PIC_SCALING)
-
+
} // End of namespace Sci
-
+
// Include again, but this time without support for scaling
#define FILL_FUNCTION _gfxr_fill_1
#define FILL_FUNCTION_RECURSIVE _gfxr_fill_1_recursive
@@ -1175,7 +1175,7 @@ namespace Sci {
x -= ((temp >> 4) & 0x7); \
else \
x += (temp >> 4); \
- \
+ \
if (temp & 0x08) \
y -= (temp & 0x7); \
else \
@@ -1666,7 +1666,7 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size,
// we can only safely replace the palette if it's static
// *if it's not for some reason, we should die
-
+
if (!(view->flags & GFX_PIXMAP_FLAG_EXTERNAL_PALETTE) && !sci1) {
sciprintf("gfx_draw_pic0(): can't set a non-static palette for an embedded view!\n");
}
diff --git a/engines/sci/gfx/resource/sci_picfill.cpp b/engines/sci/gfx/resource/sci_picfill.cpp
index 0867b84c6e..73b2b83e7d 100644
--- a/engines/sci/gfx/resource/sci_picfill.cpp
+++ b/engines/sci/gfx/resource/sci_picfill.cpp
@@ -62,7 +62,7 @@ namespace Sci {
#endif
static void FILL_FUNCTION_RECURSIVE(gfxr_pic_t *pic, int old_xl, int old_xr, int y, int dy, byte *bounds,
- int legalcolor, int legalmask, int color, int priority, int drawenable, int sci_titlebar_size) {
+ int legalcolor, int legalmask, int color, int priority, int drawenable, int sci_titlebar_size) {
int linewidth = pic->mode->xfact * 320;
int miny = pic->mode->yfact * sci_titlebar_size;
int maxy = pic->mode->yfact * 200;
@@ -265,7 +265,7 @@ static void FILL_FUNCTION_RECURSIVE(gfxr_pic_t *pic, int old_xl, int old_xr, int
static void FILL_FUNCTION(gfxr_pic_t *pic, int x_320, int y_200, int color, int priority, int control, int drawenable,
- int sci_titlebar_size) {
+ int sci_titlebar_size) {
int linewidth = pic->mode->xfact * 320;
int x, y;
int xl, xr;
diff --git a/engines/sci/gfx/resource/sci_picfill_aux.cpp b/engines/sci/gfx/resource/sci_picfill_aux.cpp
index f7deff27fa..98fd5bbb2a 100644
--- a/engines/sci/gfx/resource/sci_picfill_aux.cpp
+++ b/engines/sci/gfx/resource/sci_picfill_aux.cpp
@@ -40,7 +40,7 @@ namespace Sci {
#define CLIPMASK_HARD_BOUND 0x80 /* ensures that we don't re-fill filled stuff */
static void AUXBUF_FILL_HELPER(gfxr_pic_t *pic, int old_xl, int old_xr, int y, int dy,
- int clipmask, int control, int sci_titlebar_size) {
+ int clipmask, int control, int sci_titlebar_size) {
int xl, xr;
int oldytotal = y * 320;
#ifdef DRAW_SCALED
@@ -72,7 +72,7 @@ static void AUXBUF_FILL_HELPER(gfxr_pic_t *pic, int old_xl, int old_xr, int y, i
if ((ytotal + xl) < 0) {
fprintf(stderr, "AARGH-%d\n", __LINE__);
- BREAKPOINT();
+ BREAKPOINT();
}
xr = xl;
diff --git a/engines/sci/gfx/resource/sci_resmgr.cpp b/engines/sci/gfx/resource/sci_resmgr.cpp
index 734c91e2c3..d64b777afa 100644
--- a/engines/sci/gfx/resource/sci_resmgr.cpp
+++ b/engines/sci/gfx/resource/sci_resmgr.cpp
@@ -69,7 +69,7 @@ void gfxr_interpreter_clear_pic(int version, gfxr_pic_t *pic, void *internal) {
}
int gfxr_interpreter_calculate_pic(gfx_resstate_t *state, gfxr_pic_t *scaled_pic, gfxr_pic_t *unscaled_pic,
- int flags, int default_palette, int nr, void *internal) {
+ int flags, int default_palette, int nr, void *internal) {
ResourceManager *resmgr = (ResourceManager *)state->misc_payload;
resource_t *res = scir_find_resource(resmgr, sci_pic, nr, 0);
int need_unscaled = unscaled_pic != NULL;
diff --git a/engines/sci/gfx/resource/sci_view_1.cpp b/engines/sci/gfx/resource/sci_view_1.cpp
index 7af584bcfe..48c204cf43 100644
--- a/engines/sci/gfx/resource/sci_view_1.cpp
+++ b/engines/sci/gfx/resource/sci_view_1.cpp
@@ -51,7 +51,7 @@ namespace Sci {
literal_pos += n;
static int decompress_sci_view(int id, int loop, int cel, byte *resource, byte *dest, int mirrored, int pixmap_size, int size,
- int runlength_pos, int literal_pos, int xl, int yl, int color_key) {
+ int runlength_pos, int literal_pos, int xl, int yl, int color_key) {
int writepos = mirrored ? xl : 0;
if (mirrored) {
@@ -178,7 +178,7 @@ static int decompress_sci_view(int id, int loop, int cel, byte *resource, byte *
}
static int decompress_sci_view_amiga(int id, int loop, int cel, byte *resource, byte *dest, int mirrored, int pixmap_size, int size,
- int pos, int xl, int yl, int color_key) {
+ int pos, int xl, int yl, int color_key) {
int writepos = mirrored ? xl - 1 : 0;
while (writepos < pixmap_size && pos < size) {
@@ -315,7 +315,7 @@ static int gfxr_draw_loop1(gfxr_loop_t *dest, int id, int loop, int mirrored, by
//static byte view_magics[V1_MAGICS_NR] = {0x80, 0x00, 0x00, 0x00, 0x00};
gfxr_view_t *gfxr_draw_view1(int id, byte *resource, int size, gfx_pixmap_color_t *static_pal,
- int static_pal_nr) {
+ int static_pal_nr) {
int i;
int palette_offset;
gfxr_view_t *view;
@@ -457,7 +457,7 @@ gfx_pixmap_t *gfxr_draw_cel11(int id, int loop, int cel, int mirrored, byte *res
}
gfxr_loop_t *gfxr_draw_loop11(int id, int loop, int mirrored, byte *resource_base, byte *loop_base, int size, int cels_nr,
- gfxr_loop_t *result, gfxr_view_t *view, int bytes_per_cel) {
+ gfxr_loop_t *result, gfxr_view_t *view, int bytes_per_cel) {
byte *seeker = loop_base;
int i;
diff --git a/engines/sci/gfx/sbtree.h b/engines/sci/gfx/sbtree.h
index 9165b71335..4b02eb1e54 100644
--- a/engines/sci/gfx/sbtree.h
+++ b/engines/sci/gfx/sbtree.h
@@ -84,7 +84,7 @@ void *sbtree_get(sbtree_t *tree, int key);
*/
void sbtree_foreach(sbtree_t *tree, void *args, void *(*operation)(sbtree_t *, const int,
- const void *, void *));
+ const void *, void *));
/* Operates once on each entry in the tree
** Parameters: (sbtree_t *) tree: The tree to operate on
** (void *) arguments: Additional arguments to pass to 'operation'
diff --git a/engines/sci/gfx/sci_widgets.cpp b/engines/sci/gfx/sci_widgets.cpp
index 76bace3960..398f315285 100644
--- a/engines/sci/gfx/sci_widgets.cpp
+++ b/engines/sci/gfx/sci_widgets.cpp
@@ -128,7 +128,7 @@ static void sciw_make_window_fit(rect_t *rect, gfxw_port_t *parent) {
}
gfxw_port_t *sciw_new_window(EngineState *s, rect_t area, int font, gfx_color_t color, gfx_color_t bgcolor,
- int title_font, gfx_color_t title_color, gfx_color_t title_bgcolor, const char *title, int flags) {
+ int title_font, gfx_color_t title_color, gfx_color_t title_bgcolor, const char *title, int flags) {
gfxw_visual_t *visual = s->visual;
gfx_state_t *state = s->gfx_state;
int shadow_offset = 2;
@@ -260,7 +260,7 @@ static inline rect_t _move_and_extend_rect(rect_t rect, Common::Point point, int
}
gfxw_list_t *_sciw_add_text_to_list(gfxw_list_t *list, gfxw_port_t *port, rect_t zone, char *text,
- int font, gfx_alignment_t align, char framed, char inverse, int flags, char gray_text) {
+ int font, gfx_alignment_t align, char framed, char inverse, int flags, char gray_text) {
gfx_color_t *color1, *color2, *bgcolor;
if (inverse) {
@@ -407,7 +407,7 @@ gfxw_list_t *sciw_new_edit_control(gfxw_port_t *port, reg_t ID, rect_t zone, cha
}
gfxw_list_t *sciw_new_icon_control(gfxw_port_t *port, reg_t ID, rect_t zone, int view, int loop, int cel,
- char frame, char inverse) {
+ char frame, char inverse) {
gfxw_list_t *list = gfxw_new_list(_move_and_extend_rect(zone, Common::Point(port->zone.x, port->zone.y), 1), 0);
gfxw_widget_t *icon;
gfxw_set_id(GFXW(list), ID.segment, ID.offset);
@@ -436,7 +436,7 @@ gfxw_list_t *sciw_new_icon_control(gfxw_port_t *port, reg_t ID, rect_t zone, int
}
gfxw_list_t *sciw_new_list_control(gfxw_port_t *port, reg_t ID, rect_t zone, int font_nr, char **entries_list,
- int entries_nr, int list_top, int selection, char inverse) {
+ int entries_nr, int list_top, int selection, char inverse) {
gfxw_list_t *list;
char arr_up[2], arr_down[2];
diff --git a/engines/sci/gfx/widgets.cpp b/engines/sci/gfx/widgets.cpp
index e9079c1a5c..93aedcc68d 100644
--- a/engines/sci/gfx/widgets.cpp
+++ b/engines/sci/gfx/widgets.cpp
@@ -182,7 +182,7 @@ static inline int verify_widget(gfxw_widget_t *widget) {
}
#define VERIFY_WIDGET(w) \
- if (verify_widget((gfxw_widget_t *)(w))) { GFXERROR("Error occured while validating widget\n"); }
+ if (verify_widget((gfxw_widget_t *)(w))) { GFXERROR("Error occured while validating widget\n"); }
static void _gfxw_unallocate_widget(gfx_state_t *state, gfxw_widget_t *widget) {
if (GFXW_IS_TEXT(widget)) {
@@ -205,15 +205,15 @@ static void _gfxw_unallocate_widget(gfx_state_t *state, gfxw_widget_t *widget) {
}
#define GFX_ASSERT(_x) \
- { \
- int retval = (_x); \
- if (retval == GFX_ERROR) { \
- GFXERROR("Error occured while drawing widget!\n"); \
- return 1; \
- } else if (retval == GFX_FATAL) { \
- error("Fatal error occured while drawing widget!\nGraphics state invalid; aborting program..."); \
- } \
- }
+{ \
+ int retval = (_x); \
+ if (retval == GFX_ERROR) { \
+ GFXERROR("Error occured while drawing widget!\n"); \
+ return 1; \
+ } else if (retval == GFX_FATAL) { \
+ error("Fatal error occured while drawing widget!\nGraphics state invalid; aborting program..."); \
+ } \
+}
//********** Widgets *************
@@ -281,7 +281,7 @@ static int _gfxwop_basic_should_replace(gfxw_widget_t *widget, gfxw_widget_t *ot
}
static inline void _gfxw_set_ops(gfxw_widget_t *widget, gfxw_point_op *draw, gfxw_op *free, gfxw_op *tag, gfxw_op_int *print,
- gfxw_bin_op *compare_to, gfxw_bin_op *equals, gfxw_bin_op *superarea_of) {
+ gfxw_bin_op *compare_to, gfxw_bin_op *equals, gfxw_bin_op *superarea_of) {
widget->draw = draw;
widget->widfree = free;
widget->tag = tag;
@@ -699,7 +699,7 @@ void _gfxw_set_ops_VIEW(gfxw_widget_t *view, char stat) {
}
gfxw_view_t *gfxw_new_view(gfx_state_t *state, Common::Point pos, int view_nr, int loop, int cel, int palette, int priority, int control,
- gfx_alignment_t halign, gfx_alignment_t valign, int flags) {
+ gfx_alignment_t halign, gfx_alignment_t valign, int flags) {
gfxw_view_t *view;
if (flags & GFXW_VIEW_FLAG_DONT_MODIFY_OFFSET) {
@@ -841,7 +841,7 @@ void _gfxw_set_ops_PICVIEW(gfxw_widget_t *widget) {
}
gfxw_dyn_view_t *gfxw_new_dyn_view(gfx_state_t *state, Common::Point pos, int z, int view, int loop, int cel, int palette, int priority, int control,
- gfx_alignment_t halign, gfx_alignment_t valign, int sequence) {
+ gfx_alignment_t halign, gfx_alignment_t valign, int sequence) {
gfxw_dyn_view_t *widget;
int width, height;
int xalignmod, yalignmod;
@@ -992,7 +992,7 @@ void _gfxw_set_ops_TEXT(gfxw_widget_t *widget) {
}
gfxw_text_t *gfxw_new_text(gfx_state_t *state, rect_t area, int font, const char *text, gfx_alignment_t halign,
- gfx_alignment_t valign, gfx_color_t color1, gfx_color_t color2, gfx_color_t bgcolor, int text_flags) {
+ gfx_alignment_t valign, gfx_color_t color1, gfx_color_t color2, gfx_color_t bgcolor, int text_flags) {
gfxw_text_t *widget = (gfxw_text_t *)_gfxw_new_widget(sizeof(gfxw_text_t), GFXW_TEXT);
widget->widget_priority = _gfxw_color_get_priority(color1);
@@ -1047,10 +1047,10 @@ static int _gfxwop_container_add_dirty_rel(gfxw_container_t *cont, rect_t rect,
}
static inline void _gfxw_set_container_ops(gfxw_container_t *container, gfxw_point_op *draw, gfxw_op *free, gfxw_op *tag,
- gfxw_op_int *print, gfxw_bin_op *compare_to, gfxw_bin_op *equals,
- gfxw_bin_op *superarea_of, gfxw_visual_op *set_visual,
- gfxw_unary_container_op *free_tagged, gfxw_unary_container_op *free_contents,
- gfxw_rect_op *add_dirty, gfxw_container_op *add) {
+ gfxw_op_int *print, gfxw_bin_op *compare_to, gfxw_bin_op *equals,
+ gfxw_bin_op *superarea_of, gfxw_visual_op *set_visual,
+ gfxw_unary_container_op *free_tagged, gfxw_unary_container_op *free_contents,
+ gfxw_rect_op *add_dirty, gfxw_container_op *add) {
_gfxw_set_ops(GFXW(container), draw, free, tag, print, compare_to, equals, superarea_of);
container->free_tagged = free_tagged;
diff --git a/engines/sci/include/kernel.h b/engines/sci/include/kernel.h
index d1c54d1994..c5d6452610 100644
--- a/engines/sci/include/kernel.h
+++ b/engines/sci/include/kernel.h
@@ -79,7 +79,7 @@ struct abs_rect_t {
#define INV_SEL(_object_, _selector_, _noinvalid_) \
- s, _object_, s->selector_map._selector_, _noinvalid_, funct_nr, argv, argc, __FILE__, __LINE__
+ s, _object_, s->selector_map._selector_, _noinvalid_, funct_nr, argv, argc, __FILE__, __LINE__
/* Kludge for use with invoke_selector(). Used for compatibility with compilers that can't
** handle vararg macros.
*/
@@ -88,7 +88,7 @@ struct abs_rect_t {
reg_t read_selector(EngineState *s, reg_t object, selector_t selector_id, const char *fname, int line);
void write_selector(EngineState *s, reg_t object, selector_t selector_id, reg_t value, const char *fname, int line);
int invoke_selector(EngineState *s, reg_t object, int selector_id, int noinvalid, int kfunct,
- stack_ptr_t k_argp, int k_argc, const char *fname, int line, int argc, ...);
+ stack_ptr_t k_argp, int k_argc, const char *fname, int line, int argc, ...);
/******************** Text functionality ********************/
@@ -111,15 +111,15 @@ char *kernel_lookup_text(EngineState *s, reg_t address, int index);
#ifdef SCI_KERNEL_DEBUG
#define CHECK_THIS_KERNEL_FUNCTION if (s->debug_mode & (1 << SCIkFUNCCHK_NR)) {\
- int i;\
- sciprintf("Kernel CHECK: %s[%x](", s->kernel_names[funct_nr], funct_nr); \
- for (i = 0; i < argc; i++) { \
- sciprintf("%04x", 0xffff & UKPV(i)); \
- if (i+1 < argc) sciprintf(", "); \
- } \
- sciprintf(")\n"); \
+ int i;\
+ sciprintf("Kernel CHECK: %s[%x](", s->kernel_names[funct_nr], funct_nr); \
+ for (i = 0; i < argc; i++) { \
+ sciprintf("%04x", 0xffff & UKPV(i)); \
+ if (i+1 < argc) sciprintf(", "); \
+ } \
+ sciprintf(")\n"); \
} \
-
+
#else /* !SCI_KERNEL_DEBUG */
#define CHECK_THIS_KERNEL_FUNCTION
@@ -200,13 +200,13 @@ int _find_view_priority(EngineState *s, int y);
+ ((((y) - s->priority_first) * 14) / (s->priority_last - s->priority_first))))
#define SCI0_PRIORITY_BAND_FIRST_14_ZONES(nr) ((((nr) == 0)? 0 : \
- ((s->priority_first) + (((nr)-1) * (s->priority_last - s->priority_first)) / 14)))
+ ((s->priority_first) + (((nr)-1) * (s->priority_last - s->priority_first)) / 14)))
#define SCI0_VIEW_PRIORITY(y) (((y) < s->priority_first)? 0 : (((y) >= s->priority_last)? 14 : 1\
+ ((((y) - s->priority_first) * 15) / (s->priority_last - s->priority_first))))
#define SCI0_PRIORITY_BAND_FIRST(nr) ((((nr) == 0)? 0 : \
- ((s->priority_first) + (((nr)-1) * (s->priority_last - s->priority_first)) / 15)))
+ ((s->priority_first) + (((nr)-1) * (s->priority_last - s->priority_first)) / 15)))
#define VIEW_PRIORITY(y) _find_view_priority(s, y)
#define PRIORITY_BAND_FIRST(nr) _find_priority_band(s, nr)
diff --git a/engines/sci/include/list.h b/engines/sci/include/list.h
index ec5e15ec67..cc7c2530ed 100644
--- a/engines/sci/include/list.h
+++ b/engines/sci/include/list.h
@@ -106,7 +106,7 @@ struct { \
#define LIST_REMOVE(elm, field) do { \
if ((elm)->field.le_next != NULL) \
- (elm)->field.le_next->field.le_prev = \
+ (elm)->field.le_next->field.le_prev = \
(elm)->field.le_prev; \
*(elm)->field.le_prev = (elm)->field.le_next; \
} while (0)
diff --git a/engines/sci/include/sci_widgets.h b/engines/sci/include/sci_widgets.h
index 4c03b072de..4fefd43d70 100644
--- a/engines/sci/include/sci_widgets.h
+++ b/engines/sci/include/sci_widgets.h
@@ -71,8 +71,8 @@ void sciw_set_status_bar(EngineState *s, gfxw_port_t *status_bar, char *text, in
*/
gfxw_port_t *sciw_new_window(EngineState *s, rect_t area, int font, gfx_color_t color, gfx_color_t bgcolor,
- int title_font, gfx_color_t title_color, gfx_color_t title_bg_color,
- const char *title, int flags);
+ int title_font, gfx_color_t title_color, gfx_color_t title_bg_color,
+ const char *title, int flags);
/* Creates a new SCI style window
** Parameters: (EngineState *) s: The affected game state
** (rect_t) area: The screen area to frame (not including a potential window title)
@@ -106,7 +106,7 @@ gfxw_list_t *sciw_new_button_control(gfxw_port_t *port, reg_t ID, rect_t zone, c
*/
gfxw_list_t *sciw_new_text_control(gfxw_port_t *port, reg_t ID, rect_t zone, char *text, int font,
- gfx_alignment_t align, char frame, char inverse);
+ gfx_alignment_t align, char frame, char inverse);
/* Creates a new text control list
** Parameters: (gfxw_port_t *) port: The port containing the color values to use
** (reg_t) ID: Text widget ID
@@ -120,7 +120,7 @@ gfxw_list_t *sciw_new_text_control(gfxw_port_t *port, reg_t ID, rect_t zone, cha
*/
gfxw_list_t *sciw_new_edit_control(gfxw_port_t *port, reg_t ID, rect_t zone, char *text, int font, unsigned int cursor,
- char inverse);
+ char inverse);
/* Creates a new edit control list
** Parameters: (gfxw_port_t *) port: The port containing the color values to use
** (reg_t) ID: Text widget ID
@@ -133,7 +133,7 @@ gfxw_list_t *sciw_new_edit_control(gfxw_port_t *port, reg_t ID, rect_t zone, cha
*/
gfxw_list_t *sciw_new_icon_control(gfxw_port_t *port, reg_t ID, rect_t zone, int view, int loop, int cel,
- char frame, char inverse);
+ char frame, char inverse);
/* Creates a new icon control list
** Parameters: (gfxw_port_t *) port: The port containing the color values to use
** (reg_t) ID: Text widget ID
@@ -145,7 +145,7 @@ gfxw_list_t *sciw_new_icon_control(gfxw_port_t *port, reg_t ID, rect_t zone, int
*/
gfxw_list_t *sciw_new_list_control(gfxw_port_t *port, reg_t ID, rect_t zone, int font_nr, char **entries_list,
- int entries_nr, int list_top, int selection, char inverse);
+ int entries_nr, int list_top, int selection, char inverse);
/* Creates a new list control list
** Parameters: (gfxw_port_t *) port: The port containing the color values to use
** (int) ID: Text widget ID
diff --git a/engines/sci/include/sciresource.h b/engines/sci/include/sciresource.h
index 1bad516e1f..9be5d0ed3a 100644
--- a/engines/sci/include/sciresource.h
+++ b/engines/sci/include/sciresource.h
@@ -160,7 +160,7 @@ struct resource_t {
resource_t *prev;
resource_altsource_t *alt_sources; /* SLL of alternative resource data sources */
-};
+};
struct ResourceManager {
@@ -206,7 +206,7 @@ ResourceSource *scir_add_patch_dir(ResourceManager *mgr, const char *path);
ResourceSource *scir_get_volume(ResourceManager *mgr, ResourceSource *map, int volume_nr);
ResourceSource *scir_add_volume(ResourceManager *mgr, ResourceSource *map, const char *filename,
- int number, int extended_addressing);
+ int number, int extended_addressing);
/* Add a volume to the resource manager's list of sources.
** Parameters: (ResourceManager *) mgr: The resource manager to look up in
** (ResourceSource *) map: The map associated with this volume
@@ -280,7 +280,7 @@ int sci0_read_resource_map(ResourceManager *mgr, ResourceSource *map, resource_t
*/
int sci1_read_resource_map(ResourceManager *mgr, ResourceSource *map, ResourceSource *vol,
- resource_t **resource_p, int *resource_nr_p, int *sci_version);
+ resource_t **resource_p, int *resource_nr_p, int *sci_version);
/* Reads the SCI1 resource.map file from a local directory
** Parameters: (char *) path: (unused)
** (resource_t **) resources: Pointer to a pointer
diff --git a/engines/sci/include/vm.h b/engines/sci/include/vm.h
index 6362c2f072..1a720988de 100644
--- a/engines/sci/include/vm.h
+++ b/engines/sci/include/vm.h
@@ -156,23 +156,23 @@ struct code_block_t {
};
#define VM_OBJECT_GET_VARSELECTOR(obj, i) \
- (s->version < SCI_VERSION(1,001,000) ? \
- getUInt16(obj->base_obj + obj->variables_nr * 2 + i*2) : \
- *(obj->base_vars + i))
+ (s->version < SCI_VERSION(1,001,000) ? \
+ getUInt16(obj->base_obj + obj->variables_nr * 2 + i*2) : \
+ *(obj->base_vars + i))
#define VM_OBJECT_READ_PROPERTY(obj, i) (obj->variables[i])
#define VM_OBJECT_GET_FUNCSELECTOR(obj, i) \
- (s->version < SCI_VERSION(1,001,000) ? \
- getUInt16((byte *) (obj->base_method + i)) : \
- getUInt16((byte *) (obj->base_method + i*2 + 1)))
+ (s->version < SCI_VERSION(1,001,000) ? \
+ getUInt16((byte *) (obj->base_method + i)) : \
+ getUInt16((byte *) (obj->base_method + i*2 + 1)))
#define VM_OBJECT_READ_FUNCTION(obj, i) \
- (s->version < SCI_VERSION(1,001,000) ? \
- make_reg(obj->pos.segment, \
- getUInt16((byte *) (obj->base_method \
- + obj->methods_nr + 1 \
- + i))) : \
- make_reg(obj->pos.segment, \
- getUInt16((byte *) (obj->base_method \
- + i * 2 + 2))))
+ (s->version < SCI_VERSION(1,001,000) ? \
+ make_reg(obj->pos.segment, \
+ getUInt16((byte *) (obj->base_method \
+ + obj->methods_nr + 1 \
+ + i))) : \
+ make_reg(obj->pos.segment, \
+ getUInt16((byte *) (obj->base_method \
+ + i * 2 + 2))))
@@ -466,7 +466,7 @@ extern int max_instance;
/*inline*/
exec_stack_t *execute_method(EngineState *s, uint16 script, uint16 pubfunct, stack_ptr_t sp, reg_t calling_obj,
- uint16 argc, stack_ptr_t argp);
+ uint16 argc, stack_ptr_t argp);
/* Executes function pubfunct of the specified script.
** Parameters: (EngineState *) s: The state which is to be executed with
** (uint16) script: The script which is called
@@ -480,7 +480,7 @@ exec_stack_t *execute_method(EngineState *s, uint16 script, uint16 pubfunct, sta
exec_stack_t *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj,
- stack_ptr_t sp, int framesize, stack_ptr_t argp);
+ stack_ptr_t sp, int framesize, stack_ptr_t argp);
/* Executes a "send" or related operation to a selector
** Parameters: (EngineState *) s: The EngineState to operate on
** (reg_t) send_obj: Heap address of the object to send to
@@ -498,8 +498,7 @@ exec_stack_t *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj,
#define SCI_XS_CALLEE_LOCALS -1
exec_stack_t *add_exec_stack_entry(EngineState *s, reg_t pc, stack_ptr_t sp, reg_t objp, int argc,
- stack_ptr_t argp, selector_t selector, reg_t sendp, int origin,
- seg_id_t local_segment);
+ stack_ptr_t argp, selector_t selector, reg_t sendp, int origin, seg_id_t local_segment);
/* Adds an entry to the top of the execution stack
** Parameters: (EngineState *) s: The state with which to execute
** (reg_t) pc: The initial program counter
@@ -520,7 +519,7 @@ exec_stack_t *add_exec_stack_entry(EngineState *s, reg_t pc, stack_ptr_t sp, reg
exec_stack_t *add_exec_stack_varselector(EngineState *s, reg_t objp, int argc, stack_ptr_t argp,
- selector_t selector, reg_t *address, int origin);
+ selector_t selector, reg_t *address, int origin);
/* Adds one varselector access to the execution stack
** Parameters: (EngineState *) s: The EngineState to use
** (reg_t) objp: Pointer to the object owning the selector
@@ -552,10 +551,8 @@ void vm_handle_fatal_error(EngineState *s, int line, const char *file);
void script_debug(EngineState *s, reg_t *pc, stack_ptr_t *sp, stack_ptr_t *pp, reg_t *objp,
- int *restadjust,
- seg_id_t *segids, reg_t **variables, reg_t **variables_base,
- int *variables_nr,
- int bp);
+ int *restadjust, seg_id_t *segids, reg_t **variables, reg_t **variables_base,
+ int *variables_nr, int bp);
/* Debugger functionality
** Parameters: (EngineState *) s: The state at which debugging should take place
** (reg_t *) pc: Pointer to the program counter
diff --git a/engines/sci/include/vocabulary.h b/engines/sci/include/vocabulary.h
index 3e2239b952..9f9c3367bc 100644
--- a/engines/sci/include/vocabulary.h
+++ b/engines/sci/include/vocabulary.h
@@ -284,8 +284,7 @@ void vocab_free_branches(parse_tree_branch_t *parser_branches);
*/
result_word_t *vocab_lookup_word(char *word, int word_len,
- word_t **words, int words_nr,
- suffix_t **suffices, int suffices_nr);
+ word_t **words, int words_nr, suffix_t **suffices, int suffices_nr);
/* Looks up a single word in the words and suffixes list
** Parameters: (char *) word: Pointer to the word to look up
** (int) word_len: Length of the word to look up
@@ -299,9 +298,7 @@ result_word_t *vocab_lookup_word(char *word, int word_len,
result_word_t *vocab_tokenize_string(char *sentence, int *result_nr,
- word_t **words, int words_nr,
- suffix_t **suffices, int suffices_nr,
- char **error);
+ word_t **words, int words_nr, suffix_t **suffices, int suffices_nr, char **error);
/* Tokenizes a string and compiles it into word_ts.
** Parameters: (char *) sentence: The sentence to examine
** (int *) result_nr: The variable to store the resulting number of words in
@@ -338,7 +335,7 @@ void vocab_free_rule_list(parse_rule_list_t *rule_list);
int vocab_build_parse_tree(parse_tree_node_t *nodes, result_word_t *words, int words_nr,
- parse_tree_branch_t *branch0, parse_rule_list_t *rules);
+ parse_tree_branch_t *branch0, parse_rule_list_t *rules);
/* Builds a parse tree from a list of words
** Parameters: (parse_tree_node_t *) nodes: A node list to store the tree in (must have
** at least VOCAB_TREE_NODES entries)
@@ -396,7 +393,7 @@ void vocab_synonymize_tokens(result_word_t *words, int words_nr, synonym_t *syno
*/
int vocab_gnf_parse(parse_tree_node_t *nodes, result_word_t *words, int words_nr,
- parse_tree_branch_t *branch0, parse_rule_list_t *tlist, int verbose);
+ parse_tree_branch_t *branch0, parse_rule_list_t *tlist, int verbose);
void vocab_gnf_dump(parse_tree_branch_t *branches, int branches_nr);
diff --git a/engines/sci/scicore/decompress0.cpp b/engines/sci/scicore/decompress0.cpp
index b7d9e4780a..3863bfa508 100644
--- a/engines/sci/scicore/decompress0.cpp
+++ b/engines/sci/scicore/decompress0.cpp
@@ -88,7 +88,7 @@ int decrypt1(uint8 *dest, uint8 *src, int length, int complength) {
bytectr++;
}
- if (token == 0x101)
+ if (token == 0x101)
return 0; // terminator
if (token == 0x100) { // reset command
maxtoken = 0x200;
diff --git a/engines/sci/scicore/resource.cpp b/engines/sci/scicore/resource.cpp
index d2305422c6..b1523f66b6 100644
--- a/engines/sci/scicore/resource.cpp
+++ b/engines/sci/scicore/resource.cpp
@@ -233,7 +233,7 @@ static void _scir_load_resource(ResourceManager *mgr, resource_t *res, bool prot
// Get patch file name
patch_sprintfers[mgr->sci_version](filename, res);
-
+
// FIXME: Instead of using SearchMan, maybe we should only search
// a single dir specified by this RESSOURCE_TYPE_DIRECTORY ResourceSource?
} else
diff --git a/engines/sci/scicore/resource_map.cpp b/engines/sci/scicore/resource_map.cpp
index 93129f193d..6406c60c98 100644
--- a/engines/sci/scicore/resource_map.cpp
+++ b/engines/sci/scicore/resource_map.cpp
@@ -46,46 +46,46 @@ namespace Sci {
#define SCI01V_B3_RESFILE_SHIFT 4
#define SCI0_RESID_GET_TYPE(bytes) \
- (((bytes)[1] & SCI0_B1_RESTYPE_MASK) >> SCI0_B1_RESTYPE_SHIFT)
+ (((bytes)[1] & SCI0_B1_RESTYPE_MASK) >> SCI0_B1_RESTYPE_SHIFT)
#define SCI0_RESID_GET_NUMBER(bytes) \
- ((((bytes)[1] & ~SCI0_B1_RESTYPE_MASK) << 8) | ((bytes)[0]))
+ ((((bytes)[1] & ~SCI0_B1_RESTYPE_MASK) << 8) | ((bytes)[0]))
#define SCI0_RESFILE_GET_FILE(bytes) \
- (((bytes)[3] & SCI0_B3_RESFILE_MASK) >> SCI0_B3_RESFILE_SHIFT)
+ (((bytes)[3] & SCI0_B3_RESFILE_MASK) >> SCI0_B3_RESFILE_SHIFT)
#define SCI0_RESFILE_GET_OFFSET(bytes) \
- ((((bytes)[3] & ~SCI0_B3_RESFILE_MASK) << 24) \
- | (((bytes)[2]) << 16) \
- | (((bytes)[1]) << 8) \
- | (((bytes)[0]) << 0))
+ ((((bytes)[3] & ~SCI0_B3_RESFILE_MASK) << 24) \
+ | (((bytes)[2]) << 16) \
+ | (((bytes)[1]) << 8) \
+ | (((bytes)[0]) << 0))
#define SCI01V_RESFILE_GET_FILE(bytes) \
- (((bytes)[3] & SCI01V_B3_RESFILE_MASK) >> SCI01V_B3_RESFILE_SHIFT)
+ (((bytes)[3] & SCI01V_B3_RESFILE_MASK) >> SCI01V_B3_RESFILE_SHIFT)
#define SCI01V_RESFILE_GET_OFFSET(bytes) \
- ((((bytes)[3] & ~SCI01V_B3_RESFILE_MASK) << 24) \
- | (((bytes)[2]) << 16) \
- | (((bytes)[1]) << 8) \
- | (((bytes)[0]) << 0))
+ ((((bytes)[3] & ~SCI01V_B3_RESFILE_MASK) << 24) \
+ | (((bytes)[2]) << 16) \
+ | (((bytes)[1]) << 8) \
+ | (((bytes)[0]) << 0))
#define SCI1_B5_RESFILE_MASK 0xf0
#define SCI1_B5_RESFILE_SHIFT 4
#define SCI1_RESFILE_GET_FILE(bytes) \
- (((bytes)[5] & SCI1_B5_RESFILE_MASK) >> SCI1_B5_RESFILE_SHIFT)
+ (((bytes)[5] & SCI1_B5_RESFILE_MASK) >> SCI1_B5_RESFILE_SHIFT)
#define SCI1_RESFILE_GET_OFFSET(bytes) \
- ((((bytes)[5] & ~SCI1_B5_RESFILE_MASK) << 24) \
- | (((bytes)[4]) << 16) \
- | (((bytes)[3]) << 8) \
- | (((bytes)[2]) << 0))
+ ((((bytes)[5] & ~SCI1_B5_RESFILE_MASK) << 24) \
+ | (((bytes)[4]) << 16) \
+ | (((bytes)[3]) << 8) \
+ | (((bytes)[2]) << 0))
#define SCI1_RESFILE_GET_NUMBER(bytes) \
- ((((bytes)[1]) << 8) \
- | (((bytes)[0]) << 0))
+ ((((bytes)[1]) << 8) \
+ | (((bytes)[0]) << 0))
#define SCI11_RESFILE_GET_OFFSET(bytes) \
- ((((bytes)[4]) << 17) \
- | (((bytes)[3]) << 9) \
- | (((bytes)[2]) << 1))
+ ((((bytes)[4]) << 17) \
+ | (((bytes)[3]) << 9) \
+ | (((bytes)[2]) << 1))
static int detect_odd_sci01(Common::File &file) {
byte buf[6];
@@ -119,7 +119,7 @@ static int detect_odd_sci01(Common::File &file) {
}
static int sci_res_read_entry(ResourceManager *mgr, ResourceSource *map,
- byte *buf, resource_t *res, int sci_version) {
+ byte *buf, resource_t *res, int sci_version) {
res->id = buf[0] | (buf[1] << 8);
res->type = SCI0_RESID_GET_TYPE(buf);
res->number = SCI0_RESID_GET_NUMBER(buf);
@@ -372,7 +372,7 @@ static int sci10_or_11(int *types) {
}
int sci1_read_resource_map(ResourceManager *mgr, ResourceSource *map, ResourceSource *vol,
- resource_t **resource_p, int *resource_nr_p, int *sci_version) {
+ resource_t **resource_p, int *resource_nr_p, int *sci_version) {
int fsize;
Common::File file;
resource_t *resources, *resource_start;
diff --git a/engines/sci/scicore/resource_patch.cpp b/engines/sci/scicore/resource_patch.cpp
index 7681d009c7..8545987d8f 100644
--- a/engines/sci/scicore/resource_patch.cpp
+++ b/engines/sci/scicore/resource_patch.cpp
@@ -41,7 +41,7 @@ void sci1_sprintf_patch_file_name(char *string, resource_t *res) {
// version-agnostic patch application
static void process_patch(ResourceSource *source,
- Common::ArchiveMember &member, int restype, int resnumber, resource_t **resource_p, int *resource_nr_p) {
+ Common::ArchiveMember &member, int restype, int resnumber, resource_t **resource_p, int *resource_nr_p) {
Common::File file;
if (restype == sci_invalid_resource)
diff --git a/engines/sci/scicore/vocab.cpp b/engines/sci/scicore/vocab.cpp
index b8de863161..6318c5922f 100644
--- a/engines/sci/scicore/vocab.cpp
+++ b/engines/sci/scicore/vocab.cpp
@@ -279,7 +279,7 @@ parse_tree_branch_t *vocab_get_branches(ResourceManager * resmgr, int *branches_
result_word_t *vocab_lookup_word(char *word, int word_len, word_t **words, int words_nr,
- suffix_t **suffices, int suffices_nr) {
+ suffix_t **suffices, int suffices_nr) {
word_t *tempword = (word_t*)sci_malloc(sizeof(word_t) + word_len + 256);
// 256: For suffices. Should suffice.
word_t **dict_word;
@@ -518,8 +518,8 @@ int vocab_build_simple_parse_tree(parse_tree_node_t *nodes, result_word_t *words
}
#endif
-result_word_t *vocab_tokenize_string(char *sentence, int *result_nr, word_t **words, int words_nr,
- suffix_t **suffices, int suffices_nr, char **error) {
+result_word_t *vocab_tokenize_string(char *sentence, int *result_nr, word_t **words, int words_nr,
+ suffix_t **suffices, int suffices_nr, char **error) {
char *lastword = sentence;
int pos_in_sentence = 0;
char c;
diff --git a/engines/sci/sfx/core.cpp b/engines/sci/sfx/core.cpp
index 4d40d002ca..540750538f 100644
--- a/engines/sci/sfx/core.cpp
+++ b/engines/sci/sfx/core.cpp
@@ -731,7 +731,7 @@ void sfx_song_set_status(sfx_state_t *self, song_handle_t handle, int status) {
}
void sfx_song_set_fade(sfx_state_t *self, song_handle_t handle,
- fade_params_t *params) {
+ fade_params_t *params) {
#ifdef DEBUG_SONG_API
static const char *stopmsg[] = {"??? Should not happen", "Do not stop afterwards", "Stop afterwards"};
#endif
@@ -808,7 +808,7 @@ static const int MIDI_cmdlen[16] = {0, 0, 0, 0, 0, 0, 0, 0,
static const song_handle_t midi_send_base = 0xffff0000;
int sfx_send_midi(sfx_state_t *self, song_handle_t handle, int channel,
- int command, int arg1, int arg2) {
+ int command, int arg1, int arg2) {
byte buffer[5];
tell_synth_func *tell = sfx_get_player_tell_func();
diff --git a/engines/sci/sfx/device/camd-midi.cpp b/engines/sci/sfx/device/camd-midi.cpp
index 307e215a50..d06324aaed 100644
--- a/engines/sci/sfx/device/camd-midi.cpp
+++ b/engines/sci/sfx/device/camd-midi.cpp
@@ -54,7 +54,7 @@ static struct MidiNode *midi_node = NULL;
#define ABORT(m) { \
if (CamdBase) \
- IExec->CloseLibrary(CamdBase); \
+ IExec->CloseLibrary(CamdBase); \
sciprintf("[SFX] CAMD driver: "); \
sciprintf(m); \
sciprintf("\n"); \
diff --git a/engines/sci/sfx/iterator.cpp b/engines/sci/sfx/iterator.cpp
index baa6572658..90964ee9c6 100644
--- a/engines/sci/sfx/iterator.cpp
+++ b/engines/sci/sfx/iterator.cpp
@@ -115,13 +115,11 @@ static inline int _parse_ticks(byte *data, int *offset_p, int size) {
static int _sci0_read_next_command(sci0_song_iterator_t *self,
- unsigned char *buf, int *result);
+ unsigned char *buf, int *result);
static int _sci0_get_pcm_data(sci0_song_iterator_t *self,
- sfx_pcm_config_t *format,
- int *xoffset,
- unsigned int *xsize);
+ sfx_pcm_config_t *format, int *xoffset, unsigned int *xsize);
#define PARSE_FLAG_LOOPS_UNLIMITED (1 << 0) /* Unlimited # of loops? */
#define PARSE_FLAG_PARAMETRIC_CUE (1 << 1) /* Assume that cues take an additional "cue value" argument */
@@ -144,9 +142,8 @@ void _reset_synth_channels(base_song_iterator_t *self, song_iterator_channel_t *
}
}
-static int _parse_sci_midi_command(base_song_iterator_t *self, unsigned char *buf, int *result,
- song_iterator_channel_t *channel,
- int flags) {
+static int _parse_sci_midi_command(base_song_iterator_t *self, unsigned char *buf,
+ int *result, song_iterator_channel_t *channel, int flags) {
unsigned char cmd;
int paramsleft;
int midi_op;
@@ -354,8 +351,7 @@ static int _parse_sci_midi_command(base_song_iterator_t *self, unsigned char *bu
}
static int _sci_midi_process_state(base_song_iterator_t *self, unsigned char *buf, int *result,
- song_iterator_channel_t *channel,
- int flags) {
+ song_iterator_channel_t *channel, int flags) {
CHECK_FOR_END(0);
switch (channel->state) {
@@ -449,7 +445,7 @@ static int _sci_midi_process_state(base_song_iterator_t *self, unsigned char *bu
}
static inline int _sci_midi_process(base_song_iterator_t *self, unsigned char *buf, int *result,
- song_iterator_channel_t *channel, int flags) {
+ song_iterator_channel_t *channel, int flags) {
return _sci_midi_process_state(self, buf, result,
channel,
flags);
@@ -473,9 +469,7 @@ static inline int _sci0_header_magic_p(unsigned char *data, int offset, int size
static int _sci0_get_pcm_data(sci0_song_iterator_t *self,
- sfx_pcm_config_t *format,
- int *xoffset,
- unsigned int *xsize) {
+ sfx_pcm_config_t *format, int *xoffset, unsigned int *xsize) {
int tries = 2;
int found_it = 0;
unsigned char *pcm_data;
@@ -634,7 +628,7 @@ static int _sci0_get_timepos(sci0_song_iterator_t *self) {
}
static void _base_init_channel(song_iterator_channel_t *channel, int id, int offset,
- int end) {
+ int end) {
channel->playmask = PLAYMASK_NONE; /* Disable all channels */
channel->id = id;
channel->notes_played = 0;
@@ -976,7 +970,7 @@ static sfx_pcm_feed_t *_sci1_get_pcm(sci1_song_iterator_t *self) {
}
static int _sci1_process_next_command(sci1_song_iterator_t *self,
- unsigned char *buf, int *result) {
+ unsigned char *buf, int *result) {
int retval = -42; /* Shouldn't happen, but gcc doesn't agree */
int chan;
@@ -1300,7 +1294,7 @@ song_iterator_t *new_cleanup_iterator(unsigned int channels) {
/**********************************/
static int _ff_read_next_command(fast_forward_song_iterator_t *self,
- byte *buf, int *result) {
+ byte *buf, int *result) {
int rv;
if (self->delta <= 0)
@@ -1328,7 +1322,7 @@ static sfx_pcm_feed_t *_ff_check_pcm(fast_forward_song_iterator_t *self) {
}
static song_iterator_t *_ff_handle_message(fast_forward_song_iterator_t *self,
- song_iterator_message_t msg) {
+ song_iterator_message_t msg) {
if (msg.recipient == _SIMSG_PLASTICWRAP)
switch (msg.type) {
@@ -1417,7 +1411,7 @@ song_iterator_t *new_fast_forward_iterator(song_iterator_t *capsit, int delta) {
static int _tee_read_next_command(tee_song_iterator_t *it, unsigned char *buf,
- int *result) {
+ int *result) {
static int ready_masks[2] = {TEE_LEFT_READY, TEE_RIGHT_READY};
static int active_masks[2] = {TEE_LEFT_ACTIVE, TEE_RIGHT_ACTIVE};
static int pcm_masks[2] = {TEE_LEFT_PCM, TEE_RIGHT_PCM};
@@ -1648,7 +1642,7 @@ static void _tee_free(tee_song_iterator_t *it) {
#endif
static void songit_tee_death_notification(tee_song_iterator_t *self,
- song_iterator_t *corpse) {
+ song_iterator_t *corpse) {
if (corpse == self->children[TEE_LEFT].it) {
self->status &= ~TEE_LEFT_ACTIVE;
self->children[TEE_LEFT].it = NULL;
@@ -1933,8 +1927,7 @@ song_iterator_t *songit_clone(song_iterator_t *it, int delta) {
}
void song_iterator_add_death_listener(song_iterator_t *it,
- void *client,
- void (*notify)(void *self, void *notifier)) {
+ void *client, void (*notify)(void *self, void *notifier)) {
if (it->death_listeners_nr >= SONGIT_MAX_LISTENERS) {
error("FATAL: Too many death listeners for song iterator");
}
@@ -1945,8 +1938,7 @@ void song_iterator_add_death_listener(song_iterator_t *it,
it->death_listeners_nr++;
}
-void song_iterator_remove_death_listener(song_iterator_t *it,
- void *client) {
+void song_iterator_remove_death_listener(song_iterator_t *it, void *client) {
int i;
for (i = 0; i < it->death_listeners_nr; i++) {
if (it->death_listeners[i].self == client) {
diff --git a/engines/sci/sfx/mixer/soft.cpp b/engines/sci/sfx/mixer/soft.cpp
index e0450e578f..209fcf0633 100644
--- a/engines/sci/sfx/mixer/soft.cpp
+++ b/engines/sci/sfx/mixer/soft.cpp
@@ -434,16 +434,16 @@ static inline int mix_compute_buf_len(sfx_pcm_mixer_t *self, int *skip_frames)
if (P->delta_observations > MAX_DELTA_OBSERVATIONS)
P->delta_observations = MAX_DELTA_OBSERVATIONS;
- /* /\* Disabled, broken *\/ */
- /* if (0 && P->delta_observations > MIN_DELTA_OBSERVATIONS) { /\* Start improving after a while *\/ */
- /* int diff = self->dev->conf.rate - P->max_delta; */
+ /* /\* Disabled, broken *\/ */
+ /* if (0 && P->delta_observations > MIN_DELTA_OBSERVATIONS) { /\* Start improving after a while *\/ */
+ /* int diff = self->dev->conf.rate - P->max_delta; */
- /* /\* log-approximate P->max_delta over time *\/ */
- /* recommended_frames = P->max_delta + */
- /* ((diff * MIN_DELTA_OBSERVATIONS) / P->delta_observations); */
+ /* /\* log-approximate P->max_delta over time *\/ */
+ /* recommended_frames = P->max_delta + */
+ /* ((diff * MIN_DELTA_OBSERVATIONS) / P->delta_observations); */
/* /\* WTF? *\/ */
- /* } else */
- /* recommended_frames = self->dev->buf_size; /\* Initially, keep the buffer full *\/ */
+ /* } else */
+ /* recommended_frames = self->dev->buf_size; /\* Initially, keep the buffer full *\/ */
#if (DEBUG >= 1)
sciprintf("[soft-mixer] played since last time: %d, recommended: %d, free: %d\n",
diff --git a/engines/sci/sfx/pcm_device.cpp b/engines/sci/sfx/pcm_device.cpp
index a0f590ee82..5934b76b21 100644
--- a/engines/sci/sfx/pcm_device.cpp
+++ b/engines/sci/sfx/pcm_device.cpp
@@ -56,7 +56,7 @@ static int pcmout_scummvm_init(sfx_pcm_device_t *self) {
}
static int pcmout_scummvm_output(sfx_pcm_device_t *self, byte *buf, int count,
- sfx_timestamp_t *timestamp) {
+ sfx_timestamp_t *timestamp) {
byte *__buf = new byte[count * pcmout_scummvm_framesize];
diff --git a/engines/sci/sfx/seq/oss-adlib.cpp b/engines/sci/sfx/seq/oss-adlib.cpp
index f1c7bbf1b9..2222544781 100644
--- a/engines/sci/sfx/seq/oss-adlib.cpp
+++ b/engines/sci/sfx/seq/oss-adlib.cpp
@@ -176,7 +176,7 @@ adlib_start_note(int chn, int note, int velocity) {
static int
midi_adlib_open(int data_length, byte *data_ptr, int data2_length,
- byte *data2_ptr, void *seq) {
+ byte *data2_ptr, void *seq) {
int nrdevs, i, n;
struct synth_info info;
struct sbi_instrument sbi;
@@ -357,7 +357,7 @@ sfx_sequencer_t sfx_sequencer_oss_adlib = {
003, /* patch.003 */
SFX_SEQ_PATCHFILE_NONE,
0x04, /* playflag */
- 0, /* do not play channel 9 */
+ 0, /* do not play channel 9 */
ADLIB_VOICES, /* Max polyphony */
0 /* Does not require any write-ahead by its own */
};
diff --git a/engines/sci/sfx/sfx_iterator.h b/engines/sci/sfx/sfx_iterator.h
index 0203159a49..4ddef7f111 100644
--- a/engines/sci/sfx/sfx_iterator.h
+++ b/engines/sci/sfx/sfx_iterator.h
@@ -109,7 +109,7 @@ struct song_iterator_message_t {
#define INHERITS_SONG_ITERATOR \
songit_id_t ID; \
uint16 channel_mask; \
- fade_params_t fade; \
+ fade_params_t fade; \
unsigned int flags; \
int priority; \
int (*next) (song_iterator_t *self, unsigned char *buf, int *buf_size); \
@@ -117,10 +117,10 @@ struct song_iterator_message_t {
song_iterator_t * (* handle_message)(song_iterator_t *self, song_iterator_message_t msg); \
void (*init) (song_iterator_t *self); \
void (*cleanup) (song_iterator_t *self); \
- int (*get_timepos) (song_iterator_t *self); \
+ int (*get_timepos) (song_iterator_t *self); \
listener_t death_listeners[SONGIT_MAX_LISTENERS]; \
int death_listeners_nr \
-
+
#define SONGIT_MAX_LISTENERS 2
struct song_iterator_t {
@@ -208,8 +208,7 @@ struct song_iterator_t {
** in the song-player thread. */
void song_iterator_add_death_listener(song_iterator_t *it,
- void *client,
- void (*notify)(void *self, void *notifier));
+ void *client, void (*notify)(void *self, void *notifier));
/* Adds a death listener to a song iterator
** Parameters: (song_iterator_t *) it: The iterator to add to
** (void *) client: The object wanting to be notified
@@ -220,8 +219,7 @@ void song_iterator_add_death_listener(song_iterator_t *it,
** Death listeners are NOT cloned.
*/
-void song_iterator_remove_death_listener(song_iterator_t *it,
- void *client);
+void song_iterator_remove_death_listener(song_iterator_t *it, void *client);
/* Removes a death listener from a song iterator
** Parameters: (song_iterator_t *) it: The iterator to modify
** (void *) client: The object no longer wanting to be notified
@@ -298,7 +296,7 @@ void songit_free(song_iterator_t *it);
*/
song_iterator_message_t songit_make_message(songit_id_t id,
- int recipient_class, int type, int a1, int a2);
+ int recipient_class, int type, int a1, int a2);
/* Create a song iterator message
** Parameters: (songit_id_t) id: song ID the message is targetted to
** (int) recipient_class: Message recipient class
@@ -308,7 +306,7 @@ song_iterator_message_t songit_make_message(songit_id_t id,
*/
song_iterator_message_t songit_make_ptr_message(songit_id_t id,
- int recipient_class, int type, void * a1, int a2);
+ int recipient_class, int type, void * a1, int a2);
/* Create a song iterator message, wherein the first parameter is a pointer
** Parameters: (songit_id_t) id: song ID the message is targetted to
** (int) recipient_class: Message recipient class
diff --git a/engines/sci/sfx/sfx_iterator_internal.h b/engines/sci/sfx/sfx_iterator_internal.h
index ba6f79742c..1898b34ca1 100644
--- a/engines/sci/sfx/sfx_iterator_internal.h
+++ b/engines/sci/sfx/sfx_iterator_internal.h
@@ -220,8 +220,7 @@ struct tee_song_iterator_t {
sfx_pcm_feed_t *sfx_iterator_make_feed(byte *base_data, int offset,
- int size,
- sfx_pcm_config_t conf);
+ int size, sfx_pcm_config_t conf);
/* Generates a feed for a song iterator
** Parameters: (byte *) base_data: A refcounted memory chunk containing
** (among other things) PCM data
diff --git a/engines/sci/sfx/sfx_songlib.h b/engines/sci/sfx/sfx_songlib.h
index c1683a2f47..bf68697d0b 100644
--- a/engines/sci/sfx/sfx_songlib.h
+++ b/engines/sci/sfx/sfx_songlib.h
@@ -177,7 +177,7 @@ GTimeVal song_next_wakeup_time(GTimeVal *lastslept, long ticks);
*/
void song_lib_set_restore_behavior(songlib_t songlib, song_handle_t handle,
- RESTORE_BEHAVIOR action);
+ RESTORE_BEHAVIOR action);
/* Determines what should be done with the song "handle" when
** restoring it from a saved game.
** Parameters: (songlib_t) songlib: The library that contains the song
diff --git a/engines/sci/sfx/softseq/SN76496.cpp b/engines/sci/sfx/softseq/SN76496.cpp
index 2295eceb7b..f9ecd12aaf 100644
--- a/engines/sci/sfx/softseq/SN76496.cpp
+++ b/engines/sci/sfx/softseq/SN76496.cpp
@@ -51,7 +51,7 @@ static int SN76496_set_option(sfx_softseq_t *self, const char *name, const char
}
static int SN76496_init(sfx_softseq_t *self, byte *patch, int patch_len, byte *patch2,
- int patch2_len) {
+ int patch2_len) {
return SFX_OK;
}
diff --git a/engines/sci/sfx/softseq/fluidsynth.cpp b/engines/sci/sfx/softseq/fluidsynth.cpp
index 17fcef34ba..ab73c381bd 100644
--- a/engines/sci/sfx/softseq/fluidsynth.cpp
+++ b/engines/sci/sfx/softseq/fluidsynth.cpp
@@ -156,7 +156,7 @@ fluidsynth_poll(sfx_softseq_t *self, byte *dest, int count) {
static int
fluidsynth_init(sfx_softseq_t *self, byte *data_ptr, int data_length,
- byte *data2_ptr, int data2_length) {
+ byte *data2_ptr, int data2_length) {
int sfont_id;
double min, max;
diff --git a/engines/sci/sfx/softseq/opl2.cpp b/engines/sci/sfx/softseq/opl2.cpp
index 1229000283..7dbe423eaa 100644
--- a/engines/sci/sfx/softseq/opl2.cpp
+++ b/engines/sci/sfx/softseq/opl2.cpp
@@ -173,8 +173,8 @@ static inline int opl_write(int a, int v) {
/*
static inline uint8 opl_read (int a)
{
- OPLWrite (ym3812_L, 0x388, a);
- return OPLRead (ym3812_L, 0x389);
+ OPLWrite (ym3812_L, 0x388, a);
+ return OPLRead (ym3812_L, 0x389);
}
*/
@@ -514,7 +514,7 @@ static void opl2_poll(sfx_softseq_t *self, byte *dest, int count) {
}
static int opl2_init(sfx_softseq_t *self, byte *data_ptr, int data_length, byte *data2_ptr,
- int data2_length) {
+ int data2_length) {
int i;
/* load up the patch.003 file, parse out the instruments */
diff --git a/engines/sci/sfx/softseq/pcspeaker.cpp b/engines/sci/sfx/softseq/pcspeaker.cpp
index 8d9b6e3da8..82486c28a1 100644
--- a/engines/sci/sfx/softseq/pcspeaker.cpp
+++ b/engines/sci/sfx/softseq/pcspeaker.cpp
@@ -45,7 +45,7 @@ static int sps_set_option(sfx_softseq_t *self, const char *name, const char *val
}
static int sps_init(sfx_softseq_t *self, byte *patch, int patch_len, byte *patch2,
- int patch2_len) {
+ int patch2_len) {
return SFX_OK;
}