2021-05-02 01:16:45 +03:00
|
|
|
[SynopticMultimedia::] Multimedia.
|
|
|
|
|
2021-05-05 14:24:08 +03:00
|
|
|
To compile the main/synoptic/multimedia submodule.
|
2021-05-02 01:16:45 +03:00
|
|
|
|
2022-01-07 01:10:15 +02:00
|
|
|
@ Our inventory |inv| already contains a list |inv->figure_nodes| of all packages
|
|
|
|
in the tree with type |_instance| which are of the kind |K_figure_name|, and
|
|
|
|
similarly for sounds and files. (These do not have ID numbers here because they
|
|
|
|
already have |instance_id| values by virtue of being instances. Resource ID
|
|
|
|
numbers are a little different, and are pooled between sounds and figures:
|
|
|
|
these are assigned by the //inform7// compiler, not here.)
|
2021-05-02 01:16:45 +03:00
|
|
|
|
|
|
|
=
|
2021-11-15 01:40:33 +02:00
|
|
|
void SynopticMultimedia::compile(inter_tree *I, pipeline_step *step, tree_inventory *inv) {
|
2022-02-03 01:35:38 +02:00
|
|
|
if (InterNodeList::array_len(inv->figure_nodes) > 0)
|
|
|
|
InterNodeList::array_sort(inv->figure_nodes, MakeSynopticModuleStage::module_order);
|
|
|
|
if (InterNodeList::array_len(inv->sound_nodes) > 0)
|
|
|
|
InterNodeList::array_sort(inv->sound_nodes, MakeSynopticModuleStage::module_order);
|
|
|
|
if (InterNodeList::array_len(inv->file_nodes) > 0)
|
|
|
|
InterNodeList::array_sort(inv->file_nodes, MakeSynopticModuleStage::module_order);
|
2022-11-04 00:56:50 +02:00
|
|
|
if (InterNodeList::array_len(inv->internal_file_nodes) > 0)
|
|
|
|
InterNodeList::array_sort(inv->internal_file_nodes, MakeSynopticModuleStage::module_order);
|
2021-05-05 14:24:08 +03:00
|
|
|
@<Define RESOURCEIDSOFFIGURES array@>;
|
|
|
|
@<Define RESOURCEIDSOFSOUNDS array@>;
|
|
|
|
@<Define NO_EXTERNAL_FILES@>;
|
|
|
|
@<Define TABLEOFEXTERNALFILES array@>;
|
2022-11-04 00:56:50 +02:00
|
|
|
@<Define NO_INTERNAL_FILES@>;
|
|
|
|
@<Define TABLEOFINTERNALFILES array@>;
|
2021-05-02 01:16:45 +03:00
|
|
|
}
|
|
|
|
|
2021-05-05 14:24:08 +03:00
|
|
|
@<Define RESOURCEIDSOFFIGURES array@> =
|
2022-01-16 01:49:25 +02:00
|
|
|
inter_name *iname = HierarchyLocations::iname(I, RESOURCEIDSOFFIGURES_HL);
|
2021-11-15 01:40:33 +02:00
|
|
|
Synoptic::begin_array(I, step, iname);
|
2021-05-05 14:24:08 +03:00
|
|
|
Synoptic::numeric_entry(0);
|
2022-02-03 01:35:38 +02:00
|
|
|
for (int i=0; i<InterNodeList::array_len(inv->figure_nodes); i++) {
|
2022-01-07 01:10:15 +02:00
|
|
|
inter_package *pack =
|
2022-03-01 02:41:22 +02:00
|
|
|
PackageInstruction::at_this_head(inv->figure_nodes->list[i].node);
|
2021-05-02 01:16:45 +03:00
|
|
|
inter_ti id = Metadata::read_numeric(pack, I"^resource_id");
|
2021-05-05 14:24:08 +03:00
|
|
|
Synoptic::numeric_entry(id);
|
2021-05-02 01:16:45 +03:00
|
|
|
}
|
2021-05-05 14:24:08 +03:00
|
|
|
Synoptic::numeric_entry(0);
|
|
|
|
Synoptic::end_array(I);
|
2021-05-02 01:16:45 +03:00
|
|
|
|
2021-05-05 14:24:08 +03:00
|
|
|
@<Define RESOURCEIDSOFSOUNDS array@> =
|
2022-01-16 01:49:25 +02:00
|
|
|
inter_name *iname = HierarchyLocations::iname(I, RESOURCEIDSOFSOUNDS_HL);
|
2021-11-15 01:40:33 +02:00
|
|
|
Synoptic::begin_array(I, step, iname);
|
2021-05-05 14:24:08 +03:00
|
|
|
Synoptic::numeric_entry(0);
|
2022-02-03 01:35:38 +02:00
|
|
|
for (int i=0; i<InterNodeList::array_len(inv->sound_nodes); i++) {
|
2022-01-07 01:10:15 +02:00
|
|
|
inter_package *pack =
|
2022-03-01 02:41:22 +02:00
|
|
|
PackageInstruction::at_this_head(inv->sound_nodes->list[i].node);
|
2021-05-02 01:16:45 +03:00
|
|
|
inter_ti id = Metadata::read_numeric(pack, I"^resource_id");
|
2021-05-05 14:24:08 +03:00
|
|
|
Synoptic::numeric_entry(id);
|
2021-05-02 01:16:45 +03:00
|
|
|
}
|
2021-05-05 14:24:08 +03:00
|
|
|
Synoptic::numeric_entry(0);
|
|
|
|
Synoptic::end_array(I);
|
2021-05-02 01:16:45 +03:00
|
|
|
|
|
|
|
@<Define NO_EXTERNAL_FILES@> =
|
2022-01-16 01:49:25 +02:00
|
|
|
inter_name *iname = HierarchyLocations::iname(I, NO_EXTERNAL_FILES_HL);
|
2022-02-03 01:35:38 +02:00
|
|
|
Produce::numeric_constant(I, iname, K_value, (inter_ti) InterNodeList::array_len(inv->file_nodes));
|
2021-05-02 01:16:45 +03:00
|
|
|
|
2021-05-05 14:24:08 +03:00
|
|
|
@<Define TABLEOFEXTERNALFILES array@> =
|
2022-01-07 01:10:15 +02:00
|
|
|
inter_name *iname =
|
2022-01-16 01:49:25 +02:00
|
|
|
HierarchyLocations::iname(I, TABLEOFEXTERNALFILES_HL);
|
2021-11-15 01:40:33 +02:00
|
|
|
Synoptic::begin_array(I, step, iname);
|
2021-05-05 14:24:08 +03:00
|
|
|
Synoptic::numeric_entry(0);
|
2022-02-03 01:35:38 +02:00
|
|
|
for (int i=0; i<InterNodeList::array_len(inv->file_nodes); i++) {
|
2022-03-01 02:41:22 +02:00
|
|
|
inter_package *pack = PackageInstruction::at_this_head(inv->file_nodes->list[i].node);
|
2022-03-01 00:24:58 +02:00
|
|
|
inter_symbol *vc_s = Metadata::required_symbol(pack, I"^file_value");
|
2021-05-05 14:24:08 +03:00
|
|
|
Synoptic::symbol_entry(vc_s);
|
2021-05-02 01:16:45 +03:00
|
|
|
}
|
2021-05-05 14:24:08 +03:00
|
|
|
Synoptic::numeric_entry(0);
|
|
|
|
Synoptic::end_array(I);
|
2022-11-04 00:56:50 +02:00
|
|
|
|
|
|
|
@<Define NO_INTERNAL_FILES@> =
|
|
|
|
inter_name *iname = HierarchyLocations::iname(I, NO_INTERNAL_FILES_HL);
|
|
|
|
Produce::numeric_constant(I, iname, K_value, (inter_ti) InterNodeList::array_len(inv->internal_file_nodes));
|
|
|
|
|
|
|
|
@<Define TABLEOFINTERNALFILES array@> =
|
|
|
|
inter_name *iname =
|
|
|
|
HierarchyLocations::iname(I, TABLEOFINTERNALFILES_HL);
|
|
|
|
Synoptic::begin_array(I, step, iname);
|
|
|
|
Synoptic::numeric_entry(0);
|
|
|
|
for (int i=0; i<InterNodeList::array_len(inv->internal_file_nodes); i++) {
|
|
|
|
inter_package *pack = PackageInstruction::at_this_head(inv->internal_file_nodes->list[i].node);
|
|
|
|
inter_symbol *vc_s = Metadata::required_symbol(pack, I"^file_value");
|
|
|
|
Synoptic::symbol_entry(vc_s);
|
|
|
|
}
|
|
|
|
Synoptic::numeric_entry(0);
|
|
|
|
Synoptic::end_array(I);
|