binding-of-isaac/src/structure.h

127 lines
2.3 KiB
C

#ifndef BACK_CONSTS_H
#define BACK_CONSTS_H
typedef struct imgs {
int len;
SDL_Texture** arr;
} imgs ;
typedef struct pt_2d {
double x;
double y;
double z;
} pt_2d ;
struct cube_0 {
int red; int green; int blue ;
double x;
double y;
double z;
double w;
double h;
double d;
double hz_angle ;
double vt_angle ;
} ;
typedef struct cube_0 cube_0 ;
typedef cube_0* cube ;
typedef struct teleporter {
cube_0 hitbox ;
int dest_chx ; // in the pool, these are offsets
int dest_chy ;
double dest_x ;
double dest_y ;
double dest_z ;
} teleporter ;
typedef struct entity {
cube_0* pos ;
void (*updatePos)(double x, double y, double z, double w, double h, double d, double hz_angle, double vt_angle, float dtime, cube_0* ret) ;
// act as velocity function
void (*onHit)(float dtime, int* hp, int* dmg, cube_0* ret) ;
// triggers when object is hit
void (*onDeath)(float dtime) ;
// triggers when <hitpoints> goes negative
int damage ;
int* hitpoints ;
} entity ;
struct room {
// (0, 0, 0) = bottom, left and down
int chunk_x ;
int chunk_y ;
cube_0* map ;
int map_size ;
teleporter* tps ;
int tps_size ;
entity* ents ;
int ent_len ;
int ent_memlen ;
} ;
typedef struct room room ;
struct cell {
int chx ;
int chy ;
room* area ;
struct cell* next ;
} ;
typedef struct cell cell ;
typedef struct cell* linkedList ;
struct hashtbl_0 {
int tabLength ;
int insertedElts ;
int maxInserted ;
linkedList* tab ;
} ;
typedef struct hashtbl_0 hashtbl_0 ;
typedef hashtbl_0* hashtbl ;
// ------------------------------------------------ //
extern double sim_time ;
extern imgs digits ;
extern imgs letters ;
extern double camx ;
extern double camy ;
extern double camz ;
extern double rot_hz ;
extern double rot_vt ;
extern double tan_fov ;
extern bool has_changed ;
extern hashtbl visited ;
extern room* current_room ;
extern int player_chx ;
extern int player_chy ;
extern int* drawOrder ;
extern int coins ;
extern int draw_type ;
extern double draw_constant ;
extern pt_2d** triangles_to_render ;
extern pt_2d** triangles_og_coords ;
extern double* triangles_areas;
extern int triangles_i ;
extern int player_hp ;
extern int fade_dmg ;
#endif