Convert entity to a class
FossilOrigin-Name: 4b002822f954056510cbb1f85d7687784e26782f63c5995f01ac6488d0632d80
This commit is contained in:
parent
34b31eb77f
commit
d42f82f1ec
19 changed files with 222 additions and 122 deletions
15
src/cube.h
15
src/cube.h
|
@ -10,6 +10,7 @@
|
|||
|
||||
#define _MAXDEFSTR 260
|
||||
|
||||
@class Entity;
|
||||
@class DynamicEntity;
|
||||
|
||||
@interface Cube: OFObject <OFApplicationDelegate>
|
||||
|
@ -76,18 +77,6 @@ enum {
|
|||
MAXENTTYPES
|
||||
};
|
||||
|
||||
// map entity
|
||||
struct persistent_entity {
|
||||
short x, y, z; // cube aligned position
|
||||
short attr1;
|
||||
uchar type; // type is one of the above
|
||||
uchar attr2, attr3, attr4;
|
||||
};
|
||||
|
||||
struct entity: public persistent_entity {
|
||||
bool spawned; // the only dynamic state of a map entity
|
||||
};
|
||||
|
||||
#define MAPVERSION 5 // bump if map format changes, see worldio.cpp
|
||||
|
||||
// map file format header
|
||||
|
@ -264,7 +253,7 @@ extern DynamicEntity *player1;
|
|||
// all the other clients (in multiplayer)
|
||||
extern OFMutableArray *players;
|
||||
extern bool editmode;
|
||||
extern vector<entity> ents; // map entities
|
||||
extern OFMutableArray<Entity *> *ents; // map entities
|
||||
extern OFVector3D worldpos; // current target of the crosshair in the world
|
||||
extern int lastmillis; // last time
|
||||
extern int curtime; // current frame time
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue