1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-18 03:21:27 +02:00
- vcmibuilder will correctly install campaign video
This commit is contained in:
Ivan Savenko 2013-02-27 15:46:14 +00:00
parent 459e858756
commit 9c1c337a3d
5 changed files with 21 additions and 13 deletions

View File

@ -627,7 +627,10 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay)
ResourceID resource(std::string("Video/") + fname, EResType::VIDEO); ResourceID resource(std::string("Video/") + fname, EResType::VIDEO);
if (!CResourceHandler::get()->existsResource(resource)) if (!CResourceHandler::get()->existsResource(resource))
{
tlog0 << "Error: video " << resource.getName() << " was not found\n";
return false; return false;
}
data = CResourceHandler::get()->load(resource); data = CResourceHandler::get()->load(resource);

View File

@ -3734,7 +3734,7 @@ void CTavernWindow::show(SDL_Surface * to)
boost::algorithm::replace_first(recruit->hoverTexts[0],"%s",sel->h->type->heroClass->name); 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)); CSDL_Ext::drawBorder(to,sel->pos.x-2,sel->pos.y-2,sel->pos.w+4,sel->pos.h+4,int3(247,223,123));
} }
} }

View File

@ -1217,14 +1217,16 @@ void CTextContainer::blitLine(SDL_Surface *to, Point where, std::string what)
{ {
const IFont * f = graphics->fonts[font]; const IFont * f = graphics->fonts[font];
auto renderer = &IFont::renderTextLeft; if (alignment == CENTER)
switch (alignment)
{ {
break; case TOPLEFT: renderer = &IFont::renderTextLeft; where.x -= f->getStringWidth(what) / 2;
break; case CENTER: renderer = &IFont::renderTextCenter; where.y -= f->getLineHeight() / 2;
break; case BOTTOMRIGHT: renderer = &IFont::renderTextRight; }
break; default: assert(0);
if (alignment == BOTTOMRIGHT)
{
where.x -= f->getStringWidth(what);
where.y -= f->getLineHeight();
} }
size_t begin = 0; size_t begin = 0;
@ -1238,12 +1240,14 @@ void CTextContainer::blitLine(SDL_Surface *to, Point where, std::string what)
if (begin != end) if (begin != end)
{ {
std::string toPrint = what.substr(begin, end-1); std::string toPrint = what.substr(begin, end-1);
if (currDelimeter % 2) // Enclosed in {} text - set to yellow 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 else // Non-enclosed text
(graphics->fonts[font]->*renderer)(to, toPrint, color, where); f->renderTextLeft(to, toPrint, color, where);
begin = end; begin = end;
where.x += f->getStringWidth(toPrint.c_str());
where.x += f->getStringWidth(toPrint);
} }
currDelimeter++; currDelimeter++;
} }

View File

@ -36,6 +36,7 @@
"VIDEO/": "VIDEO/":
[ [
{"type" : "vid", "path" : "ALL/Data/H3ab_ahd.vid"}, {"type" : "vid", "path" : "ALL/Data/H3ab_ahd.vid"},
{"type" : "vid", "path" : "ALL/Data/Heroes3.vid"},
{"type" : "vid", "path" : "ALL/Data/video.vid"}, {"type" : "vid", "path" : "ALL/Data/video.vid"},
// Location of video files in linux release // Location of video files in linux release
{"type" : "dir", "path" : "ALL/Data/Video"} {"type" : "dir", "path" : "ALL/Data/Video"}

View File

@ -201,10 +201,10 @@ then
if [ -d "$cd2_dir"/heroes3 ] if [ -d "$cd2_dir"/heroes3 ]
then 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 cp "$cd2_dir"/heroes3/Data/Heroes3.snd "$dest_dir"/Data/Heroes3-cd2.snd
else 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 cp "$cd2_dir"/Heroes3/Data/Heroes3.snd "$dest_dir"/Data/Heroes3-cd2.snd
fi fi
fi fi