Subversion Repositories Kolibri OS

Rev

Rev 5213 | Rev 5256 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5213 Rev 5218
Line 3... Line 3...
3
	mov esi,[p]
3
	mov esi,[p]
4
	add esi,4
4
	add esi,4
5
	mov edi,[context]
5
	mov edi,[context]
6
	add edi,offs_cont_current_normal
6
	add edi,offs_cont_current_normal
7
	mov ecx,4
7
	mov ecx,3
8
	rep movsd
8
	rep movsd
9
	mov dword[esi],0.0 ;context.current_normal.W = 0.0
9
	mov dword[edi],0.0 ;context.current_normal.W = 0.0
10
	ret
10
	ret
11
endp
11
endp
12
 
12
 
Line 13... Line 13...
13
align 4
13
align 4
14
proc glopTexCoord uses ecx esi edi, context:dword, p:dword
14
proc glopTexCoord uses ecx esi edi, context:dword, p:dword
Line 169... Line 169...
169
			mov dword[edx+offs_cont_matrix_model_projection_no_w_transform],1
169
			mov dword[edx+offs_cont_matrix_model_projection_no_w_transform],1
170
	.end_if_0:
170
	.end_if_0:
171
 
171
 
Line 172... Line 172...
172
		; test if the texture matrix is not Identity
172
		; test if the texture matrix is not Identity
-
 
173
		mov eax,edx
173
		stdcall gl_M4_IsId,edx+offs_cont_matrix_stack_ptr+8
174
		add eax,offs_cont_matrix_stack_ptr+8
-
 
175
		stdcall gl_M4_IsId,eax
174
		xor edx,1
176
		xor eax,1
175
		mov ebx,[context]
-
 
176
		mov dword[ebx+offs_cont_apply_texture_matrix],edx
177
		mov dword[edx+offs_cont_apply_texture_matrix],eax
Line 177... Line -...
177
 
-
 
178
		mov edx,[context]
178
 
179
		mov dword[edx+offs_cont_matrix_model_projection_updated],0
179
		mov dword[edx+offs_cont_matrix_model_projection_updated],0
Line 180... Line 180...
180
	.end_mmpu:
180
	.end_mmpu:
181
 
181
 
Line 251... Line 251...
251
			fstp dword[edx+offs_vert_ec] ;v.ec.X = v.coord.X * m[0] + v.coord.Y * m[1] + v.coord.Z * m[2] + m[3]
251
			fstp dword[edx+offs_vert_ec] ;v.ec.X = v.coord.X * m[0] + v.coord.Y * m[1] + v.coord.Z * m[2] + m[3]
252
			add ebx,16 ;следущая строка матрицы
252
			add ebx,16 ;следущая строка матрицы
253
			add edx,4  ;следущая координата вектора
253
			add edx,4  ;следущая координата вектора
254
		loop .cycle_0
254
		loop .cycle_0
255
 
255
		ffree st0
-
 
256
		fincstp
-
 
257
		ffree st0
-
 
258
		fincstp
-
 
259
		ffree st0
-
 
260
		fincstp
-
 
261
 
Line 256... Line 262...
256
		; projection coordinates
262
		; projection coordinates
257
		mov ebx,dword[eax+offs_cont_matrix_stack_ptr+4]
263
		mov ebx,dword[eax+offs_cont_matrix_stack_ptr+4]
258
		mov edx,[v]
264
		mov edx,[v]
259
		finit
265
 
260
		fld dword[edx+offs_vert_ec+offs_X]
266
		fld dword[edx+offs_vert_ec+offs_X]
261
		fld dword[edx+offs_vert_ec+offs_Y]
267
		fld dword[edx+offs_vert_ec+offs_Y]
262
		fld dword[edx+offs_vert_ec+offs_Z]
268
		fld dword[edx+offs_vert_ec+offs_Z]
Line 263... Line 269...
263
 
269
 
Line 275... Line 281...
275
			fstp dword[edx+offs_vert_pc] ;v.pc.X = v.ec.X * m[0] + v.ec.Y * m[1] + v.ec.Z * m[2] + m[3]
281
			fstp dword[edx+offs_vert_pc] ;v.pc.X = v.ec.X * m[0] + v.ec.Y * m[1] + v.ec.Z * m[2] + m[3]
276
			add ebx,16 ;следущая строка матрицы
282
			add ebx,16 ;следущая строка матрицы
