diff options
author | etabeta78 <etabeta78@users.noreply.github.com> | 2021-04-29 15:34:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-29 15:34:02 +0200 |
commit | d0d8110ecdfdc6092577ee1e73a0555e83643682 (patch) | |
tree | e73d8a76d97540ebab69be9fa6fb5ba42120b2a8 /src/emu | |
parent | 97d978dd8f230866d047e569c0ed008a42a7ef37 (diff) |
options: extended the snapname templates to allow for a timestamp %t option, so to allow for alternate ways to organize the generated snaps.
Diffstat (limited to 'src/emu')
-rw-r--r-- | src/emu/video.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/emu/video.cpp b/src/emu/video.cpp index db7406a8474..b6dada1c0b5 100644 --- a/src/emu/video.cpp +++ b/src/emu/video.cpp @@ -1169,6 +1169,18 @@ osd_file::error video_manager::open_next(emu_file &file, const char *extension, } } + // handle %t in the template (for timestamp) + std::string snaptime("%t"); + int pos_time = snapstr.find(snaptime); + + if (pos_time != -1) + { + char t_str[15]; + const std::time_t cur_time = std::time(nullptr); + strftime(t_str, sizeof(t_str), "%Y%m%d_%H%M%S", std::localtime(&cur_time)); + strreplace(snapstr, "%t", t_str); + } + // add our own extension snapstr.append(".").append(extension); |