[Scummvm-cvs-logs] CVS: scummvm/common config-file.cpp,1.11,1.12 engine.cpp,1.14,1.15 engine.h,1.15,1.16 file.cpp,1.23,1.24 gameDetector.cpp,1.80,1.81 gameDetector.h,1.29,1.30 list.h,1.3,1.4 main.cpp,1.19,1.20 map.h,1.6,1.7 scaler.cpp,1.7,1.8 scummsys.h,1.15,1.16 str.cpp,1.13,1.14 str.h,1.8,1.9 system.h,1.20,1.21 timer.cpp,1.5,1.6 util.cpp,1.7,1.8 util.h,1.10,1.11

Pawel Kolodziejski aquadran at users.sourceforge.net
Thu Mar 6 08:42:18 CET 2003


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv644

Modified Files:
	config-file.cpp engine.cpp engine.h file.cpp gameDetector.cpp 
	gameDetector.h list.h main.cpp map.h scaler.cpp scummsys.h 
	str.cpp str.h system.h timer.cpp util.cpp util.h 
Log Message:
next pedantic cleanup code

Index: config-file.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/config-file.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- config-file.cpp	21 Nov 2002 17:25:31 -0000	1.11
+++ config-file.cpp	6 Mar 2003 16:26:55 -0000	1.12
@@ -29,14 +29,12 @@
 
 #define MAXLINELEN 256
 
