summaryrefslogtreecommitdiffhomepage
path: root/src/demorec.h
diff options
context:
space:
mode:
authorMichael Smith <mikesmiffy128@gmail.com>2023-07-29 14:32:06 +0100
committerMichael Smith <mikesmiffy128@gmail.com>2023-08-02 21:02:31 +0100
commit9a0d8730fa977f666b5c12e4c5901e7d0391e245 (patch)
tree87eebcdcef04ae1e7348ef80e972c08aa4783649 /src/demorec.h
parentd337b09936ecd90bad07b28b48b7103395d97ce5 (diff)
Make various preparations for upcoming features
A lot of this is random WIP from a while back, at least a month ago, and is being committed now to get it out of the way so that other patches can be brought in and integrated against it without causing headaches. Also rolled into this commit is a way to distinguish plugin_unload from exiting the game. This is required for another soon-to-be-integrated feature to avoid crashing on exit, and could in theory also be used to speed up unloading on exit in future. While we're at it, this also avoids the need to linearly scan through the plugin list to do the old branch unloading fix, because we can. Rough summary of the other smaller stuff I can remember doing: - Rework bitbuf a bit - Add some cryptographic nonsense in ac.c (not final at all) - Introduce the first couple of "chunklets" libraries as a sort-of subproject of this one - Tidy up random small bits and bobs - Add source for a small keypair generation tool - Rework democustom to be very marginally more useful
Diffstat (limited to 'src/demorec.h')
-rw-r--r--src/demorec.h25
1 files changed, 21 insertions, 4 deletions
diff --git a/src/demorec.h b/src/demorec.h
index 2de4f24..b53896f 100644
--- a/src/demorec.h
+++ b/src/demorec.h
@@ -52,21 +52,38 @@ bool demorec_start(const char *name);
/*
* Stops recording the current demo and returns the number of demos recorded
* (the first will have the original basename + .dem extension; the rest will
- * have the _N.dem suffixes).
+ * have the _N.dem suffixes). Value will be zero if the recording is stopped
+ * before the game has even gotten a chance to create the first demo file.
*/
int demorec_stop(void);
/*
- * Queries whether a demo is currently being recorded.
+ * Returns the current number in the recording sequence, or -1 if not recording.
+ * Value may be 0 if recording was requested but has yet to start (say, because
+ * we have yet to join a map).
*/
-bool demorec_recording(void);
+int demorec_demonum(void);
/*
* Used to determine whether to allow usage of the normal record and stop
* commands. Code which takes over control of demo recording can use this to
* block the user from interfering.
*/
-DECL_PREDICATE(AllowDemoControl)
+DECL_PREDICATE(DemoControlAllowed, void)
+
+/*
+ * Emitted whenever a recording session is about to be started, as a result of
+ * either the record command or a call to the demorec_start() function. A demo
+ * file won't actually have been created yet; this merely indicates that a
+ * request to record has happened.
+ */
+DECL_EVENT(DemoRecordStarting, void)
+
+/*
+ * Emitted when the current demo or series of demos has finished recording.
+ * Receives the number of recorded demo files (which could be 0) as an argument.
+ */
+DECL_EVENT(DemoRecordStopped, int)
#endif