Rev 5175 | Rev 5218 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5175 | Rev 5213 | ||
---|---|---|---|
Line 44... | Line 44... | ||
44 | mov ecx,7 |
44 | mov ecx,7 |
45 | rep movsd |
45 | rep movsd |
46 | 46 | ||
Line 47... | Line 47... | ||
47 | mov eax,[context] |
47 | mov eax,[context] |
48 | cmp dword[eax+offs_cont_color_material_enabled],1 |
48 | cmp dword[eax+offs_cont_color_material_enabled],0 |
49 | jne @f |
49 | je @f |
50 | mov dword[q],OP_Material |
50 | mov dword[q],OP_Material |
51 | mov ecx,[eax+offs_cont_current_color_material_mode] |
51 | mov ecx,[eax+offs_cont_current_color_material_mode] |
52 | mov dword[q+4],ecx |
52 | mov dword[q+4],ecx |
53 | mov ecx,[eax+offs_cont_current_color_material_type] |
53 | mov ecx,[eax+offs_cont_current_color_material_type] |
54 | mov dword[q+8],ecx |
54 | mov dword[q+8],ecx |
55 | mov esi,[p] |
55 | mov esi,[p] |
56 | add esi,4 |
56 | add esi,4 |
- | 57 | mov edi,ebp |
|
57 | mov edi,dword[q+12] ;edi = [q3] |
58 | sub edi,16 ;edi = &q[3] |
58 | mov ecx,4 |
59 | mov ecx,4 |
59 | rep movsd |
60 | rep movsd |
60 | stdcall glopMaterial, eax,[q] |
61 | stdcall glopMaterial, eax,[q] |
61 | @@: |
62 | @@: |
62 | ret |
63 | ret |
Line 145... | Line 146... | ||
145 | mov ecx,edx |
146 | mov ecx,edx |
146 | add ecx,offs_cont_matrix_model_projection |
147 | add ecx,offs_cont_matrix_model_projection |
147 | ; precompute projection matrix |
148 | ; precompute projection matrix |
148 | stdcall gl_M4_Mul, ecx,dword[edx+offs_cont_matrix_stack_ptr+4],dword[edx+offs_cont_matrix_stack_ptr] |
149 | stdcall gl_M4_Mul, ecx,dword[edx+offs_cont_matrix_stack_ptr+4],dword[edx+offs_cont_matrix_stack_ptr] |
149 | ;if DEBUG ;glopBegin |
150 | |
150 | ;stdcall gl_print_matrix,ecx,4 |
- | |
151 | ;stdcall gl_print_matrix,[edx+offs_cont_matrix_stack_ptr+4],4 |
- | |
152 | ;stdcall gl_print_matrix,[edx+offs_cont_matrix_stack_ptr],4 |
- | |
153 | ;end if |
- | |
154 | ; test to accelerate computation |
151 | ; test to accelerate computation |
155 | mov dword[edx+offs_cont_matrix_model_projection_no_w_transform],0 |
152 | mov dword[edx+offs_cont_matrix_model_projection_no_w_transform],0 |
156 | fldz |
153 | fldz |
157 | fld dword[ecx+12*4] |
154 | fld dword[ecx+12*4] |
158 | fcomp st1 |
155 | fcomp st1 |
159 | fstsw ax |
156 | fstsw ax |
Line 453... | Line 450... | ||
453 | jmp @f |
450 | jmp @f |
454 | .els_0: |
451 | .els_0: |
455 | mov eax,[edx+offs_cont_current_color] |
452 | mov eax,[edx+offs_cont_current_color] |
456 | mov [ebx+offs_vert_color],eax |
453 | mov [ebx+offs_vert_color],eax |
457 | @@: |
454 | mov eax,[edx+offs_cont_current_color+4] |
- | 455 | mov [ebx+offs_vert_color+4],eax |
|
- | 456 | mov eax,[edx+offs_cont_current_color+8] |
|
- | 457 | mov [ebx+offs_vert_color+8],eax |
|
- | 458 | @@: |
|
458 | 459 | ||
Line 459... | Line 460... | ||
459 | ; tex coords |
460 | ; tex coords |
460 | cmp dword[edx+offs_cont_texture_2d_enabled],0 |
461 | cmp dword[edx+offs_cont_texture_2d_enabled],0 |
461 | je @f |
462 | je @f |
Line 568... | Line 569... | ||
568 | cmp dword[edx+offs_cont_begin_type],GL_QUADS |
569 | cmp dword[edx+offs_cont_begin_type],GL_QUADS |
569 | jne @f |
570 | jne @f |
570 | cmp dword[n],4 |
571 | cmp dword[n],4 |
571 | jne .end_f |
572 | jne .end_f |
572 | ; c->vertex[2].edge_flag = 0; |
573 | mov eax,[edx+offs_cont_vertex] |
- | 574 | add eax,2*sizeof.GLVertex |
|
- | 575 | mov dword[eax+offs_vert_edge_flag],0 ;context.vertex[2].edge_flag = 0 |
|
573 | ; gl_draw_triangle(c, &c->vertex[0], &c->vertex[1], &c->vertex[2]); |
576 | push eax |
- | 577 | sub eax,sizeof.GLVertex |
|
- | 578 | push eax |
|
- | 579 | sub eax,sizeof.GLVertex |
|
- | 580 | stdcall gl_draw_triangle, edx,eax ;v0,v1,v2 |
|
574 | ; c->vertex[2].edge_flag = 1; |
581 | mov dword[eax+offs_vert_edge_flag],0 ;context.vertex[0].edge_flag = 0 |
575 | ; c->vertex[0].edge_flag = 0; |
582 | add eax,2*sizeof.GLVertex |
- | 583 | mov dword[eax+offs_vert_edge_flag],1 ;context.vertex[2].edge_flag = 1 |
|
576 | ; gl_draw_triangle(c, &c->vertex[0], &c->vertex[2], &c->vertex[3]); |
584 | add eax,sizeof.GLVertex |
- | 585 | push eax |
|
- | 586 | sub eax,sizeof.GLVertex |
|
- | 587 | push eax |
|
- | 588 | sub eax,2*sizeof.GLVertex |
|
- | 589 | stdcall gl_draw_triangle, edx,eax ;v0,v2,v3 |
|
577 | xor eax,eax |
590 | xor eax,eax |
578 | mov dword[n],eax |
591 | mov dword[n],eax |
579 | jmp .end_f |
592 | jmp .end_f |
580 | @@: |
593 | @@: |
581 | cmp dword[edx+offs_cont_begin_type],GL_QUAD_STRIP |
594 | cmp dword[edx+offs_cont_begin_type],GL_QUAD_STRIP |
582 | jne @f |
595 | jne @f |
Line 589... | Line 602... | ||
589 | mov dword[n],2 |
602 | mov dword[n],2 |
590 | jmp .end_f |
603 | jmp .end_f |
591 | @@: |
604 | @@: |
592 | cmp dword[edx+offs_cont_begin_type],GL_POLYGON |
605 | cmp dword[edx+offs_cont_begin_type],GL_POLYGON |
593 | jne @f |
606 | je .end_f |
594 | ;... |
- | |
595 | jmp .end_f |
- | |
596 | @@: |
607 | ; default: |
597 | ; default: |
- | |
598 | ; gl_fatal_error("glBegin: type %x not handled\n", c->begin_type); |
608 | ; gl_fatal_error("glBegin: type %x not handled\n", c->begin_type); |
599 | ; } |
609 | ; } |
600 | .end_f: |
610 | .end_f: |
601 | 611 | ||
Line 605... | Line 615... | ||
605 | ret |
615 | ret |
606 | endp |
616 | endp |
607 | 617 | ||
Line 608... | Line 618... | ||
608 | align 4 |
618 | align 4 |
609 | proc glopEnd uses eax ebx, context:dword, p:dword |
619 | proc glopEnd uses eax ebx ecx, context:dword, p:dword |
610 | mov eax,[context] |
620 | mov eax,[context] |
611 | ; assert(c->in_begin == 1); |
621 | ; assert(c->in_begin == 1); |
Line 612... | Line 622... | ||
612 | 622 | ||
613 | cmp dword[eax+offs_cont_begin_type],GL_LINE_LOOP |
623 | cmp dword[eax+offs_cont_begin_type],GL_LINE_LOOP |
Line 627... | Line 637... | ||
627 | @@: ;while (ebx >= 3) |
637 | @@: ;while (ebx >= 3) |
628 | cmp ebx,3 |
638 | cmp ebx,3 |
629 | jl .end_i |
639 | jl .end_i |
630 | dec ebx |
640 | dec ebx |
631 | ; gl_draw_triangle(c, &c->vertex[i], &c->vertex[0], &c->vertex[i - 1]); |
641 | mov ecx,ebx |
- | 642 | imul ecx,sizeof.GLVertex |
|
- | 643 | add ecx,[eax+offs_cont_vertex] |
|
- | 644 | push ecx ;ecx = &context.vertex[i] |
|
- | 645 | sub ecx,sizeof.GLVertex |
|
- | 646 | push ecx ;ecx = &context.vertex[i-1] |
|
- | 647 | stdcall gl_draw_triangle, eax,[eax+offs_cont_vertex] |
|
632 | jmp @b |
648 | jmp @b |
633 | .end_i: |
649 | .end_i: |
634 | mov dword[eax+offs_cont_in_begin],0 |
650 | mov dword[eax+offs_cont_in_begin],0 |
635 | ret |
651 | ret |
636 | endp> |
652 | endp> |
637 | 653 |