/// struct _FieldPoint_ and globals concerning the masses alive /* Everything to maintain the field, which is a wrapping matrix containing all mass pixels. It's a kind of map, and usually much bigger than the visible part of the screen. */ #ifndef __FIELD__ #define __FIELD__ /* FIXME: is this really needed? It's only for the struct mass, which is only referenced by pointer anyway... */ #include "mass.h" #include "fieldwrap.h" #include "fieldcells.h" #include "optimize.h" /* 10 bits ==> field of 1024x1024 pixels */ #define FIELDSIZE_BITS (10) #define FIELDSIZE (1<maxRect is altered (except if only shrinking). But since the only consequence is that GetMassesInRect() might still use the old position, calling it once at the end of the round should do. */ extern void MassPositionHasChanged(Mass * m); /* returns a list of masses that at least touch the rect r with their maxrect; the list must bee freed */ extern List * GetMassesInRect(Rect r); /* called from time to time to speed up the above */ extern void DistributePendingMasses(void); /* returns a list of all masses that are not frozen */ extern List * GetThawnMasses(void); /* all masses (except zombies) */ extern List * GetAllMasses(void); /* check wether the pointer is valid; for debugging only, it is slow */ extern int IsValidMass(Mass * m); /* Expensive! */ extern void DebugCheckField(void); /* calculate a quick checksum */ extern Uint8 NetworkChecksum(void); /* a quite expensive one */ extern Uint16 FullChecksum(void); extern void PrintFieldStatistics(void); // This transfers ownership of the mass (its memory will be freed in field.c) // Mass-enters-game actions go here. extern void AddMassToField(Mass * m); // Destroy a mass. It will be cleanly removed from the field immediately, and freed later. // Mass-leaves-game actions go here. extern void RemoveMassFromField(Mass * m); #endif