Permalink
Browse files

implement WF_COVERANIMS support

Fixes rendering of the lit torches in BG2 AR3017.
  • Loading branch information...
1 parent df8fd1b commit b9e94af3de4ef1e08133940dd92d1e58d4045c7c @fizzet fizzet committed Jun 26, 2013
Showing with 4 additions and 3 deletions.
  1. +3 −2 gemrb/core/Map.cpp
  2. +1 −1 gemrb/core/Map.h
View
@@ -1925,7 +1925,7 @@ unsigned int Map::GetBlocked(const Point &c)
// 2 - always dither
SpriteCover* Map::BuildSpriteCover(int x, int y, int xpos, int ypos,
- unsigned int width, unsigned int height, int flags)
+ unsigned int width, unsigned int height, int flags, bool areaanim)
{
SpriteCover* sc = new SpriteCover;
sc->worldx = x;
@@ -1946,6 +1946,7 @@ SpriteCover* Map::BuildSpriteCover(int x, int y, int xpos, int ypos,
Wall_Polygon* wp = GetWallGroup(i);
if (!wp) continue;
if (!wp->PointCovered(x, y)) continue;
+ if (areaanim && !(wp->GetPolygonFlag() & WF_COVERANIMS)) continue;
video->AddPolygonToSpriteCover(sc, wp);
}
@@ -3881,7 +3882,7 @@ void AreaAnimation::Draw(const Region &screen, Map *area)
// TODO: Should this build a sprite cover with base point
// Pos.x,Pos.y, or with Pos.y,Pos.y+height ?
covers[ac] = area->BuildSpriteCover(Pos.x, Pos.y, -anim->animArea.x,
- -anim->animArea.y, anim->animArea.w, anim->animArea.h, 0);
+ -anim->animArea.y, anim->animArea.w, anim->animArea.h, 0, true);
}
}
video->BlitGameSprite( frame, Pos.x + screen.x, Pos.y + screen.y,
View
@@ -340,7 +340,7 @@ class GEM_EXPORT Map : public Scriptable {
Walls = walls;
}
SpriteCover* BuildSpriteCover(int x, int y, int xpos, int ypos,
- unsigned int width, unsigned int height, int flag);
+ unsigned int width, unsigned int height, int flag, bool areaanim = false);
void ActivateWallgroups(unsigned int baseindex, unsigned int count, int flg);
void Shout(Actor* actor, int shoutID, unsigned int radius);
void ActorSpottedByPlayer(Actor *actor);

0 comments on commit b9e94af

Please sign in to comment.