| static int LoadEnvelope2(CompileContext *ctx, FILE *f) | static int LoadEnvelope2(CompileContext *ctx, FILE *f) | ||||
| { | { | ||||
| int ix, ix2; | |||||
| int displ; | int displ; | ||||
| int n_points; | int n_points; | ||||
| char line_buf[128]; | char line_buf[128]; | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| if (n_points > 0) { | if (n_points > 0) { | ||||
| env_x[n_points] = env_x[n_points-1]; | env_x[n_points] = env_x[n_points-1]; | ||||
| env_y[n_points] = env_y[n_points-1]; | |||||
| } | |||||
| env_y[n_points] = env_y[n_points-1]; | |||||
| ix = 0; | |||||
| ix2 = 0; | |||||
| if (n_points > 0) for (int x = 0; x < ENV_LEN; x++) { | |||||
| int ix = 0; | |||||
| int ix2 = 0; | |||||
| for (int x = 0; x < ENV_LEN; x++) { | |||||
| if (n_points > 3 && x > env_x[ix+3]) | if (n_points > 3 && x > env_x[ix+3]) | ||||
| ix++; | ix++; | ||||
| if (n_points > 2 && x >= env_x[ix2+1]) | if (n_points > 2 && x >= env_x[ix2+1]) | ||||
| if (y > 255) y = 255; | if (y > 255) y = 255; | ||||
| env[x] = y; | env[x] = y; | ||||
| } | } | ||||
| } | |||||
| displ = ftell(ctx->f_phdata); | displ = ftell(ctx->f_phdata); | ||||
| fwrite(env, 1, ENV_LEN, ctx->f_phdata); | fwrite(env, 1, ENV_LEN, ctx->f_phdata); |