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

Method DoStuff

editor/ScriptSyncDialog.cpp:330–447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

328void SS_CompileOutputCallback(char *str) { SS_CompileOutputData += str; }
329
330void CScriptSyncDialog::DoStuff(void) {
331 m_InStuff = true;
332 defer();
333
334 if (m_Index >= m_NumFiles) {
335 if (m_FillingIn) {
336 m_FillingIn = false;
337 m_Index = 0;
338 } else {
339 m_Done = true;
340 goto done;
341 }
342 }
343
344 if (m_FillingIn) {
345 char dllfilename[_MAX_PATH];
346
347 ddio_SplitPath(m_Files[m_Index].filename, NULL, dllfilename, NULL);
348 strcat(dllfilename, ".dll");
349
350 if (!cfexist(dllfilename)) {
351 m_Files[m_Index].state = STATE_MISSING;
352 } else {
353 if (IsScriptOutofSync(m_Files[m_Index].filename)) {
354 m_Files[m_Index].state = STATE_OOS;
355 } else if (IsScriptOutofDate(m_Files[m_Index].filename)) {
356 m_Files[m_Index].state = STATE_OOD;
357 } else
358 m_Files[m_Index].state = STATE_COMPILED;
359 }
360 m_List.AddItem(m_Files[m_Index].filename, m_Files[m_Index].state);
361 m_List.EnsureVisible(m_Index, false);
362 } else {
363 if (m_Files) {
364 switch (m_Files[m_Index].state) {
365 case STATE_COMPILED:
366 break;
367 case STATE_MISSING:
368 case STATE_OOD:
369 case STATE_OOS: {
370 char Compiler_path[_MAX_PATH];
371 int len = _MAX_PATH;
372
373 // attempt to recompile the script
374 // make sure there is a compiler defined
375 if (m_HasCompiler == -1) {
376 if (Database->read("EditorCompiler", Compiler_path, &len)) {
377 if (!cfexist(Compiler_path)) {
378 m_HasCompiler = 0;
379 } else {
380 m_HasCompiler = 1;
381 }
382 } else {
383 m_HasCompiler = 0;
384 }
385 }
386
387 if (m_HasCompiler) {

Callers

nothing calls this directly

Calls 12

cfexistFunction · 0.85
IsScriptOutofSyncFunction · 0.85
IsScriptOutofDateFunction · 0.85
DetermineScriptTypeFunction · 0.85
ScriptCompileFunction · 0.85
textaux_CopyTextLineFunction · 0.85
GetBufferMethod · 0.80
SetItemMethod · 0.80
ddio_SplitPathFunction · 0.50
AddItemMethod · 0.45
readMethod · 0.45
SelectItemMethod · 0.45

Tested by

no test coverage detected