diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 49b47645a9..407290ab62 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -32,6 +32,9 @@ #include +#include +#include + sgct::Engine* _sgctEngine; void mainInitFunc(); diff --git a/modules/globebrowsing/tile/tiledataset.cpp b/modules/globebrowsing/tile/tiledataset.cpp index 4c2d0bc781..e2e49932c7 100644 --- a/modules/globebrowsing/tile/tiledataset.cpp +++ b/modules/globebrowsing/tile/tiledataset.cpp @@ -184,6 +184,9 @@ namespace openspace { } } + // Commenting away the following for now since it is not supported for older + // versions of GDAL. Only used for debug info. + /* const std::string originalDriverName = dataset->GetDriverName(); if (originalDriverName != "WMS") { @@ -200,7 +203,7 @@ namespace openspace { const char* in_memory = ""; //GDALDataset* vrtDataset = driver->CreateCopy(in_memory, dataset, false, nullptr, nullptr, nullptr); } - + */ return dataset; } @@ -308,8 +311,7 @@ namespace openspace { TileDepthTransform TileDataset::calculateTileDepthTransform() { GDALRasterBand* firstBand = _dataset->GetRasterBand(1); - // Floating point types does not have a fix maximum or minimum value and - // can not be normalized when sampling a texture. Hence no rescaling is needed. + bool isFloat = (_dataLayout.gdalType == GDT_Float32 || _dataLayout.gdalType == GDT_Float64); double maximumValue = isFloat ? 1.0 : TileDataType::getMaximumValue(_dataLayout.gdalType); diff --git a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp index 2cdbefd741..bd36cb1d55 100644 --- a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp @@ -74,10 +74,11 @@ namespace openspace { throw std::runtime_error("Must define key '" + KeyFilePath + "'"); } - std::ifstream in(_datasetFile.c_str()); - ghoul_assert(errno == 0, strerror(errno) << std::endl << _datasetFile); - + if (!in.is_open()) { + throw ghoul::FileNotFoundError(_datasetFile); + } + // read file std::string xml((std::istreambuf_iterator(in)), (std::istreambuf_iterator())); _gdalXmlTemplate = consumeTemporalMetaData(xml);