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

Method WriteActionFunctionCall

editor/DallasMainDlg.cpp:10759–10793  ·  view source on GitHub ↗

Writes out an action function call

Source from the content-addressed store, hash-verified

10757
10758// Writes out an action function call
10759void CDallasMainDlg::WriteActionFunctionCall(HTREEITEM action_node) {
10760 tTreeNodeData *data;
10761
10762 if (CurrentOutputFile == NULL || action_node == NULL)
10763 return;
10764
10765 data = (tTreeNodeData *)m_ScriptTree.GetItemData(action_node);
10766 if (data == NULL || data->type != ACTION_STATEMENT_NODE)
10767 return;
10768
10769 // Check Action ID validity
10770 if (data->ID < 0 || data->ID >= m_NumActions) {
10771 if (data->ID != DO_NOTHING_ID) {
10772 TabOver();
10773 O(("// ERROR: Invalid Action Function Encountered!!!"));
10774 }
10775 return;
10776 }
10777
10778 // Write out the function name
10779 TabOver();
10780 cfprintf(CurrentOutputFile, "%s(", m_ActionDatabase[data->ID].func);
10781
10782 // Write out the parameter arguments
10783 HTREEITEM param_node;
10784
10785 param_node = m_ScriptTree.GetChildItem(action_node);
10786 while (param_node != NULL) {
10787 WriteFunctionParameter(param_node);
10788 param_node = m_ScriptTree.GetNextSiblingItem(param_node);
10789 if (param_node != NULL)
10790 cfprintf(CurrentOutputFile, ", ");
10791 }
10792 O((");"));
10793}
10794
10795// Writes out an action function call
10796void CDallasMainDlg::WriteFunctionParameter(HTREEITEM param_node) {

Callers

nothing calls this directly

Calls 1

cfprintfFunction · 0.85

Tested by

no test coverage detected