277
			add edx,4  ;следущая координата вектора
283
			add edx,4  ;следущая координата вектора
278
		loop .cycle_1
284
		loop .cycle_1
279
 
285
		ffree st0
-
 
286
		fincstp
-
 
287
		ffree st0
-
 
288
		fincstp
-
 
289
		ffree st0
-
 
290
		fincstp
-
 
291
 
Line 280... Line 292...
280
		mov ebx,eax
292
		mov ebx,eax
281
		add ebx,offs_cont_matrix_model_view_inv
293
		add ebx,offs_cont_matrix_model_view_inv
282
		mov edi,eax
294
		mov edi,eax
283
		add edi,offs_cont_current_normal
295
		add edi,offs_cont_current_normal
284
		mov edx,[v]
296
		mov edx,[v]
285
		finit
297
 
286
		fld dword[edi+offs_X]
298
		fld dword[edi+offs_X]
287
		fld dword[edi+offs_Y]
299
		fld dword[edi+offs_Y]
288
		fld dword[edi+offs_Z]
300
		fld dword[edi+offs_Z]
Line 289... Line 301...
289
 
301
 
Line 303... Line 315...
303
		loop .cycle_2
315
		loop .cycle_2
304
 
316
 
Line 305... Line 317...
305
		cmp dword[eax+offs_cont_normalize_enabled],0
317
		cmp dword[eax+offs_cont_normalize_enabled],0
306
		je .end_els
318
		je .end_els
-
 
319
			mov edx,[v]
-
 
320
			add edx,offs_vert_normal
307
;stdcall gl_V3_Norm(&v->normal)
321
			stdcall gl_V3_Norm,edx
308
		jmp .end_els
322
		jmp .end_els
309
	.els_0:
323
	.els_0:
310
		; no eye coordinates needed, no normal
324
		; no eye coordinates needed, no normal
311
		; NOTE: W = 1 is assumed
325
		; NOTE: W = 1 is assumed
312
		mov ebx,eax
326
		mov ebx,eax
Line 514... Line 528...
514
		cmp dword[n],2
528
		cmp dword[n],2
515
		jne .end_f ;else if (n == 2)
529
		jne .end_f ;else if (n == 2)
516
			mov eax,[edx+offs_cont_vertex]
530
			mov eax,[edx+offs_cont_vertex]
517
			push eax
531
			push eax
518
			add eax,sizeof.GLVertex
532
			mov edi,eax
-
 
533
			add eax,sizeof.GLVertex
519
			stdcall gl_draw_line, edx, eax
534
			mov esi,eax
-
 
535
			stdcall gl_draw_line, edx, eax
520
			mov edi,[edx+offs_cont_vertex]
536
			mov ecx,(sizeof.GLVertex)/4 ;((...)/4) что-бы использовать movsd вместо movsb
521
			mov esi,edi
-
 
522
			add esi,sizeof.GLVertex
-
 
523
			mov ecx,(sizeof.GLVertex)/4 ;((...)/4) что-бы использовать movsd вместо movsb
-
 
524
			rep movsd ;context.vertex[0] = context.vertex[1]
537
			rep movsd ;context.vertex[0] = context.vertex[1]
525
			mov dword[n],1
538
			mov dword[n],1
526
		jmp .end_f
539
		jmp .end_f
527
	@@:
540
	@@:
528
	cmp dword[edx+offs_cont_begin_type],GL_TRIANGLES
541
	cmp dword[edx+offs_cont_begin_type],GL_TRIANGLES
529
	jne @f
542
	jne @f
530
		cmp dword[n],3
543
		cmp dword[n],3
531
		jne .end_f
544
		jne .end_f
532
			mov eax,[edx+offs_cont_vertex]
545
			mov eax,[edx+offs_cont_vertex]
533
			push eax
546
			mov [esp-4],eax
534
			add eax,sizeof.GLVertex
547
			add eax,sizeof.GLVertex
535
			push eax
548
			mov [esp-8],eax
536
			add eax,sizeof.GLVertex
549
			add eax,sizeof.GLVertex
537
			stdcall gl_draw_triangle, edx, eax
550
			mov [esp-12],eax
-
 
551
			sub esp,12
-
 
552
			stdcall gl_draw_triangle, edx
538
			xor eax,eax
553
			xor eax,eax
539
			mov dword[n],eax
