Merge branch 'master' from Windows

This commit is contained in:
2015-01-09 14:23:30 -05:00
5 changed files with 46 additions and 20 deletions

View File

@@ -164,7 +164,7 @@
<NoEntryPoint>false</NoEntryPoint>
</Link>
<PostBuildEvent>
<Command>call $(ProjectDir)CopyFiles.bat $(SolutionDir)$(Configuration)</Command>
<Command>call "$(ProjectDir)CopyFiles.bat" "$(SolutionDir)" "$(Configuration)" "$(VCInstallDir)"</Command>
<Message>Copy resource files</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
@@ -188,7 +188,7 @@
<OptimizeReferences>true</OptimizeReferences>
</Link>
<PostBuildEvent>
<Command>call $(ProjectDir)CopyFiles.bat $(SolutionDir)$(Configuration)</Command>
<Command>call "$(ProjectDir)CopyFiles.bat" "$(SolutionDir)" "$(Configuration)" "$(VCInstallDir)"</Command>
<Message>Copy resource files</Message>
</PostBuildEvent>
</ItemDefinitionGroup>

View File

@@ -1,9 +1,14 @@
@echo off
echo Copying files...
set ResourceDir=%1\..\..\..\rsrc
set TargetDir=%1
set SolutionDir=%1
set Config=%2
set VCDir=%~f3
set ResourceDir=%SolutionDir%%Config%\..\..\..\rsrc
set TargetDir=%SolutionDir%%Config%
set ScenEdDir=%TargetDir%\"Scenario Editor"
set DllSrcDir=%VCDir%bin
@echo on
@echo Copying graphics...
@@ -28,4 +33,21 @@ xcopy %1\..\..\tools\mask.* %TargetDir%\data\shaders /s /y /i /d
xcopy %ResourceDir%\"Blades of Exile Bases" %ScenEdDir%\"Blades of Exile Base" /s /y /i /d
@echo Copying scenario files...
xcopy %ResourceDir%\"Blades of Exile Scenarios" %TargetDir%\"Blades of Exile Scenarios" /s /y /i /d
xcopy %ResourceDir%\"Blades of Exile Scenarios"\*.exs %TargetDir%\"Blades of Exile Scenarios" /s /y /i /d
xcopy %ResourceDir%\"Blades of Exile Scenarios"\*.bmp %TargetDir%\"Blades of Exile Scenarios" /s /y /i /d
@echo Copying required DLLs...
if %Config% == "Debug" (
xcopy "%DllSrcDir%\sfml-audio-d-2.dll" %TargetDir% /s /y /i /d
xcopy "%DllSrcDir%\sfml-graphics-d-2.dll" %TargetDir% /s /y /i /d
xcopy "%DllSrcDir%\sfml-system-d-2.dll" %TargetDir% /s /y /i /d
xcopy "%DllSrcDir%\sfml-window-d-2.dll" %TargetDir% /s /y /i /d
) else (
xcopy "%DllSrcDir%\sfml-audio-2.dll" %TargetDir% /s /y /i /d
xcopy "%DllSrcDir%\sfml-graphics-2.dll" %TargetDir% /s /y /i /d
xcopy "%DllSrcDir%\sfml-system-2.dll" %TargetDir% /s /y /i /d
xcopy "%DllSrcDir%\sfml-window-2.dll" %TargetDir% /s /y /i /d
)
xcopy "%DllSrcDir%\zlib1.dll" %TargetDir% /s /y /i /d
xcopy "%DllSrcDir%\libsndfile-1.dll" %TargetDir% /s /y /i /d

View File

@@ -42,6 +42,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<TargetName>Character Editor</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>

View File

@@ -42,6 +42,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
<TargetName>Scenario Editor</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>

View File

@@ -57,20 +57,6 @@ std::filebuf logfile;
void init_directories(const char* exec_path) {
progDir = fs::canonical(exec_path);
#ifdef _MSC_VER
#ifdef DEBUG
void set_debug_buffers();
set_debug_buffers();
#else
std::string logpath = (progDir.parent_path()/"bladeslog.txt").string();
logfile.open(logpath.c_str(), std::ios::out);
std::cout.rdbuf(&logfile);
std::cerr.rdbuf(&logfile);
#endif
std::cout << "Testing cout" << std::endl;
std::cerr << "Testing cerr" << std::endl;
sf::err().rdbuf(std::cerr.rdbuf());
#endif
#ifdef __APPLE__
// Need to back up out of the application package
// We're pointing at .app/Contents/MacOS/exec_name, so back out three steps
@@ -78,7 +64,6 @@ void init_directories(const char* exec_path) {
#endif
progDir = progDir.parent_path();
if(progDir.filename() == "Scenario Editor") progDir = progDir.parent_path();
std::cout << progDir << std::endl;
// Initialize the resource manager paths
ResMgr::pushPath<ImageRsrc>(progDir/"Scenario Editor"/"graphics.exd"/"mac");
ResMgr::pushPath<CursorRsrc>(progDir/"Scenario Editor"/"graphics.exd"/"mac"/"cursors");
@@ -100,6 +85,23 @@ void init_directories(const char* exec_path) {
#endif // __APPLE__
#endif // _Win32||_Win64
tempDir /= "Temporary Files";
// Depending on the build environment, we may need to redirect stdout and stderr.
#ifdef _MSC_VER
#ifdef DEBUG
void set_debug_buffers();
set_debug_buffers();
#else
std::string logpath = (tempDir.parent_path()/"bladeslog.txt").string();
logfile.open(logpath.c_str(), std::ios::out);
std::cout.rdbuf(&logfile);
std::cerr.rdbuf(&logfile);
#endif
std::cout << "Testing cout" << std::endl;
std::cerr << "Testing cerr" << std::endl;
sf::err().rdbuf(std::cerr.rdbuf());
#endif
std::cout << progDir << std::endl;
}
void check_for_intel() {