diff --git a/.gitignore b/.gitignore index 59aef79..f45c22c 100644 --- a/.gitignore +++ b/.gitignore @@ -7,9 +7,7 @@ /utility/Debug/*.pdb /utility/Debug/*.obj /utility/Debug -/ipch/ANTTWEAKBAR-5f4de96b/*.ipch /*.sdf -/ipch/STORMLIB-4af47af8/*.ipch /utility/*.user /.vs/maps/v14/*.suo /MapViewer/x64/Debug/*.pdb @@ -40,7 +38,6 @@ /pathfind/x64/Debug /utility/x64/Debug /maps.VC.db -/ipch/STORMLIB_VS15-5647bf9b/*.ipch /MapBuilder/x64/Release /MapViewer/x64/Release /RecastDetourBuild/x64/Release @@ -50,12 +47,13 @@ /pathfind/*.user /gos.csv /.vs -/ipch/STORMLIB_VS15-933783c6/*.ipch +/.vscode /MapViewer/Include/pixelShader.hpp /MapViewer/Include/vertexShader.hpp /CMakeSettings.json /out /build /*.idea +/*.ipch /cmake-build-debug -/cmake-build-release +/cmake-build-release \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index ba24a2d..6d750b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,7 +54,10 @@ endif() # This is just easier than copying over the DLLs if (MSVC) set(STORM_USE_BUNDLED_LIBRARIES ON CACHE BOOL "") +elseif(CMAKE_BUILD_TYPE STREQUAL "Debug") + add_definitions(-D_DEBUG) endif() + add_subdirectory(stormlib EXCLUDE_FROM_ALL) if (NAMIGATOR_BUILD_C_API) install(TARGETS storm ARCHIVE DESTINATION lib) diff --git a/parser/MpqManager.cpp b/parser/MpqManager.cpp index d953b9a..9ea98ca 100644 --- a/parser/MpqManager.cpp +++ b/parser/MpqManager.cpp @@ -276,7 +276,12 @@ MpqManager::OpenFile(const std::string& file) for (auto const& i : MpqHandles) { - if (i.first != file_lower) + // if we are on Linux, the mpq filenames will use forward slashes + // instead of backslashes. this code could be cleaner. + std::string mpqPath = i.first; + std::replace(mpqPath.begin(), mpqPath.end(), '/', '\\'); + + if (mpqPath != file_lower) continue; // if we have found a match, there should be exactly two files in this