1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Final part of the merge

Merging VCMI Dirs refactoring + GUI refactoring with current develop
This commit is contained in:
Ivan Savenko 2014-09-04 20:59:07 +03:00
commit b551bdb725
30 changed files with 228 additions and 858 deletions

19
.gitignore vendored
View File

@ -1,10 +1,29 @@
/client/vcmiclient
/server/vcmiserver
/launcher/vcmilauncher
/launcher/vcmilauncher_automoc.cpp
*.dll
*.exe
*.depend
*.o
*.a
*.so
*.res
*.layout
*.pro.user
*.pro.user.*
/CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
Makefile
cmake_install.cmake
install_manifest.txt
*_cotire.cmake
cotire
moc_*.cpp
qrc_*.cpp
ui_*.h
/CPackConfig.cmake
/CPackSourceConfig.cmake
build-*

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -27,27 +27,27 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -41,27 +41,27 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -67,27 +67,27 @@
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -27,27 +27,27 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -27,27 +27,27 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">

View File

@ -198,12 +198,27 @@ SET(PCH_PROPERTIES
COTIRE_CXX_PREFIX_HEADER_INIT "StdInc.h"
)
find_path(MINIZIP_INCLUDE_PATH NAMES minizip/unzip.h)
find_library(MINIZIP_LIB NAMES minizip PATH_SUFFIXES dynamic)
mark_as_advanced(MINIZIP_INCLUDE_PATH MINIZIP_LIB)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(MINIZIP MINIZIP_INCLUDE_PATH MINIZIP_LIB)
if (MINIZIP_FOUND)
set(MINIZIP_INCLUDE_DIR ${MINIZIP_INCLUDE_PATH})
set(MINIZIP_LIBRARIES ${MINIZIP_LIB})
add_definitions(-DUSE_SYSTEM_MINIZIP)
endif()
if (ENABLE_ERM)
add_subdirectory(scripting/erm)
endif()
if (NOT MINIZIP_FOUND)
add_subdirectory(lib/minizip)
set(MINIZIP_LIBRARIES minizip)
endif()
add_subdirectory(lib)
add_subdirectory(client)
add_subdirectory(lib/minizip)
add_subdirectory(server)
add_subdirectory(AI)
if (ENABLE_EDITOR)

View File

@ -31,43 +31,50 @@ On Debian-based systems (e.g. Ubuntu) run:
sudo apt-get install cmake g++ libsdl1.2debian libsdl-image1.2-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev zlib1g-dev libavformat-dev libswscale-dev libboost-dev libboost-filesystem-dev libboost-system-dev libboost-thread-dev libboost-program-options-dev libboost-locale-dev qtbase5-dev
On RPM-based distributions (e.g. Fedora) run:
sudo yum install cmake gcc-c++ SDL-devel SDL_image-devel SDL_ttf-devel SDL_mixer-devel boost boost-devel boost-filesystem boost-system boost-thread boost-program-options boost-locale zlib-devel ffmpeg-devel ffmpeg-libs
sudo yum install cmake gcc-c++ SDL2-devel SDL2_image-devel SDL2_ttf-devel SDL2_mixer-devel boost boost-devel boost-filesystem boost-system boost-thread boost-program-options boost-locale zlib-devel ffmpeg-devel ffmpeg-libs
II. Getting the sources
VCMI is still in development. We recommend the following initial directory structure:
trunk
trunk/src -> contains sources and is under SVN control
trunk/vcmi -> contains sources and is under git control
trunk/build -> contains build output, makefiles, object files,...
You can get latest sources with subversion:
cd trunk
svn co http://svn.code.sf.net/p/vcmi/code/trunk/
git clone https://github.com/vcmi/vcmi.git
III. Compilation
Run configure:
mkdir build && cd build
cmake ../src <any other options, see below>
cmake ../vcmi <any other options, see below>
Additional options that you may want to use:
To enable debugging: -DCMAKE_BUILD_TYPE=Debug
To enable launcher: -DENABLE_LAUNCHER=Yes
To change installation directory: -DCMAKE_INSTALL_PREFIX=$absolute_path_to_directory
Notice:
The ../src/ is not a typo, it will place makefile scripts into the build dir
The ../vcmi/ is not a typo, it will place makefile scripts into the build dir
as the build dir is your working dir when calling CMake.
Then build vcmi:
make -j2 (j2 = compile with 2 cpu cores, you can specifiy any value)
make -j2 (j2 = compile with 2 threads, you can specify any value)
That will generate vcmiclient, vcmiserver as well as 3 .so libraries.
That will generate vcmiclient, vcmiserver, vcmilauncher as well as 3 .so libraries.
III. Installing binaries
To install VCMI you can use "make install" command however generation of distribution-specific packages is usually a better idea. In most cases this can be achieved using tool called "checkinstall"
If you're compiling vcmi for development puposes, it's better to use links instead.
If you're compiling vcmi for development puposes, the easiest is to use cmake prefix and then make install:
# mkdir .../trunk/install
# cmake -DCMAKE_INSTALL_PREFIX=.../trunk/install ../vcmi
# make && make install
# .../trunk/install/bin/vcmiclient
it's better to use links instead.
Go to /BIN_PATH/, and type:
ln -s .../trunk/build/client/vcmiclient
@ -86,5 +93,3 @@ Go to /LIB_PATH/vcmi/AI, and type:
Go to /DATA_PATH/vcmi, and type:
ln -s .../trunk/source/config
ln -s .../trunk/source/Mods

View File

@ -774,9 +774,9 @@ void processCommand(const std::string &message)
//plays intro, ends when intro is over or button has been pressed (handles events)
void playIntro()
{
if(CCS->videoh->openAndPlayVideo("3DOLOGO.SMK", 60, 40, screen, true))
if(CCS->videoh->openAndPlayVideo("3DOLOGO.SMK", 60, 40, screen, true, true))
{
CCS->videoh->openAndPlayVideo("AZVS.SMK", 60, 80, screen, true);
CCS->videoh->openAndPlayVideo("AZVS.SMK", 60, 80, screen, true, true);
}
}

