@@ -99,7 +99,7 @@ struct Window { | |||||
~Window(); | ~Window(); | ||||
void run(); | void run(); | ||||
/** Takes a screenshot of each module */ | /** Takes a screenshot of each module */ | ||||
void screenshot(); | |||||
void screenshot(float zoom); | |||||
void close(); | void close(); | ||||
void cursorLock(); | void cursorLock(); | ||||
void cursorUnlock(); | void cursorUnlock(); | ||||
@@ -58,11 +58,12 @@ int main(int argc, char *argv[]) { | |||||
std::string patchPath; | std::string patchPath; | ||||
bool screenshot = false; | bool screenshot = false; | ||||
float screenshotZoom = 1.f; | |||||
// Parse command line arguments | // Parse command line arguments | ||||
int c; | int c; | ||||
opterr = 0; | opterr = 0; | ||||
while ((c = getopt(argc, argv, "dhps:u:")) != -1) { | |||||
while ((c = getopt(argc, argv, "dhp:s:u:")) != -1) { | |||||
switch (c) { | switch (c) { | ||||
case 'd': { | case 'd': { | ||||
settings::devMode = true; | settings::devMode = true; | ||||
@@ -72,6 +73,7 @@ int main(int argc, char *argv[]) { | |||||
} break; | } break; | ||||
case 'p': { | case 'p': { | ||||
screenshot = true; | screenshot = true; | ||||
sscanf(optarg, "%f", &screenshotZoom); | |||||
} break; | } break; | ||||
case 's': { | case 's': { | ||||
asset::systemDir = optarg; | asset::systemDir = optarg; | ||||
@@ -163,7 +165,7 @@ int main(int argc, char *argv[]) { | |||||
std::this_thread::sleep_for(std::chrono::seconds(2)); | std::this_thread::sleep_for(std::chrono::seconds(2)); | ||||
} | } | ||||
else if (screenshot) { | else if (screenshot) { | ||||
APP->window->screenshot(); | |||||
APP->window->screenshot(screenshotZoom); | |||||
} | } | ||||
else { | else { | ||||
INFO("Running window"); | INFO("Running window"); | ||||
@@ -403,7 +403,7 @@ void Window::run() { | |||||
} | } | ||||
} | } | ||||
void Window::screenshot() { | |||||
void Window::screenshot(float zoom) { | |||||
// Iterate plugins and create directories | // Iterate plugins and create directories | ||||
std::string screenshotsDir = asset::user("screenshots"); | std::string screenshotsDir = asset::user("screenshots"); | ||||
system::createDirectory(screenshotsDir); | system::createDirectory(screenshotsDir); | ||||
@@ -421,7 +421,6 @@ void Window::screenshot() { | |||||
app::ModuleWidget *mw = model->createModuleWidgetNull(); | app::ModuleWidget *mw = model->createModuleWidgetNull(); | ||||
widget::FramebufferWidget *fb = new widget::FramebufferWidget; | widget::FramebufferWidget *fb = new widget::FramebufferWidget; | ||||
fb->addChild(mw); | fb->addChild(mw); | ||||
float zoom = 2.f; | |||||
fb->scale = math::Vec(zoom, zoom); | fb->scale = math::Vec(zoom, zoom); | ||||
// Draw to framebuffer | // Draw to framebuffer | ||||