Dumb-ways-to-memorize
2D game
|
Go to the source code of this file.
Functions | |
void | AddComplexMemToEnt (entity_t *ent, entity_members_complex_t member, void *value) |
void | ParseComplexMember (entity_t *ent, jsmntok_t *token, char *str, entity_members_complex_t member, int size) |
void | AddVector2Entity (entity_t *ent, entity_members_vector2_t member, vec2_t *value) |
void | AddSpritesToEnt (entity_t *ent, char **files, int size) |
entity_t * | ParseToEntity (object_t *object, char *str) |
Variables | |
char * | ComplexVariableNames [] |
char * | Vector2VariableNames [] |
char * | SimpleVariableNames [] |
Defines the enum for variables in the entity structure
Definition at line 12 of file parseentity.h.
Defines the enum for simple members in the entity
Definition at line 30 of file parseentity.h.
Defines the enum for variables in the entity struct with vec2_t values
Definition at line 21 of file parseentity.h.
void AddComplexMemToEnt | ( | entity_t * | ent, |
entity_members_complex_t | member, | ||
void * | value | ||
) |
Alias for a switch case that handles complex member to entity.
[in,out] | ent | If non-null, the ent. |
member | The member. | |
[in,out] | value | If non-null, the value. |
Definition at line 15 of file parseentity.c.
References ENTITY_MEMBER_COLLISION_TYPE, ENTITY_MEMBER_ENTITY_STATE, and ENTITY_MEMBER_HAZARDS.
Referenced by ParseComplexMember().
void AddSpritesToEnt | ( | entity_t * | ent, |
char ** | files, | ||
int | size | ||
) |
Loads and adds the sprite files given to the entity.
[in,out] | ent | If non-null, the ent. |
[in,out] | files | If non-null, an array of the strings with file names of the sprites. |
size | The size. |
Definition at line 49 of file parseentity.c.
References LoadSprite().
Referenced by ParseToEntity().
void AddVector2Entity | ( | entity_t * | ent, |
entity_members_vector2_t | member, | ||
vec2_t * | value | ||
) |
Adds a vector2 to the entity, which is a switch case similar to AddComplexMemToEnt.
[in,out] | ent | If non-null, the ent. |
member | The vector member to enters. | |
[in,out] | value | If non-null, the value of the vector. |
Definition at line 32 of file parseentity.c.
References ENTITY_MEMBER_ACCEL, ENTITY_MEMBER_POSITION, and ENTITY_MEMBER_VELOCITY.
Referenced by ParseToEntity().
void ParseComplexMember | ( | entity_t * | ent, |
jsmntok_t * | token, | ||
char * | str, | ||
entity_members_complex_t | member, | ||
int | size | ||
) |
Handles entering / converting complex members into the entity given.
[in,out] | ent | If non-null, the ent. |
[in,out] | token | If non-null, the token(s) to parse. |
[in,out] | str | If non-null, the global string to parse tokens from. |
member | The complex member associated with values given. | |
size | The amount of values to input. |
Definition at line 166 of file parseentity.c.
References AddComplexMemToEnt(), ENTITY_MEMBER_COLLISION_TYPE, ENTITY_MEMBER_ENTITY_STATE, ENTITY_MEMBER_HAZARDS, JsmnToString(), StrToCollisionType(), StrToEntityState(), and StrToHazard().
Referenced by ParseToEntity().
entity_t* ParseToEntity | ( | object_t * | object, |
char * | str | ||
) |
Parse to entity. Tries to Assign everything , and defaults all function pointers to generic. Current Frame = 0, Weight = 1
[in,out] | object | If non-null, the object. |
[in,out] | str | If non-null, the string. |
Definition at line 70 of file parseentity.c.
References AddSpritesToEnt(), AddVector2Entity(), ComplexVariableNames, CountMem(), DrawGeneric(), ENTITY_MEMBER_DAMAGE, ENTITY_MEMBER_FRAMES, ENTITY_MEMBER_HEALTH, ENTITY_MEMBER_HEIGHT, ENTITY_MEMBER_SPRITE, ENTITY_MEMBER_WIDTH, FindKey(), FindObject(), JsmnToInt(), JsmnToString(), LoadAnimation(), MAX_ANIMATIONS, ParseComplexMember(), ParseToVec2(), PrintEntity(), SimpleVariableNames, ThinkGeneric(), TouchGeneric(), and Vector2VariableNames.
Referenced by LoadEntityData().
char* ComplexVariableNames[] |
The complex variables which need more processing to parse
Definition at line 11 of file parseentity.c.
Referenced by ParseToEntity().
char* SimpleVariableNames[] |
The simple variables are there given values
Definition at line 13 of file parseentity.c.
Referenced by ParseToEntity().
char* Vector2VariableNames[] |
The variables which parse to vectors
Definition at line 12 of file parseentity.c.
Referenced by ParseToEntity().