View File

@ -25,6 +25,7 @@
#include "../lib/Connection.h"
#include "../lib/CSpellHandler.h"
#include "../lib/CTownHandler.h"
#include "../lib/mapObjects/CObjectClassesHandler.h" // For displaying correct UI when interacting with objects
#include "../lib/BattleState.h"
#include "../lib/JsonNode.h"
#include "CMusicHandler.h"
@ -1529,6 +1530,16 @@ void CPlayerInterface::centerView (int3 pos, int focusTime)
void CPlayerInterface::objectRemoved( const CGObjectInstance *obj )
{
EVENT_HANDLER_CALLED_BY_CLIENT;
if (LOCPLINT->cb->getCurrentPlayer() == playerID) {
std::string handlerName = VLC->objtypeh->getObjectHandlerName(obj->ID);
if ((handlerName == "pickable") || (handlerName == "scholar") || (handlerName== "artifact") || (handlerName == "pandora")) {
waitWhileDialog();
CCS->soundh->playSoundFromSet(CCS->soundh->pickupSounds);
} else if ((handlerName == "monster") || (handlerName == "hero")) {
waitWhileDialog();
CCS->soundh->playSound(soundBase::KillFade);
}
}
if(obj->ID == Obj::HERO && obj->tempOwner == playerID)
{
const CGHeroInstance *h = static_cast<const CGHeroInstance*>(obj);

View File

@ -21,555 +21,6 @@ static bool keyDown()
}
return false;
}
#endif
#if defined(VCMI_WINDOWS) && (_MSC_VER < 1800 || !defined(USE_FFMPEG))
void checkForError(bool throwing = true)
{
int error = GetLastError();
if(!error)
return;
logGlobal->errorStream() << "Error " << error << " encountered!";
std::string msg;
char* pTemp = nullptr;
FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM,
nullptr, error, MAKELANGID( LANG_NEUTRAL, SUBLANG_DEFAULT ), (LPSTR)&pTemp, 1, nullptr );
logGlobal->errorStream() << "Error: " << pTemp;
msg = pTemp;
LocalFree( pTemp );
pTemp = nullptr;
if(throwing)
throw std::runtime_error(msg);
}
void blitBuffer(char *buffer, int x, int y, int w, int h, SDL_Surface *dst)
{
const int bpp = dst->format->BytesPerPixel;
char *dest;
for(int i = h; i > 0; i--)
{
dest = (char*)dst->pixels + dst->pitch*(y+h-i) + x*dst->format->BytesPerPixel;
memcpy(dest, buffer, bpp*w);
buffer += bpp*w;
}
}
void DLLHandler::Instantiate(const char *filename)
{
name = filename;
dll = LoadLibraryA(filename);
if(!dll)
{
logGlobal->errorStream() << "Failed loading " << filename;
checkForError(true);
}
}
void *DLLHandler::FindAddress(const char *symbol)
{
void *ret;
if(!dll)
{
logGlobal->errorStream() << "Cannot look for " << symbol << " because DLL hasn't been appropriately loaded!";
return nullptr;
}
ret = (void*) GetProcAddress(dll,symbol);
if(!ret)
{
logGlobal->errorStream() << "Failed to find " << symbol << " in " << name;
checkForError();
}
return ret;
}
DLLHandler::~DLLHandler()
{
if(dll)
{
if(!FreeLibrary(dll))
{
logGlobal->errorStream() << "Failed to free " << name;
checkForError();
}
}
}
DLLHandler::DLLHandler()
{
dll = nullptr;
}
CBIKHandler::CBIKHandler()
{
Instantiate("BINKW32.DLL");
//binkGetError = FindAddress("_BinkGetError@0");
binkOpen = (BinkOpen)FindAddress("_BinkOpen@8");
binkSetSoundSystem = (BinkSetSoundSystem)FindAddress("_BinkSetSoundSystem@8");
//getPalette = (BinkGetPalette)FindAddress("_BinkGetPalette@4");
binkNextFrame = (BinkNextFrame)FindAddress("_BinkNextFrame@4");
binkDoFrame = (BinkDoFrame)FindAddress("_BinkDoFrame@4");
binkCopyToBuffer = (BinkCopyToBuffer)FindAddress("_BinkCopyToBuffer@28");
binkWait = (BinkWait)FindAddress("_BinkWait@4");
binkClose = (BinkClose)FindAddress("_BinkClose@4");
hBinkFile = nullptr;
hBink = nullptr;
buffer = nullptr;
bufferSize = 0;
}
bool CBIKHandler::open(std::string name)
{
hBinkFile = CreateFileA
(
name.c_str(), // file name
GENERIC_READ, // access mode
FILE_SHARE_READ, // share mode
nullptr, // Security Descriptor
OPEN_EXISTING, // how to create
FILE_ATTRIBUTE_NORMAL,//FILE_FLAG_SEQUENTIAL_SCAN, // file attributes
0 // handle to template file
);
if(hBinkFile == INVALID_HANDLE_VALUE)
{
logGlobal->errorStream() << "BIK handler: failed to open " << name;
goto checkErrorAndClean;
}
//GCC wants scope of waveout to don`t cross labels/swith/goto
{
void *waveout = (void *)GetProcAddress(dll,"_BinkOpenWaveOut@4");
if(waveout)
binkSetSoundSystem(waveout,nullptr);
}
hBink = binkOpen(hBinkFile, 0x8a800000);
if(!hBink)
{
logGlobal->errorStream() << "bink failed to open " << name;
goto checkErrorAndClean;
}
allocBuffer();
return true;
checkErrorAndClean:
CloseHandle(hBinkFile);
hBinkFile = nullptr;
checkForError();
throw std::runtime_error("BIK failed opening video!");
}
void CBIKHandler::show( int x, int y, SDL_Surface *dst, bool update )
{
const int w = hBink->width,
h = hBink->height,
Bpp = dst->format->BytesPerPixel;
int mode = -1;
//screen color depth might have changed... (eg. because F4)
if(bufferSize != w * h * Bpp)
{
freeBuffer();
allocBuffer(Bpp);
}
switch(Bpp)
{
case 2:
mode = 3; //565, mode 2 is 555 probably
break;
case 3:
mode = 0;
break;
case 4:
mode = 1;
break;
default:
return; //not supported screen depth
}
binkDoFrame(hBink);
binkCopyToBuffer(hBink, buffer, w*Bpp, h, 0, 0, mode);
blitBuffer(buffer, x, y, w, h, dst);
if(update)
SDL_UpdateRect(dst, x, y, w, h);
}
bool CBIKHandler::nextFrame()
{
binkNextFrame(hBink);
return true;
}
void CBIKHandler::close()
{
binkClose(hBink);
hBink = nullptr;
CloseHandle(hBinkFile);
hBinkFile = nullptr;
delete [] buffer;
buffer = nullptr;
bufferSize = 0;
}
bool CBIKHandler::wait()
{
return binkWait(hBink);
}
int CBIKHandler::curFrame() const
{
return hBink->currentFrame;
}
int CBIKHandler::frameCount() const
{
return hBink->frameCount;
}
void CBIKHandler::redraw( int x, int y, SDL_Surface *dst, bool update )
{
int w = hBink->width, h = hBink->height;
blitBuffer(buffer, x, y, w, h, dst);
if(update)
SDL_UpdateRect(dst, x, y, w, h);
}
void CBIKHandler::allocBuffer(int Bpp)
{
if(!Bpp) Bpp = screen->format->BytesPerPixel;
bufferSize = hBink->width * hBink->height * Bpp;
buffer = new char[bufferSize];
}
void CBIKHandler::freeBuffer()
{
delete [] buffer;
buffer = nullptr;
bufferSize = 0;
}
bool CSmackPlayer::nextFrame()
{
ptrSmackNextFrame(data);
return true;
}
bool CSmackPlayer::wait()
{
return ptrSmackWait(data);
}
CSmackPlayer::CSmackPlayer() : data(nullptr)
{
Instantiate("smackw32.dll");
ptrSmackNextFrame = (SmackNextFrame)FindAddress("_SmackNextFrame@4");
ptrSmackWait = (SmackWait)FindAddress("_SmackWait@4");
ptrSmackDoFrame = (SmackDoFrame)FindAddress("_SmackDoFrame@4");
ptrSmackToBuffer = (SmackToBuffer)FindAddress("_SmackToBuffer@28");
ptrSmackOpen = (SmackOpen)FindAddress("_SmackOpen@12");
ptrSmackSoundOnOff = (SmackSoundOnOff)FindAddress("_SmackSoundOnOff@8");
ptrSmackClose = (SmackClose)FindAddress("_SmackClose@4");
ptrVolumePan = (SmackVolumePan)FindAddress("_SmackVolumePan@16");
}
CSmackPlayer::~CSmackPlayer()
{
if(data)
close();
}
void CSmackPlayer::close()
{
ptrSmackClose(data);
data = nullptr;
}
bool CSmackPlayer::open( std::string name )
{
Uint32 flags[2] = {0xff400, 0xfe400};
data = ptrSmackOpen( (void*)name.c_str(), flags[1], -1);
if (!data)
{
logGlobal->errorStream() << "Smack cannot open " << name;
checkForError();
throw std::runtime_error("SMACK failed opening video");
}
buffer = new char[data->width*data->height*2];
buf = buffer+data->width*(data->height-1)*2; // adjust pointer position for later use by 'SmackToBuffer'
//ptrVolumePan(data, 0xfe000, 3640 * GDefaultOptions.musicVolume / 11, 0x8000); //set volume
return true;
}
void CSmackPlayer::show( int x, int y, SDL_Surface *dst, bool update)
{
int w = data->width;
int stripe = (-w*2) & (~3);
//put frame to the buffer
ptrSmackToBuffer(data, 0, 0, stripe, w, buf, 0x80000000);
ptrSmackDoFrame(data);
redraw(x, y, dst, update);
}
int CSmackPlayer::curFrame() const
{
return data->currentFrame;
}
int CSmackPlayer::frameCount() const
{
return data->frameCount;
}
void CSmackPlayer::redraw( int x, int y, SDL_Surface *dst, bool update )
{
int w = std::min<int>(data->width, dst->w - x), h = std::min<int>(data->height, dst->h - y);
/* Lock the screen for direct access to the pixels */
if ( SDL_MUSTLOCK(dst) )
{
if ( SDL_LockSurface(dst) < 0 )
{
fprintf(stderr, "Can't lock screen: %s\n", SDL_GetError());
return;
}
}
// draw the frame
Uint16* addr = (Uint16*) (buffer+w*(h-1)*2-2);
if(dst->format->BytesPerPixel >= 3)
{
for( int j=0; j<h-1; j++) // why -1 ?
{
for ( int i=w-1; i>=0; i--)
{
Uint16 pixel = *addr;
Uint8 *p = (Uint8 *)dst->pixels + (j+y) * dst->pitch + (i + x) * dst->format->BytesPerPixel;
p[2] = ((pixel & 0x7c00) >> 10) * 8;
p[1] = ((pixel & 0x3e0) >> 5) * 8;
p[0] = ((pixel & 0x1F)) * 8;
addr--;
}
}
}
else if(dst->format->BytesPerPixel == 2)
{
for( int j=0; j<h-1; j++) // why -1 ?
{
for ( int i=w-1; i>=0; i--)
{
//convert rgb 555 to 565
Uint16 pixel = *addr;
Uint16 *p = (Uint16 *)((Uint8 *)dst->pixels + (j+y) * dst->pitch + (i + x) * dst->format->BytesPerPixel);
*p = (pixel & 0x1F)
+ ((pixel & 0x3e0) << 1)
+ ((pixel & 0x7c00) << 1);
addr--;
}
}
}
if ( SDL_MUSTLOCK(dst) )
{
SDL_UnlockSurface(dst);
}
if(update)
SDL_UpdateRect(dst, x, y, w, h);
}
CVideoPlayer::CVideoPlayer()
{
current = nullptr;
}
CVideoPlayer::~CVideoPlayer()
{
}
bool CVideoPlayer::open(std::string name)
{
fname = name;
first = true;
try
{
// Extract video from video.vid so we can play it.
// We can handle only videos in form of single file, no archive support yet.
{
ResourceID videoID = ResourceID("VIDEO/" + name, EResType::VIDEO);
auto data = CResourceHandler::get()->load(videoID)->readAll();
// try to determine video format using magic number from header (3 bytes, SMK or BIK)
std::string magic(reinterpret_cast<char*>(data.first.get()), 3);
if (magic == "BIK")
current = &bikPlayer;
else if (magic == "SMK")
current = &smkPlayer;
else
throw std::runtime_error("Unknown video format: " + magic);
std::ofstream out(name, std::ofstream::binary);
out.exceptions(std::ifstream::failbit | std::ifstream::badbit);
out.write(reinterpret_cast<char*>(data.first.get()), data.second);
}
current->open(name);
return true;
}
catch(std::exception &e)
{
current = nullptr;
logGlobal->warnStream() << "Failed to open video file " << name << ": " << e.what();
}
return false;
}
void CVideoPlayer::close()
{
if(!current)
{
logGlobal->warnStream() << "Closing no opened player...?";
return;
}
current->close();
current = nullptr;
if(!DeleteFileA(fname.c_str()))
{
logGlobal->errorStream() << "Cannot remove temporarily extracted video file: " << fname;
checkForError(false);
}
fname.clear();
}
bool CVideoPlayer::nextFrame()
{
if(current)
{
current->nextFrame();
return true;
}
else
return false;
}
void CVideoPlayer::show(int x, int y, SDL_Surface *dst, bool update)
{
if(current)
current->show(x, y, dst, update);
}
bool CVideoPlayer::wait()
{
if(current)
return current->wait();
else
return false;
}
int CVideoPlayer::curFrame() const
{
if(current)
return current->curFrame();
else
return -1;
}
int CVideoPlayer::frameCount() const
{
if(current)
return current->frameCount();
else
return -1;
}
bool CVideoPlayer::openAndPlayVideo(std::string name, int x, int y, SDL_Surface *dst, bool stopOnKey)
{
if(!open(name))
return false;
bool ret = playVideo(x, y, dst, stopOnKey);
close();
return ret;
}
void CVideoPlayer::update( int x, int y, SDL_Surface *dst, bool forceRedraw, bool update )
{
if(!current)
return;
bool w = false;
if(!first)
{
w = wait(); //check if should keep current frame
if(!w)
nextFrame();
}
else
{
first = false;
}
if(!w)
{
show(x,y,dst,update);
}
else if (forceRedraw)
{
redraw(x, y, dst, update);
}
}
void CVideoPlayer::redraw( int x, int y, SDL_Surface *dst, bool update )
{
if(current)
current->redraw(x, y, dst, update);
}
bool CVideoPlayer::playVideo(int x, int y, SDL_Surface *dst, bool stopOnKey)
{
if(!current)
return false;
int frame = 0;
while(frame < frameCount()) //play all frames
{
if(stopOnKey && keyDown())
return false;
if(!wait())
{
show(x, y, dst);
nextFrame();
frame++;
}
SDL_Delay(20);
}
return true;
}
#else
#ifdef _MSC_VER
#pragma comment(lib, "avcodec.lib")
@ -578,9 +29,6 @@ bool CVideoPlayer::playVideo(int x, int y, SDL_Surface *dst, bool stopOnKey)
#pragma comment(lib, "swscale.lib")
#endif // _MSC_VER
#ifndef DISABLE_VIDEO
// Define a set of functions to read data
static int lodRead(void* opaque, uint8_t* buf, int size)
{
@ -619,14 +67,14 @@ CVideoPlayer::CVideoPlayer()
av_register_all();
}
bool CVideoPlayer::open(std::string fname)
bool CVideoPlayer::open(std::string fname, bool scale/* = false*/)
{
return open(fname, true, false);
}
// loop = to loop through the video
// useOverlay = directly write to the screen.
bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay)
bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay, bool scale /*= false*/)
{
close();
@ -708,24 +156,37 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay)
// Allocate video frame
frame = avcodec_alloc_frame();
//setup scaling
if(scale)
{
pos.w = screen->w;
pos.h = screen->h;
}
else
{
pos.w = codecContext->width;
pos.h = codecContext->height;
}
// Allocate a place to put our YUV image on that screen
if (useOverlay)
{
#ifdef VCMI_SDL1
overlay = SDL_CreateYUVOverlay(codecContext->width, codecContext->height,
overlay = SDL_CreateYUVOverlay(pos.w, pos.h,
SDL_YV12_OVERLAY, screen);
#else
texture = SDL_CreateTexture( mainRenderer, SDL_PIXELFORMAT_IYUV, SDL_TEXTUREACCESS_STATIC, codecContext->width, codecContext->height);
texture = SDL_CreateTexture( mainRenderer, SDL_PIXELFORMAT_IYUV, SDL_TEXTUREACCESS_STATIC, pos.w, pos.h);
#endif
}
else
{
dest = CSDL_Ext::newSurface(codecContext->width, codecContext->height);
dest = CSDL_Ext::newSurface(pos.w, pos.h);
destRect.x = destRect.y = 0;
destRect.w = codecContext->width;
destRect.h = codecContext->height;
destRect.w = pos.w;
destRect.h = pos.h;
}
#ifdef VCMI_SDL1
if (overlay == nullptr && dest == nullptr)
@ -739,9 +200,9 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay)
if (texture)
#endif
{ // Convert the image into YUV format that SDL uses
sws = sws_getContext(codecContext->width, codecContext->height,
codecContext->pix_fmt, codecContext->width, codecContext->height,
PIX_FMT_YUV420P, SWS_BICUBIC, nullptr, nullptr, nullptr);
sws = sws_getContext(codecContext->width, codecContext->height, codecContext->pix_fmt,
pos.w, pos.h, PIX_FMT_YUV420P,
SWS_BICUBIC, nullptr, nullptr, nullptr);
}
else
{
@ -770,17 +231,14 @@ bool CVideoPlayer::open(std::string fname, bool loop, bool useOverlay)
}
}
sws = sws_getContext(codecContext->width, codecContext->height,
codecContext->pix_fmt, codecContext->width, codecContext->height,
screenFormat, SWS_BICUBIC, nullptr, nullptr, nullptr);
sws = sws_getContext(codecContext->width, codecContext->height, codecContext->pix_fmt,
pos.w, pos.h, screenFormat,
SWS_BICUBIC, nullptr, nullptr, nullptr);
}
if (sws == nullptr)
return false;
pos.w = codecContext->width;
pos.h = codecContext->height;
return true;
}
@ -844,7 +302,7 @@ bool CVideoPlayer::nextFrame()
SDL_UnlockYUVOverlay(overlay);
#else
if (texture) {
avpicture_alloc(&pict, AV_PIX_FMT_YUV420P, codecContext->width, codecContext->height);
avpicture_alloc(&pict, AV_PIX_FMT_YUV420P, pos.w, pos.h);
sws_scale(sws, frame->data, frame->linesize,
0, codecContext->height, pict.data, pict.linesize);
@ -1000,7 +458,7 @@ bool CVideoPlayer::playVideo(int x, int y, SDL_Surface *dst, bool stopOnKey)
#ifdef VCMI_SDL1
SDL_DisplayYUVOverlay(overlay, &pos);
#else
SDL_RenderCopy(mainRenderer, texture, NULL, NULL);
SDL_RenderCopy(mainRenderer, texture, NULL, &pos);
SDL_RenderPresent(mainRenderer);
#endif
@ -1014,9 +472,9 @@ bool CVideoPlayer::playVideo(int x, int y, SDL_Surface *dst, bool stopOnKey)
return true;
}
bool CVideoPlayer::openAndPlayVideo(std::string name, int x, int y, SDL_Surface *dst, bool stopOnKey)
bool CVideoPlayer::openAndPlayVideo(std::string name, int x, int y, SDL_Surface *dst, bool stopOnKey, bool scale/* = false*/)
{
open(name, false, true);
open(name, false, true, scale);
bool ret = playVideo(x, y, dst, stopOnKey);
close();
return ret;
@ -1029,4 +487,3 @@ CVideoPlayer::~CVideoPlayer()
#endif
#endif

View File

@ -6,7 +6,7 @@ struct SDL_Surface;
class IVideoPlayer
{
public:
virtual bool open(std::string name)=0; //true - succes
virtual bool open(std::string name, bool scale = false)=0; //true - succes
virtual void close()=0;
virtual bool nextFrame()=0;
virtual void show(int x, int y, SDL_Surface *dst, bool update = true)=0;
@ -14,7 +14,6 @@ public:
virtual bool wait()=0;
virtual int curFrame() const =0;
virtual int frameCount() const =0;
};
class IMainVideoPlayer : public IVideoPlayer
@ -23,7 +22,7 @@ public:
std::string fname; //name of current video file (empty if idle)
virtual void update(int x, int y, SDL_Surface *dst, bool forceRedraw, bool update = true){}
virtual bool openAndPlayVideo(std::string name, int x, int y, SDL_Surface *dst, bool stopOnKey = false)
virtual bool openAndPlayVideo(std::string name, int x, int y, SDL_Surface *dst, bool stopOnKey = false, bool scale = false)
{
return false;
}
@ -31,189 +30,17 @@ public:
class CEmptyVideoPlayer : public IMainVideoPlayer
{
public:
virtual int curFrame() const {return -1;};
virtual int frameCount() const {return -1;};
virtual void redraw( int x, int y, SDL_Surface *dst, bool update = true ) {};
virtual void show( int x, int y, SDL_Surface *dst, bool update = true ) {};
virtual bool nextFrame() {return false;};
virtual void close() {};
virtual bool wait() {return false;};
virtual bool open( std::string name ) {return false;};
public:
int curFrame() const override {return -1;};
int frameCount() const override {return -1;};
void redraw( int x, int y, SDL_Surface *dst, bool update = true ) override {};
void show( int x, int y, SDL_Surface *dst, bool update = true ) override {};
bool nextFrame() override {return false;};
void close() override {};
bool wait() override {return false;};
bool open(std::string name, bool scale = false) override {return false;};
};
#if defined(VCMI_WINDOWS) && (_MSC_VER < 1800 || !defined(USE_FFMPEG))
#include <windows.h>
#pragma pack(push,1)
struct BINK_STRUCT
{
si32 width;
si32 height;
si32 frameCount;
si32 currentFrame;
si32 lastFrame;
si32 FPSMul;
si32 FPSDiv;
si32 unknown0;
ui8 flags;
ui8 unknown1[260];
si32 CurPlane; // current plane
void *plane0; // posi32er to plane 0
void *plane1; // posi32er to plane 1
si32 unknown2;
si32 unknown3;
si32 yWidth; // Y plane width
si32 yHeight; // Y plane height
si32 uvWidth; // U&V plane width
si32 uvHeight; // U&V plane height
};
#pragma pack(pop)
typedef BINK_STRUCT* HBINK;
class DLLHandler
{
public:
std::string name;
HINSTANCE dll;
void Instantiate(const char *filename);
const char *GetLibExtension();
void *FindAddress(const char *symbol);
DLLHandler();
virtual ~DLLHandler(); //d-tor
};
typedef void*(__stdcall* BinkSetSoundSystem)(void * soundfun, void*);
typedef HBINK(__stdcall* BinkOpen)(HANDLE bikfile, int flags);
typedef void(__stdcall* BinkClose)(HBINK);
//typedef si32(__stdcall* BinkGetPalette)(HBINK);
typedef void(__stdcall* BinkNextFrame)(HBINK);
typedef void(__stdcall* BinkDoFrame)(HBINK);
typedef ui8(__stdcall* BinkWait)(HBINK);
typedef si32(__stdcall* BinkCopyToBuffer)(HBINK, void* buffer, int stride, int height, int x, int y, int mode);
class CBIKHandler : public DLLHandler, public IVideoPlayer
{
void allocBuffer(int Bpp = 0);
void freeBuffer();
public:
HANDLE hBinkFile;
HBINK hBink;
char * buffer;
int bufferSize;
BinkSetSoundSystem binkSetSoundSystem;
BinkOpen binkOpen;
//BinkGetPalette getPalette;
BinkNextFrame binkNextFrame;
BinkDoFrame binkDoFrame;
BinkCopyToBuffer binkCopyToBuffer;
BinkWait binkWait;
BinkClose binkClose;
CBIKHandler();
bool open(std::string name);
void close();
bool nextFrame();
void show(int x, int y, SDL_Surface *dst, bool update = true);
void redraw(int x, int y, SDL_Surface *dst, bool update = true); //reblits buffer
bool wait();
int curFrame() const;
int frameCount() const;
};
//////////SMK Player ///////////////////////////////////////////////////////
struct SmackStruct
{
si32 version;
si32 width;
si32 height;
si32 frameCount;
si32 mspf;
ui8 unk1[88];
ui8 palette[776];
si32 currentFrame; // Starting with 0
ui8 unk[56];
ui32 fileHandle; // exact type is HANDLE in windows.h
};
// defines function pointer types
typedef SmackStruct* (__stdcall* SmackOpen)(void* , ui32, si32 );
typedef int (__stdcall* SmackDoFrame)( SmackStruct * );
typedef void (__stdcall * SmackGoto )(SmackStruct *, int frameNumber);
typedef void (__stdcall* SmackNextFrame)(SmackStruct*);
typedef void (__stdcall* SmackClose)(SmackStruct*);
typedef void (__stdcall* SmackToBuffer) (SmackStruct*, int, int, int, int, char *, ui32);
typedef bool (__stdcall* SmackWait)(SmackStruct*);
typedef void (__stdcall* SmackSoundOnOff) (SmackStruct*, bool);
typedef int (__stdcall* SmackVolumePan)(SmackStruct *, int SmackTrack, int volume, int pan);
class CSmackPlayer: public DLLHandler, public IVideoPlayer
{
public:
SmackOpen ptrSmackOpen;
SmackDoFrame ptrSmackDoFrame;
SmackToBuffer ptrSmackToBuffer;
SmackNextFrame ptrSmackNextFrame;
SmackWait ptrSmackWait;
SmackSoundOnOff ptrSmackSoundOnOff;
SmackClose ptrSmackClose;
SmackVolumePan ptrVolumePan;
char *buffer, *buf;
SmackStruct* data;
CSmackPlayer();
~CSmackPlayer();
bool open(std::string name);
void close();
bool nextFrame();
void show(int x, int y, SDL_Surface *dst, bool update = true);
void redraw(int x, int y, SDL_Surface *dst, bool update = true); //reblits buffer
bool wait();
int curFrame() const;
int frameCount() const;
};
class CVidHandler;
class CVideoPlayer : public IMainVideoPlayer
{
private:
CSmackPlayer smkPlayer; //for .SMK
CBIKHandler bikPlayer; //for .BIK
IVideoPlayer *current; //points to bik or smk player, appropriate to type of currently played video
bool first; //are we about to display the first frame (blocks update)
public:
CVideoPlayer(); //c-tor
~CVideoPlayer(); //d-tor
bool open(std::string name);
void close();
bool nextFrame(); //move animation to the next frame
void show(int x, int y, SDL_Surface *dst, bool update = true); //blit current frame
void redraw(int x, int y, SDL_Surface *dst, bool update = true); //reblits buffer
void update(int x, int y, SDL_Surface *dst, bool forceRedraw, bool update = true); //moves to next frame if appropriate, and blits it or blits only if redraw paremeter is set true
bool wait(); //true if we should wait before displaying next frame (for keeping FPS)
int curFrame() const; //current frame number <1, framecount>
int frameCount() const;
bool openAndPlayVideo(std::string name, int x, int y, SDL_Surface *dst, bool stopOnKey = false); //opens video, calls playVideo, closes video; returns playVideo result (if whole video has been played)
bool playVideo(int x, int y, SDL_Surface *dst, bool stopOnKey = false); //plays whole opened video; returns: true when whole video has been shown, false when it has been interrupted
};
#else
#ifndef DISABLE_VIDEO
#include "../lib/filesystem/CInputStream.h"
@ -256,32 +83,32 @@ class CVideoPlayer : public IMainVideoPlayer
bool doLoop; // loop through video
bool playVideo(int x, int y, SDL_Surface *dst, bool stopOnKey);
bool open(std::string fname, bool loop, bool useOverlay = false);
bool open(std::string fname, bool loop, bool useOverlay = false, bool scale = false);
public:
CVideoPlayer();
~CVideoPlayer();
bool init();
bool open(std::string fname);
void close();
bool nextFrame(); // display next frame
bool open(std::string fname, bool scale = false) override;
void close() override;
bool nextFrame() override; // display next frame
void show(int x, int y, SDL_Surface *dst, bool update = true); //blit current frame
void redraw(int x, int y, SDL_Surface *dst, bool update = true); //reblits buffer
void update(int x, int y, SDL_Surface *dst, bool forceRedraw, bool update = true); //moves to next frame if appropriate, and blits it or blits only if redraw parameter is set true
void show(int x, int y, SDL_Surface *dst, bool update = true) override; //blit current frame
void redraw(int x, int y, SDL_Surface *dst, bool update = true) override; //reblits buffer
void update(int x, int y, SDL_Surface *dst, bool forceRedraw, bool update = true) override; //moves to next frame if appropriate, and blits it or blits only if redraw parameter is set true
// Opens video, calls playVideo, closes video; returns playVideo result (if whole video has been played)
bool openAndPlayVideo(std::string name, int x, int y, SDL_Surface *dst, bool stopOnKey = false);
bool openAndPlayVideo(std::string name, int x, int y, SDL_Surface *dst, bool stopOnKey = false, bool scale = false) override;
//TODO:
bool wait(){return false;};
int curFrame() const {return -1;};
int frameCount() const {return -1;};
bool wait() override {return false;};
int curFrame() const override {return -1;};
int frameCount() const override {return -1;};
// public to allow access from ffmpeg IO functions
std::unique_ptr<CInputStream> data;
};
#endif
#endif

