Rev 5159 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5153 | IgorA | 1 | |
2 | proc ZB_plot uses eax ebx ecx edx edi, zb:dword, p:dword |
||
3 | mov eax,[zb] |
||
4 | mov ebx,[p] |
||
5 | mov ecx,[ebx+ZBufferPoint.y] |
||
8069 | IgorA | 6 | imul ecx,[eax+ZBuffer.xsize] |
7 | add ecx,[ebx+ZBufferPoint.x] |
||
8 | shl ecx,1 |
||
5159 | IgorA | 9 | add ecx,[eax+ZBuffer.zbuf] |
8069 | IgorA | 10 | mov edx,[eax+ZBuffer.linesize] |
11 | imul edx,[ebx+ZBufferPoint.y] |
||
12 | mov edi,[ebx+ZBufferPoint.x] |
||
13 | imul edi,PSZB |
||
5153 | IgorA | 14 | add edx,edi |
15 | add edx,[eax+ZBuffer.pbuf] |
||
8069 | IgorA | 16 | mov edi,[ebx+ZBufferPoint.z] |
17 | shr edi,ZB_POINT_Z_FRAC_BITS |
||
5153 | IgorA | 18 | cmp di,word[ecx] |
5159 | IgorA | 19 | jl .end_f |
5153 | IgorA | 20 | if TGL_FEATURE_RENDER_BITS eq 24 |
21 | mov eax,[ebx+ZBufferPoint.r] |
||
8069 | IgorA | 22 | mov byte[edx],ah |
5153 | IgorA | 23 | mov eax,[ebx+ZBufferPoint.g] |
8069 | IgorA | 24 | mov byte[edx+1],ah |
5153 | IgorA | 25 | mov eax,[ebx+ZBufferPoint.b] |
8069 | IgorA | 26 | mov byte[edx+2],ah |
5153 | IgorA | 27 | else |
28 | ; *pp = RGB_TO_PIXEL(p->r, p->g, p->b); |
||
29 | end if |
||
30 | mov word[ecx],di |
||
5159 | IgorA | 31 | .end_f: |
5153 | IgorA | 32 | ret |
33 | endp |
||
34 | |||
35 | |||
36 | align 4 |
||
37 | proc ZB_line_flat_z, zb:dword, p1:dword, p2:dword, color:dword |
||
38 | include 'zline.inc' |
||
39 | |||
40 | |||
41 | INTERP_Z equ 1 |
||
42 | align 4 |
||
43 | proc ZB_line_interp_z, zb:dword, p1:dword, p2:dword |
||
44 | include 'zline_r.inc' |
||
45 | |||
46 | |||
47 | |||
48 | |||
49 | proc ZB_line_flat, zb:dword, p1:dword, p2:dword, color:dword |
||
50 | include 'zline.inc' |
||
51 | |||
52 | |||
53 | proc ZB_line_interp, zb:dword, p1:dword, p2:dword |
||
54 | include 'zline_r.inc' |
||
55 | |||
56 | |||
57 | proc ZB_line_z uses eax ebx ecx, zb:dword, p1:dword, p2:dword |
||
58 | if DEBUG ;ZB_line_z |
||
59 | push edi |
||
60 | mov ecx,80 |
||
61 | mov eax,[p1] |
||
62 | mov eax,[eax+ZBufferPoint.x] |
||
8069 | IgorA | 63 | lea edi,[buf_param] |
5153 | IgorA | 64 | stdcall convert_int_to_str,ecx |
65 | stdcall str_n_cat,edi,txt_zp_sp,2 |
||
66 | stdcall str_len,edi |
||
67 | add edi,eax |
||
68 | sub ecx,eax |
||
69 | |||
70 | |||
71 | mov eax,[eax+ZBufferPoint.y] |
||
8069 | IgorA | 72 | stdcall convert_int_to_str,ecx |
5153 | IgorA | 73 | stdcall str_n_cat,edi,txt_zp_sp,2 |
74 | stdcall str_len,edi |
||
75 | add edi,eax |
||
76 | sub ecx,eax |
||
77 | |||
78 | |||
79 | mov eax,[eax+ZBufferPoint.x] |
||
8069 | IgorA | 80 | stdcall convert_int_to_str,ecx |
5153 | IgorA | 81 | stdcall str_n_cat,edi,txt_zp_sp,2 |
82 | stdcall str_len,edi |
||
83 | add edi,eax |
||
84 | sub ecx,eax |
||
85 | |||
86 | |||
87 | mov eax,[eax+ZBufferPoint.y] |
||
8069 | IgorA | 88 | stdcall convert_int_to_str,ecx |
5153 | IgorA | 89 | |
90 | |||
91 | stdcall dbg_print,f_zbz,buf_param |
||
92 | pop edi |
||
93 | end if |
||
94 | mov ebx,[p1] |
||
95 | RGB_TO_PIXEL dword[ebx+ZBufferPoint.r],dword[ebx+ZBufferPoint.g],dword[ebx+ZBufferPoint.b] |
||
8069 | IgorA | 96 | mov ecx,eax |
5153 | IgorA | 97 | mov ebx,[p2] |
98 | RGB_TO_PIXEL dword[ebx+ZBufferPoint.r],dword[ebx+ZBufferPoint.g],dword[ebx+ZBufferPoint.b] |
||
8069 | IgorA | 99 | |
5153 | IgorA | 100 | |
101 | cmp ecx,eax |
||
102 | jne .els |
||
103 | stdcall ZB_line_flat_z, dword[zb], dword[p1], ebx, ecx |
||
104 | jmp @f |
||
105 | .els: |
||
106 | stdcall ZB_line_interp_z, dword[zb], dword[p1], ebx |
||
107 | @@: |
||
108 | ret |
||
109 | endp |
||
110 | |||
111 | |||
112 | proc ZB_line uses eax ebx ecx, zb:dword, p1:dword, p2:dword |
||
113 | if DEBUG ;ZB_line |
||
114 | push edi |
||
115 | mov ecx,80 |
||
116 | mov eax,[p1] |
||
117 | mov eax,[eax+ZBufferPoint.x] |
||
8069 | IgorA | 118 | lea edi,[buf_param] |
5153 | IgorA | 119 | stdcall convert_int_to_str,ecx |
120 | stdcall str_n_cat,edi,txt_zp_sp,2 |
||
121 | stdcall str_len,edi |
||
122 | add edi,eax |
||
123 | sub ecx,eax |
||
124 | |||
125 | |||
126 | mov eax,[eax+ZBufferPoint.y] |
||
8069 | IgorA | 127 | stdcall convert_int_to_str,ecx |
5153 | IgorA | 128 | stdcall str_n_cat,edi,txt_zp_sp,2 |
129 | stdcall str_len,edi |
||
130 | add edi,eax |
||
131 | sub ecx,eax |
||
132 | |||
133 | |||
134 | mov eax,[eax+ZBufferPoint.x] |
||
8069 | IgorA | 135 | stdcall convert_int_to_str,ecx |
5153 | IgorA | 136 | stdcall str_n_cat,edi,txt_zp_sp,2 |
137 | stdcall str_len,edi |
||
138 | add edi,eax |
||
139 | sub ecx,eax |
||
140 | |||
141 | |||
142 | mov eax,[eax+ZBufferPoint.y] |
||
8069 | IgorA | 143 | stdcall convert_int_to_str,ecx |
5153 | IgorA | 144 | |
145 | |||
146 | stdcall dbg_print,f_zb,buf_param |
||
147 | pop edi |
||
148 | end if |
||
149 | mov ebx,[p1] |
||
150 | RGB_TO_PIXEL dword[ebx+ZBufferPoint.r],dword[ebx+ZBufferPoint.g],dword[ebx+ZBufferPoint.b] |
||
8069 | IgorA | 151 | mov ecx,eax |
5153 | IgorA | 152 | mov ebx,[p2] |
153 | RGB_TO_PIXEL dword[ebx+ZBufferPoint.r],dword[ebx+ZBufferPoint.g],dword[ebx+ZBufferPoint.b] |
||
8069 | IgorA | 154 | |
5153 | IgorA | 155 | |
156 | cmp ecx,eax |
||
157 | jne .els |
||
158 | stdcall ZB_line_flat, dword[zb], dword[p1], ebx, ecx |
||
159 | jmp @f |
||
160 | .els: |
||
161 | stdcall ZB_line_interp, dword[zb], dword[p1], ebx |
||
162 | @@: |
||
163 | ret |
||
164 | endp |
||
165 |