mirror of
https://github.com/libretro/RetroArch
synced 2025-01-30 03:32:46 +00:00
Revert "Add way to hide message for screenshot tasks"
This reverts commit 0aca3d04c077366f2c28f2071d1cb6706c6855d4.
This commit is contained in:
parent
0bd94b9b54
commit
70053afd03
@ -1899,7 +1899,7 @@ bool command_event(enum event_command cmd, void *data)
|
||||
settings->state_slot++;
|
||||
break;
|
||||
case CMD_EVENT_TAKE_SCREENSHOT:
|
||||
if (!take_screenshot(false))
|
||||
if (!take_screenshot())
|
||||
return false;
|
||||
break;
|
||||
case CMD_EVENT_UNLOAD_CORE:
|
||||
|
@ -75,7 +75,6 @@ typedef struct
|
||||
int pitch;
|
||||
bool bgr24;
|
||||
void *userbuf;
|
||||
bool hide_msg;
|
||||
} screenshot_task_state_t;
|
||||
|
||||
/**
|
||||
@ -175,8 +174,7 @@ static bool screenshot_dump(
|
||||
const void *frame,
|
||||
unsigned width,
|
||||
unsigned height,
|
||||
int pitch, bool bgr24, bool hide_msg,
|
||||
void *userbuf)
|
||||
int pitch, bool bgr24, void *userbuf)
|
||||
{
|
||||
#ifdef _XBOX1
|
||||
d3d_video_t *d3d = (d3d_video_t*)video_driver_get_ptr(true);
|
||||
@ -186,13 +184,12 @@ static bool screenshot_dump(
|
||||
screenshot_task_state_t *state = (screenshot_task_state_t*)
|
||||
calloc(1, sizeof(*state));
|
||||
|
||||
state->hide_msg = hide_msg;
|
||||
state->bgr24 = bgr24;
|
||||
state->height = height;
|
||||
state->width = width;
|
||||
state->pitch = pitch;
|
||||
state->frame = frame;
|
||||
state->userbuf = userbuf;
|
||||
state->bgr24 = bgr24;
|
||||
state->height = height;
|
||||
state->width = width;
|
||||
state->pitch = pitch;
|
||||
state->frame = frame;
|
||||
state->userbuf = userbuf;
|
||||
|
||||
if (settings->auto_screenshot_filename)
|
||||
fill_str_dated_filename(state->shotname, path_basename(name_base),
|
||||
@ -218,17 +215,14 @@ static bool screenshot_dump(
|
||||
task->type = TASK_TYPE_BLOCKING;
|
||||
task->state = state;
|
||||
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);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
#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];
|
||||
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. */
|
||||
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;
|
||||
|
||||
return true;
|
||||
@ -275,7 +269,7 @@ error:
|
||||
}
|
||||
#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;
|
||||
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,
|
||||
(const uint8_t*)data + (height - 1) * pitch,
|
||||
width, height, -pitch, false, hide_msg, userbuf))
|
||||
width, height, -pitch, false, userbuf))
|
||||
return false;
|
||||
|
||||
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();
|
||||
|
||||
@ -322,14 +316,14 @@ static bool take_screenshot_choice(const char *name_base, bool hide_msg)
|
||||
if (!runloop_ctl(RUNLOOP_CTL_IS_IDLE, NULL))
|
||||
video_driver_cached_frame();
|
||||
#if defined(VITA)
|
||||
return take_screenshot_raw(name_base, hide__msg, NULL);
|
||||
return take_screenshot_raw(name_base, NULL);
|
||||
#else
|
||||
return take_screenshot_viewport(name_base, hide_msg);
|
||||
return take_screenshot_viewport(name_base);
|
||||
#endif
|
||||
}
|
||||
|
||||
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())
|
||||
{
|
||||
@ -351,7 +345,7 @@ static bool take_screenshot_choice(const char *name_base, bool hide_msg)
|
||||
if (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;
|
||||
}
|
||||
|
||||
@ -366,11 +360,11 @@ static bool take_screenshot_choice(const char *name_base, bool hide_msg)
|
||||
*
|
||||
* 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));
|
||||
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
|
||||
? msg_hash_to_str(MSG_TAKING_SCREENSHOT) :
|
||||
msg_hash_to_str(MSG_FAILED_TO_TAKE_SCREENSHOT);
|
||||
|
@ -145,7 +145,7 @@ bool content_push_to_history_playlist(
|
||||
const char *core_path);
|
||||
|
||||
/* TODO/FIXME - turn this into actual task */
|
||||
bool take_screenshot(bool hide_msg);
|
||||
bool take_screenshot(void);
|
||||
|
||||
bool event_load_save_files(void);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user