View File

@ -104,6 +104,7 @@
<Add directory="$(#boost.include)" />
<Add directory="../include" />
<Add directory="../client" />
<Add directory="$(#ffmpeg.include)" />
</Compiler>
<Linker>
<Add option="-lole32" />
@ -115,8 +116,13 @@
<Add option="-lboost_thread$(#boost.libsuffix)" />
<Add option="-lboost_chrono$(#boost.libsuffix)" />
<Add option="-lVCMI_lib" />
<Add option="-lavcodec.dll" />
<Add option="-lavformat.dll" />
<Add option="-lswscale.dll" />
<Add option="-lavutil.dll" />
<Add directory="$(#boost.lib32)" />
<Add directory="../" />
<Add directory="$(#ffmpeg.lib)" />
</Linker>
<Unit filename="../CCallback.cpp" />
<Unit filename="../CCallback.h" />

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -27,23 +27,23 @@
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
@ -92,6 +92,9 @@
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='RD|Win32'" />
<CodeAnalysisRuleAssemblies Condition="'$(Configuration)|$(Platform)'=='RD|x64'" />
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LibraryWPath />
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<Optimization>
@ -101,13 +104,14 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>StdInc.h</PrecompiledHeaderFile>
<AdditionalOptions>/MP4 /Zm150</AdditionalOptions>
<AdditionalIncludeDirectories>$(FFMPEGDIR)\include;.</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>SDL.lib;zlib.lib;SDL_image.lib;SDL_ttf.lib;SDL_mixer.lib;VCMI_lib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>avcodec.lib;avdevice.lib;avfilter.lib;avformat.lib;avutil.lib;postproc.lib;swresample.lib;swscale.lib;SDL.lib;zlib.lib;SDL_image.lib;SDL_ttf.lib;SDL_mixer.lib;VCMI_lib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>NotSet</ShowProgress>
<OptimizeReferences>false</OptimizeReferences>
<OptimizeReferences>true</OptimizeReferences>
<Profile>true</Profile>
<AdditionalLibraryDirectories>..\..\libs;..</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(FFMPEGDIR)\lib;.;..\..\libs;..</AdditionalLibraryDirectories>
</Link>
<Manifest>
<AdditionalManifestFiles>$(ProjectDir)DPIaware.manifest;%(AdditionalManifestFiles)</AdditionalManifestFiles>
@ -138,15 +142,22 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>StdInc.h</PrecompiledHeaderFile>
<AdditionalOptions>/MP4 /Zm150</AdditionalOptions>
<AdditionalIncludeDirectories>$(FFMPEGDIR)\include;.</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<AdditionalDependencies>SDL.lib;zlib.lib;SDL_image.lib;SDL_ttf.lib;SDL_mixer.lib;VCMI_lib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>avcodec.lib;avdevice.lib;avfilter.lib;avformat.lib;avutil.lib;postproc.lib;swresample.lib;swscale.lib;SDL.lib;zlib.lib;SDL_image.lib;SDL_ttf.lib;SDL_mixer.lib;VCMI_lib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<Driver>NotSet</Driver>
<LinkTimeCodeGeneration>
</LinkTimeCodeGeneration>
<ShowProgress>NotSet</ShowProgress>
<AdditionalLibraryDirectories>..\..\libs;..</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(FFMPEGDIR)\lib;.;..\..\libs;..</AdditionalLibraryDirectories>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<OptimizeReferences>true</OptimizeReferences>
</Link>
<CustomBuildStep>
<Command>
</Command>
</CustomBuildStep>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='RD|x64'">
<ClCompile>

