1
0
Fork 0
mirror of https://github.com/ganelson/inform.git synced 2024-07-08 18:14:21 +03:00
inform7/inter/codegen-module/Chapter 6/Backdrops.w
2021-06-23 00:23:35 +01:00

42 lines
1.1 KiB
OpenEdge ABL

[IXBackdrops::] Backdrops.
Indexing the player's initial position.
@ Since backdrops are contained using different mechanisms, the following
adds backdrop contents to a room called |loc|, or lists backdrops which are
"everywhere" if |loc| is |NULL|.
=
void IXBackdrops::index_object_further(OUTPUT_STREAM, faux_instance *loc, int depth,
int details, int how) {
int discoveries = 0;
faux_instance *bd;
if (loc) {
LOOP_OVER_LINKED_LIST(bd, faux_instance, loc->backdrop_presences) {
if (++discoveries == 1) @<Insert fore-matter@>;
IXPhysicalWorld::index(OUT, bd, depth+1, details);
}
} else {
LOOP_OVER_BACKDROPS(bd)
if (bd->is_everywhere) {
if (++discoveries == 1) @<Insert fore-matter@>;
IXPhysicalWorld::index(OUT, bd, depth+1, details);
}
}
if (discoveries > 0) @<Insert after-matter@>;
}
@<Insert fore-matter@> =
switch (how) {
case 1: HTML_OPEN("p");
WRITE("<b>Present everywhere:</b>"); HTML_TAG("br"); break;
case 2: HTML_TAG("br"); break;
}
@<Insert after-matter@> =
switch (how) {
case 1: HTML_CLOSE("p"); HTML_TAG("hr"); HTML_OPEN("p"); break;
case 2: break;
}