-static char *ltrim(char *t)
-{
+static char *ltrim(char *t) {
 	for (; *t && (*t == ' '); t++);
 	return t;
 }
 
-static char *rtrim(char *t)
-{
+static char *rtrim(char *t) {
 	int l;
 
 	for (l = strlen(t) - 1; l; l--) {
@@ -52,8 +50,7 @@
 // The config-class itself.
 
 Config::Config (const String &cfg, const String &d)
- : filename(cfg), defaultDomain(d), willwrite(false)
-{
+ : filename(cfg), defaultDomain(d), willwrite(false) {
 	FILE *cfg_file;
 	char t[MAXLINELEN];
 
@@ -103,8 +100,7 @@
 	}
 }
 
-const char *Config::get(const String &key, const String &d) const
-{
+const char *Config::get(const String &key, const String &d) const {
 	String domain;
 
 	if (d.isEmpty())
@@ -119,26 +115,23 @@
 	return 0;
 }
 
-const int Config::getInt(const String &key, int def, const String &d) const
-{
+const int Config::getInt(const String &key, int def, const String &d) const {
 	const char *value = get(key, d);
-	
+
 	if (value)
 		return atoi(value);
 	return def;
 }
 
-const bool Config::getBool(const String &key, bool def, const String &d) const
-{
+const bool Config::getBool(const String &key, bool def, const String &d) const {
 	const char *value = get(key, d);
-	
+
 	if (value)
 		return !scumm_stricmp(value, "true");
 	return def;
 }
 
-void Config::set(const String &key, const String &value, const String &d)
-{
+void Config::set(const String &key, const String &value, const String &d) {
 	String domain(d);
 
 	if (domain.isEmpty())
@@ -148,34 +141,29 @@
 	domains[domain][key] = value;
 }
 
-void Config::setInt(const String &key, int value_i, const String &d)
-{
+void Config::setInt(const String &key, int value_i, const String &d) {
 	char value[MAXLINELEN];
 	sprintf(value, "%i", value_i);
 	set(key, String(value), d);
 }
 
-void Config::setBool(const String &key, bool value_b, const String &d)
-{
+void Config::setBool(const String &key, bool value_b, const String &d) {
 	String value(value_b ? "true" : "false");
 	set(key, value, d);
 }
 
-void Config::set_domain(const String &d)
-{
+void Config::set_domain(const String &d) {
 	defaultDomain = d;
 	defaultDomain.toLowercase();
 }
 
-bool Config::has_domain(const String &d) const
-{
+bool Config::has_domain(const String &d) const {
 	String temp(d);
 	temp.toLowercase();
 	return domains.contains(temp);
 }
 
-void Config::flush() const
-{
+void Config::flush() const {
 	FILE *cfg_file;
 
 	if (!willwrite)
@@ -187,7 +175,7 @@
 		DomainMap::Iterator d;
 		for (d = domains.begin(); d != domains.end(); ++d) {
 			fprintf(cfg_file, "[%s]\n", d->_key.c_str());
-			
+
 			const StringMap &data = d->_value;
 			StringMap::Iterator x;
 			for (x = data.begin(); x != data.end(); ++x) {
@@ -201,8 +189,7 @@
 	}
 }
 
-void Config::rename_domain(const String &oldD, const String &newD)
-{
+void Config::rename_domain(const String &oldD, const String &newD) {
 	String oldDomain(oldD);
 	String newDomain(newD);
 	oldDomain.toLowercase();
@@ -219,29 +206,24 @@
 	domains.remove(oldDomain);
 }
 
-void Config::delete_domain(const String &d)
-{
+void Config::delete_domain(const String &d) {
 	String domain(d);
 	domain.toLowercase();
-
 	domains.remove(d);
 }
 
-void Config::set_filename(const String &f)
-{
+void Config::set_filename(const String &f) {
 	filename = f;
 }
 
-void Config::merge_config(const Config &c)
-{
+void Config::merge_config(const Config &c) {
 	DomainMap::Iterator d, end(c.domains.end());
 	for (d = c.domains.begin(); d != end; ++d) {
 		domains[d->_key].merge(d->_value);
 	}
 }
 
-void Config::set_writing(bool w)
-{
+void Config::set_writing(bool w) {
 	willwrite = w;
 }
 
@@ -260,7 +242,7 @@
 	for (d = domains.begin(); d != end; ++d) {
 		domainNames.push_back(d->_key);
 	}
-	
+
 	return domainNames;
 }
 

Index: engine.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/engine.cpp,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- engine.cpp	5 Mar 2003 19:04:26 -0000	1.14
+++ engine.cpp	6 Mar 2003 16:26:56 -0000	1.15
@@ -30,8 +30,7 @@
 SoundMixer *g_mixer = 0;
 
 Engine::Engine(GameDetector *detector, OSystem *syst)
-	: _system(syst)
-{
+	: _system(syst) {
 	_mixer = new SoundMixer();
 
 	_gameDataPath = detector->_gameDataPath;
@@ -43,14 +42,12 @@
 	_timer->init();
 }
 
-Engine::~Engine()
-{
+Engine::~Engine() {
 	delete _mixer;
 	delete _timer;
 }
 
-const char *Engine::getSavePath() const
-{
+const char *Engine::getSavePath() const {
 	const char *dir = NULL;
 
 #ifdef _WIN32_WCE
@@ -77,8 +74,7 @@
 	return dir;
 }
 
-Engine *Engine::createFromDetector(GameDetector *detector, OSystem *syst)
-{
+Engine *Engine::createFromDetector(GameDetector *detector, OSystem *syst) {
 	Engine *engine = NULL;
 
 	if (detector->_gameId >= GID_SIMON_FIRST && detector->_gameId <= GID_SIMON_LAST) {
@@ -97,8 +93,7 @@
 	return engine;
 }
 
-void CDECL warning(const char *s, ...)
-{
+void CDECL warning(const char *s, ...) {
 	char buf[1024];
 	va_list va;
 
@@ -119,8 +114,7 @@
 
 uint16 _debugLevel = 1;
 
-void CDECL debug(int level, const char *s, ...)
-{
+void CDECL debug(int level, const char *s, ...) {
 	char buf[1024];
 	va_list va;
 
@@ -140,8 +134,7 @@
 	fflush(stdout);
 }
 
-void checkHeap()
-{
+void checkHeap() {
 #if defined(WIN32)
 	if (_heapchk() != _HEAPOK) {
 		error("Heap is invalid!");

Index: engine.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/engine.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- engine.h	5 Mar 2003 19:04:28 -0000	1.15
+++ engine.h	6 Mar 2003 16:26:57 -0000	1.16
@@ -50,7 +50,7 @@
 
 	// Invoke the main engine loop using this method
 	virtual void go() = 0;
-	
+
 	// Get the save game dir path
 	const char *getSavePath() const;
 

Index: file.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/file.cpp,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- file.cpp	12 Jan 2003 01:06:28 -0000	1.23
+++ file.cpp	6 Mar 2003 16:26:58 -0000	1.24
@@ -56,7 +56,7 @@
 		strcpy(buf, directory);
 		if (directory[0] != 0) {
 #ifdef __MORPHOS__
-			if (buf[strlen(buf)-1] != ':' && buf[strlen(buf)-1] != '/')
+			if (buf[strlen(buf) - 1] != ':' && buf[strlen(buf) - 1] != '/')
 #endif
 			strcat(buf, "/");
 		}
@@ -97,7 +97,6 @@
 }
 
 bool File::open(const char *filename, const char *directory, int mode, byte encbyte) {
-
 	if (_handle) {
 		debug(2, "File %s already opened", filename);
 		return false;
@@ -127,7 +126,7 @@
 	}
 
 	_encbyte = encbyte;
-	
+
 	int len = strlen(filename);
 	_name = new char[len+1];
 	memcpy(_name, filename, len+1);
@@ -181,7 +180,7 @@
 	fseek(_handle, 0, SEEK_END);
 	uint32 length = ftell(_handle);
 	fseek(_handle, oldPos, SEEK_SET);
-	
+
 	return length;
 }
 

Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.cpp,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- gameDetector.cpp	5 Mar 2003 19:04:29 -0000	1.80
+++ gameDetector.cpp	6 Mar 2003 16:26:59 -0000	1.81
@@ -20,14 +20,12 @@
  *
  */
 
-
 #include "stdafx.h"
 #include "sound/mididrv.h"
 #include "common/engine.h"
 #include "common/gameDetector.h"
 #include "common/config-file.h"
 
-
 #define CHECK_OPTION() if ((current_option != NULL) || (*s != '\0')) goto ShowHelpAndExit
 #define HANDLE_OPTION() if ((*s == '\0') && (current_option == NULL)) goto ShowHelpAndExit;  \
                         if ((*s != '\0') && (current_option != NULL)) goto ShowHelpAndExit; \
@@ -75,12 +73,9 @@
 	"\t-u         - dump scripts\n"
 ;
 
-
-
 // This contains a pointer to a list of all supported games.
 const VersionSettings *version_settings = NULL;
 
-
 static const struct GraphicsModes gfx_modes[] = {
 	{"normal", "Normal (no scaling)", GFX_NORMAL},
 	{"1x", "Normal (no scaling)", GFX_NORMAL},
@@ -122,17 +117,14 @@
 	{0, 0, 0}
 };
 
-
-static int countVersions(const VersionSettings *v)
-{
+static int countVersions(const VersionSettings *v) {
 	int count;
 	for (count = 0; v->filename; v++, count++)
 		;
 	return count;
 }
 
-GameDetector::GameDetector()
-{
+GameDetector::GameDetector() {
 	_fullScreen = false;
 	_gameId = 0;
 
@@ -205,9 +197,8 @@
 	}
 }
 
-void GameDetector::updateconfig()
-{
-	const char * val;
+void GameDetector::updateconfig() {
+	const char *val;
 
 	_amiga = g_config->getBool("amiga", _amiga);
 
@@ -260,12 +251,9 @@
 		_gameTempo = strtol(val, NULL, 0);
 
 	_talkSpeed = g_config->getInt("talkspeed", _talkSpeed);
-
-
 }
 
-void GameDetector::list_games()
-{
+void GameDetector::list_games() {
 	const VersionSettings *v = version_settings;
 	char config[4] = "";
 
@@ -292,8 +280,7 @@
 		
 }
 
-void GameDetector::parseCommandLine(int argc, char **argv)
-{
+void GameDetector::parseCommandLine(int argc, char **argv) {
 	int i;
 	char *s;
 	char *current_option = NULL;
@@ -354,7 +341,7 @@
 			case 'l':
 				HANDLE_OPTION();
 				{
-					Config * newconfig = new Config(option, "scummvm");
+					Config *newconfig = new Config(option, "scummvm");
 					g_config->merge_config(*newconfig);
 					delete newconfig;
 					updateconfig();
@@ -431,7 +418,7 @@
 				break;
 			case 'y':
 				HANDLE_OPTION();
-				_talkSpeed = atoi(option);				
+				_talkSpeed = atoi(option);
 				g_config->setInt("talkspeed", _talkSpeed);
 				break;
 			case 'z':
@@ -458,13 +445,12 @@
 
 	return;
 
- ShowHelpAndExit:
+ShowHelpAndExit:
 	printf(USAGE_STRING);
 	exit(1);
 }
 
-void GameDetector::setGame(const String &name)
-{
+void GameDetector::setGame(const String &name) {
 	_gameFileName = name;
 	g_config->set_domain(name);
 	g_config->rename_domain(name, "game-specific");
@@ -472,8 +458,7 @@
 	updateconfig();
 }
 
-int GameDetector::parseGraphicsMode(const char *s)
-{
+int GameDetector::parseGraphicsMode(const char *s) {
 	const GraphicsModes *gm = gfx_modes;
 	while(gm->name) {
 		if (!scumm_stricmp(gm->name, s))
@@ -484,8 +469,7 @@
 	return -1;
 }
 
-int GameDetector::parseLanguage(const char *s)
-{
+int GameDetector::parseLanguage(const char *s) {
 	const Languages *l = languages;
 	while(l->name) {
 		if (!scumm_stricmp(l->name, s))
@@ -496,41 +480,38 @@
 	return -1;
 }
 
-bool GameDetector::isMusicDriverAvailable(int drv)
-{
+bool GameDetector::isMusicDriverAvailable(int drv) {
 	switch(drv) {
 	case MD_AUTO:
-	case MD_NULL:		return true;
-	case MD_ADLIB:		return true;
+	case MD_NULL: return true;
+	case MD_ADLIB: return true;
 #if defined(WIN32) && !defined(_WIN32_WCE)
-	case MD_WINDOWS:	return true;
+	case MD_WINDOWS: return true;
 #endif
 #if defined(__MORPHOS__)
-	case MD_ETUDE:		return true;
+	case MD_ETUDE: return true;
 #endif
 #if defined(UNIX) && !defined(__BEOS__) && !defined(MACOSX)
-	case MD_SEQ:		return true;
+	case MD_SEQ: return true;
 #endif
 #if defined(MACOSX) || defined(macintosh)
-	case MD_QTMUSIC:	return true;
+	case MD_QTMUSIC: return true;
 #endif
 #if defined(MACOSX)
-	case MD_COREAUDIO:	return true;
+	case MD_COREAUDIO: return true;
 #endif
 #if defined(UNIX) && defined(USE_ALSA)
-	case MD_ALSA:		return true;
+	case MD_ALSA: return true;
 #endif
 	}
 	return false;
 }
 
-const MusicDrivers *GameDetector::getMusicDrivers()
-{
+const MusicDrivers *GameDetector::getMusicDrivers() {
 	return music_drivers;
 }
 
-bool GameDetector::parseMusicDriver(const char *s)
-{
+bool GameDetector::parseMusicDriver(const char *s) {
 	const MusicDrivers *md = music_drivers;
 
 	while (md->name) {
@@ -545,15 +526,14 @@
 	return false;
 }
 
-bool GameDetector::detectGame()
-{
+bool GameDetector::detectGame() {
 	const VersionSettings *gnl = version_settings;
 	char *realGame;
 	_gameId = 0;
 	_gameText.clear();
 
-	if (!(realGame = (char*)g_config->get("gameid")))
-		realGame = (char*)_gameFileName.c_str();
+	if (!(realGame = (char *)g_config->get("gameid")))
+		realGame = (char *)_gameFileName.c_str();
 	printf("Looking for %s\n", realGame);
 
 	do {
@@ -576,8 +556,7 @@
 	return false;
 }
 
-const ScummVM::String& GameDetector::getGameName()
-{
+const ScummVM::String& GameDetector::getGameName() {
 	if (_gameText.isEmpty()) {
 		_gameText = "Unknown game: \"";
 		_gameText += _gameFileName;
@@ -586,8 +565,7 @@
 	return _gameText;
 }
 
-int GameDetector::detectMain()
-{
+int GameDetector::detectMain() {
 	if (_gameFileName.isEmpty()) {
 		warning("No game was specified...");
 		return (-1);

Index: gameDetector.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- gameDetector.h	5 Mar 2003 19:04:31 -0000	1.29
+++ gameDetector.h	6 Mar 2003 16:26:59 -0000	1.30
@@ -113,7 +113,7 @@
 
 public:
 	GameDetector();
-	
+
 	void parseCommandLine(int argc, char **argv);
 	int detectMain();
 	void setGame(const String &name);

Index: list.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/list.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- list.h	14 Nov 2002 13:33:16 -0000	1.3
+++ list.h	6 Mar 2003 16:27:00 -0000	1.4
@@ -29,35 +29,31 @@
 template <class T>
 class List {
 protected:
-	int		_capacity;
-	int		_size;
-	T		*_data;
+	int _capacity;
+	int _size;
+	T *_data;
 
 public:
 	List<T>() : _capacity(0), _size(0), _data(0) {}
-	List<T>(const List<T>& list) : _capacity(0), _size(0), _data(0)
-	{
+	List<T>(const List<T>& list) : _capacity(0), _size(0), _data(0) {
 		_size = list._size;
 		_capacity = _size + 32;
 		_data = new T[_capacity];
 		for (int i = 0; i < _size; i++)
 			_data[i] = list._data[i];
 	}
-	
-	~List<T>()
-	{
+
+	~List<T>() {
 		if (_data)
 			delete [] _data;
 	}
-	
-	void push_back(const T& element)
-	{
+
+	void push_back(const T& element) {
 		ensureCapacity(_size + 1);
 		_data[_size++] = element;
 	}
-	
-	void insert_at(int idx, const T& element)
-	{
+
+	void insert_at(int idx, const T& element) {
 		assert(idx >= 0 && idx <= _size);
 		ensureCapacity(_size + 1);
 		// The following loop is not efficient if you can just memcpy things around.
@@ -70,23 +66,20 @@
 		_size++;
 	}
 
-	
+
 	// TODO: insert, remove, ...
-	
-	T& operator [](int idx)
-	{
+
+	T& operator [](int idx) {
 		assert(idx >= 0 && idx < _size);
 		return _data[idx];
 	}
 
-	const T& operator [](int idx) const
-	{
+	const T& operator [](int idx) const {
 		assert(idx >= 0 && idx < _size);
 		return _data[idx];
 	}
 
-	List<T>& operator  =(const List<T>& list)
-	{
+	List<T>& operator  =(const List<T>& list) {
 		if (_data)
 			delete [] _data;
 		_size = list._size;
@@ -98,10 +91,11 @@
 		return *this;
 	}
 
-	int size() const	{ return _size; }
+	int size() const {
+		return _size;
+	}
 
-	void clear()
-	{
+	void clear() {
 		if (_data) {
 			delete [] _data;
 			_data = 0;
@@ -110,18 +104,19 @@
 		_capacity = 0;
 	}
 	
-	bool isEmpty() const	{ return (_size == 0); }
+	bool isEmpty() const { 
+		return (_size == 0);
+	}
 
 protected:
-	void ensureCapacity(int new_len)
-	{
+	void ensureCapacity(int new_len) {
 		if (new_len <= _capacity)
 			return;
-	
+
 		T *old_data = _data;
 		_capacity = new_len + 32;
 		_data = new T[_capacity];
-	
+
 		if (old_data) {
 			// Copy old data
 			for (int i = 0; i < _size; i++)
@@ -131,7 +126,6 @@
 	}
 };
 
-
-};	// End of namespace ScummVM
+};// End of namespace ScummVM
 
 #endif

Index: main.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/main.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -d -r1.19 -r1.20
--- main.cpp	25 Nov 2002 23:28:10 -0000	1.19
+++ main.cpp	6 Mar 2003 16:27:01 -0000	1.20
@@ -31,7 +31,6 @@
 Config *g_config = 0;
 NewGui *g_gui = 0;
 
-
 #if defined(QTOPIA)
 // FIXME - why exactly is this needed?
 extern "C" int main(int argc, char *argv[]);
@@ -99,8 +98,7 @@
 
 #endif
 
-static void launcherDialog(GameDetector &detector, OSystem *system)
-{
+static void launcherDialog(GameDetector &detector, OSystem *system) {
 	// FIXME - we need to call init_size() here so that we can display for example
 	// the launcher dialog. But the Engine object will also call it again (possibly
 	// with a different widht/height!9 However, this method is not for all OSystem 
@@ -143,8 +141,7 @@
 	dlg.runModal();
 }
 
-int main(int argc, char *argv[])
-{
+int main(int argc, char *argv[]) {
 	GameDetector detector;
 	OSystem::Property prop;
 
@@ -157,12 +154,12 @@
 		sprintf(scummhome,"%s/%s", getenv("HOME"), DEFAULT_CONFIG_FILE);
 	else strcpy(scummhome,DEFAULT_CONFIG_FILE);
 #else
-    char scummhome[256];
+	char scummhome[256];
 	#if defined (WIN32) && !defined(_WIN32_WCE)
 		GetWindowsDirectory(scummhome, 256);
 		strcat(scummhome, "\\");
 		strcat(scummhome, DEFAULT_CONFIG_FILE);
-	#else	
+	#else
 		strcpy(scummhome, DEFAULT_CONFIG_FILE);
 	#endif
 #endif
@@ -170,7 +167,7 @@
 	// Read the config file
 	g_config = new Config(scummhome, "scummvm");
 	g_config->set("versioninfo", SCUMMVM_VERSION);
-	
+
 	// Parse the command line information
 	detector._saveconfig = false;
 	detector.updateconfig();
@@ -193,9 +190,9 @@
 	// Verify the given game name
 	if (detector.detectMain()) {
 		system->quit();
-		return (-1);
+		return -1;
 	}
-	
+
 	// Set the window caption to the game name
 	prop.caption = detector.getGameName().c_str();
 	system->property(OSystem::PROP_SET_WINDOW_CAPTION, &prop);
@@ -205,15 +202,15 @@
 
 	// Run the game engine
 	engine->go();
-	
+
 	// Free up memory
 	delete engine;
 	delete g_gui;
 	delete g_config;
-	
+
 	// ...and quit (the return 0 should never be reached)
 	system->quit();
-	
+
 	return 0;
 }
 

Index: map.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/map.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- map.h	13 Nov 2002 13:42:05 -0000	1.6
+++ map.h	6 Mar 2003 16:27:02 -0000	1.7
@@ -50,8 +50,7 @@
 		const Node &operator *() const { assert(_node != 0); return *_node; }
         const Node *operator->() const { assert(_node != 0); return _node; }
         bool operator !=(const Iterator &iter) const { return _node != iter._node; }
-		void operator ++()
-		{
+		void operator ++() {
 			if (!_node)
 				return;
 			if (_node->_right) {
@@ -64,25 +63,23 @@
 					_node = parent;
 					parent = _node->_parent;
 				}
-				
+
 				if (_node->_right != parent)
 					_node = parent;
 			}
-			
+
 			if (_node->_parent == 0)
 				_node = 0;
 		}
 	};
 
 public:
-	Map<Key, Value>() : _root(0)
-	{
+	Map<Key, Value>() : _root(0) {
 		_header = new Node();
 		_header->_right = _header->_left = _header;
 	}
 	
-	~Map<Key, Value>()
-	{
+	~Map<Key, Value>() {
 		clearNodes(_root);
 		delete _header;
 		_root = _header = 0;
@@ -92,8 +89,7 @@
 	 * Return the object for the given key. If no match is found, a new entry
 	 * with the given key and the default data value is inserted.
 	 */
-	Value &operator [](const Key &key)
-	{
+	Value &operator [](const Key &key) {
 		Node *node;
 		if (!_root)
 			node = _root = new Node(key, _header);
@@ -102,38 +98,33 @@
 		return node->_value;
 	}
 
-	const Value &operator [](const Key &key) const
-	{
+	const Value &operator [](const Key &key) const {
 		Node *node = findNode(_root, key);
 		assert(node != 0);
 		return node->_value;
 	}
-	
-	bool contains(const Key &key) const
-	{
+
+	bool contains(const Key &key) const {
 		return (findNode(_root, key) != 0);
 	}
 
-	void clear()
-	{
+	void clear() {
 		clearNodes(_root);
 		_root = 0;
 	}
 
-	bool isEmpty() const
-	{
+	bool isEmpty() const {
 		return (_root == 0);
 	}
 
-	void remove(const Key &key)
-	{
+	void remove(const Key &key) {
 		// TODO - implement efficiently. Indeed, maybe switch to using red-black trees?
 		// For now, just a lame, bad remove algorithm. Rule: don't remove elements
 		// from one of our maps if you need to be efficient :-)
 		Node *node = findNode(_root, key);
 		if (!node)
 			return;
-		
+
 		// Now we have to remove 'node'. There are two simple cases and one hard.
 		Node *parent = node->_parent;
 		Node *rep;
@@ -144,9 +135,9 @@
 		} else {
 			// We have to do it the hard way since both children are present.
 			Node *n2;
-			
+
 			n2 = rep = node->_right;
-			
+
 			// Now insert the left child leftmost into our right child
 			while (n2->_left)
 				n2 = n2->_left;
@@ -167,9 +158,8 @@
 		// Finally free the allocated memory
 		delete node;
 	}
-	
-	void merge(const Map<Key, Value> &map)
-	{
+
+	void merge(const Map<Key, Value> &map) {
 		// FIXME - this is a very bad algorithm.
 		// Right now we insert the items from 'map' using the default iterator,
 		// which gives us the objects ordered, leading to an unbalanced tree.
@@ -182,9 +172,8 @@
 			(*this)[x->_key] = x->_value;
 		}
 	}
-	
-	Iterator	begin() const
-	{
+
+	Iterator	begin() const {
 		Node *node = _root;
 		if (node) {
 			while (node->_left)
@@ -192,16 +181,14 @@
 		}
 		return Iterator(node);
 	}
-	
-	Iterator	end() const
-	{
+
+	Iterator	end() const {
 		return Iterator();
 	}
 
 protected:
 	// Find the node matching the given key, if any
-	Node *findNode(Node *node, const Key &key) const
-	{
+	Node *findNode(Node *node, const Key &key) const {
 		while (node && (key != node->_key)) {
 			if (key < node->_key) {
 				node = node->_left;
@@ -212,8 +199,7 @@
 		return node;
 	}
 
-	Node *createNode(Node *node, const Key &key)
-	{
+	Node *createNode(Node *node, const Key &key) {
 		Node *prevNode = 0;
 		bool left = true;
 		while (node) {
@@ -236,9 +222,8 @@
 		}
 		return node;
 	}
-	
-	void clearNodes(Node *node)
-	{
+
+	void clearNodes(Node *node) {
 		if (!node)
 			return;
 

Index: scaler.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- scaler.cpp	2 Mar 2003 16:36:52 -0000	1.7
+++ scaler.cpp	6 Mar 2003 16:27:03 -0000	1.8
@@ -33,21 +33,20 @@
 static uint32 greenMask = 0x7E0;
 
 static const uint16 dotmatrix_565[16] = {
-  0x01E0, 0x0007, 0x3800, 0x0000,
-  0x39E7, 0x0000, 0x39E7, 0x0000,
-  0x3800, 0x0000, 0x01E0, 0x0007,
-  0x39E7, 0x0000, 0x39E7, 0x0000
+	0x01E0, 0x0007, 0x3800, 0x0000,
+	0x39E7, 0x0000, 0x39E7, 0x0000,
+	0x3800, 0x0000, 0x01E0, 0x0007,
+	0x39E7, 0x0000, 0x39E7, 0x0000
 };
 static const uint16 dotmatrix_555[16] = {
-  0x00E0, 0x0007, 0x1C00, 0x0000,
-  0x1CE7, 0x0000, 0x1CE7, 0x0000,
-  0x1C00, 0x0000, 0x00E0, 0x0007,
-  0x1CE7, 0x0000, 0x1CE7, 0x0000
+	0x00E0, 0x0007, 0x1C00, 0x0000,
+	0x1CE7, 0x0000, 0x1CE7, 0x0000,
+	0x1C00, 0x0000, 0x00E0, 0x0007,
+	0x1CE7, 0x0000, 0x1CE7, 0x0000
 };
 static const uint16 *dotmatrix;
 
-int Init_2xSaI(uint32 BitFormat)
-{
+int Init_2xSaI(uint32 BitFormat) {
 	if (BitFormat == 565) {
 		colorMask = 0xF7DEF7DE;
 		lowPixelMask = 0x08210821;
@@ -71,8 +70,7 @@
 	return 1;
 }
 
-static inline int GetResult1(uint32 A, uint32 B, uint32 C, uint32 D, uint32 /* E */ )
-{
+static inline int GetResult1(uint32 A, uint32 B, uint32 C, uint32 D, uint32 /* E */ ) {
 	int x = 0;
 	int y = 0;
 	int r = 0;
@@ -92,8 +90,7 @@
 	return r;
 }
 
-static inline int GetResult2(uint32 A, uint32 B, uint32 C, uint32 D, uint32 /* E */ )
-{
+static inline int GetResult2(uint32 A, uint32 B, uint32 C, uint32 D, uint32 /* E */ ) {
 	int x = 0;
 	int y = 0;
 	int r = 0;
@@ -113,8 +110,7 @@
 	return r;
 }
 
-static inline int GetResult(uint32 A, uint32 B, uint32 C, uint32 D)
-{
+static inline int GetResult(uint32 A, uint32 B, uint32 C, uint32 D) {
 	int x = 0;
 	int y = 0;
 	int r = 0;
@@ -134,16 +130,14 @@
 	return r;
 }
 
-static inline uint32 INTERPOLATE(uint32 A, uint32 B)
-{
+static inline uint32 INTERPOLATE(uint32 A, uint32 B) {
 	if (A != B) {
 		return (((A & colorMask) >> 1) + ((B & colorMask) >> 1) + (A & B & lowPixelMask));
 	} else
 		return A;
 }
 
-static inline uint32 Q_INTERPOLATE(uint32 A, uint32 B, uint32 C, uint32 D)
-{
+static inline uint32 Q_INTERPOLATE(uint32 A, uint32 B, uint32 C, uint32 D) {
 	register uint32 x = ((A & qcolorMask) >> 2) +
 		((B & qcolorMask) >> 2) + ((C & qcolorMask) >> 2) + ((D & qcolorMask) >> 2);
 	register uint32 y = (A & qlowpixelMask) +
@@ -162,8 +156,7 @@
 #define GREEN_MASK555 0x03E003E0
 
 void Super2xSaI(uint8 *srcPtr, uint32 srcPitch,
-								uint8 *deltaPtr, uint8 *dstPtr, uint32 dstPitch, int width, int height)
-{
+								uint8 *deltaPtr, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
 	uint16 *bP;
 	uint8 *dP;
 	uint32 inc_bP;
@@ -281,8 +274,7 @@
 }
 
 void SuperEagle(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr,
-								uint8 *dstPtr, uint32 dstPitch, int width, int height)
-{
+								uint8 *dstPtr, uint32 dstPitch, int width, int height) {
 	uint8 *dP;
 	uint16 *bP;
 	uint32 inc_bP;
@@ -401,13 +393,11 @@
 }
 
 void _2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 *deltaPtr,
-						uint8 *dstPtr, uint32 dstPitch, int width, int height)
-{
+						uint8 *dstPtr, uint32 dstPitch, int width, int height) {
 	uint8 *dP;
 	uint16 *bP;
 	uint32 inc_bP;
 
-
 	{
 		inc_bP = 1;
 
@@ -554,8 +544,7 @@
 	}
 }
 
-static uint32 Bilinear(uint32 A, uint32 B, uint32 x)
-{
+static uint32 Bilinear(uint32 A, uint32 B, uint32 x) {
 	unsigned long areaA, areaB;
 	unsigned long result;
 
@@ -571,11 +560,9 @@
 	result = ((areaA * A) + (areaB * B)) >> 5;
 
 	return (result & redblueMask) | ((result >> 16) & greenMask);
-
 }
 
-static uint32 Bilinear4(uint32 A, uint32 B, uint32 C, uint32 D, uint32 x, uint32 y)
-{
+static uint32 Bilinear4(uint32 A, uint32 B, uint32 C, uint32 D, uint32 x, uint32 y) {
 	unsigned long areaA, areaB, areaC, areaD;
 	unsigned long result, xy;
 
@@ -600,8 +587,7 @@
 
 void Scale_2xSaI(uint8 *srcPtr, uint32 srcPitch, uint8 * /* deltaPtr */ ,
 								 uint8 *dstPtr, uint32 dstPitch,
-								 uint32 dstWidth, uint32 dstHeight, int width, int height)
-{
+								 uint32 dstWidth, uint32 dstHeight, int width, int height) {
 	uint8 *dP;
 	uint16 *bP;
 
@@ -732,8 +718,7 @@
 }
 
 void AdvMame2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
-							 int width, int height)
-{
+							 int width, int height) {
 	unsigned int nextlineSrc = srcPitch / sizeof(short);
 	short *p = (short *)srcPtr;
 
@@ -762,10 +747,8 @@
 	}
 }
 
-
 void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
-							int width, int height)
-{
+							int width, int height) {
 	while (height--) {
 		memcpy(dstPtr, srcPtr, 2 * width);
 		srcPtr += srcPitch;
@@ -774,8 +757,7 @@
 }
 
 void Normal2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
-							int width, int height)
-{
+							int width, int height) {
 	uint8 *r;
 
 	while (height--) {
@@ -794,8 +776,7 @@
 }
 
 void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
-							int width, int height)
-{
+							int width, int height) {
 	uint8 *r;
 	uint32 dstPitch2 = dstPitch * 2;
 	uint32 dstPitch3 = dstPitch * 3;
@@ -821,8 +802,7 @@
 }
 
 void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, 
-					int width, int height)
-{
+					int width, int height) {
 	unsigned int nextlineSrc = srcPitch / sizeof(uint16);
 	uint16 *p = (uint16 *)srcPtr;
 

Index: scummsys.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scummsys.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- scummsys.h	17 Dec 2002 01:15:13 -0000	1.15
+++ scummsys.h	6 Mar 2003 16:27:03 -0000	1.16
@@ -31,356 +31,353 @@
 #endif
 
 #if defined(_MSC_VER)
-  
-  //#pragma warning (disable: 4244)
-  //#pragma warning (disable: 4101)
-  
-  #define scumm_stricmp stricmp
-  #define snprintf _snprintf
-  
-  #if defined(CHECK_HEAP)
-  #undef CHECK_HEAP
-  #define CHECK_HEAP checkHeap();
-  #else
-  #define CHECK_HEAP
-  #endif
-  
-  #define SCUMM_LITTLE_ENDIAN
-  
-  #define FORCEINLINE __forceinline
-  #define NORETURN _declspec(noreturn)
-  
-  typedef unsigned char byte;
-  typedef unsigned char uint8;
-  typedef unsigned short uint16;
-  typedef unsigned long uint32;
-  typedef unsigned int uint;
-  typedef signed char int8;
-  typedef signed short int16;
-  typedef signed long int32;
-  
-  #define START_PACK_STRUCTS pack (push,1)
-  #define END_PACK_STRUCTS   pack(pop)
-  #define GCC_PACK
+
+	//#pragma warning (disable: 4244)
+	//#pragma warning (disable: 4101)
+
+	#define scumm_stricmp stricmp
+	#define snprintf _snprintf
+
+	#if defined(CHECK_HEAP)
+	#undef CHECK_HEAP
+	#define CHECK_HEAP checkHeap();
+	#else
+	#define CHECK_HEAP
+	#endif
+
+	#define SCUMM_LITTLE_ENDIAN
+
+	#define FORCEINLINE __forceinline
+	#define NORETURN _declspec(noreturn)
+
+	typedef unsigned char byte;
+	typedef unsigned char uint8;
+	typedef unsigned short uint16;
+	typedef unsigned long uint32;
+	typedef unsigned int uint;
+	typedef signed char int8;
+	typedef signed short int16;
+	typedef signed long int32;
+	
+	#define START_PACK_STRUCTS pack(push, 1)
+	#define END_PACK_STRUCTS	 pack(pop)
+	#define GCC_PACK
 
 #if defined(_WIN32_WCE) && _WIN32_WCE < 300
 
-  #define CDECL __cdecl
+	#define CDECL __cdecl
 
 #endif
 
 #elif defined(__MINGW32__)
-  
-  #define scumm_stricmp stricmp
-  #define CHECK_HEAP
-  #define SCUMM_LITTLE_ENDIAN
-  
-  #define FORCEINLINE inline
-  #define NORETURN __attribute__((__noreturn__))
-  #define GCC_PACK __attribute__((packed))
-  #define _HEAPOK 0
-  
-  typedef unsigned char byte;
-  typedef unsigned char uint8;
-  typedef unsigned short uint16;
-  typedef unsigned int uint32;
-  typedef unsigned int uint;
-  typedef signed char int8;
-  typedef signed short int16;
-  typedef signed int int32;
-  
-  #define START_PACK_STRUCTS pack (push,1)
-  #define END_PACK_STRUCTS   pack(pop)
-  
+
+	#define scumm_stricmp stricmp
+	#define CHECK_HEAP
+	#define SCUMM_LITTLE_ENDIAN
+
+	#define FORCEINLINE inline
+	#define NORETURN __attribute__((__noreturn__))
+	#define GCC_PACK __attribute__((packed))
+	#define _HEAPOK 0
+
+	typedef unsigned char byte;
+	typedef unsigned char uint8;
+	typedef unsigned short uint16;
+	typedef unsigned int uint32;
+	typedef unsigned int uint;
+	typedef signed char int8;
+	typedef signed short int16;
+	typedef signed int int32;
+
+	#define START_PACK_STRUCTS pack (push, 1)
+	#define END_PACK_STRUCTS	 pack(pop)
+
 #elif defined(UNIX)
-  
-  #define scumm_stricmp strcasecmp
-  
-  #define CHECK_HEAP
-  
-  #ifdef X11_BACKEND
-  
-  /* You need to set those manually */
-//  #define SCUMM_LITTLE_ENDIAN
-  /* #define SCUMM_NEED_ALIGNMENT */
-  
-  #else
-  /* need this for the SDL_BYTEORDER define */
-  #include <SDL_byteorder.h>
-  
-  #if SDL_BYTEORDER == SDL_LIL_ENDIAN
-  #define SCUMM_LITTLE_ENDIAN
-  #elif SDL_BYTEORDER == SDL_BIG_ENDIAN
-  #define SCUMM_BIG_ENDIAN
-  #define SCUMM_NEED_ALIGNMENT
-  #else
-  #error Neither SDL_BIG_ENDIAN nor SDL_LITTLE_ENDIAN is set.
-  #endif
-  #endif
-  
-  #define FORCEINLINE inline
-  #define CDECL 
-  
-  #ifndef CONFIG_H
-  typedef unsigned char byte;
-  typedef unsigned char uint8;
-  typedef unsigned short uint16;
-  typedef unsigned int uint;
-  typedef unsigned int uint32;
-  typedef signed char int8;
-  typedef signed short int16;
-  typedef signed int int32;
-  #endif
-  
 
-  #  if defined(__DECCXX) // Assume alpha architecture
-  #    define INVERSE_MKID
-  #    define SCUMM_NEED_ALIGNMENT
-  #  endif
+	#define scumm_stricmp strcasecmp
+
+	#define CHECK_HEAP
+
+	#ifdef X11_BACKEND
+
+	/* You need to set those manually */
+//	#define SCUMM_LITTLE_ENDIAN
+	/* #define SCUMM_NEED_ALIGNMENT */
+	
+	#else
+	/* need this for the SDL_BYTEORDER define */
+	#include <SDL_byteorder.h>
+
+	#if SDL_BYTEORDER == SDL_LIL_ENDIAN
+	#define SCUMM_LITTLE_ENDIAN
+	#elif SDL_BYTEORDER == SDL_BIG_ENDIAN
+	#define SCUMM_BIG_ENDIAN
+	#define SCUMM_NEED_ALIGNMENT
+	#else
+	#error Neither SDL_BIG_ENDIAN nor SDL_LITTLE_ENDIAN is set.
+	#endif
+	#endif
+
+	#define FORCEINLINE inline
+	#define CDECL 
+
+	#ifndef CONFIG_H
+	typedef unsigned char byte;
+	typedef unsigned char uint8;
+	typedef unsigned short uint16;
+	typedef unsigned int uint;
+	typedef unsigned int uint32;
+	typedef signed char int8;
+	typedef signed short int16;
+	typedef signed int int32;
+	#endif
+
+	#if defined(__DECCXX) // Assume alpha architecture
+	#define INVERSE_MKID
+	#define SCUMM_NEED_ALIGNMENT
+	#endif
+
+	#if defined(__GNUC__)
+	#define START_PACK_STRUCTS
+	#define END_PACK_STRUCTS
+	#define GCC_PACK __attribute__((packed))
+	#define NORETURN __attribute__((__noreturn__)) 
+	#else
+	#define START_PACK_STRUCTS pack (1)
+	#define END_PACK_STRUCTS	 pack ()
+	#define GCC_PACK
+	#define NORETURN
+	#endif
 
-  
-  #if defined(__GNUC__)
-  #define START_PACK_STRUCTS
-  #define END_PACK_STRUCTS
-  #define GCC_PACK __attribute__((packed))
-  #define NORETURN __attribute__((__noreturn__)) 
-  #else
-  #define START_PACK_STRUCTS pack (1)
-  #define END_PACK_STRUCTS   pack ()
-  #define GCC_PACK
-  #define NORETURN
-  #endif
-  
 #elif defined(macintosh)
-  #include <stdio.h>
-  
-  #include "macos.h"
-  
-  #define scumm_stricmp strcmp// FIXME - this is definitly wrong. Try strcasecmp?
-  
-  #define CHECK_HEAP
-  #define SCUMM_BIG_ENDIAN
-  
-  #define FORCEINLINE inline
-  #define CDECL 
-  
-  typedef unsigned char byte;
-  typedef unsigned char uint8;
-  typedef unsigned short uint16;
-  typedef unsigned long uint32;
-  typedef unsigned int uint;
-  typedef signed char int8;
-  typedef signed short int16;
-  typedef signed long int32;
-  
-  #define START_PACK_STRUCTS pack (1)
-  #define END_PACK_STRUCTS   pack ()
-  #define GCC_PACK
-  #define NORETURN
-  #define USE_QTMUSIC
-  #define NEED_STRDUP
+	#include <stdio.h>
+
+	#include "macos.h"
+
+	#define scumm_stricmp strcmp// FIXME - this is definitly wrong. Try strcasecmp?
+
+	#define CHECK_HEAP
+	#define SCUMM_BIG_ENDIAN
+
+	#define FORCEINLINE inline
+	#define CDECL 
+
+	typedef unsigned char byte;
+	typedef unsigned char uint8;
+	typedef unsigned short uint16;
+	typedef unsigned long uint32;
+	typedef unsigned int uint;
+	typedef signed char int8;
+	typedef signed short int16;
+	typedef signed long int32;
+
+	#define START_PACK_STRUCTS pack (1)
+	#define END_PACK_STRUCTS	 pack ()
+	#define GCC_PACK
+	#define NORETURN
+	#define USE_QTMUSIC
+	#define NEED_STRDUP
 
 #elif defined(__MORPHOS__)
-  #define scumm_stricmp stricmp
-  #define CHECK_HEAP
-  
-  #define SCUMM_BIG_ENDIAN
-  #define SCUMM_NEED_ALIGNMENT
-  
-  #define FORCEINLINE inline
-  #define CDECL
-  
-  typedef unsigned char byte;
-  typedef unsigned char uint8;
-  typedef unsigned short uint16;
-  typedef unsigned long uint32;
-  typedef unsigned int uint;
-  typedef signed char int8;
-  typedef signed short int16;
-  typedef signed long int32;
-  
-  #if defined(__GNUC__)
-	  #define START_PACK_STRUCTS
-	  #define END_PACK_STRUCTS
-	  #define GCC_PACK __attribute__((packed))
-	  #define NORETURN __attribute__((__noreturn__))
-  #else
-	  #define START_PACK_STRUCTS pack (1)
-	  #define END_PACK_STRUCTS   pack ()
-	  #define GCC_PACK
-	  #define NORETURN
-  #endif
-  #define main morphos_main
+	#define scumm_stricmp stricmp
+	#define CHECK_HEAP
+
+	#define SCUMM_BIG_ENDIAN
+	#define SCUMM_NEED_ALIGNMENT
+
+	#define FORCEINLINE inline
+	#define CDECL
+
+	typedef unsigned char byte;
+	typedef unsigned char uint8;
+	typedef unsigned short uint16;
+	typedef unsigned long uint32;
+	typedef unsigned int uint;
+	typedef signed char int8;
+	typedef signed short int16;
+	typedef signed long int32;
+
+	#if defined(__GNUC__)
+		#define START_PACK_STRUCTS
+		#define END_PACK_STRUCTS
+		#define GCC_PACK __attribute__((packed))
+		#define NORETURN __attribute__((__noreturn__))
+	#else
+		#define START_PACK_STRUCTS pack (1)
+		#define END_PACK_STRUCTS	 pack ()
+		#define GCC_PACK
+		#define NORETURN
+	#endif
+	#define main morphos_main
 
 #elif defined(__DC__)
 
-  #define scumm_stricmp strcasecmp
-  #define CHECK_HEAP
-  #define SCUMM_LITTLE_ENDIAN
-  #define SCUMM_NEED_ALIGNMENT
-  
-  #define FORCEINLINE inline
-  #define NORETURN __attribute__((__noreturn__))
-  #define GCC_PACK __attribute__((packed))
-  #define CDECL
-  
-  typedef unsigned char byte;
-  typedef unsigned char uint8;
-  typedef unsigned short uint16;
-  typedef unsigned long uint32;
-  typedef unsigned int uint;
-  typedef signed char int8;
-  typedef signed short int16;
-  typedef signed long int32;
-  
-  #define START_PACK_STRUCTS pack (push,1)
-  #define END_PACK_STRUCTS   pack(pop)
-  
+	#define scumm_stricmp strcasecmp
+	#define CHECK_HEAP
+	#define SCUMM_LITTLE_ENDIAN
+	#define SCUMM_NEED_ALIGNMENT
+
+	#define FORCEINLINE inline
+	#define NORETURN __attribute__((__noreturn__))
+	#define GCC_PACK __attribute__((packed))
+	#define CDECL
+
+	typedef unsigned char byte;
+	typedef unsigned char uint8;
+	typedef unsigned short uint16;
+	typedef unsigned long uint32;
+	typedef unsigned int uint;
+	typedef signed char int8;
+	typedef signed short int16;
+	typedef signed long int32;
+
+	#define START_PACK_STRUCTS pack (push, 1)
+	#define END_PACK_STRUCTS	 pack(pop)
+
 #elif defined __GP32__ //ph0x
-	#define CDECL	
+	#define CDECL 
 	#define SCUMM_NEED_ALIGNMENT
-	#define SCUMM_LITTLE_ENDIAN	
+	#define SCUMM_LITTLE_ENDIAN 
 
-  #define scumm_stricmp stricmp
-  #define CHECK_HEAP
-  
-  #define FORCEINLINE inline
-  #define NORETURN __attribute__((__noreturn__))
-  #define GCC_PACK __attribute__((packed))
-  #define _HEAPOK 0
-  
-  typedef unsigned char byte;
-  typedef unsigned char uint8;
-  typedef unsigned short uint16;
-  typedef unsigned long uint32;
-  typedef unsigned int uint;
-  typedef signed char int8;
-  typedef signed short int16;
-  typedef signed long int32;
-  
-  #define START_PACK_STRUCTS pack (push,1)
-  #define END_PACK_STRUCTS   pack(pop)
+	#define scumm_stricmp stricmp
+	#define CHECK_HEAP
+
+	#define FORCEINLINE inline
+	#define NORETURN __attribute__((__noreturn__))
+	#define GCC_PACK __attribute__((packed))
+	#define _HEAPOK 0
+
+	typedef unsigned char byte;
+	typedef unsigned char uint8;
+	typedef unsigned short uint16;
+	typedef unsigned long uint32;
+	typedef unsigned int uint;
+	typedef signed char int8;
+	typedef signed short int16;
+	typedef signed long int32;
+
+	#define START_PACK_STRUCTS pack (push, 1)
+	#define END_PACK_STRUCTS	 pack(pop)
 #else
-  #error No system type defined
+	#error No system type defined
 #endif
 
-#define SWAP_BYTES(a) ((((a)>>24)&0xFF) | (((a)>>8)&0xFF00) | (((a)<<8)&0xFF0000) | (((a)<<24)&0xFF000000))
+#define SWAP_BYTES(a) ((((a) >> 24) & 0xFF) | (((a) >> 8) & 0xFF00) | \
+									(((a) << 8) & 0xFF0000) | (((a) << 24) & 0xFF000000))
 
 #if defined(SCUMM_LITTLE_ENDIAN)
-  
-  #define PROTO_MKID(a) SWAP_BYTES(a)
-  #define PROTO_MKID_BE(a) (a & 0xffffffff)
-  
-  #if defined(INVERSE_MKID)
-  #  define MKID(a) PROTO_MKID_BE(a)
-  #  define MKID_BE(a) PROTO_MKID(a)
-  #else
-  #  define MKID(a) PROTO_MKID(a)
-  #  define MKID_BE(a) PROTO_MKID_BE(a)
-  #endif
-  
-  
-  #if defined(SCUMM_NEED_ALIGNMENT)
-	  FORCEINLINE uint READ_LE_UINT16(void *ptr) {
-		  return (((byte*)ptr)[1]<<8)|((byte*)ptr)[0];
-	  }
-  #else
-	  FORCEINLINE uint READ_LE_UINT16(void *ptr) {
-		  return *(uint16*)(ptr);
-	  }
-  #endif
-  
-  FORCEINLINE uint READ_BE_UINT16(void *ptr) {
-	  return (((byte*)ptr)[0]<<8)|((byte*)ptr)[1];
-  }
-  
-  #if defined(SCUMM_NEED_ALIGNMENT)
-	  FORCEINLINE uint32 READ_LE_UINT32(void *ptr) {
-		  byte *b = (byte*)ptr;
-		  return (b[3]<<24)+(b[2]<<16)+(b[1]<<8)+(b[0]);
-	  }
-  #else
-	  FORCEINLINE uint32 READ_LE_UINT32(void *ptr) {
-		  return *(uint32*)(ptr);
-	  }
-  #endif
-  
-  FORCEINLINE uint32 READ_BE_UINT32(void *ptr) {
-	  byte *b = (byte*)ptr;
-	  return (b[0]<<24)+(b[1]<<16)+(b[2]<<8)+(b[3]);
-  }
-  
-  #define READ_BE_UINT32_UNALIGNED READ_BE_UINT32
-  #define READ_BE_UINT16_UNALIGNED READ_BE_UINT16
-  
-  #define READ_UINT32_UNALIGNED(a) READ_LE_UINT32(a)
-  
-  #define FROM_LE_32(__a__) __a__
-  #define FROM_LE_16(__a__) __a__
-  
-  #define TO_LE_32(__a__) __a__
-  #define TO_LE_16(__a__) __a__
-  
-  #define TO_BE_32(a) SWAP_BYTES(a)
-  
-  uint16 FORCEINLINE TO_BE_16(uint16 a) { return (a>>8) | (a<<8); }
+
+	#define PROTO_MKID(a) SWAP_BYTES(a)
+	#define PROTO_MKID_BE(a) (a & 0xffffffff)
+
+	#if defined(INVERSE_MKID)
+	#  define MKID(a) PROTO_MKID_BE(a)
+	#  define MKID_BE(a) PROTO_MKID(a)
+	#else
+	#  define MKID(a) PROTO_MKID(a)
+	#  define MKID_BE(a) PROTO_MKID_BE(a)
+	#endif
+
+	#if defined(SCUMM_NEED_ALIGNMENT)
+		FORCEINLINE uint READ_LE_UINT16(void *ptr) {
+			return (((byte *)ptr)[1] << 8)|((byte *)ptr)[0];
+		}
+	#else
+		FORCEINLINE uint READ_LE_UINT16(void *ptr) {
+			return *(uint16 *)(ptr);
+		}
+	#endif
+
+	FORCEINLINE uint READ_BE_UINT16(void *ptr) {
+		return (((byte *)ptr)[0] << 8)|((byte *)ptr)[1];
+	}
+
+	#if defined(SCUMM_NEED_ALIGNMENT)
+		FORCEINLINE uint32 READ_LE_UINT32(void *ptr) {
+			byte *b = (byte *)ptr;
+			return (b[3] << 24) + (b[2] <<16) + (b[1] << 8) + (b[0]);
+		}
+	#else
+		FORCEINLINE uint32 READ_LE_UINT32(void *ptr) {
+			return *(uint32 *)(ptr);
+		}
+	#endif
+	
+	FORCEINLINE uint32 READ_BE_UINT32(void *ptr) {
+		byte *b = (byte *)ptr;
+		return (b[0] << 24) + (b[1] << 16) + (b[2] << 8) + (b[3]);
+	}
+
+	#define READ_BE_UINT32_UNALIGNED READ_BE_UINT32
+	#define READ_BE_UINT16_UNALIGNED READ_BE_UINT16
+
+	#define READ_UINT32_UNALIGNED(a) READ_LE_UINT32(a)
+
+	#define FROM_LE_32(__a__) __a__
+	#define FROM_LE_16(__a__) __a__
+
+	#define TO_LE_32(__a__) __a__
+	#define TO_LE_16(__a__) __a__
+
+	#define TO_BE_32(a) SWAP_BYTES(a)
+
+	uint16 FORCEINLINE TO_BE_16(uint16 a) { return (a >> 8) | (a << 8); }
 
 #elif defined(SCUMM_BIG_ENDIAN)
 
-  #define MKID(a) (a)
-  #define MKID_BE(a) (a)
-  //#define MKID_BE(a) SWAP_BYTES(a)
-  
-  uint32 FORCEINLINE FROM_LE_32(uint32 a) {
-	  return ((a>>24)&0xFF) + ((a>>8)&0xFF00) + ((a<<8)&0xFF0000) + ((a<<24)&0xFF000000);
-  }
-  
-  uint16 FORCEINLINE FROM_LE_16(uint16 a) {
-	  return ((a>>8)&0xFF) + ((a<<8)&0xFF00);
-  }
-  
-  #define TO_LE_32 FROM_LE_32
-  #define TO_LE_16 FROM_LE_16
-  
-  uint32 FORCEINLINE READ_LE_UINT32(void *ptr) {
-	  byte *b = (byte*)ptr;
-	  return (b[3]<<24)+(b[2]<<16)+(b[1]<<8)+(b[0]);
-  }
-  
-  uint32 FORCEINLINE READ_BE_UINT32(void *ptr) {
-	  return *(uint32*)(ptr);
-  }
-  
-  uint FORCEINLINE READ_LE_UINT16(void *ptr) {
-	  byte *b = (byte*)ptr;
-	  return (b[1]<<8) + b[0];
-  }
-  
-  uint FORCEINLINE READ_BE_UINT16(void *ptr) {
-	  return *(uint16*)(ptr);
-  }
-  
-  uint FORCEINLINE READ_BE_UINT16_UNALIGNED(void *ptr) {
-	  return (((byte*)ptr)[0]<<8)|((byte*)ptr)[1];
-  }
-  
-  uint32 FORCEINLINE READ_BE_UINT32_UNALIGNED(void *ptr) {
-	  byte *b = (byte*)ptr;
-	  return (b[0]<<24)+(b[1]<<16)+(b[2]<<8)+(b[3]);
-  }
-  
-  #define READ_UINT32_UNALIGNED READ_BE_UINT32_UNALIGNED
-  
-  #define TO_BE_32(a) (a)
-  #define TO_BE_16(a) (a)
+	#define MKID(a) (a)
+	#define MKID_BE(a) (a)
+	//#define MKID_BE(a) SWAP_BYTES(a)
 
-#else
+	uint32 FORCEINLINE FROM_LE_32(uint32 a) {
+		return ((a >> 24) & 0xFF) + ((a >> 8) & 0xFF00) + (( a<< 8) & 0xFF0000) \
+						+ ((a<<24)&0xFF000000);
+	}
 
-  #error No endianness defined
+	uint16 FORCEINLINE FROM_LE_16(uint16 a) {
+		return ((a >> 8) & 0xFF) + ((a << 8) & 0xFF00);
+	}
 
-#endif
+	#define TO_LE_32 FROM_LE_32
+	#define TO_LE_16 FROM_LE_16
+
+	uint32 FORCEINLINE READ_LE_UINT32(void *ptr) {
+		byte *b = (byte *)ptr;
+		return (b[3] << 24) + (b[2] << 16) + (b[1] << 8) + (b[0]);
+	}
+
+	uint32 FORCEINLINE READ_BE_UINT32(void *ptr) {
+		return *(uint32 *)(ptr);
+	}
+
+	uint FORCEINLINE READ_LE_UINT16(void *ptr) {
+		byte *b = (byte *)ptr;
+		return (b[1] << 8) + b[0];
+	}
 
+	uint FORCEINLINE READ_BE_UINT16(void *ptr) {
+		return *(uint16 *)(ptr);
+	}
 
+	uint FORCEINLINE READ_BE_UINT16_UNALIGNED(void *ptr) {
+		return (((byte *)ptr)[0] << 8)|((byte *)ptr)[1];
+	}
+
+	uint32 FORCEINLINE READ_BE_UINT32_UNALIGNED(void *ptr) {
+		byte *b = (byte*)ptr;
+		return (b[0] << 24) + (b[1] << 16) + (b[2] << 8) + (b[3]);
+	}
+
+	#define READ_UINT32_UNALIGNED READ_BE_UINT32_UNALIGNED
+
+	#define TO_BE_32(a) (a)
+	#define TO_BE_16(a) (a)
+
+#else
+
+	#error No endianness defined
+
+#endif
 
 /* Initialized operator new */
 // FIXME - get rid of these new/delete overrides!!! They conflict with the

Index: str.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/str.cpp,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- str.cpp	10 Jan 2003 21:33:42 -0000	1.13
+++ str.cpp	6 Mar 2003 16:27:04 -0000	1.14
@@ -30,8 +30,7 @@
 
 namespace ScummVM {
 
-String::String(const char *str, int len)
-{
+String::String(const char *str, int len) {
 	_refCount = new int(1);
 	if (str && len != 0) {
 		if (len > 0)
@@ -47,8 +46,7 @@
 	}
 }
 
-String::String(const ConstString &str)
-{
+String::String(const ConstString &str) {
 	printf("String::String(const ConstString &str)\n");
 	_refCount = new int(1);
 	if (str._str) {		
@@ -61,8 +59,7 @@
 	}
 }
 
-String::String(const String &str)
-{
+String::String(const String &str) {
 	++(*str._refCount);
 
 	_refCount = str._refCount;
@@ -71,13 +68,11 @@
 	_str = str._str;
 }
 
-String::~String()
-{
+String::~String() {
 	decRefCount();
 }
 
-void String::decRefCount()
-{
+void String::decRefCount() {
 	--(*_refCount);
 	if (*_refCount <= 0) {
 		delete _refCount;
@@ -86,17 +81,16 @@
 	}
 }
 
-String& String::operator  =(const char* str)
-{	
+String& String::operator  =(const char *str) {
 	int len = strlen(str);
 	if (len > 0) {
 		ensureCapacity(len, false);
-		
+
 		_len = len;
 		memcpy(_str, str, _len + 1);
 	} else if (_len > 0) {
 		decRefCount();
-		
+
 		_refCount = new int(1);
 		_capacity = 0;
 		_len = 0;
@@ -105,12 +99,11 @@
 	return *this;
 }
 
-String& String::operator  =(const String& str)
-{
+String &String::operator  =(const String &str) {
 	++(*str._refCount);
 
 	decRefCount();
-	
+
 	_refCount = str._refCount;
 	_capacity = str._capacity;
 	_len = str._len;
@@ -119,8 +112,7 @@
 	return *this;
 }
 
-String& String::operator +=(const char* str)
-{
+String &String::operator +=(const char *str) {
 	int len = strlen(str);
 	if (len > 0) {
 		ensureCapacity(_len + len, true);
@@ -131,8 +123,7 @@
 	return *this;
 }
 
-String& String::operator +=(const String& str)
-{
+String &String::operator +=(const String &str) {
 	int len = str._len;
 	if (len > 0) {
 		ensureCapacity(_len + len, true);
@@ -143,10 +134,9 @@
 	return *this;
 }
 
-String& String::operator +=(char c)
-{
+String &String::operator += (char c) {
 	ensureCapacity(_len + 1, true);
-	
+
 	_str[_len++] = c;
 	_str[_len] = 0;
 
@@ -160,8 +150,7 @@
 	}
 }
 
-void String::deleteChar(int p)
-{
+void String::deleteChar(int p) {
 	if (p >= 0 && p < _len) {
 		ensureCapacity(_len - 1, true);
 		while (p++ < _len)
@@ -170,11 +159,10 @@
 	}
 }
 
-void String::clear()
-{
+void String::clear() {
 	if (_capacity) {
 		decRefCount();
-		
+
 		_refCount = new int(1);
 		_capacity = 0;
 		_len = 0;
@@ -182,8 +170,7 @@
 	}
 }
 
-void String::insertChar(char c, int p)
-{
+void String::insertChar(char c, int p) {
 	if (p >= 0 && p <= _len) {
 		ensureCapacity(++_len, true);
 		for (int i = _len; i > p; i--) {
@@ -193,26 +180,23 @@
 	}
 }
 
-void String::toLowercase()
-{
+void String::toLowercase() {
 	if (_str == 0 || _len == 0)
 		return;
-	
+
 	for (int i = 0; i < _len; ++i)
 		_str[i] = tolower(_str[i]);
 }
 
-void String::toUppercase()
-{
+void String::toUppercase() {
 	if (_str == 0 || _len == 0)
 		return;
-	
+
 	for (int i = 0; i < _len; ++i)
 		_str[i] = toupper(_str[i]);
 }
 
-void String::ensureCapacity(int new_len, bool keep_old)
-{
+void String::ensureCapacity(int new_len, bool keep_old) {
 	// If there is not enough space, or if we are not the only owner 
 	// of the current data, then we have to reallocate it.
 	if (new_len <= _capacity && *_refCount == 1)
@@ -227,23 +211,19 @@
 		_len = 0;
 
 	decRefCount();
-	
+
 	_refCount = new int(1);
 	_capacity = newCapacity;
 	_str = newStr;
 }
 
-
 #pragma mark -
 
-
-bool ConstString::operator ==(const ConstString& x) const
-{
+bool ConstString::operator ==(const ConstString &x) const {
 	return (_len == x._len) && ((_len == 0) || (0 == strcmp(_str, x._str)));
 }
 
-bool ConstString::operator ==(const char* x) const
-{
+bool ConstString::operator ==(const char *x) const {
 	if (_str == 0)
 		return (x == 0) || (*x == 0);
 	if (x == 0)
@@ -251,13 +231,11 @@
 	return (0 == strcmp(_str, x));
 }
 
-bool ConstString::operator !=(const ConstString& x) const
-{
+bool ConstString::operator !=(const ConstString &x) const {
 	return (_len != x._len) || ((_len != 0) && (0 != strcmp(_str, x._str)));
 }
 
-bool ConstString::operator !=(const char* x) const
-{
+bool ConstString::operator !=(const char *x) const {
 	if (_str == 0)
 		return (x != 0) && (*x != 0);
 	if (x == 0)
@@ -265,37 +243,31 @@
 	return (0 != strcmp(_str, x));
 }
 
-bool ConstString::operator < (const ConstString& x) const
-{
+bool ConstString::operator < (const ConstString &x) const {
 	if (!_len || !x._len)	// Any or both empty?
 		return !_len && x._len;	// Less only if this string is empty and the other isn't
 	return scumm_stricmp(_str, x._str) < 0;
 }
 
-bool ConstString::operator <= (const ConstString& x) const
-{
+bool ConstString::operator <= (const ConstString &x) const {
 	if (!_len || !x._len)	// Any or both empty?
 		return !_len;	// Less or equal unless the other string is empty and this one isn't
 	return scumm_stricmp(_str, x._str) <= 0;
 }
 
-bool ConstString::operator > (const ConstString& x) const
-{
+bool ConstString::operator > (const ConstString &x) const {
 	return (x < *this);
 }
 
-bool ConstString::operator >= (const ConstString& x) const
-{
+bool ConstString::operator >= (const ConstString &x) const {
 	return (x <= *this);
 }
 
-bool operator == (const char* y, const ConstString& x)
-{
+bool operator == (const char* y, const ConstString &x) {
 	return (x == y);
 }
 
-bool operator != (const char* y, const ConstString& x)
-{
+bool operator != (const char* y, const ConstString &x) {
 	return x != y;
 }
 

Index: str.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/str.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- str.h	10 Jan 2003 21:33:42 -0000	1.8
+++ str.h	6 Mar 2003 16:27:05 -0000	1.9
@@ -49,20 +49,19 @@
 
 public:
 	ConstString() : _str(0), _len(0) {}
-	ConstString(const char *str, int len = -1) : _str((char*)str) { _len = str ? (len >= 0 ? len : strlen(str)) : 0; }
+	ConstString(const char *str, int len = -1) : _str((char *)str) { _len = str ? (len >= 0 ? len : strlen(str)) : 0; }
 	virtual ~ConstString() {}
 	
-	bool operator ==(const ConstString& x) const;
-	bool operator ==(const char* x) const;
-	bool operator !=(const ConstString& x) const;
-	bool operator !=(const char* x) const;
-	bool operator <(const ConstString& x) const;
-	bool operator <=(const ConstString& x) const;
-	bool operator >(const ConstString& x) const;
-	bool operator >=(const ConstString& x) const;
+	bool operator ==(const ConstString &x) const;
+	bool operator ==(const char *x) const;
+	bool operator !=(const ConstString &x) const;
+	bool operator !=(const char *x) const;
+	bool operator <(const ConstString &x) const;
+	bool operator <=(const ConstString &x) const;
+	bool operator >(const ConstString &x) const;
+	bool operator >=(const ConstString &x) const;
 
-	char operator [](int idx) const
-	{
+	char operator [](int idx) const {
 		assert(_str && idx >= 0 && idx < _len);
 		return _str[idx];
 	}
@@ -85,26 +84,24 @@
 	String(const String &str);
 	virtual ~String();
 	
-	String& operator  =(const char* str);
+	String &operator  =(const char *str);
 // TODO - We should use RTTI here - that is, not real C++ RTTI but maybe some magic
 // constant in each string object. We want to be able to optimize the case when
 // a real 'String' object is passed to a function as a ConstString obj and then
 // assigned to a 'String' object.
 // An alternative would be to add private clone() and cloneMutable methods that 
 // would do the right thing.
-	String& operator  =(const String& str);
-	String& operator +=(const char* str);
-	String& operator +=(const String& str);
-	String& operator +=(char c);
+	String &operator  =(const String &str);
+	String &operator +=(const char *str);
+	String &operator +=(const String &str);
+	String &operator +=(char c);
 
-	char operator [](int idx) const
-	{
+	char operator [](int idx) const {
 		assert(_str && idx >= 0 && idx < _len);
 		return _str[idx];
 	}
 
-	char &operator [](int idx)
-	{
+	char &operator [](int idx) {
 		assert(_str && idx >= 0 && idx < _len);
 		return _str[idx];
 	}
@@ -113,7 +110,7 @@
 	void deleteChar(int p);
 	void clear();
 	void insertChar(char c, int p);
-	
+
 	void toLowercase();
 	void toUppercase();
 
@@ -123,25 +120,22 @@
 };
 
 // Some useful additional comparision operators for Strings
-bool operator == (const char* x, const ConstString& y);
-bool operator != (const char* x, const ConstString& y);
+bool operator == (const char *x, const ConstString &y);
+bool operator != (const char *x, const ConstString &y);
 
 class StringList : public List<String> {
 public:
-	void push_back(const char* str)
-	{
+	void push_back(const char *str) {
 		ensureCapacity(_size + 1);
 		_data[_size++] = str;
 	}
 
-	void push_back(const ConstString& str)
-	{
+	void push_back(const ConstString &str) {
 		ensureCapacity(_size + 1);
 		_data[_size++] = str;
 	}
 	
-	void push_back(const String& str)
-	{
+	void push_back(const String &str) {
 		ensureCapacity(_size + 1);
 		_data[_size++] = str;
 	}

Index: system.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/system.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- system.h	2 Mar 2003 16:36:52 -0000	1.20
+++ system.h	6 Mar 2003 16:27:05 -0000	1.21
@@ -182,24 +182,20 @@
 
 	// Methods that convert RBG to/from colors suitable for the overlay.
 	// Default implementation assumes 565 mode.
-	virtual int16 RBGToColor(uint8 r, uint8 g, uint8 b)
-	{
-		return ((((r>>3)&0x1F) << 11) | (((g>>2)&0x3F) << 5) | ((b>>3)&0x1F));
+	virtual int16 RBGToColor(uint8 r, uint8 g, uint8 b) {
+		return ((((r >> 3) & 0x1F) << 11) | (((g >> 2) & 0x3F) << 5) | ((b >> 3) & 0x1F));
 	}
-	virtual void colorToRBG(int16 color, uint8 &r, uint8 &g, uint8 &b)
-	{
-		r = (((color>>11)&0x1F) << 3);
-		g = (((color>>5)&0x3F) << 2);
+	virtual void colorToRBG(int16 color, uint8 &r, uint8 &g, uint8 &b) {
+		r = (((color >> 11) & 0x1F) << 3);
+		g = (((color >> 5) & 0x3F) << 2);
 		b = ((color&0x1F) << 3);
 	}
 
 	// Savefile management
-	virtual SaveFileManager *get_savefile_manager()
-	{
+	virtual SaveFileManager *get_savefile_manager() {
 		return new SaveFileManager();
 	}
 };
-
 
 /* Factory functions. This means we don't have to include the
  * OSystem_SDL header file. (which in turn would require the SDL headers)

Index: timer.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/timer.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- timer.cpp	25 Jan 2003 12:13:41 -0000	1.5
+++ timer.cpp	6 Mar 2003 16:27:05 -0000	1.6
@@ -36,8 +36,7 @@
 	release();
 }
 
-static int timer_handler (int t)
-{
+static int timer_handler (int t) {
 	eng->_timer->handler(&t);
 	return t;
 }
@@ -68,9 +67,9 @@
 	int32 l;
 
 	if (_engine->_system == NULL) {
- 		printf("Timer: OSystem not initialized !\n");
- 		return false;
- 	}
+	printf("Timer: OSystem not initialized !\n");
+	return false;
+}
 
 	if (_initialized == true) 
 		return true;

Index: util.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/util.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- util.cpp	28 Dec 2002 01:57:17 -0000	1.7
+++ util.cpp	6 Mar 2003 16:27:05 -0000	1.8
@@ -30,8 +30,7 @@
 // Find the entry in the given palette which matches the color defined by
 // the tripel (r,b,g) most closely.
 //
-int RGBMatch(byte *palette, int r, int g, int b)
-{
+int RGBMatch(byte *palette, int r, int g, int b) {
 	int i, bestidx = 0, besterr = 0xFFFFFF;
 	int error = 0;
 
@@ -54,49 +53,45 @@
 //
 // Blend two 8 bit colors into a third, all colors being defined by palette indices.
 //
-int Blend(int src, int dst, byte *palette)
-{
+int Blend(int src, int dst, byte *palette) {
 	int r, g, b;
 	int alpha = 128;	// Level of transparency [0-256]
-	byte *srcpal = palette + (dst  * 3);
+	byte *srcpal = palette + (dst * 3);
 	byte *dstpal = palette + (src * 3);
 
 	if (BlendCache[dst][src] > -1)
 		return BlendCache[dst][src];
 
 	r =  (*srcpal++ * alpha);
-    r += (*dstpal++ * (256-alpha));
-    r /= 256;
+	r += (*dstpal++ * (256 - alpha));
+	r /= 256;
 
-    g =  (*srcpal++ * alpha);
-    g += (*dstpal++ * (256-alpha));
-    g /= 256;
+	g =  (*srcpal++ * alpha);
+	g += (*dstpal++ * (256 - alpha));
+	g /= 256;
+
+	b =  (*srcpal++ * alpha);
+	b += (*dstpal++  * (256 - alpha));
+	b /= 256;
 
-    b =  (*srcpal++ * alpha);
-    b += (*dstpal++  * (256-alpha));
-    b /= 256;
-       
 	return (BlendCache[dst][src] = RGBMatch(palette, r , g , b ));
 }
 
 //
 // Reset the blending cache
 //
-void ClearBlendCache(byte *palette, int weight)
-{
+void ClearBlendCache(byte *palette, int weight) {
 	for (int i = 0; i < 256; i++)
-		for (int j = 0 ; j < 256 ; j++)			
+		for (int j = 0 ; j < 256 ; j++)
 //			BlendCache[i][j] = i;	// No alphablending
 //			BlendCache[i][j] = j;	// 100% translucent
 			BlendCache[i][j] = -1;	// Enable alphablending
 }
 
-
 //
 // Print hexdump of the data passed in, 8 bytes a row
 //
-void hexdump(const byte * data, int len)
-{
+void hexdump(const byte * data, int len) {
 	int i;
 	byte c;
 	while (len >= 8) {
@@ -133,26 +128,22 @@
 	printf("|\n");
 }
 
-RandomSource::RandomSource(uint32 seed)
-{
+RandomSource::RandomSource(uint32 seed) {
 	_randSeed = seed;
 }
 
-void RandomSource::setSeed(uint32 seed)
-{
+void RandomSource::setSeed(uint32 seed) {
 	_randSeed = seed;
 }
 
-uint RandomSource::getRandomNumber(uint max)
-{
+uint RandomSource::getRandomNumber(uint max) {
 	/* TODO: my own random number generator */
 	_randSeed = 0xDEADBF03 * (_randSeed + 1);
 	_randSeed = (_randSeed >> 13) | (_randSeed << 19);
 	return _randSeed % (max + 1);
 }
 
-uint RandomSource::getRandomNumberRng(uint min, uint max)
-{
+uint RandomSource::getRandomNumberRng(uint min, uint max) {
 	return getRandomNumber(max - min) + min;
 }
 

Index: util.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/util.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- util.h	28 Dec 2002 01:57:17 -0000	1.10
+++ util.h	6 Mar 2003 16:27:06 -0000	1.11
@@ -24,19 +24,19 @@
 #include "scummsys.h"
 
 #ifndef ABS
-#define ABS(x) ((x)>=0?(x):-(x))
+#define ABS(x) ((x) >= 0 ? (x) : -(x))
 #endif
 
 #ifndef MIN
-#define	MIN(a,b) (((a)<(b))?(a):(b))
+#define MIN(a,b) (((a) < (b)) ? (a) : (b))
 #endif
 
 #ifndef MAX
-#define	MAX(a,b) (((a)>(b))?(a):(b))
+#define MAX(a,b) (((a) > (b)) ? (a) : (b))
 #endif
 
-static inline void SWAP(int &a, int &b) { int tmp=a; a=b; b=tmp; }
-#define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0]))
+static inline void SWAP(int &a, int &b) { int tmp = a; a = b; b = tmp; }
+#define ARRAYSIZE(x) (sizeof(x) / sizeof(x[0]))
 
 int RGBMatch(byte *palette, int r, int g, int b);
 int Blend(int src, int dst, byte *palette);





More information about the Scummvm-git-logs mailing list