- int pc;
- const struct point_info *point_ptr;
- struct point_state *point_state;
- float observer_z;
- float unit_scale;
- float offset_x;
- float offset_y;
- char *mark_ptr;
-
- pc = POINT_COUNT;
- point_ptr = &point_table[0];
- point_state = &hs->hs_points[0];
- mark_ptr = &hs->hs_moved[0];
-
- while (--pc >= 0)
- {
- double pos_a;
- double pos_b;
- double pos_c;
- double pos_d;
- double az, bz, cz, dz;
- double sum_z;
- double ax, bx, cx, dx;
- double sum_x;
- double ay, by, cy, dy;
- double sum_y;
- double mul;
- int old_x;
- int old_y;
- int old_dep;
- double xf;
- double yf;
- int new_x;
- int new_y;
- int new_dep;
- int mov;
-
- pos_a = point_ptr->pg_a;
- pos_b = point_ptr->pg_b;
- pos_c = point_ptr->pg_c;
- pos_d = point_ptr->pg_d;
- point_ptr++;
- az = hs->hs_ref_az; bz = hs->hs_ref_bz; cz = hs->hs_ref_cz; dz = hs->hs_ref_dz;
- ax = hs->hs_ref_ax; bx = hs->hs_ref_bx; cx = hs->hs_ref_cx; dx = hs->hs_ref_dx;
- ay = hs->hs_ref_ay; by = hs->hs_ref_by; cy = hs->hs_ref_cy; dy = hs->hs_ref_dy;
- sum_z = pos_a * az + pos_b * bz + pos_c * cz + pos_d * dz;
- observer_z = hs->hs_observer_z;
- unit_scale = hs->hs_unit_scale;
- sum_x = pos_a * ax + pos_b * bx + pos_c * cx + pos_d * dx;
- sum_y = pos_a * ay + pos_b * by + pos_c * cy + pos_d * dy;
- mul = unit_scale / (observer_z - sum_z);
- offset_x = hs->hs_offset_x;
- offset_y = hs->hs_offset_y;
- old_x = point_state->new_x;
- old_y = point_state->new_y;
- old_dep = point_state->new_dep;
- xf = sum_x * mul + offset_x;
- yf = sum_y * mul + offset_y;
- new_x = (int)rint(xf);
- new_y = (int)rint(yf);
- new_dep = (int)floor(sum_z * -128.0) + 128;
- point_state->old_x = old_x;
- point_state->old_y = old_y;
- point_state->old_dep = old_dep;
- point_state->new_x = new_x;
- point_state->new_y = new_y;
- point_state->new_dep = new_dep;
- point_state++;
- mov = new_x != old_x || new_y != old_y || new_dep != old_dep;
- *mark_ptr = mov;
- mark_ptr++;
- }
+ double pos_a;
+ double pos_b;
+ double pos_c;
+ double pos_d;
+ double az, bz, cz, dz;
+ double sum_z;
+ double ax, bx, cx, dx;
+ double sum_x;
+ double ay, by, cy, dy;
+ double sum_y;
+ double mul;
+ int old_x;
+ int old_y;
+ int old_dep;
+ double xf;
+ double yf;
+ int new_x;
+ int new_y;
+ int new_dep;
+ int mov;
+
+ pos_a = point_ptr->pg_a;
+ pos_b = point_ptr->pg_b;
+ pos_c = point_ptr->pg_c;
+ pos_d = point_ptr->pg_d;
+ point_ptr++;
+ az = hs->hs_ref_az; bz = hs->hs_ref_bz; cz = hs->hs_ref_cz; dz = hs->hs_ref_dz;
+ ax = hs->hs_ref_ax; bx = hs->hs_ref_bx; cx = hs->hs_ref_cx; dx = hs->hs_ref_dx;
+ ay = hs->hs_ref_ay; by = hs->hs_ref_by; cy = hs->hs_ref_cy; dy = hs->hs_ref_dy;
+ sum_z = pos_a * az + pos_b * bz + pos_c * cz + pos_d * dz;
+ observer_z = hs->hs_observer_z;
+ unit_scale = hs->hs_unit_scale;
+ sum_x = pos_a * ax + pos_b * bx + pos_c * cx + pos_d * dx;
+ sum_y = pos_a * ay + pos_b * by + pos_c * cy + pos_d * dy;
+ mul = unit_scale / (observer_z - sum_z);
+ offset_x = hs->hs_offset_x;
+ offset_y = hs->hs_offset_y;
+ old_x = point_state->new_x;
+ old_y = point_state->new_y;
+ old_dep = point_state->new_dep;
+ xf = sum_x * mul + offset_x;
+ yf = sum_y * mul + offset_y;
+ new_x = (int)rint(xf);
+ new_y = (int)rint(yf);
+ new_dep = (int)floor(sum_z * -128.0) + 128;
+ point_state->old_x = old_x;
+ point_state->old_y = old_y;
+ point_state->old_dep = old_dep;
+ point_state->new_x = new_x;
+ point_state->new_y = new_y;
+ point_state->new_dep = new_dep;
+ point_state++;
+ mov = new_x != old_x || new_y != old_y || new_dep != old_dep;
+ *mark_ptr = mov;
+ mark_ptr++;