62 #define NUMVERTEXNORMALS 162
84 #define BBOX_TRIVIAL_ACCEPT 0
85 #define BBOX_MUST_CLIP_XY 1
86 #define BBOX_MUST_CLIP_Z 2
87 #define BBOX_TRIVIAL_REJECT 8
96 unsigned long aggregate_and_clipcode = ~0
U,
97 aggregate_or_clipcode = 0;
100 vec3_t transformed_min, transformed_max;
101 qboolean zclipped =
false, zfullyclipped =
true;
106 for (
i = 0;
i < 3;
i++)
109 maxs[
i] = mins[
i] + frame->
scale[
i] * 255;
119 zfullyclipped =
false;
121 zfullyclipped =
false;
135 for (
i = 0;
i < 8;
i++)
139 unsigned long clipcode = 0;
158 for (
j = 0;
j < 4;
j++)
166 aggregate_and_clipcode &= clipcode;
167 aggregate_or_clipcode |= clipcode;
170 if (aggregate_and_clipcode)
174 if (!aggregate_or_clipcode)
184 unsigned long ccodes[2] = { 0, 0 };
282 pfv[0] = &pfinalverts[ptri->
index_xyz[0]];
283 pfv[1] = &pfinalverts[ptri->
index_xyz[1]];
284 pfv[2] = &pfinalverts[ptri->
index_xyz[2]];
286 if (pfv[0]->flags & pfv[1]->flags & pfv[2]->flags)
290 pfv[0]->
s = pstverts[ptri->
index_st[0]].
s << 16;
291 pfv[0]->
t = pstverts[ptri->
index_st[0]].
t << 16;
293 pfv[1]->
s = pstverts[ptri->
index_st[1]].
s << 16;
294 pfv[1]->
t = pstverts[ptri->
index_st[1]].
t << 16;
296 pfv[2]->
s = pstverts[ptri->
index_st[2]].
s << 16;
297 pfv[2]->
t = pstverts[ptri->
index_st[2]].
t << 16;
299 if (!(pfv[0]->flags | pfv[1]->flags | pfv[2]->flags))
320 pfv[0] = &pfinalverts[ptri->
index_xyz[0]];
321 pfv[1] = &pfinalverts[ptri->
index_xyz[1]];
322 pfv[2] = &pfinalverts[ptri->
index_xyz[2]];
324 if (pfv[0]->flags & pfv[1]->flags & pfv[2]->flags)
328 pfv[0]->
s = pstverts[ptri->
index_st[0]].
s << 16;
329 pfv[0]->
t = pstverts[ptri->
index_st[0]].
t << 16;
331 pfv[1]->
s = pstverts[ptri->
index_st[1]].
s << 16;
332 pfv[1]->
t = pstverts[ptri->
index_st[1]].
t << 16;
334 pfv[2]->
s = pstverts[ptri->
index_st[2]].
s << 16;
335 pfv[2]->
t = pstverts[ptri->
index_st[2]].
t << 16;
337 if (!(pfv[0]->flags | pfv[1]->flags | pfv[2]->flags))
365 static float viewmatrix[3][4];
382 for (
i = 0;
i < 3;
i++)
408 viewmatrix[0][3] = 0;
409 viewmatrix[1][3] = 0;
410 viewmatrix[2][3] = 0;
431 #if id386 && !defined __linux__ && !defined __FreeBSD__
435 float lerped_vert[3];
436 int byte_to_dword_ptr_var;
445 __asm mov ecx, numpoints
460 __asm mov byte_to_dword_ptr_var, ebx
461 __asm fild dword ptr byte_to_dword_ptr_var
465 __asm mov byte_to_dword_ptr_var, ebx
466 __asm fild dword ptr byte_to_dword_ptr_var
467 __asm fmul dword ptr [
r_lerp_backv+4] ; oldv[1]*rlb[1] | oldv[0]*rlb[0]
470 __asm mov byte_to_dword_ptr_var, ebx
471 __asm fild dword ptr byte_to_dword_ptr_var
472 __asm fmul dword ptr [
r_lerp_backv+8] ; oldv[2]*rlb[2] | oldv[1]*rlb[1] | oldv[0]*rlb[0]
475 __asm mov byte_to_dword_ptr_var, ebx
476 __asm fild dword ptr byte_to_dword_ptr_var
477 __asm fmul dword ptr [
r_lerp_frontv+0] ; newv[0]*rlf[0] | oldv[2]*rlb[2] | oldv[1]*rlb[1] | oldv[0]*rlb[0]
480 __asm mov byte_to_dword_ptr_var, ebx
481 __asm fild dword ptr byte_to_dword_ptr_var
482 __asm fmul dword ptr [
r_lerp_frontv+4] ; newv[1]*rlf[1] | newv[0]*rlf[0] | oldv[2]*rlb[2] | oldv[1]*rlb[1] | oldv[0]*rlb[0]
485 __asm mov byte_to_dword_ptr_var, ebx
486 __asm fild dword ptr byte_to_dword_ptr_var
487 __asm fmul dword ptr [
r_lerp_frontv+8] ; newv[2]*rlf[2] | newv[1]*rlf[1] | newv[0]*rlf[0] | oldv[2]*rlb[2] | oldv[1]*rlb[1] | oldv[0]*rlb[0]
489 __asm fxch
st(5) ; oldv[0]*rlb[0] | newv[1]*rlf[1] | newv[0]*rlf[0] | oldv[2]*rlb[2] | oldv[1]*rlb[1] | newv[2]*rlf[2]
490 __asm faddp
st(2),
st ; newv[1]*rlf[1] | oldv[0]*rlb[0] + newv[0]*rlf[0] | oldv[2]*rlb[2] | oldv[1]*rlb[1] | newv[2]*rlf[2]
491 __asm faddp
st(3),
st ; oldv[0]*rlb[0] + newv[0]*rlf[0] | oldv[2]*rlb[2] | oldv[1]*rlb[1] + newv[1]*rlf[1] | newv[2]*rlf[2]
492 __asm fxch
st(1) ; oldv[2]*rlb[2] | oldv[0]*rlb[0] + newv[0]*rlf[0] | oldv[1]*rlb[1] + newv[1]*rlf[1] | newv[2]*rlf[2]
493 __asm faddp
st(3),
st ; oldv[0]*rlb[0] + newv[0]*rlf[0] | oldv[1]*rlb[1] + newv[1]*rlf[1] | oldv[2]*rlb[2] + newv[2]*rlf[2]
494 __asm fadd dword ptr [
r_lerp_move+0] ; lv0 | oldv[1]*rlb[1] + newv[1]*rlf[1] | oldv[2]*rlb[2] + newv[2]*rlf[2]
495 __asm fxch
st(1) ; oldv[1]*rlb[1] + newv[1]*rlf[1] | lv0 | oldv[2]*rlb[2] + newv[2]*rlf[2]
496 __asm fadd dword ptr [
r_lerp_move+4] ; lv1 | lv0 | oldv[2]*rlb[2] + newv[2]*rlf[2]
497 __asm fxch
st(2) ; oldv[2]*rlb[2] + newv[2]*rlf[2] | lv0 | lv1
498 __asm fadd dword ptr [
r_lerp_move+8] ; lv2 | lv0 | lv1
499 __asm fxch
st(1) ; lv0 | lv2 | lv1
500 __asm fstp dword ptr [lerped_vert+0] ; lv2 | lv1
501 __asm fstp dword ptr [lerped_vert+8] ; lv2
502 __asm fstp dword ptr [lerped_vert+4] ; (empty)
508 __asm jz not_powersuit
522 __asm fld dword ptr [eax+0] ; n[0]
523 __asm fmul PS_SCALE ; n[0] * PS
524 __asm fld dword ptr [eax+4] ; n[1] | n[0] * PS
525 __asm fmul PS_SCALE ; n[1] * PS | n[0] * PS
526 __asm fld dword ptr [eax+8] ; n[2] | n[1] * PS | n[0] * PS
527 __asm fmul PS_SCALE ; n[2] * PS | n[1] * PS | n[0] * PS
528 __asm fld dword ptr [lerped_vert+0] ; lv0 | n[2] * PS | n[1] * PS | n[0] * PS
529 __asm faddp
st(3),
st ; n[2] * PS | n[1] * PS | n[0] * PS + lv0
530 __asm fld dword ptr [lerped_vert+4] ; lv1 | n[2] * PS | n[1] * PS | n[0] * PS + lv0
531 __asm faddp
st(2),
st ; n[2] * PS | n[1] * PS + lv1 | n[0] * PS + lv0
532 __asm fadd dword ptr [lerped_vert+8] ; n[2] * PS + lv2 | n[1] * PS + lv1 | n[0] * PS + lv0
533 __asm fxch
st(2) ; LV0 | LV1 | LV2
534 __asm fstp dword ptr [lerped_vert+0] ; LV1 | LV2
535 __asm fstp dword ptr [lerped_vert+4] ; LV2
536 __asm fstp dword ptr [lerped_vert+8] ; (empty)
550 __asm fld dword ptr [lerped_vert+0] ; lv0
552 __asm fld dword ptr [lerped_vert+4] ; lv1 | lv0*at[0][0]
553 __asm fmul dword ptr [
aliastransform+4] ; lv1*at[0][1] | lv0*at[0][0]
554 __asm fld dword ptr [lerped_vert+8] ; lv2 | lv1*at[0][1] | lv0*at[0][0]
555 __asm fmul dword ptr [
aliastransform+8] ; lv2*at[0][2] | lv1*at[0][1] | lv0*at[0][0]
556 __asm fxch
st(2) ; lv0*at[0][0] | lv1*at[0][1] | lv2*at[0][2]
557 __asm faddp
st(1),
st ; lv0*at[0][0] + lv1*at[0][1] | lv2*at[0][2]
558 __asm faddp
st(1),
st ; lv0*at[0][0] + lv1*at[0][1] + lv2*at[0][2]
561 __asm fld dword ptr [lerped_vert+0] ; lv0
563 __asm fld dword ptr [lerped_vert+4] ; lv1 | lv0*at[1][0]
564 __asm fmul dword ptr [
aliastransform+20] ; lv1*at[1][1] | lv0*at[1][0]
565 __asm fld dword ptr [lerped_vert+8] ; lv2 | lv1*at[1][1] | lv0*at[1][0]
566 __asm fmul dword ptr [
aliastransform+24] ; lv2*at[1][2] | lv1*at[1][1] | lv0*at[1][0]
567 __asm fxch
st(2) ; lv0*at[1][0] | lv1*at[1][1] | lv2*at[1][2]
568 __asm faddp
st(1),
st ; lv0*at[1][0] + lv1*at[1][1] | lv2*at[1][2]
569 __asm faddp
st(1),
st ; lv0*at[1][0] + lv1*at[1][1] + lv2*at[1][2]
571 __asm fxch
st(1) ; FV.X | FV.Y
574 __asm fld dword ptr [lerped_vert+0] ; lv0
576 __asm fld dword ptr [lerped_vert+4] ; lv1 | lv0*at[2][0]
577 __asm fmul dword ptr [
aliastransform+36] ; lv1*at[2][1] | lv0*at[2][0]
578 __asm fld dword ptr [lerped_vert+8] ; lv2 | lv1*at[2][1] | lv0*at[2][0]
579 __asm fmul dword ptr [
aliastransform+40] ; lv2*at[2][2] | lv1*at[2][1] | lv0*at[2][0]
580 __asm fxch
st(2) ; lv0*at[2][0] | lv1*at[2][1] | lv2*at[2][2]
581 __asm faddp
st(1),
st ; lv0*at[2][0] + lv1*at[2][1] | lv2*at[2][2]
582 __asm faddp
st(1),
st ; lv0*at[2][0] + lv1*at[2][1] + lv2*at[2][2]
584 __asm fxch
st(1) ; FV.Y | FV.Z
602 __asm fld dword ptr [eax+0]
603 __asm fmul dword ptr [ebx+0]
604 __asm fld dword ptr [eax+4]
605 __asm fmul dword ptr [ebx+4]
606 __asm fld dword ptr [eax+8]
607 __asm fmul dword ptr [ebx+8]
609 __asm faddp
st(1),
st
610 __asm faddp
st(1),
st
611 __asm fstp dword ptr lightcos
612 __asm mov eax, lightcos
632 __asm fmul dword ptr lightcos
633 __asm fistp dword ptr tmpint
634 __asm add ebx, tmpint
661 __asm js alias_z_clip
662 __asm cmp eax, FALIAS_Z_CLIP_PLANE
663 __asm jl alias_z_clip
684 __asm mov eax, dword ptr [edi+32]
685 __asm mov eax, dword ptr [edi+64]
694 __asm fmul
zi ;
x * asx *
zi |
y * asy | fv5
696 __asm fxch
st(1) ;
y * asy | fv0 | fv5
697 __asm fmul
zi ;
y * asy *
zi | fv0 | fv5
699 __asm fxch
st(2) ; fv5 | fv0 | fv1
718 __asm jge ct_alias_top
722 __asm jge ct_alias_right
726 __asm jle ct_alias_bottom
730 __asm jle end_of_loop
733 __asm jmp end_of_loop
746 __asm jnz top_of_loop
753 for (
i = 0;
i < numpoints;
i++,
fv++, oldv++, newv++)
756 float lightcos, *plightnormal;
895 float lightvec[3] = { 0.2, -0.8, 0.6 };
896 float rlightvec[3] = { -1, 0, 0 };
897 float glightvec[3] = { 0, -1, 0 };
898 float blightvec[3] = { 0, 0, -1 };
905 for (
i = 0;
i < 3;
i++)
920 for (
i = 0;
i < 3;
i++)
931 for (
i = 0;
i < 3;
i++)
999 if ((thisframe >= pmdl->
num_frames) || (thisframe < 0))
1005 if ((lastframe >= pmdl->
num_frames) || (lastframe < 0))
1027 vec3_t translation, vectors[3];
1030 frontlerp = 1.0F - backlerp;
1051 for (
i = 0;
i < 3;
i++)
1056 for (
i = 0;
i < 3;
i++)
1203 s_ziscale = (float)0x8000 * (
float)0x10000 * 3.0;
1205 s_ziscale = (float)0x8000 * (
float)0x10000;