mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-29 21:56:54 +02:00
- fixed crash on shutdown - fixed compile issue #973
This commit is contained in:
parent
3c43e03d4e
commit
49495c9caf
@ -633,13 +633,13 @@ void CBattleInterface::show(SDL_Surface * to)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
//patch by ench0
|
//patch by ench0
|
||||||
const CStack * const shere = curInt->cb->battleGetStackByPos(b, false);
|
|
||||||
|
|
||||||
// display the movement shadow of the stack at b (i.e. stack under mouse)
|
// activeStack == NULL means it is opponent's turn...
|
||||||
if(shere && shere->alive())
|
if(activeStack)
|
||||||
{
|
{
|
||||||
// activeStack == NULL means it is opponent's turn...
|
// display the movement shadow of the stack at b (i.e. stack under mouse)
|
||||||
if (activeStack && shere != activeStack)
|
const CStack * const shere = curInt->cb->battleGetStackByPos(b, false);
|
||||||
|
if (shere && shere != activeStack && shere->alive())
|
||||||
{
|
{
|
||||||
std::vector<BattleHex> v = curInt->cb->battleGetAvailableHexes(shere, true );
|
std::vector<BattleHex> v = curInt->cb->battleGetAvailableHexes(shere, true );
|
||||||
BOOST_FOREACH (BattleHex hex, v)
|
BOOST_FOREACH (BattleHex hex, v)
|
||||||
@ -892,12 +892,6 @@ void CBattleInterface::show(SDL_Surface * to)
|
|||||||
bWait->showAll(to);
|
bWait->showAll(to);
|
||||||
bDefence->showAll(to);
|
bDefence->showAll(to);
|
||||||
|
|
||||||
//showing window with result of battle
|
|
||||||
if(resWindow)
|
|
||||||
{
|
|
||||||
resWindow->show(to);
|
|
||||||
}
|
|
||||||
|
|
||||||
//showing in-game console
|
//showing in-game console
|
||||||
LOCPLINT->cingconsole->show(to);
|
LOCPLINT->cingconsole->show(to);
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ CMinimap::CMinimap()
|
|||||||
pos.h=ADVOPT.minimapW;
|
pos.h=ADVOPT.minimapW;
|
||||||
pos.w=ADVOPT.minimapH;
|
pos.w=ADVOPT.minimapH;
|
||||||
|
|
||||||
temps = CSDL_Ext::createSurfaceWithBpp<3>(pos.w,pos.h);
|
temps = CSDL_Ext::createSurfaceWithBpp<4>(pos.w,pos.h);
|
||||||
aiShield = new CPicture("AISHIELD.bmp");
|
aiShield = new CPicture("AISHIELD.bmp");
|
||||||
|
|
||||||
const JsonNode config(GameConstants::DATA_DIR + "/config/minimap.json");
|
const JsonNode config(GameConstants::DATA_DIR + "/config/minimap.json");
|
||||||
@ -228,7 +228,7 @@ void CMinimapSurfacesRef::initFoW(int level)
|
|||||||
int3 pp( ((i*mapSizes.x)/mw), ((j*mapSizes.y)/mh), d );
|
int3 pp( ((i*mapSizes.x)/mw), ((j*mapSizes.y)/mh), d );
|
||||||
if ( !LOCPLINT->cb->isVisible(pp) )
|
if ( !LOCPLINT->cb->isVisible(pp) )
|
||||||
{
|
{
|
||||||
CSDL_Ext::SDL_PutPixelWithoutRefresh(pt,i,j,0,0,0,0);
|
CSDL_Ext::SDL_PutPixelWithoutRefresh(pt,i,j,0,0,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -457,7 +457,7 @@ void CMinimap::hideTile(const int3 &pos)
|
|||||||
for (int jj=0; jj<ho; jj++)
|
for (int jj=0; jj<ho; jj++)
|
||||||
{
|
{
|
||||||
if ((pos.x*wo+ii<this->pos.w) && (pos.y*ho+jj<this->pos.h))
|
if ((pos.x*wo+ii<this->pos.w) && (pos.y*ho+jj<this->pos.h))
|
||||||
CSDL_Ext::SDL_PutPixelWithoutRefresh(FoW[pos.z],pos.x*wo+ii,pos.y*ho+jj,0,0,0,255);
|
CSDL_Ext::SDL_PutPixelWithoutRefresh(FoW[pos.z],pos.x*wo+ii,pos.y*ho+jj,0,0,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,7 +70,6 @@ SDL_Surface *screen = NULL, //main screen surface
|
|||||||
*screenBuf = screen; //points to screen (if only advmapint is present) or screen2 (else) - should be used when updating controls which are not regularly redrawed
|
*screenBuf = screen; //points to screen (if only advmapint is present) or screen2 (else) - should be used when updating controls which are not regularly redrawed
|
||||||
static boost::thread *mainGUIThread;
|
static boost::thread *mainGUIThread;
|
||||||
|
|
||||||
VCMIDirs GVCMIDirs;
|
|
||||||
std::queue<SDL_Event*> events;
|
std::queue<SDL_Event*> events;
|
||||||
boost::mutex eventsM;
|
boost::mutex eventsM;
|
||||||
|
|
||||||
|
@ -697,7 +697,7 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay)
|
|||||||
else
|
else
|
||||||
filePath = GameConstants::DATA_DIR + "/Data/video/" + fname;
|
filePath = GameConstants::DATA_DIR + "/Data/video/" + fname;
|
||||||
|
|
||||||
#if LIBAVFORMAT_VERSION_MAJOR < 53
|
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 0, 0)
|
||||||
int avfopen = av_open_input_file(&format, filePath.c_str(), NULL, 0, NULL);
|
int avfopen = av_open_input_file(&format, filePath.c_str(), NULL, 0, NULL);
|
||||||
#else
|
#else
|
||||||
int avfopen = avformat_open_input(&format, filePath.c_str(), NULL, NULL);
|
int avfopen = avformat_open_input(&format, filePath.c_str(), NULL, NULL);
|
||||||
@ -708,7 +708,7 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Retrieve stream information
|
// Retrieve stream information
|
||||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 17, 0)
|
||||||
if (av_find_stream_info(format) < 0)
|
if (av_find_stream_info(format) < 0)
|
||||||
#else
|
#else
|
||||||
if (avformat_find_stream_info(format, NULL) < 0)
|
if (avformat_find_stream_info(format, NULL) < 0)
|
||||||
@ -719,7 +719,7 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay)
|
|||||||
stream = -1;
|
stream = -1;
|
||||||
for(ui32 i=0; i<format->nb_streams; i++)
|
for(ui32 i=0; i<format->nb_streams; i++)
|
||||||
{
|
{
|
||||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 0, 0)
|
||||||
if (format->streams[i]->codec->codec_type==CODEC_TYPE_VIDEO)
|
if (format->streams[i]->codec->codec_type==CODEC_TYPE_VIDEO)
|
||||||
#else
|
#else
|
||||||
if (format->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO)
|
if (format->streams[i]->codec->codec_type==AVMEDIA_TYPE_VIDEO)
|
||||||
@ -747,7 +747,7 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Open codec
|
// Open codec
|
||||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 17, 0)
|
||||||
if ( avcodec_open(codecContext, codec) < 0 )
|
if ( avcodec_open(codecContext, codec) < 0 )
|
||||||
#else
|
#else
|
||||||
if ( avcodec_open2(codecContext, codec, NULL) < 0 )
|
if ( avcodec_open2(codecContext, codec, NULL) < 0 )
|
||||||
@ -846,12 +846,7 @@ bool CVideoPlayer::nextFrame()
|
|||||||
if (packet.stream_index == stream)
|
if (packet.stream_index == stream)
|
||||||
{
|
{
|
||||||
// Decode video frame
|
// Decode video frame
|
||||||
#ifdef WITH_AVCODEC_DECODE_VIDEO2
|
|
||||||
avcodec_decode_video2(codecContext, frame, &frameFinished, &packet);
|
avcodec_decode_video2(codecContext, frame, &frameFinished, &packet);
|
||||||
#else
|
|
||||||
avcodec_decode_video(codecContext, frame, &frameFinished,
|
|
||||||
packet.data, packet.size);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Did we get a video frame?
|
// Did we get a video frame?
|
||||||
if (frameFinished)
|
if (frameFinished)
|
||||||
@ -975,7 +970,7 @@ void CVideoPlayer::close()
|
|||||||
|
|
||||||
if (format)
|
if (format)
|
||||||
{
|
{
|
||||||
#if LIBAVCODEC_VERSION_MAJOR < 53
|
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(53, 17, 0)
|
||||||
av_close_input_file(format);
|
av_close_input_file(format);
|
||||||
format = NULL;
|
format = NULL;
|
||||||
#else
|
#else
|
||||||
|
@ -786,9 +786,11 @@ std::set<CStack*> BattleInfo::getAttackedCreatures(const CSpell * s, int skillLe
|
|||||||
BOOST_FOREACH (auto stack, stacks)
|
BOOST_FOREACH (auto stack, stacks)
|
||||||
{
|
{
|
||||||
if (stack->isValidTarget())
|
if (stack->isValidTarget())
|
||||||
BOOST_FOREACH (auto hex, stack->getHexes())
|
|
||||||
{
|
{
|
||||||
possibleHexes.insert (hex);
|
BOOST_FOREACH (auto hex, stack->getHexes())
|
||||||
|
{
|
||||||
|
possibleHexes.insert (hex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BattleHex lightningHex = destinationTile;
|
BattleHex lightningHex = destinationTile;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
#undef max
|
#undef max
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
VCMIDirs GVCMIDirs;
|
extern VCMIDirs GVCMIDirs;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CLodHandler.cpp, part of VCMI engine
|
* CLodHandler.cpp, part of VCMI engine
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include "CGeneralTextHandler.h"
|
#include "CGeneralTextHandler.h"
|
||||||
#include "IGameEventsReceiver.h"
|
#include "IGameEventsReceiver.h"
|
||||||
#include "CStopWatch.h"
|
#include "CStopWatch.h"
|
||||||
|
#include "VCMIDirs.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* VCMI_Lib.cpp, part of VCMI engine
|
* VCMI_Lib.cpp, part of VCMI engine
|
||||||
@ -31,6 +32,8 @@ DLL_LINKAGE CLodHandler *bitmaph = NULL,
|
|||||||
*spriteh = NULL,
|
*spriteh = NULL,
|
||||||
*bitmaph_ab = NULL;
|
*bitmaph_ab = NULL;
|
||||||
|
|
||||||
|
VCMIDirs GVCMIDirs;
|
||||||
|
|
||||||
|
|
||||||
DLL_LINKAGE void initDLL(CConsoleHandler *Console, std::ostream *Logfile)
|
DLL_LINKAGE void initDLL(CConsoleHandler *Console, std::ostream *Logfile)
|
||||||
{
|
{
|
||||||
|
@ -33,7 +33,6 @@ using namespace boost::asio::ip;
|
|||||||
namespace intpr = boost::interprocess;
|
namespace intpr = boost::interprocess;
|
||||||
bool end2 = false;
|
bool end2 = false;
|
||||||
int port = 3030;
|
int port = 3030;
|
||||||
VCMIDirs GVCMIDirs;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CVCMIServer.cpp, part of VCMI engine
|
* CVCMIServer.cpp, part of VCMI engine
|
||||||
|
Loading…
x
Reference in New Issue
Block a user