omi-eikyo/src/g_object.h

57 lines
1.2 KiB
C
Raw Normal View History

2017-09-20 08:42:57 -07:00
// Copyright © 2017 Project Golan, all rights reserved.
#ifndef g_object_h
#define g_object_h
2017-09-27 18:47:18 -07:00
#include "g_objdef.h"
2017-09-20 08:42:57 -07:00
#include <Doominati.h>
2017-09-27 18:47:18 -07:00
#define G_propMemOfs(ofs, t, name) \
__prop name {__get: DGE_Object_MemberGet(t, ->id, ofs), \
__set: DGE_Object_MemberSet(t, ->id, ofs)}
2017-09-20 08:42:57 -07:00
2017-09-27 18:47:18 -07:00
#define G_propMemExt(base, ofs, t, name) \
G_propMemOfs(DGE_OME_##base + (ofs), t, name)
2017-09-20 08:42:57 -07:00
2017-09-27 18:47:18 -07:00
#define G_Entity_propMem(ofs, t, name) \
G_propMemExt(Entity, ofs, t, name)
2017-09-20 08:42:57 -07:00
2017-09-27 18:47:18 -07:00
#define G_Entity_props() DGE_EntityProps()
2017-09-20 08:42:57 -07:00
// Types ---------------------------------------------------------------------|
2017-09-27 18:47:18 -07:00
enum
2017-09-20 08:42:57 -07:00
{
2017-09-27 18:47:18 -07:00
G_Player_ammo,
G_Player_propN
};
2017-09-20 08:42:57 -07:00
2017-09-27 18:47:18 -07:00
typedef struct G_entit // Entity
2017-09-20 08:42:57 -07:00
{
2017-09-27 18:47:18 -07:00
int id;
G_Entity_props()
} G_entit;
2017-09-20 08:42:57 -07:00
2017-09-27 18:47:18 -07:00
#define G_Player_props() G_Entity_props() \
G_Entity_propMem(G_Player_ammo, unsigned, ammo)
typedef struct G_playr // Player
2017-09-20 08:42:57 -07:00
{
2017-09-27 18:47:18 -07:00
int id;
2017-09-20 08:42:57 -07:00
2017-09-27 18:47:18 -07:00
G_Player_props()
} G_playr;
2017-09-20 08:42:57 -07:00
2017-09-27 18:47:18 -07:00
// Extern Objects ------------------------------------------------------------|
extern int G_Player_Count;
2017-09-21 10:53:20 -07:00
2017-09-27 18:47:18 -07:00
// Extern Functions ----------------------------------------------------------|
2017-09-21 10:53:20 -07:00
2017-09-27 18:47:18 -07:00
DGE_Callback void G_Player_Think(unsigned id);
2017-09-21 10:53:20 -07:00
2017-09-23 12:43:54 -07:00
void G_Entity_Create(union G_mfdat *info);
void G_Sector_Create(union G_mfdat *info);
2017-09-20 08:42:57 -07:00
#endif