|
@@ -46,8 +46,8 @@ void CQuestLabel::showAll(SDL_Surface * to)
|
|
|
CBoundedLabel::showAll (to);
|
|
|
}
|
|
|
|
|
|
-CQuestIcon::CQuestIcon (const std::string &bmpname, int x, int y) :
|
|
|
- CPicture (bmpname, x, y)
|
|
|
+CQuestIcon::CQuestIcon (const std::string &defname, int index, int x, int y) :
|
|
|
+ CAnimImage(defname, index, 0, x, y)
|
|
|
{
|
|
|
addUsedEvents(LCLICK);
|
|
|
}
|
|
@@ -60,25 +60,8 @@ void CQuestIcon::clickLeft(tribool down, bool previousState)
|
|
|
|
|
|
void CQuestIcon::showAll(SDL_Surface * to)
|
|
|
{
|
|
|
- if(bg)
|
|
|
- {
|
|
|
- if(srcRect)
|
|
|
- {
|
|
|
- SDL_Rect srcRectCpy = *srcRect;
|
|
|
- SDL_Rect dstRect = srcRectCpy;
|
|
|
- dstRect.x = pos.x;
|
|
|
- dstRect.y = pos.y;
|
|
|
-
|
|
|
- CSDL_Ext::blitSurface(bg, &srcRectCpy, to, &dstRect);
|
|
|
- }
|
|
|
- else //TODO: allow blitting with offset correction (center of picture on the center of pos)
|
|
|
- {
|
|
|
- SDL_Rect dstRect = pos;
|
|
|
- dstRect.x -= pos.w + 2;
|
|
|
- dstRect.y -= pos.h + 2;
|
|
|
- blitAt(bg, dstRect, to);
|
|
|
- }
|
|
|
- }
|
|
|
+ CSDL_Ext::CClipRectGuard guard(to, parent->pos);
|
|
|
+ CAnimImage::showAll(to);
|
|
|
}
|
|
|
|
|
|
CQuestMinimap::CQuestMinimap (const Rect & position) :
|
|
@@ -101,20 +84,14 @@ void CQuestMinimap::addQuestMarks (const QuestInfo * q)
|
|
|
{
|
|
|
tile = q->tile;
|
|
|
}
|
|
|
- CQuestIcon * pic = new CQuestIcon ("", 0, 0);
|
|
|
- CDefHandler * def = CDefHandler::giveDef("VwSymbol.def");
|
|
|
- CSDL_Ext::alphaTransform(def->ourImages[3].bitmap);
|
|
|
- pic->bg = def->ourImages[3].bitmap;
|
|
|
- pic->pos.w = 8;
|
|
|
- pic->pos.h = 8;
|
|
|
-
|
|
|
- int x, y;
|
|
|
+ int x,y;
|
|
|
minimap->tileToPixels (tile, x, y);
|
|
|
- pic->moveTo (Point (minimap->pos.x, minimap->pos.y), true);
|
|
|
- pic->pos.x += x - pic->pos.w / 2 - 1;
|
|
|
- pic->pos.y += y - pic->pos.h / 2 - 1;
|
|
|
|
|
|
+ CQuestIcon * pic = new CQuestIcon ("VwSymbol.def", 3, x, y);
|
|
|
+
|
|
|
+ pic->moveBy (Point ( -pic->pos.w/2, -pic->pos.h/2));
|
|
|
pic->callback = boost::bind (&CQuestMinimap::iconClicked, this);
|
|
|
+
|
|
|
icons.push_back(pic);
|
|
|
}
|
|
|
|
|
@@ -134,7 +111,7 @@ void CQuestMinimap::iconClicked()
|
|
|
|
|
|
void CQuestMinimap::showAll(SDL_Surface * to)
|
|
|
{
|
|
|
- CMinimap::showAll(to);
|
|
|
+ CIntObject::showAll(to); // blitting IntObject directly to hide radar
|
|
|
BOOST_FOREACH (auto pic, icons)
|
|
|
pic->showAll(to);
|
|
|
}
|
|
@@ -159,13 +136,6 @@ void CQuestLog::init()
|
|
|
if (quests.size() > QUEST_COUNT)
|
|
|
slider = new CSlider(203, 199, 230, boost::bind (&CQuestLog::sliderMoved, this, _1), QUEST_COUNT, quests.size(), false, 0);
|
|
|
|
|
|
- auto map = LOCPLINT->cb->getVisibilityMap(); //TODO: another function to get all tiles?
|
|
|
-
|
|
|
- for (int g = 0; g < map.size(); ++g)
|
|
|
- for (int h = 0; h < map[g].size(); ++h)
|
|
|
- for (int y = 0; y < map[g][h].size(); ++y)
|
|
|
- minimap->showTile (int3 (g, h, y));
|
|
|
-
|
|
|
for (int i = 0; i < quests.size(); ++i)
|
|
|
{
|
|
|
MetaString text;
|
|
@@ -179,7 +149,6 @@ void CQuestLog::init()
|
|
|
}
|
|
|
|
|
|
recreateQuestList (0);
|
|
|
- showAll (screen2);
|
|
|
}
|
|
|
|
|
|
void CQuestLog::showAll(SDL_Surface * to)
|