Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 6145 → Rev 6143

/programs/develop/libraries/TinyGL/asm_fork/examples/textures1.asm
149,14 → 149,12
mcall SF_CREATE_WINDOW,(50 shl 16)+420,(30 shl 16)+410,0x33ffffff,,caption
 
mov esi,[sc.work_button]
mcall SF_DEFINE_BUTTON,(6 shl 16)+19,(6 shl 16)+19,3+0x40000000 ;земля с меридиан.
mcall ,(36 shl 16)+19,,4+0x40000000 ;земля
mcall SF_DEFINE_BUTTON,(6 shl 16)+19,(6 shl 16)+19,3+0x40000000 ;земля 1
mcall ,(36 shl 16)+19,,4+0x40000000 ;земля 2
 
mov ebx,[image_data_toolbar]
add ebx,IMAGE_TOOLBAR_ICON_SIZE
mcall SF_PUT_IMAGE,,(21 shl 16)+21,(5 shl 16)+5 ;земля с меридиан.
add ebx,IMAGE_TOOLBAR_ICON_SIZE
mcall ,,,(35 shl 16)+5 ;земля
mcall SF_PUT_IMAGE,[image_data_toolbar],(21 shl 16)+21,(5 shl 16)+5 ;земля 1
;add ebx,2*IMAGE_TOOLBAR_ICON_SIZE
mcall ,,,(35 shl 16)+5 ;земля 2
 
stdcall [kosglSwapBuffers]
mcall SF_REDRAW,SSF_END_DRAW
304,22 → 302,18
stdcall [glPushMatrix]
stdcall [glTranslatef], 0.0,0.0,0.5
stdcall [glScalef], [scale], [scale], [scale]
;stdcall [glRotatef], [angle_z],0.0,0.0,1.0
stdcall [glRotatef], [angle_y],0.0,1.0,0.0
stdcall [glRotatef], [angle_x],1.0,0.0,0.0
 
cmp dword[dr_figure],0
jne @f
; рисование земли с меридианами
stdcall [glColor3f], 0.0, 0.0, 1.0
stdcall [gluQuadricDrawStyle], [qObj],GLU_LINE
stdcall [gluSphere], [qObj], 1.0, 24,18 ;меридианы
stdcall [gluQuadricDrawStyle], [qObj],GLU_FILL
stdcall [gluSphere], [qObj], 0.995, 24,18 ;земля
; рисование земли
stdcall [gluSphere], [qObj], 1.0, 16,16
@@:
cmp dword[dr_figure],1
jne @f
; рисование земли
stdcall [gluQuadricDrawStyle], [qObj],GLU_FILL
stdcall [gluSphere], [qObj], 1.0, 64,64
@@:
stdcall [glPopMatrix]
/programs/develop/libraries/TinyGL/asm_fork/ztriangle.inc
465,6 → 465,7
if INTERP_ST eq 1
mov ebx,[l1]
mov eax,[ebx+offs_zbup_s]
add eax,0x00200000 ;прокручиваем горизонтальную координату на 0.5
mov [s1],eax ;s1 = l1.s
mov eax,[dsdx]
imul eax,[dxdy_min]
/programs/develop/libraries/TinyGL/asm_fork/clip.asm
33,11 → 33,14
fistp dword[ebx+offs_vert_zp+offs_zbup_y] ;v.zp.y = st0, st0 = st1
 
fld dword[ebx+offs_vert_pc+offs_Z] ;st0 = v.pc.Z
fmulp
fmul st0,st1
fmul dword[eax+offs_cont_viewport+offs_vpor_scale+offs_Z]
fadd dword[eax+offs_cont_viewport+offs_vpor_trans+offs_Z]
fistp dword[ebx+offs_vert_zp+offs_zbup_z] ;v.zp.z = st0, st0 = st1
 
ffree st0
fincstp
 
; color
cmp dword[eax+offs_cont_lighting_enabled],0 ;if (context.lighting_enabled)
je @f
74,7 → 77,7
fild dword[point]
fmul dword[ebx+offs_vert_tex_coord+offs_Y] ;st0 *= v.tex_coord.Y
fistp dword[ebx+offs_vert_zp+offs_zbup_t]
add dword[ebx+offs_vert_zp+offs_zbup_t],ZB_POINT_T_MIN
add dword[ebx+offs_vert_zp+offs_zbup_s],ZB_POINT_T_MIN
@@:
ret
endp
178,9 → 181,12
 
