1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-22 02:12:45 +01:00

Merge pull request #533 from christoph-heiss/fix-cutscenes-macos

Fix cutscene only showing a grey screen on macOS.
This commit is contained in:
Jannik Vogel 2018-06-26 22:09:59 +02:00 committed by GitHub
commit 2b59f8b210
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 35 deletions

View File

@ -67,10 +67,14 @@ else()
endif()
if(FILESYSTEM_LIBRARY STREQUAL "CXX17")
set(CMAKE_CXX_STANDARD 17)
target_compile_definitions(rw_interface INTERFACE "RW_FS_LIBRARY=0")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_link_libraries(rw_interface INTERFACE "stdc++fs")
endif()
elseif(FILESYSTEM_LIBRARY STREQUAL "CXXTS")
target_compile_definitions(rw_interface INTERFACE "RW_FS_LIBRARY=1")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_link_libraries(rw_interface INTERFACE "stdc++fs")
endif()
elseif(FILESYSTEM_LIBRARY STREQUAL "BOOST")

View File

@ -21,14 +21,16 @@ void LoaderCutsceneDAT::load(CutsceneTracks &tracks, const FileHandle& file) {
ss.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
for (int i = 0; i < numZooms; ++i) {
float t = 0.f;
float z = 0.f;
ss >> t;
ss.ignore(2, ',');
ss >> z;
ss.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
tracks.zoom[t] = z;
std::string st, sz;
std::getline(ss, st, ',');
std::getline(ss, sz, ',');
float t = std::stof(st);
tracks.zoom[t] = std::stof(sz);
tracks.duration = std::max(t, tracks.duration);
ss.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
ss.ignore(std::numeric_limits<std::streamsize>::max(), ';');
@ -38,14 +40,16 @@ void LoaderCutsceneDAT::load(CutsceneTracks &tracks, const FileHandle& file) {
ss.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
for (int i = 0; i < numRotations; ++i) {
float t = 0.f;
float r = 0.f;
ss >> t;
ss.ignore(2, ',');
ss >> r;
ss.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
tracks.rotation[t] = r;
std::string st, sr;
std::getline(ss, st, ',');
std::getline(ss, sr, ',');
float t = std::stof(st);
tracks.rotation[t] = std::stof(sr);
tracks.duration = std::max(t, tracks.duration);
ss.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
ss.ignore(std::numeric_limits<std::streamsize>::max(), ';');
@ -55,18 +59,19 @@ void LoaderCutsceneDAT::load(CutsceneTracks &tracks, const FileHandle& file) {
ss.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
for (int i = 0; i < numPositions; ++i) {
float t = 0.f;
glm::vec3 p;
ss >> t;
ss.ignore(2, ',');
ss >> p.x;
ss.ignore(1, ',');
ss >> p.y;
ss.ignore(1, ',');
ss >> p.z;
ss.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
std::string st, sx, sy, sz;
std::getline(ss, st, ',');
std::getline(ss, sx, ',');
std::getline(ss, sy, ',');
std::getline(ss, sz, ',');
float t = std::stof(st);
glm::vec3 p{std::stof(sx), std::stof(sy), std::stof(sz)};
tracks.position[t] = p;
tracks.duration = std::max(t, tracks.duration);
ss.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
ss.ignore(std::numeric_limits<std::streamsize>::max(), ';');
@ -76,18 +81,19 @@ void LoaderCutsceneDAT::load(CutsceneTracks &tracks, const FileHandle& file) {
ss.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
for (int i = 0; i < numTargets; ++i) {
float t = 0.f;
glm::vec3 p;
ss >> t;
ss.ignore(2, ',');
ss >> p.x;
ss.ignore(1, ',');
ss >> p.y;
ss.ignore(1, ',');
ss >> p.z;
ss.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
std::string st, sx, sy, sz;
std::getline(ss, st, ',');
std::getline(ss, sx, ',');
std::getline(ss, sy, ',');
std::getline(ss, sz, ',');
float t = std::stof(st);
glm::vec3 p{std::stof(sx), std::stof(sy), std::stof(sz)};
tracks.target[t] = p;
tracks.duration = std::max(t, tracks.duration);
ss.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
}
RW_CHECK(ss.eof() || ss.good(), "Loading CutsceneDAT file failed");