Fix name conflict with linux stdlib

main
parent db7ce69b0e
commit 449b0a889a

@ -54,6 +54,11 @@
"stdint.h": "c", "stdint.h": "c",
"ipsettings.h": "c", "ipsettings.h": "c",
"cpvect.h": "c", "cpvect.h": "c",
"miniaudio.h": "c" "miniaudio.h": "c",
"bit": "c",
"condition_variable": "c",
"ctime": "c",
"limits": "c",
"xlocinfo": "c"
} }
} }

@ -75,7 +75,7 @@ bool cloaking_active(GameState *gs, Entity *e)
{ {
// cloaking doesn't work for first 1/2 second of game because when initializing // cloaking doesn't work for first 1/2 second of game because when initializing
// everything needs to be uncloaked // everything needs to be uncloaked
return time(gs) >= 0.5 && (time(gs) - e->time_was_last_cloaked) <= TIMESTEP * 2.0; return elapsed_time(gs) >= 0.5 && (elapsed_time(gs) - e->time_was_last_cloaked) <= TIMESTEP * 2.0;
} }
bool is_cloaked(GameState *gs, Entity *e, Entity *this_players_perspective) bool is_cloaked(GameState *gs, Entity *e, Entity *this_players_perspective)
@ -1684,7 +1684,7 @@ static void cloaking_shield_callback_func(cpShape *shape, cpContactPointSet *poi
GameState *gs = entitys_gamestate(from_cloaking_box); GameState *gs = entitys_gamestate(from_cloaking_box);
Entity *to_cloak = cp_shape_entity(shape); Entity *to_cloak = cp_shape_entity(shape);
to_cloak->time_was_last_cloaked = time(gs); to_cloak->time_was_last_cloaked = elapsed_time(gs);
to_cloak->last_cloaked_by_squad = from_cloaking_box->owning_squad; to_cloak->last_cloaked_by_squad = from_cloaking_box->owning_squad;
} }
@ -1824,7 +1824,7 @@ uint64_t tick(GameState *gs)
return gs->tick; return gs->tick;
} }
double time(GameState *gs) double elapsed_time(GameState *gs)
{ {
return ((double)gs->tick * TIMESTEP) + gs->subframe_time; return ((double)gs->tick * TIMESTEP) + gs->subframe_time;
} }
@ -2247,7 +2247,7 @@ void process(struct GameState *gs, double dt)
{ {
p->goldness += 0.1; p->goldness += 0.1;
p->damage = 0.0; p->damage = 0.0;
gs->goldpos = (cpVect){.x = hash11((float)time(gs)) * 20.0, .y = hash11((float)time(gs) - 13.6) * 20.0}; gs->goldpos = (cpVect){.x = hash11((float)elapsed_time(gs)) * 20.0, .y = hash11((float)elapsed_time(gs) - 13.6) * 20.0};
} }
#if 1 #if 1
cpVect world_hand_pos = get_world_hand_pos(gs, &player->input, p); cpVect world_hand_pos = get_world_hand_pos(gs, &player->input, p);

@ -426,7 +426,7 @@ void process_fixed_timestep(GameState *gs);
void process(struct GameState *gs, double dt); // does in place void process(struct GameState *gs, double dt); // does in place
Entity *closest_box_to_point_in_radius(struct GameState *gs, cpVect point, double radius, bool (*filter_func)(Entity *)); Entity *closest_box_to_point_in_radius(struct GameState *gs, cpVect point, double radius, bool (*filter_func)(Entity *));
uint64_t tick(struct GameState *gs); uint64_t tick(struct GameState *gs);
double time(GameState *gs); double elapsed_time(GameState *gs);
double sun_dist_no_gravity(Entity *sun); double sun_dist_no_gravity(Entity *sun);
// all of these return if successful or not // all of these return if successful or not

Loading…
Cancel
Save