fld dword[ecx+offs_vert_color+8]
fsub dword[ebx+offs_vert_color+8]
fmulp
fmul st0,st1
fadd dword[ebx+offs_vert_color+8]
fstp dword[eax+offs_vert_color+8]
 
ffree st0
fincstp
ret
endp
 
/programs/develop/libraries/TinyGL/asm_fork/vertex.asm
2,7 → 2,7
f_vt db ' gl_vertex_transform',0
end if
 
align 16
align 4
proc glopNormal uses ecx esi edi, context:dword, p:dword
mov esi,[p]
add esi,4
14,7 → 14,7
ret
endp
 
align 16
align 4
proc glopTexCoord uses ecx esi edi, context:dword, p:dword
mov esi,[p]
add esi,4
25,7 → 25,7
ret
endp
 
align 16
align 4
proc glopEdgeFlag uses eax ebx, context:dword, p:dword
mov eax,[context]
mov ebx,[p]
34,7 → 34,7
ret
endp
 
align 16
align 4
proc glopColor uses eax ecx esi edi, context:dword, p:dword
locals
q rd 7
69,7 → 69,7
ret
endp
 
align 16
align 4
proc gl_eval_viewport uses eax, context:dword
locals
zsize dd ? ;float
115,7 → 115,7
endp
 
 
align 16
align 4
proc glopBegin uses eax ebx ecx edx, context:dword, p:dword
locals
tmp M4
134,12 → 134,7
jnc .end_mmpu
 
cmp dword[edx+offs_cont_lighting_enabled],0 ;if(context.lighting_enabled)
jne .if_0
cmp dword[eax+offs_cont_texture_2d_enabled],0
jne .if_0
jmp @f
align 4
.if_0:
je @f
if DEBUG ;context.matrix_stack_ptr[0]
stdcall gl_print_matrix,dword[edx+offs_cont_matrix_stack_ptr],4
end if
160,7 → 155,6
stdcall gl_print_matrix,ebx,4
end if
jmp .end_if_0
align 4
@@:
mov ecx,edx
add ecx,offs_cont_matrix_model_projection
213,7 → 207,6
mov dword[edx+offs_cont_draw_triangle_front],gl_draw_triangle_select
mov dword[edx+offs_cont_draw_triangle_back],gl_draw_triangle_select
jmp .end_if_2
align 4
@@:
 
cmp dword[edx+offs_cont_polygon_mode_front],GL_POINT
220,13 → 213,11
jne @f
mov dword[edx+offs_cont_draw_triangle_front],gl_draw_triangle_point
jmp .end_if_1
align 4
@@:
cmp dword[edx+offs_cont_polygon_mode_front],GL_LINE
jne @f
mov dword[edx+offs_cont_draw_triangle_front],gl_draw_triangle_line
jmp .end_if_1
align 4
@@: ;default:
mov dword[edx+offs_cont_draw_triangle_front],gl_draw_triangle_fill
.end_if_1:
235,13 → 226,11
jne @f
mov dword[edx+offs_cont_draw_triangle_back],gl_draw_triangle_point
jmp .end_if_2
align 4
@@:
cmp dword[edx+offs_cont_polygon_mode_back],GL_LINE
jne @f
mov dword[edx+offs_cont_draw_triangle_back],gl_draw_triangle_line
jmp .end_if_2
align 4
@@: ;default:
mov dword[edx+offs_cont_draw_triangle_back],gl_draw_triangle_fill
.end_if_2:
250,18 → 239,13
 
; coords, tranformation , clip code and projection
; TODO : handle all cases
align 16
align 4
proc gl_vertex_transform, context:dword, v:dword
pushad
mov eax,[context]
mov edx,[v]
cmp dword[eax+offs_cont_lighting_enabled],0 ;if (context.lighting_enabled)
jne @f
cmp dword[eax+offs_cont_texture_2d_enabled],0
jne @f
jmp .els_0
align 4
@@:
je .els_0
; eye coordinates needed for lighting
mov ebx,dword[eax+offs_cont_matrix_stack_ptr]
finit
372,7 → 356,6
je .end_els
stdcall gl_V3_Norm,edx
jmp .end_els
align 4
.els_0:
; no eye coordinates needed, no normal
; NOTE: W = 1 is assumed
426,7 → 409,6
mov ebx,dword[ebx+60] ;ebx = m[15]
mov dword[esi+12],ebx ;v.pc.W = m[15]
jmp .end_els
align 4
.els_1:
fld dword[ebx+48] ;st0 = m[12]
fmul st0,st3 ;st0 *= v.coord.X
460,7 → 442,7
ret
endp
 
