Skip to content

Commit

Permalink
Fix Windows build. Fix camera indexing
Browse files Browse the repository at this point in the history
  • Loading branch information
dtarakanov1 committed Sep 17, 2018
1 parent 08946cb commit 4ad2edc
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
8 changes: 7 additions & 1 deletion BaikalDataGenerator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ add_library(BaikalDataGeneratorLib SHARED ${DATAGENERATOR_LIB_SOURCES})

target_compile_features(BaikalDataGeneratorLib PRIVATE cxx_std_17)

target_compile_definitions(BaikalDataGeneratorLib PRIVATE RPR_EXPORT_API)

target_include_directories(BaikalDataGeneratorLib
PRIVATE .
PRIVATE ${Baikal_SOURCE_DIR}
Expand All @@ -29,7 +31,11 @@ set_target_properties(BaikalDataGeneratorLib

add_dependencies(BaikalDataGeneratorLib ResourcesDir Copy3rdParty)

install(TARGETS BaikalDataGeneratorLib LIBRARY DESTINATION lib)
if (WIN32)
install(TARGETS BaikalDataGeneratorLib RUNTIME DESTINATION bin)
else ()
install(TARGETS BaikalDataGeneratorLib LIBRARY DESTINATION lib)
endif ()


# Application
Expand Down
7 changes: 4 additions & 3 deletions BaikalDataGenerator/Source/data_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,21 +89,22 @@ try
params->cameras_offset_idx,
params->gamma_correction != 0);

for (unsigned i = params->cameras_start_idx; i <= camera_end_idx; ++i)
for (unsigned i = 0; i < params->cameras_num; ++i)
{
auto* camera = CameraObject::Cast<CameraObject>(params->cameras[i]);
if (camera == nullptr)
{
return kDataGeneratorBadCamera;
}
int camera_idx = params->cameras_start_idx + params->cameras_offset_idx + i;
render.GenerateSample(camera,
params->cameras_offset_idx + i,
camera_idx,
sorted_spp,
output_dir,
params->gamma_correction != 0);
if (params->progress_callback)
{
params->progress_callback(params->cameras_offset_idx + i);
params->progress_callback(camera_idx);
}
}

Expand Down
6 changes: 3 additions & 3 deletions BaikalDataGenerator/Source/object_loader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ void ObjectLoader::LoadCameras()
m_app_config.split_num,
m_app_config.split_idx);
m_cameras_start_idx = static_cast<unsigned>(indices.first);
m_cameras.erase(m_cameras.begin() + indices.second);
m_cameras.erase(m_cameras.begin() + indices.second, m_cameras.end());
m_cameras.erase(m_cameras.begin(), m_cameras.begin() + indices.first);
for (auto& camera : m_cameras)
{
Expand Down Expand Up @@ -300,9 +300,9 @@ void ObjectLoader::LoadLights()
auto light_type = kLightTypesMap.at(elem->Attribute("type"));
light = std::make_unique<LightObject>(light_type);
}
catch (std::out_of_range& ex)
catch (std::out_of_range&)
{
THROW_EX("Unsupported light type: " << elem->Attribute("type"))
THROW_EX("Unsupported light type: " << type_name)
}

switch (light->GetType())
Expand Down
1 change: 1 addition & 0 deletions Rpr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ target_link_libraries(RadeonProRender64 PUBLIC Baikal BaikalIO OpenGL::GL GLEW::

# Install target
if (WIN32)
target_compile_options(RadeonProRender64 PUBLIC /wd4251)
install(TARGETS RadeonProRender64 RUNTIME DESTINATION bin)
else ()
install(TARGETS RadeonProRender64 LIBRARY DESTINATION lib)
Expand Down
4 changes: 3 additions & 1 deletion Rpr/WrapObject/WrapObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ THE SOFTWARE.
********************************************************************/
#pragma once

#include "RadeonProRender.h"

#include <string>

//base wrap class of Baikal scene nodes
class WrapObject
class RPR_API_ENTRY WrapObject
{
public:
WrapObject() = default;
Expand Down

0 comments on commit 4ad2edc

Please sign in to comment.