[Scummvm-cvs-logs] CVS: scummvm/kyra codecs.cpp,1.2,1.3 font.cpp,1.1,1.2 kyra.cpp,1.4,1.5 kyra.h,1.2,1.3 palette.cpp,1.1,1.2 resource.cpp,1.2,1.3 script_v1.cpp,1.2,1.3

Max Horn fingolfin at users.sourceforge.net
Sat Oct 16 15:29:07 CEST 2004


Update of /cvsroot/scummvm/scummvm/kyra
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19869

Modified Files:
	codecs.cpp font.cpp kyra.cpp kyra.h palette.cpp resource.cpp 
	script_v1.cpp 
Log Message:
Fix whitespace / code formatting to match out guidelines

Index: codecs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/codecs.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- codecs.cpp	15 Oct 2004 19:47:16 -0000	1.2
+++ codecs.cpp	16 Oct 2004 22:28:29 -0000	1.3
@@ -54,24 +54,19 @@
     uint16 code;
     uint16 count;
 
-    while (1) 
-    {
+    while (1) {
         code = *readp++;
-        if (~code & 0x80) 
-        {
+        if (~code & 0x80) {
             //bit 7 = 0
             //command 0 (0cccpppp p): copy
             count = (code >> 4) + 3;
             copyp = writep - (((code & 0xf) << 8) + *readp++);
             while (count--)
                 *writep++ = *copyp++;
-        } 
-        else 
-        {
+        } else {
             //bit 7 = 1
             count = code & 0x3f;
-            if (~code & 0x40) 
-            {
+            if (~code & 0x40) {
                 //bit 6 = 0
                 if (!count)
                     //end of image
@@ -79,12 +74,9 @@
                 //command 1 (10cccccc): copy
                 while (count--)
                     *writep++ = *readp++;
-            } 
-            else 
-            {
+            } else {
                 //bit 6 = 1
-                if (count < 0x3e) 
-                {
+                if (count < 0x3e) {
                     //command 2 (11cccccc p p): copy
                     count += 3;
 
@@ -94,9 +86,7 @@
                     memcpy(writep, copyp, count);
                     writep += count;
                     copyp += count;
-                }
-                else if (count == 0x3e) 
-                {
+                } else if (count == 0x3e) {
                     //command 3 (11111110 c c v): fill
 
                     count = READ_LE_UINT16(readp);
@@ -104,9 +94,7 @@
                     code = *readp++;
                     memset(writep, code, count);
                     writep += count;
-                }
-                else 
-                {
+                } else {
                     //command 4 (copy 11111111 c c p p): copy
 
                     count = READ_LE_UINT16(readp);
@@ -146,57 +134,44 @@
 
     while (1) {
         code = *readp++;
-        if (~code & 0x80) 
-        {
+        if (~code & 0x80) {
            //bit 7 = 0
-            if (!code) 
-            {
+            if (!code) {
                 //command 0 (00000000 c v): fill
                 count = *readp++;
                 code = *readp++;
                 while (count--)
                     *writep++ ^= code;
-            } 
-            else 
-            {
+            } else {
                 //command 1 (0ccccccc): copy
                 count = code;
                 while (count--)
                     *writep++ ^= *readp++;
             }
 
-        } 
-        else 
-        {
+        } else {
             //bit 7 = 1
-            if (!(count = code & 0x7f)) 
-            {
+            if (!(count = code & 0x7f)) {
 
                 count = READ_LE_UINT16(readp);
                 readp += 2;
                 code = count >> 8;
-                if (~code & 0x80) 
-                {
+                if (~code & 0x80) {
                     //bit 7 = 0
                     //command 2 (10000000 c 0ccccccc): skip
                     if (!count)
                         // end of image
                         break;
                     writep += count;
-                } 
-                else 
-                {
+                } else {
                     //bit 7 = 1
                     count &= 0x3fff;
-                    if (~code & 0x40) 
-                    {
+                    if (~code & 0x40) {
                         //bit 6 = 0
                         //command 3 (10000000 c 10cccccc): copy
                         while (count--)
                             *writep++ ^= *readp++;
-                    }
-                    else 
-                    {
+                    } else {
                         //bit 6 = 1
                         //command 4 (10000000 c 11cccccc v): fill
                         code = *readp++;
@@ -204,8 +179,7 @@
                             *writep++ ^= code;
                     }
                 }
-            }
-            else //command 5 (1ccccccc): skip
+            } else //command 5 (1ccccccc): skip
             	writep += count;       
         }
     }
@@ -232,23 +206,18 @@
 	
 	do {
         code = *const_cast<int8*>((const int8*)readp++);
-        if (code > 0) // Copy 
-        {      	
+        if (code > 0) { // Copy 
         	count = code ;
         	while (count--)
         		*writep++ = *readp++;        
-        }
-        else if (code == 0) // Fill(1) 
-        {
+        } else if (code == 0) { // Fill(1)
         	count = READ_BE_UINT16(readp);
  
         	readp += 2;
         	code = *readp++;
         	while (count--)
         		*writep++ = (uint8)code;
-        }
-        else if (code < 0) // Fill (2)
-        {
+        } else if (code < 0) { // Fill (2)
         	count = -code;
         	code = *readp++;
         	while (count--)

Index: font.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/font.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- font.cpp	15 Oct 2004 06:06:47 -0000	1.1
+++ font.cpp	16 Oct 2004 22:28:29 -0000	1.2
@@ -206,20 +206,20 @@
 		for (uint8 yadd = 0; yadd < height; ++yadd) {
 			for (uint8 xadd = 0; xadd < width; ++xadd) {
 				switch(*src) {					
-					case 1:
-						plane[(y + yadd) * planewidth + x + xadd] = color;
+				case 1:
+					plane[(y + yadd) * planewidth + x + xadd] = color;
 					break;
 					
-					case 2:
-						plane[(y + yadd) * planewidth + x + xadd] = 14;
+				case 2:
+					plane[(y + yadd) * planewidth + x + xadd] = 14;
 					break;
 					
-					case 3:
-						plane[(y + yadd) * planewidth + x + xadd] = 0;
+				case 3:
+					plane[(y + yadd) * planewidth + x + xadd] = 0;
 					break;
 					
-					default:
-						// nothing to do now
+				default:
+					// nothing to do now
 					break;
 				};
 				
@@ -269,30 +269,30 @@
 					}
 					
 					switch(index) {
-						case 1:
+					case 1:
 #ifdef DUMP_FILES
-							fprintf(dump, "#");
+						fprintf(dump, "#");
 #endif
-							dst[yadd * newChar.width + xadd] = 1;
+						dst[yadd * newChar.width + xadd] = 1;
 						break;
-						
-						case 2:
+					
+					case 2:
 #ifdef DUMP_FILES
-							fprintf(dump, "$");
+						fprintf(dump, "$");
 #endif
-							dst[yadd * newChar.width + xadd] = 2;
+						dst[yadd * newChar.width + xadd] = 2;
 						break;
-						
-						case 3:
+					
+					case 3:
 #ifdef DUMP_FILES
-							fprintf(dump, "§");
+						fprintf(dump, "§");
 #endif
-							dst[yadd * newChar.width + xadd] = 3;
+						dst[yadd * newChar.width + xadd] = 3;
 						break;
-						
-						default:
+					
+					default:
 #ifdef DUMP_FILES
-							fprintf(dump, "%d", index);
+						fprintf(dump, "%d", index);
 #endif
 						break;
 					};

Index: kyra.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/kyra.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- kyra.cpp	15 Oct 2004 10:42:44 -0000	1.4
+++ kyra.cpp	16 Oct 2004 22:28:29 -0000	1.5
@@ -34,32 +34,32 @@
 #include "script.h"
 
 struct KyraGameSettings {
-        const char *name;
-        const char *description;
-        uint32 features;
-        const char *detectName;
-        GameSettings toGameSettings() const {
-                GameSettings dummy = { name, description, features };
-                return dummy;
-        }
+	const char *name;
+	const char *description;
+	uint32 features;
+	const char *detectName;
+	GameSettings toGameSettings() const {
+		GameSettings dummy = { name, description, features };
+		return dummy;
+	}
 };
 
 static const KyraGameSettings kyra_settings[] = { 
-        {"kyra1cd", "Legend of Kyrandia (CD)",  GF_TALKIE & GF_KYRA1,  "CHAPTER1.VRM"},
-        {"kyra1", "Legend of Kyrandia (Floppy)", GF_FLOPPY & GF_KYRA1, "INTRO.SND"},
+	{"kyra1cd", "Legend of Kyrandia (CD)",	GF_TALKIE & GF_KYRA1,  "CHAPTER1.VRM"},
+	{"kyra1", "Legend of Kyrandia (Floppy)", GF_FLOPPY & GF_KYRA1, "INTRO.SND"},
 	{ 0, 0, 0, 0}
 };
 
 GameList Engine_KYRA_gameList() {
-        GameList games;
-        const KyraGameSettings *g = kyra_settings;
+	GameList games;
+	const KyraGameSettings *g = kyra_settings;
 
-        while (g->name) {
-                games.push_back(g->toGameSettings());
-                g++;
-        }
+	while (g->name) {
+		games.push_back(g->toGameSettings());
+		g++;
+	}
 
-        return games;
+	return games;
 }
 
 DetectedGameList Engine_KYRA_detectGames(const FSList &fslist) {
@@ -79,7 +79,7 @@
 		}
 	}
 
-        return detectedGames;
+	return detectedGames;
 }
 
 Engine *Engine_KYRA_create(GameDetector *detector, OSystem *syst) {
@@ -159,11 +159,11 @@
 		updateScreen();
 		while (g_system->pollEvent(event)) {
 			switch (event.event_code) {
-				case OSystem::EVENT_QUIT:
-					g_system->quit();
-					break;
-				default:
-					break;
+			case OSystem::EVENT_QUIT:
+				g_system->quit();
+				break;
+			default:
+				break;
 			}
 		}
 		_system->delayMillis(10);
@@ -175,23 +175,23 @@
 }
 
 void KyraEngine::updateScreen(void) {
-        _system->copyRectToScreen(_screen, 320, 0, 0, 320, 240);
-        _system->updateScreen();
+	_system->copyRectToScreen(_screen, 320, 0, 0, 320, 240);
+	_system->updateScreen();
 }
 
 void KyraEngine::setCurrentPalette(Palette* pal, bool delNextTime) {
-//        if (_delPalNextTime)
-//                delete _currentPal;
+//	if (_delPalNextTime)
+//		delete _currentPal;
 
-//        _delPalNextTime = delNextTime;
+//	_delPalNextTime = delNextTime;
 
-//        _currentPal = pal;
+//	_currentPal = pal;
 
-        if (pal->getData()) {
-                _system->setPalette(pal->getData(), 0, 256);
-        } else {
-                warning("palette contains no data");
-        }
+	if (pal->getData()) {
+		_system->setPalette(pal->getData(), 0, 256);
+	} else {
+		warning("palette contains no data");
+	}
 }
 
 } // End of namespace KYRA

Index: kyra.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/kyra.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- kyra.h	15 Oct 2004 06:06:47 -0000	1.2
+++ kyra.h	16 Oct 2004 22:28:29 -0000	1.3
@@ -8,7 +8,7 @@
 
  * 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
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  * GNU General Public License for more details.
 
  * You should have received a copy of the GNU General Public License
@@ -48,23 +48,23 @@
 	void errorString( const char *buf_input, char *buf_output);
 
 	void updateScreen(void);
-        void setCurrentPalette(Palette* pal, bool delNextTime = true);
+	void setCurrentPalette(Palette* pal, bool delNextTime = true);
 
-        Resourcemanager* resManager(void) { return _resMgr; }
-//        MidiDriver* midiDriver(void) { return _midiDriver; }
+	Resourcemanager* resManager(void) { return _resMgr; }
+//	MidiDriver* midiDriver(void) { return _midiDriver; }
 
 protected:
 	void go();
 	void shutdown();
-        Resourcemanager* _resMgr;
+	Resourcemanager* _resMgr;
 	uint8 *_screen;
 
-        Font* _font;
-        CPSImage* _mouse;
-        CPSImage* _items;
+	Font* _font;
+	CPSImage* _mouse;
+	CPSImage* _items;
 
-        VMContext* _currentScript; // our current script
-        VMContext* _npcScript; // script from NPCs
+	VMContext* _currentScript; // our current script
+	VMContext* _npcScript; // script from NPCs
 };
 
 } // End of namespace Kyra

Index: palette.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/palette.cpp,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- palette.cpp	15 Oct 2004 06:06:47 -0000	1.1
+++ palette.cpp	16 Oct 2004 22:28:29 -0000	1.2
@@ -71,9 +71,9 @@
 			currentposdst[2] = currentpossrc[2] << 2;
 			currentpossrc += 3;
 			currentposdst += 4;
-    	}
-    	
-   		delete [] data;
+		}
+		
+		delete [] data;
 	}
 
 } // end of namespace Kyra

Index: resource.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/resource.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- resource.cpp	15 Oct 2004 10:32:17 -0000	1.2
+++ resource.cpp	16 Oct 2004 22:28:29 -0000	1.3
@@ -36,8 +36,8 @@
 		// ugly a hardcoded list
 		// TODO: use the FS Backend to get all .PAK Files and load them
 		static const char* kyraFilelist[] = {
-  			"A_E.PAK", "DAT.PAK", "F_L.PAK", "MAP_5.PAK", "MSC.PAK", "M_S.PAK",
-	     		"S_Z.PAK", "WSA1.PAK", "WSA2.PAK", "WSA3.PAK", "WSA4.PAK", "WSA5.PAK",
+			"A_E.PAK", "DAT.PAK", "F_L.PAK", "MAP_5.PAK", "MSC.PAK", "M_S.PAK",
+			"S_Z.PAK", "WSA1.PAK", "WSA2.PAK", "WSA3.PAK", "WSA4.PAK", "WSA5.PAK",
 			"WSA6.PAK", "startup.pak", "intro1.pak", 0
 		};
 		
@@ -45,7 +45,7 @@
 			// prefetch file
 			PAKFile* file = new PAKFile(getPath() + kyraFilelist[tmp]);
 			assert(file);			
-     
+
 			if (file->isOpen() && file->isValid())		
 				_pakfiles.push_back(file);
 			else
@@ -109,7 +109,7 @@
 		return buffer;
 	}
 	
-	Palette* Resourcemanager::loadPalette(const char* file)	{
+	Palette* Resourcemanager::loadPalette(const char* file) {
 		uint32 size = 0;
 		uint8* buffer = 0;
 		buffer = fileData(file, &size);
@@ -146,11 +146,11 @@
 		return new WSAMovieV1(buffer, size);
 	}
 
-        VMContext* Resourcemanager::loadScript(const char* file) {
-                VMContext* context = new VMContext(_engine);
-                context->loadScript(file);
-                return context;
-        }
+	VMContext* Resourcemanager::loadScript(const char* file) {
+		VMContext* context = new VMContext(_engine);
+		context->loadScript(file);
+		return context;
+	}
 	
 	Common::String Resourcemanager::getPath(void) {
 		assert(_gameDir);
@@ -223,7 +223,7 @@
 			_files.push_back(chunk);
 		}
 		_open = true;
- 	}
+	}
 
 	PAKFile::~PAKFile() {
 		delete [] _buffer;
@@ -231,7 +231,7 @@
 		_open = false;
 
 		for (PAKFile_Iterate) {
- 			delete *start;
+			delete *start;
 			*start = 0;
 		}
 	}

Index: script_v1.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/kyra/script_v1.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- script_v1.cpp	15 Oct 2004 10:42:44 -0000	1.2
+++ script_v1.cpp	16 Oct 2004 22:28:29 -0000	1.3
@@ -115,21 +115,21 @@
 	
 	void VMContext::c1_negate(void) {
 		switch(_argument) {
-			case 0:
-				topStack() = !topStack();
+		case 0:
+			topStack() = !topStack();
 			break;
-			
-			case 1:
-				topStack() = -topStack();
+		
+		case 1:
+			topStack() = -topStack();
 			break;
-			
-			case 2:
-				topStack() = ~topStack();
+		
+		case 2:
+			topStack() = ~topStack();
 			break;
-			
-			default:
-				debug("unkown negate instruction %d", _argument);
-				_error = true;
+		
+		default:
+			debug("unkown negate instruction %d", _argument);
+			_error = true;
 			break;
 		};
 	}
@@ -142,76 +142,76 @@
 		y = popStack();
 		
 		switch(_argument) {
-			case 0:
-				res = x && y;
+		case 0:
+			res = x && y;
 			break;
-			
-			case 1:
-				res = x || y;
+		
+		case 1:
+			res = x || y;
 			break;
-			
-			case 3:
-				res = x != y;
+		
+		case 3:
+			res = x != y;
 			break;
-			
-			case 4:
-				res = x < y;
+		
+		case 4:
+			res = x < y;
+			break;
+		
+		case 5:
+			res = x <= y;
 			break;
 			
-			case 5:
-				res = x <= y;
+		case 6:
+			res = x > y;
 			break;
-				
-			case 6:
-				res = x > y;
+		
+		case 7:
+			res = x >= y;
 			break;
-			
-			case 7:
-				res = x >= y;
+		
+		case 8:
+			res = x + y;
 			break;
 			
-			case 8:
-				res = x + y;
-				break;
-				
-			case 9:
-				res = x - y;
+		case 9:
+			res = x - y;
 			break;
-			
-			case 10:
-				res = x * y;
+		
+		case 10:
+			res = x * y;
 			break;
-			
-     		case 11:
-				res = x / y;
+		
+		case 11:
+			res = x / y;
 			break;
-			
-     		case 12:
-				res = x >> y;
+		
+		case 12:
+			res = x >> y;
 			break;
-			
-			case 13:
-				res = x << y;
+		
+		case 13:
+			res = x << y;
 			break;
-			
-			case 14:
-				res = x & y;
+		
+		case 14:
+			res = x & y;
 			break;
-			
-			case 15:
-				res = x | y;
+		
+		case 15:
+			res = x | y;
 			break;
-			
-			case 16:
-				res = x % y;
+		
+		case 16:
+			res = x % y;
 			break;
-			
-			case 17:
-				res = x ^ y;
+		
+		case 17:
+			res = x ^ y;
 			break;
-			
-			default:
-				debug("unknown evaluate command");
+		
+		default:
+			debug("unknown evaluate command");
 			break;
 		};
 		
@@ -232,7 +232,7 @@
 			paramString(4), paramString(5));
 	}
 
-        void VMContext::o1_0x68(void) {
-                debug("o1_0x68 was called with param0: '%d' and param1: '%d'", param(0), param(1));
-        }
+	void VMContext::o1_0x68(void) {
+		debug("o1_0x68 was called with param0: '%d' and param1: '%d'", param(0), param(1));
+	}
 } // end of namespace Kyra





More information about the Scummvm-git-logs mailing list