Browse Source

Account for Object API changes

master
Marrub 5 years ago
parent
commit
b0734bda05
  1. 22
      src/g_object.c
  2. 30
      src/g_object.h

22
src/g_object.c

@ -10,22 +10,6 @@
// Extern Functions ----------------------------------------------------------|
//
// G_Object_AnimGet
//
G_anima const *G_Object_AnimGet(unsigned id, unsigned ofs)
{
return (G_anima const *)DGE_Object_MemberGet(unsigned, id, ofs);
}
//
// G_Object_AnimSet
//
void G_Object_AnimSet(unsigned id, unsigned ofs, G_anima const *an)
{
DGE_Object_MemberSet(unsigned, id, ofs, (unsigned)an);
}
//
// G_RenderThinker_Animate
//
@ -90,8 +74,10 @@ void G_Entity_Create(G_mfdat *info)
ent.y = info->ent.y;
ent.z = info->ent.z;
ent.gravity = 1;
ent.mass = 1;
ent.gx = 1;
ent.gy = 1;
ent.gz = 1;
ent.mass = 1;
ent.friction = 0.875ulr;
if(type) {

30
src/g_object.h

@ -8,36 +8,34 @@
#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)}
__prop name {__get: DGE_Object_MemberGetT(t, ->id, ofs), \
__set: DGE_Object_MemberSetT(t, ->id, ofs, __arg)}
#define G_propMemFcn(ofs, fn, name) \
__prop name {__get: fn##Get(->id, ofs), \
__set: fn##Set(->id, ofs)}
#define G_propMemGEM(cl, t, name) \
G_propMemOfs(DGE_OME(cl##.##name), t, name)
#define G_propMemExt(base, ofs, t, name) \
G_propMemOfs(DGE_OME_##base + (ofs), t, name)
#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)
#define G_Entity_propMem(ofs, t, name) G_propMemExt(Entity, ofs, t, name)
#define G_RenderThinker_propMem(ofs, t, name) \
G_propMemExt(RenderThinker, ofs, t, name)
G_propMemIEM(RenderThinker, ofs, t, name)
#define G_RenderThinker_propExt() \
G_propMemOfs(DGE_OME(RenderThinker.frame), unsigned, frame) \
G_propMemOfs(DGE_OME(RenderThinker.ftime), unsigned, ftime) \
G_propMemFcn(DGE_OME(RenderThinker.curanim), G_Object_Anim, curanim) \
G_propMemGEM(RenderThinker, unsigned, frame) \
G_propMemGEM(RenderThinker, unsigned, ftime) \
G_propMemGEM(RenderThinker, G_anima const *, curanim) \
__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() \
G_propMemOfs(DGE_OME(Entity.subtype), int, subtype)
G_propMemGEM(Entity, int, subtype)
// Extern Functions ----------------------------------------------------------|
G_anima const *G_Object_AnimGet(unsigned id, unsigned ofs);
void G_Object_AnimSet(unsigned id, unsigned ofs, G_anima const *an);
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);

Loading…
Cancel
Save