43 int32_t *fourth_screen_vertex;
44 int32_t projection_state_or_face_flags_bits;
45 int32_t fourth_projection_y_q12;
46 int32_t fourth_screen_x;
50 int32_t vertex0_scale4_index = (uint16_t)(polygon_ref->
vertex_indices[0]);
51 int32_t vertex0_scale4_model_z = (int32_t)runtime_vertices[vertex0_scale4_index].pos.z;
52 int32_t vertex0_scale4_model_x = (int32_t)runtime_vertices[vertex0_scale4_index].pos.x;
53 int32_t vertex0_scale4_model_y = (int32_t)runtime_vertices[vertex0_scale4_index].pos.y;
59 (
float)((
long double)vertex0_scale4_view_x_fp * (
long double)0.015625f);
61 (
float)((
long double)vertex0_scale4_view_y_fp * (
long double)0.015625f);
63 (
float)((
long double)vertex0_scale4_view_z_fp * (
long double)0.015625f);
71 int32_t vertex0_scale4_focal_distance = vertex0_scale4_render_state->
focal_distance;
72 int32_t vertex0_scale4_perspective_scale =
73 ((int64_t)vertex0_scale4_focal_distance *
MATH_Q12_ONE) / vertex0_scale4_view_z_fp;
74 int64_t vertex0_scale4_projection_x_product = (int64_t)(int32_t)(vertex0_scale4_perspective_scale) * (int32_t)(vertex0_scale4_view_x_fp);
75 int32_t vertex0_scale4_screen_x =
76 (((int32_t)(uint32_t)((uint64_t)vertex0_scale4_projection_x_product >> 12)) >> 0xc) + (
Graphics_WindowWidth >> 1);
77 int64_t vertex0_scale4_projection_y_product = (int64_t)(int32_t)(vertex0_scale4_perspective_scale) * (int32_t)(vertex0_scale4_view_y_fp);
78 int32_t vertex0_scale4_screen_y =
79 (((int32_t)(uint32_t)((uint64_t)vertex0_scale4_projection_y_product >> 12)) >> 0xc) + (
Graphics_WindowHeight >> 1);
81 if (vertex0_scale4_screen_x != (int32_t)(int16_t)vertex0_scale4_screen_x || vertex0_scale4_screen_y != (int32_t)(int16_t)vertex0_scale4_screen_y)
90 int32_t vertex1_scale4_index = (uint16_t)(polygon_ref->
vertex_indices[1]);
91 int32_t vertex1_scale4_model_y = (int32_t)saved_runtime_vertices[vertex1_scale4_index].pos.y;
92 int32_t vertex1_x_scale4 =
93 (int32_t)saved_runtime_vertices[vertex1_scale4_index].pos.x;
94 int32_t vertex1_scale4_model_z = (int32_t)saved_runtime_vertices[vertex1_scale4_index].pos.z;
100 (
float)((
long double)vertex1_scale4_view_x_fp * (
long double)0.015625f);
103 (
float)((
long double)vertex1_scale4_view_y_fp * (
long double)0.015625f);
105 (
float)((
long double)vertex1_scale4_view_z_fp * (
long double)0.015625f);
113 int32_t vertex1_scale4_focal_distance = vertex1_scale4_render_state->
focal_distance;
114 int32_t vertex1_scale4_perspective_scale =
115 ((int64_t)vertex1_scale4_focal_distance *
MATH_Q12_ONE) / vertex1_scale4_view_z_fp;
116 int64_t vertex1_scale4_projection_x_product = (int64_t)(int32_t)(vertex1_scale4_perspective_scale) * (int32_t)(vertex1_scale4_view_x_fp);
117 int32_t vertex1_scale4_screen_x =
118 (((int32_t)(uint32_t)((uint64_t)vertex1_scale4_projection_x_product >> 12)) >> 0xc) + (
Graphics_WindowWidth >> 1);
119 int64_t vertex1_scale4_projection_y_product = (int64_t)(int32_t)(vertex1_scale4_perspective_scale) * (int32_t)(vertex1_scale4_view_y_fp);
120 int32_t vertex1_scale4_screen_y =
121 (((int32_t)(uint32_t)((uint64_t)vertex1_scale4_projection_y_product >> 12)) >> 0xc) + (
Graphics_WindowHeight >> 1);
123 if (vertex1_scale4_screen_x != (int32_t)(int16_t)vertex1_scale4_screen_x || vertex1_scale4_screen_y != (int32_t)(int16_t)vertex1_scale4_screen_y)
132 int32_t vertex2_scale4_index = (uint16_t)(polygon_ref->
vertex_indices[2]);
133 int32_t vertex2_scale4_model_y = (int32_t)saved_runtime_vertices[vertex2_scale4_index].pos.y;
134 int32_t vertex2_x_scale4 =
135 (int32_t)saved_runtime_vertices[vertex2_scale4_index].pos.x;
136 int32_t vertex2_scale4_model_z = (int32_t)saved_runtime_vertices[vertex2_scale4_index].pos.z;
144 (
float)((
long double)vertex2_scale4_view_x_fp * (
long double)0.015625f);
147 (
float)((
long double)vertex2_scale4_view_y_fp * (
long double)0.015625f);
149 (
float)((
long double)projection_state_or_face_flags_bits * (
long double)0.015625f);
155 if (projection_state_or_face_flags_bits > vertex2_scale4_render_state->
projection_near_fp)
157 int32_t vertex2_scale4_focal_distance = vertex2_scale4_render_state->
focal_distance;
158 int32_t vertex2_scale4_perspective_scale = ((int64_t)vertex2_scale4_focal_distance *
MATH_Q12_ONE) / projection_state_or_face_flags_bits;
159 int64_t vertex2_scale4_projection_x_product = (int64_t)(int32_t)(vertex2_scale4_perspective_scale) * (int32_t)(vertex2_scale4_view_x_fp);
160 int32_t vertex2_scale4_screen_x =
161 (((int32_t)(uint32_t)((uint64_t)vertex2_scale4_projection_x_product >> 12)) >> 0xc) + (
Graphics_WindowWidth >> 1);
162 int64_t vertex2_scale4_projection_y_product = (int64_t)(int32_t)(vertex2_scale4_perspective_scale) * (int32_t)(vertex2_scale4_view_y_fp);
164 projection_state_or_face_flags_bits =
165 (((int32_t)(uint32_t)((uint64_t)vertex2_scale4_projection_y_product >> 12)) >> 0xc) + (
Graphics_WindowHeight >> 1);
167 if (vertex2_scale4_screen_x != (int32_t)(int16_t)vertex2_scale4_screen_x || projection_state_or_face_flags_bits != (int32_t)(int16_t)projection_state_or_face_flags_bits)
183 int32_t vertex3_scale4_index = (uint16_t)(polygon_ref->
vertex_indices[3]);
184 int32_t vertex3_scale4_model_y = (int32_t)saved_runtime_vertices[vertex3_scale4_index].pos.y;
185 int32_t vertex3_x_scale4 =
186 (int32_t)saved_runtime_vertices[vertex3_scale4_index].pos.x;
187 int32_t vertex3_scale4_model_z = (int32_t)saved_runtime_vertices[vertex3_scale4_index].pos.z;
189 projection_state_or_face_flags_bits = ((
198 (
float)((
long double)vertex3_scale4_view_x_fp * (
long double)0.015625f);
201 (
float)((
long double)vertex3_scale4_view_y_fp * (
long double)0.015625f);
203 (
float)((
long double)projection_state_or_face_flags_bits * (
long double)0.015625f);
209 if (projection_state_or_face_flags_bits > vertex3_scale4_render_state->
projection_near_fp)
211 int32_t vertex3_scale4_focal_distance = vertex3_scale4_render_state->
focal_distance;
212 int32_t vertex3_scale4_perspective_scale = ((int64_t)vertex3_scale4_focal_distance *
MATH_Q12_ONE) / projection_state_or_face_flags_bits;
213 int64_t vertex3_scale4_projection_x_product = (int64_t)(int32_t)(vertex3_scale4_perspective_scale) * (int32_t)(vertex3_scale4_view_x_fp);
216 (((int32_t)(uint32_t)((uint64_t)vertex3_scale4_projection_x_product >> 12)) >> 0xc) + (
Graphics_WindowWidth >> 1);
218 int64_t vertex3_scale4_projection_y_product = (int64_t)(int32_t)(vertex3_scale4_perspective_scale) * (int32_t)(vertex3_scale4_view_y_fp);
220 fourth_projection_y_q12 = (int32_t)(uint32_t)((uint64_t)vertex3_scale4_projection_y_product >> 12);
222 projection_state_or_face_flags_bits = (fourth_projection_y_q12 >> 0xc) + (
Graphics_WindowHeight >> 1);
224 if (fourth_screen_x != (int32_t)(int16_t)fourth_screen_x || projection_state_or_face_flags_bits != (int32_t)(int16_t)projection_state_or_face_flags_bits)
237 fourth_screen_vertex = NULL;
241 int32_t vertex0_scale6_index = (uint16_t)(polygon_ref->
vertex_indices[0]);
242 int32_t vertex0_x_scale6 =
243 (int32_t)runtime_vertices[vertex0_scale6_index].pos.x;
244 struct Math_Vec3I16 *vertex0_scale6_position = &runtime_vertices[vertex0_scale6_index].
pos;
245 int32_t vertex0_scale6_model_z = (int32_t)vertex0_scale6_position->
z;
246 int32_t vertex0_scale6_model_y = (int32_t)vertex0_scale6_position->
y;
252 (
float)((
long double)vertex0_scale6_view_x_fp * (
long double)0.015625f);
255 (
float)((
long double)vertex0_scale6_view_y_fp * (
long double)0.015625f);
257 (
float)((
long double)vertex0_scale6_view_z_fp * (
long double)0.015625f);
265 int32_t vertex0_scale6_focal_distance = vertex0_scale6_render_state->
focal_distance;
266 int32_t vertex0_scale6_perspective_scale =
267 ((int64_t)vertex0_scale6_focal_distance *
MATH_Q12_ONE) / vertex0_scale6_view_z_fp;
268 int64_t vertex0_scale6_projection_x_product = (int64_t)(int32_t)(vertex0_scale6_perspective_scale) * (int32_t)(vertex0_scale6_view_x_fp);
269 int32_t vertex0_scale6_screen_x =
270 (((int32_t)(uint32_t)((uint64_t)vertex0_scale6_projection_x_product >> 12)) >> 0xc) + (
Graphics_WindowWidth >> 1);
271 int64_t vertex0_scale6_projection_y_product = (int64_t)(int32_t)(vertex0_scale6_perspective_scale) * (int32_t)(vertex0_scale6_view_y_fp);
272 int32_t vertex0_scale6_screen_y =
273 (((int32_t)(uint32_t)((uint64_t)vertex0_scale6_projection_y_product >> 12)) >> 0xc) + (
Graphics_WindowHeight >> 1);
275 if (vertex0_scale6_screen_x != (int32_t)(int16_t)vertex0_scale6_screen_x || vertex0_scale6_screen_y != (int32_t)(int16_t)vertex0_scale6_screen_y)
284 int32_t vertex1_scale6_index = (uint16_t)(polygon_ref->
vertex_indices[1]);
285 int32_t vertex1_scale6_model_y = (int32_t)saved_runtime_vertices[vertex1_scale6_index].pos.y;
286 int32_t vertex1_x_scale6 =
287 (int32_t)saved_runtime_vertices[vertex1_scale6_index].pos.x;
288 int32_t vertex1_scale6_model_z = (int32_t)saved_runtime_vertices[vertex1_scale6_index].pos.z;
294 (
float)((
long double)vertex1_scale6_view_x_fp * (
long double)0.015625f);
297 (
float)((
long double)vertex1_scale6_view_y_fp * (
long double)0.015625f);
299 (
float)((
long double)vertex1_scale6_view_z_fp * (
long double)0.015625f);
307 int32_t vertex1_scale6_focal_distance = vertex1_scale6_render_state->
focal_distance;
308 int32_t vertex1_scale6_perspective_scale =
309 ((int64_t)vertex1_scale6_focal_distance *
MATH_Q12_ONE) / vertex1_scale6_view_z_fp;
310 int64_t vertex1_scale6_projection_x_product = (int64_t)(int32_t)(vertex1_scale6_perspective_scale) * (int32_t)(vertex1_scale6_view_x_fp);
311 int32_t vertex1_scale6_screen_x =
312 (((int32_t)(uint32_t)((uint64_t)vertex1_scale6_projection_x_product >> 12)) >> 0xc) + (
Graphics_WindowWidth >> 1);
313 int64_t vertex1_scale6_projection_y_product = (int64_t)(int32_t)(vertex1_scale6_perspective_scale) * (int32_t)(vertex1_scale6_view_y_fp);
314 int32_t vertex1_scale6_screen_y =
315 (((int32_t)(uint32_t)((uint64_t)vertex1_scale6_projection_y_product >> 12)) >> 0xc) + (
Graphics_WindowHeight >> 1);
317 if (vertex1_scale6_screen_x != (int32_t)(int16_t)vertex1_scale6_screen_x || vertex1_scale6_screen_y != (int32_t)(int16_t)vertex1_scale6_screen_y)
326 int32_t vertex2_scale6_index = (uint16_t)(polygon_ref->
vertex_indices[2]);
327 int32_t vertex2_scale6_model_y = (int32_t)saved_runtime_vertices[vertex2_scale6_index].pos.y;
328 int32_t vertex2_x_scale6 =
329 (int32_t)saved_runtime_vertices[vertex2_scale6_index].pos.x;
330 int32_t vertex2_scale6_model_z = (int32_t)saved_runtime_vertices[vertex2_scale6_index].pos.z;
336 (
float)((
long double)vertex2_scale6_view_x_fp * (
long double)0.015625f);
339 (
float)((
long double)vertex2_scale6_view_y_fp * (
long double)0.015625f);
341 (
float)((
long double)vertex2_scale6_view_z_fp * (
long double)0.015625f);
349 int32_t vertex2_scale6_focal_distance = vertex2_scale6_render_state->
focal_distance;
350 int32_t vertex2_scale6_perspective_scale =
351 ((int64_t)vertex2_scale6_focal_distance *
MATH_Q12_ONE) / vertex2_scale6_view_z_fp;
352 int64_t vertex2_scale6_projection_x_product = (int64_t)(int32_t)(vertex2_scale6_perspective_scale) * (int32_t)(vertex2_scale6_view_x_fp);
353 int32_t vertex2_scale6_screen_x =
354 (((int32_t)(uint32_t)((uint64_t)vertex2_scale6_projection_x_product >> 12)) >> 0xc) + (
Graphics_WindowWidth >> 1);
355 int64_t vertex2_scale6_projection_y_product = (int64_t)(int32_t)(vertex2_scale6_perspective_scale) * (int32_t)(vertex2_scale6_view_y_fp);
356 int32_t vertex2_scale6_screen_y =
357 (((int32_t)(uint32_t)((uint64_t)vertex2_scale6_projection_y_product >> 12)) >> 0xc) + (
Graphics_WindowHeight >> 1);
359 if (vertex2_scale6_screen_x != (int32_t)(int16_t)vertex2_scale6_screen_x || vertex2_scale6_screen_y != (int32_t)(int16_t)vertex2_scale6_screen_y)
372 int32_t vertex3_scale6_index = (uint16_t)(polygon_ref->
vertex_indices[3]);
373 int32_t vertex3_scale6_model_y = (int32_t)saved_runtime_vertices[vertex3_scale6_index].pos.y;
374 int32_t vertex3_x_scale6 =
375 (int32_t)saved_runtime_vertices[vertex3_scale6_index].pos.x;
376 int32_t vertex3_scale6_model_z = (int32_t)saved_runtime_vertices[vertex3_scale6_index].pos.z;
378 projection_state_or_face_flags_bits = ((
387 (
float)((
long double)vertex3_scale6_view_x_fp * (
long double)0.015625f);
390 (
float)((
long double)vertex3_scale6_view_y_fp * (
long double)0.015625f);
392 (
float)((
long double)projection_state_or_face_flags_bits * (
long double)0.015625f);
398 if (projection_state_or_face_flags_bits > vertex3_scale6_render_state->
projection_near_fp)
400 int32_t vertex3_scale6_focal_distance = vertex3_scale6_render_state->
focal_distance;
401 int32_t vertex3_scale6_perspective_scale =
402 ((int64_t)vertex3_scale6_focal_distance *
MATH_Q12_ONE) / projection_state_or_face_flags_bits;
403 int64_t vertex3_scale6_projection_x_product = (int64_t)(int32_t)(vertex3_scale6_perspective_scale) * (int32_t)(vertex3_scale6_view_x_fp);
404 int32_t vertex3_scale6_screen_x = (((int32_t)(uint32_t)((uint64_t)vertex3_scale6_projection_x_product >> 12)) >> 0xc) + (
Graphics_WindowWidth >> 1);
405 int64_t vertex3_scale6_projection_y_product = (int64_t)(int32_t)(vertex3_scale6_perspective_scale) * (int32_t)(vertex3_scale6_view_y_fp);
407 projection_state_or_face_flags_bits = (((int32_t)(uint32_t)((uint64_t)vertex3_scale6_projection_y_product >> 12)) >> 0xc) + (
Graphics_WindowHeight >> 1);
409 if (vertex3_scale6_screen_x != (int32_t)(int16_t)vertex3_scale6_screen_x || projection_state_or_face_flags_bits != (int32_t)(int16_t)projection_state_or_face_flags_bits)
423 projection_state_or_face_flags_bits = 0;
424 fourth_screen_vertex = NULL;
432 int32_t vertex0_scale10_index = (uint16_t)(polygon_ref->
vertex_indices[0]);
433 int32_t vertex0_x_scale10 =
434 (int32_t)runtime_vertices[vertex0_scale10_index].pos.x;
435 struct Math_Vec3I16 *vertex0_scale10_position = &runtime_vertices[vertex0_scale10_index].
pos;
436 int32_t vertex0_scale10_model_z = (int32_t)vertex0_scale10_position->
z;
437 int32_t vertex0_scale10_model_y = (int32_t)vertex0_scale10_position->
y;
443 (
float)((
long double)vertex0_scale10_view_x_fp * (
long double)0.015625f);
446 (
float)((
long double)vertex0_scale10_view_y_fp * (
long double)0.015625f);
448 (
float)((
long double)vertex0_scale10_view_z_fp * (
long double)0.015625f);
456 int32_t vertex0_scale10_focal_distance = vertex0_scale10_render_state->
focal_distance;
457 int32_t vertex0_scale10_perspective_scale =
458 ((int64_t)vertex0_scale10_focal_distance *
MATH_Q12_ONE) / vertex0_scale10_view_z_fp;
459 int64_t vertex0_scale10_projection_x_product = (int64_t)(int32_t)(vertex0_scale10_perspective_scale) * (int32_t)(vertex0_scale10_view_x_fp);
460 int32_t vertex0_scale10_screen_x =
461 (((int32_t)(uint32_t)((uint64_t)vertex0_scale10_projection_x_product >> 12)) >> 0xc) + (
Graphics_WindowWidth >> 1);
462 int64_t vertex0_scale10_projection_y_product = (int64_t)(int32_t)(vertex0_scale10_perspective_scale) * (int32_t)(vertex0_scale10_view_y_fp);
463 int32_t vertex0_scale10_screen_y =
464 (((int32_t)(uint32_t)((uint64_t)vertex0_scale10_projection_y_product >> 12)) >> 0xc) + (
Graphics_WindowHeight >> 1);
466 if (vertex0_scale10_screen_x != (int32_t)(int16_t)vertex0_scale10_screen_x || vertex0_scale10_screen_y != (int32_t)(int16_t)vertex0_scale10_screen_y)
475 int32_t vertex1_scale10_index = (uint16_t)(polygon_ref->
vertex_indices[1]);
476 int32_t vertex1_scale10_model_y = (int32_t)saved_runtime_vertices[vertex1_scale10_index].pos.y;
477 int32_t vertex1_x_scale10 =
478 (int32_t)saved_runtime_vertices[vertex1_scale10_index].pos.x;
479 int32_t vertex1_scale10_model_z = (int32_t)saved_runtime_vertices[vertex1_scale10_index].pos.z;
485 (
float)((
long double)vertex1_scale10_view_x_fp * (
long double)0.015625f);
488 (
float)((
long double)vertex1_scale10_view_y_fp * (
long double)0.015625f);
490 (
float)((
long double)vertex1_scale10_view_z_fp * (
long double)0.015625f);
498 int32_t vertex1_scale10_focal_distance = vertex1_scale10_render_state->
focal_distance;
499 int32_t vertex1_scale10_perspective_scale =
500 ((int64_t)vertex1_scale10_focal_distance *
MATH_Q12_ONE) / vertex1_scale10_view_z_fp;
501 int64_t vertex1_scale10_projection_x_product = (int64_t)(int32_t)(vertex1_scale10_perspective_scale) * (int32_t)(vertex1_scale10_view_x_fp);
502 int32_t vertex1_scale10_screen_x =
503 (((int32_t)(uint32_t)((uint64_t)vertex1_scale10_projection_x_product >> 12)) >> 0xc) + (
Graphics_WindowWidth >> 1);
504 int64_t vertex1_scale10_projection_y_product = (int64_t)(int32_t)(vertex1_scale10_perspective_scale) * (int32_t)(vertex1_scale10_view_y_fp);
505 int32_t vertex1_scale10_screen_y =
506 (((int32_t)(uint32_t)((uint64_t)vertex1_scale10_projection_y_product >> 12)) >> 0xc) + (
Graphics_WindowHeight >> 1);
508 if (vertex1_scale10_screen_x != (int32_t)(int16_t)vertex1_scale10_screen_x || vertex1_scale10_screen_y != (int32_t)(int16_t)vertex1_scale10_screen_y)
517 int32_t vertex2_scale10_index = (uint16_t)(polygon_ref->
vertex_indices[2]);
518 int32_t vertex2_scale10_model_y = (int32_t)saved_runtime_vertices[vertex2_scale10_index].pos.y;
519 int32_t vertex2_x_scale10 =
520 (int32_t)saved_runtime_vertices[vertex2_scale10_index].pos.x;
521 int32_t vertex2_scale10_model_z = (int32_t)saved_runtime_vertices[vertex2_scale10_index].pos.z;
527 (
float)((
long double)vertex2_scale10_view_x_fp * (
long double)0.015625f);
530 (
float)((
long double)vertex2_scale10_view_y_fp * (
long double)0.015625f);
532 (
float)((
long double)vertex2_scale10_view_z_fp * (
long double)0.015625f);
540 int32_t vertex2_scale10_focal_distance = vertex2_scale10_render_state->
focal_distance;
541 int32_t vertex2_scale10_perspective_scale =
542 ((int64_t)vertex2_scale10_focal_distance *
MATH_Q12_ONE) / vertex2_scale10_view_z_fp;
543 int64_t vertex2_scale10_projection_x_product = (int64_t)(int32_t)(vertex2_scale10_perspective_scale) * (int32_t)(vertex2_scale10_view_x_fp);
544 int32_t vertex2_scale10_screen_x =
545 (((int32_t)(uint32_t)((uint64_t)vertex2_scale10_projection_x_product >> 12)) >> 0xc) + (
Graphics_WindowWidth >> 1);
546 int64_t vertex2_scale10_projection_y_product = (int64_t)(int32_t)(vertex2_scale10_perspective_scale) * (int32_t)(vertex2_scale10_view_y_fp);
547 int32_t vertex2_scale10_screen_y =
548 (((int32_t)(uint32_t)((uint64_t)vertex2_scale10_projection_y_product >> 12)) >> 0xc) + (
Graphics_WindowHeight >> 1);
550 if (vertex2_scale10_screen_x != (int32_t)(int16_t)vertex2_scale10_screen_x || vertex2_scale10_screen_y != (int32_t)(int16_t)vertex2_scale10_screen_y)
563 int32_t vertex3_scale10_index = (uint16_t)(polygon_ref->
vertex_indices[3]);
564 int32_t vertex3_scale10_model_y = (int32_t)saved_runtime_vertices[vertex3_scale10_index].pos.y;
565 int32_t vertex3_x_scale10 =
566 (int32_t)saved_runtime_vertices[vertex3_scale10_index].pos.x;
567 int32_t vertex3_scale10_model_z = (int32_t)saved_runtime_vertices[vertex3_scale10_index].pos.z;
569 projection_state_or_face_flags_bits = ((
578 (
float)((
long double)vertex3_scale10_view_x_fp * (
long double)0.015625f);
581 (
float)((
long double)vertex3_scale10_view_y_fp * (
long double)0.015625f);
583 (
float)((
long double)projection_state_or_face_flags_bits * (
long double)0.015625f);
589 if (projection_state_or_face_flags_bits > vertex3_scale10_render_state->
projection_near_fp)
591 int32_t vertex3_scale10_focal_distance = vertex3_scale10_render_state->
focal_distance;
592 int32_t vertex3_scale10_perspective_scale = ((int64_t)vertex3_scale10_focal_distance *
MATH_Q12_ONE) / projection_state_or_face_flags_bits;
593 int64_t vertex3_scale10_projection_x_product = (int64_t)(int32_t)(vertex3_scale10_perspective_scale) * (int32_t)(vertex3_scale10_view_x_fp);
595 fourth_screen_x = (((int32_t)(uint32_t)((uint64_t)vertex3_scale10_projection_x_product >> 12)) >> 0xc) + (
Graphics_WindowWidth >> 1);
597 int64_t vertex3_scale10_projection_y_product = (int64_t)(int32_t)(vertex3_scale10_perspective_scale) * (int32_t)(vertex3_scale10_view_y_fp);
599 fourth_projection_y_q12 = (int32_t)(uint32_t)((uint64_t)vertex3_scale10_projection_y_product >> 12);
601 projection_state_or_face_flags_bits = (fourth_projection_y_q12 >> 0xc) + (
Graphics_WindowHeight >> 1);
603 if (fourth_screen_x != (int32_t)(int16_t)fourth_screen_x || projection_state_or_face_flags_bits != (int32_t)(int16_t)projection_state_or_face_flags_bits)
617 projection_state_or_face_flags_bits = 0;
618 fourth_screen_vertex = NULL;
631 uint16_t polygon_flags = polygon_ref->
flags;
632 int32_t oriented_depth_bias;
640 if (face_normal_dot_view + plane_dist >= 0)
642 oriented_depth_bias = depth_bias_q12 << 3;
651 oriented_depth_bias = -((depth_bias_q12 << 3));
656 polygon_ref->
flags = (uint16_t)polygon_flags;
661 int32_t initial_uv_vertex0_index = (uint16_t)(polygon_ref->
vertex_indices[0]);
664 uv_vertices[0] = &saved_runtime_vertices[initial_uv_vertex0_index];
666 int32_t initial_uv_vertex1_index = (uint16_t)(polygon_ref->
vertex_indices[1]);
668 uv_vertices[1] = &saved_runtime_vertices[initial_uv_vertex1_index];
670 int32_t initial_uv_vertex2_index = (uint16_t)(polygon_ref->
vertex_indices[2]);
672 uv_vertices[2] = &saved_runtime_vertices[initial_uv_vertex2_index];
676 int32_t initial_uv_vertex3_index = (uint16_t)(polygon_ref->
vertex_indices[3]);
678 uv_vertices[3] = &saved_runtime_vertices[initial_uv_vertex3_index];
706 int32_t biased_vertex2_depth =
712 if (fourth_screen_vertex)
715 int32_t depth_bucket_index = 0;
729 if (capability_blend_mode)
739 int32_t depth_comparison_flag = 1;
740 long double first_three_depth_sum = (
long double)saved_vertex2_view_z + (
long double)saved_vertex1_view_z + (
long double)saved_vertex0_view_z;
741 long double first_depth_extended = (
long double)saved_vertex0_view_z;
742 long double second_depth_extended = (
long double)saved_vertex1_view_z;
744 if (first_depth_extended != second_depth_extended)
745 depth_comparison_flag = 0;
747 long double depth_equality_flag_extended = (
long double)depth_comparison_flag;
748 long double third_depth_extended = (
long double)saved_vertex2_view_z;
750 long double scaled_sort_depth;
752 if (depth_equality_flag_extended == third_depth_extended)
754 else if (!fourth_screen_vertex)
760 int32_t scaled_depth_integer =
__ftol_msvc(scaled_sort_depth);
762 if (scaled_depth_integer > 0x3fff)
763 scaled_depth_integer = 0x3fff;
765 depth_bucket_index = 0x3fff - scaled_depth_integer;
767 if (depth_bucket_index < 1)
768 depth_bucket_index = 1;
769 else if (depth_bucket_index > 0x3fff)
770 depth_bucket_index = 0x3fff;
777 if (depth_bucket_index < 1)
778 depth_bucket_index = 1;
803 (uint16_t)vertex0_packed_screen_xy;
805 (uint16_t)((uint32_t)vertex0_packed_screen_xy >> 16);
812 (uint16_t)vertex1_packed_screen_xy;
814 (uint16_t)((uint32_t)vertex1_packed_screen_xy >> 16);
821 (uint16_t)vertex2_packed_screen_xy;
823 (uint16_t)((uint32_t)vertex2_packed_screen_xy >> 16);
829 vertex2_projected_depth;
839 if (fourth_screen_vertex)
841 int32_t vertex3_packed_screen_xy = *(uint32_t *)fourth_screen_vertex;
844 (uint16_t)vertex3_packed_screen_xy;
846 (uint16_t)((uint32_t)vertex3_packed_screen_xy >> 16);
848 fourth_screen_vertex[1];
864 uint32_t vertex0_color_before_fade =
866 int32_t vertex0_green_before_fade = (uint8_t)((uint8_t)((uint32_t)vertex0_color_before_fade >> 8));
867 uint32_t vertex1_color_before_fade =
870 (&
g_polygonBatchRecords)[batch_index].vertex_colors[0] = (((vertex0_green_before_fade * fade_intensity_q12) & 0xff000) | ((uint32_t)(uint8_t)vertex0_color_before_fade * fade_intensity_q12) >> 8) >> 4 | (((vertex0_color_before_fade >> 0xc & 0xff0) * fade_intensity_q12) & 0xff0000);
872 int32_t vertex1_green_before_fade = (uint8_t)((uint8_t)((uint32_t)vertex1_color_before_fade >> 8));
873 uint32_t vertex2_color_before_fade =
876 (&
g_polygonBatchRecords)[batch_index].vertex_colors[1] = (((vertex1_green_before_fade * fade_intensity_q12) & 0xff000) | ((uint32_t)(uint8_t)vertex1_color_before_fade * fade_intensity_q12) >> 8) >> 4 | (((vertex1_color_before_fade >> 0xc & 0xff0) * fade_intensity_q12) & 0xff0000);
878 int32_t vertex2_green_before_fade = (uint8_t)((uint8_t)((uint32_t)vertex2_color_before_fade >> 8));
879 uint32_t vertex3_color_before_fade =
882 (&
g_polygonBatchRecords)[batch_index].vertex_colors[2] = (((vertex2_green_before_fade * fade_intensity_q12) & 0xff000) | ((uint32_t)(uint8_t)vertex2_color_before_fade * fade_intensity_q12) >> 8) >> 4 | (((vertex2_color_before_fade >> 0xc & 0xff0) * fade_intensity_q12) & 0xff0000);
884 int32_t vertex3_green_before_fade = (uint8_t)((uint8_t)((uint32_t)vertex3_color_before_fade >> 8));
886 (&
g_polygonBatchRecords)[batch_index].vertex_colors[3] = (((vertex3_green_before_fade * fade_intensity_q12) & 0xff000) | ((uint32_t)(uint8_t)vertex3_color_before_fade * fade_intensity_q12) >> 8) >> 4 | (((vertex3_color_before_fade >> 0xc & 0xff0) * fade_intensity_q12) & 0xff0000);
889 runtime_vertices = saved_runtime_vertices;
893 polygon_ref = &polygon_ref[1];