Revert "Add way to hide message for screenshot tasks"

This reverts commit 0aca3d04c077366f2c28f2071d1cb6706c6855d4.
This commit is contained in:
Jean-André Santoni 2016-12-01 20:30:54 +01:00
parent 0bd94b9b54
commit 70053afd03
3 changed files with 21 additions and 27 deletions

View File

@ -1899,7 +1899,7 @@ bool command_event(enum event_command cmd, void *data)
settings->state_slot++; settings->state_slot++;
break; break;
case CMD_EVENT_TAKE_SCREENSHOT: case CMD_EVENT_TAKE_SCREENSHOT:
if (!take_screenshot(false)) if (!take_screenshot())
return false; return false;
break; break;
case CMD_EVENT_UNLOAD_CORE: case CMD_EVENT_UNLOAD_CORE:

View File

@ -75,7 +75,6 @@ typedef struct
int pitch; int pitch;
bool bgr24; bool bgr24;
void *userbuf; void *userbuf;
bool hide_msg;
} screenshot_task_state_t; } screenshot_task_state_t;
/** /**
@ -175,8 +174,7 @@ static bool screenshot_dump(
const void *frame, const void *frame,
unsigned width, unsigned width,
unsigned height, unsigned height,
int pitch, bool bgr24, bool hide_msg, int pitch, bool bgr24, void *userbuf)
void *userbuf)
{ {
#ifdef _XBOX1 #ifdef _XBOX1
d3d_video_t *d3d = (d3d_video_t*)video_driver_get_ptr(true); d3d_video_t *d3d = (d3d_video_t*)video_driver_get_ptr(true);
@ -186,7 +184,6 @@ static bool screenshot_dump(
screenshot_task_state_t *state = (screenshot_task_state_t*) screenshot_task_state_t *state = (screenshot_task_state_t*)
calloc(1, sizeof(*state)); calloc(1, sizeof(*state));
state->hide_msg = hide_msg;
state->bgr24 = bgr24; state->bgr24 = bgr24;
state->height = height; state->height = height;
state->width = width; state->width = width;
@ -218,17 +215,14 @@ static bool screenshot_dump(
task->type = TASK_TYPE_BLOCKING; task->type = TASK_TYPE_BLOCKING;
task->state = state; task->state = state;
task->handler = task_screenshot_handler; task->handler = task_screenshot_handler;
if (!hide_msg)
task->title = strdup(msg_hash_to_str(MSG_TAKING_SCREENSHOT)); task->title = strdup(msg_hash_to_str(MSG_TAKING_SCREENSHOT));
task_queue_ctl(TASK_QUEUE_CTL_PUSH, task); task_queue_ctl(TASK_QUEUE_CTL_PUSH, task);
return true; return true;
} }
#if !defined(VITA) #if !defined(VITA)
static bool take_screenshot_viewport(const char *name_base, bool hide_msg) static bool take_screenshot_viewport(const char *name_base)
{ {
char screenshot_path[PATH_MAX_LENGTH]; char screenshot_path[PATH_MAX_LENGTH];
const char *screenshot_dir = NULL; const char *screenshot_dir = NULL;
@ -263,7 +257,7 @@ static bool take_screenshot_viewport(const char *name_base, bool hide_msg)
/* Data read from viewport is in bottom-up order, suitable for BMP. */ /* Data read from viewport is in bottom-up order, suitable for BMP. */
if (!screenshot_dump(name_base, screenshot_dir, buffer, vp.width, vp.height, if (!screenshot_dump(name_base, screenshot_dir, buffer, vp.width, vp.height,
vp.width * 3, true, hide_msg, buffer)) vp.width * 3, true, buffer))
goto error; goto error;
return true; return true;
@ -275,7 +269,7 @@ error:
} }
#endif #endif
static bool take_screenshot_raw(const char *name_base, bool hide_msg, void *userbuf) static bool take_screenshot_raw(const char *name_base, void *userbuf)
{ {
size_t pitch; size_t pitch;
unsigned width, height; unsigned width, height;
@ -300,13 +294,13 @@ static bool take_screenshot_raw(const char *name_base, bool hide_msg, void *user
*/ */
if (!screenshot_dump(name_base, screenshot_dir, if (!screenshot_dump(name_base, screenshot_dir,
(const uint8_t*)data + (height - 1) * pitch, (const uint8_t*)data + (height - 1) * pitch,
width, height, -pitch, false, hide_msg, userbuf)) width, height, -pitch, false, userbuf))
return false; return false;
return true; return true;
} }
static bool take_screenshot_choice(const char *name_base, bool hide_msg) static bool take_screenshot_choice(const char *name_base)
{ {
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
@ -322,14 +316,14 @@ static bool take_screenshot_choice(const char *name_base, bool hide_msg)
if (!runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL)) if (!runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL))
video_driver_cached_frame(); video_driver_cached_frame();
#if defined(VITA) #if defined(VITA)
return take_screenshot_raw(name_base, hide__msg, NULL); return take_screenshot_raw(name_base, NULL);
#else #else
return take_screenshot_viewport(name_base, hide_msg); return take_screenshot_viewport(name_base);
#endif #endif
} }
if (!video_driver_cached_frame_has_valid_framebuffer()) if (!video_driver_cached_frame_has_valid_framebuffer())
return take_screenshot_raw(name_base, hide_msg, NULL); return take_screenshot_raw(name_base, NULL);
if (video_driver_supports_read_frame_raw()) if (video_driver_supports_read_frame_raw())
{ {
@ -351,7 +345,7 @@ static bool take_screenshot_choice(const char *name_base, bool hide_msg)
if (frame_data) if (frame_data)
{ {
video_driver_set_cached_frame_ptr(frame_data); video_driver_set_cached_frame_ptr(frame_data);
if (take_screenshot_raw(name_base, hide_msg, frame_data)) if (take_screenshot_raw(name_base, frame_data))
ret = true; ret = true;
} }
@ -366,11 +360,11 @@ static bool take_screenshot_choice(const char *name_base, bool hide_msg)
* *
* Returns: true (1) if successful, otherwise false (0). * Returns: true (1) if successful, otherwise false (0).
**/ **/
bool take_screenshot(bool hide_msg) bool take_screenshot(void)
{ {
char *name_base = strdup(path_get(RARCH_PATH_BASENAME)); char *name_base = strdup(path_get(RARCH_PATH_BASENAME));
bool is_paused = runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL); bool is_paused = runloop_ctl(RUNLOOP_CTL_IS_PAUSED, NULL);
bool ret = take_screenshot_choice(name_base, hide_msg); bool ret = take_screenshot_choice(name_base);
const char *msg_screenshot = ret const char *msg_screenshot = ret
? msg_hash_to_str(MSG_TAKING_SCREENSHOT) : ? msg_hash_to_str(MSG_TAKING_SCREENSHOT) :
msg_hash_to_str(MSG_FAILED_TO_TAKE_SCREENSHOT); msg_hash_to_str(MSG_FAILED_TO_TAKE_SCREENSHOT);

View File

@ -145,7 +145,7 @@ bool content_push_to_history_playlist(
const char *core_path); const char *core_path);
/* TODO/FIXME - turn this into actual task */ /* TODO/FIXME - turn this into actual task */
bool take_screenshot(bool hide_msg); bool take_screenshot(void);
bool event_load_save_files(void); bool event_load_save_files(void);