[Scummvm-cvs-logs] SF.net SVN: scummvm:[44109] scummvm/trunk/engines/teenagent
megath at users.sourceforge.net
megath at users.sourceforge.net
Tue Sep 15 22:21:18 CEST 2009
Revision: 44109
http://scummvm.svn.sourceforge.net/scummvm/?rev=44109&view=rev
Author: megath
Date: 2009-09-15 20:21:18 +0000 (Tue, 15 Sep 2009)
Log Message:
-----------
renamed constants to comply with the code convention.
Modified Paths:
--------------
scummvm/trunk/engines/teenagent/actor.cpp
scummvm/trunk/engines/teenagent/animation.cpp
scummvm/trunk/engines/teenagent/animation.h
scummvm/trunk/engines/teenagent/callbacks.cpp
scummvm/trunk/engines/teenagent/dialog.cpp
scummvm/trunk/engines/teenagent/font.cpp
scummvm/trunk/engines/teenagent/inventory.cpp
scummvm/trunk/engines/teenagent/objects.h
scummvm/trunk/engines/teenagent/scene.cpp
scummvm/trunk/engines/teenagent/scene.h
scummvm/trunk/engines/teenagent/surface.cpp
scummvm/trunk/engines/teenagent/surface.h
scummvm/trunk/engines/teenagent/teenagent.cpp
scummvm/trunk/engines/teenagent/teenagent.h
Modified: scummvm/trunk/engines/teenagent/actor.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/actor.cpp 2009-09-15 20:08:28 UTC (rev 44108)
+++ scummvm/trunk/engines/teenagent/actor.cpp 2009-09-15 20:21:18 UTC (rev 44109)
@@ -39,22 +39,22 @@
}
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 @@
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
Modified: scummvm/trunk/engines/teenagent/animation.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/animation.cpp 2009-09-15 20:08:28 UTC (rev 44108)
+++ scummvm/trunk/engines/teenagent/animation.cpp 2009-09-15 20:21:18 UTC (rev 44109)
@@ -114,7 +114,7 @@
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 @@
//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 @@
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 @@
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;
}
Modified: scummvm/trunk/engines/teenagent/animation.h
===================================================================
--- scummvm/trunk/engines/teenagent/animation.h 2009-09-15 20:08:28 UTC (rev 44108)
+++ scummvm/trunk/engines/teenagent/animation.h 2009-09-15 20:21:18 UTC (rev 44109)
@@ -35,10 +35,10 @@
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();
Modified: scummvm/trunk/engines/teenagent/callbacks.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/callbacks.cpp 2009-09-15 20:08:28 UTC (rev 44108)
+++ scummvm/trunk/engines/teenagent/callbacks.cpp 2009-09-15 20:21:18 UTC (rev 44109)
@@ -3512,7 +3512,7 @@
displayMessage("THE END");
debug(0, "FIXME: THE END + CREDITS");
- scene->push(SceneEvent(SceneEvent::Quit));
+ scene->push(SceneEvent(SceneEvent::kQuit));
return true;
Modified: scummvm/trunk/engines/teenagent/dialog.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/dialog.cpp 2009-09-15 20:08:28 UTC (rev 44108)
+++ scummvm/trunk/engines/teenagent/dialog.cpp 2009-09-15 20:21:18 UTC (rev 44109)
@@ -32,20 +32,20 @@
--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 @@
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 @@
} 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 @@
}
{
- SceneEvent e(SceneEvent::Message);
+ SceneEvent e(SceneEvent::kMessage);
e.message = message;
e.color = color;
if (animation1 != 0 && color == color1)
@@ -125,13 +125,13 @@
}
}
- 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);
Modified: scummvm/trunk/engines/teenagent/font.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/font.cpp 2009-09-15 20:08:28 UTC (rev 44108)
+++ scummvm/trunk/engines/teenagent/font.cpp 2009-09-15 20:21:18 UTC (rev 44109)
@@ -34,7 +34,7 @@
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 @@
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 @@
//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 @@
}
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)
Modified: scummvm/trunk/engines/teenagent/inventory.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/inventory.cpp 2009-09-15 20:08:28 UTC (rev 44108)
+++ scummvm/trunk/engines/teenagent/inventory.cpp 2009-09-15 20:21:18 UTC (rev 44109)
@@ -39,7 +39,7 @@
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 @@
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 @@
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);
}
Modified: scummvm/trunk/engines/teenagent/objects.h
===================================================================
--- scummvm/trunk/engines/teenagent/objects.h 2009-09-15 20:08:28 UTC (rev 44108)
+++ scummvm/trunk/engines/teenagent/objects.h 2009-09-15 20:21:18 UTC (rev 44109)
@@ -68,7 +68,7 @@
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);
Modified: scummvm/trunk/engines/teenagent/scene.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/scene.cpp 2009-09-15 20:08:28 UTC (rev 44108)
+++ scummvm/trunk/engines/teenagent/scene.cpp 2009-09-15 20:21:18 UTC (rev 44109)
@@ -36,8 +36,8 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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::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 @@
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 @@
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 @@
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 @@
}
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 @@
}
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 @@
}
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 @@
);
//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 @@
}
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 @@
}
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;
Modified: scummvm/trunk/engines/teenagent/scene.h
===================================================================
--- scummvm/trunk/engines/teenagent/scene.h 2009-09-15 20:08:28 UTC (rev 44108)
+++ scummvm/trunk/engines/teenagent/scene.h 2009-09-15 20:21:18 UTC (rev 44109)
@@ -40,11 +40,23 @@
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 @@
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 @@
}
inline bool empty() const {
- return type == None;
+ return type == kNone;
}
void dump() const {
Modified: scummvm/trunk/engines/teenagent/surface.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/surface.cpp 2009-09-15 20:08:28 UTC (rev 44108)
+++ scummvm/trunk/engines/teenagent/surface.cpp 2009-09-15 20:21:18 UTC (rev 44109)
@@ -40,7 +40,7 @@
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 @@
uint16 w_ = stream->readUint16LE();
uint16 h_ = stream->readUint16LE();
- if (type != TypeLan) {
+ if (type != kTypeLan) {
uint16 pos = stream->readUint16LE();
x = pos % 320;
y = pos / 320;
Modified: scummvm/trunk/engines/teenagent/surface.h
===================================================================
--- scummvm/trunk/engines/teenagent/surface.h 2009-09-15 20:08:28 UTC (rev 44108)
+++ scummvm/trunk/engines/teenagent/surface.h 2009-09-15 20:21:18 UTC (rev 44109)
@@ -33,7 +33,7 @@
class Pack;
class Surface : public Graphics::Surface {
public:
- enum Type {TypeOn, TypeOns, TypeLan};
+ enum Type {kTypeOn, kTypeOns, kTypeLan};
uint16 flags[255];
uint16 x, y;
Modified: scummvm/trunk/engines/teenagent/teenagent.cpp
===================================================================
--- scummvm/trunk/engines/teenagent/teenagent.cpp 2009-09-15 20:08:28 UTC (rev 44108)
+++ scummvm/trunk/engines/teenagent/teenagent.cpp 2009-09-15 20:21:18 UTC (rev 44109)
@@ -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 @@
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 @@
}
}
break;
- case ActionUse: {
+ case kActionUse: {
InventoryObject *inv = inventory->selectedObject();
if (inv != NULL) {
byte *dcall = res->dseg.ptr(0xbb87);
@@ -90,7 +90,7 @@
}
break;
- case ActionNone:
+ case kActionNone:
break;
}
}
@@ -108,7 +108,7 @@
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 @@
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 @@
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 @@
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::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(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::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::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::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, 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::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::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::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::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::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::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);
}
Modified: scummvm/trunk/engines/teenagent/teenagent.h
===================================================================
--- scummvm/trunk/engines/teenagent/teenagent.h 2009-09-15 20:08:28 UTC (rev 44108)
+++ scummvm/trunk/engines/teenagent/teenagent.h 2009-09-15 20:21:18 UTC (rev 44109)
@@ -42,7 +42,7 @@
class TeenAgentEngine: public Engine {
public:
- enum Action { ActionNone, ActionExamine, ActionUse };
+ enum Action { kActionNone, kActionExamine, kActionUse };
TeenAgentEngine(OSystem *system, const ADGameDescription *gd);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list