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

Function ListObjectsInLevel

editor/Erooms.cpp:3168–3203  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3166#include "mission.h"
3167
3168void ListObjectsInLevel(int *object_counts) {
3169 int i;
3170 object *objp;
3171
3172 for (i = 0; i < MAX_OBJECT_IDS; i++)
3173 object_counts[i] = 0;
3174
3175 for (i = 0, objp = Objects; i <= Highest_object_index; i++, objp++) {
3176 if (IS_GENERIC(objp->type))
3177 object_counts[objp->id]++;
3178 }
3179
3180 CheckError("\n Robots:\n");
3181 for (i = 0; i < MAX_OBJECT_IDS; i++) {
3182 if (object_counts[i] && (Object_info[i].type == OBJ_ROBOT))
3183 CheckError(" %2d\t%s\n", object_counts[i], Object_info[i].name);
3184 }
3185
3186 CheckError("\n Powerups:\n");
3187 for (i = 0; i < MAX_OBJECT_IDS; i++) {
3188 if (object_counts[i] && (Object_info[i].type == OBJ_POWERUP))
3189 CheckError(" %2d\t%s\n", object_counts[i], Object_info[i].name);
3190 }
3191
3192 CheckError("\n Buildings:\n");
3193 for (i = 0; i < MAX_OBJECT_IDS; i++) {
3194 if (object_counts[i] && (Object_info[i].type == OBJ_BUILDING))
3195 CheckError(" %2d\t%s\n", object_counts[i], Object_info[i].name);
3196 }
3197
3198 CheckError("\n Clutter:\n");
3199 for (i = 0; i < MAX_OBJECT_IDS; i++) {
3200 if (object_counts[i] && (Object_info[i].type == OBJ_CLUTTER))
3201 CheckError(" %2d\t%s\n", object_counts[i], Object_info[i].name);
3202 }
3203}
3204
3205#include "loadlevel.h"
3206

Callers 1

ListObjectsInAllLevelsFunction · 0.85

Calls 1

CheckErrorFunction · 0.85

Tested by

no test coverage detected