\n
%s
\n", bsp->map.c_str(), bsp->map.c_str());
79 |
80 | fprintf(output, "
");
81 | for (it = bsp->index.begin(); it < bsp->index.end(); it++)
82 | {
83 | if (bsp->lump_reference.find((*it).id) != bsp->lump_reference.end() && (*it).size)
84 | {
85 | fprintf(output, "
%s ", (*it).id, LumpName[bsp->lump_reference[(*it).id]]);
86 | }
87 | }
88 | fprintf(output, "
\n");
89 | }
90 |
91 | unsigned int n = 0;
92 | for (it = bsp->index.begin(); it < bsp->index.end(); it++)
93 | {
94 | restore_cursor_position();
95 | printf("%3.0f%%", ceil(((float) n / bsp->index.size()) * 100.0f));
96 |
97 | if (bsp->lump_reference.find((*it).id) != bsp->lump_reference.end())
98 | {
99 | LumpReference reference = bsp->lump_reference[(*it).id];
100 | if ((*it).size && bsp->size(reference))
101 | {
102 | if (export_html)
103 | {
104 | fprintf(output, "
Lump %u - %s (%u)
", (*it).id, (*it).id, LumpName[reference], bsp->size(reference));
105 | bsp->write(output, reference);
106 | fprintf(output, "
");
107 | }
108 | else
109 | {
110 | fprintf(output, "Lump %u - %s (%u)\r\n", (*it).id, LumpName[reference], bsp->size(reference));
111 | bsp->write(output, reference);
112 | fprintf(output, "\r\n\r\n");
113 | }
114 | }
115 | }
116 | n++;
117 | }
118 |
119 | if (export_html)
120 | {
121 | fprintf(output, "
");
122 | }
123 | fclose(output);
124 | }
125 |
126 | restore_cursor_position();
127 | printf("100%%\n");
128 | }
129 |
130 | void write_lumps(BSP_Handle *bsp, const std::string &path, bool export_html)
131 | {
132 | printf("Exporting lumps...");
133 | retrieve_cursor_position();
134 |
135 | unsigned int n = 0;
136 | std::vector