Subversion Repositories Kolibri OS

Rev

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

Rev 5153 Rev 5159
Line 48... Line 48...
48
	add edi,[eax+offs_zbuf_pbuf] ;edi = (zb.pbuf + zb.linesize*p1.y + p1.x*PSZB)
48
	add edi,[eax+offs_zbuf_pbuf] ;edi = (zb.pbuf + zb.linesize*p1.y + p1.x*PSZB)
49
if INTERP_Z eq 1
49
if INTERP_Z eq 1
50
	mov edx,[ecx+offs_zbup_y]
50
	mov edx,[ecx+offs_zbup_y]
51
	imul edx,[sx]
51
	imul edx,[sx]
52
	add edx,[ecx+offs_zbup_x]
52
	add edx,[ecx+offs_zbup_x]
-
 
53
	shl edx,1
53
	add edx,[eax+offs_zbuf_zbuf]
54
	add edx,[eax+offs_zbuf_zbuf]
54
	mov [pz],edx ;pz = zb.zbuf + (p1.y*sx + p1.x)
55
	mov [pz],edx ;pz = zb.zbuf + (p1.y*sx + p1.x)
55
	mov edx,[ecx+offs_zbup_z]
56
	mov edx,[ecx+offs_zbup_z]
56
	mov [z],edx ;z = p1.z
57
	mov [z],edx ;z = p1.z
57
end if
58
end if
Line 96... Line 97...
96
if INTERP_Z eq 1
97
if INTERP_Z eq 1
97
local .end_0
98
local .end_0
98
	mov eax,[z]
99
	mov eax,[z]
99
	shr eax, ZB_POINT_Z_FRAC_BITS
100
	shr eax, ZB_POINT_Z_FRAC_BITS
100
	mov [zz],eax
101
	mov [zz],eax
101
	cmp eax,[pz]
102
	mov ebx,[pz]
-
 
103
	cmp ax,word[ebx]
102
	jl .end_0
104
	jl .end_0
103
		RGBPIXEL
105
		RGBPIXEL
104
		mov eax,dword[zz]
106
		mov eax,dword[zz]
-
 
107
		mov ebx,[pz]
105
		mov [pz],eax
108
		mov word[ebx],ax
106
	.end_0:
109
	.end_0:
107
else ; INTERP_Z
110
else
108
	RGBPIXEL
111
	RGBPIXEL
109
end if ; INTERP_Z
112
end if
110
}
113
}
Line 111... Line 114...
111
 
114
 
112
macro DRAWLINE d_x,d_y,inc_1,inc_2
115
macro DRAWLINE d_x,d_y,inc_1,inc_2
-
 
116
{
-
 
117
local .mz_0
-
 
118
local .mz_1
-
 
119
local .mz_2
113
{
120
 
114
	mov eax,d_x
121
	mov eax,d_x
115
	mov [n],eax
122
	mov [n],eax
116
if INTERP_Z eq 1
123
if INTERP_Z eq 1
117
	mov ebx,[p1]
124
	mov ebx,[p1]
118
	mov eax,[p2]
125
	mov eax,[p2]
-
 
126
	mov eax,[eax+offs_zbup_z]
-
 
127
	cmp eax,[ebx+offs_zbup_z]
-
 
128
	jg .mz_0
-
 
129
	je .mz_1
-
 
130
		;if(p2.z
-
 
131
		sub eax,[ebx+offs_zbup_z]
-
 
132
		neg eax
-
 
133
		inc eax
-
 
134
		xor edx,edx
-
 
135
		div dword[n]
-
 
136
		neg eax
-
 
137
		inc eax
-
 
138
		jmp .mz_2
119
	mov eax,[eax+offs_zbup_z]
139
	.mz_0:
120
	sub eax,[ebx+offs_zbup_z]
140
	sub eax,[ebx+offs_zbup_z]
121
	xor edx,edx
141
	xor edx,edx
-
 
142
	div dword[n]
-
 
143
	jmp .mz_2
-
 
144
	.mz_1:
-
 
145
		xor eax,eax
122
	div dword[n]
146
	.mz_2:
123
	mov [zinc],eax ;zinc=(p2.z-p1.z)/n
147
	mov [zinc],eax ;zinc=(p2.z-p1.z)/n
124
end if
148
end if
125
	shl dword d_y,1
149
	shl dword d_y,1
126
	mov eax, d_y
150
	mov eax, d_y
Line 152... Line 176...
152
	cmp dword[a],0
176
	cmp dword[a],0
153
	jle .els_0
177
	jle .els_0
154
	add edi,[pp_inc_1]
178
	add edi,[pp_inc_1]
155
if INTERP_Z eq 1
179
if INTERP_Z eq 1
156
	mov eax,inc_1
180
	mov eax,inc_1
-
 
181
	shl eax,1
157
	add [pz],eax
182
	add [pz],eax
158
end if
183
end if
159
	mov eax,d_x
184
	mov eax,d_x
160
	sub [a],eax
185
	sub [a],eax
161
	jmp .end_0
186
	jmp .end_0
Line 162... Line 187...
162
 
187
 
163
.els_0:
188
.els_0:
164
	add edi,[pp_inc_2]
189
	add edi,[pp_inc_2]
165
if INTERP_Z eq 1
190
if INTERP_Z eq 1
-
 
191
	mov eax,inc_2
166
	mov eax,inc_2
192
	shl eax,1
167
	add [pz],eax
193
	add [pz],eax
168
end if
194
end if
169
	mov eax,d_y
195
	mov eax,d_y