554
			mov dword[n],eax
540
		jmp .end_f
555
		jmp .end_f
541
	@@:
556
	@@:
542
	cmp dword[edx+offs_cont_begin_type],GL_TRIANGLE_STRIP
557
	cmp dword[edx+offs_cont_begin_type],GL_TRIANGLE_STRIP
543
	jne @f
558
	jne @f
Line 558... Line 573...
558
		jmp .end_f
573
		jmp .end_f
559
	@@:
574
	@@:
560
	cmp dword[edx+offs_cont_begin_type],GL_TRIANGLE_FAN
575
	cmp dword[edx+offs_cont_begin_type],GL_TRIANGLE_FAN
561
	jne @f
576
	jne @f
562
		cmp dword[n],2
577
		cmp dword[n],3
563
		jne .end_f
578
		jne .end_f
564
;           gl_draw_triangle(c, &c->vertex[0], &c->vertex[1], &c->vertex[2]);
579
			mov eax,[edx+offs_cont_vertex]
-
 
580
			mov [esp-4],eax
-
 
581
			add eax,sizeof.GLVertex
-
 
582
			mov [esp-8],eax
-
 
583
			mov edi,eax
-
 
584
			add eax,sizeof.GLVertex
-
 
585
			mov [esp-12],eax
-
 
586
			mov esi,eax
-
 
587
			sub esp,12
-
 
588
			stdcall gl_draw_triangle, edx
565
;           c->vertex[1] = c->vertex[2];
589
			mov ecx,(sizeof.GLVertex)/4 ;((...)/4) что-бы использовать movsd вместо movsb
-
 
590
			rep movsd ;context.vertex[1] = context.vertex[2]
566
			mov dword[n],2
591
			mov dword[n],2
567
		jmp .end_f
592
		jmp .end_f
568
	@@:
593
	@@:
569
	cmp dword[edx+offs_cont_begin_type],GL_QUADS
594
	cmp dword[edx+offs_cont_begin_type],GL_QUADS
570
	jne @f
595
	jne @f
571
		cmp dword[n],4
596
		cmp dword[n],4
Line 592... Line 617...
592
		jmp .end_f
617
		jmp .end_f
593
	@@:
618
	@@:
594
	cmp dword[edx+offs_cont_begin_type],GL_QUAD_STRIP
619
	cmp dword[edx+offs_cont_begin_type],GL_QUAD_STRIP
595
	jne @f
620
	jne @f
596
		cmp dword[n],2
621
		cmp dword[n],4
597
		jne .end_f
622
		jne .end_f
598
;           gl_draw_triangle(c, &c->vertex[0], &c->vertex[1], &c->vertex[2]);
623
			mov eax,[edx+offs_cont_vertex]
-
 
624
			mov [esp-4],eax
-
 
625
			mov edi,eax
-
 
626
			add eax,sizeof.GLVertex
-
 
627
			mov [esp-8],eax
-
 
628
			add eax,sizeof.GLVertex
-
 
629
			mov [esp-12],eax
-
 
630
			mov esi,eax
-
 
631
			sub esp,12
-
 
632
			stdcall gl_draw_triangle, edx ;v0,v1,v2
599
;           gl_draw_triangle(c, &c->vertex[1], &c->vertex[3], &c->vertex[2]);
633
			mov [esp-12],eax
-
 
634
			add eax,sizeof.GLVertex
-
 
635
			mov [esp-8],eax
-
 
636
			sub eax,2*sizeof.GLVertex
-
 
637
			mov [esp-4],eax
-
 
638
			sub esp,12
-
 
639
			stdcall gl_draw_triangle, edx ;v1,v3,v2
600
;           for (i = 0; i < 2; i++)
640
			mov ecx,(sizeof.GLVertex)/2 ;((...)/2) копируем 2 вершины
601
;               c->vertex[i] = c->vertex[i + 2];
641
			rep movsd ;context.vertex[0] = context.vertex[2], context.vertex[1] = context.vertex[3]
602
			mov dword[n],2
642
			mov dword[n],2
603
		jmp .end_f
643
		jmp .end_f
604
	@@:
644
	@@:
605
	cmp dword[edx+offs_cont_begin_type],GL_POLYGON
645
	cmp dword[edx+offs_cont_begin_type],GL_POLYGON
606
	je .end_f
646
	je .end_f
607
;    default:
647
;    default: