X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=nageru%2Fscene.h;h=8db75540559cfa29bf45611319e19380bb56fc1c;hb=5e9f3fe04e04a7c53a8e64106797e14e44fe9024;hp=32b3203410305dba14ae627122eee048eaa07459;hpb=87ca88abe461522ff7386ee179a87a2ba2f5012c;p=nageru diff --git a/nageru/scene.h b/nageru/scene.h index 32b3203..8db7554 100644 --- a/nageru/scene.h +++ b/nageru/scene.h @@ -88,7 +88,21 @@ struct Block { std::vector alternatives; // Must all have the same amount of inputs. Pointers to make things easier for Lua. std::vector inputs; // One for each input of alternatives[0] (ie., typically 0 or 1, occasionally 2). - std::vector disablers; // If any of these are disabled (IdentityEffect chosen), so should this one. + + // If any of these effects are disabled (IdentityEffect chosen) + // or enabled (not chosen) as determined by , so should this one. + struct Disabler { + Index block_idx; + enum { + DISABLE_IF_OTHER_DISABLED, + + // This a promise from the user; ie., we don't disable automatically + // (see comments in find_disabled_blocks()). + DISABLE_IF_OTHER_ENABLED + } condition; + std::string declaration_point; // For error messages. + }; + std::vector disablers; int currently_chosen_alternative = 0; // What alternative to use if the block is disabled. // Points to an alternative with IDENTITY_EFFECT if it exists @@ -115,6 +129,8 @@ struct Block { std::map float_parameters; std::map> vec3_parameters; std::map> vec4_parameters; + + std::string declaration_point; // For error messages. }; int Block_display(lua_State* L); @@ -123,6 +139,7 @@ int Block_enable(lua_State *L); int Block_enable_if(lua_State *L); int Block_disable(lua_State *L); int Block_always_disable_if_disabled(lua_State *L); +int Block_promise_to_disable_if_enabled(lua_State *L); int Block_set_int(lua_State *L); int Block_set_float(lua_State *L); int Block_set_vec3(lua_State *L);