View File

@ -17,7 +17,7 @@
"type" : "object",
"default": {},
"additionalProperties" : false,
"required" : [ "classicCreatureWindow", "playerName", "showfps", "music", "sound", "encoding" ],
"required" : [ "playerName", "showfps", "music", "sound", "encoding" ],
"properties" : {
"playerName" : {
"type":"string",

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -17,11 +17,11 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -19,13 +19,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>

View File

@ -133,7 +133,7 @@ set(lib_HEADERS
add_library(vcmi SHARED ${lib_SRCS} ${lib_HEADERS})
set_target_properties(vcmi PROPERTIES XCODE_ATTRIBUTE_LD_DYLIB_INSTALL_NAME "@rpath/libvcmi.dylib")
set_target_properties(vcmi PROPERTIES COMPILE_DEFINITIONS "VCMI_DLL=1")
target_link_libraries(vcmi minizip ${Boost_LIBRARIES} ${SDL_LIBRARY} ${ZLIB_LIBRARIES} ${SYSTEM_LIBS})
target_link_libraries(vcmi ${MINIZIP_LIBRARIES} ${Boost_LIBRARIES} ${SDL_LIBRARY} ${ZLIB_LIBRARIES} ${SYSTEM_LIBS})
if(WIN32)
set_target_properties(vcmi PROPERTIES OUTPUT_NAME VCMI_lib)

View File

@ -3,6 +3,9 @@
// Use some magic to keep the list of files and their code name in sync.
#define VCMI_SOUND_LIST \
/* Sounds for map actions */ \
VCMI_SOUND_NAME(KillFade) VCMI_SOUND_FILE(KILLFADE.wav) /* hero or monster disappears */ \
/* Other sounds (TODO: separate out the sounds for units, spells and the rest */ \
VCMI_SOUND_NAME(AAGLAttack) VCMI_SOUND_FILE(AAGLATTK.wav) \
VCMI_SOUND_NAME(AAGLDefend) VCMI_SOUND_FILE(AAGLDFND.wav) \
VCMI_SOUND_NAME(AAGLKill) VCMI_SOUND_FILE(AAGLKILL.wav) \
@ -515,7 +518,6 @@ VCMI_SOUND_NAME(ITRGKill) VCMI_SOUND_FILE(ITRGKILL.wav) \
VCMI_SOUND_NAME(ITRGMove) VCMI_SOUND_FILE(ITRGMOVE.wav) \
VCMI_SOUND_NAME(ITRGWNCE) VCMI_SOUND_FILE(ITRGWNCE.wav) \
VCMI_SOUND_NAME(KEEPShot) VCMI_SOUND_FILE(KEEPSHOT.wav) \
VCMI_SOUND_NAME(KillFADE) VCMI_SOUND_FILE(KILLFADE.wav) \
VCMI_SOUND_NAME(LANDKill) VCMI_SOUND_FILE(LANDKILL.wav) \
VCMI_SOUND_NAME(LANDMINE) VCMI_SOUND_FILE(LANDMINE.wav) \
VCMI_SOUND_NAME(LCRSAttack) VCMI_SOUND_FILE(LCRSATTK.wav) \
@ -1033,4 +1035,4 @@ public:
};
#undef VCMI_SOUND_NAME
#undef VCMI_SOUND_FILE
};
};

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -27,24 +27,24 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">

