EMI: Implement Lua_V2::ActorActivateShadow

This commit is contained in:
Dries Harnie 2012-08-28 23:23:58 +02:00
parent d2078fafb9
commit 494839062f
3 changed files with 10 additions and 3 deletions

View File

@ -69,7 +69,8 @@ Actor::Actor(const Common::String &actorName) :
_lastTurnDir(0), _currTurnDir(0),
_sayLineText(0), _talkDelay(0),
_attachedActor(NULL), _attachedJoint(""),
_globalAlpha(1.f), _alphaMode(AlphaOff) {
_globalAlpha(1.f), _alphaMode(AlphaOff),
_shadowActive(false) {
_lookingMode = false;
_constrain = false;
_talkSoundName = "";
@ -112,6 +113,7 @@ Actor::Actor() {
_globalAlpha = 1.f;
_sortOrder = 0;
_shadowActive = false;
for (int i = 0; i < MAX_SHADOWS; i++) {
_shadowArray[i].active = false;
@ -1310,7 +1312,8 @@ void Actor::draw() {
g_driver->setShadow(NULL);
}
if (!isAttached() || !costume->getFilename().equals("fx/dumbshadow.cos")) {
bool isShadowCostume = costume->getFilename().equals("fx/dumbshadow.cos");
if (!isShadowCostume || _shadowActive) {
// normal draw actor
g_driver->startActorDraw(absPos, _scale, _yaw, _pitch, _roll, _inOverworld, _alphaMode != AlphaOff ? _globalAlpha : 1.f);
costume->draw();

View File

@ -479,6 +479,8 @@ public:
int getSortOrder() const { return _sortOrder; }
void setSortOrder(const int order) { _sortOrder = order; }
void activateShadow(bool active) { _shadowActive = active; }
private:
void costumeMarkerCallback(int marker);
void collisionHandlerCallback(Actor *other) const;
@ -618,6 +620,8 @@ private:
bool _inOverworld;
int _sortOrder;
bool _shadowActive;
};
} // end of namespace Grim

View File

@ -307,7 +307,7 @@ void Lua_V2::ActorActivateShadow() {
if (lua_isstring(planeObj))
plane = lua_getstring(planeObj);
warning("Lua_V2::ActorActivateShadow, actor: %s, aquality: %d, plane: %s", actor->getName().c_str(), quality, plane);
// FIXME: implement missing rest part of code
actor->activateShadow(quality);
}
void Lua_V2::ActorStopMoving() {