From a396b9c39f4234a301c29c54f986f7e7d49315a5 Mon Sep 17 00:00:00 2001 From: Ilari Liusvaara Date: Sat, 17 Sep 2011 11:33:35 +0300 Subject: [PATCH] Move take-screenshot: mainloop.cpp -> framebuffer.cpp --- framebuffer.cpp | 11 +++++++++++ mainloop.cpp | 9 --------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/framebuffer.cpp b/framebuffer.cpp index ec2d9a3b..0fa5154f 100644 --- a/framebuffer.cpp +++ b/framebuffer.cpp @@ -1,6 +1,8 @@ #include "framebuffer.hpp" #include "lua.hpp" +#include "command.hpp" #include "window.hpp" +#include "misc.hpp" #include "render.hpp" lcscreen framebuffer; @@ -89,6 +91,15 @@ namespace target[i] = 0x1F; draw_special_screen(target, rl_corrupt); } + + function_ptr_command take_screenshot("take-screenshot", "Takes a screenshot", + "Syntax: take-screenshot \nSaves screenshot to PNG file \n", + [](const std::string& args) throw(std::bad_alloc, std::runtime_error) { + if(args == "") + throw std::runtime_error("Filename required"); + framebuffer.save_png(args); + messages << "Saved PNG screenshot" << std::endl; + }); } screen main_screen; diff --git a/mainloop.cpp b/mainloop.cpp index 41369a38..5cd1602f 100644 --- a/mainloop.cpp +++ b/mainloop.cpp @@ -689,15 +689,6 @@ namespace while(1); }); - function_ptr_command take_screenshot("take-screenshot", "Takes a screenshot", - "Syntax: take-screenshot \nSaves screenshot to PNG file \n", - [](const std::string& args) throw(std::bad_alloc, std::runtime_error) { - if(args == "") - throw std::runtime_error("Filename required"); - framebuffer.save_png(args); - messages << "Saved PNG screenshot" << std::endl; - }); - function_ptr_command mouse_button_handler("mouse_button", "no description available", "No help available\n", [](const std::string& args) throw(std::bad_alloc, std::runtime_error) { tokensplitter t(args);