mirror of
https://github.com/vcmi/vcmi.git
synced 2026-06-19 22:57:37 +02:00
Merge branch 'develop' into feature/pathfinderLayers
This commit is contained in:
+6
-4
@@ -529,8 +529,9 @@ void processCommand(const std::string &message)
|
||||
std::string cn; //command name
|
||||
readed >> cn;
|
||||
|
||||
if(LOCPLINT && LOCPLINT->cingconsole)
|
||||
LOCPLINT->cingconsole->print(message);
|
||||
// Check mantis issue 2292 for details
|
||||
// if(LOCPLINT && LOCPLINT->cingconsole)
|
||||
// LOCPLINT->cingconsole->print(message);
|
||||
|
||||
if(ermInteractiveMode)
|
||||
{
|
||||
@@ -789,11 +790,12 @@ void processCommand(const std::string &message)
|
||||
Settings session = settings.write["session"];
|
||||
session["autoSkip"].Bool() = !session["autoSkip"].Bool();
|
||||
}
|
||||
else if(client && client->serv && client->serv->connected && LOCPLINT) //send to server
|
||||
// Check mantis issue 2292 for details
|
||||
/* else if(client && client->serv && client->serv->connected && LOCPLINT) //send to server
|
||||
{
|
||||
boost::unique_lock<boost::recursive_mutex> un(*LOCPLINT->pim);
|
||||
LOCPLINT->cb->sendMessage(message);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
//plays intro, ends when intro is over or button has been pressed (handles events)
|
||||
|
||||
@@ -151,7 +151,11 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay, bool scal
|
||||
}
|
||||
|
||||
// Allocate video frame
|
||||
#if LIBAVUTIL_VERSION_MAJOR > 52
|
||||
frame = av_alloc_frame();
|
||||
#else
|
||||
frame = avcodec_alloc_frame();
|
||||
#endif
|
||||
|
||||
//setup scaling
|
||||
|
||||
@@ -185,21 +189,36 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay, bool scal
|
||||
if (texture)
|
||||
{ // Convert the image into YUV format that SDL uses
|
||||
sws = sws_getContext(codecContext->width, codecContext->height, codecContext->pix_fmt,
|
||||
pos.w, pos.h, PIX_FMT_YUV420P,
|
||||
pos.w, pos.h,
|
||||
#if LIBAVUTIL_VERSION_MAJOR > 51
|
||||
AV_PIX_FMT_YUV420P,
|
||||
#else
|
||||
PIX_FMT_YUV420P,
|
||||
#endif
|
||||
SWS_BICUBIC, nullptr, nullptr, nullptr);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
#if LIBAVUTIL_VERSION_MAJOR > 51
|
||||
AVPixelFormat screenFormat = AV_PIX_FMT_NONE;
|
||||
#else
|
||||
PixelFormat screenFormat = PIX_FMT_NONE;
|
||||
#endif
|
||||
if (screen->format->Bshift > screen->format->Rshift)
|
||||
{
|
||||
// this a BGR surface
|
||||
switch (screen->format->BytesPerPixel)
|
||||
{
|
||||
#if LIBAVUTIL_VERSION_MAJOR > 51
|
||||
case 2: screenFormat = AV_PIX_FMT_BGR565; break;
|
||||
case 3: screenFormat = AV_PIX_FMT_BGR24; break;
|
||||
case 4: screenFormat = AV_PIX_FMT_BGR32; break;
|
||||
#else
|
||||
case 2: screenFormat = PIX_FMT_BGR565; break;
|
||||
case 3: screenFormat = PIX_FMT_BGR24; break;
|
||||
case 4: screenFormat = PIX_FMT_BGR32; break;
|
||||
#endif
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
@@ -208,9 +227,15 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay, bool scal
|
||||
// this a RGB surface
|
||||
switch (screen->format->BytesPerPixel)
|
||||
{
|
||||
#if LIBAVUTIL_VERSION_MAJOR > 51
|
||||
case 2: screenFormat = AV_PIX_FMT_RGB565; break;
|
||||
case 3: screenFormat = AV_PIX_FMT_RGB24; break;
|
||||
case 4: screenFormat = AV_PIX_FMT_RGB32; break;
|
||||
#else
|
||||
case 2: screenFormat = PIX_FMT_RGB565; break;
|
||||
case 3: screenFormat = PIX_FMT_RGB24; break;
|
||||
case 4: screenFormat = PIX_FMT_RGB32; break;
|
||||
#endif
|
||||
default: return false;
|
||||
}
|
||||
}
|
||||
@@ -367,7 +392,11 @@ void CVideoPlayer::close()
|
||||
|
||||
if (frame)
|
||||
{
|
||||
#if LIBAVUTIL_VERSION_MAJOR > 52
|
||||
av_frame_free(frame);
|
||||
#else
|
||||
av_free(frame);
|
||||
#endif
|
||||
frame = nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -819,10 +819,10 @@ void SaveGame::applyCl(CClient *cl)
|
||||
|
||||
void PlayerMessage::applyCl(CClient *cl)
|
||||
{
|
||||
std::ostringstream str;
|
||||
str << "Player "<< player <<" sends a message: " << text;
|
||||
logNetwork->debugStream() << "Player "<< player <<" sends a message: " << text;
|
||||
|
||||
logNetwork->debugStream() << str.str();
|
||||
std::ostringstream str;
|
||||
str << cl->getPlayer(player)->nodeName() <<": " << text;
|
||||
if(LOCPLINT)
|
||||
LOCPLINT->cingconsole->print(str.str());
|
||||
}
|
||||
|
||||
@@ -881,7 +881,7 @@ void CAdvMapInt::showAll(SDL_Surface * to)
|
||||
|
||||
statusbar.show(to);
|
||||
|
||||
LOCPLINT->cingconsole->showAll(to);
|
||||
LOCPLINT->cingconsole->show(to);
|
||||
}
|
||||
|
||||
bool CAdvMapInt::isHeroSleeping(const CGHeroInstance *hero)
|
||||
@@ -958,7 +958,7 @@ void CAdvMapInt::show(SDL_Surface * to)
|
||||
for(int i=0;i<4;i++)
|
||||
blitAt(gems[i]->ourImages[LOCPLINT->playerID.getNum()].bitmap,ADVOPT.gemX[i],ADVOPT.gemY[i],to);
|
||||
updateScreen=false;
|
||||
LOCPLINT->cingconsole->showAll(to);
|
||||
LOCPLINT->cingconsole->show(to);
|
||||
}
|
||||
else if (terrain.needsAnimUpdate())
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user