mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-05 19:19:39 -06:00
Merge branch 'master' into issue/1303
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
#include <openspace/properties/vector/vec2property.h>
|
||||
#include <openspace/rendering/renderable.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
#include <ghoul/opengl/texture.h>
|
||||
#include <ghoul/opengl/uniformcache.h>
|
||||
|
||||
namespace ghoul::filesystem { class File; }
|
||||
|
||||
@@ -95,21 +95,31 @@ void ExoplanetsCsvToBinTask::perform(const Task::ProgressCallback& progressCallb
|
||||
LINFOC("CSVTOBIN", fmt::format("Loading {} stars", total));
|
||||
|
||||
auto readFloatData = [](const std::string& str) -> float {
|
||||
#ifdef WIN32
|
||||
float result;
|
||||
auto [p, ec] = std::from_chars(str.data(), str.data() + str.size(), result);
|
||||
if (ec == std::errc()) {
|
||||
return result;
|
||||
}
|
||||
return NAN;
|
||||
#else
|
||||
// clang is missing float support for std::from_chars
|
||||
return !str.empty() ? std::stof(str.c_str(), nullptr) : NAN;
|
||||
#endif
|
||||
};
|
||||
|
||||
auto readDoubleData = [](const std::string& str) -> double {
|
||||
#ifdef WIN32
|
||||
double result;
|
||||
auto [p, ec] = std::from_chars(str.data(), str.data() + str.size(), result);
|
||||
if (ec == std::errc()) {
|
||||
return result;
|
||||
}
|
||||
return NAN;
|
||||
#else
|
||||
// clang is missing double support for std::from_chars
|
||||
return !str.empty() ? std::stod(str.c_str(), nullptr) : NAN;
|
||||
#endif
|
||||
};
|
||||
|
||||
auto readIntegerData = [](const std::string& str) -> int {
|
||||
|
||||
Reference in New Issue
Block a user