| 100 | //============================================================================= |
| 101 | |
| 102 | void CallCreateSummaryFunction(const char* qname, DObject* runner, MapRecord* map, SummaryInfo* info, MapRecord* map2) |
| 103 | { |
| 104 | if (qname == nullptr || *qname == 0) return; // no level summary defined. |
| 105 | auto func = LookupFunction(qname); |
| 106 | auto s = func->Proto->ArgumentTypes.Size(); |
| 107 | auto at = func->Proto->ArgumentTypes.Data(); |
| 108 | if (s != 3 && s != 4) I_Error("Bad map-cutscene function %s. Must receive precisely three or four arguments.", qname); |
| 109 | if (at[0] != cutscene.runnerclasstype && at[1] != maprecordtype && at[2] != summaryinfotype && (s == 3 || at[3] == maprecordtype)) |
| 110 | I_Error("Bad cutscene function %s. Must receive ScreenJobRunner, MapRecord and SummaryInfo reference,", qname); |
| 111 | if (info) summaryinfo = *info; // must be copied to a persistent location. |
| 112 | else summaryinfo = {}; |
| 113 | VMValue val[] = { runner, map, &summaryinfo, map2 }; |
| 114 | VMCall(func, val, s, nullptr, 0); |
| 115 | } |
| 116 | |
| 117 | //============================================================================= |
| 118 | // |
no test coverage detected