Load stylesheet from disk.

This commit is contained in:
Young Hahn
2014-06-01 13:50:32 -04:00
parent 705ddf68a5
commit 04610023de

View File

@@ -3,6 +3,8 @@
#include <signal.h>
#include <getopt.h>
#include <fstream>
#include <sstream>
#include "../common/settings_json.hpp"
#include "../common/glfw_view.hpp"
@@ -40,6 +42,11 @@ int main(int argc, char *argv[]) {
sigIntHandler.sa_flags = 0;
sigaction(SIGINT, &sigIntHandler, NULL);
// read default stylesheet from disk
std::ifstream stylefile("./build/Release/style.min.js");
std::stringstream stylejson;
stylejson << stylefile.rdbuf();
view = new GLFWView();
llmr::Map map(*view);
@@ -49,6 +56,9 @@ int main(int argc, char *argv[]) {
map.setAngle(settings.angle);
map.setDebug(settings.debug);
// Load style
map.setStyleJSON(stylejson.str());
int ret = view->run();
// Save settings