diff options
Diffstat (limited to 'engines/teenagent')
27 files changed, 121 insertions, 98 deletions
diff --git a/engines/teenagent/actor.cpp b/engines/teenagent/actor.cpp index 9904da42f2..1a325e3028 100644 --- a/engines/teenagent/actor.cpp +++ b/engines/teenagent/actor.cpp @@ -21,10 +21,11 @@ * $URL$ * $Id$ */ -#include "actor.h" -#include "objects.h" -using namespace TeenAgent; +#include "teenagent/actor.h" +#include "teenagent/objects.h" + +namespace TeenAgent { void Actor::render(Graphics::Surface * surface, const Common::Point & position, uint8 orientation, int delta_frame) { uint8 frames_left_right[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; @@ -68,3 +69,5 @@ void Actor::render(Graphics::Surface * surface, const Common::Point & position, if (s != NULL) s->render(surface, position.x - dx, position.y - dy, orientation == Object::ActorLeft); } + +} // End of namespace TeenAgent diff --git a/engines/teenagent/actor.h b/engines/teenagent/actor.h index d295d2227b..3aae27c073 100644 --- a/engines/teenagent/actor.h +++ b/engines/teenagent/actor.h @@ -22,7 +22,7 @@ * $Id$ */ -#include "animation.h" +#include "teenagent/animation.h" #include "common/rect.h" namespace TeenAgent { @@ -31,4 +31,5 @@ class Actor : public Animation { public: void render(Graphics::Surface * surface, const Common::Point & position, uint8 orientation, int delta_frame); }; -} + +} // End of namespace TeenAgent diff --git a/engines/teenagent/animation.cpp b/engines/teenagent/animation.cpp index 97cf785506..8149632160 100644 --- a/engines/teenagent/animation.cpp +++ b/engines/teenagent/animation.cpp @@ -22,11 +22,10 @@ * $Id$ */ - -#include "animation.h" +#include "teenagent/animation.h" #include "common/endian.h" -using namespace TeenAgent; +namespace TeenAgent { Animation::Animation() : id(0), x(0), y(0), loop(true), data(0), data_size(0), frames_count(0), frames(0), index(0) { } @@ -183,3 +182,5 @@ void Animation::load(Common::SeekableReadStream * s, Type type) { Animation::~Animation() { free(); } + +} // End of namespace TeenAgent diff --git a/engines/teenagent/animation.h b/engines/teenagent/animation.h index f9dfe747fb..784ce3b15a 100644 --- a/engines/teenagent/animation.h +++ b/engines/teenagent/animation.h @@ -22,14 +22,14 @@ * $Id$ */ - #ifndef TEENAGENT_ANIMATION_H #define TEENAGENT_ANIMATION_H #include "common/stream.h" -#include "surface.h" +#include "teenagent/surface.h" namespace TeenAgent { + class Animation { public: uint16 id, x, y; @@ -57,8 +57,7 @@ protected: Surface * frames; uint16 index; }; -} +} // End of namespace TeenAgent #endif - diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp index 86df52870d..4d79f24a00 100644 --- a/engines/teenagent/callbacks.cpp +++ b/engines/teenagent/callbacks.cpp @@ -22,12 +22,12 @@ * $Id$ */ -#include "scene.h" -#include "teenagent.h" -#include "resources.h" -#include "dialog.h" +#include "teenagent/scene.h" +#include "teenagent/teenagent.h" +#include "teenagent/resources.h" +#include "teenagent/dialog.h" -using namespace TeenAgent; +namespace TeenAgent { #define CHECK_FLAG(addr, v) (res->dseg.get_byte(addr) == (v)) #define SET_FLAG(addr, v) (res->dseg.set_byte((addr), (v))) @@ -1823,3 +1823,5 @@ bool TeenAgentEngine::processCallback(uint16 addr) { debug(0, "invalid callback %04x called", addr); return true; } + +} // End of namespace TeenAgent diff --git a/engines/teenagent/detection.cpp b/engines/teenagent/detection.cpp index b9d4dab0fa..33519d4ea5 100644 --- a/engines/teenagent/detection.cpp +++ b/engines/teenagent/detection.cpp @@ -22,13 +22,14 @@ * $Id$ */ +#include "common/system.h" +#include "common/savefile.h" -#include "engines/advancedDetector.h" #include "base/plugins.h" + +#include "engines/advancedDetector.h" + #include "teenagent/teenagent.h" -#include "common/system.h" -#include "common/savefile.h" -#include "teenagent.h" static const PlainGameDescriptor teenAgentGames[] = { { "teenagent", "Teen agent" }, diff --git a/engines/teenagent/dialog.cpp b/engines/teenagent/dialog.cpp index 8b14eafe9a..e91ae8df4b 100644 --- a/engines/teenagent/dialog.cpp +++ b/engines/teenagent/dialog.cpp @@ -22,11 +22,11 @@ * $Id$ */ -#include "dialog.h" -#include "resources.h" -#include "scene.h" +#include "teenagent/dialog.h" +#include "teenagent/resources.h" +#include "teenagent/scene.h" -using namespace TeenAgent; +namespace TeenAgent { void Dialog::show(Scene * scene, uint16 addr, uint16 animation) { debug(0, "Dialog::show(%04x, %u)", addr, animation); @@ -104,3 +104,5 @@ uint16 Dialog::pop(Scene *scene, uint16 addr, uint16 animation) { show(scene, next, animation); return next; } + +} // End of namespace TeenAgent diff --git a/engines/teenagent/dialog.h b/engines/teenagent/dialog.h index c8f41d1621..84e8edbb7a 100644 --- a/engines/teenagent/dialog.h +++ b/engines/teenagent/dialog.h @@ -36,7 +36,7 @@ public: static uint16 pop(Scene *scene, uint16 addr, uint16 animation = 0); static void show(Scene *scene, uint16 addr, uint16 animation = 0); }; -} -#endif +} // End of namespace TeenAgent +#endif diff --git a/engines/teenagent/font.cpp b/engines/teenagent/font.cpp index 6221428f29..4f982f1775 100644 --- a/engines/teenagent/font.cpp +++ b/engines/teenagent/font.cpp @@ -22,11 +22,10 @@ * $Id$ */ +#include "teenagent/font.h" +#include "teenagent/resources.h" -#include "font.h" -#include "resources.h" - -using namespace TeenAgent; +namespace TeenAgent { Font::Font() : grid_color(0xd0), color(0xd1), data(0) { } @@ -140,3 +139,5 @@ void Font::grid(Graphics::Surface *surface, int x, int y, int w, int h, byte col Font::~Font() { delete[] data; } + +} // End of namespace TeenAgent diff --git a/engines/teenagent/font.h b/engines/teenagent/font.h index 0c6b4d2e33..7bfbca7237 100644 --- a/engines/teenagent/font.h +++ b/engines/teenagent/font.h @@ -28,6 +28,7 @@ #include "graphics/surface.h" namespace TeenAgent { + class Font { public: byte grid_color, color; @@ -42,7 +43,8 @@ public: private: byte *data; }; -} + +} // End of namespace TeenAgent #endif diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp index 608d759321..c90223463a 100644 --- a/engines/teenagent/inventory.cpp +++ b/engines/teenagent/inventory.cpp @@ -22,13 +22,14 @@ * $Id$ */ -#include "inventory.h" -#include "resources.h" #include "common/stream.h" -#include "objects.h" -#include "teenagent.h" -using namespace TeenAgent; +#include "teenagent/inventory.h" +#include "teenagent/resources.h" +#include "teenagent/objects.h" +#include "teenagent/teenagent.h" + +namespace TeenAgent { void Inventory::init(TeenAgentEngine * engine) { _engine = engine; @@ -283,3 +284,5 @@ void Inventory::render(Graphics::Surface * surface) { } } } + +} // End of namespace TeenAgent diff --git a/engines/teenagent/inventory.h b/engines/teenagent/inventory.h index bbef0208fd..e38ca9b5a1 100644 --- a/engines/teenagent/inventory.h +++ b/engines/teenagent/inventory.h @@ -25,10 +25,10 @@ #ifndef TEENAGENT_INVENTORY_H #define TEENAGENT_INVENTORY_H -#include "surface.h" -#include "animation.h" +#include "teenagent/surface.h" +#include "teenagent/animation.h" #include "common/events.h" -#include "objects.h" +#include "teenagent/objects.h" namespace TeenAgent { @@ -78,7 +78,7 @@ private: InventoryObject *hovered_obj, *selected_obj; }; -} -#endif +} // End of namespace TeenAgent +#endif diff --git a/engines/teenagent/music.cpp b/engines/teenagent/music.cpp index 58b12e7a17..61c469838e 100644 --- a/engines/teenagent/music.cpp +++ b/engines/teenagent/music.cpp @@ -23,10 +23,10 @@ * */ -#include "music.h" -#include "resources.h" +#include "teenagent/music.h" +#include "teenagent/resources.h" -using namespace TeenAgent; +namespace TeenAgent { static uint32 noteToPeriod[3][12] = { {855, 807, 761, 720, 678, 640, 604, 569, 537, 508, 480, 453}, @@ -160,3 +160,5 @@ void MusicPlayer::interrupt() { ++_currRow; } + +} // End of namespace TeenAgent diff --git a/engines/teenagent/objects.cpp b/engines/teenagent/objects.cpp index 201ed16100..8347230986 100644 --- a/engines/teenagent/objects.cpp +++ b/engines/teenagent/objects.cpp @@ -22,10 +22,10 @@ * $Id$ */ -#include "objects.h" +#include "teenagent/objects.h" #include "common/debug.h" -using namespace TeenAgent; +namespace TeenAgent { void Rect::render(Graphics::Surface *surface, uint8 color) const { surface->hLine(left, bottom, right, color); @@ -84,3 +84,5 @@ Common::String Object::description() const { Common::String InventoryObject::description() const { return Object::description(name); } + +} // End of namespace TeenAgent diff --git a/engines/teenagent/objects.h b/engines/teenagent/objects.h index 5d548f639e..b506aecf0b 100644 --- a/engines/teenagent/objects.h +++ b/engines/teenagent/objects.h @@ -99,6 +99,6 @@ struct Walkbox { #include "common/pack-end.h" // END STRUCT PACKING -} +} // End of namespace TeenAgent #endif diff --git a/engines/teenagent/pack.cpp b/engines/teenagent/pack.cpp index a6bf5777ab..6f22134143 100644 --- a/engines/teenagent/pack.cpp +++ b/engines/teenagent/pack.cpp @@ -22,12 +22,11 @@ * $Id$ */ - -#include "pack.h" +#include "teenagent/pack.h" #include "common/util.h" #include "common/debug.h" -using namespace TeenAgent; +namespace TeenAgent { Pack::Pack() : count(0), offsets(0) {} @@ -81,3 +80,5 @@ Common::SeekableReadStream * Pack::getStream(uint32 id) const { debug(0, "stream: %04x-%04x", offsets[id - 1], offsets[id]); return new Common::SeekableSubReadStream(&file, offsets[id - 1], offsets[id], false); } + +} // End of namespace TeenAgent diff --git a/engines/teenagent/pack.h b/engines/teenagent/pack.h index 947f8d75f6..4514da8d6c 100644 --- a/engines/teenagent/pack.h +++ b/engines/teenagent/pack.h @@ -44,6 +44,6 @@ public: Common::SeekableReadStream * getStream(uint32 id) const; }; -} +} // End of namespace TeenAgent #endif diff --git a/engines/teenagent/resources.cpp b/engines/teenagent/resources.cpp index 4f2fe6354c..45a9cddd8d 100644 --- a/engines/teenagent/resources.cpp +++ b/engines/teenagent/resources.cpp @@ -22,10 +22,10 @@ * $Id$ */ -#include "resources.h" -#include "teenagent.h" +#include "teenagent/resources.h" +#include "teenagent/teenagent.h" -using namespace TeenAgent; +namespace TeenAgent { Resources::Resources() {} @@ -143,3 +143,5 @@ Common::SeekableReadStream * Resources::loadLan000(uint32 id) const { } return lan000.getStream(id); } + +} // End of namespace TeenAgent diff --git a/engines/teenagent/resources.h b/engines/teenagent/resources.h index 22c6539f9b..9b7ab9e96e 100644 --- a/engines/teenagent/resources.h +++ b/engines/teenagent/resources.h @@ -22,13 +22,12 @@ * $Id$ */ - #ifndef TEENAGENT_RESOURCES_H #define TEENAGENT_RESOURCES_H -#include "pack.h" -#include "segment.h" -#include "font.h" +#include "teenagent/pack.h" +#include "teenagent/segment.h" +#include "teenagent/font.h" #include "graphics/surface.h" namespace TeenAgent { @@ -53,6 +52,6 @@ public: Font font7; }; -} +} // End of namespace TeenAgent #endif diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp index 3679496fcf..b90349c06c 100644 --- a/engines/teenagent/scene.cpp +++ b/engines/teenagent/scene.cpp @@ -22,17 +22,16 @@ * $Id$ */ - -#include "scene.h" -#include "resources.h" -#include "surface.h" +#include "teenagent/scene.h" +#include "teenagent/resources.h" +#include "teenagent/surface.h" #include "common/debug.h" -#include "objects.h" -#include "teenagent.h" -#include "dialog.h" -#include "music.h" +#include "teenagent/objects.h" +#include "teenagent/teenagent.h" +#include "teenagent/dialog.h" +#include "teenagent/music.h" -using namespace TeenAgent; +namespace TeenAgent { Scene::Scene() : _engine(NULL), _system(NULL), @@ -509,3 +508,5 @@ void Scene::clear() { events.clear(); current_event.clear(); } + +} // End of namespace TeenAgent diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h index f966312b05..693d6cf282 100644 --- a/engines/teenagent/scene.h +++ b/engines/teenagent/scene.h @@ -22,12 +22,11 @@ * $Id$ */ - #ifndef TEENAGENT_SCENE_H #define TEENAGENT_SCENE_H -#include "surface.h" -#include "actor.h" +#include "teenagent/surface.h" +#include "teenagent/actor.h" #include "common/system.h" #include "common/list.h" @@ -160,7 +159,7 @@ private: byte sound_id, sound_delay; }; -} -#endif +} // End of namespace TeenAgent +#endif diff --git a/engines/teenagent/segment.cpp b/engines/teenagent/segment.cpp index b1a57514ad..6858f5d65c 100644 --- a/engines/teenagent/segment.cpp +++ b/engines/teenagent/segment.cpp @@ -22,8 +22,9 @@ * $Id$ */ +#include "teenagent/segment.h" -#include "segment.h" +namespace TeenAgent { void Segment::read(Common::ReadStream *stream, uint32 s) { _size = s; @@ -35,3 +36,4 @@ Segment::~Segment() { delete[] _data; } +} // End of namespace TeenAgent diff --git a/engines/teenagent/segment.h b/engines/teenagent/segment.h index 487c467f7b..922a814e0b 100644 --- a/engines/teenagent/segment.h +++ b/engines/teenagent/segment.h @@ -22,13 +22,14 @@ * $Id$ */ - #ifndef TEENAGENT_SEGMENT_H #define TEENAGENT_SEGMENT_H #include "common/stream.h" #include "common/endian.h" +namespace TeenAgent { + class Segment { uint32 _size; byte * _data; @@ -76,5 +77,6 @@ public: uint size() const { return _size; } }; -#endif +} // End of namespace TeenAgent +#endif diff --git a/engines/teenagent/surface.cpp b/engines/teenagent/surface.cpp index 7de4dc08b1..7f7458cfd6 100644 --- a/engines/teenagent/surface.cpp +++ b/engines/teenagent/surface.cpp @@ -22,13 +22,12 @@ * $Id$ */ - -#include "surface.h" -#include "pack.h" +#include "teenagent/surface.h" +#include "teenagent/pack.h" #include "common/stream.h" #include "common/debug.h" -using namespace TeenAgent; +namespace TeenAgent { Surface::Surface() : x(0), y(0) { memset(flags, 0, sizeof(flags)); @@ -46,7 +45,7 @@ void Surface::load(Common::SeekableReadStream *stream, Type type) { if (stream->eos()) return; - for(byte i = 0; i < fn; ++i) { + for (byte i = 0; i < fn; ++i) { flags[i] = stream->readUint16LE(); debug(0, "flags[%u] = %u (0x%04x)", i, flags[i], flags[i]); } @@ -83,8 +82,8 @@ void Surface::render(Graphics::Surface * surface, int dx, int dy, bool mirror) { byte *src = (byte *)pixels; byte *dst = (byte *)surface->getBasePtr(dx + x, dy + 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) { byte p = src[j]; if (p != 0xff) dst[mirror? w - j - 1: j] = p; @@ -93,3 +92,5 @@ void Surface::render(Graphics::Surface * surface, int dx, int dy, bool mirror) { src += pitch; } } + +} // End of namespace TeenAgent diff --git a/engines/teenagent/surface.h b/engines/teenagent/surface.h index acbbed5971..b337167460 100644 --- a/engines/teenagent/surface.h +++ b/engines/teenagent/surface.h @@ -22,7 +22,6 @@ * $Id$ */ - #ifndef TAGET_SURFACE_H #define TAGET_SURFACE_H @@ -46,7 +45,6 @@ public: bool empty() const { return pixels == NULL; } }; -} +} // End of namespace TeenAgent #endif - diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp index 675663f46a..0d8c994b7a 100644 --- a/engines/teenagent/teenagent.cpp +++ b/engines/teenagent/teenagent.cpp @@ -22,7 +22,6 @@ * $Id$ */ - #include "teenagent/teenagent.h" #include "common/system.h" #include "common/events.h" @@ -30,11 +29,11 @@ #include "common/savefile.h" #include "common/config-manager.h" #include "sound/mixer.h" -#include "scene.h" -#include "objects.h" -#include "music.h" +#include "teenagent/scene.h" +#include "teenagent/objects.h" +#include "teenagent/music.h" -using namespace TeenAgent; +namespace TeenAgent { TeenAgentEngine::TeenAgentEngine(OSystem * system, const GameDescription *gd) : Engine(system), action(ActionNone), _gameDescription(gd) { music = new MusicPlayer(); @@ -482,3 +481,5 @@ bool TeenAgentEngine::hasFeature(EngineFeature f) const { return false; } } + +} // End of namespace TeenAgent diff --git a/engines/teenagent/teenagent.h b/engines/teenagent/teenagent.h index d4f61f82cb..228d581ffd 100644 --- a/engines/teenagent/teenagent.h +++ b/engines/teenagent/teenagent.h @@ -22,14 +22,13 @@ * $Id$ */ - #ifndef TEENAGENT_ENGINE_H #define TEENAGENT_ENGINE_H #include "engines/engine.h" -#include "pack.h" -#include "resources.h" -#include "inventory.h" +#include "teenagent/pack.h" +#include "teenagent/resources.h" +#include "teenagent/inventory.h" #include "sound/audiostream.h" #include "sound/mixer.h" #include "engines/advancedDetector.h" @@ -117,7 +116,6 @@ private: const GameDescription *_gameDescription; }; -} +} // End of namespace TeenAgent #endif - |