solve merge conflict with develop

This commit is contained in:
Michael Nilsson
2016-04-20 15:03:51 -04:00
182 changed files with 10662 additions and 3631 deletions

View File

@@ -34,7 +34,7 @@ using std::string;
namespace {
const string _configurationFile = "openspace.cfg";
const string _keyBasePath = "BASE_PATH";
const string _keyBasePath = "BASE_PATH";
}
namespace openspace {
@@ -91,24 +91,24 @@ string ConfigurationManager::findConfiguration(const string& filename) {
}
void ConfigurationManager::loadFromFile(const string& filename) {
using ghoul::filesystem::FileSystem;
using ghoul::filesystem::FileSystem;
if (!FileSys.fileExists(filename))
throw ghoul::FileNotFoundError(filename, "ConfigurationManager");
// ${BASE_PATH}
string basePathToken = FileSystem::TokenOpeningBraces + _keyBasePath
// ${BASE_PATH}
string basePathToken = FileSystem::TokenOpeningBraces + _keyBasePath
+ FileSystem::TokenClosingBraces;
// Retrieving the directory in which the configuration file lies
// Retrieving the directory in which the configuration file lies
string absolutePath = FileSys.absolutePath(filename);
string basePath = ghoul::filesystem::File(absolutePath).directoryName();
FileSys.registerPathToken(basePathToken, basePath);
string basePath = ghoul::filesystem::File(absolutePath).directoryName();
FileSys.registerPathToken(basePathToken, basePath);
// Loading the configuration file into ourselves
// Loading the configuration file into ourselves
ghoul::lua::loadDictionaryFromFile(filename, *this);
// Register all the paths
// Register all the paths
ghoul::Dictionary dictionary = value<ghoul::Dictionary>(KeyPaths);
std::vector<std::string> pathKeys = dictionary.keys();
@@ -118,8 +118,8 @@ void ConfigurationManager::loadFromFile(const string& filename) {
std::string fullKey =
FileSystem::TokenOpeningBraces + key + FileSystem::TokenClosingBraces;
LDEBUGC("ConfigurationManager", "Registering path " << fullKey << ": " << p);
bool override = (basePathToken == fullKey);
bool override = (basePathToken == fullKey);
if (override)
LINFOC("ConfigurationManager", "Overriding base path with '" << p << "'");
@@ -132,7 +132,7 @@ void ConfigurationManager::loadFromFile(const string& filename) {
}
}
bool complete = checkCompleteness();
bool complete = checkCompleteness();
if (!complete) {
throw ghoul::RuntimeError(
"Configuration file '" + filename + "' was not complete",
@@ -140,34 +140,34 @@ void ConfigurationManager::loadFromFile(const string& filename) {
);
}
// Remove the Paths dictionary from the configuration manager as those paths might
// change later and we don't want to be forced to keep our local copy up to date
removeKey(KeyPaths);
// Remove the Paths dictionary from the configuration manager as those paths might
// change later and we don't want to be forced to keep our local copy up to date
removeKey(KeyPaths);
}
bool ConfigurationManager::checkCompleteness() const {
std::vector<std::string> requiredTokens = {
KeyPaths,
KeyPaths + "." + KeyCache,
KeyFonts,
KeyConfigSgct
};
std::vector<std::string> requiredTokens = {
KeyPaths,
KeyPaths + "." + KeyCache,
KeyFonts,
KeyConfigSgct
};
bool totalSuccess = true;
for (const std::string& token : requiredTokens) {
bool success = hasKey(token);
bool totalSuccess = true;
for (const std::string& token : requiredTokens) {
bool success = hasKey(token);
if (!success) {
LFATALC(
LFATALC(
"ConfigurationManager",
"Configuration file did not contain required key '" << token << "'"
);
}
totalSuccess &= success;
}
totalSuccess &= success;
}
return totalSuccess;
return totalSuccess;
}
} // namespace openspace

View File

@@ -24,7 +24,7 @@
#include <openspace/engine/openspaceengine.h>
#include <openspace/version.h>
#include <openspace/openspace.h>
#include <openspace/engine/configurationmanager.h>
#include <openspace/engine/downloadmanager.h>
@@ -55,6 +55,7 @@
#include <ghoul/font/fontmanager.h>
#include <ghoul/font/fontrenderer.h>
#include <ghoul/logging/consolelog.h>
#include <ghoul/logging/visualstudiooutputlog.h>
#include <ghoul/lua/ghoul_lua.h>
#include <ghoul/lua/lua_helper.h>
#include <ghoul/systemcapabilities/systemcapabilities>
@@ -71,6 +72,10 @@
#endif
#endif
#ifdef WIN32
#include <WinBase.h>
#endif
using namespace openspace::scripting;
using namespace ghoul::filesystem;
using namespace ghoul::logging;
@@ -579,6 +584,12 @@ void OpenSpaceEngine::configureLogging() {
}
}
}
#ifdef WIN32
if (IsDebuggerPresent()) {
LogMgr.addLog(std::make_unique<VisualStudioOutputLog>());
}
#endif // WIN32
}
bool OpenSpaceEngine::initializeGL() {
@@ -641,6 +652,22 @@ void OpenSpaceEngine::postSynchronizationPreDraw() {
_gui->startFrame(static_cast<float>(dt), glm::vec2(drawBufferResolution), mousePosition, mouseButtons);
}
// Testing this every frame has minimal impact on the performance --- abock
// Debug build: 1-2 us ; Release build: <= 1 us
using ghoul::logging::LogManager;
int warningCounter = LogMgr.messageCounter(LogManager::LogLevel::Warning);
int errorCounter = LogMgr.messageCounter(LogManager::LogLevel::Error);
int fatalCounter = LogMgr.messageCounter(LogManager::LogLevel::Fatal);
if (warningCounter > 0)
LWARNINGC("Logging", "Number of Warnings raised: " << warningCounter);
if (errorCounter > 0)
LWARNINGC("Logging", "Number of Errors raised: " << errorCounter);
if (fatalCounter > 0)
LWARNINGC("Logging", "Number of Fatals raised: " << fatalCounter);
LogMgr.resetMessageCounters();
}
void OpenSpaceEngine::render(const glm::mat4 &projectionMatrix, const glm::mat4 &viewMatrix) {

View File

@@ -90,7 +90,7 @@ glm::ivec2 SGCTWindowWrapper::currentDrawBufferResolution() const {
if (viewport->hasSubViewports() && viewport->getNonLinearProjectionPtr()) {
int res = viewport->getNonLinearProjectionPtr()->getCubemapResolution();
return glm::ivec2(res, res);
} else {
} else {
return currentWindowResolution();
}
}