align 16
align 4
proc glopVertex, context:dword, p:dword
locals
;ebx = GLVertex * v
515,7 → 497,6
je .els_0
stdcall gl_shade_vertex, edx,ebx
jmp @f
align 4
.els_0:
mov esi,edx
add esi,offs_cont_current_color
537,7 → 518,6
add eax,offs_vert_tex_coord
stdcall gl_M4_MulV4, eax, dword[edx+offs_cont_matrix_stack_ptr+8]
jmp @f
align 4
.els_1:
mov esi,edx
add esi,offs_cont_current_tex_coord
562,7 → 542,6
stdcall gl_draw_point, edx, dword[edx+offs_cont_vertex] ;dword[edx+...] = &context.vertex[0]
mov dword[n],0
jmp .end_f
align 4
@@:
cmp dword[edx+offs_cont_begin_type],GL_LINES
jne @f
575,7 → 554,6
xor eax,eax
mov dword[n],eax
jmp .end_f
align 4
@@:
cmp dword[edx+offs_cont_begin_type],GL_LINE_STRIP
je .li_loop
590,7 → 568,6
mov ecx,(sizeof.GLVertex)/4 ;((...)/4) что-бы использовать movsd вместо movsb
rep movsd ;context.vertex[2] = context.vertex[0]
jmp .end_f
align 4
.els_2:
cmp dword[n],2
jne .end_f ;else if (n == 2)
604,7 → 581,6
rep movsd ;context.vertex[0] = context.vertex[1]
mov dword[n],1
jmp .end_f
align 4
@@:
cmp dword[edx+offs_cont_begin_type],GL_TRIANGLES
jne @f
621,7 → 597,6
xor eax,eax
mov dword[n],eax
jmp .end_f
align 4
@@:
cmp dword[edx+offs_cont_begin_type],GL_TRIANGLE_STRIP
jne @f
644,7 → 619,6
sub esp,12
stdcall gl_draw_triangle, edx ;v2,v1,v0
jmp .end_f
align 4
.case_1:
mov [esp-12],eax
add eax,sizeof.GLVertex
654,7 → 628,6
sub esp,12
stdcall gl_draw_triangle, edx ;v0,v1,v2
jmp .end_f
align 4
@@:
cmp dword[edx+offs_cont_begin_type],GL_TRIANGLE_FAN
jne @f
674,7 → 647,6
rep movsd ;context.vertex[1] = context.vertex[2]
mov dword[n],2
jmp .end_f
align 4
@@:
cmp dword[edx+offs_cont_begin_type],GL_QUADS
jne @f
700,7 → 672,6
xor eax,eax
mov dword[n],eax
jmp .end_f
align 4
@@:
cmp dword[edx+offs_cont_begin_type],GL_QUAD_STRIP
jne @f
727,7 → 698,6
rep movsd ;context.vertex[0] = context.vertex[2], context.vertex[1] = context.vertex[3]
mov dword[n],2
jmp .end_f
align 4
@@:
cmp dword[edx+offs_cont_begin_type],GL_POLYGON
je .end_f
742,7 → 712,7
ret
endp
 
align 16
align 4
proc glopEnd uses eax ebx ecx, context:dword, p:dword
mov eax,[context]
; assert(c->in_begin == 1);
757,7 → 727,6
push ebx
stdcall gl_draw_line, eax
jmp .end_i
align 4
.else_i:
cmp dword[eax+offs_cont_begin_type],GL_POLYGON
jne .end_i
774,7 → 743,6
push ecx ;ecx = &context.vertex[i-1]
stdcall gl_draw_triangle, eax,[eax+offs_cont_vertex]
jmp @b
align 4
.end_i:
mov dword[eax+offs_cont_in_begin],0
ret