int sol_load_lerp(struct s_lerp *fp, struct s_vary *vary) { int i; fp->vary = vary; if (fp->vary->mc) { fp->mv = calloc(fp->vary->mc, sizeof (*fp->mv)); fp->mc = fp->vary->mc; for (i = 0; i < fp->vary->mc; i++) fp->mv[i][CURR].pi = fp->vary->mv[i].pi; } if (fp->vary->uc) { fp->uv = calloc(fp->vary->uc, sizeof (*fp->uv)); fp->uc = fp->vary->uc; for (i = 0; i < fp->vary->uc; i++) { e_cpy(fp->uv[i][CURR].e, fp->vary->uv[i].e); v_cpy(fp->uv[i][CURR].p, fp->vary->uv[i].p); e_cpy(fp->uv[i][CURR].E, fp->vary->uv[i].E); fp->uv[i][CURR].r = fp->vary->uv[i].r; } } sol_lerp_copy(fp); return 1; }
void game_lerp_copy(struct game_lerp *gl) { sol_lerp_copy(&gl->lerp); gl->tilt[PREV] = gl->tilt[CURR]; gl->view[PREV] = gl->view[CURR]; gl->goal_k[PREV] = gl->goal_k[CURR]; gl->jump_dt[PREV] = gl->jump_dt[CURR]; }