View File

@ -16,7 +16,11 @@
#include "CCompressedStream.h"
// Necessary here in order to get all types
#ifdef USE_SYSTEM_MINIZIP
#include <minizip/unzip.h>
#else
#include "../minizip/unzip.h"
#endif
class DLL_LINKAGE CZipStream : public CBufferedStream
{

View File

@ -110,6 +110,7 @@ EResType::Type EResTypeHelper::getTypeFromExtension(std::string extension)
(".AVI", EResType::VIDEO)
(".MP3", EResType::MUSIC)
(".OGG", EResType::MUSIC)
(".FLAC", EResType::MUSIC)
(".ZIP", EResType::ARCHIVE_ZIP)
(".LOD", EResType::ARCHIVE_LOD)
(".PAC", EResType::ARCHIVE_LOD)

View File

@ -318,6 +318,11 @@ std::string CObjectClassesHandler::getObjectName(si32 type, si32 subtype) const
return getObjectName(type);
}
std::string CObjectClassesHandler::getObjectHandlerName(si32 type) const
{
return objects.at(type)->handlerName;
}
void AObjectTypeHandler::setType(si32 type, si32 subtype)
{
this->type = type;

View File

@ -221,6 +221,9 @@ public:
std::string getObjectName(si32 type) const;
std::string getObjectName(si32 type, si32 subtype) const;
/// Returns handler string describing the handler (for use in client)
std::string getObjectHandlerName(si32 type) const;
template <typename Handler> void serialize(Handler &h, const int version)
{

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -37,26 +37,26 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>

View File

@ -81,6 +81,9 @@ std::unique_ptr<CMap> CMapGenerator::generate(CMapGenOptions * mapGenOptions, in
{
this->mapGenOptions = mapGenOptions;
this->randomSeed = randomSeed;
assert(mapGenOptions);
rand.setSeed(this->randomSeed);
mapGenOptions->finalize(rand);
@ -90,6 +93,7 @@ std::unique_ptr<CMap> CMapGenerator::generate(CMapGenOptions * mapGenOptions, in
try
{
editManager->getUndoManager().setUndoRedoLimit(0);
//FIXME: somehow mapGenOption is nullptr at this point :?
addHeaderInfo();
initTiles();

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -27,27 +27,27 @@
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">

View File

@ -599,14 +599,14 @@ int main(int argc, char** argv)
CBasicLogConfigurator logConfig(VCMIDirs::get().userCachePath() / "VCMI_Server_log.txt", console);
logConfig.configureDefault();
preinitDLL(console);
settings.init();
logConfig.configure();
handleCommandOptions(argc, argv);
port = cmdLineOptions["port"].as<int>();
logNetwork->infoStream() << "Port " << port << " will be used.";
preinitDLL(console);
settings.init();
logConfig.configure();
loadDLLClasses();
srand ( (ui32)time(nullptr) );
try

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -27,23 +27,23 @@
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
@ -27,23 +27,23 @@
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='RD|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v110_xp</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v110</PlatformToolset>
<PlatformToolset>v120_xp</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">