aboutsummaryrefslogtreecommitdiff
path: root/engines/teenagent
diff options
context:
space:
mode:
authorVladimir Menshakov2009-09-15 20:21:18 +0000
committerVladimir Menshakov2009-09-15 20:21:18 +0000
commit6db034a1db90ed2423a4cb6cc7a7ae5d87673e77 (patch)
tree580f739bc56fb8b0ec471b9dbe95cdb432fda012 /engines/teenagent
parent76ea1fbb6493cdefcb7bdc2bf1112fc7cff6f108 (diff)
downloadscummvm-rg350-6db034a1db90ed2423a4cb6cc7a7ae5d87673e77.tar.gz
scummvm-rg350-6db034a1db90ed2423a4cb6cc7a7ae5d87673e77.tar.bz2
scummvm-rg350-6db034a1db90ed2423a4cb6cc7a7ae5d87673e77.zip
renamed constants to comply with the code convention.
svn-id: r44109
Diffstat (limited to 'engines/teenagent')
-rw-r--r--engines/teenagent/actor.cpp10
-rw-r--r--engines/teenagent/animation.cpp12
-rw-r--r--engines/teenagent/animation.h4
-rw-r--r--engines/teenagent/callbacks.cpp2
-rw-r--r--engines/teenagent/dialog.cpp20
-rw-r--r--engines/teenagent/font.cpp8
-rw-r--r--engines/teenagent/inventory.cpp6
-rw-r--r--engines/teenagent/objects.h2
-rw-r--r--engines/teenagent/scene.cpp56
-rw-r--r--engines/teenagent/scene.h26
-rw-r--r--engines/teenagent/surface.cpp4
-rw-r--r--engines/teenagent/surface.h2
-rw-r--r--engines/teenagent/teenagent.cpp52
-rw-r--r--engines/teenagent/teenagent.h2
14 files changed, 109 insertions, 97 deletions
diff --git a/engines/teenagent/actor.cpp b/engines/teenagent/actor.cpp
index c52cd1e6bc..2d1874da19 100644
--- a/engines/teenagent/actor.cpp
+++ b/engines/teenagent/actor.cpp
@@ -39,22 +39,22 @@ Common::Rect Actor::render(Graphics::Surface *surface, const Common::Point &posi
}
int dx, dy;
switch (orientation) {
- case Object::ActorLeft:
- case Object::ActorRight:
+ case Object::kActorLeft:
+ case Object::kActorRight:
if (index >= sizeof(frames_left_right))
index = 1;
s = frames + frames_left_right[index];
dx = 11;
dy = 62;
break;
- case Object::ActorUp:
+ case Object::kActorUp:
if (index >= sizeof(frames_up))
index = 1;
s = frames + frames_up[index];
dx = 29;
dy = 67;
break;
- case Object::ActorDown:
+ case Object::kActorDown:
if (index >= sizeof(frames_down))
index = 1;
s = frames + frames_down[index];
@@ -77,7 +77,7 @@ Common::Rect Actor::render(Graphics::Surface *surface, const Common::Point &posi
if (yp + s->h > 200)
yp = 200 - s->h;
- return s != NULL? s->render(surface, xp, yp, orientation == Object::ActorLeft): Common::Rect();
+ return s != NULL? s->render(surface, xp, yp, orientation == Object::kActorLeft): Common::Rect();
}
} // End of namespace TeenAgent
diff --git a/engines/teenagent/animation.cpp b/engines/teenagent/animation.cpp
index 4fa08d5739..c77d43594a 100644
--- a/engines/teenagent/animation.cpp
+++ b/engines/teenagent/animation.cpp
@@ -114,7 +114,7 @@ void Animation::load(Common::SeekableReadStream *s, Type type) {
uint16 pos = 0;
int off = 0;
switch (type) {
- case TypeLan:
+ case kTypeLan:
data_size = s->readUint16LE();
if (s->eos()) {
debug(0, "empty animation");
@@ -141,13 +141,13 @@ void Animation::load(Common::SeekableReadStream *s, Type type) {
//debug(0, "pos?: %04x", pos);
for (uint16 i = 0; i < frames_count; ++i) {
- frames[i].load(s, Surface::TypeLan);
+ frames[i].load(s, Surface::kTypeLan);
frames[i].x = 0;
frames[i].y = 0;
}
break;
- case TypeInventory: {
+ case kTypeInventory: {
data_size = 3 * s->readByte();
data = new byte[data_size];
@@ -169,12 +169,12 @@ void Animation::load(Common::SeekableReadStream *s, Type type) {
frames = new Surface[frames_count];
for (uint16 i = 0; i < frames_count; ++i) {
- frames[i].load(s, Surface::TypeOns);
+ frames[i].load(s, Surface::kTypeOns);
}
}
break;
- case TypeVaria:
+ case kTypeVaria:
frames_count = s->readByte();
debug(0, "loading varia resource, %u physical frames", frames_count);
uint16 offset[255];
@@ -186,7 +186,7 @@ void Animation::load(Common::SeekableReadStream *s, Type type) {
for (uint16 i = 0; i < frames_count; ++i) {
debug(0, "%04x", offset[i]);
s->seek(offset[i] + off);
- frames[i].load(s, Surface::TypeOns);
+ frames[i].load(s, Surface::kTypeOns);
frames[i].x = 0;
frames[i].y = 0;
}
diff --git a/engines/teenagent/animation.h b/engines/teenagent/animation.h
index 7e157ef897..3a05f20d26 100644
--- a/engines/teenagent/animation.h
+++ b/engines/teenagent/animation.h
@@ -35,10 +35,10 @@ public:
uint16 id, x, y;
bool loop, paused;
- enum Type {TypeLan, TypeVaria, TypeInventory};
+ enum Type {kTypeLan, kTypeVaria, kTypeInventory};
Animation();
- void load(Common::SeekableReadStream *s, Type type = TypeLan);
+ void load(Common::SeekableReadStream *s, Type type = kTypeLan);
void free();
Surface *firstFrame();
diff --git a/engines/teenagent/callbacks.cpp b/engines/teenagent/callbacks.cpp
index 8a3b816db4..4d90391dc5 100644
--- a/engines/teenagent/callbacks.cpp
+++ b/engines/teenagent/callbacks.cpp
@@ -3512,7 +3512,7 @@ bool TeenAgentEngine::processCallback(uint16 addr) {
displayMessage("THE END");
debug(0, "FIXME: THE END + CREDITS");
- scene->push(SceneEvent(SceneEvent::Quit));
+ scene->push(SceneEvent(SceneEvent::kQuit));
return true;
diff --git a/engines/teenagent/dialog.cpp b/engines/teenagent/dialog.cpp
index 14729d8b60..2b5efd7092 100644
--- a/engines/teenagent/dialog.cpp
+++ b/engines/teenagent/dialog.cpp
@@ -32,20 +32,20 @@ void Dialog::show(Scene *scene, uint16 addr, uint16 animation1, uint16 animation
--slot1;
--slot2;
debug(0, "Dialog::pop(%04x, %u:%u, %u:%u)", addr, slot1, animation1, slot2, animation2);
- Resources * res = Resources::instance();
+ Resources *res = Resources::instance();
int n = 0;
Common::String message;
byte color = color1;
if (animation1 != 0) {
- SceneEvent e(SceneEvent::PlayAnimation);
+ SceneEvent e(SceneEvent::kPlayAnimation);
e.animation = animation1;
e.lan = 0xc0 | slot1; //looped, paused
scene->push(e);
}
if (animation2 != 0) {
- SceneEvent e(SceneEvent::PlayAnimation);
+ SceneEvent e(SceneEvent::kPlayAnimation);
e.animation = animation2;
e.lan = 0xc0 | slot2; //looped, paused
scene->push(e);
@@ -69,12 +69,12 @@ void Dialog::show(Scene *scene, uint16 addr, uint16 animation1, uint16 animation
if (color == color2 && animation2 != 0) {
//pause animation in other slot
{
- SceneEvent e(SceneEvent::PauseAnimation);
+ SceneEvent e(SceneEvent::kPauseAnimation);
e.lan = 0x80 | slot1;
scene->push(e);
}
{
- SceneEvent e(SceneEvent::PlayAnimation);
+ SceneEvent e(SceneEvent::kPlayAnimation);
e.animation = animation2;
e.lan = 0x80 | slot2;
scene->push(e);
@@ -82,12 +82,12 @@ void Dialog::show(Scene *scene, uint16 addr, uint16 animation1, uint16 animation
} else if (color == color1 && animation1 != 0) {
//pause animation in other slot
{
- SceneEvent e(SceneEvent::PauseAnimation);
+ SceneEvent e(SceneEvent::kPauseAnimation);
e.lan = 0x80 | slot2;
scene->push(e);
}
{
- SceneEvent e(SceneEvent::PlayAnimation);
+ SceneEvent e(SceneEvent::kPlayAnimation);
e.animation = animation1;
e.lan = 0x80 | slot1;
scene->push(e);
@@ -95,7 +95,7 @@ void Dialog::show(Scene *scene, uint16 addr, uint16 animation1, uint16 animation
}
{
- SceneEvent e(SceneEvent::Message);
+ SceneEvent e(SceneEvent::kMessage);
e.message = message;
e.color = color;
if (animation1 != 0 && color == color1)
@@ -125,13 +125,13 @@ void Dialog::show(Scene *scene, uint16 addr, uint16 animation1, uint16 animation
}
}
- SceneEvent e(SceneEvent::ClearAnimations);
+ SceneEvent e(SceneEvent::kClearAnimations);
scene->push(e);
}
uint16 Dialog::pop(Scene *scene, uint16 addr, uint16 animation1, uint16 animation2, byte color1, byte color2, byte slot1, byte slot2) {
debug(0, "Dialog::pop(%04x, %u:%u, %u:%u)", addr, slot1, animation1, slot2, animation2);
- Resources * res = Resources::instance();
+ Resources *res = Resources::instance();
uint16 next;
do {
next = res->dseg.get_word(addr);
diff --git a/engines/teenagent/font.cpp b/engines/teenagent/font.cpp
index 1ede68c2d7..e18c4f5904 100644
--- a/engines/teenagent/font.cpp
+++ b/engines/teenagent/font.cpp
@@ -34,7 +34,7 @@ void Font::load(int id) {
delete[] data;
data = NULL;
- Common::SeekableReadStream * s = Resources::instance()->varia.getStream(id);
+ Common::SeekableReadStream *s = Resources::instance()->varia.getStream(id);
if (s == NULL)
error("loading font %d failed", id);
@@ -50,7 +50,7 @@ uint Font::render(Graphics::Surface *surface, int x, int y, char c) {
return 0;
}
idx -= 0x20;
- byte * glyph = data + READ_LE_UINT16(data + idx * 2);
+ byte *glyph = data + READ_LE_UINT16(data + idx * 2);
uint h = glyph[0], w = glyph[1];
if (surface == NULL || surface->pixels == NULL)
@@ -58,7 +58,7 @@ 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);
+ byte *dst = (byte *)surface->getBasePtr(x, y);
for (uint i = 0; i < h; ++i) {
for (uint j = 0; j < w; ++j) {
byte v = *glyph++;
@@ -125,7 +125,7 @@ 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);
+ byte *dst = (byte *)surface->getBasePtr(x, y);
for (int i = 0; i < h; ++i) {
for (int j = 0; j < w; ++j) {
if (((i ^ j) & 1) == 0)
diff --git a/engines/teenagent/inventory.cpp b/engines/teenagent/inventory.cpp
index 4569423603..d07ba52e6e 100644
--- a/engines/teenagent/inventory.cpp
+++ b/engines/teenagent/inventory.cpp
@@ -39,7 +39,7 @@ void Inventory::init(TeenAgentEngine *engine) {
Common::SeekableReadStream *s = res->varia.getStream(3);
assert(s != NULL);
debug(0, "loading inventory background...");
- background.load(s, Surface::TypeOns);
+ background.load(s, Surface::kTypeOns);
items = res->varia.getStream(4);
assert(items != NULL);
@@ -235,7 +235,7 @@ void Inventory::Item::render(Inventory *inventory, InventoryObject *obj, Graphic
if (animation.empty()) {
debug(0, "loading item %d from offset %x", obj->id, inventory->offset[obj->id - 1]);
inventory->items->seek(inventory->offset[obj->id - 1]);
- animation.load(inventory->items, Animation::TypeInventory);
+ animation.load(inventory->items, Animation::kTypeInventory);
}
if (hovered) {
Surface *s = animation.currentFrame();
@@ -252,7 +252,7 @@ void Inventory::Item::render(Inventory *inventory, InventoryObject *obj, Graphic
if (surface.empty()) {
debug(0, "loading item %d from offset %x", obj->id, inventory->offset[obj->id - 1]);
inventory->items->seek(inventory->offset[obj->id - 1]);
- surface.load(inventory->items, Surface::TypeOns);
+ surface.load(inventory->items, Surface::kTypeOns);
}
surface.render(dst, rect.left + 1, rect.top + 1);
}
diff --git a/engines/teenagent/objects.h b/engines/teenagent/objects.h
index 2633f4b649..00b147faac 100644
--- a/engines/teenagent/objects.h
+++ b/engines/teenagent/objects.h
@@ -68,7 +68,7 @@ struct Object {
byte enabled;
char name[1];
- enum {ActorUp = 1, ActorRight = 2, ActorDown = 3, ActorLeft = 4 };
+ enum {kActorUp = 1, kActorRight = 2, kActorDown = 3, kActorLeft = 4 };
void dump();
static Common::String description(const char *name);
diff --git a/engines/teenagent/scene.cpp b/engines/teenagent/scene.cpp
index 4d0963f48d..e35f5311ff 100644
--- a/engines/teenagent/scene.cpp
+++ b/engines/teenagent/scene.cpp
@@ -36,8 +36,8 @@ namespace TeenAgent {
Scene::Scene() : intro(false), _engine(NULL),
_system(NULL),
_id(0), ons(0), walkboxes(0),
- orientation(Object::ActorRight),
- current_event(SceneEvent::None), hide_actor(false) {}
+ orientation(Object::kActorRight),
+ current_event(SceneEvent::kNone), hide_actor(false) {}
void Scene::warp(const Common::Point &_point, byte o) {
Common::Point point(_point);
@@ -99,7 +99,7 @@ void Scene::init(TeenAgentEngine *engine, OSystem *system) {
if (s == NULL)
error("invalid resource data");
- teenagent.load(s, Animation::TypeVaria);
+ teenagent.load(s, Animation::kTypeVaria);
if (teenagent.empty())
error("invalid mark animation");
@@ -107,7 +107,7 @@ void Scene::init(TeenAgentEngine *engine, OSystem *system) {
if (s == NULL)
error("invalid resource data");
- teenagent_idle.load(s, Animation::TypeVaria);
+ teenagent_idle.load(s, Animation::kTypeVaria);
if (teenagent_idle.empty())
error("invalid mark animation");
}
@@ -149,7 +149,7 @@ void Scene::loadOns() {
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);
+ ons[i].load(s, Surface::kTypeOns);
}
}
}
@@ -171,7 +171,7 @@ void Scene::loadLans() {
Common::SeekableReadStream *s = res->loadLan000(res_id);
if (s != NULL) {
- animation[i].load(s, Animation::TypeLan);
+ animation[i].load(s, Animation::kTypeLan);
if (bxv != 0 && bxv != 0xff)
animation[i].id = bxv;
delete s;
@@ -209,7 +209,7 @@ void Scene::init(int id, const Common::Point &pos) {
setPalette(_system, palette, 4);
Common::SeekableReadStream *stream = res->on.getStream(id);
- on.load(stream, Surface::TypeOn);
+ on.load(stream, Surface::kTypeOn);
delete stream;
loadOns();
@@ -291,7 +291,7 @@ bool Scene::processEvent(const Common::Event &event) {
bool Scene::render(OSystem *system) {
//render background
Resources *res = Resources::instance();
- if (current_event.type == SceneEvent::CreditsMessage) {
+ if (current_event.type == SceneEvent::kCreditsMessage) {
system->fillScreen(0);
Graphics::Surface *surface = system->lockScreen();
res->font8.color = current_event.color;
@@ -365,9 +365,9 @@ bool Scene::render(OSystem *system) {
Common::Point dp(destination.x - position0.x, destination.y - position0.y);
int o;
if (ABS(dp.x) > ABS(dp.y))
- o = dp.x > 0 ? Object::ActorRight : Object::ActorLeft;
+ o = dp.x > 0 ? Object::kActorRight : Object::kActorLeft;
else
- o = dp.y > 0 ? Object::ActorDown : Object::ActorUp;
+ o = dp.y > 0 ? Object::kActorDown : Object::kActorUp;
position.x = position0.x + dp.x * progress / progress_total;
position.y = position0.y + dp.y * progress / progress_total;
@@ -399,7 +399,7 @@ bool Scene::render(OSystem *system) {
system->unlockScreen();
- if (current_event.type == SceneEvent::WaitForAnimation && !got_any_animation) {
+ if (current_event.type == SceneEvent::kWaitForAnimation && !got_any_animation) {
debug(0, "no animations, nextevent");
nextEvent();
restart = true;
@@ -438,7 +438,7 @@ bool Scene::processEventQueue() {
events.pop_front();
switch (current_event.type) {
- case SceneEvent::SetOn: {
+ case SceneEvent::kSetOn: {
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;
@@ -447,7 +447,7 @@ bool Scene::processEventQueue() {
}
break;
- case SceneEvent::SetLan: {
+ case SceneEvent::kSetLan: {
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);
@@ -458,14 +458,14 @@ bool Scene::processEventQueue() {
}
break;
- case SceneEvent::LoadScene: {
+ case SceneEvent::kLoadScene: {
init(current_event.scene, current_event.dst);
sounds.clear();
current_event.clear();
}
break;
- case SceneEvent::Walk: {
+ case SceneEvent::kWalk: {
Common::Point dst = current_event.dst;
if ((current_event.color & 2) != 0) { //relative move
dst.x += position.x;
@@ -479,8 +479,8 @@ bool Scene::processEventQueue() {
}
break;
- case SceneEvent::CreditsMessage:
- case SceneEvent::Message: {
+ case SceneEvent::kCreditsMessage:
+ case SceneEvent::kMessage: {
message = current_event.message;
Common::Point p(
(actor_animation_position.left + actor_animation_position.right) / 2,
@@ -488,7 +488,7 @@ bool Scene::processEventQueue() {
);
//FIXME: rewrite it:
if (current_event.lan < 4) {
- const Surface * s = custom_animation[current_event.lan].currentFrame(0);
+ const Surface *s = custom_animation[current_event.lan].currentFrame(0);
if (s == NULL)
s = animation[current_event.lan].currentFrame(0);
if (s != NULL) {
@@ -502,44 +502,44 @@ bool Scene::processEventQueue() {
}
break;
- case SceneEvent::PlayAnimation:
+ case SceneEvent::kPlayAnimation:
debug(0, "playing animation %u in slot %u", current_event.animation, current_event.lan & 3);
playAnimation(current_event.lan & 0x3, current_event.animation, (current_event.lan & 0x80) != 0, (current_event.lan & 0x40) != 0);
current_event.clear();
break;
- case SceneEvent::PauseAnimation:
+ case SceneEvent::kPauseAnimation:
debug(0, "pause animation in slot %u", current_event.lan & 3);
custom_animation[current_event.lan & 3].paused = (current_event.lan & 0x80) != 0;
current_event.clear();
break;
- case SceneEvent::ClearAnimations:
+ case SceneEvent::kClearAnimations:
for (byte i = 0; i < 4; ++i)
custom_animation[i].free();
current_event.clear();
break;
- case SceneEvent::PlayActorAnimation:
+ case SceneEvent::kPlayActorAnimation:
debug(0, "playing actor animation %u", current_event.animation);
playActorAnimation(current_event.animation, (current_event.lan & 0x80) != 0);
current_event.clear();
break;
- case SceneEvent::PlayMusic:
+ case SceneEvent::kPlayMusic:
debug(0, "setting music %u", current_event.music);
_engine->setMusic(current_event.music);
Resources::instance()->dseg.set_byte(0xDB90, current_event.music);
current_event.clear();
break;
- case SceneEvent::PlaySound:
+ case SceneEvent::kPlaySound:
debug(0, "playing sound %u, delay: %u", current_event.sound, current_event.color);
sounds.push_back(Sound(current_event.sound, current_event.color));
current_event.clear();
break;
- case SceneEvent::EnableObject: {
+ case SceneEvent::kEnableObject: {
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);
obj->enabled = current_event.color;
@@ -547,16 +547,16 @@ bool Scene::processEventQueue() {
}
break;
- case SceneEvent::HideActor:
+ case SceneEvent::kHideActor:
hide_actor = current_event.color != 0;
current_event.clear();
break;
- case SceneEvent::WaitForAnimation:
+ case SceneEvent::kWaitForAnimation:
debug(0, "waiting for the animation");
break;
- case SceneEvent::Quit:
+ case SceneEvent::kQuit:
debug(0, "quit!");
_engine->quitGame();
break;
diff --git a/engines/teenagent/scene.h b/engines/teenagent/scene.h
index 3bff7cac1a..dc5095822d 100644
--- a/engines/teenagent/scene.h
+++ b/engines/teenagent/scene.h
@@ -40,11 +40,23 @@ class Dialog;
struct SceneEvent {
enum Type {
- None, Message, Walk, PlayAnimation, PlayActorAnimation, PauseAnimation, ClearAnimations,
- LoadScene, SetOn, SetLan, PlayMusic,
- PlaySound, EnableObject, HideActor,
- WaitForAnimation, CreditsMessage,
- Quit
+ kNone,
+ kMessage,
+ kWalk,
+ kPlayAnimation,
+ kPlayActorAnimation,
+ kPauseAnimation,
+ kClearAnimations,
+ kLoadScene,
+ kSetOn,
+ kSetLan,
+ kPlayMusic,
+ kPlaySound,
+ kEnableObject,
+ kHideActor,
+ kWaitForAnimation,
+ kCreditsMessage,
+ kQuit
} type;
Common::String message;
@@ -64,7 +76,7 @@ struct SceneEvent {
scene(0), ons(0), lan(0), music(0), sound(0), object(0) {}
void clear() {
- type = None;
+ type = kNone;
message.clear();
color = 0xd1;
orientation = 0;
@@ -79,7 +91,7 @@ struct SceneEvent {
}
inline bool empty() const {
- return type == None;
+ return type == kNone;
}
void dump() const {
diff --git a/engines/teenagent/surface.cpp b/engines/teenagent/surface.cpp
index 62bc033a20..47e1db300c 100644
--- a/engines/teenagent/surface.cpp
+++ b/engines/teenagent/surface.cpp
@@ -40,7 +40,7 @@ void Surface::load(Common::SeekableReadStream *stream, Type type) {
x = y = 0;
memset(flags, 0, sizeof(flags));
- if (type == TypeOn) {
+ if (type == kTypeOn) {
byte fn = stream->readByte();
if (stream->eos())
return;
@@ -54,7 +54,7 @@ void Surface::load(Common::SeekableReadStream *stream, Type type) {
uint16 w_ = stream->readUint16LE();
uint16 h_ = stream->readUint16LE();
- if (type != TypeLan) {
+ if (type != kTypeLan) {
uint16 pos = stream->readUint16LE();
x = pos % 320;
y = pos / 320;
diff --git a/engines/teenagent/surface.h b/engines/teenagent/surface.h
index e48cb3d2aa..15c6d7eaa2 100644
--- a/engines/teenagent/surface.h
+++ b/engines/teenagent/surface.h
@@ -33,7 +33,7 @@ namespace TeenAgent {
class Pack;
class Surface : public Graphics::Surface {
public:
- enum Type {TypeOn, TypeOns, TypeLan};
+ enum Type {kTypeOn, kTypeOns, kTypeLan};
uint16 flags[255];
uint16 x, y;
diff --git a/engines/teenagent/teenagent.cpp b/engines/teenagent/teenagent.cpp
index a1b0be0d80..43cd232b66 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(kActionNone), _gameDescription(gd) {
music = new MusicPlayer();
}
@@ -46,7 +46,7 @@ void TeenAgentEngine::processObject() {
Resources *res = Resources::instance();
switch (action) {
- case ActionExamine: {
+ case kActionExamine: {
byte *dcall = res->dseg.ptr(0xb5ce);
dcall = res->dseg.ptr(READ_LE_UINT16(dcall + scene->getId() * 2 - 2));
dcall += 2 * dst_object->id - 2;
@@ -58,7 +58,7 @@ void TeenAgentEngine::processObject() {
}
}
break;
- case ActionUse: {
+ case kActionUse: {
InventoryObject *inv = inventory->selectedObject();
if (inv != NULL) {
byte *dcall = res->dseg.ptr(0xbb87);
@@ -90,7 +90,7 @@ void TeenAgentEngine::processObject() {
}
break;
- case ActionNone:
+ case kActionNone:
break;
}
}
@@ -108,7 +108,7 @@ void TeenAgentEngine::use(Object *object) {
scene->moveTo(Common::Point(object->actor_rect.right, object->actor_rect.bottom), object->actor_orientation);
if (object->actor_orientation > 0)
scene->setOrientation(object->actor_orientation);
- action = ActionUse;
+ action = kActionUse;
}
void TeenAgentEngine::examine(const Common::Point &point, Object *object) {
@@ -120,13 +120,13 @@ void TeenAgentEngine::examine(const Common::Point &point, Object *object) {
debug(0, "click %d, %d, object %d, %d", point.x, point.y, dst.x, dst.y);
if (object->actor_rect.valid())
scene->moveTo(dst, object->actor_orientation);
- action = ActionExamine;
+ action = kActionExamine;
dst_object = object;
} else {
debug(0, "click %d, %d", point.x, point.y);
scene->moveTo(point, 0, true);
dst_object = NULL;
- action = ActionNone;
+ action = kActionNone;
}
}
@@ -267,9 +267,9 @@ Common::Error TeenAgentEngine::run() {
if (f0 != f1) {
bool b = scene->render(_system);
scene_busy = b;
- if (!inventory->active() && !scene_busy && action != ActionNone) {
+ if (!inventory->active() && !scene_busy && action != kActionNone) {
processObject();
- action = ActionNone;
+ action = kActionNone;
dst_object = NULL;
}
}
@@ -335,7 +335,7 @@ void TeenAgentEngine::displayMessage(const Common::String &str, byte color) {
if (str.empty()) {
return;
}
- SceneEvent event(SceneEvent::Message);
+ SceneEvent event(SceneEvent::kMessage);
event.message = str;
event.color = color;
event.lan = 4;
@@ -364,7 +364,7 @@ void TeenAgentEngine::displayMessage(uint16 addr, byte color) {
}
void TeenAgentEngine::displayCredits(uint16 addr) {
- SceneEvent event(SceneEvent::CreditsMessage);
+ SceneEvent event(SceneEvent::kCreditsMessage);
const byte *src = Resources::instance()->dseg.ptr(addr);
event.orientation = *src++;
@@ -394,7 +394,7 @@ void TeenAgentEngine::moveTo(Object *obj) {
}
void TeenAgentEngine::moveTo(uint16 x, uint16 y, byte o, bool warp) {
- SceneEvent event(SceneEvent::Walk);
+ SceneEvent event(SceneEvent::kWalk);
event.dst.x = x;
event.dst.y = y;
event.orientation = o;
@@ -403,7 +403,7 @@ void TeenAgentEngine::moveTo(uint16 x, uint16 y, byte o, bool warp) {
}
void TeenAgentEngine::moveRel(int16 x, int16 y, byte o, bool warp) {
- SceneEvent event(SceneEvent::Walk);
+ SceneEvent event(SceneEvent::kWalk);
event.dst.x = x;
event.dst.y = y;
event.orientation = o;
@@ -412,7 +412,7 @@ void TeenAgentEngine::moveRel(int16 x, int16 y, byte o, bool warp) {
}
void TeenAgentEngine::playAnimation(uint16 id, byte slot, bool async) {
- SceneEvent event(SceneEvent::PlayAnimation);
+ SceneEvent event(SceneEvent::kPlayAnimation);
event.animation = id;
event.lan = slot;
scene->push(event);
@@ -421,7 +421,7 @@ void TeenAgentEngine::playAnimation(uint16 id, byte slot, bool async) {
}
void TeenAgentEngine::playActorAnimation(uint16 id, bool async) {
- SceneEvent event(SceneEvent::PlayActorAnimation);
+ SceneEvent event(SceneEvent::kPlayActorAnimation);
event.animation = id;
scene->push(event);
if (!async)
@@ -434,7 +434,7 @@ void TeenAgentEngine::loadScene(byte id, const Common::Point &pos, byte o) {
}
void TeenAgentEngine::loadScene(byte id, uint16 x, uint16 y, byte o) {
- SceneEvent event(SceneEvent::LoadScene);
+ SceneEvent event(SceneEvent::kLoadScene);
event.scene = id;
event.dst.x = x;
event.dst.y = y;
@@ -443,7 +443,7 @@ void TeenAgentEngine::loadScene(byte id, uint16 x, uint16 y, byte o) {
}
void TeenAgentEngine::setOns(byte id, byte value, byte scene_id) {
- SceneEvent event(SceneEvent::SetOn);
+ SceneEvent event(SceneEvent::kSetOn);
event.ons = id + 1;
event.color = value;
event.scene = scene_id;
@@ -453,7 +453,7 @@ void TeenAgentEngine::setOns(byte id, byte value, byte scene_id) {
void TeenAgentEngine::setLan(byte id, byte value, byte scene_id) {
if (id == 0)
error("setting lan 0 is invalid");
- SceneEvent event(SceneEvent::SetLan);
+ SceneEvent event(SceneEvent::kSetLan);
event.lan = id;
event.color = value;
event.scene = scene_id;
@@ -461,14 +461,14 @@ void TeenAgentEngine::setLan(byte id, byte value, byte scene_id) {
}
void TeenAgentEngine::reloadLan() {
- SceneEvent event(SceneEvent::SetLan);
+ SceneEvent event(SceneEvent::kSetLan);
event.lan = 0;
scene->push(event);
}
void TeenAgentEngine::playMusic(byte id) {
- SceneEvent event(SceneEvent::PlayMusic);
+ SceneEvent event(SceneEvent::kPlayMusic);
event.music = id;
scene->push(event);
}
@@ -476,14 +476,14 @@ void TeenAgentEngine::playMusic(byte id) {
void TeenAgentEngine::playSound(byte id, byte skip_frames) {
if (skip_frames > 0)
--skip_frames;
- SceneEvent event(SceneEvent::PlaySound);
+ SceneEvent event(SceneEvent::kPlaySound);
event.sound = id;
event.color = skip_frames;
scene->push(event);
}
void TeenAgentEngine::enableObject(byte id, byte scene_id) {
- SceneEvent event(SceneEvent::EnableObject);
+ SceneEvent event(SceneEvent::kEnableObject);
event.object = id + 1;
event.color = 1;
event.scene = scene_id;
@@ -491,7 +491,7 @@ void TeenAgentEngine::enableObject(byte id, byte scene_id) {
}
void TeenAgentEngine::disableObject(byte id, byte scene_id) {
- SceneEvent event(SceneEvent::EnableObject);
+ SceneEvent event(SceneEvent::kEnableObject);
event.object = id + 1;
event.color = 0;
event.scene = scene_id;
@@ -499,19 +499,19 @@ void TeenAgentEngine::disableObject(byte id, byte scene_id) {
}
void TeenAgentEngine::hideActor() {
- SceneEvent event(SceneEvent::HideActor);
+ SceneEvent event(SceneEvent::kHideActor);
event.color = 1;
scene->push(event);
}
void TeenAgentEngine::showActor() {
- SceneEvent event(SceneEvent::HideActor);
+ SceneEvent event(SceneEvent::kHideActor);
event.color = 0;
scene->push(event);
}
void TeenAgentEngine::waitAnimation() {
- SceneEvent event(SceneEvent::WaitForAnimation);
+ SceneEvent event(SceneEvent::kWaitForAnimation);
scene->push(event);
}
diff --git a/engines/teenagent/teenagent.h b/engines/teenagent/teenagent.h
index f6b17c825b..1a12ae0d5f 100644
--- a/engines/teenagent/teenagent.h
+++ b/engines/teenagent/teenagent.h
@@ -42,7 +42,7 @@ class MusicPlayer;
class TeenAgentEngine: public Engine {
public:
- enum Action { ActionNone, ActionExamine, ActionUse };
+ enum Action { kActionNone, kActionExamine, kActionUse };
TeenAgentEngine(OSystem *system, const ADGameDescription *gd);