diff bindings.c @ 2295:eb45ad9d8a3f

WIP "video" recording in APNG format
author Michael Pavone <pavone@retrodev.com>
date Fri, 10 Feb 2023 23:17:43 -0800
parents 4de40b13b55f
children b3832f73444f
line wrap: on
line diff
--- a/bindings.c	Fri Feb 10 21:37:59 2023 -0800
+++ b/bindings.c	Fri Feb 10 23:17:43 2023 -0800
@@ -37,6 +37,7 @@
 	UI_RELOAD,
 	UI_SMS_PAUSE,
 	UI_SCREENSHOT,
+	UI_RECORD_VIDEO,
 	UI_VGM_LOG,
 	UI_EXIT,
 	UI_PLANE_DEBUG,
@@ -413,6 +414,16 @@
 				render_save_screenshot(path);
 			}
 			break;
+		case UI_RECORD_VIDEO:
+			if (allow_content_binds) {
+				if (render_saving_video()) {
+					render_end_video();
+				} else {
+					char *path = get_content_config_path("ui\0video_path\0", "ui\0video_template\0", "blastem_%c.apng");
+					render_save_video(path);
+				}
+			}
+			break;
 		case UI_VGM_LOG:
 			if (allow_content_binds && current_system->start_vgm_log) {
 				if (current_system->vgm_logging) {
@@ -678,6 +689,8 @@
 			*subtype_a = UI_SMS_PAUSE;
 		} else if (!strcmp(target + 3, "screenshot")) {
 			*subtype_a = UI_SCREENSHOT;
+		} else if (!strcmp(target + 3, "record_video")) {
+			*subtype_a = UI_RECORD_VIDEO;
 		} else if (!strcmp(target + 3, "vgm_log")) {
 			*subtype_a = UI_VGM_LOG;
 		} else if(!strcmp(target + 3, "exit")) {