2017-09-20 08:42:57 -07:00
|
|
|
// Copyright © 2017 Project Golan, all rights reserved.
|
2017-10-04 17:14:46 -07:00
|
|
|
// See COPYING for more information.
|
2017-09-20 08:42:57 -07:00
|
|
|
#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) \
|
2017-10-04 19:28:04 -07:00
|
|
|
__prop name {__get: DGE_Object_MemberGetT(t, ->id, ofs), \
|
|
|
|
__set: DGE_Object_MemberSetT(t, ->id, ofs, __arg)}
|
2017-09-20 08:42:57 -07:00
|
|
|
|
2017-10-04 19:28:04 -07:00
|
|
|
#define G_propMemGEM(cl, t, name) \
|
|
|
|
G_propMemOfs(DGE_OME(cl##.##name), t, name)
|
2017-10-04 02:07:02 -07:00
|
|
|
|
2017-10-04 19:28:04 -07:00
|
|
|
#define G_propMemIEM(cl, ofs, t, name) \
|
|
|
|
G_propMemOfs(DGE_OME_##cl + (ofs), t, name)
|
|
|
|
|
|
|
|
#define G_Entity_propMem(ofs, t, name) \
|
|
|
|
G_propMemIEM(Entity, ofs, t, name)
|
2017-09-20 08:42:57 -07:00
|
|
|
|
2017-10-04 02:07:02 -07:00
|
|
|
#define G_RenderThinker_propMem(ofs, t, name) \
|
2017-10-04 19:28:04 -07:00
|
|
|
G_propMemIEM(RenderThinker, ofs, t, name)
|
2017-10-04 02:07:02 -07:00
|
|
|
|
|
|
|
#define G_RenderThinker_propExt() \
|
2017-10-04 19:28:04 -07:00
|
|
|
G_propMemGEM(RenderThinker, unsigned, frame) \
|
|
|
|
G_propMemGEM(RenderThinker, unsigned, ftime) \
|
|
|
|
G_propMemGEM(RenderThinker, G_anima const *, curanim) \
|
2017-10-04 02:07:02 -07:00
|
|
|
__prop animate {__call: G_RenderThinker_Animate(->id)} \
|
|
|
|
__prop setAnim {__call: G_RenderThinker_AnimSet(->id)} \
|
|
|
|
__prop fsetAnim {__call: G_RenderThinker_AnimSetForced(->id)}
|
|
|
|
|
|
|
|
#define G_Entity_propExt() \
|
2017-10-04 19:28:04 -07:00
|
|
|
G_propMemGEM(Entity, int, subtype)
|
2017-10-04 02:07:02 -07:00
|
|
|
|
|
|
|
// Extern Functions ----------------------------------------------------------|
|
|
|
|
|
|
|
|
void G_RenderThinker_Animate(unsigned id);
|
|
|
|
void G_RenderThinker_AnimSet(unsigned id, G_anima const *anim);
|
|
|
|
void G_RenderThinker_AnimSetForced(unsigned id, G_anima const *anim);
|
2017-09-20 08:42:57 -07:00
|
|
|
|
|
|
|
// Types ---------------------------------------------------------------------|
|
|
|
|
|
2017-09-27 18:51:40 -07:00
|
|
|
enum G_subty
|
|
|
|
{
|
|
|
|
subtype_none,
|
2017-09-29 04:50:36 -07:00
|
|
|
subtype_missile,
|
|
|
|
subtype_test,
|
2017-09-27 18:51:40 -07:00
|
|
|
subtype_player,
|
|
|
|
subtype_max,
|
|
|
|
};
|
|
|
|
|
2017-10-04 02:07:02 -07:00
|
|
|
#define G_RenderThinker_props() DGE_RenderThinkerProps() \
|
|
|
|
G_RenderThinker_propExt()
|
|
|
|
typedef struct G_rthnk // Render Thinker
|
|
|
|
{
|
|
|
|
int id;
|
|
|
|
|
|
|
|
G_RenderThinker_props()
|
|
|
|
} G_rthnk;
|
|
|
|
|
2017-09-29 04:50:36 -07:00
|
|
|
#define G_Entity_props() DGE_EntityProps() \
|
2017-10-04 02:07:02 -07:00
|
|
|
G_RenderThinker_propExt() \
|
|
|
|
G_Entity_propExt()
|
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-29 04:50:36 -07:00
|
|
|
#define G_Missile_props() DGE_MissileEntityProps() \
|
2017-10-04 02:07:02 -07:00
|
|
|
G_RenderThinker_propExt() \
|
|
|
|
G_Entity_propExt()
|
2017-09-29 04:50:36 -07:00
|
|
|
typedef struct G_missl // Missile
|
|
|
|
{
|
|
|
|
int id;
|
|
|
|
|
|
|
|
G_Missile_props()
|
|
|
|
} G_missl;
|
|
|
|
|
2017-09-27 18:47:18 -07:00
|
|
|
// Extern Functions ----------------------------------------------------------|
|
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
|