- samples[4 * i + 0] = x;
- samples[4 * i + 1] = y;
- samples[4 * i + 2] = total_weight;
- samples[4 * i + 3] = 0.0f;
+ float pos1 = base_pos / (float)size;
+ float pos2 = (base_pos + 1) / (float)size;
+ float pos, total_weight;
+ combine_two_samples(w1, w2, pos1, pos2, size, &pos, &total_weight, NULL);
+
+ samples[2 * i + 0] = pos;
+ samples[2 * i + 1] = total_weight;