AERMRE 1.5.1
AER modding framework for Hyper Light Drifter.
instance.h
Go to the documentation of this file.
1
20#ifndef AER_INSTANCE_H
21#define AER_INSTANCE_H
22
23#include <stdbool.h>
24#include <stddef.h>
25#include <stdint.h>
26
27/* ----- PUBLIC TYPES ----- */
28
36typedef void AERInstance;
37
43typedef union AERLocal {
44 bool b;
45 uint64_t u;
46 int64_t i;
47 float f;
48 double d;
49 void* p;
50} AERLocal;
51
52/* ----- PUBLIC FUNCTIONS ----- */
53
76size_t AERInstanceGetAll(size_t bufSize, AERInstance** instBuf);
77
106size_t AERInstanceGetByObject(int32_t objIdx,
107 bool recursive,
108 size_t bufSize,
109 AERInstance** instBuf);
110
126
143AERInstance* AERInstanceCreate(int32_t objIdx, float x, float y);
144
171void AERInstanceChange(AERInstance* inst, int32_t newObjIdx, bool doEvents);
172
187
202
216
228void AERInstanceSetDepth(AERInstance* inst, float depth);
229
242
262
276
294bool AERInstanceCompatibleWith(AERInstance* inst, int32_t objIdx);
295
309
321void AERInstanceSetDeactivated(AERInstance* inst, bool deactivated);
322
336
348void AERInstanceSetPersistent(AERInstance* inst, bool persistent);
349
366void AERInstanceGetPosition(AERInstance* inst, float* x, float* y);
367
382void AERInstanceSetPosition(AERInstance* inst, float x, float y);
383
400void AERInstanceAddPosition(AERInstance* inst, float x, float y);
401
424 float* left,
425 float* top,
426 float* right,
427 float* bottom);
428
446
460void AERInstanceSetFriction(AERInstance* inst, float friction);
461
478void AERInstanceGetMotion(AERInstance* inst, float* x, float* y);
479
494void AERInstanceSetMotion(AERInstance* inst, float x, float y);
495
510void AERInstanceAddMotion(AERInstance* inst, float x, float y);
511
525
541void AERInstanceSetMask(AERInstance* inst, int32_t maskIdx);
542
556
568void AERInstanceSetVisible(AERInstance* inst, bool visible);
569
583
596void AERInstanceSetSprite(AERInstance* inst, int32_t spriteIdx);
597
622
639void AERInstanceSetSpriteFrame(AERInstance* inst, float frame);
640
656
671void AERInstanceSetSpriteSpeed(AERInstance* inst, float speed);
672
686
700void AERInstanceSetSpriteAlpha(AERInstance* inst, float alpha);
701
715
727void AERInstanceSetSpriteAngle(AERInstance* inst, float angle);
728
745void AERInstanceGetSpriteScale(AERInstance* inst, float* x, float* y);
746
762void AERInstanceSetSpriteScale(AERInstance* inst, float x, float y);
763
778
791void AERInstanceSetSpriteBlend(AERInstance* inst, uint32_t color);
792
812
826void AERInstanceSetTangible(AERInstance* inst, bool tangible);
827
844int32_t AERInstanceGetAlarm(AERInstance* inst, uint32_t alarmIdx);
845
863 uint32_t alarmIdx,
864 int32_t numSteps);
865
894 size_t bufSize,
895 const char** nameBuf);
896
919
956 const char* name,
957 bool public,
958 void (*destructor)(AERLocal* local));
959
981 const char* name,
982 bool public);
983
1007 const char* name,
1008 bool public);
1009
1031 const char* name,
1032 bool public);
1033
1034#endif /* AER_INSTANCE_H */
int32_t AERInstanceGetObject(AERInstance *inst)
Query the object of an instance.
void AERInstanceSetSprite(AERInstance *inst, int32_t spriteIdx)
Set the sprite of an instance.
float AERInstanceGetSpriteAngle(AERInstance *inst)
Query the sprite offset angle of an instance.
bool AERInstanceGetTangible(AERInstance *inst)
Query the tangibility of an instance.
AERLocal * AERInstanceCreateModLocal(AERInstance *inst, const char *name, bool public, void(*destructor)(AERLocal *local))
Create a new mod local variable for an instance.
int32_t AERInstanceGetAlarm(AERInstance *inst, uint32_t alarmIdx)
Query the state of an alarm of an instance.
bool AERInstanceGetVisible(AERInstance *inst)
Query the visibility of an instance.
void AERInstanceAddMotion(AERInstance *inst, float x, float y)
Add to the existing motion of an instance.
float AERInstanceGetFriction(AERInstance *inst)
Query the friction of an instance.
void AERInstanceSetDeactivated(AERInstance *inst, bool deactivated)
Set the deactivation state of an instance.
void AERInstanceGetMotion(AERInstance *inst, float *x, float *y)
Query the motion of an instance.
float AERInstanceGetSpriteSpeed(AERInstance *inst)
Query the sprite animation speed of an instance.
void AERInstanceSetAlarm(AERInstance *inst, uint32_t alarmIdx, int32_t numSteps)
Set the state of an alarm of an instance.
float AERInstanceGetSpriteAlpha(AERInstance *inst)
Query the sprite alpha (transparency) of an instance.
AERLocal * AERInstanceGetModLocal(AERInstance *inst, const char *name, bool public)
Get a reference to a specific mod local variable of an instance.
void AERInstanceSetFriction(AERInstance *inst, float friction)
Set the friction of an instance.
AERInstance * AERInstanceGetById(int32_t instId)
Query the instance with a specific ID in the current room.
void AERInstanceSetTangible(AERInstance *inst, bool tangible)
Set the tangibility of an instance.
void AERInstance
Opaque type for instance of an object.
Definition: instance.h:36
void AERInstanceSetSpriteBlend(AERInstance *inst, uint32_t color)
Set the sprite blend color of an instance.
void AERInstanceAddPosition(AERInstance *inst, float x, float y)
Add to the existing position of an instance in the current room.
bool AERInstanceGetDeactivated(AERInstance *inst)
Query whether or not an instance is deactivated.
void AERInstanceSetSpriteAlpha(AERInstance *inst, float alpha)
Set the sprite alpha (transparency) of an instance.
bool AERInstanceCompatibleWith(AERInstance *inst, int32_t objIdx)
Query whether an instance's object is or inherits from another object.
AERLocal * AERInstanceGetHLDLocal(AERInstance *inst, const char *name)
Get a reference to a specific vanilla local variable of an instance.
void AERInstanceSetVisible(AERInstance *inst, bool visible)
Set the visibility of an instance.
size_t AERInstanceGetByObject(int32_t objIdx, bool recursive, size_t bufSize, AERInstance **instBuf)
Query all instances of an object in the current room.
bool AERInstanceGetPersistent(AERInstance *inst)
Query the persistence of an instance.
uint32_t AERInstanceGetSpriteBlend(AERInstance *inst)
Query the sprite blend color of an instance.
void AERInstanceGetBoundingBox(AERInstance *inst, float *left, float *top, float *right, float *bottom)
Query the axis-aligned bounding box of an instance.
void AERInstanceSetMotion(AERInstance *inst, float x, float y)
Set the motion of an instance.
void AERInstanceSetSpriteSpeed(AERInstance *inst, float speed)
Set the sprite animation speed of an instance.
size_t AERInstanceGetAll(size_t bufSize, AERInstance **instBuf)
Query all instances in the current room.
int32_t AERInstanceGetSprite(AERInstance *inst)
Query the sprite of an instance.
void AERInstanceSetMask(AERInstance *inst, int32_t maskIdx)
Set the collision mask of an instance.
float AERInstanceGetSpriteFrame(AERInstance *inst)
Query the current frame of sprite animation of an instance.
void AERInstanceSetSpriteScale(AERInstance *inst, float x, float y)
Set the sprite scale of an instance.
void AERInstanceSetSpriteFrame(AERInstance *inst, float frame)
Set the current frame of sprite animation of an instance.
AERLocal AERInstanceDeleteModLocal(AERInstance *inst, const char *name, bool public)
Destroy a mod local variable but do not call its destructor.
void AERInstanceDestroy(AERInstance *inst)
Destroy an instance and call its destroy event.
void AERInstanceSyncDepth(AERInstance *inst)
Set the render depth of an instance based on its position in the current room.
void AERInstanceGetSpriteScale(AERInstance *inst, float *x, float *y)
Query the sprite scale of an instance.
size_t AERInstanceGetHLDLocals(AERInstance *inst, size_t bufSize, const char **nameBuf)
Query the names of all vanilla local variables of an instance.
float AERInstanceGetDepth(AERInstance *inst)
Query the render depth of an instance.
void AERInstanceSetDepth(AERInstance *inst, float depth)
Set the render depth of an instance.
void AERInstanceSetPosition(AERInstance *inst, float x, float y)
Set the position of an instance in the current room.
void AERInstanceChange(AERInstance *inst, int32_t newObjIdx, bool doEvents)
Convert an instance of one object into an instance of another object in-place.
int32_t AERInstanceGetId(AERInstance *inst)
Query the ID of an instance.
void AERInstanceSetPersistent(AERInstance *inst, bool persistent)
Set the persistence of an instance.
int32_t AERInstanceGetMask(AERInstance *inst)
Query the collision mask of an instance.
void AERInstanceGetPosition(AERInstance *inst, float *x, float *y)
Query the position of an instance in the current room.
void AERInstanceDelete(AERInstance *inst)
Destroy an instance but do not call its destroy event.
void AERInstanceDestroyModLocal(AERInstance *inst, const char *name, bool public)
Destroy a mod local variable and call its destructor.
void AERInstanceSetSpriteAngle(AERInstance *inst, float angle)
Set the sprite offset angle of an instance.
AERInstance * AERInstanceCreate(int32_t objIdx, float x, float y)
Create an instance of an object.
A dynamic member variable of an instance.
Definition: instance.h:43