aboutsummaryrefslogtreecommitdiff
path: root/engines/m4
diff options
context:
space:
mode:
authorMax Horn2009-01-29 05:26:12 +0000
committerMax Horn2009-01-29 05:26:12 +0000
commitac59693be26b4239aaaf380896a1e1b753172546 (patch)
treeb64a9b664917ed86e78e90560b034f0b1ee49054 /engines/m4
parenta0a82d911c77b63f2069dbc39ab26394fe4d377d (diff)
downloadscummvm-rg350-ac59693be26b4239aaaf380896a1e1b753172546.tar.gz
scummvm-rg350-ac59693be26b4239aaaf380896a1e1b753172546.tar.bz2
scummvm-rg350-ac59693be26b4239aaaf380896a1e1b753172546.zip
A ton of code formatting fixes; also fixed warnings about single line loops like 'while(cond);' by inserting newlines
svn-id: r36127
Diffstat (limited to 'engines/m4')
-rw-r--r--engines/m4/converse.cpp22
-rw-r--r--engines/m4/globals.cpp8
-rw-r--r--engines/m4/graphics.cpp2
-rw-r--r--engines/m4/m4.cpp4
4 files changed, 18 insertions, 18 deletions
diff --git a/engines/m4/converse.cpp b/engines/m4/converse.cpp
index 5567c8888a..61f4c1eac7 100644
--- a/engines/m4/converse.cpp
+++ b/engines/m4/converse.cpp
@@ -290,7 +290,7 @@ void ConversationView::playNextReply() {
int previousWeight = 1;
int currentWeight = 0;
- for(uint32 j = 0; j < currentEntry->entries.size(); j++) {
+ for (uint32 j = 0; j < currentEntry->entries.size(); j++) {
currentWeight += currentEntry->entries[j]->weight;
if (selectedWeight >= previousWeight && selectedWeight <= currentWeight) {
sprintf(buffer, "%s.raw", currentEntry->entries[j]->voiceFile);
@@ -406,7 +406,7 @@ void Converse::loadConversation(const char *convName) {
convS->read(buffer, 8);
if (debugFlag) printf("Conversation name: %s\n", buffer);
- while(true) {
+ while (true) {
chunkPos = convS->pos();
chunk = convS->readUint32LE(); // read chunk
if (convS->eos()) break;
@@ -716,7 +716,7 @@ void Converse::loadConversationMads(const char *convName) {
printf("Chunk 0\n");
printf("Conv stream size: %i\n", convS->size());
- while(!convS->eos()) { // FIXME (eos changed)
+ while (!convS->eos()) { // FIXME (eos changed)
printf("%i ", convS->readByte());
}
printf("\n");
@@ -727,7 +727,7 @@ void Converse::loadConversationMads(const char *convName) {
printf("Chunk 1\n");
printf("Conv stream size: %i\n", convS->size());
- while(!convS->eos()) { // FIXME (eos changed)
+ while (!convS->eos()) { // FIXME (eos changed)
printf("%i ", convS->readByte());
}
printf("\n");
@@ -738,7 +738,7 @@ void Converse::loadConversationMads(const char *convName) {
printf("Chunk 2\n");
printf("Conv stream size: %i\n", convS->size());
- while(!convS->eos()) { // FIXME (eos changed)
+ while (!convS->eos()) { // FIXME (eos changed)
printf("%i ", convS->readByte());
}
printf("\n");
@@ -792,7 +792,7 @@ void Converse::loadConversationMads(const char *convName) {
convS->read(buffer, 14); // speech file
printf("Speech file: %s\n", buffer);
- while(!convS->eos()) { // FIXME: eos changed
+ while (!convS->eos()) { // FIXME: eos changed
printf("%i ", convS->readByte());
}
printf("\n");
@@ -805,7 +805,7 @@ void Converse::loadConversationMads(const char *convName) {
printf("Chunk 1: conversation nodes\n");
printf("Conv stream size: %i\n", convS->size());
- while(true) {
+ while (true) {
uint16 id = convS->readUint16LE();
if (convS->eos()) break;
@@ -844,7 +844,7 @@ void Converse::loadConversationMads(const char *convName) {
*buffer = 0;
- while(true) {
+ while (true) {
//if (curPos == 0)
// printf("%i: Offset %i: ", _convStrings.size(), convS->pos());
uint8 b = convS->readByte();
@@ -900,7 +900,7 @@ void Converse::loadConversationMads(const char *convName) {
//printf("Chunk 3 - MESG chunk data\n");
//printf("Conv stream size: %i\n", convS->size());
- while(true) {
+ while (true) {
uint16 index = convS->readUint16LE();
if (convS->eos()) break;
@@ -926,7 +926,7 @@ void Converse::loadConversationMads(const char *convName) {
convS = convData.getItemStream(6);
printf("Chunk 6\n");
printf("Conv stream size: %i\n", convS->size());
- /*while(!convS->eos()) { // FIXME (eos changed)
+ /*while (!convS->eos()) { // FIXME (eos changed)
printf("%i ", convS->readByte());
printf("%i ", convS->readByte());
printf("%i ", convS->readByte());
@@ -965,7 +965,7 @@ void Converse::readConvEntryActions(Common::SubReadStream *convS, ConvEntry *cur
int messageIndex = 0;
int unk = 0;
- while(true) {
+ while (true) {
chunk = convS->readByte();
if (convS->eos()) break;
diff --git a/engines/m4/globals.cpp b/engines/m4/globals.cpp
index 56f78ce835..7028569c6b 100644
--- a/engines/m4/globals.cpp
+++ b/engines/m4/globals.cpp
@@ -273,11 +273,11 @@ Globals::Globals(M4Engine *vm): _vm(vm) {
Globals::~Globals() {
uint32 i;
- for(i = 0; i < _madsVocab.size(); i++)
+ for (i = 0; i < _madsVocab.size(); i++)
free(_madsVocab[i]);
_madsVocab.clear();
- for(i = 0; i < _madsQuotes.size(); i++)
+ for (i = 0; i < _madsQuotes.size(); i++)
free(_madsQuotes[i]);
_madsQuotes.clear();
@@ -295,7 +295,7 @@ void Globals::loadMadsVocab() {
char buffer[30];
strcpy(buffer, "");
- while(true) {
+ while (true) {
uint8 b = vocabS->readByte();
if (vocabS->eos()) break;
@@ -318,7 +318,7 @@ void Globals::loadMadsQuotes() {
char buffer[128];
strcpy(buffer, "");
- while(true) {
+ while (true) {
uint8 b = quoteS->readByte();
if (quoteS->eos()) break;
diff --git a/engines/m4/graphics.cpp b/engines/m4/graphics.cpp
index 6d933d476b..06bb358179 100644
--- a/engines/m4/graphics.cpp
+++ b/engines/m4/graphics.cpp
@@ -723,7 +723,7 @@ static void fadeRange(M4Engine *vm, RGB8 *srcPal, RGB8 *destPal, int startIndex
RGB8 tempPal[256];
// perform the fade
- for(int stepCtr = 1; stepCtr <= numSteps; ++stepCtr) {
+ for (int stepCtr = 1; stepCtr <= numSteps; ++stepCtr) {
// Delay the specified amount
uint32 startTime = g_system->getMillis();
while ((g_system->getMillis() - startTime) < delayAmount) {
diff --git a/engines/m4/m4.cpp b/engines/m4/m4.cpp
index 60e74fd127..98944b2611 100644
--- a/engines/m4/m4.cpp
+++ b/engines/m4/m4.cpp
@@ -528,7 +528,7 @@ void M4Engine::dumpFile(const char* filename, bool uncompress) {
printf("Dumping %s, size: %i\n", filename, fileS->size());
if (!uncompress) {
- while(!fileS->eos()) {
+ while (!fileS->eos()) {
bytesRead = fileS->read(buffer, 256);
fwrite(buffer, bytesRead, 1, destFile);
}
@@ -538,7 +538,7 @@ void M4Engine::dumpFile(const char* filename, bool uncompress) {
for (int i = 0; i < packData.getCount(); i++) {
sourceUnc = packData.getItemStream(i);
printf("Dumping compressed chunk %i of %i, size is %i\n", i + 1, packData.getCount(), sourceUnc->size());
- while(!sourceUnc->eos()) {
+ while (!sourceUnc->eos()) {
bytesRead = sourceUnc->read(buffer, 256);
fwrite(buffer, bytesRead, 1, destFile);
}