From 285ab66af53123b4c30bf92a4ff3eb0951a38f82 Mon Sep 17 00:00:00 2001 From: danzel Date: Mon, 14 Aug 2017 08:52:28 +1200 Subject: [PATCH] Don't hardcode the size --- src/scripted_input/script_runner.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/scripted_input/script_runner.cpp b/src/scripted_input/script_runner.cpp index b2c3d61e7..2ed426567 100644 --- a/src/scripted_input/script_runner.cpp +++ b/src/scripted_input/script_runner.cpp @@ -6,8 +6,10 @@ #include #include #include "common/logging/log.h" +#include "core/frontend/emu_window.h" #include "scripted_input/script_runner.h" #include "scripted_input/scripted_buttons.h" +#include "video_core/video_core.h" #define SCRIPT_MAX_LINE 200 @@ -123,8 +125,8 @@ void ScriptRunner::SaveScreenshot() { char buf[12]; sprintf(buf, "%i.bmp", frame_number); - const int w = 400; // render_window->GetActiveConfig().min_client_area_size.first; - const int h = 480; // render_window->GetActiveConfig().min_client_area_size.second; + const int w = VideoCore::g_emu_window->GetActiveConfig().min_client_area_size.first; + const int h = VideoCore::g_emu_window->GetActiveConfig().min_client_area_size.second; unsigned char* pixels = new unsigned char[w * h * 3]; glReadPixels(0, 0, w, h, GL_BGR, GL_UNSIGNED_BYTE, pixels);