| 112 | } |
| 113 | |
| 114 | void run(void *p_userdata) override { |
| 115 | GodotMonoDecompWrapper *wrapper = (GodotMonoDecompWrapper *)p_userdata; |
| 116 | if (wrapper->decompilerHandle == nullptr) { |
| 117 | ERR_PRINT("Decompiler handle is null"); |
| 118 | err = ERR_CANT_CREATE; |
| 119 | return; |
| 120 | } |
| 121 | CharString outputCSProjectPath_chrstr = outputCSProjectPath.utf8(); |
| 122 | const char *outputCSProjectPath_c = outputCSProjectPath_chrstr.get_data(); |
| 123 | Vector<CharString> excludeFiles_chrstrrs; |
| 124 | excludeFiles_chrstrrs.resize(excludeFiles.size()); |
| 125 | const char **excludeFiles_c_array = new const char *[excludeFiles.size()]; |
| 126 | for (int i = 0; i < excludeFiles.size(); i++) { |
| 127 | excludeFiles_chrstrrs.write[i] = excludeFiles[i].utf8(); |
| 128 | excludeFiles_c_array[i] = excludeFiles_chrstrrs[i].get_data(); |
| 129 | } |
| 130 | |
| 131 | int result = GodotMonoDecomp_DecompileModuleWithProgress(wrapper->decompilerHandle, outputCSProjectPath_c, excludeFiles_c_array, excludeFiles.size(), &DecompileModuleTaskData::_progress_callback, this); |
| 132 | delete[] excludeFiles_c_array; |
| 133 | if (result != 0 && !cancelled) { |
| 134 | err = ERR_CANT_CREATE; |
| 135 | } |
| 136 | } |
| 137 | |
| 138 | virtual ~DecompileModuleTaskData() = default; |
| 139 | }; |