65 lines
1.3 KiB
C
65 lines
1.3 KiB
C
// Copyright © 2017 Project Golan, all rights reserved.
|
|
#ifndef g_object_h
|
|
#define g_object_h
|
|
|
|
#include "g_objdef.h"
|
|
|
|
#include <Doominati.h>
|
|
|
|
#define G_propMemOfs(ofs, t, name) \
|
|
__prop name {__get: DGE_Object_MemberGet(t, ->id, ofs), \
|
|
__set: DGE_Object_MemberSet(t, ->id, ofs)}
|
|
|
|
#define G_propMemExt(base, ofs, t, name) \
|
|
G_propMemOfs(DGE_OME_##base + (ofs), t, name)
|
|
|
|
#define G_Entity_propMem(ofs, t, name) \
|
|
G_propMemExt(Entity, ofs, t, name)
|
|
|
|
#define G_Entity_props() DGE_EntityProps() \
|
|
G_propMemOfs(DGE_OME(Entity.subtype), int, subtype)
|
|
|
|
// Types ---------------------------------------------------------------------|
|
|
|
|
enum G_subty
|
|
{
|
|
subtype_none,
|
|
subtype_player,
|
|
subtype_max,
|
|
};
|
|
|
|
enum
|
|
{
|
|
G_Player_ammo,
|
|
G_Player_propN
|
|
};
|
|
|
|
typedef struct G_entit // Entity
|
|
{
|
|
int id;
|
|
|
|
G_Entity_props()
|
|
} G_entit;
|
|
|
|
#define G_Player_props() G_Entity_props() \
|
|
G_Entity_propMem(G_Player_ammo, unsigned, ammo)
|
|
typedef struct G_playr // Player
|
|
{
|
|
int id;
|
|
|
|
G_Player_props()
|
|
} G_playr;
|
|
|
|
// Extern Objects ------------------------------------------------------------|
|
|
|
|
extern int G_Player_Count;
|
|
|
|
// Extern Functions ----------------------------------------------------------|
|
|
|
|
DGE_Callback void G_Player_Think(unsigned id);
|
|
|
|
void G_Entity_Create(union G_mfdat *info);
|
|
void G_Sector_Create(union G_mfdat *info);
|
|
|
|
#endif
|