+ {
+ d = &pr_fielddefs[i];
+ name = PR_GetString(d->s_name);
+ if (name[strlen(name)-2] == '_')
+ continue; // skip _x, _y, _z vars
+ switch(d->type & ~DEF_SAVEGLOBAL)
+ {
+ case ev_string:
+ strlcat (tempstring, "string ", sizeof (tempstring));
+ break;
+ case ev_entity:
+ strlcat (tempstring, "entity ", sizeof (tempstring));
+ break;
+ case ev_function:
+ strlcat (tempstring, "function ", sizeof (tempstring));
+ break;
+ case ev_field:
+ strlcat (tempstring, "field ", sizeof (tempstring));
+ break;
+ case ev_void:
+ strlcat (tempstring, "void ", sizeof (tempstring));
+ break;
+ case ev_float:
+ strlcat (tempstring, "float ", sizeof (tempstring));
+ break;
+ case ev_vector:
+ strlcat (tempstring, "vector ", sizeof (tempstring));
+ break;
+ case ev_pointer:
+ strlcat (tempstring, "pointer ", sizeof (tempstring));
+ break;
+ default:
+ snprintf (tempstring2, sizeof (tempstring2), "bad type %i ", d->type & ~DEF_SAVEGLOBAL);
+ strlcat (tempstring, tempstring2, sizeof (tempstring));
+ break;
+ }
+ if (strlen(name) > 256)
+ {
+ strncpy(tempstring2, name, 256);
+ tempstring2[256] = tempstring2[257] = tempstring2[258] = '.';
+ tempstring2[259] = 0;
+ name = tempstring2;
+ }
+ strcat (tempstring, name);
+ for (j = strlen(name);j < 25;j++)
+ strcat(tempstring, " ");
+ snprintf (tempstring2, sizeof (tempstring2), "%5d", counts[i]);
+ strlcat (tempstring, tempstring2, sizeof (tempstring));
+ strlcat (tempstring, "\n", sizeof (tempstring));
+ if (strlen(tempstring) >= 4096)
+ {
+ Con_Printf("%s", tempstring);
+ tempstring[0] = 0;
+ }
+ if (counts[i])
+ {
+ used++;
+ usedamount += type_size[d->type & ~DEF_SAVEGLOBAL];
+ }
+ }
+ Mem_Free(counts);
+ Con_Printf("%i entity fields (%i in use), totalling %i bytes per edict (%i in use), %i edicts allocated, %i bytes total spent on edict fields (%i needed)\n", progs->entityfields, used, progs->entityfields * 4, usedamount * 4, sv.max_edicts, progs->entityfields * 4 * sv.max_edicts, usedamount * 4 * sv.max_edicts);