aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/teenagent/actor.cpp4
-rw-r--r--engines/teenagent/actor.h2
-rw-r--r--engines/teenagent/animation.cpp10
-rw-r--r--engines/teenagent/animation.h10
-rw-r--r--engines/teenagent/dialog.cpp2
-rw-r--r--engines/teenagent/inventory.cpp26
-rw-r--r--engines/teenagent/inventory.h6
-rw-r--r--engines/teenagent/music.cpp2
-rw-r--r--engines/teenagent/objects.cpp2
-rw-r--r--engines/teenagent/pack.cpp2
-rw-r--r--engines/teenagent/pack.h2
-rw-r--r--engines/teenagent/resources.cpp16
-rw-r--r--engines/teenagent/resources.h10
-rw-r--r--engines/teenagent/scene.cpp60
-rw-r--r--engines/teenagent/scene.h16
-rw-r--r--engines/teenagent/segment.h6
-rw-r--r--engines/teenagent/surface.cpp2
-rw-r--r--engines/teenagent/surface.h4
-rw-r--r--engines/teenagent/teenagent.cpp36
-rw-r--r--engines/teenagent/teenagent.h10
20 files changed, 114 insertions, 114 deletions
diff --git a/engines/teenagent/actor.cpp b/engines/teenagent/actor.cpp
index 57532e6d62..6971c44901 100644
--- a/engines/teenagent/actor.cpp
+++ b/engines/teenagent/actor.cpp
@@ -27,12 +27,12 @@
namespace TeenAgent {
-void Actor::render(Graphics::Surface * surface, const Common::Point & position, uint8 orientation, int delta_frame) {
+void Actor::render(Graphics::Surface *surface, const Common::Point & position, uint8 orientation, int delta_frame) {
const uint8 frames_left_right[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
const uint8 frames_up[] = {18, 19, 20, 21, 22, 23, 24, 25, };
const uint8 frames_down[] = {10, 11, 12, 13, 14, 15, 16, 17, };
- Surface * s = NULL;
+ Surface *s = NULL;
if (delta_frame == 0) {
index = 0; //static animation
diff --git a/engines/teenagent/actor.h b/engines/teenagent/actor.h
index 3aae27c073..a686bd4fef 100644
--- a/engines/teenagent/actor.h
+++ b/engines/teenagent/actor.h
@@ -29,7 +29,7 @@ namespace TeenAgent {
class Actor : public Animation {
public:
- void render(Graphics::Surface * surface, const Common::Point & position, uint8 orientation, int delta_frame);
+ 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 794918de40..bae4ad9c14 100644
--- a/engines/teenagent/animation.cpp
+++ b/engines/teenagent/animation.cpp
@@ -30,11 +30,11 @@ namespace TeenAgent {
Animation::Animation() : id(0), x(0), y(0), loop(true), paused(false), data(0), data_size(0), frames_count(0), frames(0), index(0) {
}
-Surface * Animation::firstFrame(){
+Surface *Animation::firstFrame(){
if (frames == NULL || frames_count == 0)
return NULL;
- Surface * r = frames;
+ Surface *r = frames;
uint16 pos = READ_LE_UINT16(data + 1);
if (pos != 0) {
r->x = pos % 320;
@@ -43,14 +43,14 @@ Surface * Animation::firstFrame(){
return r;
}
-Surface * Animation::currentFrame(int dt) {
+Surface *Animation::currentFrame(int dt) {
if (paused)
return firstFrame();
if (frames == NULL || frames_count == 0)
return NULL;
- Surface * r;
+ Surface *r;
if (data != NULL) {
uint32 frame = 3 * index;
@@ -102,7 +102,7 @@ void Animation::free() {
index = 0;
}
-void Animation::load(Common::SeekableReadStream * s, Type type) {
+void Animation::load(Common::SeekableReadStream *s, Type type) {
//fixme: do not reload the same animation each time
free();
diff --git a/engines/teenagent/animation.h b/engines/teenagent/animation.h
index a5d7e25c7c..86839bd79b 100644
--- a/engines/teenagent/animation.h
+++ b/engines/teenagent/animation.h
@@ -38,11 +38,11 @@ public:
enum Type {TypeLan, TypeVaria, TypeInventory};
Animation();
- void load(Common::SeekableReadStream * s, Type type = TypeLan);
+ void load(Common::SeekableReadStream *s, Type type = TypeLan);
void free();
- Surface * firstFrame();
- Surface * currentFrame(int dt = 1);
+ Surface *firstFrame();
+ Surface *currentFrame(int dt = 1);
uint16 currentIndex() const { return index; }
~Animation();
@@ -53,11 +53,11 @@ public:
//uint16 height() const { return frames? frames[0].h: 0; }
protected:
- byte * data;
+ byte *data;
uint16 data_size;
uint16 frames_count;
- Surface * frames;
+ Surface *frames;
uint16 index;
};
diff --git a/engines/teenagent/dialog.cpp b/engines/teenagent/dialog.cpp
index 3102266c10..ca0bfee79d 100644
--- a/engines/teenagent/dialog.cpp
+++ b/engines/teenagent/dialog.cpp
@@ -28,7 +28,7 @@
namespace TeenAgent {
-void Dialog::show(Scene * scene, uint16 addr, uint16 animation1, uint16 animation2, byte color1, byte color2, byte slot1, byte slot2) {
+void Dialog::show(Scene *scene, uint16 addr, uint16 animation1, uint16 animation2, byte color1, byte color2, byte slot1, byte slot2) {
--slot1;
--slot2;
debug(0, "Dialog::pop(%04x, %u:%u, %u:%u)", addr, slot1, animation1, slot2, animation2);
diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp
index ccb182e8b0..39cdd9e4bc 100644
--- a/engines/teenagent/inventory.cpp
+++ b/engines/teenagent/inventory.cpp
@@ -31,12 +31,12 @@
namespace TeenAgent {
-void Inventory::init(TeenAgentEngine * engine) {
+void Inventory::init(TeenAgentEngine *engine) {
_engine = engine;
_active = false;
- Resources * res = Resources::instance();
+ Resources *res = Resources::instance();
- Common::SeekableReadStream * s = res->varia.getStream(3);
+ Common::SeekableReadStream *s = res->varia.getStream(3);
assert(s != NULL);
debug(0, "loading inventory background...");
background.load(s, Surface::TypeOns);
@@ -111,7 +111,7 @@ void Inventory::add(byte item) {
}
bool Inventory::processEvent(const Common::Event &event) {
- Resources * res = Resources::instance();
+ Resources *res = Resources::instance();
switch(event.type) {
case Common::EVENT_MOUSEMOVE:
@@ -157,7 +157,7 @@ bool Inventory::processEvent(const Common::Event &event) {
int id2 = hovered_obj->id;
debug(0, "combine(0x%02x, 0x%02x)!", id1, id2);
- byte * table = res->dseg.ptr(0xC335);
+ byte *table = res->dseg.ptr(0xC335);
while (table[0] != 0 && table[1] != 0) {
if (
(id1 == table[0] && id2 == table[1]) ||
@@ -189,7 +189,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();
@@ -227,8 +227,8 @@ void Inventory::Item::free() {
surface.free();
}
-void Inventory::Item::render(Inventory * inventory, InventoryObject *obj, Graphics::Surface * dst) {
- Resources * res = Resources::instance();
+void Inventory::Item::render(Inventory *inventory, InventoryObject *obj, Graphics::Surface *dst) {
+ Resources *res = Resources::instance();
rect.render(dst, hovered? 233: 234);
if (obj->animated) {
@@ -238,13 +238,13 @@ void Inventory::Item::render(Inventory * inventory, InventoryObject *obj, Graphi
animation.load(inventory->items, Animation::TypeInventory);
}
if (hovered) {
- Surface * s = animation.currentFrame();
+ Surface *s = animation.currentFrame();
if (animation.currentIndex() == 0)
s = animation.currentFrame();
if (s != NULL)
s->render(dst, rect.left + 1, rect.top + 1);
} else {
- Surface * s = animation.firstFrame();
+ Surface *s = animation.firstFrame();
if (s != NULL)
s->render(dst, rect.left + 1, rect.top + 1);
}
@@ -270,12 +270,12 @@ void Inventory::Item::render(Inventory * inventory, InventoryObject *obj, Graphi
}
}
-void Inventory::render(Graphics::Surface * surface) {
+void Inventory::render(Graphics::Surface *surface) {
if (!_active)
return;
background.render(surface);
- Resources * res = Resources::instance();
+ Resources *res = Resources::instance();
for (int y = 0; y < 4; y++) {
for (int x = 0; x < 6; x++) {
@@ -286,7 +286,7 @@ void Inventory::render(Graphics::Surface * surface) {
//debug(0, "%d,%d -> %u", x0, y0, item);
- InventoryObject * obj = (InventoryObject *)res->dseg.ptr(READ_LE_UINT16(objects + item * 2));
+ InventoryObject *obj = (InventoryObject *)res->dseg.ptr(READ_LE_UINT16(objects + item * 2));
graphics[idx].render(this, obj, surface);
}
}
diff --git a/engines/teenagent/inventory.h b/engines/teenagent/inventory.h
index e38ca9b5a1..16a9aee573 100644
--- a/engines/teenagent/inventory.h
+++ b/engines/teenagent/inventory.h
@@ -37,8 +37,8 @@ class TeenAgentEngine;
class Inventory {
public:
- void init(TeenAgentEngine * engine);
- void render(Graphics::Surface * surface);
+ void init(TeenAgentEngine *engine);
+ void render(Graphics::Surface *surface);
void clear();
void add(byte item);
@@ -69,7 +69,7 @@ private:
Item() : hovered(false) {}
void free();
- void render(Inventory *inventory, InventoryObject *obj, Graphics::Surface * surface);
+ void render(Inventory *inventory, InventoryObject *obj, Graphics::Surface *surface);
} graphics[24];
bool _active;
diff --git a/engines/teenagent/music.cpp b/engines/teenagent/music.cpp
index 45df21b6f0..ad950165fa 100644
--- a/engines/teenagent/music.cpp
+++ b/engines/teenagent/music.cpp
@@ -41,7 +41,7 @@ MusicPlayer::~MusicPlayer() {
}
bool MusicPlayer::load(int id) {
- Resources * res = Resources::instance();
+ Resources *res = Resources::instance();
Common::SeekableReadStream *stream = res->mmm.getStream(id);
if (stream == NULL)
diff --git a/engines/teenagent/objects.cpp b/engines/teenagent/objects.cpp
index fd97b15891..6e59a73892 100644
--- a/engines/teenagent/objects.cpp
+++ b/engines/teenagent/objects.cpp
@@ -50,7 +50,7 @@ void Object::dump() {
}
Common::String Object::description(const char *name) {
- const char * desc = name + strlen(name) + 1;
+ const char *desc = name + strlen(name) + 1;
if (*desc == 0)
return Common::String();
diff --git a/engines/teenagent/pack.cpp b/engines/teenagent/pack.cpp
index 67c58895e1..67252601ad 100644
--- a/engines/teenagent/pack.cpp
+++ b/engines/teenagent/pack.cpp
@@ -74,7 +74,7 @@ uint32 Pack::read(uint32 id, byte *dst, uint32 size) const {
return r;
}
-Common::SeekableReadStream * Pack::getStream(uint32 id) const {
+Common::SeekableReadStream *Pack::getStream(uint32 id) const {
if (id < 1 || id > count)
return 0;
debug(0, "stream: %04x-%04x", offsets[id - 1], offsets[id]);
diff --git a/engines/teenagent/pack.h b/engines/teenagent/pack.h
index 4514da8d6c..0619cc28e3 100644
--- a/engines/teenagent/pack.h
+++ b/engines/teenagent/pack.h
@@ -41,7 +41,7 @@ public:
void close();
uint32 get_size(uint32 id) const;
uint32 read(uint32 id, byte *dst, uint32 size) const;
- Common::SeekableReadStream * getStream(uint32 id) const;
+ Common::SeekableReadStream *getStream(uint32 id) const;
};
} // End of namespace TeenAgent
diff --git a/engines/teenagent/resources.cpp b/engines/teenagent/resources.cpp
index c13af1febf..21200fca83 100644
--- a/engines/teenagent/resources.cpp
+++ b/engines/teenagent/resources.cpp
@@ -30,7 +30,7 @@ namespace TeenAgent {
Resources::Resources() {}
-Resources * Resources::instance() {
+Resources *Resources::instance() {
static Resources i;
return &i;
}
@@ -47,7 +47,7 @@ void Resources::deinit() {
sam_sam.close();
}
-bool Resources::loadArchives(const ADGameDescription * gd) {
+bool Resources::loadArchives(const ADGameDescription *gd) {
Common::File dat_file;
if (!dat_file.open("teenagent.dat")) {
Common::String errorMessage = "You're missing the 'teenagent.dat' file. Get it from the ScummVM website";
@@ -55,7 +55,7 @@ bool Resources::loadArchives(const ADGameDescription * gd) {
warning("%s", errorMessage.c_str());
return false;
}
- Common::SeekableReadStream * dat = Common::wrapCompressedReadStream(&dat_file);
+ Common::SeekableReadStream *dat = Common::wrapCompressedReadStream(&dat_file);
cseg.read(dat, 0xb3b0);
dseg.read(dat, 0xe790);
eseg.read(dat, 0x8be2);
@@ -81,7 +81,7 @@ bool Resources::loadArchives(const ADGameDescription * gd) {
return true;
}
-void Resources::loadOff(Graphics::Surface &surface, byte * palette, int id) {
+void Resources::loadOff(Graphics::Surface &surface, byte *palette, int id) {
uint32 size = off.get_size(id);
if (size == 0) {
error("invalid background %d", id);
@@ -90,17 +90,17 @@ void Resources::loadOff(Graphics::Surface &surface, byte * palette, int id) {
byte buf[64768];
off.read(id, buf, sizeof(buf));
- byte * src = buf;
- byte * dst = (byte *)surface.pixels;
+ byte *src = buf;
+ byte *dst = (byte *)surface.pixels;
memcpy(dst, src, 64000);
memcpy(palette, buf + 64000, 768);
}
-Common::SeekableReadStream * Resources::loadLan(uint32 id) const {
+Common::SeekableReadStream *Resources::loadLan(uint32 id) const {
return id <= 500? loadLan000(id): lan500.getStream(id - 500);
}
-Common::SeekableReadStream * Resources::loadLan000(uint32 id) const {
+Common::SeekableReadStream *Resources::loadLan000(uint32 id) const {
switch(id) {
case 81:
diff --git a/engines/teenagent/resources.h b/engines/teenagent/resources.h
index f62b5e321f..0f6a57d8fe 100644
--- a/engines/teenagent/resources.h
+++ b/engines/teenagent/resources.h
@@ -38,13 +38,13 @@ class Resources {
protected:
Resources();
public:
- static Resources * instance();
- bool loadArchives(const ADGameDescription * gd);
+ static Resources *instance();
+ bool loadArchives(const ADGameDescription *gd);
void deinit();
void loadOff(Graphics::Surface &surface, byte *palette, int id);
- Common::SeekableReadStream * loadLan(uint32 id) const;
- Common::SeekableReadStream * loadLan000(uint32 id) const;
- //void loadOn(Graphics::Surface &surface, int id, uint16 &dst, uint16 * flags);
+ Common::SeekableReadStream *loadLan(uint32 id) const;
+ Common::SeekableReadStream *loadLan000(uint32 id) const;
+ //void loadOn(Graphics::Surface &surface, int id, uint16 &dst, uint16 *flags);
//void loadOns(Graphics::Surface &surface, int id, uint16 &dst);
Pack varia, off, on, ons, lan000, lan500, mmm, sam_mmm, sam_sam;
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index 1d6830199f..d2b78004a6 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) {
debug(0, "moveTo(%d, %d, %u)", point.x, point.y, orient);
if (validate) {
for (byte i = 0; i < walkboxes; ++i) {
- Walkbox * w = walkbox[i];
+ Walkbox *w = walkbox[i];
if (w->rect.in(point)) {
debug(0, "bumped into walkbox %u", i);
byte o = w->orientation;
@@ -89,12 +89,12 @@ void Scene::moveTo(const Common::Point & _point, byte orient, bool validate) {
}
-void Scene::init(TeenAgentEngine *engine, OSystem * system) {
+void Scene::init(TeenAgentEngine *engine, OSystem *system) {
_engine = engine;
_system = system;
- Resources * res = Resources::instance();
- Common::SeekableReadStream * s = res->varia.getStream(1);
+ Resources *res = Resources::instance();
+ Common::SeekableReadStream *s = res->varia.getStream(1);
if (s == NULL)
error("invalid resource data");
@@ -112,18 +112,18 @@ void Scene::init(TeenAgentEngine *engine, OSystem * system) {
}
byte *Scene::getOns(int id) {
- Resources * res = Resources::instance();
+ Resources *res = Resources::instance();
return res->dseg.ptr(res->dseg.get_word(0xb4f5 + (id - 1) * 2));
}
-byte * Scene::getLans(int id) {
- Resources * res = Resources::instance();
+byte *Scene::getLans(int id) {
+ Resources *res = Resources::instance();
return res->dseg.ptr(0xd89e + (id - 1) * 4);
}
void Scene::loadOns() {
debug(0, "loading ons animation");
- Resources * res = Resources::instance();
+ Resources *res = Resources::instance();
uint16 addr = res->dseg.get_word(0xb4f5 + (_id - 1) * 2);
//debug(0, "ons index: %04x", addr);
@@ -146,7 +146,7 @@ void Scene::loadOns() {
if (ons_count > 0) {
ons = new Surface[ons_count];
for (uint32 i = 0; i < ons_count; ++i) {
- Common::SeekableReadStream * s = res->ons.getStream(on_id[i]);
+ Common::SeekableReadStream *s = res->ons.getStream(on_id[i]);
if (s != NULL)
ons[i].load(s, Surface::TypeOns);
}
@@ -155,7 +155,7 @@ void Scene::loadOns() {
void Scene::loadLans() {
debug(0, "loading lans animation");
- Resources * res = Resources::instance();
+ Resources *res = Resources::instance();
//load lan000
for (int i = 0; i < 4; ++i) {
@@ -168,7 +168,7 @@ void Scene::loadLans() {
if (bxv == 0)
continue;
- Common::SeekableReadStream * s = res->loadLan000(res_id);
+ Common::SeekableReadStream *s = res->loadLan000(res_id);
if (s != NULL) {
animations[i].load(s, Animation::TypeLan);
if (bxv != 0 && bxv != 0xff)
@@ -190,7 +190,7 @@ void Scene::init(int id, const Common::Point &pos) {
warp(pos);
- Resources * res = Resources::instance();
+ Resources *res = Resources::instance();
res->loadOff(background, palette, id);
if (id == 24) {
//dark scene
@@ -214,7 +214,7 @@ void Scene::init(int id, const Common::Point &pos) {
loadOns();
loadLans();
- byte * walkboxes_base = res->dseg.ptr(READ_LE_UINT16(res->dseg.ptr(0x6746 + (id - 1) * 2)));
+ byte *walkboxes_base = res->dseg.ptr(READ_LE_UINT16(res->dseg.ptr(0x6746 + (id - 1) * 2)));
walkboxes = *walkboxes_base++;
debug(0, "found %d walkboxes", walkboxes);
@@ -232,7 +232,7 @@ void Scene::init(int id, const Common::Point &pos) {
void Scene::playAnimation(byte idx, uint id, bool loop, bool paused) {
assert(idx < 4);
- Common::SeekableReadStream * s = Resources::instance()->loadLan(id + 1);
+ Common::SeekableReadStream *s = Resources::instance()->loadLan(id + 1);
if (s == NULL)
error("playing animation %u failed", id);
@@ -242,7 +242,7 @@ void Scene::playAnimation(byte idx, uint id, bool loop, bool paused) {
}
void Scene::playActorAnimation(uint id, bool loop) {
- Common::SeekableReadStream * s = Resources::instance()->loadLan(id + 1);
+ Common::SeekableReadStream *s = Resources::instance()->loadLan(id + 1);
if (s == NULL)
error("playing animation %u failed", id);
@@ -287,12 +287,12 @@ bool Scene::processEvent(const Common::Event &event) {
}
}
-bool Scene::render(OSystem * system) {
+bool Scene::render(OSystem *system) {
//render background
- Resources * res = Resources::instance();
+ Resources *res = Resources::instance();
if (current_event.type == SceneEvent::CreditsMessage) {
system->fillScreen(0);
- Graphics::Surface * surface = system->lockScreen();
+ Graphics::Surface *surface = system->lockScreen();
res->font8.color = current_event.color;
res->font8.shadow_color = current_event.orientation;
res->font8.render(surface, current_event.dst.x, current_event.dst.y, message);
@@ -308,11 +308,11 @@ bool Scene::render(OSystem * system) {
busy = processEventQueue();
system->copyRectToScreen((const byte *)background.pixels, background.pitch, 0, 0, background.w, background.h);
- Graphics::Surface * surface = system->lockScreen();
+ Graphics::Surface *surface = system->lockScreen();
if (ons != NULL) {
for (uint32 i = 0; i < ons_count; ++i) {
- Surface* s = ons + i;
+ Surface *s = ons + i;
if (s != NULL)
s->render(surface);
}
@@ -345,7 +345,7 @@ bool Scene::render(OSystem * system) {
if (a->id == 0)
continue;
- Object * obj = getObject(a->id);
+ Object *obj = getObject(a->id);
if (obj != NULL) {
obj->rect.left = s->x;
obj->rect.top = s->y;
@@ -356,7 +356,7 @@ bool Scene::render(OSystem * system) {
}
if (!hide_actor) {
- Surface * mark = actor_animation.currentFrame();
+ Surface *mark = actor_animation.currentFrame();
if (mark == NULL) {
actor_animation.free();
@@ -407,7 +407,7 @@ bool Scene::render(OSystem * system) {
// current_event.dump();
/*
for (byte i = 0; i < walkboxes; ++i) {
- Walkbox * w = walkbox[i];
+ Walkbox *w = walkbox[i];
w->rect.render(surface, 0xd0 + i);
}
*/
@@ -437,7 +437,7 @@ bool Scene::processEventQueue() {
switch(current_event.type) {
case SceneEvent::SetOn: {
- byte * ptr = getOns(current_event.scene == 0? _id: current_event.scene);
+ byte *ptr = getOns(current_event.scene == 0? _id: current_event.scene);
debug(0, "on[%u] = %02x", current_event.ons - 1, current_event.color);
ptr[current_event.ons - 1] = current_event.color;
loadOns();
@@ -447,7 +447,7 @@ bool Scene::processEventQueue() {
case SceneEvent::SetLan: {
if (current_event.lan != 0) {
debug(0, "lan[%u] = %02x", current_event.lan - 1, current_event.color);
- byte * ptr = getLans(current_event.scene == 0? _id: current_event.scene);
+ byte *ptr = getLans(current_event.scene == 0? _id: current_event.scene);
ptr[current_event.lan - 1] = current_event.color;
}
loadLans();
@@ -524,7 +524,7 @@ bool Scene::processEventQueue() {
case SceneEvent::EnableObject: {
debug(0, "%s object #%u", current_event.color?"enabling":"disabling", current_event.object - 1);
- Object * obj = getObject(current_event.object - 1, current_event.scene == 0? _id: current_event.scene);
+ Object *obj = getObject(current_event.object - 1, current_event.scene == 0? _id: current_event.scene);
obj->enabled = current_event.color;
current_event.clear();
}
@@ -555,7 +555,7 @@ bool Scene::processEventQueue() {
return !current_event.empty();
}
-void Scene::setPalette(OSystem *system, const byte * buf, unsigned mul) {
+void Scene::setPalette(OSystem *system, const byte *buf, unsigned mul) {
byte p[1024];
memset(p, 0, 1024);
@@ -567,11 +567,11 @@ void Scene::setPalette(OSystem *system, const byte * buf, unsigned mul) {
system->setPalette(p, 0, 256);
}
-Object * Scene::getObject(int id, int scene_id) {
+Object *Scene::getObject(int id, int scene_id) {
if (scene_id == 0)
scene_id = _id;
- Resources * res = Resources::instance();
+ Resources *res = Resources::instance();
uint16 addr = res->dseg.get_word(0x7254 + (scene_id - 1) * 2);
//debug(0, "object base: %04x, x: %d, %d", addr, point.x, point.y);
uint16 object = res->dseg.get_word(addr + 2 * id - 2);
@@ -581,7 +581,7 @@ Object * Scene::getObject(int id, int scene_id) {
}
Common::Point Scene::messagePosition(const Common::String &str, const Common::Point & position) {
- Resources * res = Resources::instance();
+ Resources *res = Resources::instance();
uint w = res->font7.render(NULL, 0, 0, str);
Common::Point message_pos = position;
message_pos.x -= w / 2;
diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h
index 081b01c6fe..6f8430968a 100644
--- a/engines/teenagent/scene.h
+++ b/engines/teenagent/scene.h
@@ -95,9 +95,9 @@ public:
Scene();
- void init(TeenAgentEngine *engine, OSystem * system);
+ void init(TeenAgentEngine *engine, OSystem *system);
void init(int id, const Common::Point &pos);
- bool render(OSystem * system);
+ bool render(OSystem *system);
int getId() const { return _id; }
void warp(const Common::Point & point, byte orientation = 0);
@@ -113,13 +113,13 @@ public:
void clear();
- byte * getOns(int id);
- byte * getLans(int id);
+ byte *getOns(int id);
+ byte *getLans(int id);
bool eventRunning() const { return !current_event.empty(); }
Walkbox *getWalkbox(byte id) { return walkbox[id]; }
- Object * getObject(int id, int scene_id = 0);
+ Object *getObject(int id, int scene_id = 0);
private:
void loadOns();
@@ -129,7 +129,7 @@ private:
void playActorAnimation(uint id, bool loop);
byte palette[768];
- void setPalette(OSystem *system, const byte * palette, unsigned mul = 1);
+ void setPalette(OSystem *system, const byte *palette, unsigned mul = 1);
static Common::Point messagePosition(const Common::String &str, const Common::Point & position);
bool processEventQueue();
@@ -139,7 +139,7 @@ private:
}
TeenAgentEngine *_engine;
- OSystem * _system;
+ OSystem *_system;
int _id;
Graphics::Surface background;
@@ -154,7 +154,7 @@ private:
uint8 orientation;
byte walkboxes;
- Walkbox * walkbox[255];
+ Walkbox *walkbox[255];
Common::String message;
Common::Point message_pos;
diff --git a/engines/teenagent/segment.h b/engines/teenagent/segment.h
index 922a814e0b..f87f46a8c0 100644
--- a/engines/teenagent/segment.h
+++ b/engines/teenagent/segment.h
@@ -32,7 +32,7 @@ namespace TeenAgent {
class Segment {
uint32 _size;
- byte * _data;
+ byte *_data;
public:
Segment() : _size(0), _data(0) {}
@@ -65,12 +65,12 @@ public:
return WRITE_LE_UINT32(_data + offset, v);
}
- const byte * ptr(uint32 addr) const {
+ const byte *ptr(uint32 addr) const {
assert(addr < _size);
return _data + addr;
}
- byte * ptr(uint32 addr) {
+ byte *ptr(uint32 addr) {
assert(addr < _size);
return _data + addr;
}
diff --git a/engines/teenagent/surface.cpp b/engines/teenagent/surface.cpp
index 7f7458cfd6..0679aa28da 100644
--- a/engines/teenagent/surface.cpp
+++ b/engines/teenagent/surface.cpp
@@ -75,7 +75,7 @@ void Surface::load(Common::SeekableReadStream *stream, Type type) {
stream->read(pixels, w_ * h_);
}
-void Surface::render(Graphics::Surface * surface, int dx, int dy, bool mirror) {
+void Surface::render(Graphics::Surface *surface, int dx, int dy, bool mirror) {
assert(x + w <= surface->w);
assert(y + h <= surface->h);
diff --git a/engines/teenagent/surface.h b/engines/teenagent/surface.h
index b337167460..24149f5fa2 100644
--- a/engines/teenagent/surface.h
+++ b/engines/teenagent/surface.h
@@ -39,8 +39,8 @@ public:
uint16 x, y;
Surface();
- void load(Common::SeekableReadStream * stream, Type type);
- void render(Graphics::Surface * surface, int dx = 0, int dy = 0, bool mirror = false);
+ void load(Common::SeekableReadStream *stream, Type type);
+ void render(Graphics::Surface *surface, int dx = 0, int dy = 0, bool mirror = false);
bool empty() const { return pixels == NULL; }
};
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp
index 60e7dec39a..8368e75785 100644
--- a/engines/teenagent/teenagent.cpp
+++ b/engines/teenagent/teenagent.cpp
@@ -36,7 +36,7 @@
namespace TeenAgent {
-TeenAgentEngine::TeenAgentEngine(OSystem * system, const ADGameDescription *gd) : Engine(system), action(ActionNone), _gameDescription(gd) {
+TeenAgentEngine::TeenAgentEngine(OSystem *system, const ADGameDescription *gd) : Engine(system), action(ActionNone), _gameDescription(gd) {
music = new MusicPlayer();
}
@@ -44,10 +44,10 @@ void TeenAgentEngine::processObject() {
if (dst_object == NULL)
return;
- Resources * res = Resources::instance();
+ Resources *res = Resources::instance();
switch (action) {
case ActionExamine: {
- byte * dcall = res->dseg.ptr(0xb5ce);
+ byte *dcall = res->dseg.ptr(0xb5ce);
dcall = res->dseg.ptr(READ_LE_UINT16(dcall + scene->getId() * 2 - 2));
dcall += 2 * dst_object->id - 2;
uint16 callback = READ_LE_UINT16(dcall);
@@ -62,9 +62,9 @@ void TeenAgentEngine::processObject() {
{
InventoryObject *inv = inventory->selectedObject();
if (inv != NULL) {
- byte * dcall = res->dseg.ptr(0xbb87);
+ 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);
@@ -81,7 +81,7 @@ void TeenAgentEngine::processObject() {
break;
} else {
- byte * dcall = res->dseg.ptr(0xb89c);
+ byte *dcall = res->dseg.ptr(0xb89c);
dcall = res->dseg.ptr(READ_LE_UINT16(dcall + scene->getId() * 2 - 2));
dcall += 2 * dst_object->id - 2;
uint16 callback = READ_LE_UINT16(dcall);
@@ -150,7 +150,7 @@ Common::Error TeenAgentEngine::loadGameState(int slot) {
if (in == NULL)
return Common::kReadPermissionDenied;
- Resources * res = Resources::instance();
+ Resources *res = Resources::instance();
assert(res->dseg.size() >= 0x6478 + 0x777a);
char data[0x777a];
@@ -181,7 +181,7 @@ Common::Error TeenAgentEngine::saveGameState(int slot, const char *desc) {
if (out == NULL)
return Common::kWritePermissionDenied;
- Resources * res = Resources::instance();
+ Resources *res = Resources::instance();
res->dseg.set_byte(0xB4F3, scene->getId());
Common::Point pos = scene->getPosition();
res->dseg.set_word(0x64AF, pos.x);
@@ -195,11 +195,11 @@ Common::Error TeenAgentEngine::saveGameState(int slot, const char *desc) {
}
Common::Error TeenAgentEngine::run() {
- Resources * res = Resources::instance();
+ Resources *res = Resources::instance();
if (!res->loadArchives(_gameDescription))
return Common::kUnknownError;
- Common::EventManager * _event = _system->getEventManager();
+ Common::EventManager *_event = _system->getEventManager();
initGraphics(320, 200, false);
@@ -237,7 +237,7 @@ Common::Error TeenAgentEngine::run() {
do {
_system->showMouse(true);
uint32 t0 = _system->getMillis();
- Object * current_object = findObject(scene->getId(), mouse);
+ Object *current_object = findObject(scene->getId(), mouse);
while (_event->pollEvent(event)) {
if (event.type == Common::EVENT_RTL) {
@@ -275,7 +275,7 @@ Common::Error TeenAgentEngine::run() {
}
bool busy = inventory->active() || scene_busy;
- Graphics::Surface * surface = _system->lockScreen();
+ Graphics::Surface *surface = _system->lockScreen();
if (!busy) {
InventoryObject *selected_object = inventory->selectedObject();
@@ -314,8 +314,8 @@ Common::Error TeenAgentEngine::run() {
return Common::kNoError;
}
-Object * TeenAgentEngine::findObject(int id, const Common::Point &point) {
- Resources * res = Resources::instance();
+Object *TeenAgentEngine::findObject(int id, const Common::Point &point) {
+ Resources *res = Resources::instance();
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;
@@ -345,7 +345,7 @@ void TeenAgentEngine::displayMessage(const Common::String &str, byte color) {
Common::String TeenAgentEngine::parseMessage(uint16 addr) {
Common::String message;
for (
- const char * str = (const char *)Resources::instance()->dseg.ptr(addr);
+ const char *str = (const char *)Resources::instance()->dseg.ptr(addr);
str[0] != 0 || str[1] != 0;
++str)
{
@@ -366,7 +366,7 @@ void TeenAgentEngine::displayMessage(uint16 addr, byte color) {
void TeenAgentEngine::displayCredits(uint16 addr) {
SceneEvent event(SceneEvent::CreditsMessage);
- const byte * src = Resources::instance()->dseg.ptr(addr);
+ const byte *src = Resources::instance()->dseg.ptr(addr);
event.orientation = *src++;
event.color = *src++;
@@ -517,8 +517,8 @@ void TeenAgentEngine::waitAnimation() {
}
void TeenAgentEngine::playSoundNow(byte id) {
- Resources * res = Resources::instance();
- Common::SeekableReadStream * in = res->sam_sam.getStream(id);
+ Resources *res = Resources::instance();
+ Common::SeekableReadStream *in = res->sam_sam.getStream(id);
if (in == NULL) {
debug(0, "skipping invalid sound %u", id);
return;
diff --git a/engines/teenagent/teenagent.h b/engines/teenagent/teenagent.h
index 2adafabdcd..8944d06f16 100644
--- a/engines/teenagent/teenagent.h
+++ b/engines/teenagent/teenagent.h
@@ -44,7 +44,7 @@ class TeenAgentEngine: public Engine {
public:
enum Action { ActionNone, ActionExamine, ActionUse };
- TeenAgentEngine(OSystem * system, const ADGameDescription *gd);
+ TeenAgentEngine(OSystem *system, const ADGameDescription *gd);
virtual Common::Error run();
virtual Common::Error loadGameState(int slot);
@@ -56,13 +56,13 @@ public:
void deinit();
- Object * findObject(int id, const Common::Point &point);
+ Object *findObject(int id, const Common::Point &point);
void examine(const Common::Point &point, Object *object);
void use(Object *object);
bool processCallback(uint16 addr);
- inline Scene * getScene() { return scene; }
+ inline Scene *getScene() { return scene; }
static Common::String parseMessage(uint16 addr);
@@ -72,7 +72,7 @@ public:
void displayCredits(uint16 addr);
void moveTo(const Common::Point & dst, byte o, bool warp = false);
void moveTo(uint16 x, uint16 y, byte o, bool warp = false);
- void moveTo(Object * obj);
+ void moveTo(Object *obj);
void moveRel(int16 x, int16 y, byte o, bool warp = false);
void playActorAnimation(uint16 id, bool async = false);
void playAnimation(uint16 id, byte slot, bool async = false);
@@ -105,7 +105,7 @@ private:
bool scene_busy;
Action action;
- Object * dst_object;
+ Object *dst_object;
Audio::AudioStream *_musicStream;