From 4ae8f43be3394927a9b8b71dfaaaff4a87aa2f69 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Fri, 4 Sep 2009 20:09:29 +0000 Subject: TEEN: Some whitespace fixes svn-id: r43946 --- engines/teenagent/animation.cpp | 12 ++++++------ engines/teenagent/callbacks.cpp | 2 +- engines/teenagent/dialog.cpp | 2 +- engines/teenagent/font.cpp | 12 ++++++------ engines/teenagent/inventory.cpp | 22 +++++++++++----------- engines/teenagent/objects.cpp | 4 ++-- engines/teenagent/pack.cpp | 4 ++-- engines/teenagent/scene.cpp | 20 ++++++++++---------- engines/teenagent/teenagent.cpp | 6 +++--- 9 files changed, 42 insertions(+), 42 deletions(-) (limited to 'engines/teenagent') diff --git a/engines/teenagent/animation.cpp b/engines/teenagent/animation.cpp index 8149632160..248e312231 100644 --- a/engines/teenagent/animation.cpp +++ b/engines/teenagent/animation.cpp @@ -107,7 +107,7 @@ void Animation::load(Common::SeekableReadStream * s, Type type) { data_size -= 2; data = new byte[data_size]; data_size = s->read(data, data_size); -/* for(int i = 0; i < data_size; ++i) { +/* for (int i = 0; i < data_size; ++i) { debug(0, "%02x ", data[i]); } debug(0, ", %u frames", data_size / 3); @@ -123,7 +123,7 @@ void Animation::load(Common::SeekableReadStream * s, Type type) { pos = s->readUint16LE(); //debug(0, "pos?: %04x", pos); - for(uint16 i = 0; i < frames_count; ++i) { + for (uint16 i = 0; i < frames_count; ++i) { frames[i].load(s, Surface::TypeLan); frames[i].x = 0; frames[i].y = 0; @@ -135,7 +135,7 @@ void Animation::load(Common::SeekableReadStream * s, Type type) { data = new byte[data_size]; frames_count = 0; - for(byte i = 0; i < data_size / 3; ++i) { + for (byte i = 0; i < data_size / 3; ++i) { int idx = i * 3; /* byte unk = */ s->readByte(); data[idx] = s->readByte(); @@ -150,7 +150,7 @@ void Animation::load(Common::SeekableReadStream * s, Type type) { frames = new Surface[frames_count]; - for(uint16 i = 0; i < frames_count; ++i) { + for (uint16 i = 0; i < frames_count; ++i) { frames[i].load(s, Surface::TypeOns); } } @@ -160,12 +160,12 @@ void Animation::load(Common::SeekableReadStream * s, Type type) { frames_count = s->readByte(); debug(0, "loading varia resource, %u physical frames", frames_count); uint16 offset[255]; - for(byte i = 0; i < frames_count; ++i) { + for (byte i = 0; i < frames_count; ++i) { offset[i] = s->readUint16LE(); debug(0, "%u: %04x", i, offset[i]); } frames = new Surface[frames_count]; - for(uint16 i = 0; i < frames_count; ++i) { + for (uint16 i = 0; i < frames_count; ++i) { debug(0, "%04x", offset[i]); s->seek(offset[i] + off); frames[i].load(s, Surface::TypeOns); diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp index 4d79f24a00..7ad369009e 100644 --- a/engines/teenagent/callbacks.cpp +++ b/engines/teenagent/callbacks.cpp @@ -1816,7 +1816,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) { } //unimplemented callback :( - for(uint i = 0; i < 32; ++i) { + for (uint i = 0; i < 32; ++i) { debug(0, "code[%u] = %02x ", i, code[i]); } //error("invalid callback %04x called", addr); diff --git a/engines/teenagent/dialog.cpp b/engines/teenagent/dialog.cpp index e91ae8df4b..4d500d44e5 100644 --- a/engines/teenagent/dialog.cpp +++ b/engines/teenagent/dialog.cpp @@ -97,7 +97,7 @@ uint16 Dialog::pop(Scene *scene, uint16 addr, uint16 animation) { do { next = res->dseg.get_word(addr); addr += 2; - } while(next == 0); + } while (next == 0); uint16 next2 = res->dseg.get_word(addr); if (next2 != 0xffff) res->dseg.set_word(addr - 2, 0); diff --git a/engines/teenagent/font.cpp b/engines/teenagent/font.cpp index 4f982f1775..5e917dc354 100644 --- a/engines/teenagent/font.cpp +++ b/engines/teenagent/font.cpp @@ -59,8 +59,8 @@ uint Font::render(Graphics::Surface *surface, int x, int y, char c) { //debug(0, "char %c, width: %dx%d", c, w, h); glyph += 2; byte * dst = (byte *)surface->getBasePtr(x, y); - for(uint i = 0; i < h; ++i) { - for(uint j = 0; j < w; ++j) { + for (uint i = 0; i < h; ++i) { + for (uint j = 0; j < w; ++j) { byte v = *glyph++; switch(v) { case 1: @@ -77,7 +77,7 @@ uint Font::render(Graphics::Surface *surface, int x, int y, char c) { } static uint find_in_str(const Common::String &str, char c, uint pos = 0) { - while(pos < str.size() && str[pos] != c) ++pos; + while (pos < str.size() && str[pos] != c) ++pos; return pos; } @@ -102,7 +102,7 @@ uint Font::render(Graphics::Surface *surface, int x, int y, const Common::String y += height; i = j + 1; - } while(i < str.size()); + } while (i < str.size()); return max_w; } else { //surface == NULL; @@ -127,8 +127,8 @@ uint Font::render(Graphics::Surface *surface, int x, int y, const Common::String void Font::grid(Graphics::Surface *surface, int x, int y, int w, int h, byte color) { byte * dst = (byte *)surface->getBasePtr(x, y); - for(int i = 0; i < h; ++i) { - for(int j = 0; j < w; ++j) { + for (int i = 0; i < h; ++i) { + for (int j = 0; j < w; ++j) { if (((i ^ j) & 1) == 0) dst[j] = color; } diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp index c90223463a..a0346f63be 100644 --- a/engines/teenagent/inventory.cpp +++ b/engines/teenagent/inventory.cpp @@ -46,14 +46,14 @@ void Inventory::init(TeenAgentEngine * engine) { byte offsets = items->readByte(); assert(offsets == 92); - for(byte i = 0; i < offsets; ++i) { + for (byte i = 0; i < offsets; ++i) { offset[i] = items->readUint16LE(); } objects = res->dseg.ptr(0xc4a4); inventory = res->dseg.ptr(0xc48d); - for(int y = 0; y < 4; ++y) - for(int x = 0; x < 6; ++x) { + for (int y = 0; y < 4; ++y) + for (int x = 0; x < 6; ++x) { int i = y * 6 + x; graphics[i].rect.left = 28 + 45 * x - 1; graphics[i].rect.top = 23 + 31 * y - 1; @@ -65,7 +65,7 @@ void Inventory::init(TeenAgentEngine * engine) { } bool Inventory::has(byte item) const { - for(int i = 0; i < 24; ++i) { + for (int i = 0; i < 24; ++i) { if (inventory[i] == item) return true; } @@ -75,12 +75,12 @@ bool Inventory::has(byte item) const { void Inventory::remove(byte item) { debug(0, "removing %02x from inventory", item); int i; - for(i = 0; i < 24; ++i) { + for (i = 0; i < 24; ++i) { if (inventory[i] == item) { break; } } - for(; i < 23; ++i) { + for (; i < 23; ++i) { inventory[i] = inventory[i + 1]; graphics[i].free(); } @@ -90,7 +90,7 @@ void Inventory::remove(byte item) { void Inventory::clear() { debug(0, "clearing inventory"); - for(int i = 0; i < 24; ++i) { + for (int i = 0; i < 24; ++i) { inventory[i] = 0; graphics[i].free(); } @@ -101,7 +101,7 @@ void Inventory::add(byte item) { if (has(item)) return; debug(0, "adding %02x to inventory", item); - for(int i = 0; i < 24; ++i) { + for (int i = 0; i < 24; ++i) { if (inventory[i] == 0) { inventory[i] = item; return; @@ -131,7 +131,7 @@ bool Inventory::processEvent(const Common::Event &event) { hovered_obj = NULL; - for(int i = 0; i < 24; ++i) { + for (int i = 0; i < 24; ++i) { byte item = inventory[i]; if (item == 0) continue; @@ -152,7 +152,7 @@ bool Inventory::processEvent(const Common::Event &event) { debug(0, "combine(0x%02x, 0x%02x)!", id1, id2); byte * table = res->dseg.ptr(0xC335); - while(table[0] != 0 && table[1] != 0) { + while (table[0] != 0 && table[1] != 0) { if ( (id1 == table[0] && id2 == table[1]) || (id2 == table[0] && id1 == table[1]) @@ -183,7 +183,7 @@ bool Inventory::processEvent(const Common::Event &event) { byte id = hovered_obj->id; debug(0, "rclick object %u", id); uint i = 0; - for(byte * table = res->dseg.ptr(0xBB6F + 3); //original offset + 3 bytes. + for (byte * table = res->dseg.ptr(0xBB6F + 3); //original offset + 3 bytes. table[0] != 0 && i < 7; table += 3, ++i) { if (table[0] == id) { resetSelectedObject(); diff --git a/engines/teenagent/objects.cpp b/engines/teenagent/objects.cpp index 8347230986..c6b64c8b9e 100644 --- a/engines/teenagent/objects.cpp +++ b/engines/teenagent/objects.cpp @@ -55,9 +55,9 @@ Common::String Object::description(const char *name) { Common::String result; - while(*desc != 1 && *desc != 0) { + while (*desc != 1 && *desc != 0) { Common::String line; - while(*desc != 1 && *desc != 0) { + while (*desc != 1 && *desc != 0) { //debug(0, "%02x ", *desc); line += *desc++; } diff --git a/engines/teenagent/pack.cpp b/engines/teenagent/pack.cpp index 6f22134143..67c58895e1 100644 --- a/engines/teenagent/pack.cpp +++ b/engines/teenagent/pack.cpp @@ -47,11 +47,11 @@ void Pack::open(const Common::String &filename) { count = file.readUint32LE(); debug(0, "opened %s, found %u entries", filename.c_str(), count); offsets = new uint32[count + 1]; - for(uint32 i = 0; i <= count; ++i) { + for (uint32 i = 0; i <= count; ++i) { offsets[i] = file.readUint32LE(); //debug(0, "%d: %06x", i, offsets[i]); } -/* for(uint32 i = 0; i < count; ++i) { +/* for (uint32 i = 0; i < count; ++i) { debug(0, "%d: len = %d", i, offsets[i + 1] - offsets[i]); } */ diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index b90349c06c..fbed57a365 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -52,7 +52,7 @@ void Scene::moveTo(const Common::Point & _point, byte orient, bool validate) { Common::Point point(_point); debug(0, "moveTo(%d, %d, %u)", point.x, point.y, orient); if (validate) { - for(byte i = 0; i < walkboxes; ++i) { + for (byte i = 0; i < walkboxes; ++i) { if (walkbox[i]->rect.in(point)) { debug(0, "bumped into walkbox %u", i); return; @@ -111,7 +111,7 @@ void Scene::loadOns() { ons_count = 0; byte b; byte on_id[16]; - while((b = res->dseg.get_byte(addr)) != 0xff) { + while ((b = res->dseg.get_byte(addr)) != 0xff) { debug(0, "on: %04x = %02x", addr, b); ++addr; if (b == 0) @@ -125,7 +125,7 @@ void Scene::loadOns() { if (ons_count > 0) { ons = new Surface[ons_count]; - for(uint32 i = 0; i < ons_count; ++i) { + for (uint32 i = 0; i < ons_count; ++i) { Common::SeekableReadStream * s = res->ons.getStream(on_id[i]); if (s != NULL) ons[i].load(s, Surface::TypeOns); @@ -178,10 +178,10 @@ void Scene::init(int id, const Common::Point &pos) { if (res->dseg.get_byte(0xDBA4) != 1) { //dim down palette uint i; - for(i = 0; i < 624; ++i) { + for (i = 0; i < 624; ++i) { palette[i] = palette[i] > 0x20? palette[i] - 0x20: 0; } - for(i = 726; i < 768; ++i) { + for (i = 726; i < 768; ++i) { palette[i] = palette[i] > 0x20? palette[i] - 0x20: 0; } } @@ -258,14 +258,14 @@ bool Scene::render(OSystem * system) { Graphics::Surface * surface = system->lockScreen(); if (ons != NULL) { - for(uint32 i = 0; i < ons_count; ++i) { + for (uint32 i = 0; i < ons_count; ++i) { Surface* s = ons + i; if (s != NULL) s->render(surface); } } - for(int i = 3; i >= 0; --i) { + for (int i = 3; i >= 0; --i) { Animation &a = animations[i]; Surface *s = a.currentFrame(); if (s == NULL) @@ -294,7 +294,7 @@ bool Scene::render(OSystem * system) { bool hide_actor = false; bool got_any_animation = false; - for(int i = 3; i >= 0; --i) { + for (int i = 3; i >= 0; --i) { Animation &a = custom_animations[i]; Surface *s = a.currentFrame(); if (s == NULL) { @@ -463,8 +463,8 @@ void Scene::setPalette(OSystem *system, const byte * buf, unsigned mul) { byte p[1024]; memset(p, 0, 1024); - for(int i = 0; i < 256; ++i) { - for(int c = 0; c < 3; ++c) + for (int i = 0; i < 256; ++i) { + for (int c = 0; c < 3; ++c) p[i * 4 + c] = buf[i * 3 + c] * mul; } diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp index 0d8c994b7a..122d5c5963 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -65,7 +65,7 @@ void TeenAgentEngine::processObject() { if (inv != NULL) { byte * dcall = res->dseg.ptr(0xbb87); dcall = res->dseg.ptr(READ_LE_UINT16(dcall + scene->getId() * 2 - 2)); - for(UseObject * obj = (UseObject *)dcall; obj->inventory_id != 0; ++obj) { + for (UseObject * obj = (UseObject *)dcall; obj->inventory_id != 0; ++obj) { if (obj->inventory_id == inv->id && dst_object->id == obj->object_id) { debug(0, "combine! %u,%u", obj->x, obj->y); //moveTo(Common::Point(obj->x, obj->y), NULL, Examine); @@ -308,7 +308,7 @@ Common::Error TeenAgentEngine::run() { _system->delayMillis(40 - dt); ++frame; - } while(!_event->shouldQuit()); + } while (!_event->shouldQuit()); deinit(); return Common::kNoError; @@ -319,7 +319,7 @@ Object * TeenAgentEngine::findObject(int id, const Common::Point &point) { uint16 addr = res->dseg.get_word(0x7254 + (id - 1) * 2); //debug(0, "object base: %04x, x: %d, %d", addr, point.x, point.y); uint16 object; - for(;(object = res->dseg.get_word(addr)) != 0; addr += 2) { + for (;(object = res->dseg.get_word(addr)) != 0; addr += 2) { if (object == 0) return NULL; -- cgit v1.2.3