mirror of
https://github.com/ganelson/inform.git
synced 2024-06-26 04:00:43 +03:00
Began beat filter functions
This commit is contained in:
parent
ddaf720eea
commit
3d53a40960
|
@ -1,6 +1,6 @@
|
|||
# Inform 7
|
||||
|
||||
[Version](notes/versioning.md): 10.2.0-beta+6V61 'Krypton' (15 September 2022)
|
||||
[Version](notes/versioning.md): 10.2.0-beta+6V62 'Krypton' (16 September 2022)
|
||||
|
||||
## About Inform
|
||||
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
Prerelease: beta
|
||||
Build Date: 15 September 2022
|
||||
Build Number: 6V61
|
||||
Build Date: 16 September 2022
|
||||
Build Number: 6V62
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"is": {
|
||||
"type": "kit",
|
||||
"title": "BasicInformExtrasKit",
|
||||
"version": "10.2.0-beta+6V61"
|
||||
"version": "10.2.0-beta+6V62"
|
||||
},
|
||||
"kit-details": {
|
||||
"has-priority": 1
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"is": {
|
||||
"type": "kit",
|
||||
"title": "BasicInformKit",
|
||||
"version": "10.2.0-beta+6V61"
|
||||
"version": "10.2.0-beta+6V62"
|
||||
},
|
||||
"needs": [ {
|
||||
"unless": {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"is": {
|
||||
"type": "kit",
|
||||
"title": "CommandParserKit",
|
||||
"version": "10.2.0-beta+6V61"
|
||||
"version": "10.2.0-beta+6V62"
|
||||
},
|
||||
"needs": [ {
|
||||
"need": {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"is": {
|
||||
"type": "kit",
|
||||
"title": "EnglishLanguageKit",
|
||||
"version": "10.2.0-beta+6V61"
|
||||
"version": "10.2.0-beta+6V62"
|
||||
},
|
||||
"needs": [ {
|
||||
"need": {
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"is": {
|
||||
"type": "kit",
|
||||
"title": "WorldModelKit",
|
||||
"version": "10.2.0-beta+6V61"
|
||||
"version": "10.2.0-beta+6V62"
|
||||
},
|
||||
"needs": [ {
|
||||
"need": {
|
||||
|
|
|
@ -959,6 +959,7 @@ void Hierarchy::establish(void) {
|
|||
@e INLINE_PROPERTIES_HAP
|
||||
@e INLINE_PROPERTY_HL
|
||||
@e DIRECTION_HL
|
||||
@e BEAT_FILTER_FN_HL
|
||||
|
||||
@<Establish instances@> =
|
||||
submodule_identity *instances = LargeScale::register_submodule_identity(I"instances");
|
||||
|
@ -1051,6 +1052,7 @@ void Hierarchy::establish(void) {
|
|||
H_F_G(REGION_FOUND_IN_FN_HL, I"region_found_in_fn", I"RFI_for_I")
|
||||
H_F_G(TSD_DOOR_DIR_FN_HL, I"tsd_door_dir_fn", I"TSD_door_dir_value")
|
||||
H_F_G(TSD_DOOR_TO_FN_HL, I"tsd_door_to_fn", I"TSD_door_to_value")
|
||||
H_F_G(BEAT_FILTER_FN_HL, I"beat_filter_fn", I"DB_filter")
|
||||
H_F_U(INST_SHOWME_FN_HL, I"showme_fn")
|
||||
H_BEGIN_AP(INLINE_PROPERTIES_HAP, I"inline_property", I"_inline_property")
|
||||
H_C_U(INLINE_PROPERTY_HL, I"inline")
|
||||
|
|
|
@ -9,14 +9,24 @@ Each |dialogue_beat| object contains this data:
|
|||
=
|
||||
typedef struct dialogue_beat_compilation_data {
|
||||
struct parse_node *where_created;
|
||||
struct inter_name *usage_filter_function;
|
||||
} dialogue_beat_compilation_data;
|
||||
|
||||
dialogue_beat_compilation_data RTDialogue::new_beat(parse_node *PN, dialogue_beat *db) {
|
||||
dialogue_beat_compilation_data dbcd;
|
||||
dbcd.where_created = PN;
|
||||
dbcd.usage_filter_function = NULL;
|
||||
|
||||
return dbcd;
|
||||
}
|
||||
|
||||
inter_name *RTDialogue::beat_filter(dialogue_beat *db) {
|
||||
if (db->compilation_data.usage_filter_function == NULL)
|
||||
db->compilation_data.usage_filter_function =
|
||||
Hierarchy::make_iname_in(BEAT_FILTER_FN_HL, RTInstances::package(db->as_instance));
|
||||
return db->compilation_data.usage_filter_function;
|
||||
}
|
||||
|
||||
@h Compilation data for dialogue lines.
|
||||
Each |dialogue_line| object contains this data:
|
||||
|
||||
|
@ -69,8 +79,62 @@ void RTDialogue::beat_compilation_agent(compilation_subtask *ct) {
|
|||
LOG("Beat %d = %W name '%W' scene '%W'\n",
|
||||
db->allocation_id, Node::get_text(current_sentence), db->beat_name, db->scene_name);
|
||||
RTDialogue::log_r(db->root);
|
||||
packaging_state save = Functions::begin(RTDialogue::beat_filter(db));
|
||||
local_variable *latest = LocalVariables::new_internal_commented(I"latest", I"most recently performed beat");
|
||||
LocalVariables::set_kind(latest, K_dialogue_beat);
|
||||
local_variable *pool = LocalVariables::new_internal_commented(I"pool", I"pool of live topics");
|
||||
inter_symbol *latest_s = LocalVariables::declare(latest);
|
||||
inter_symbol *pool_s = LocalVariables::declare(pool);
|
||||
if (db->immediately_after) {
|
||||
EmitCode::inv(IF_BIP);
|
||||
EmitCode::down();
|
||||
EmitCode::inv(NE_BIP);
|
||||
EmitCode::down();
|
||||
EmitCode::val_symbol(K_value, latest_s);
|
||||
EmitCode::val_number(0);
|
||||
EmitCode::up();
|
||||
EmitCode::code();
|
||||
EmitCode::down();
|
||||
@<Return true if latest matches the immediately after description@>;
|
||||
EmitCode::rfalse();
|
||||
EmitCode::up();
|
||||
EmitCode::up();
|
||||
}
|
||||
EmitCode::inv(STORE_BIP);
|
||||
EmitCode::down();
|
||||
EmitCode::ref_symbol(K_value, pool_s);
|
||||
EmitCode::val_number(0);
|
||||
EmitCode::up();
|
||||
EmitCode::rfalse();
|
||||
Functions::end(save);
|
||||
}
|
||||
|
||||
@<Return true if latest matches the immediately after description@> =
|
||||
EmitCode::inv(IF_BIP);
|
||||
EmitCode::down();
|
||||
LOG("IA cond is $T\n", db->immediately_after);
|
||||
instance *I = Rvalues::to_instance(db->immediately_after);
|
||||
if (I) {
|
||||
EmitCode::inv(EQ_BIP);
|
||||
EmitCode::down();
|
||||
EmitCode::val_symbol(K_value, latest_s);
|
||||
EmitCode::val_iname(K_dialogue_beat, RTInstances::value_iname(I));
|
||||
EmitCode::up();
|
||||
} else {
|
||||
pcalc_prop *prop = Descriptions::to_proposition(db->immediately_after);
|
||||
if (prop) {
|
||||
CompilePropositions::to_test_as_condition(Lvalues::new_LOCAL_VARIABLE(EMPTY_WORDING, latest), prop);
|
||||
} else {
|
||||
internal_error("cannot test");
|
||||
}
|
||||
}
|
||||
EmitCode::code();
|
||||
EmitCode::down();
|
||||
EmitCode::rtrue();
|
||||
EmitCode::up();
|
||||
EmitCode::up();
|
||||
|
||||
@ =
|
||||
void RTDialogue::line_compilation_agent(compilation_subtask *ct) {
|
||||
dialogue_line *dl = RETRIEVE_POINTER_dialogue_line(ct->data);
|
||||
current_sentence = dl->compilation_data.where_created;
|
||||
|
|
Loading…
Reference in a new issue