aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMax Horn2011-12-08 10:02:51 +0100
committerMax Horn2011-12-08 19:52:10 +0100
commit5b43fb6be7650a29b9aad6b504599f7b8600b419 (patch)
treeb31e3ceafd6726b711703e184191028bc445c6f6
parente731d9b8132d0c64dbd115173a600eb977aa50fa (diff)
downloadscummvm-rg350-5b43fb6be7650a29b9aad6b504599f7b8600b419.tar.gz
scummvm-rg350-5b43fb6be7650a29b9aad6b504599f7b8600b419.tar.bz2
scummvm-rg350-5b43fb6be7650a29b9aad6b504599f7b8600b419.zip
DREAMWEB: Code formatting
-rw-r--r--engines/dreamweb/backdrop.cpp2
-rw-r--r--engines/dreamweb/detection.cpp2
-rw-r--r--engines/dreamweb/dreamweb.cpp8
-rw-r--r--engines/dreamweb/print.cpp4
-rw-r--r--engines/dreamweb/sound.cpp2
-rw-r--r--engines/dreamweb/sprite.cpp2
-rw-r--r--engines/dreamweb/stubs.cpp14
-rw-r--r--engines/dreamweb/vgagrafx.cpp20
8 files changed, 27 insertions, 27 deletions
diff --git a/engines/dreamweb/backdrop.cpp b/engines/dreamweb/backdrop.cpp
index cf07ffcfe2..3e005fdec9 100644
--- a/engines/dreamweb/backdrop.cpp
+++ b/engines/dreamweb/backdrop.cpp
@@ -247,7 +247,7 @@ void DreamGenContext::showAllFree() {
data.word(kFramesad) = kFrframes;
data.byte(kCurrentfree) = 0;
const DynObject *freeObjects = (const DynObject *)getSegment(data.word(kFreedat)).ptr(0, 0);
- for(size_t i = 0; i < 80; ++i) {
+ for (size_t i = 0; i < 80; ++i) {
uint8 mapAd = getMapAd(freeObjects[i].mapad);
if (mapAd != 0) {
uint8 width, height;
diff --git a/engines/dreamweb/detection.cpp b/engines/dreamweb/detection.cpp
index a3f311c304..ba7152beb5 100644
--- a/engines/dreamweb/detection.cpp
+++ b/engines/dreamweb/detection.cpp
@@ -95,7 +95,7 @@ SaveStateList DreamWebMetaEngine::listSaves(const char *target) const {
Common::sort(files.begin(), files.end());
SaveStateList saveList;
- for(uint i = 0; i < files.size(); ++i) {
+ for (uint i = 0; i < files.size(); ++i) {
const Common::String &file = files[i];
Common::InSaveFile *stream = saveFileMan->openForLoading(file);
if (!stream)
diff --git a/engines/dreamweb/dreamweb.cpp b/engines/dreamweb/dreamweb.cpp
index 717c0620f4..e15f315c1e 100644
--- a/engines/dreamweb/dreamweb.cpp
+++ b/engines/dreamweb/dreamweb.cpp
@@ -326,14 +326,14 @@ void DreamWebEngine::mouseCall(uint16 *x, uint16 *y, uint16 *state) {
void DreamWebEngine::getPalette(uint8 *data, uint start, uint count) {
_system->getPaletteManager()->grabPalette(data, start, count);
- while(count--)
+ while (count--)
*data++ >>= 2;
}
void DreamWebEngine::setPalette(const uint8 *data, uint start, uint count) {
assert(start + count <= 256);
uint8 fixed[768];
- for(uint i = 0; i < count * 3; ++i) {
+ for (uint i = 0; i < count * 3; ++i) {
fixed[i] = data[i] << 2;
}
_system->getPaletteManager()->setPalette(fixed, start, count);
@@ -356,9 +356,9 @@ void DreamWebEngine::printUnderMonitor() {
if (!s)
error("lockScreen failed");
- for(uint y = 0; y < 104; ++y) {
+ for (uint y = 0; y < 104; ++y) {
uint8 *src = (uint8 *)s->getBasePtr(76, 43 + 8 + y);
- for(uint x = 0; x < 170; ++x) {
+ for (uint x = 0; x < 170; ++x) {
if (*src < 231)
*dst++ = *src++;
else {
diff --git a/engines/dreamweb/print.cpp b/engines/dreamweb/print.cpp
index df89df28ef..dc7ca8a2f7 100644
--- a/engines/dreamweb/print.cpp
+++ b/engines/dreamweb/print.cpp
@@ -35,7 +35,7 @@ void DreamBase::printBoth(const Frame *charSet, uint16 *x, uint16 y, uint8 c, ui
uint8 DreamBase::getNextWord(const Frame *charSet, const uint8 *string, uint8 *totalWidth, uint8 *charCount) {
*totalWidth = 0;
*charCount = 0;
- while(true) {
+ while (true) {
uint8 firstChar = *string;
++string;
++*charCount;
@@ -153,7 +153,7 @@ uint8 DreamBase::printDirect(const uint8** string, uint16 x, uint16 *y, uint8 ma
printChar(charSet, &i, *y, c, nextChar, &width, &height);
data.word(kLastxpos) = i;
--charCount;
- } while(charCount);
+ } while (charCount);
*y += data.word(kLinespacing);
}
}
diff --git a/engines/dreamweb/sound.cpp b/engines/dreamweb/sound.cpp
index 8bccc5e280..fc68a8f996 100644
--- a/engines/dreamweb/sound.cpp
+++ b/engines/dreamweb/sound.cpp
@@ -289,7 +289,7 @@ void DreamWebEngine::loadSounds(uint bank, const Common::String &filename) {
SoundData &soundData = _soundData[bank];
soundData.samples.resize(tablesize / 6);
uint total = 0;
- for(uint i = 0; i < tablesize / 6; ++i) {
+ for (uint i = 0; i < tablesize / 6; ++i) {
uint8 entry[6];
Sample &sample = soundData.samples[i];
file.read(entry, sizeof(entry));
diff --git a/engines/dreamweb/sprite.cpp b/engines/dreamweb/sprite.cpp
index b14cfc554c..8b8bd230a6 100644
--- a/engines/dreamweb/sprite.cpp
+++ b/engines/dreamweb/sprite.cpp
@@ -530,7 +530,7 @@ void DreamGenContext::showRain() {
rain->setW3(ax);
const uint8 *src = ds.ptr(si, 0) + ax;
uint8 *dst = workspace() + y * 320 + x;
- for(uint16 i = 0; i < size; ++i) {
+ for (uint16 i = 0; i < size; ++i) {
uint8 v = src[i];
if (v != 0)
*dst = v;
diff --git a/engines/dreamweb/stubs.cpp b/engines/dreamweb/stubs.cpp
index 465cb68741..9d3719f806 100644
--- a/engines/dreamweb/stubs.cpp
+++ b/engines/dreamweb/stubs.cpp
@@ -993,7 +993,7 @@ void DreamGenContext::deallocateMem(uint16 segment) {
MutableSegmentRef buffers(this);
buffers = bseg;
uint8 *ptr = buffers.ptr(kSpritetable, tsize);
- for(uint i = 0; i < tsize; i += 32) {
+ for (uint i = 0; i < tsize; i += 32) {
uint16 seg = READ_LE_UINT16(ptr + i + 6);
//debug(1, "sprite segment = %04x", seg);
if (seg == segment)
@@ -1032,8 +1032,8 @@ void DreamGenContext::fadeDOS() {
//processEvents will be called from vsync
uint8 *dst = es.ptr(kStartpal, 768);
engine->getPalette(dst, 0, 64);
- for(int fade = 0; fade < 64; ++fade) {
- for(int c = 0; c < 768; ++c) { //original sources decrement 768 values -> 256 colors
+ for (int fade = 0; fade < 64; ++fade) {
+ for (int c = 0; c < 768; ++c) { //original sources decrement 768 values -> 256 colors
if (dst[c]) {
--dst[c];
}
@@ -1475,7 +1475,7 @@ void DreamGenContext::doChange(uint8 index, uint8 value, uint8 type) {
void DreamGenContext::deleteTaken() {
const DynObject *extraObjects = (const DynObject *)getSegment(data.word(kExtras)).ptr(kExdata, 0);
DynObject *freeObjects = (DynObject *)getSegment(data.word(kFreedat)).ptr(0, 0);
- for(size_t i = 0; i < kNumexobjects; ++i) {
+ for (size_t i = 0; i < kNumexobjects; ++i) {
uint8 location = extraObjects[i].initialLocation;
if (location == data.byte(kReallocation)) {
uint8 index = extraObjects[i].index;
@@ -1873,7 +1873,7 @@ bool DreamGenContext::compare(uint8 index, uint8 flag, const char id[4]) {
void *ptr = getAnyAdDir(index, flag);
const char *objId = (const char *)(((const uint8 *)ptr) + 12); // whether it is a DynObject or a SetObject
for (size_t i = 0; i < 4; ++i) {
- if(id[i] != objId[i] + 'A')
+ if (id[i] != objId[i] + 'A')
return false;
}
return true;
@@ -3549,7 +3549,7 @@ void DreamGenContext::nextDest() {
data.byte(kDestpos) = 0; // last destination
getDestInfo();
- } while(al == 0);
+ } while (al == 0);
data.byte(kNewtextline) = 1;
delTextLine();
@@ -3580,7 +3580,7 @@ void DreamGenContext::lastDest() {
data.byte(kDestpos) = 15; // first destination
getDestInfo();
- } while(al == 0);
+ } while (al == 0);
data.byte(kNewtextline) = 1;
delTextLine();
diff --git a/engines/dreamweb/vgagrafx.cpp b/engines/dreamweb/vgagrafx.cpp
index 8d303d1a04..2a69124fdf 100644
--- a/engines/dreamweb/vgagrafx.cpp
+++ b/engines/dreamweb/vgagrafx.cpp
@@ -43,7 +43,7 @@ void DreamBase::multiGet(uint8 *dst, uint16 x, uint16 y, uint8 w, uint8 h) {
if (x + w > 320)
w = 320 - x;
//debug(1, "multiGet %u,%u %ux%u -> segment: %04x->%04x", x, y, w, h, (uint16)ds, (uint16)es);
- for(unsigned l = 0; l < h; ++l) {
+ for (unsigned l = 0; l < h; ++l) {
const uint8 *src_p = src + kScreenwidth * l;
uint8 *dst_p = dst + w * l;
memcpy(dst_p, src_p, w);
@@ -66,7 +66,7 @@ void DreamBase::multiPut(const uint8 *src, uint16 x, uint16 y, uint8 w, uint8 h)
if (x + w > 320)
w = 320 - x;
//debug(1, "multiPut %ux%u -> segment: %04x->%04x", w, h, (uint16)ds, (uint16)es);
- for(unsigned l = 0; l < h; ++l) {
+ for (unsigned l = 0; l < h; ++l) {
const uint8 *src_p = src + w * l;
uint8 *dst_p = dst + kScreenwidth * l;
memcpy(dst_p, src_p, w);
@@ -260,26 +260,26 @@ void DreamBase::frameOutV(uint8 *dst, const uint8 *src, uint16 pitch, uint16 wid
// or was something broken during porting to C++?
assert(pitch == 320);
- if(x < 0) {
+ if (x < 0) {
assert(width >= -x);
width -= -x;
src += -x;
x = 0;
}
- if(y < 0) {
+ if (y < 0) {
assert(height >= -y);
height -= -y;
src += (-y) * width;
y = 0;
}
- if(x >= 320)
+ if (x >= 320)
return;
- if(y >= 200)
+ if (y >= 200)
return;
- if(x + width > 320) {
+ if (x + width > 320) {
width = 320 - x;
}
- if(y + height > 200) {
+ if (y + height > 200) {
height = 200 - y;
}
@@ -384,8 +384,8 @@ void DreamGenContext::zoom() {
uint16 dstOffset = (kZoomy + 4) * 320 + (kZoomx + 5);
const uint8 *src = workspace() + srcOffset;
uint8 *dst = workspace() + dstOffset;
- for(size_t i=0; i<20; ++i) {
- for(size_t j=0; j<23; ++j) {
+ for (size_t i = 0; i < 20; ++i) {
+ for (size_t j = 0; j < 23; ++j) {
uint8 v = src[j];
dst[2*j+0] = v;
dst[2*j+1] = v;