diff --git a/client/CVideoHandler.cpp b/client/CVideoHandler.cpp index 23b415677..4282fdabf 100644 --- a/client/CVideoHandler.cpp +++ b/client/CVideoHandler.cpp @@ -627,7 +627,10 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay) ResourceID resource(std::string("Video/") + fname, EResType::VIDEO); if (!CResourceHandler::get()->existsResource(resource)) + { + tlog0 << "Error: video " << resource.getName() << " was not found\n"; return false; + } data = CResourceHandler::get()->load(resource); diff --git a/client/GUIClasses.cpp b/client/GUIClasses.cpp index 73fac8a83..90524e751 100644 --- a/client/GUIClasses.cpp +++ b/client/GUIClasses.cpp @@ -3734,7 +3734,7 @@ void CTavernWindow::show(SDL_Surface * to) boost::algorithm::replace_first(recruit->hoverTexts[0],"%s",sel->h->type->heroClass->name); } - printAtMiddleWBLoc(sel->descr, 146, 389, FONT_SMALL, 200, Colors::WHITE, to); + printAtMiddleWBLoc(sel->descr, 146, 395, FONT_SMALL, 200, Colors::WHITE, to); CSDL_Ext::drawBorder(to,sel->pos.x-2,sel->pos.y-2,sel->pos.w+4,sel->pos.h+4,int3(247,223,123)); } } diff --git a/client/UIFramework/CIntObjectClasses.cpp b/client/UIFramework/CIntObjectClasses.cpp index 3b51fb576..cf0bbe558 100644 --- a/client/UIFramework/CIntObjectClasses.cpp +++ b/client/UIFramework/CIntObjectClasses.cpp @@ -1217,14 +1217,16 @@ void CTextContainer::blitLine(SDL_Surface *to, Point where, std::string what) { const IFont * f = graphics->fonts[font]; - auto renderer = &IFont::renderTextLeft; - - switch (alignment) + if (alignment == CENTER) { - break; case TOPLEFT: renderer = &IFont::renderTextLeft; - break; case CENTER: renderer = &IFont::renderTextCenter; - break; case BOTTOMRIGHT: renderer = &IFont::renderTextRight; - break; default: assert(0); + where.x -= f->getStringWidth(what) / 2; + where.y -= f->getLineHeight() / 2; + } + + if (alignment == BOTTOMRIGHT) + { + where.x -= f->getStringWidth(what); + where.y -= f->getLineHeight(); } size_t begin = 0; @@ -1238,12 +1240,14 @@ void CTextContainer::blitLine(SDL_Surface *to, Point where, std::string what) if (begin != end) { std::string toPrint = what.substr(begin, end-1); + if (currDelimeter % 2) // Enclosed in {} text - set to yellow - (graphics->fonts[font]->*renderer)(to, toPrint, Colors::YELLOW, where); + f->renderTextLeft(to, toPrint, Colors::YELLOW, where); else // Non-enclosed text - (graphics->fonts[font]->*renderer)(to, toPrint, color, where); + f->renderTextLeft(to, toPrint, color, where); begin = end; - where.x += f->getStringWidth(toPrint.c_str()); + + where.x += f->getStringWidth(toPrint); } currDelimeter++; } diff --git a/config/filesystem.json b/config/filesystem.json index 748f57618..c68ef9ae0 100644 --- a/config/filesystem.json +++ b/config/filesystem.json @@ -36,6 +36,7 @@ "VIDEO/": [ {"type" : "vid", "path" : "ALL/Data/H3ab_ahd.vid"}, + {"type" : "vid", "path" : "ALL/Data/Heroes3.vid"}, {"type" : "vid", "path" : "ALL/Data/video.vid"}, // Location of video files in linux release {"type" : "dir", "path" : "ALL/Data/Video"} diff --git a/vcmibuilder b/vcmibuilder index 23dad3739..819c1fb37 100755 --- a/vcmibuilder +++ b/vcmibuilder @@ -201,10 +201,10 @@ then if [ -d "$cd2_dir"/heroes3 ] then - cp "$cd2_dir"/heroes3/Data/Heroes3.vid "$dest_dir"/Data/VIDEO.VID + cp "$cd2_dir"/heroes3/Data/Heroes3.vid "$dest_dir"/Data/Heroes3.vid cp "$cd2_dir"/heroes3/Data/Heroes3.snd "$dest_dir"/Data/Heroes3-cd2.snd else - cp "$cd2_dir"/Heroes3/Data/Heroes3.vid "$dest_dir"/Data/VIDEO.VID + cp "$cd2_dir"/Heroes3/Data/Heroes3.vid "$dest_dir"/Data/Heroes3.vid cp "$cd2_dir"/Heroes3/Data/Heroes3.snd "$dest_dir"/Data/Heroes3-cd2.snd fi fi