aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/engine
diff options
context:
space:
mode:
authorMax Horn2009-05-20 17:53:31 +0000
committerMax Horn2009-05-20 17:53:31 +0000
commitbba91075bf8820e062d3684c820c6aa9782b77a1 (patch)
treecb75a05923ef525ebaa41a25f867cf80b3d78f9a /engines/sci/engine
parent4f55f1e730fa50d354f47c3558d3d0aca68aa0a1 (diff)
downloadscummvm-rg350-bba91075bf8820e062d3684c820c6aa9782b77a1.tar.gz
scummvm-rg350-bba91075bf8820e062d3684c820c6aa9782b77a1.tar.bz2
scummvm-rg350-bba91075bf8820e062d3684c820c6aa9782b77a1.zip
removed trailing whitespaces
svn-id: r40742
Diffstat (limited to 'engines/sci/engine')
-rw-r--r--engines/sci/engine/game.cpp6
-rw-r--r--engines/sci/engine/intmap.cpp2
-rw-r--r--engines/sci/engine/kfile.cpp14
-rw-r--r--engines/sci/engine/kgraphics.cpp10
-rw-r--r--engines/sci/engine/kpathing.cpp14
-rw-r--r--engines/sci/engine/message.cpp6
-rw-r--r--engines/sci/engine/said.cpp2
-rw-r--r--engines/sci/engine/savegame.cpp12
-rw-r--r--engines/sci/engine/scriptdebug.cpp2
-rw-r--r--engines/sci/engine/seg_manager.cpp2
-rw-r--r--engines/sci/engine/state.h10
-rw-r--r--engines/sci/engine/stringfrag.cpp20
12 files changed, 50 insertions, 50 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp
index eff320edfc..f19185e267 100644
--- a/engines/sci/engine/game.cpp
+++ b/engines/sci/engine/game.cpp
@@ -143,7 +143,7 @@ int _reset_graphics_input(EngineState *s) {
s->visual = gfxw_new_visual(s->gfx_state, font_nr);
- s->wm_port = gfxw_new_port(s->visual, NULL, s->gfx_state->pic_port_bounds, s->ega_colors[0], transparent);
+ s->wm_port = gfxw_new_port(s->visual, NULL, s->gfx_state->pic_port_bounds, s->ega_colors[0], transparent);
s->iconbar_port = gfxw_new_port(s->visual, NULL, gfx_rect(0, 0, 320, 200), s->ega_colors[0], transparent);
s->iconbar_port->_flags |= GFXW_FLAG_NO_IMPLICIT_SWITCH;
@@ -419,7 +419,7 @@ int script_init_engine(EngineState *s, sci_version_t version) {
str->max_size = MAX_SAVE_DIR_SIZE;
str->value = (reg_t *)calloc(MAX_SAVE_DIR_SIZE, sizeof(reg_t)); // FIXME -- sizeof(char) or sizeof(reg_t) ??
str->value[0].segment = s->string_frag_segment; // Set to empty string
- str->value[0].offset = 0;
+ str->value[0].offset = 0;
s->save_dir_copy = make_reg(s->sys_strings_segment, SYS_STRING_SAVEDIR);
@@ -458,7 +458,7 @@ int script_init_engine(EngineState *s, sci_version_t version) {
void script_set_gamestate_save_dir(EngineState *s, const char *path) {
SystemString *str = &s->sys_strings->strings[SYS_STRING_SAVEDIR];
-
+
strncpy((char *)str->value, path, str->max_size); // FIXME -- strncpy or internal_stringfrag_strncpy ?
str->value[str->max_size - 1].segment = s->string_frag_segment; // Make sure to terminate
str->value[str->max_size - 1].offset &= 0xff00; // Make sure to terminate
diff --git a/engines/sci/engine/intmap.cpp b/engines/sci/engine/intmap.cpp
index 633754ef9c..9efdd27996 100644
--- a/engines/sci/engine/intmap.cpp
+++ b/engines/sci/engine/intmap.cpp
@@ -104,7 +104,7 @@ int IntMapper::lookupKey(int key) const {
if (*node)
return (*node)->idx;
-
+
return -1;
}
diff --git a/engines/sci/engine/kfile.cpp b/engines/sci/engine/kfile.cpp
index 557b72997a..2cd78c3ac0 100644
--- a/engines/sci/engine/kfile.cpp
+++ b/engines/sci/engine/kfile.cpp
@@ -46,14 +46,14 @@ namespace Sci {
*
* To handle opening a file called "foobar", what we do is this: First, we
* create an 'augmented file name', by prepending the game target and a dash,
- * so if we running game target sq1vga, the name becomes "sq1vga-foobar".
+ * so if we running game target sq1vga, the name becomes "sq1vga-foobar".
* Next, we check if such a file is known to the SaveFileManager. If so, we
* we use that for reading/writing, delete it, whatever.
*
* If no such file is present but we were only asked to *read* the file,
* we fallback to looking for a regular file called "foobar", and open that
* for reading only.
- *
+ *
* There are some caveats to this: First off, SCI apparently has no way
* to signal that a file is supposed to be opened for reading only. For now,
* we hackishly just assume that this is what _K_FILE_MODE_OPEN_OR_FAIL is for.
@@ -71,8 +71,8 @@ namespace Sci {
* at all, and for what. Based on that, we can maybe come up with a better waybill
* to provide this functionality.
*/
-
-
+
+
FileHandle::FileHandle() : _in(0), _out(0) {
}
@@ -197,7 +197,7 @@ void file_open(EngineState *s, const char *filename, int mode) {
s->_fileHandles[handle]._name = filename;
s->r_acc = make_reg(0, handle);
-
+
debug(3, " -> opened file '%s' with handle %d", filename, handle);
}
@@ -694,7 +694,7 @@ enum {
void DirSeeker::firstFile(const char *mask, reg_t buffer) {
-
+
// Verify that we are given a valid buffer
if (!buffer.segment) {
error("DirSeeker::firstFile('%s') invoked with invalid buffer", mask);
@@ -722,7 +722,7 @@ void DirSeeker::nextFile() {
char *mem = kernel_dereference_char_pointer(_vm, _outbuffer, 0);
memset(mem, 0, 13);
- // TODO: Transform the string back into a format usable by the SCI scripts.
+ // TODO: Transform the string back into a format usable by the SCI scripts.
// I.e., strip any TARGET- prefix.
const char *string = _iter->c_str();
assert(string);
diff --git a/engines/sci/engine/kgraphics.cpp b/engines/sci/engine/kgraphics.cpp
index 051c6f8b2e..dddf1a01af 100644
--- a/engines/sci/engine/kgraphics.cpp
+++ b/engines/sci/engine/kgraphics.cpp
@@ -276,7 +276,7 @@ PaletteEntry get_pic_color(EngineState *s, int color) {
else {
error("Color index %d out of bounds for pic %d (%d max)", color, s->gfx_state->pic_nr, s->gfx_state->gfxResMan->getColorCount());
BREAKPOINT();
- return PaletteEntry(0,0,0);
+ return PaletteEntry(0,0,0);
}
}
@@ -312,7 +312,7 @@ reg_t kSetCursor(EngineState *s, int funct_nr, int argc, reg_t *argv) {
s->mouse_pointer_loop = s->save_mouse_pointer_loop;
s->mouse_pointer_cel = s->save_mouse_pointer_cel;
}
- case 2 :
+ case 2 :
case 4 :
if (s->version >= SCI_VERSION_1_1 || (s->flags & GF_SCI1_NEWSETCURSOR)) {
GFX_ASSERT(gfxop_set_pointer_position(s->gfx_state, Common::Point(UKPV(0), UKPV(1))));
@@ -1344,8 +1344,8 @@ static void _k_disable_delete_for_now(EngineState *s, reg_t obj) {
* SQ4SG.<number>) and the exact file format of the savegame index
* (SQ4SG.DIR). From the earlier discussions on file I/O handling -
* before as well as after the merge - I gather that this is not an
- * option.
- *
+ * option.
+ *
* SQ4/Floppy is special, being the first game to implement savegame
* deletion at all. For later games, we manage to implement deletion by
* using gross hacks in kDeviceInfo() (essentially repurposing a few
@@ -3155,7 +3155,7 @@ reg_t kDisplay(EngineState *s, int funct_nr, int argc, reg_t *argv) {
color0 = port->_color;
bg_color = port->_bgcolor;
// TODO: in SCI1VGA the default colors for text and background are #0 (black)
- // SCI0 case should be checked
+ // SCI0 case should be checked
if (s->resmgr->_sciVersion >= SCI_VERSION_01_VGA) {
// This priority check fixes the colors in the menus in KQ5
// TODO/FIXME: Is this correct?
diff --git a/engines/sci/engine/kpathing.cpp b/engines/sci/engine/kpathing.cpp
index d4d6e96437..32d1a1d010 100644
--- a/engines/sci/engine/kpathing.cpp
+++ b/engines/sci/engine/kpathing.cpp
@@ -75,7 +75,7 @@ enum {
PF_OK = 0,
PF_ERROR = -1,
PF_FATAL = -2
-};
+};
// Floating point struct
struct FloatPoint {
@@ -130,11 +130,11 @@ public:
public:
CircularVertexList() : _head(0) {}
-
+
Vertex *first() const {
return _head;
}
-
+
void insertHead(Vertex *elm) {
if (_head == NULL) {
elm->_next = elm->_prev = elm;
@@ -240,7 +240,7 @@ struct PathfindingState {
_appendPoint = NULL;
vertices = 0;
}
-
+
~PathfindingState() {
free(vertex_index);
@@ -810,10 +810,10 @@ static VertexList *visible_vertices(PathfindingState *s, Vertex *vert) {
if (VERTEX_HAS_EDGES(vertex)) {
CLIST_FOREACH(vertex, &polygon->vertices) {
const Common::Point *high, *low;
-
+
// Add edges that intersect the initial position of the sweeping line
clockwise(vertex, high, low);
-
+
if ((high->y < p.y) && (low->y >= p.y) && (*low != p))
intersected.push_front(vertex);
}
@@ -1201,7 +1201,7 @@ static Vertex *merge_point(PathfindingState *s, const Common::Point &v) {
if (VERTEX_HAS_EDGES(polygon->vertices.first())) {
CLIST_FOREACH(vertex, &polygon->vertices) {
Vertex *next = CLIST_NEXT(vertex);
-
+
if (between(vertex->v, next->v, v)) {
// Split edge by adding vertex
polygon->vertices.insertAfter(vertex, v_new);
diff --git a/engines/sci/engine/message.cpp b/engines/sci/engine/message.cpp
index 8b137a1b29..61151e3218 100644
--- a/engines/sci/engine/message.cpp
+++ b/engines/sci/engine/message.cpp
@@ -87,9 +87,9 @@ int MessageState::findTuple(MessageTuple &t) {
while (1) {
MessageTuple looking_at = getTuple();
- if (t.noun == looking_at.noun &&
- t.verb == looking_at.verb &&
- t.cond == looking_at.cond &&
+ if (t.noun == looking_at.noun &&
+ t.verb == looking_at.verb &&
+ t.cond == looking_at.cond &&
t.seq == looking_at.seq)
break;
diff --git a/engines/sci/engine/said.cpp b/engines/sci/engine/said.cpp
index f7bfff2061..a03c829357 100644
--- a/engines/sci/engine/said.cpp
+++ b/engines/sci/engine/said.cpp
@@ -1245,7 +1245,7 @@ yyparse ()
#endif
#endif
{
-
+
int yystate;
int yyn;
int yyresult;
diff --git a/engines/sci/engine/savegame.cpp b/engines/sci/engine/savegame.cpp
index bca5df65b5..47d1f3e721 100644
--- a/engines/sci/engine/savegame.cpp
+++ b/engines/sci/engine/savegame.cpp
@@ -82,7 +82,7 @@ static void sync_song_t(Common::Serializer &s, song_t &obj) {
s.syncAsSint32LE(obj.restore_time);
s.syncAsSint32LE(obj.loops);
s.syncAsSint32LE(obj.hold);
-
+
if (s.isLoading()) {
obj._delay = 0;
obj.it = 0;
@@ -219,7 +219,7 @@ static void sync_SegManagerPtr(Common::Serializer &s, SegManager *&obj) {
delete obj;
obj = new SegManager(sci11);
}
-
+
obj->saveLoadWithSerializer(s);
}
@@ -366,7 +366,7 @@ void Script::saveLoadWithSerializer(Common::Serializer &s) {
static void sync_SystemString(Common::Serializer &s, SystemString &obj) {
syncCStr(s, &obj.name);
s.syncAsSint32LE(obj.max_size);
-
+
// FIXME: This is a *WEIRD* hack: We sync a reg_t* as if it was a string.
// No idea why, but this mimicks what the old save/load code used to do.
syncCStr(s, (char **)&obj.value);
@@ -406,7 +406,7 @@ static void sync_songlib_t(Common::Serializer &s, songlib_t &obj) {
if (s.isSaving())
songcount = song_lib_count(obj);
s.syncAsUint32LE(songcount);
-
+
if (s.isLoading()) {
song_lib_init(&obj);
while (songcount--) {
@@ -442,7 +442,7 @@ static void sync_MemObjPtr(Common::Serializer &s, MemObject *&mobj) {
} else {
assert(mobj);
}
-
+
s.syncAsSint32LE(mobj->_segmgrId);
mobj->saveLoadWithSerializer(s);
}
@@ -819,7 +819,7 @@ EngineState *gamestate_restore(EngineState *s, Common::SeekableReadStream *fh) {
internal_stringfrag_strncpy(s, str->value, s->sys_strings->strings[SYS_STRING_SAVEDIR].value, str->max_size);
str->value[str->max_size - 1].segment = s->string_frag_segment; // Make sure to terminate
str->value[str->max_size - 1].offset &= 0xff00; // Make sure to terminate
-
+
// Time state:
retval->last_wait_time = g_system->getMillis();
retval->game_start_time = g_system->getMillis() - retval->game_time * 1000;
diff --git a/engines/sci/engine/scriptdebug.cpp b/engines/sci/engine/scriptdebug.cpp
index e7345b93b7..e24c5b654f 100644
--- a/engines/sci/engine/scriptdebug.cpp
+++ b/engines/sci/engine/scriptdebug.cpp
@@ -91,7 +91,7 @@ char inputbuf[256] = "";
static const char *_debug_get_input() {
char newinpbuf[256];
-
+
printf("> ");
if (!fgets(newinpbuf, 254, stdin))
return NULL;
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp
index a4e9bba27f..51459324e0 100644
--- a/engines/sci/engine/seg_manager.cpp
+++ b/engines/sci/engine/seg_manager.cpp
@@ -824,7 +824,7 @@ SystemStrings *SegManager::allocateSysStrings(SegmentId *segid) {
SegmentId SegManager::allocateStringFrags() {
SegmentId segid;
-
+
allocNonscriptSegment(MEM_OBJ_STRING_FRAG, &segid);
return segid;
diff --git a/engines/sci/engine/state.h b/engines/sci/engine/state.h
index e7755d3388..40749cb0fd 100644
--- a/engines/sci/engine/state.h
+++ b/engines/sci/engine/state.h
@@ -52,7 +52,7 @@ struct kfunct_sig_pair_t; // from kernel.h
struct GfxState;
struct GfxPort;
struct GfxVisual;
-struct GfxContainer;
+struct GfxContainer;
struct GfxList;
@@ -68,7 +68,7 @@ public:
_outbuffer = NULL_REG;
_iter = _savefiles.begin();
}
-
+
void firstFile(const char *mask, reg_t buffer);
void nextFile();
};
@@ -100,11 +100,11 @@ public:
Common::String _name;
Common::SeekableReadStream *_in;
Common::WriteStream *_out;
-
+
public:
FileHandle();
~FileHandle();
-
+
void close();
bool isOpen() const;
};
@@ -224,7 +224,7 @@ public:
reg_t parser_base; /**< Base address for the parser error reporting mechanism */
reg_t parser_event; /**< The event passed to Parse() and later used by Said() */
Script *script_000; /**< script 000, e.g. for globals */
-
+
uint16 currentRoomNumber() const { return KP_UINT(script_000->locals_block->_locals[13]); }
int parser_lastmatch_word; /**< Position of the input word the parser last matched on, or SAID_NO_MATCH */
diff --git a/engines/sci/engine/stringfrag.cpp b/engines/sci/engine/stringfrag.cpp
index b616dea912..3b3c3911cf 100644
--- a/engines/sci/engine/stringfrag.cpp
+++ b/engines/sci/engine/stringfrag.cpp
@@ -38,7 +38,7 @@ could possible be turned into documentation for the strings frags code...
Max Horn wrote:
> Basically, saving the reg_t "array" (?) in the SystemString struct (see
> sync_SystemString in engine/savegame.cpp) seems like a bad hack that will
-> result in breakage...
+> result in breakage...
The short explanation is that the casts _will_ go away, but that the
system strings, too, will become stringfrag-based eventually.
@@ -107,7 +107,7 @@ int is_valid_stringfrag(EngineState *s, reg_t pos) {
return internal_is_valid_stringfrag(s, buffer);
}
-
+
static int internal_stringfrag_length(EngineState *s, reg_t *buffer) {
int result = 0;
@@ -245,20 +245,20 @@ void stringfrag_memmove(EngineState *s, reg_t *buffer, int sourcepos, int destpo
/* Some of these values are not used yet. There are a couple
of cases that we could implement faster if the need arises, in
which case we would most certainly need these. */
- int source_begin_pos = sourcepos/2;
- int source_begin_offset = sourcepos%2;
+ int source_begin_pos = sourcepos/2;
+ int source_begin_offset = sourcepos%2;
int source_end_pos = (sourcepos+count-1)/2;
int source_end_offset = (sourcepos+count-1)%2;
- int dest_begin_pos = destpos/2;
- int dest_begin_offset = destpos%2;
+ int dest_begin_pos = destpos/2;
+ int dest_begin_offset = destpos%2;
int dest_end_pos = (destpos+count-1)/2;
int dest_end_offset = (destpos+count-1)%2;
if (sourcepos < destpos) {
for (int n = count-1; n >= 0; n--) {
buffer[dest_end_pos].segment = STRINGFRAG_SEGMENT;
- stringfrag_setchar(buffer, dest_end_pos, dest_end_offset,
+ stringfrag_setchar(buffer, dest_end_pos, dest_end_offset,
stringfrag_getchar(buffer, source_end_pos, source_end_offset));
if (source_end_offset ^= 1)
source_end_pos --;
@@ -268,7 +268,7 @@ void stringfrag_memmove(EngineState *s, reg_t *buffer, int sourcepos, int destpo
} else {
for (int n = 0; n < count; n++) {
buffer[dest_begin_pos].segment = STRINGFRAG_SEGMENT;
- stringfrag_setchar(buffer, dest_begin_pos, dest_begin_offset,
+ stringfrag_setchar(buffer, dest_begin_pos, dest_begin_offset,
stringfrag_getchar(buffer, source_begin_pos, source_begin_offset));
if (!(source_begin_offset ^= 1))
source_begin_pos ++;
@@ -291,7 +291,7 @@ static void internal_stringfrag_insert_char(EngineState *s, reg_t *buffer, int p
/* The variables restore_null_offset and restore_null_pos will
indicate where the NUL character should be PUT BACK after
- inserting c, as this operation might overwrite the NUL. */
+ inserting c, as this operation might overwrite the NUL. */
if (seeker->offset & 0xff00) {
restore_nul_offset = 1;
restore_nul_pos = 0;
@@ -329,7 +329,7 @@ static void internal_stringfrag_delete_char(EngineState *s, reg_t *buffer, int p
/* The variables restore_null_offset and restore_null_pos will
indicate where the NUL character should be PUT BACK after
- deletion, as this operation might overwrite the NUL. */
+ deletion, as this operation might overwrite the NUL. */
if (seeker->offset & 0xff00) {
restore_nul_offset = 1;
restore_nul_pos = -1;