[Change] Compressed the debug messages.
This commit is contained in:
parent
e87f160e23
commit
ddadb068fe
@ -266,7 +266,7 @@ int factions_load(void) {
|
||||
free(buf);
|
||||
xmlCleanupParser();
|
||||
|
||||
DEBUG("Loaded %d faction%c", nfactions, (nfactions==1)?' ':'s');
|
||||
DEBUG("Loaded %d Faction%s", nfactions, (nfactions==1) ?"": "s");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -280,8 +280,6 @@ static Outfit* outfit_parse(const xmlNodePtr parent) {
|
||||
MELEMENT(tmp->type==0, "type");
|
||||
#undef MELEMENT
|
||||
|
||||
DEBUG("Loaded outfit '%s' of type '%s'", tmp->name, outfit_getType(tmp));
|
||||
|
||||
return tmp;
|
||||
}
|
||||
|
||||
@ -319,6 +317,9 @@ int outfit_load(void) {
|
||||
xmlFreeDoc(doc);
|
||||
free(buf);
|
||||
xmlCleanupParser();
|
||||
|
||||
DEBUG("Loaded %d outfit%s", outfits, (outfits==1) ? "" : "s");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -166,9 +166,7 @@ static Ship* ship_parse(xmlNodePtr parent) {
|
||||
MELEMENT(tmp->cap_weapon==0, "cap_weapon");
|
||||
#undef MELEMENT
|
||||
|
||||
DEBUG("Loaded ship '%s'", tmp->name);
|
||||
return tmp;
|
||||
|
||||
}
|
||||
|
||||
int ships_load(void) {
|
||||
@ -205,6 +203,8 @@ int ships_load(void) {
|
||||
free(buf);
|
||||
xmlCleanupParser();
|
||||
|
||||
DEBUG("Loaded %d ship%s", ships, (ships==1) ? "" : "s");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
13
src/space.c
13
src/space.c
@ -36,8 +36,9 @@
|
||||
#define FLAG_ASTEROIDSSET (1<<2)
|
||||
#define FLAG_INTEFERENCESET (1<<3)
|
||||
|
||||
StarSystem* systems = NULL;
|
||||
static int nsystems = 0;
|
||||
StarSystem* systems = NULL; // Star system stack.
|
||||
static int nsystems = 0; // Number of star systems.
|
||||
static int nplanets = 0; // Total number of loaded planets - A little silly.
|
||||
StarSystem* cur_system = NULL; // Current star system.
|
||||
|
||||
// Current stardate in nice format.
|
||||
@ -52,7 +53,7 @@ typedef struct Star_ {
|
||||
|
||||
static Star* stars = NULL; // Star array.
|
||||
static int nstars = 0; // Total stars.
|
||||
static int mstars = 0;
|
||||
static int mstars = 0; // Memory stars are taking.
|
||||
|
||||
// Intern
|
||||
static Planet* planet_get(const char* name);
|
||||
@ -390,6 +391,7 @@ static StarSystem* system_parse(const xmlNodePtr parent) {
|
||||
cur = node->children;
|
||||
do {
|
||||
if(xml_isNode(cur, "planet")) {
|
||||
nplanets++; // Increase planet counter.
|
||||
planet = planet_get(xml_get(cur));
|
||||
planet = planet_get((const char*)cur->children->content);
|
||||
tmp->planets = realloc(tmp->planets, sizeof(Planet)*(++tmp->nplanets));
|
||||
@ -430,7 +432,6 @@ static StarSystem* system_parse(const xmlNodePtr parent) {
|
||||
MELEMENT(flags&FLAG_ASTEROIDSSET, "asteroids"); // Can be 0.
|
||||
MELEMENT(flags&FLAG_INTEFERENCESET, "inteference");
|
||||
#undef MELEMENT
|
||||
DEBUG("Loaded Star System '%s' with %d Planet%c", tmp->name, tmp->nplanets, (tmp->nplanets == 1) ? ' ' : 's');
|
||||
|
||||
return tmp;
|
||||
}
|
||||
@ -517,6 +518,10 @@ int space_load(void) {
|
||||
free(buf);
|
||||
xmlCleanupParser();
|
||||
|
||||
DEBUG("Loaded %d star system%s with %d planet%s",
|
||||
nsystems, (nsystems==1) ? "" : "s",
|
||||
nplanets, (nplanets==1) ? "" : "s");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user