diff options
31 files changed, 97 insertions, 97 deletions
diff --git a/engines/sci/decompressor.cpp b/engines/sci/decompressor.cpp index c1b10b9af1..6ed43e248e 100644 --- a/engines/sci/decompressor.cpp +++ b/engines/sci/decompressor.cpp @@ -8,7 +8,7 @@   * modify it under the terms of the GNU General Public License   * as published by the Free Software Foundation; either version 2   * of the License, or (at your option) any later version. -  +   * This program is distributed in the hope that it will be useful,   * but WITHOUT ANY WARRANTY; without even the implied warranty of   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the @@ -200,7 +200,7 @@ int DecompressorLZW::unpackLZW(Common::ReadStream *src, byte *dest, uint32 nPack  				if (token >= _curtoken) {  					warning("unpackLZW: Bad token %x", token);  					return SCI_ERROR_DECOMPRESSION_ERROR; -				}  +				}  				tokenlastlength = tokenlengthlist[token] + 1;  				if (_dwWrote + tokenlastlength > _szUnpacked) {  					// For me this seems a normal situation, It's necessary to handle it @@ -387,7 +387,7 @@ void DecompressorLZW::reorderPic(byte *src, byte *dest, int dsize) {  	byte *writer = dest;  	char viewdata[7];  	byte *cdata, *cdata_start; -	 +  	*writer++ = PIC_OP_OPX;  	*writer++ = PIC_OPX_SET_PALETTE; @@ -406,7 +406,7 @@ void DecompressorLZW::reorderPic(byte *src, byte *dest, int dsize) {  	memcpy(viewdata, seeker, sizeof(viewdata));  	seeker += sizeof(viewdata); -	 +  	memcpy(writer, seeker, 4*256); /* Palette */  	seeker += 4*256;  	writer += 4*256; @@ -418,7 +418,7 @@ void DecompressorLZW::reorderPic(byte *src, byte *dest, int dsize) {  	}  	if (dsize != view_start + EXTRA_MAGIC_SIZE + view_size) { -		memcpy(dest + view_size + view_start + EXTRA_MAGIC_SIZE, seeker,  +		memcpy(dest + view_size + view_start + EXTRA_MAGIC_SIZE, seeker,  		       dsize - view_size - view_start - EXTRA_MAGIC_SIZE);  		seeker += dsize - view_size - view_start - EXTRA_MAGIC_SIZE;  	} @@ -426,7 +426,7 @@ void DecompressorLZW::reorderPic(byte *src, byte *dest, int dsize) {  	cdata_start = cdata = (byte *)malloc(cdata_size);  	memcpy(cdata, seeker, cdata_size);  	seeker += cdata_size; -	 +  	writer = dest + view_start;  	*writer++ = PIC_OP_OPX;  	*writer++ = PIC_OPX_EMBEDDED_VIEW; @@ -442,7 +442,7 @@ void DecompressorLZW::reorderPic(byte *src, byte *dest, int dsize) {  	*writer++ = 0;  	decodeRLE(&seeker, &cdata, writer, view_size); -	 +  	free(cdata_start);  } @@ -903,17 +903,17 @@ int DecompressorLZS::unpackLZS() {  	uint16 offs = 0, clen;  	while (!isFinished()) { -		if (getBitsMSB(1)) { // Compressed bytes follow  +		if (getBitsMSB(1)) { // Compressed bytes follow  			if (getBitsMSB(1)) { // Seven bit offset follows  				offs = getBitsMSB(7); -				if (!offs) // This is the end marker - a 7 bit offset of zero  +				if (!offs) // This is the end marker - a 7 bit offset of zero  					break;  				if (!(clen = getCompLen())) {  					warning("lzsDecomp: length mismatch");  					return SCI_ERROR_DECOMPRESSION_ERROR;  				}  				copyComp(offs, clen); -			} else { // Eleven bit offset follows  +			} else { // Eleven bit offset follows  				offs = getBitsMSB(11);  				if (!(clen = getCompLen())) {  					warning("lzsDecomp: length mismatch"); diff --git a/engines/sci/decompressor.h b/engines/sci/decompressor.h index 5f24b0f41d..a01434d9fb 100644 --- a/engines/sci/decompressor.h +++ b/engines/sci/decompressor.h @@ -63,7 +63,7 @@ protected:  	 * @param nUnpacket	size of unpacked data  	 * @return 0 on success, non-zero on error  	 */ -	virtual void init(Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked);	 +	virtual void init(Common::ReadStream *src, byte *dest, uint32 nPacked, uint32 nUnpacked);  	/**  	 * Get a number of bits from _src stream, starting with the most @@ -89,7 +89,7 @@ protected:  	byte getByteLSB();  	void fetchBitsMSB(); -	void fetchBitsLSB();  +	void fetchBitsLSB();  	/**  	 * Write one byte into _dest stream @@ -158,7 +158,7 @@ protected:  	void decodeRLE(byte **rledata, byte **pixeldata, byte *outbuffer, int size);  	int getRLEsize(byte *rledata, int dsize);  	void buildCelHeaders(byte **seeker, byte **writer, int celindex, int *cc_lengths, int max); -	 +  	// decompressor data  	struct Tokenlist {  		byte data; diff --git a/engines/sci/detection.cpp b/engines/sci/detection.cpp index a325c0bd3f..c492c415eb 100644 --- a/engines/sci/detection.cpp +++ b/engines/sci/detection.cpp @@ -1567,7 +1567,7 @@ static const struct SciGameDescription SciGameDescriptions[] = {  		SCI_VERSION_AUTODETECT,  		SCI_VERSION_0  	}, -	 +  	// Larry 2 - English DOS  	// SCI interpreter version 0.000.409  	{{"lsl2", "", { @@ -3476,7 +3476,7 @@ const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fsl  	// Try to parse the executable version  	if (getSciVersionFromString(exeVersionString, &g_fallbackDesc.version, g_fallbackDesc.desc.platform)) { -		printf("Detected version: %s, parsed SCI version: %s\n",  +		printf("Detected version: %s, parsed SCI version: %s\n",  					exeVersionString.c_str(), versionNames[g_fallbackDesc.version]);  		return (const ADGameDescription *)&g_fallbackDesc; 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; diff --git a/engines/sci/gfx/gfx_res_options.cpp b/engines/sci/gfx/gfx_res_options.cpp index a96949bf43..1364e333ec 100644 --- a/engines/sci/gfx/gfx_res_options.cpp +++ b/engines/sci/gfx/gfx_res_options.cpp @@ -140,7 +140,7 @@ void apply_mod(byte *factor, gfx_pixmap_t *pxm) {  		UPDATE_COL(c.g, 1);  		UPDATE_COL(c.b, 2);  		pal->setColor(i, c.r, c.g, c.b); -			 +  #undef UPDATE_COL  	}  } @@ -168,7 +168,7 @@ int gfx_get_res_config(gfx_options_t *options, gfx_pixmap_t *pxm) {  		if (pxm->palette)  			pxm->palette->free(); -		pxm->palette = new Palette(conf->conf.assign.assign.palette.colors,  +		pxm->palette = new Palette(conf->conf.assign.assign.palette.colors,  								   conf->conf.assign.assign.palette.colors_nr);  		pxm->palette->name = "res";  	} diff --git a/engines/sci/gfx/gfx_resmgr.cpp b/engines/sci/gfx/gfx_resmgr.cpp index 72faf3916d..42a2427b9b 100644 --- a/engines/sci/gfx/gfx_resmgr.cpp +++ b/engines/sci/gfx/gfx_resmgr.cpp @@ -49,8 +49,8 @@ struct param_struct {  	gfx_driver_t *driver;  }; -GfxResManager::GfxResManager(int version, bool isVGA, gfx_options_t *options, gfx_driver_t *driver, ResourceManager *resManager) :  -				_version(version), _isVGA(isVGA), _options(options), _driver(driver), _resManager(resManager),  +GfxResManager::GfxResManager(int version, bool isVGA, gfx_options_t *options, gfx_driver_t *driver, ResourceManager *resManager) : +				_version(version), _isVGA(isVGA), _options(options), _driver(driver), _resManager(resManager),  				_lockCounter(0), _tagLockCounter(0), _staticPalette(0) {  	gfxr_init_static_palette(); @@ -154,7 +154,7 @@ int GfxResManager::getOptionsHash(gfx_resource_type_t type) {  			return 10;  		else  			return (_options->pic0_unscaled) ? 0x10000 : (_options->pic0_dither_mode << 12) -			       | (_options->pic0_dither_pattern << 8) | (_options->pic0_brush_mode << 4)  +			       | (_options->pic0_dither_pattern << 8) | (_options->pic0_brush_mode << 4)  				   | (_options->pic0_line_mode);  #else  		if (_version >= SCI_VERSION_01_VGA) @@ -536,7 +536,7 @@ gfxr_view_t *GfxResManager::getView(int nr, int *loop, int *cel, int palette) {  				view->palette = new Palette(_staticPalette->size());  				view->palette->name = "interpreter_get_view";  			} -			 +  			// Palettize view  			for (unsigned i = 0; i < MIN(view->palette->size(), _staticPalette->size()); i++) {  				const PaletteEntry& vc = view->palette->getColor(i); @@ -659,7 +659,7 @@ gfx_pixmap_t *GfxResManager::getCursor(int num) {  			return NULL;  		} -		gfx_pixmap_t *cursor = gfxr_draw_cursor(GFXR_RES_ID(GFX_RESOURCE_TYPE_CURSOR, num),  +		gfx_pixmap_t *cursor = gfxr_draw_cursor(GFXR_RES_ID(GFX_RESOURCE_TYPE_CURSOR, num),  										cursorRes->data, cursorRes->size, _version != SCI_VERSION_0);  		if (!cursor) diff --git a/engines/sci/gfx/gfx_resmgr.h b/engines/sci/gfx/gfx_resmgr.h index 4c6163c7c4..68eccebc49 100644 --- a/engines/sci/gfx/gfx_resmgr.h +++ b/engines/sci/gfx/gfx_resmgr.h @@ -138,7 +138,7 @@ public:  	/* Retrieves a translated view cel -	** Parameters:  +	** Parameters:  	**             (int) nr: The view number  	**             (int *) loop: Pointer to a variable containing the loop number  	**             (int *) cel: Pointer to a variable containing the cel number diff --git a/engines/sci/gfx/gfx_tools.cpp b/engines/sci/gfx/gfx_tools.cpp index ac6e3c022a..501c972c2e 100644 --- a/engines/sci/gfx/gfx_tools.cpp +++ b/engines/sci/gfx/gfx_tools.cpp @@ -49,7 +49,7 @@ gfx_mode_t *gfx_new_mode(int xfact, int yfact, const Graphics::PixelFormat &form  	mode->xfact = xfact;  	mode->yfact = yfact;  	mode->bytespp = format.bytesPerPixel; -	 +  	// FIXME: I am not sure whether the following assignments are quite right.  	// The only code using these are the built-in scalers of the SCI engine.  	// And those are pretty weird, so I am not sure I interpreted them correctly. diff --git a/engines/sci/gfx/operations.cpp b/engines/sci/gfx/operations.cpp index 29606f5d7f..2e778e180f 100644 --- a/engines/sci/gfx/operations.cpp +++ b/engines/sci/gfx/operations.cpp @@ -405,7 +405,7 @@ static void init_aux_pixmap(gfx_pixmap_t **pixmap) {  	(*pixmap)->palette = new Palette(default_colors, DEFAULT_COLORS_NR);  } -int gfxop_init(int version, bool isVGA, GfxState *state, gfx_options_t *options, ResourceManager *resManager,  +int gfxop_init(int version, bool isVGA, GfxState *state, gfx_options_t *options, ResourceManager *resManager,  			   int xfact, int yfact, gfx_color_mode_t bpp) {  	int color_depth = bpp ? bpp : 1;  	int initialized = 0; diff --git a/engines/sci/gfx/palette.cpp b/engines/sci/gfx/palette.cpp index cb9653cacd..e246fefddd 100644 --- a/engines/sci/gfx/palette.cpp +++ b/engines/sci/gfx/palette.cpp @@ -164,12 +164,12 @@ uint Palette::findNearbyColor(byte r, byte g, byte b, bool lock) {  	for (uint i = 0; i < _size; ++i) {  		PaletteEntry& entry = _colors[i]; -	 +  		if (entry.refcount != PALENTRY_FREE) {  			int dr = abs(entry.r - r);  			int dg = abs(entry.g - g);  			int db = abs(entry.b - b); -	 +  			if (dr == 0 && dg == 0 && db == 0) {  				// Exact match  				//exact = true; @@ -177,7 +177,7 @@ uint Palette::findNearbyColor(byte r, byte g, byte b, bool lock) {  					entry.refcount++;  				return i;  			} -	 +  			int delta = (dr * dr) + (dg * dg) + (db * db);  			if (delta < bestdelta) {  				bestdelta = delta; @@ -188,7 +188,7 @@ uint Palette::findNearbyColor(byte r, byte g, byte b, bool lock) {  				firstfree = i;  		}  	} -	 +  	if (firstfree != -1) {  		// TODO: mark palette as dirty  		setColor(firstfree, r, g, b); diff --git a/engines/sci/gfx/picfill.cpp b/engines/sci/gfx/picfill.cpp index eb0e8b36c2..b5ebf9d228 100644 --- a/engines/sci/gfx/picfill.cpp +++ b/engines/sci/gfx/picfill.cpp @@ -32,13 +32,13 @@   *    AUXBUF_FILL: Name of the exported floodfill function   *    AUXBUF_FILL_HELPER: Name of the helper function   *    FILL_FUNCTION: Name of the exported floodfill function - *    FILL_FUNCTION_RECURSIVE: Name of the helper function  + *    FILL_FUNCTION_RECURSIVE: Name of the helper function   *   * Define DRAW_SCALED to support scaled drawing, or leave it out for faster   * processing.   *   */ -  +  namespace Sci {  #define CLIPMASK_HARD_BOUND 0x80 /* ensures that we don't re-fill filled stuff */ diff --git a/engines/sci/gfx/res_cursor.cpp b/engines/sci/gfx/res_cursor.cpp index 82c3b694cd..f78134536c 100644 --- a/engines/sci/gfx/res_cursor.cpp +++ b/engines/sci/gfx/res_cursor.cpp @@ -59,8 +59,8 @@ gfx_pixmap_t *gfxr_draw_cursor(int id, byte *resource, int size, bool isSci01) {  	retval = gfx_pixmap_alloc_index_data(gfx_new_pixmap(CURSOR_SIZE, CURSOR_SIZE, id, 0, 0));  	// FIXME: don't copy palette - 	retval->palette = new Palette(gfx_sci01_cursor_colors, isSci01 ? GFX_SCI01_CURSOR_COLORS_NR : GFX_SCI0_CURSOR_COLORS_NR); - 	retval->palette->name = "cursor";  +	retval->palette = new Palette(gfx_sci01_cursor_colors, isSci01 ? GFX_SCI01_CURSOR_COLORS_NR : GFX_SCI0_CURSOR_COLORS_NR); +	retval->palette->name = "cursor";  	retval->color_key = GFX_CURSOR_TRANSPARENT;  	if (isSci01) { diff --git a/engines/sci/gfx/res_pic.cpp b/engines/sci/gfx/res_pic.cpp index f88e36eb40..7f5ecfbb51 100644 --- a/engines/sci/gfx/res_pic.cpp +++ b/engines/sci/gfx/res_pic.cpp @@ -1552,7 +1552,7 @@ void gfxr_draw_pic01(gfxr_pic_t *pic, int flags, int default_palette, int size,  				gfx_xlate_pixmap(view, mode, GFX_XLATE_FILTER_NONE);  				gfx_free_mode(mode); -				// When the mode is freed, the associated view  +				// When the mode is freed, the associated view  				// palette is freed too, so set it to NULL  				view->palette = NULL; diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index 0c63075a68..1d3d102688 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -748,8 +748,8 @@ int ResourceManager::detectVolVersion() {  		int chk = (curVersion == SCI_VERSION_0) ? 4 : 20;  		int offs = curVersion < SCI_VERSION_1_1 ? 4 : 0; -		if ((curVersion < SCI_VERSION_32 && wCompression > chk)  -				|| (curVersion == SCI_VERSION_32 && wCompression != 0 && wCompression != 32)  +		if ((curVersion < SCI_VERSION_32 && wCompression > chk) +				|| (curVersion == SCI_VERSION_32 && wCompression != 0 && wCompression != 32)  				|| (wCompression == 0 && dwPacked != dwUnpacked + offs)  		        || (dwUnpacked < dwPacked - offs)) { @@ -868,7 +868,7 @@ void ResourceManager::readResourcePatches(ResourceSource *source) {  			} else {  				// SCI0 scheme  				int resname_len = strlen(szResType); -				if (scumm_strnicmp(name.c_str(), szResType, resname_len) == 0  +				if (scumm_strnicmp(name.c_str(), szResType, resname_len) == 0  					&& !isalpha(name[resname_len + 1])) {  					number = atoi(name.c_str() + resname_len + 1);  					bAdd = true; @@ -1056,10 +1056,10 @@ int ResourceManager::readResourceInfo(Resource *res, Common::File *file,  		compression = kCompNone;  		break;  	case 1: -		compression = (_sciVersion == SCI_VERSION_0) ? kCompLZW : kCompHuffman;  +		compression = (_sciVersion == SCI_VERSION_0) ? kCompLZW : kCompHuffman;  		break;  	case 2: -		compression = (_sciVersion == SCI_VERSION_0) ? kCompHuffman : kCompLZW1;  +		compression = (_sciVersion == SCI_VERSION_0) ? kCompHuffman : kCompLZW1;  		break;  	case 3:  		compression = kCompLZW1View; diff --git a/engines/sci/resource.h b/engines/sci/resource.h index 33daa71e37..8899cbdc6b 100644 --- a/engines/sci/resource.h +++ b/engines/sci/resource.h @@ -129,7 +129,7 @@ const char *getResourceTypeSuffix(ResourceType restype);  struct resource_index_t {  	uint16 wOffset;  	uint16 wSize; -};  +};  struct ResourceSource {  	ResSourceType source_type; diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp index a185305788..d12a791c88 100644 --- a/engines/sci/sci.cpp +++ b/engines/sci/sci.cpp @@ -201,7 +201,7 @@ Common::Error SciEngine::run() {  		}  	} else if (version >= SCI_VERSION_1_EARLY && version <= SCI_VERSION_1_LATE) {  		// SCI1 -		 +  		if (gamestate->flags & GF_SCI0_OLD ||  			gamestate->flags & GF_SCI0_OLDGFXFUNCS ||  			gamestate->flags & GF_SCI0_OLDGETTIME) { diff --git a/engines/sci/sci.h b/engines/sci/sci.h index 53eda6246e..096a1a3c7e 100644 --- a/engines/sci/sci.h +++ b/engines/sci/sci.h @@ -111,7 +111,7 @@ enum SciGameFlags {  	/*  	** SCI1 flags  	*/ -	 +  	/*  	** Used to distinguish SCI1 EGA games  	*/ diff --git a/engines/sci/sfx/iterator.cpp b/engines/sci/sfx/iterator.cpp index 912e6e01a6..de362a79b7 100644 --- a/engines/sci/sfx/iterator.cpp +++ b/engines/sci/sfx/iterator.cpp @@ -532,7 +532,7 @@ static int _sci0_get_pcm_data(Sci0SongIterator *self,  static Audio::AudioStream *makeStream(byte *data, int size, sfx_pcm_config_t conf) {  	printf("Playing PCM data of size %d, rate %d\n", size, conf.rate); -	 +  	// Duplicate the data  	byte *sound = (byte *)malloc(size);  	memcpy(sound, data, size); @@ -1234,9 +1234,9 @@ int FastForwardSongIterator::getTimepos() {  	return _delegate->getTimepos();  } -FastForwardSongIterator::FastForwardSongIterator(SongIterator *capsit, int delta)  +FastForwardSongIterator::FastForwardSongIterator(SongIterator *capsit, int delta)  	: _delegate(capsit), _delta(delta) { -	 +  	channel_mask = capsit->channel_mask;  } diff --git a/engines/sci/sfx/iterator_internal.h b/engines/sci/sfx/iterator_internal.h index 4f8665d336..88103ad8c9 100644 --- a/engines/sci/sfx/iterator_internal.h +++ b/engines/sci/sfx/iterator_internal.h @@ -47,7 +47,7 @@ enum {  };  struct SongIteratorChannel { -	 +  	int state;	//!< State of this song iterator channel  	int offset;     //!< Offset into the data chunk */  	int end;	//!< Last allowed byte in track */ diff --git a/engines/sci/vocab_debug.cpp b/engines/sci/vocab_debug.cpp index 8117d55308..9b969a75ad 100644 --- a/engines/sci/vocab_debug.cpp +++ b/engines/sci/vocab_debug.cpp @@ -70,7 +70,7 @@ bool vocabulary_get_snames(ResourceManager *resmgr, bool isOldSci0, Common::Stri  	for (int i = 0; i < count; i++) {  		int offset = READ_LE_UINT16(r->data + 2 + i * 2);  		int len = READ_LE_UINT16(r->data + offset); -		 +  		Common::String tmp((const char *)r->data + offset + 2, len);  		selectorNames.push_back(tmp);  | 
