diff --git a/apps/Sync/main.cpp b/apps/Sync/main.cpp index ee1dcc5c9a..cbad5abcfb 100644 --- a/apps/Sync/main.cpp +++ b/apps/Sync/main.cpp @@ -36,74 +36,13 @@ #include #include -// #include -// #include -// #include - -// #include -// #include -// #include -// #include -// #include -// #include -// #include - -// #include -// #include -// #include -// #include - -namespace { - constexpr const char* ConfigurationFile = "openspace.cfg"; - constexpr const char* _loggerCat = "Sync"; -} - int main(int argc, char** argv) { using namespace openspace; -// ghoul::initialize(); -// -// ghoul::logging::LogManager::initialize( -// ghoul::logging::LogLevel::Debug, -// ghoul::logging::LogManager::ImmediateFlush::Yes -// ); -// LogMgr.addLog(std::make_unique()); -// -// LDEBUG("Initialize FileSystem"); -// -// ghoul::filesystem::Directory launchDirectory = FileSys.currentDirectory(); -// -//#ifdef __APPLE__ -// ghoul::filesystem::File app(argv[0]); -// std::string dirName = app.directoryName(); -// LINFO("Setting starting directory to '" << dirName << "'"); -// FileSys.setCurrentDirectory(dirName); -//#endif - - // initTextureReaders(); - std::vector unusedStringlist; bool unusedBool; OpenSpaceEngine::create(argc, argv, nullptr, unusedStringlist, unusedBool); - /*openspace::ConfigurationManager configuration; - std::string configurationFile = configuration.findConfiguration(ConfigurationFile); - configuration.loadFromFile(configurationFile); - - ghoul::Dictionary moduleConfigurations; - if (configuration.hasKeyAndValue( - ConfigurationManager::KeyModuleConfigurations)) - { - configuration.getValue( - ConfigurationManager::KeyModuleConfigurations, - moduleConfigurations - ); - }*/ - - //ModuleEngine moduleEngine; - //moduleEngine.initialize(moduleConfigurations); - //LINFO("Initialization done."); - TaskLoader taskLoader; std::vector> tasks = taskLoader.tasksFromFile( absPath("${TASKS}/full_sync.task") @@ -111,15 +50,15 @@ int main(int argc, char** argv) { for (size_t i = 0; i < tasks.size(); i++) { Task& task = *tasks[i].get(); - LINFO( + LINFOC( + "Sync", "Synchronizing scene " << (i + 1) << " out of " << - tasks.size() << ": " << task.description() + tasks.size() << ": " << task.description() ); ProgressBar progressBar(100); - auto onProgress = [&progressBar](float progress) { + task.perform([&progressBar](float progress) { progressBar.print(static_cast(progress * 100.f)); - }; - task.perform(onProgress); + }); } std::cout << "Done synchronizing." << std::endl; diff --git a/ext/sgct b/ext/sgct index e1228d8be5..f6c486238d 160000 --- a/ext/sgct +++ b/ext/sgct @@ -1 +1 @@ -Subproject commit e1228d8be50065bba0ad86905f3727ab7eb26ff2 +Subproject commit f6c486238d16ae937d51593e502b4922959353b8 diff --git a/include/openspace/rendering/deferredcasterlistener.h b/include/openspace/rendering/deferredcasterlistener.h index 9e3a7a3ffd..bea9374f1e 100644 --- a/include/openspace/rendering/deferredcasterlistener.h +++ b/include/openspace/rendering/deferredcasterlistener.h @@ -34,6 +34,7 @@ class Deferredcaster; class DeferredcasterListener { public: using isAttached = ghoul::Boolean; + virtual ~DeferredcasterListener() = default; virtual void deferredcastersChanged(Deferredcaster& deferredcaster, isAttached isAttached) = 0; diff --git a/modules/atmosphere/rendering/atmospheredeferredcaster.cpp b/modules/atmosphere/rendering/atmospheredeferredcaster.cpp index dbc26d62f9..89f9c86e84 100644 --- a/modules/atmosphere/rendering/atmospheredeferredcaster.cpp +++ b/modules/atmosphere/rendering/atmospheredeferredcaster.cpp @@ -83,7 +83,9 @@ #include #include +#ifdef WIN32 #define _USE_MATH_DEFINES +#endif // WIN32 #include @@ -182,7 +184,7 @@ void AtmosphereDeferredcaster::deinitialize() { } void AtmosphereDeferredcaster::preRaycast(const RenderData& renderData, - const DeferredcastData& deferredData, + const DeferredcastData&, ghoul::opengl::ProgramObject& program) { // Atmosphere Frustum Culling @@ -418,9 +420,9 @@ void AtmosphereDeferredcaster::preRaycast(const RenderData& renderData, program.setUniform("inscatterTexture", _inScatteringTableTextureUnit); } -void AtmosphereDeferredcaster::postRaycast(const RenderData& renderData, - const DeferredcastData& deferredData, - ghoul::opengl::ProgramObject& program) +void AtmosphereDeferredcaster::postRaycast(const RenderData&, + const DeferredcastData&, + ghoul::opengl::ProgramObject&) { // Deactivate the texture units _transmittanceTableTextureUnit.deactivate(); diff --git a/modules/atmosphere/rendering/renderableatmosphere.cpp b/modules/atmosphere/rendering/renderableatmosphere.cpp index de20bc9c32..ec83ead7b6 100644 --- a/modules/atmosphere/rendering/renderableatmosphere.cpp +++ b/modules/atmosphere/rendering/renderableatmosphere.cpp @@ -52,7 +52,9 @@ #include #include +#ifdef WIN32 #define _USE_MATH_DEFINES +#endif // WIN32 #include namespace { diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp index f1242c879b..bba1213749 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp @@ -397,8 +397,8 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di , _labelFile("") , _colorOptionString("") , _unit(Parsec) - , _transformationMatrix(glm::dmat4(1.0)) , _nValuesPerAstronomicalObject(0) + , _transformationMatrix(glm::dmat4(1.0)) , _vao(0) , _vbo(0) , _polygonVao(0) @@ -483,7 +483,7 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di ghoul::Dictionary colorOptionDataDic = dictionary.value( ColorOptionInfo.identifier ); - for (int i = 0; i < colorOptionDataDic.size(); ++i) { + for (int i = 0; i < static_cast(colorOptionDataDic.size()); ++i) { std::string colorMapInUseName( colorOptionDataDic.value(std::to_string(i + 1))); _colorOption.addOption(i, colorMapInUseName); @@ -499,12 +499,12 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di addProperty(_colorOption); if (dictionary.hasKey(ColorRangeInfo.identifier)) { - ghoul::Dictionary rangeDataDic = dictionary.value( + ghoul::Dictionary rangeDataDict = dictionary.value( ColorRangeInfo.identifier - ); - for (int i = 0; i < rangeDataDic.size(); ++i) { + ); + for (size_t i = 0; i < rangeDataDict.size(); ++i) { _colorRangeData.push_back( - rangeDataDic.value(std::to_string(i+1))); + rangeDataDict.value(std::to_string(i + 1))); } } @@ -618,7 +618,7 @@ void RenderableBillboardsCloud::initialize() { if (!_colorOptionString.empty()) { // Following DU behavior here. The last colormap variable // entry is the one selected by default. - _colorOption.setValue(_colorRangeData.size() - 1); + _colorOption.setValue(static_cast(_colorRangeData.size() - 1)); } } @@ -913,7 +913,7 @@ void RenderableBillboardsCloud::render(const RenderData& data, RendererTasks&) { glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale)); glm::dmat4 modelViewMatrix = data.camera.combinedViewMatrix() * modelMatrix; - glm::mat4 viewMatrix = data.camera.viewMatrix(); + // glm::mat4 viewMatrix = data.camera.viewMatrix(); glm::mat4 projectionMatrix = data.camera.projectionMatrix(); glm::dmat4 modelViewProjectionMatrix = glm::dmat4(projectionMatrix) * @@ -1268,7 +1268,7 @@ bool RenderableBillboardsCloud::readColorMapFile() { // (signaled by the keywords 'datavar', 'texturevar', and 'texture') std::string line = ""; while (true) { - std::streampos position = file.tellg(); + // std::streampos position = file.tellg(); std::getline(file, line); if (line[0] == '#' || line.empty()) { @@ -1287,12 +1287,12 @@ bool RenderableBillboardsCloud::readColorMapFile() { } } - for (auto i = 0; i < numberOfColors; ++i) { + for (size_t i = 0; i < numberOfColors; ++i) { std::getline(file, line); std::stringstream str(line); glm::vec4 color; - for (auto j = 0; j < 4; ++j) { + for (int j = 0; j < 4; ++j) { str >> color[j]; } @@ -1481,7 +1481,7 @@ bool RenderableBillboardsCloud::saveCachedFile(const std::string& file) const { reinterpret_cast(&keySize), sizeof(int32_t) ); - for (int c = 0; c < pair.first.size(); ++c) { + for (size_t c = 0; c < pair.first.size(); ++c) { int32_t keyChar = static_cast(pair.first[c]); fileStream.write( reinterpret_cast(&keyChar), @@ -1520,7 +1520,7 @@ void RenderableBillboardsCloud::createDataSlice() { float colorMapBinSize = (currentColorRange.y - currentColorRange.x) / static_cast(_colorMapData.size()); float bin = colorMapBinSize; - for (int i = 0; i < _colorMapData.size(); ++i) { + for (size_t i = 0; i < _colorMapData.size(); ++i) { colorBins.push_back(bin); bin += colorMapBinSize; } @@ -1546,14 +1546,17 @@ void RenderableBillboardsCloud::createDataSlice() { // is the outliers color. glm::vec4 itemColor; float variableColor = _fullData[i + 3 + colorMapInUse]; - int c = colorBins.size()-1; + int c = static_cast(colorBins.size() - 1); while (variableColor < colorBins[c]) { --c; if (c == 0) break; } - int colorIndex = c == colorBins.size() - 1 ? 0 : c + 1; + int colorIndex = + c == static_cast(colorBins.size() - 1) ? + 0 : + c + 1; for (auto j = 0; j < 4; ++j) { _slicedData.push_back(_colorMapData[colorIndex][j]); diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.cpp b/modules/digitaluniverse/rendering/renderableplanescloud.cpp index 4bbaf570b7..0349a12090 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.cpp +++ b/modules/digitaluniverse/rendering/renderableplanescloud.cpp @@ -1264,8 +1264,7 @@ void RenderablePlanesCloud::createPlanes() { if (_dataIsDirty && _hasSpeckFile) { LDEBUG("Creating planes"); float maxSize = 0.0f; - int planeNumber = 0; - for (int p = 0; p < _fullData.size(); p += _nValuesPerAstronomicalObject) { + for (size_t p = 0; p < _fullData.size(); p += _nValuesPerAstronomicalObject) { glm::vec4 transformedPos = glm::vec4(_transformationMatrix * glm::dvec4(_fullData[p + 0], _fullData[p + 1], _fullData[p + 2], 1.0)); diff --git a/modules/digitaluniverse/rendering/renderablepoints.cpp b/modules/digitaluniverse/rendering/renderablepoints.cpp index 46967639cc..28c7a42652 100644 --- a/modules/digitaluniverse/rendering/renderablepoints.cpp +++ b/modules/digitaluniverse/rendering/renderablepoints.cpp @@ -381,7 +381,7 @@ namespace openspace { const size_t nAstronomicalObjects = _fullData.size() / _nValuesPerAstronomicalObject; const size_t nValues = _slicedData.size() / nAstronomicalObjects; - GLsizei stride = static_cast(sizeof(double) * nValues); + // GLsizei stride = static_cast(sizeof(double) * nValues); glEnableVertexAttribArray(positionAttrib); glVertexAttribLPointer( @@ -572,7 +572,7 @@ namespace openspace { // (signaled by the keywords 'datavar', 'texturevar', and 'texture') std::string line = ""; while (true) { - std::streampos position = file.tellg(); + // std::streampos position = file.tellg(); std::getline(file, line); if (line[0] == '#' || line.empty()) { @@ -591,12 +591,12 @@ namespace openspace { } } - for (auto i = 0; i < numberOfColors; ++i) { + for (size_t i = 0; i < numberOfColors; ++i) { std::getline(file, line); std::stringstream str(line); glm::vec4 color; - for (auto j = 0; j < 4; ++j) { + for (size_t j = 0; j < 4; ++j) { str >> color[j]; } @@ -724,7 +724,10 @@ namespace openspace { } } - colorIndex = (colorIndex == (_colorMapData.size() - 1)) ? 0 : colorIndex + 1; + colorIndex = + (colorIndex == static_cast(_colorMapData.size() - 1)) ? + 0 : + colorIndex + 1; } } diff --git a/modules/globebrowsing/rendering/chunkrenderer.cpp b/modules/globebrowsing/rendering/chunkrenderer.cpp index 5d51f4c4f5..ebde490d28 100644 --- a/modules/globebrowsing/rendering/chunkrenderer.cpp +++ b/modules/globebrowsing/rendering/chunkrenderer.cpp @@ -149,11 +149,11 @@ void ChunkRenderer::calculateEclipseShadows(const Chunk& chunk, lt ); casterPos *= KM_TO_M; // converting to meters - psc caster_pos = PowerScaledCoordinate::CreatePowerScaledCoordinate( - casterPos.x, - casterPos.y, - casterPos.z - ); + // psc caster_pos = PowerScaledCoordinate::CreatePowerScaledCoordinate( + // casterPos.x, + // casterPos.y, + // casterPos.z + // ); // First we determine if the caster is shadowing the current planet (all diff --git a/modules/space/rendering/renderableplanet.cpp b/modules/space/rendering/renderableplanet.cpp index 92167452c4..0f4682e3b0 100644 --- a/modules/space/rendering/renderableplanet.cpp +++ b/modules/space/rendering/renderableplanet.cpp @@ -45,7 +45,9 @@ #include #include +#ifdef WIN32 #define _USE_MATH_DEFINES +#endif // WIN32 #include namespace { @@ -438,7 +440,7 @@ glm::dmat4 RenderablePlanet::computeModelTransformMatrix( return modelTransform = modelTransform * rot * roty /** rotProp*/; } -void RenderablePlanet::render(const RenderData& data, RendererTasks& renderTask) { +void RenderablePlanet::render(const RenderData& data, RendererTasks&) { // activate shader _programObject->activate(); diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index aa4a29b959..83cd781a02 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -646,7 +646,7 @@ bool RenderableStars::readSpeckFile() { str >> values[i]; } bool nullArray = true; - for (int i = 0; i < values.size(); ++i) { + for (size_t i = 0; i < values.size(); ++i) { if (values[i] != 0.0) { nullArray = false; break; diff --git a/src/engine/downloadmanager.cpp b/src/engine/downloadmanager.cpp index 4cbc0bec05..156fc277eb 100644 --- a/src/engine/downloadmanager.cpp +++ b/src/engine/downloadmanager.cpp @@ -51,10 +51,6 @@ namespace { constexpr const char* _loggerCat = "DownloadManager"; - constexpr const char* RequestIdentifier = "identifier"; - constexpr const char* RequestFileVersion = "file_version"; - constexpr const char* RequestApplicationVersion = "application_version"; - struct ProgressInformation { std::shared_ptr future; std::chrono::system_clock::time_point startTime; diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index ebca9b9307..10ac2bc3c5 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -111,11 +111,9 @@ namespace { constexpr const char* SgctConfigArgumentCommand = "-config"; constexpr const int CacheVersion = 1; - constexpr const int DownloadVersion = 1; const glm::ivec3 FontAtlasSize{ 1536, 1536, 1 }; - struct { std::string configurationName; std::string sgctConfigurationName; @@ -707,7 +705,7 @@ void OpenSpaceEngine::loadSingleAsset(const std::string& assetPath) { } } } - _loadingScreen->setItemNumber(resourceSyncs.size()); + _loadingScreen->setItemNumber(static_cast(resourceSyncs.size())); bool loading = true; while (loading) { diff --git a/src/engine/settingsengine.cpp b/src/engine/settingsengine.cpp index ffceb8125a..1b4f20e891 100644 --- a/src/engine/settingsengine.cpp +++ b/src/engine/settingsengine.cpp @@ -73,7 +73,7 @@ void SettingsEngine::initialize() { // Set interaction to change ConfigurationManager and schedule the load _scenes.onChange([this, nScenes, sceneDir]() { - if (_scenes == nScenes) { + if (_scenes == static_cast(nScenes)) { OsEng.scheduleLoadSingleAsset(""); } else { std::string sceneFile = _scenes.getDescriptionByValue(_scenes); diff --git a/src/rendering/framebufferrenderer.cpp b/src/rendering/framebufferrenderer.cpp index a582dc4273..46201c9ce1 100644 --- a/src/rendering/framebufferrenderer.cpp +++ b/src/rendering/framebufferrenderer.cpp @@ -1266,9 +1266,10 @@ void saveTextureToPPMFile(const GLenum color_buffer_attachment, ppmFile.open(fileName.c_str(), std::fstream::out); if (ppmFile.is_open()) { - unsigned char * pixels = new unsigned char[width*height * 3]; - for (int t = 0; t < width*height * 3; ++t) + unsigned char* pixels = new unsigned char[width*height * 3]; + for (int t = 0; t < width*height * 3; ++t) { pixels[t] = 255; + } if (color_buffer_attachment != GL_DEPTH_ATTACHMENT) { glReadBuffer(color_buffer_attachment); @@ -1295,9 +1296,9 @@ void saveTextureToPPMFile(const GLenum color_buffer_attachment, int k = 0; for (int i = 0; i < width; i++) { for (int j = 0; j < height; j++) { - ppmFile << (unsigned int)pixels[k] << " " - << (unsigned int)pixels[k + 1] << " " - << (unsigned int)pixels[k + 2] << " "; + ppmFile << static_cast(pixels[k]) << " " + << static_cast(pixels[k + 1]) << " " + << static_cast(pixels[k + 2]) << " "; k += 3; } ppmFile << std::endl; diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index ecaa9b3294..ae2cd6c9e3 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -239,10 +239,10 @@ RenderEngine::RenderEngine() , _fadeDuration(2.f) , _currentFadeTime(0.f) , _fadeDirection(0) + , _nAaSamples(AaSamplesInfo, 4, 1, 16) , _hdrExposure(HDRExposureInfo, 0.4f, 0.01f, 10.0f) , _hdrBackground(BackgroundExposureInfo, 2.8f, 0.01f, 10.0f) , _gamma(GammaInfo, 2.2f, 0.01f, 10.0f) - , _nAaSamples(AaSamplesInfo, 4, 1, 16) , _frameNumber(0) { _doPerformanceMeasurements.onChange([this](){ diff --git a/src/scripting/scriptengine.cpp b/src/scripting/scriptengine.cpp index 1b064225ad..b407ccd776 100644 --- a/src/scripting/scriptengine.cpp +++ b/src/scripting/scriptengine.cpp @@ -274,7 +274,7 @@ void ScriptEngine::addLibraryFunctions(lua_State* state, LuaLibrary& library, for (void* d : p.userdata) { lua_pushlightuserdata(state, d); } - lua_pushcclosure(state, p.function, p.userdata.size()); + lua_pushcclosure(state, p.function, static_cast(p.userdata.size())); lua_settable(state, TableOffset); }