diff --git a/Makefile.common b/Makefile.common index b203c02371..c8403e62e9 100644 --- a/Makefile.common +++ b/Makefile.common @@ -176,7 +176,7 @@ OBJ += frontend/frontend.o \ core_info.o \ libretro-common/file/config_file.o \ config_file_userdata.o \ - screenshot.o \ + tasks/task_screenshot.o \ libretro-common/gfx/scaler/scaler.o \ gfx/drivers_shader/shader_null.o \ gfx/video_shader_driver.o \ diff --git a/command.c b/command.c index 2ddd44f5cc..4aa9aa55de 100644 --- a/command.c +++ b/command.c @@ -49,7 +49,6 @@ #include "content.h" #include "movie.h" #include "general.h" -#include "screenshot.h" #include "msg_hash.h" #include "retroarch.h" #include "managers/cheat_manager.h" diff --git a/griffin/griffin.c b/griffin/griffin.c index f8431ba83f..e3f58309f3 100644 --- a/griffin/griffin.c +++ b/griffin/griffin.c @@ -826,7 +826,7 @@ DATA RUNLOOP /*============================================================ SCREENSHOTS ============================================================ */ -#include "../screenshot.c" +#include "../tasks/task_screenshot.c" /*============================================================ PLAYLISTS diff --git a/screenshot.h b/screenshot.h deleted file mode 100644 index 9620acda60..0000000000 --- a/screenshot.h +++ /dev/null @@ -1,34 +0,0 @@ -/* RetroArch - A frontend for libretro. - * Copyright (C) 2010-2014 - Hans-Kristian Arntzen - * Copyright (C) 2011-2016 - Daniel De Matteis - * - * RetroArch is free software: you can redistribute it and/or modify it under the terms - * of the GNU General Public License as published by the Free Software Found- - * ation, either version 3 of the License, or (at your option) any later version. - * - * RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; - * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - * PURPOSE. See the GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along with RetroArch. - * If not, see . - */ - -#ifndef __RARCH_SCREENSHOT_H -#define __RARCH_SCREENSHOT_H - -#include -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - -bool take_screenshot(void); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/tasks/task_content.c b/tasks/task_content.c index cd2d6b0112..f415aea20e 100644 --- a/tasks/task_content.c +++ b/tasks/task_content.c @@ -13,6 +13,8 @@ * If not, see . */ +/* TODO/FIXME - turn this into actual task */ + #include #include #include @@ -1784,7 +1786,6 @@ error: return false; } -/* TODO/FIXME - turn this into actual task */ #ifdef HAVE_MENU static void menu_content_environment_get(int *argc, char *argv[], diff --git a/screenshot.c b/tasks/task_screenshot.c similarity index 95% rename from screenshot.c rename to tasks/task_screenshot.c index aefe64b9ab..e9b989adea 100644 --- a/screenshot.c +++ b/tasks/task_screenshot.c @@ -14,6 +14,8 @@ * If not, see . */ +/* TODO/FIXME - turn this into actual task */ + #ifdef _XBOX1 #include #include @@ -28,6 +30,7 @@ #include #include +#include #include @@ -38,18 +41,14 @@ #define IMG_EXT "bmp" #endif -#include "general.h" -#include "msg_hash.h" -#include "retroarch.h" -#include "screenshot.h" -#include "verbosity.h" +#include "../general.h" +#include "../msg_hash.h" -#include "gfx/video_driver.h" -#include "gfx/scaler/scaler.h" -#include "gfx/video_frame.h" +#include "../gfx/video_driver.h" +#include "../gfx/video_frame.h" #ifdef HAVE_CONFIG_H -#include "config.h" +#include "../config.h" #endif /* Take frame bottom-up. */ @@ -100,7 +99,6 @@ static bool screenshot_dump(const char *folder, const void *frame, scaler_ctx_gen_reset(&scaler); - RARCH_LOG("Using RPNG for PNG screenshots.\n"); ret = rpng_save_image_bgr24( filename, out_buffer, @@ -124,8 +122,6 @@ static bool screenshot_dump(const char *folder, const void *frame, pitch, bmp_type); #endif - if (!ret) - RARCH_ERR("Failed to take screenshot.\n"); return ret; } @@ -258,14 +254,12 @@ static bool take_screenshot_choice(void) **/ bool take_screenshot(void) { + bool is_paused = runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL); bool ret = take_screenshot_choice(); const char *msg_screenshot = ret ? msg_hash_to_str(MSG_TAKING_SCREENSHOT) : msg_hash_to_str(MSG_FAILED_TO_TAKE_SCREENSHOT); const char *msg = msg_screenshot; - bool is_paused = runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL); - - RARCH_LOG("%s.\n", msg); runloop_msg_queue_push(msg, 1, is_paused ? 1 : 180, true); diff --git a/tasks/tasks_internal.h b/tasks/tasks_internal.h index 31a45ecfce..3064170395 100644 --- a/tasks/tasks_internal.h +++ b/tasks/tasks_internal.h @@ -139,6 +139,9 @@ void rarch_task_image_load_free(retro_task_t *task); void rarch_task_file_load_handler(retro_task_t *task); +/* TODO/FIXME - turn this into actual task */ +bool take_screenshot(void); + #ifdef __cplusplus } #endif