Rev 5415 | Rev 6523 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5415 | Rev 5418 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | if DEBUG |
1 | if DEBUG |
2 | align 4 |
2 | align 4 |
3 | txt_gl_scal db 'glopScale',0 |
- | |
4 | txt_gl_tran db 'glopTranslate',0 |
- | |
5 | - | ||
6 | align 4 |
- | |
7 | proc gl_print_matrix uses eax ebx ecx edi, m:dword, rows:dword |
3 | proc gl_print_matrix uses eax ebx ecx edi, m:dword, rows:dword |
8 | mov ecx,[rows] |
4 | mov ecx,[rows] |
9 | cmp ecx,1 |
5 | cmp ecx,1 |
10 | jl .end_f |
6 | jl .end_f |
11 | mov ebx,[m] |
7 | mov ebx,[m] |
Line 118... | Line 114... | ||
118 | shl ebx,2 |
114 | shl ebx,2 |
119 | add ebx,eax |
115 | add ebx,eax |
120 | 116 | ||
Line 121... | Line 117... | ||
121 | stdcall gl_M4_Id,[ebx+offs_cont_matrix_stack_ptr] |
117 | stdcall gl_M4_Id,[ebx+offs_cont_matrix_stack_ptr] |
122 | if DEBUG ;glopLoadIdentity |
- | |
123 | stdcall gl_print_matrix,[ebx+offs_cont_matrix_stack_ptr],4 |
- | |
124 | end if |
- | |
125 | gl_matrix_update eax,ebx |
118 | gl_matrix_update eax,ebx |
126 | ret |
119 | ret |
127 | endp |
120 | endp |
Line 128... | Line 121... | ||
128 | 121 | ||
Line 289... | Line 282... | ||
289 | sub esp,4 |
282 | sub esp,4 |
290 | stdcall gl_M4_Rotate, ecx |
283 | stdcall gl_M4_Rotate, ecx |
291 | jmp .end_sw |
284 | jmp .end_sw |
292 | @@: ;default: |
285 | @@: ;default: |
293 | if DEBUG ;glopRotete |
286 | |
294 | stdcall dbg_print,txt_sp,m_1 |
- | |
295 | end if |
- | |
296 | - | ||
Line 297... | Line 287... | ||
297 | ; normalize vector |
287 | ; normalize vector |
298 | fld dword[u0] |
288 | fld dword[u0] |
299 | fmul st0,st0 |
289 | fmul st0,st0 |
300 | fld dword[u1] |
290 | fld dword[u1] |
Line 436... | Line 426... | ||
436 | mov ebx,[eax+offs_cont_matrix_mode] |
426 | mov ebx,[eax+offs_cont_matrix_mode] |
437 | shl ebx,2 |
427 | shl ebx,2 |
438 | add ebx,eax |
428 | add ebx,eax |
439 | stdcall gl_M4_MulLeft,dword[ebx+offs_cont_matrix_stack_ptr],ecx |
429 | stdcall gl_M4_MulLeft,dword[ebx+offs_cont_matrix_stack_ptr],ecx |
440 | if DEBUG ;glopRotete |
430 | gl_matrix_update eax,ebx |
441 | stdcall gl_print_matrix,ecx,4 |
- | |
442 | end if |
- | |
443 | gl_matrix_update eax,ebx |
- | |
444 | jmp .end_f |
431 | jmp .end_f |
445 | .f2: |
432 | .f2: |
446 | ffree st0 ;len |
433 | ffree st0 ;len |
447 | fincstp |
434 | fincstp |
448 | ffree st0 ;angle |
435 | ffree st0 ;angle |
Line 483... | Line 470... | ||
483 | fincstp |
470 | fincstp |
484 | ffree st0 |
471 | ffree st0 |
485 | fincstp |
472 | fincstp |
486 | 473 | ||
Line 487... | Line -... | ||
487 | if DEBUG ;glopScale |
- | |
488 | pushad |
- | |
489 | stdcall dbg_print,txt_gl_scal,txt_nl |
- | |
490 | mov ebx,[eax+offs_cont_matrix_mode] |
- | |
491 | shl ebx,2 |
- | |
492 | add ebx,eax |
- | |
493 | stdcall gl_print_matrix,[ebx+offs_cont_matrix_stack_ptr],4 |
- | |
494 | popad |
- | |
495 | end if |
- | |
496 | gl_matrix_update eax,ebx |
474 | gl_matrix_update eax,ebx |
497 | ret |
475 | ret |
498 | endp |
476 | endp |
Line 499... | Line 477... | ||
499 | 477 | ||
Line 530... | Line 508... | ||
530 | fincstp |
508 | fincstp |
531 | ffree st0 |
509 | ffree st0 |
532 | fincstp |
510 | fincstp |
533 | 511 | ||
Line 534... | Line -... | ||
534 | if DEBUG ;glopTranslate |
- | |
535 | pushad |
- | |
536 | stdcall dbg_print,txt_gl_tran,txt_nl |
- | |
537 | mov ebx,[eax+offs_cont_matrix_mode] |
- | |
538 | shl ebx,2 |
- | |
539 | add ebx,eax |
- | |
540 | stdcall gl_print_matrix,[ebx+offs_cont_matrix_stack_ptr],4 |
- | |
541 | popad |
- | |
542 | end if |
- | |
543 | gl_matrix_update eax,ebx |
512 | gl_matrix_update eax,ebx |
544 | ret |
513 | ret |
545 | endp |
514 | endp |
Line 546... | Line 515... | ||
546 | 515 | ||
Line 579... | Line 548... | ||
579 | fdiv st0,st1 ;st1 = (top-bottom) |
548 | fdiv st0,st1 ;st1 = (top-bottom) |
580 | fstp dword[B] ;B = (top+bottom) / (top-bottom) |
549 | fstp dword[B] ;B = (top+bottom) / (top-bottom) |
581 | fld dword[ebx+24] |
550 | fld dword[ebx+24] |
582 | fsub dword[ebx+20] ;st0 = (farp-near) |
551 | fsub dword[ebx+20] ;st0 = (farp-near) |
583 | fldz |
552 | fld dword[ebx+24] |
584 | fsub dword[ebx+24] |
553 | fadd dword[ebx+20] |
585 | fsub dword[ebx+20] ;st0 = -(farp+near) |
554 | fchs ;st0 = -(farp+near) |
586 | fdiv st0,st1 |
555 | fdiv st0,st1 |
587 | fstp dword[C] ;C = -(farp+near) / (farp-near) |
556 | fstp dword[C] ;C = -(farp+near) / (farp-near) |
588 | fld dword[ebx+24] |
557 | fld dword[ebx+24] |
589 | fmul dword[ebx+20] ;st0 = farp*near |
558 | fmul dword[ebx+20] ;st0 = farp*near |
590 | fadd st0,st0 |
559 | fadd st0,st0 |
591 | fchs ;st0 = -(2.0*farp*near) |
560 | fchs ;st0 = -(2.0*farp*near) |
592 | fdiv st0,st1 |
561 | fdiv st0,st1 |
593 | fstp dword[D] ;D = -(2.0*farp*near) / (farp-near) |
562 | fstp dword[D] ;D = -(2.0*farp*near) / (farp-near) |
594 | 563 | ffree st0 |
|
- | 564 | fincstp |
|
- | 565 | ffree st0 |
|
- | 566 | fincstp |
|
- | 567 | ffree st0 |
|
- | 568 | fincstp |
|
- | 569 | ||
Line 595... | Line 570... | ||
595 | mov ecx,ebp |
570 | mov ecx,ebp |
596 | sub ecx,sizeof.M4 |
571 | sub ecx,sizeof.M4 |
Line 597... | Line 572... | ||
597 | 572 |