summaryrefslogtreecommitdiff
path: root/src/modules/rkt
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-07-13 05:34:09 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-07-13 05:56:17 -0700
commit17990782709a52da6cd0aad02edd5cd4e4bc91af (patch)
tree10dcdcdb4dbf1cda9b1834400014666ce4571e1f /src/modules/rkt
parent468c78e30594310bed34d0d59b5544e4ef71f38e (diff)
modules/rkt: add 99999 exit scene define
rkt_scener needs to know this value so define it in rkt.h and switch over all the existing 99999 instances.
Diffstat (limited to 'src/modules/rkt')
-rw-r--r--src/modules/rkt/rkt.c9
-rw-r--r--src/modules/rkt/rkt.h2
2 files changed, 8 insertions, 3 deletions
diff --git a/src/modules/rkt/rkt.c b/src/modules/rkt/rkt.c
index a16d24f..02154b0 100644
--- a/src/modules/rkt/rkt.c
+++ b/src/modules/rkt/rkt.c
@@ -277,13 +277,16 @@ static void rkt_render_fragment(til_module_context_t *context, til_stream_t *str
if (scene < ctxt->n_scenes) {
til_module_render(ctxt->scenes[scene].module_ctxt, stream, ticks, fragment_ptr);
- } else if (scene == 99999 && !((rkt_setup_t *)context->setup)->connect && !ctxt->scener) {
+ } else if (scene == RKT_EXIT_SCENE_IDX &&
+ !((rkt_setup_t *)context->setup)->connect &&
+ !ctxt->scener) {
+
/* 99999 is treated as an "end of sequence" scene, but only honored when connect=off (player mode) */
til_stream_end(stream);
} else {
txt_t *msg = txt_newf("%s: %s @ %u [%s] [%s]",
context->setup->path,
- scene == 99999 ? "EXIT SCENE" : "NO SCENE",
+ scene == RKT_EXIT_SCENE_IDX ? "EXIT SCENE" : "NO SCENE",
scene,
((rkt_setup_t *)context->setup)->connect ? (ctxt->connected ? "ONLINE" : "OFFLINE") : "PLAYER",
ctxt->scener ? "SCENER" : "NOSCENER");
@@ -302,7 +305,7 @@ static void rkt_render_fragment(til_module_context_t *context, til_stream_t *str
}
if (scene < ctxt->n_scenes &&
- scene != 999999 &&
+ scene != RKT_EXIT_SCENE_IDX &&
((rkt_setup_t *)context->setup)->connect && !ctxt->connected) {
txt_t *msg = txt_newf("OFFLINE");
diff --git a/src/modules/rkt/rkt.h b/src/modules/rkt/rkt.h
index ae0fa64..241fa24 100644
--- a/src/modules/rkt/rkt.h
+++ b/src/modules/rkt/rkt.h
@@ -5,6 +5,8 @@
#include "til_module_context.h"
#include "til_settings.h"
+#define RKT_EXIT_SCENE_IDX 99999
+
typedef struct rkt_scener_t rkt_scener_t;
typedef struct rkt_scene_t {
© All Rights Reserved