Load the text (goal strings) for a level
| 1252 | #include "levelgoal.h" |
| 1253 | // Load the text (goal strings) for a level |
| 1254 | void LoadLevelText(const char *level_filename) { |
| 1255 | char pathname[_MAX_FNAME], filename[_MAX_FNAME]; |
| 1256 | int n_strings; |
| 1257 | ddio_SplitPath(level_filename, pathname, filename, NULL); |
| 1258 | strcat(pathname, filename); |
| 1259 | strcat(pathname, ".str"); |
| 1260 | char **goal_strings; |
| 1261 | if (CreateStringTable(pathname, &goal_strings, &n_strings)) { |
| 1262 | int n_goals = Level_goals.GetNumGoals(); |
| 1263 | ASSERT(n_strings == (n_goals * 3)); |
| 1264 | for (int i = 0; i < n_goals; i++) { |
| 1265 | Level_goals.GoalSetName(i, goal_strings[i * 3]); |
| 1266 | Level_goals.GoalSetItemName(i, goal_strings[i * 3 + 1]); |
| 1267 | Level_goals.GoalSetDesc(i, goal_strings[i * 3 + 2]); |
| 1268 | } |
| 1269 | DestroyStringTable(goal_strings, n_strings); |
| 1270 | } |
| 1271 | } |
| 1272 | |
| 1273 | /* loads a level and sets it as current level in mission |
| 1274 | */ |
no test coverage detected