MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / DetermineScriptType

Function DetermineScriptType

editor/ScriptMassCompile.cpp:227–252  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

225}
226
227uint8_t DetermineScriptType(char *filename) {
228 CFILE *file;
229 file = cfopen(filename, "rt");
230 if (!file) {
231 return 255;
232 }
233
234 char buffer[4096];
235 bool done = false;
236 uint8_t script_type = ST_GAME;
237
238 cf_ReadString(buffer, 4096, file);
239 while (!(cfeof(file) || done)) {
240 if (strstr(buffer, "GetTriggerScriptID")) {
241 // we found it!
242 script_type = ST_LEVEL;
243 done = true;
244 }
245
246 cf_ReadString(buffer, 4096, file);
247 }
248
249 cfclose(file);
250
251 return script_type;
252}
253
254void CScriptMassCompile::BuildList(void) {
255 CCheckListBox *list = (CCheckListBox *)GetDlgItem(IDC_LIST);

Callers 4

Step2Method · 0.85
OnInitDialogMethod · 0.85
DoStuffMethod · 0.85

Calls 4

cfopenFunction · 0.85
cf_ReadStringFunction · 0.85
cfeofFunction · 0.85
cfcloseFunction · 0.85

Tested by

no test coverage detected