Rev 5213 | Rev 5278 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5213 | Rev 5218 | ||
---|---|---|---|
Line 250... | Line 250... | ||
250 | 250 | ||
251 | mov ebx,[tmax] |
251 | mov ebx,[tmax] |
252 | fcom dword[ebx] |
252 | fcom dword[ebx] |
253 | fstsw ax |
253 | fstsw ax |
254 | sahf |
254 | sahf |
Line 255... | Line 255... | ||
255 | ja .r0 ;if (t>*tmax) return 0 |
255 | ja .r0_f2 ;if (t>*tmax) return 0 |
256 | 256 | ||
257 | mov ebx,[tmin] |
257 | mov ebx,[tmin] |
258 | fcom dword[ebx] |
258 | fcom dword[ebx] |
259 | fstsw ax |
259 | fstsw ax |
260 | sahf |
260 | sahf |
261 | jbe .r1 |
261 | jbe .r1_f2 |
Line 262... | Line 262... | ||
262 | fstp dword[ebx] ;if (t>*tmin) *tmin=t |
262 | fstp dword[ebx] ;if (t>*tmin) *tmin=t |
263 | jmp .r1 |
263 | jmp .r1 |
Line 268... | Line 268... | ||
268 | 268 | ||
269 | mov ebx,[tmin] |
269 | mov ebx,[tmin] |
270 | fcom dword[ebx] |
270 | fcom dword[ebx] |
271 | fstsw ax |
271 | fstsw ax |
272 | sahf |
272 | sahf |
Line 273... | Line 273... | ||
273 | jb .r0 ;if (t<*tmin) return 0 |
273 | jb .r0_f2 ;if (t<*tmin) return 0 |
274 | 274 | ||
275 | mov ebx,[tmax] |
275 | mov ebx,[tmax] |
276 | fcom dword[ebx] |
276 | fcom dword[ebx] |
277 | fstsw ax |
277 | fstsw ax |
278 | sahf |
278 | sahf |
279 | jae .r1 |
279 | jae .r1_f2 |
Line -... | Line 280... | ||
- | 280 | fstp dword[ebx] ;if (t<*tmin) *tmax=t |
|
- | 281 | jmp .r1 |
|
- | 282 | ||
280 | fstp dword[ebx] ;if (t<*tmin) *tmax=t |
283 | .r0_f2: ;return 0 & free st0,st1 |
281 | jmp .r1 |
284 | ffree st0 |
282 | 285 | fincstp |
|
- | 286 | .r0: ;return 0 & free st0 |
|
- | 287 | xor eax,eax |
|
- | 288 | jmp .end_f |
|
283 | .r0: ;return 0 |
289 | .r1_f2: ;return 1 & free st0,st1 |
284 | xor eax,eax |
290 | ffree st0 |
285 | jmp .end_f |
291 | fincstp |
286 | .r1: ;return 1 |
292 | .r1: ;return 1 & free st0 |
287 | xor eax,eax |
- | |
288 | inc eax |
- | |
289 | .end_f: |
293 | xor eax,eax |
290 | if DEBUG ;ClipLine1 |
- | |
291 | push edi |
- | |
292 | mov ecx,80 |
- | |
293 | lea edi,[buf_param] |
- | |
294 | stdcall convert_int_to_str,ecx |
- | |
295 | - | ||
296 | stdcall str_n_cat,edi,txt_nl,2 |
294 | inc eax |
297 | stdcall dbg_print,f_cl1,buf_param |
- | |
298 | pop edi |
- | |
299 | end if |
295 | .end_f: |
300 | ffree st0 ;профилактика для очистки стека |
296 | ffree st0 |
Line 301... | Line 297... | ||
301 | fincstp ;как минимум одно значение в стеке уже есть |
297 | fincstp |
302 | ret |
298 | ret |
303 | endp |
299 | endp |
304 | 300 | ||
305 | align 4 |
301 | align 4 |
306 | proc gl_draw_line uses eax ebx edx edi esi, context:dword, p1:dword, p2:dword |
302 | proc gl_draw_line, context:dword, p1:dword, p2:dword |
307 | locals |
303 | locals |
Line 316... | Line 312... | ||
316 | q1 GLVertex ? |
312 | q1 GLVertex ? |
317 | q2 GLVertex ? |
313 | q2 GLVertex ? |
318 | tmin dd ? ;ebp-8 |
314 | tmin dd ? ;ebp-8 |
319 | tmax dd ? ;ebp-4 |
315 | tmax dd ? ;ebp-4 |
320 | endl |
316 | endl |
321 | 317 | pushad |
|
322 | mov edx,[context] |
318 | mov edx,[context] |
323 | mov edi,[p1] |
319 | mov edi,[p1] |
324 | mov esi,[p2] |
320 | mov esi,[p2] |
Line 325... | Line 321... | ||
325 | 321 | ||
Line 353... | Line 349... | ||
353 | and eax,[esi+offs_vert_clip_code] |
349 | and eax,[esi+offs_vert_clip_code] |
354 | cmp eax,0 |
350 | cmp eax,0 |
355 | jne .end_f |
351 | jne .end_f |
356 | .els_0: |
352 | .els_0: |
Line 357... | Line -... | ||
357 | - | ||
358 | finit |
353 | |
359 | fld dword[esi+offs_vert_pc+offs_X] |
354 | fld dword[esi+offs_vert_pc+offs_X] |
360 | fsub dword[edi+offs_vert_pc+offs_X] |
355 | fsub dword[edi+offs_vert_pc+offs_X] |
361 | fstp dword[d_x] ;d_x = p2.pc.X - p1.pc.X |
356 | fstp dword[d_x] ;d_x = p2.pc.X - p1.pc.X |
362 | fld dword[esi+offs_vert_pc+offs_Y] |
357 | fld dword[esi+offs_vert_pc+offs_Y] |
Line 498... | Line 493... | ||
498 | call ZB_line_z ;(context.zb,&q1.zp,&q2.zp) |
493 | call ZB_line_z ;(context.zb,&q1.zp,&q2.zp) |
499 | jmp .end_f |
494 | jmp .end_f |
500 | .els_3: |
495 | .els_3: |
501 | call ZB_line ;(context.zb,&q1.zp,&q2.zp) |
496 | call ZB_line ;(context.zb,&q1.zp,&q2.zp) |
502 | .end_f: |
497 | .end_f: |
- | 498 | popad |
|
503 | ret |
499 | ret |
504 | endp |
500 | endp |
Line 505... | Line 501... | ||
505 | 501 | ||
Line 542... | Line 538... | ||
542 | fadd dword[d#dir] |
538 | fadd dword[d#dir] |
543 | else |
539 | else |
544 | fsub dword[d#dir] |
540 | fsub dword[d#dir] |
545 | end if |
541 | end if |
Line 546... | Line 542... | ||
546 | 542 | ||
547 | fldz |
- | |
548 | fcomp |
543 | ftst |
549 | fstsw ax |
544 | fstsw ax |
550 | sahf |
545 | sahf |
551 | jne @f |
546 | jne @f |
552 | fldz |
547 | fldz |