summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-01-11 17:19:24 -0800
committerVito Caputo <vcaputo@pengaru.com>2023-01-11 22:31:31 -0800
commit83e41d07fa1e219da55c26efe4fbe4ca4045362a (patch)
tree9cf71f93f2c237fb4dfa42f9b3dfc613e43b28ee
parent4e081c5cc71365378afca5271f7b461516725a77 (diff)
modules/compose: omit experimental and hermetic modules
This only omits the modules from the random layers Note the texture_values list is enumerated in compose_setup, so there's no corresponding change needed there. It might make sense to change that to a runtime-discovered list though, I think that was done in the pre-flags era.
-rw-r--r--src/modules/compose/compose.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/modules/compose/compose.c b/src/modules/compose/compose.c
index 92f6fd2..f3a1442 100644
--- a/src/modules/compose/compose.c
+++ b/src/modules/compose/compose.c
@@ -178,12 +178,18 @@ static char * compose_random_layers_setting(unsigned seed)
til_get_modules(&modules, &n_modules);
for (size_t i = 0; i < n_modules; i++) {
+ if ((modules[i]->flags & (TIL_MODULE_HERMETIC | TIL_MODULE_EXPERIMENTAL)))
+ continue;
+
if (modules[i]->flags & TIL_MODULE_OVERLAYABLE)
n_overlayable++;
}
base_idx = rand_r(&seed) % (n_modules - n_overlayable);
for (size_t i = 0, j = 0; !layers && i < n_modules; i++) {
+ if ((modules[i]->flags & (TIL_MODULE_HERMETIC | TIL_MODULE_EXPERIMENTAL)))
+ continue;
+
if (modules[i]->flags & TIL_MODULE_OVERLAYABLE)
continue;
@@ -201,6 +207,9 @@ static char * compose_random_layers_setting(unsigned seed)
size_t rand_idx = rand_r(&seed) % n_overlayable;
for (size_t i = 0, j = 0; i < n_modules; i++) {
+ if ((modules[i]->flags & (TIL_MODULE_HERMETIC | TIL_MODULE_EXPERIMENTAL)))
+ continue;
+
if (!(modules[i]->flags & TIL_MODULE_OVERLAYABLE))
continue;
© All Rights Reserved