Subversion Repositories Kolibri OS

Rev

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

Rev 2748 Rev 2758
Line 11... Line 11...
11
buf2d_bits equ byte[edi+20] ;ª®«¨ç¥á⢮ ¡¨â ¢ 1-© â®çª¥ ¨§®¡à ¦¥­¨ï
11
buf2d_bits equ byte[edi+20] ;ª®«¨ç¥á⢮ ¡¨â ¢ 1-© â®çª¥ ¨§®¡à ¦¥­¨ï
Line 12... Line 12...
12
 
12
 
13
vox_offs_tree_table equ 4
13
vox_offs_tree_table equ 4
Line 14... Line -...
14
vox_offs_data equ 12
-
 
15
 
-
 
16
;description:
14
vox_offs_data equ 12
17
; äã­ªæ¨ï à¨áãîé ï ®¤¨­®ç­ë© ¢®ªá¥«
-
 
18
;input:
-
 
19
; buf_i - ¡ãä¥à ¢ ª®â®à®¬ à¨áã¥âáï (24 ¡¨â )
-
 
20
; buf_z - ¡ãä¥à £«ã¡¨­ë (32 ¡¨â  ¯® ç¨á«ã ¯¨ªá¥«¥© ¤®«¦¥­ ᮢ¯ ¤ âì á buf_i)
-
 
21
; buf_v - ¡ãä¥à á ¨§®¡à ¦¥­¨¥¬ ¢®ªá¥«ï (32 ¡¨â )
-
 
22
; v_color - 梥â
-
 
23
align 4
-
 
24
proc draw_vox, buf_i:dword, buf_z:dword, buf_v:dword,\
-
 
25
coord_x:dword, coord_y:dword, coord_z:dword, v_color:dword
-
 
26
pushad
-
 
27
	mov eax,[coord_x]
-
 
28
	mov ebx,[coord_y]
-
 
29
	mov edi,[buf_v]
-
 
30
	mov ecx,buf2d_h
-
 
31
	mov esi,buf2d_w
-
 
32
	imul ecx,esi
-
 
33
	add esi,eax
-
 
34
	mov edx,buf2d_data
15
 
35
	cld
-
 
36
	;ecx - count pixels in voxel
-
 
37
	;edx - 㪠§ â¥«ì ­  ¤ ­­ë¥ ¢ ¢®ªá¥«ì­®¬ ¡ãä¥à¥
-
 
38
	;edi - 㪠§ â¥«ì ­  ¢®ªá¥«ì­ë© ¡ãä¥à
-
 
39
	;esi - width voxel buffer add coord x
-
 
40
	.cycle:
-
 
41
		cmp dword[edx],0
-
 
42
		je @f
-
 
43
			;¯à®¢¥à塞 ¡ãä¥à £«ã¡¨­ë
-
 
44
			push eax
-
 
45
			stdcall [buf2d_get_pixel], [buf_z],eax,ebx
-
 
46
			sub eax,[coord_z]
-
 
47
			cmp eax,[edx]
-
 
48
			jl .dr_pixel
-
 
49
				pop eax
-
 
50
				jmp @f
-
 
51
			.dr_pixel:
-
 
52
				;à¨á㥬 â®çªã
-
 
53
				pop eax
-
 
54
				stdcall [buf2d_set_pixel], [buf_i],eax,ebx,[v_color]
-
 
55
				push ecx
-
 
56
				mov ecx,[coord_z]
-
 
57
				add ecx,[edx]
-
 
58
				stdcall [buf2d_set_pixel], [buf_z],eax,ebx,ecx
-
 
59
				pop ecx
-
 
60
		@@:
-
 
61
		add edx,4
-
 
62
		inc eax
-
 
63
		cmp eax,esi
-
 
64
		jl @f
-
 
65
			inc ebx
-
 
66
			sub eax,buf2d_w
-
 
67
		@@:
-
 
68
		loop .cycle
-
 
69
popad
-
 
70
	ret
-
 
71
endp
-
 
72
 
-
 
73
;description:
-
 
74
; äã­ªæ¨ï à¨áãîé ï ¢®ªá¥«ì­ë© ®¡ê¥ªâ
-
 
75
;input:
-
 
76
; buf_i - ¡ãä¥à ¢ ª®â®à®¬ à¨áã¥âáï (24 ¡¨â )
-
 
77
; buf_z - ¡ãä¥à £«ã¡¨­ë (32 ¡¨â  ¯® ç¨á«ã ¯¨ªá¥«¥© ¤®«¦¥­ ᮢ¯ ¤ âì á buf_i)
-
 
78
; h_br - ª¨áâì á ¨§®¡à ¦¥­¨ï¬¨ ¢®ªá¥«¥© (32 ¡¨â )
-
 
79
; v_obj - ¢®ªá¥«ì­ë© ®¡ê¥ªâ
-
 
80
; k_scale - ª®íä. ¤«ï ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
-
 
81
align 4
-
 
82
proc buf2d_vox_obj_draw_3g, buf_i:dword, buf_z:dword, h_br:dword, v_obj:dword,\
-
 
83
coord_x:dword, coord_y:dword, coord_z:dword, k_scale:dword
-
 
84
pushad
-
 
85
	mov edi,[v_obj]
-
 
86
	mov eax,[k_scale]
-
 
87
	mov ebx,[coord_x]
-
 
88
 
-
 
89
;---
-
 
90
	;â¥á⮢ ï à ¬ª 
-
 
91
	mov ecx,[h_br]
-
 
92
 
-
 
93
	movzx edx,byte[ecx]
-
 
94
	movzx esi,byte[ecx+1]
-
 
95
	cmp eax,1
-
 
96
	jl .end_c0
-
 
97
		mov ecx,eax
-
 
98
		shl edx,cl
-
 
99
		shl esi,cl
-
 
100
	.end_c0:
-
 
101
	stdcall [buf2d_rect_by_size], [buf_i], ebx,[coord_y],edx,esi, 0xd0d0d0
-
 
102
;---
-
 
103
 
-
 
104
	mov ecx,[coord_y]
-
 
105
	mov edx,eax
-
 
106
	add edi,vox_offs_data
-
 
107
 
-
 
108
	mov esi,[coord_z]
-
 
109
	stdcall vox_go_in_node, [buf_i], [buf_z], [h_br], [v_obj]
-
 
110
 
-
 
111
popad
-
 
112
	ret
-
 
113
endp
-
 
114
 
-
 
115
;description:
-
 
116
; äã­ªæ¨ï à¨áãîé ï ⥭¨
-
 
117
;input:
-
 
118
; buf_i - ¡ãä¥à ¢ ª®â®à®¬ à¨áã¥âáï (24 ¡¨â )
-
 
119
; buf_z - ¡ãä¥à £«ã¡¨­ë (32 ¡¨â  ¯® ç¨á«ã ¯¨ªá¥«¥© ¤®«¦¥­ ᮢ¯ ¤ âì á buf_i)
-
 
120
; h_br - ª¨áâì á ¨§®¡à ¦¥­¨ï¬¨ ¢®ªá¥«¥© (32 ¡¨â )
16
;output:
121
; k_scale - ª®íä. ¤«ï ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
-
 
122
align 4
17
; eax - (event shl 30) + position
123
proc buf2d_vox_obj_draw_3g_shadows, buf_i:dword, buf_z:dword, h_br:dword, \
-
 
124
coord_x:dword, coord_y:dword, color:dword, k_scale:dword, prop:dword
-
 
125
locals
-
 
126
	correct_z dd 0 ;ª®à¥ªâ¨à®¢ª  ¤«ï ¡ãä¥à  £«ã¡¨­ë
-
 
127
endl
18
align 4
-
 
19
proc get_mouse_ev_scale uses ebx ecx edx, h_br:dword, coord_x:dword, coord_y:dword, scale_obj:dword, scale_img:dword
128
pushad
20
	mov ecx,[scale_obj]
129
	mov eax,[k_scale]
21
	stdcall [buf2d_vox_obj_get_img_h_3g], [h_br],ecx
130
	add eax,[prop]
22
	cmp eax,[coord_y]
131
	mov dword[correct_z],8
23
	jle .test_x
132
	sub [correct_z],eax
24
	stdcall [buf2d_vox_obj_get_img_w_3g], [h_br],ecx
Line 133... Line -...
133
	mov ebx,[coord_x]
-
 
134
	;correct_z = 8-k_scale-prop
-
 
135
 
25
	cmp eax,[coord_x]
136
	stdcall buf2d_vox_obj_get_img_w_3g, [h_br],[k_scale]
26
	jle .test_z
-
 
27
 
Line 137... Line 28...
137
	mov edx,eax ;edx - è¨à¨­  ¨§®¡à ¦¥­¨ï
28
	.no_change:
138
	stdcall buf2d_vox_obj_get_img_h_3g, [h_br],[k_scale]
29
	xor eax,eax
139
	mov esi,eax
30
	jmp .end_f
140
 
31
 
141
	mov edi,[coord_y]
32
	.test_x:
142
	mov ecx,edx
33
	mov ebx,[h_br]
143
	add edx,ebx ;è¨à¨­  + ®âáâ㯠᫥¢ 
34
	movzx ebx,byte[ebx+1]
144
	imul ecx,esi
35
	add eax,ebx
-
 
36
	cmp eax,[coord_y]
145
	cld
37
	jl .no_change
146
	.cycle_0:
38
	stdcall [buf2d_vox_obj_get_img_w_3g], [h_br],ecx
147
		stdcall [buf2d_get_pixel], [buf_z],ebx,edi
39
	cmp eax,[coord_x]
-
 
40
	jl .no_change
148
		cmp eax,0
41
	mov ebx,eax
149
		je @f
42
	mov ecx,[scale_img]
150
			stdcall vox_correct_z, [correct_z]
43
	inc ecx
151
			push eax
44
	shr ebx,cl
-
 
45
	xor edx,edx
152
			stdcall [buf2d_get_pixel], [buf_i],ebx,edi
46
	mov eax,[coord_x]
153
			stdcall combine_colors_3,eax,[color] ;,eax
47
	div ebx
154
			stdcall [buf2d_set_pixel], [buf_i],ebx,edi,eax
-
 
155
		@@:
-
 
156
		inc ebx
-
 
157
		cmp ebx,edx
-
 
158
		jl @f
-
 
159
			mov ebx,[coord_x]
-
 
160
			inc edi
-
 
161
		@@:
-
 
162
		loop .cycle_0
-
 
163
 
-
 
164
popad
-
 
165
	ret
-
 
166
endp
-
 
167
 
-
 
168
;output:
-
 
169
; eax - scaled coord z
48
	dec ecx
170
align 4
49
	xor ebx,ebx
171
proc vox_correct_z uses ecx, correct_z:dword
-
 
172
	mov ecx,[correct_z]
50
	inc ebx
173
	cmp ecx,0
51
	shl ebx,cl
174
	je .end_f
-
 
175
	jl .end_0
-
 
176
		shl eax,cl
-
 
177
		jmp .end_f
-
 
178
	.end_0:
-
 
179
		neg ecx
-
 
180
		inc ecx
-
 
181
		shr eax,cl
-
 
182
	.end_f:
-
 
183
	ret
-
 
184
endp
-
 
185
 
-
 
186
;output:
-
 
187
; eax - color
-
 
188
align 4
-
 
189
proc combine_colors_3 uses ebx ecx edx edi esi, col_0:dword, col_1:dword, alpha:dword
-
 
190
 
-
 
191
	mov ebx,[col_0]
-
 
192
	mov ecx,[col_1]
-
 
193
	movzx di,byte[alpha] ;pro
-
 
194
	mov si,0x00ff ;---get transparent---
-
 
195
	sub si,di ;256-pro
-
 
196
 
-
 
197
	;---blye---
-
 
198
	movzx ax,bl
-
 
199
	imul ax,si
-
 
200
	movzx dx,cl
-
 
201
	imul dx,di
-
 
202
	add ax,dx
-
 
203
	mov cl,ah
-
 
204
	;---green---
-
 
205
	movzx ax,bh
-
 
206
	imul ax,si
-
 
207
	movzx dx,ch
-
 
208
	imul dx,di
-
 
209
	add ax,dx
-
 
210
	mov ch,ah
-
 
211
	shr ebx,16
-
 
212
	ror ecx,16
-
 
213
	;---red---
-
 
214
	movzx ax,bl
-
 
215
	imul ax,si
-
 
216
	movzx dx,cl
-
 
217
	imul dx,di
-
 
218
	add ax,dx
-
 
219
 
-
 
220
	shl eax,8
-
 
221
	ror ecx,16
-
 
222
	mov ax,cx
-
 
223
	and eax,0xffffff
-
 
224
 
-
 
225
	ret
-
 
226
endp
-
 
227
 
-
 
228
;input:
-
 
229
; h_br - ª¨áâì á ¨§®¡à ¦¥­¨ï¬¨ ¢®ªá¥«¥© (32 ¡¨â )
-
 
230
; ebx - coord_x
-
 
231
; ecx - coord_y
-
 
232
; esi - coord_z
-
 
233
; edx - ã஢¥­ì ⥪ã襣® 㧫 
-
 
234
; edi - 㪠§ â¥«ì ­  ¤ ­­ë¥ ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
-
 
235
align 4
-
 
236
proc vox_go_in_node, buf_i:dword, buf_z:dword, h_br:dword, v_obj:dword
-
 
237
;, coord_z:dword
-
 
238
	cmp byte[edi+3],0 ;ᬮâਬ ¥áâì «¨ ¯®¤¤¥à¥¢ìï
-
 
239
	je .sub_trees
-
 
240
		;४ãàᨢ­ë© ¯¥à¥¡®à ¯®¤¤¥à¥¢ì¥¢
-
 
241
		push eax ecx
-
 
242
 
-
 
243
		;¯à®à¨á®¢ª  à ¬ª¨ ¥á«¨ à §¬¥à 㧫  = 1
-
 
244
		cmp edx,0
-
 
245
		jne .end_2
-
 
246
			push eax
-
 
247
				stdcall vox_get_sub_brush,[h_br],0 ;®¯à¥¤¥«ï¥¬ ª¨áâì ¤«ï à¨á®¢ ­¨ï
52
	cmp eax,ebx
248
				cmp eax,0 ;¥á«¨ ª¨áâì ­¥ ­ ©¤¥­ 
-
 
249
				je @f
-
 
250
					stdcall draw_vox, [buf_i], [buf_z], eax, ebx,ecx,esi, [edi]
-
 
251
				@@:
-
 
252
			pop eax
-
 
253
		.end_2:
-
 
254
 
-
 
255
		;¢å®¤ ¢­ãâàì 㧫 
-
 
256
		dec edx
-
 
257
;---
-
 
258
		push ebx
-
 
259
			;mov eax,(7-4/2)
-
 
260
			mov ebx,[h_br]
53
	jge @f
261
			movzx eax,byte[ebx+1]
-
 
262
			movzx ebx,byte[ebx+2]
-
 
263
			shr ebx,1
-
 
264
			sub eax,ebx
-
 
265
		cmp edx,1
54
		or eax,1 shl 30
266
		jl .end_c1
-
 
267
		push ecx
-
 
268
			mov ecx,edx
-
 
269
			shl eax,cl
-
 
270
			shl ebx,cl ;???
-
 
271
		pop ecx
-
 
272
		.end_c1:
-
 
273
		add esi,ebx ;???
-
 
274
		pop ebx
-
 
275
		add ecx,eax ;ª®à¥ªâ¨à®¢ª  ¢ëá®âë ¯®¤ ¢®ªá¥«ì ­¨¦­¥£® ã஢­ï
-
 
276
;---
-
 
277
		mov ah,byte[edi+3]
-
 
278
		add edi,4
-
 
279
		mov al,8
-
 
280
		.cycle:
-
 
281
			bt ax,8 ;â¥áâ¨à㥬 ⮫쪮 ah
-
 
282
			jnc .c_next
-
 
283
				push ebx ecx esi
-
 
284
				stdcall vox_corect_coords, [h_br], [v_obj]
-
 
285
				stdcall vox_go_in_node, [buf_i], [buf_z], [h_br], [v_obj]
-
 
286
				pop esi ecx ebx
-
 
287
			.c_next:
-
 
288
			shr ah,1
-
 
289
			dec al
-
 
290
			jnz .cycle
-
 
291
 
-
 
292
		;¢ë室 ¨§ 㧫 
55
		jmp .end_f
293
		inc edx
-
 
294
		pop ecx eax
-
 
295
 
-
 
296
		jmp .end_f
-
 
297
	.sub_trees:
-
 
298
		;à¨á㥬 㧥«
-
 
299
		push eax
-
 
300
			stdcall vox_get_sub_brush,[h_br],edx ;®¯à¥¤¥«ï¥¬ ª¨áâì ¤«ï à¨á®¢ ­¨ï
-
 
301
			cmp eax,0 ;¥á«¨ ª¨áâì ­¥ ­ ©¤¥­ 
-
 
302
			je @f
-
 
303
				stdcall draw_vox, [buf_i], [buf_z], eax, ebx,ecx,esi, [edi]
-
 
304
			@@:
-
 
305
		pop eax
-
 
306
 
-
 
307
		add edi,4
-
 
308
	.end_f:
-
 
309
	ret
-
 
310
endp
-
 
311
 
-
 
312
;¨§¢«¥ª ¥¬ ¨§ h_br 㪠§ â¥«ì ­  ¡ãä¥à á ¨§®¡à ¦¥­¨¥¬ ¢®ªá¥«ï, 㪠§ ­­®£® ¯®à浪  n
-
 
313
align 4
-
 
314
proc vox_get_sub_brush uses ebx ecx, h_br:dword, n:dword
-
 
315
	xor eax,eax
-
 
316
	mov ebx,[n]
-
 
317
	cmp ebx,0
-
 
318
	jl @f
-
 
319
	mov ecx,[h_br]
-
 
320
	cmp bl,byte[ecx+3]
-
 
321
	jg @f
-
 
322
		add ecx,4
-
 
323
		imul ebx,BUF_STRUCT_SIZE
-
 
324
		mov eax,ebx
-
 
Line 325... Line -...
325
		add eax,ecx
-
 
326
	@@:
-
 
327
	ret
-
 
328
endp
-
 
329
 
-
 
330
;äã­ªæ¨ï ¤«ï ª®à¥ªâ¨à®¢ª¨ ª®®à¤¨­ â
-
 
331
;­ ¯à ¢«¥­¨ï ®á¥© ª®®à¤¨­ â ¢ ¢®ªá¥«¥:
-
 
332
;*z
-
 
333
;|
-
 
334
;+
-
 
335
;  * y
-
 
336
; /
-
 
337
;+
-
 
338
; \
-
 
339
;  * x
-
 
340
;input:
-
 
341
;  al - ­®¬¥à 㧫  ¢ ¤¥à¥¢¥ (®â 1 ¤® 8)
56
	@@:
342
; ebx - ª®®à¤¨­ â  x
-
 
343
; ecx - ª®®à¤¨­ â  y
-
 
344
; esi - ª®®à¤¨­ â  z
-
 
345
; edx - ã஢¥­ì ⥪ã襣® 㧫 
-
 
346
;output:
-
 
347
; ebx - ­®¢ ï ª®®à¤¨­ â  x
-
 
348
; ecx - ­®¢ ï ª®®à¤¨­ â  y
-
 
349
; esi - ­®¢ ï ª®®à¤¨­ â  z
-
 
350
align 4
-
 
351
proc vox_corect_coords, h_br:dword, v_obj:dword
-
 
352
locals
-
 
353
	osn_w_2 dd ? ;è¨à¨­  ®á­®¢ ­¨ï ¥¤¨­¨ç­®£® ¢®ªá¥«ï : 2
-
 
354
	vox_h dd ? ;¢ëá®â  ¥¤¨­¨ç­®£® ¢®ªá¥«ï
-
 
355
endl
-
 
356
	cmp edx,0
57
	sub eax,ebx
357
	jl .end_f ;¤«ï ã᪮७¨ï ®âà¨á®¢ª¨
58
	or eax,2 shl 30
358
 
59
	jmp .end_f
359
	push eax edi
60
 
360
	and eax,15 ;¢ë¤¥«ï¥¬ ­®¬¥à 㧫  ¢ ¤¥à¥¢¥
-
 
361
	mov edi,[v_obj]
61
	.test_z:
362
	add edi,vox_offs_tree_table
62
	mov ebx,[h_br]
363
	add edi,8
-
 
364
	sub edi,eax
-
 
365
 
-
 
366
	push ebx ecx
-
 
367
		mov ebx,[h_br]
-
 
368
 
-
 
369
		movzx ecx,byte[ebx]
63
	movzx ebx,byte[ebx]
-
 
64
	add eax,ebx
370
		shr ecx,1
65
	cmp eax,[coord_x]
371
		mov dword[osn_w_2],ecx
66
	jl .no_change
372
 
67
	mov ebx,[h_br]
373
		movzx ecx,byte[ebx+2]
68
	movzx ebx,byte[ebx+1]
374
		movzx ebx,byte[ebx+1]
69
	mov ecx,[scale_obj]
375
		sub ebx,ecx
-
 
376
		mov dword[vox_h],ebx
70
	shl ebx,cl
377
		shr ecx,1
71
	mov ecx,[scale_img]
378
		mov eax,ecx ;eax - ¢ëá®â  ®á­®¢ ­¨ï ¥¤¨­¨ç­®£® ¢®ªá¥«ï : 2
72
	shr ebx,cl
379
	pop ecx ebx
73
	mov eax,[coord_y]
380
 
74
	xor edx,edx
381
	cmp edx,1
75
	div ebx
382
	jl .no_scale ;¢® ¨§¡¥¦ ­¨¥ § æ¨ª«¨¢ ­¨ï
76
	;¨­¢¥àá¨ï ª®®à¤¨­ âë y
383
	push ecx
77
	xor edx,edx
384
		mov ecx,edx
78
	inc edx
Line 385... Line -...
385
		shl eax,cl
-
 
386
		shl dword[osn_w_2],cl
-
 
387
		shl dword[vox_h],cl
-
 
388
	pop ecx
-
 
389
	.no_scale:
-
 
390
 
-
 
391
;	add esi,eax ;¬¥­ï¥¬ £«ã¡¨­ã ¤«ï ¡ãä¥à  z (ª®¬¯¥­á æ¨ï ¤«ï ª®®à¤¨­ âë y)
-
 
392
	bt word[edi],0 ;test voxel coord x
-
 
393
	jnc @f
-
 
394
		add ebx,[osn_w_2]
-
 
395
		add ecx,eax
-
 
396
		add esi,eax ;¬¥­ï¥¬ £«ã¡¨­ã ¤«ï ¡ãä¥à  z
-
 
397
	@@:
-
 
398
	bt word[edi],1 ;test voxel coord y
-
 
399
	jnc @f
-
 
400
		add ebx,[osn_w_2]
-
 
401
		sub ecx,eax
-
 
402
		sub esi,eax ;¬¥­ï¥¬ £«ã¡¨­ã ¤«ï ¡ãä¥à  z
-
 
403
	@@:
79
	shl edx,cl
404
	bt word[edi],2 ;test voxel coord z
80
	dec edx
405
	jnc @f
81
	sub edx,eax
Line 406... Line 82...
406
		sub ecx,[vox_h]
82
	mov eax,edx
Line 458... Line 134...
458
	mov byte[ebx+3],ch
134
	mov byte[ebx+3],ch
Line 459... Line 135...
459
 
135
 
460
	ret
136
	ret
Line 461... Line -...
461
endp
-
 
462
 
-
 
463
;à¨á®¢ ­¨¥ á१  ¨§®¡à ¦¥­¨ï
-
 
464
; v_size - à §¬¥à ª¢ ¤à â  á ¢®ªá¥«¥¬
-
 
465
; k_scale - á⥯¥­ì ¤¥â «¨§ æ¨¨ ¨§®¡à ¦¥­¨ï
-
 
466
; n_plane - ­®¬¥à ¯«®áª®á⨠á¥ç­¨ï (¢ ¯à¥¤¥« å ®â 0 ¤® 2^k_scale - 1)
-
 
467
; b_color - 梥⠣࠭¨æë
-
 
468
align 4
-
 
469
proc buf2d_vox_obj_draw_pl, buf_i:dword, v_obj:dword, coord_x:dword,\
-
 
470
coord_y:dword, v_size:dword, k_scale:dword, n_plane:dword, b_color:dword
-
 
471
	cmp [k_scale],0
-
 
472
	jl .end_f
-
 
473
pushad
-
 
474
	mov eax,[v_size]
-
 
475
	mov ecx,[k_scale]
-
 
476
	mov ebx,eax
-
 
477
	cmp ecx,1
-
 
478
	jl @f
-
 
479
		shl ebx,cl
-
 
480
	@@:
-
 
481
	;ebx - ¯®«­ë© à §¬¥à ¨§®¡à ¦¥­¨ï
-
 
482
	stdcall [buf2d_rect_by_size], [buf_i], [coord_x],[coord_y],ebx,ebx, [b_color] ;à ¬ª  ­  à¨áã­®ª
-
 
483
	add ebx,[coord_y]
-
 
484
	mov edx,[n_plane]
-
 
485
	imul edx,eax
-
 
486
	add edx,[coord_x]
-
 
487
	stdcall [buf2d_filled_rect_by_size], [buf_i], edx,ebx, eax,eax, [b_color] ;ª¢ ¤à â¨ª, ¯®ª §ë¢ î騩 ­®¬¥à á¥ç¥­¨ï
-
 
488
 
-
 
489
	;à¨á®¢ ­¨¥ â®ç¥ª ¤«ï á¥âª¨
-
 
490
	push ecx
-
 
491
	mov edi,1
-
 
492
	cmp ecx,1
-
 
493
	jl @f
-
 
494
		shl edi,cl
-
 
495
	@@:
-
 
496
	dec edi
-
 
497
	cmp edi,1
-
 
498
	jl .end_0
-
 
499
	mov ecx,edi
-
 
500
	imul ecx,edi
-
 
501
	mov ebx,[coord_x]
-
 
502
	mov edx,[coord_y]
-
 
503
	add edx,eax
-
 
504
	xor esi,esi
-
 
505
	cld
-
 
506
	@@:
-
 
507
		add ebx,eax
-
 
508
		inc esi
-
 
509
		stdcall [buf2d_set_pixel], [buf_i], ebx,edx, [b_color]
-
 
510
		cmp esi,edi
-
 
511
		jl .end_1
-
 
512
			;¯¥à¥å®¤ â®ç¥ª ­  ­®¢ãî áâபã
-
 
513
			xor esi,esi
-
 
514
			mov ebx,[coord_x]
-
 
515
			add edx,eax
-
 
516
		.end_1:
-
 
517
		loop @b
-
 
518
	.end_0:
-
 
519
	pop ecx
-
 
520
 
-
 
521
	;eax - à §¬¥à ®¤­®£® ª¢ ¤à â 
-
 
522
	;edi - 㪠§ â¥«ì à¨áã¥¬ë¥ ¤ ­­ë¥ ¨§ ®¡ê¥ªâ 
-
 
523
	mov ebx,[coord_x]
-
 
524
	mov edx,[coord_y]
-
 
525
	mov edi,[v_obj]
-
 
526
	add edi,vox_offs_data
-
 
527
	xor esi,esi
-
 
528
	push eax
-
 
529
	imul eax,[n_plane]
-
 
530
	stdcall draw_sub_vox_obj_pl, [buf_i],[v_obj], eax
-
 
531
popad
-
 
532
	.end_f:
-
 
533
	ret
-
 
534
endp
-
 
535
 
-
 
536
;input:
-
 
537
; ebx - coord_x
-
 
538
; edx - coord_y
-
 
539
; esi - coord_z
-
 
540
; ecx - ã஢¥­ì ⥪ã襣® 㧫 
-
 
541
; edi - 㪠§ â¥«ì ­  ¤ ­­ë¥ ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
-
 
542
align 4
-
 
543
proc draw_sub_vox_obj_pl, buf_i:dword, v_obj:dword, clip_z:dword,\
-
 
544
v_size:dword
-
 
545
	cmp byte[edi+3],0 ;ᬮâਬ ¥áâì «¨ ¯®¤¤¥à¥¢ìï
-
 
546
	je .sub_trees
-
 
547
 
-
 
548
		;¯à®à¨á®¢ª  à ¬ª¨ ¥á«¨ à §¬¥à 㧫  = 1
-
 
549
		cmp ecx,0
-
 
550
		jne @f
-
 
551
		;¯à®¢¥àª  £«ã¡¨­ë esi
-
 
552
		;clip_z=n_plane*v_size
-
 
553
		stdcall vox_is_clip, [clip_z],[v_size]
-
 
554
		cmp eax,0
-
 
555
		je @f
-
 
556
			push ecx
-
 
557
			mov ecx,dword[edi]
-
 
558
			and ecx,0xffffff
-
 
559
			stdcall [buf2d_rect_by_size], [buf_i], ebx,edx, [v_size],[v_size],ecx
-
 
560
			pop ecx
-
 
561
		@@:
-
 
562
 
-
 
563
		;४ãàᨢ­ë© ¯¥à¥¡®à ¯®¤¤¥à¥¢ì¥¢
-
 
564
		push edx
-
 
565
 
-
 
566
		;¢å®¤ ¢­ãâàì 㧫 
-
 
567
		dec ecx
-
 
568
;---
-
 
569
		mov eax,[v_size]
-
 
570
		cmp ecx,1
-
 
571
		jl @f
-
 
572
			shl eax,cl
-
 
573
		@@:
-
 
574
		add edx,eax ;ª®à¥ªâ¨à®¢ª  ¢ëá®âë ¯®¤ ¢®ªá¥«ì ­¨¦­¥£® ã஢­ï
-
 
575
;---
-
 
576
		mov ah,byte[edi+3]
-
 
577
		add edi,4
-
 
578
		mov al,8
-
 
579
		.cycle:
-
 
580
			bt ax,8 ;â¥áâ¨à㥬 ⮫쪮 ah
-
 
581
			jnc .c_next
-
 
582
				push eax ebx edx esi
-
 
583
				stdcall vox_corect_coords_pl, [v_obj],[v_size]
-
 
584
				stdcall draw_sub_vox_obj_pl, [buf_i],[v_obj],[clip_z],[v_size]
-
 
585
				pop esi edx ebx eax
-
 
586
			.c_next:
-
 
587
			shr ah,1
-
 
588
			dec al
-
 
589
			jnz .cycle
-
 
590
 
-
 
591
		;¢ë室 ¨§ 㧫 
-
 
592
		inc ecx
-
 
593
		pop edx
-
 
594
 
-
 
595
		jmp .end_f
-
 
596
	.sub_trees:
-
 
597
		cmp ecx,0
-
 
598
		jl .end_0 ;­¥ à¨á㥬 ®ç¥­ì ¬ «¥­ìª¨¥ ¢®ªá¥«¨
-
 
599
 
-
 
600
		;¯à®¢¥àª  £«ã¡¨­ë esi
-
 
601
		;clip_z=n_plane*v_size
-
 
602
		stdcall vox_is_clip, [clip_z],[v_size]
-
 
603
		cmp eax,0
-
 
604
		je .end_0
-
 
605
 
-
 
606
		;à¨á㥬 㧥«
-
 
607
		mov eax,[edi]
-
 
608
		and eax,0xffffff
-
 
609
		push eax ;梥â 㧫 
-
 
610
 
-
 
611
		mov eax,[v_size]
-
 
612
		cmp ecx,1
-
 
613
		jl @f
-
 
614
			shl eax,cl ;à §¬¥à 㧫 
-
 
615
		@@:
-
 
616
 
-
 
617
		stdcall [buf2d_filled_rect_by_size], [buf_i], ebx,edx, eax,eax
-
 
618
		.end_0:
-
 
619
		add edi,4
-
 
620
	.end_f:
-
 
621
	ret
-
 
622
endp
-
 
623
 
-
 
624
;¯à®¢¥àª  £«ã¡¨­ë esi
-
 
625
;input:
-
 
626
; ecx - ã஢¥­ì ⥪ã襣® 㧫 
-
 
627
; esi - coord z
-
 
628
; clip_z - n_plane*v_size
-
 
629
;output:
-
 
630
; eax - 0 if no draw, 1 if draw
-
 
631
align 4
-
 
632
proc vox_is_clip uses ebx edi, clip_z:dword, v_size:dword
-
 
633
	xor eax,eax
-
 
634
	mov ebx,[clip_z]
-
 
635
	mov edi,[v_size]
-
 
636
	cmp ecx,1
-
 
637
	jl @f
-
 
638
		shl edi,cl
-
 
639
	@@:
-
 
640
	;edi = 2^ecx
-
 
641
	add edi,esi
-
 
642
	cmp edi,ebx ;if (esi+2^ecx*v_size <= (n_plane*v_size)) no draw
-
 
643
	jle @f
-
 
644
	add ebx,[v_size]
-
 
645
	cmp esi,ebx ;if (esi >= (n_plane+1)*v_size) no draw
-
 
646
	jge @f
-
 
647
		inc eax
-
 
648
	@@:
-
 
649
	ret
-
 
650
endp
-
 
651
 
-
 
652
;äã­ªæ¨ï ¤«ï ª®à¥ªâ¨à®¢ª¨ ª®®à¤¨­ â
-
 
653
;­ ¯à ¢«¥­¨ï ®á¥© ª®®à¤¨­ â ¢ ¢®ªá¥«¥:
-
 
654
;*z
-
 
655
;|
-
 
656
;+-* x
-
 
657
;input:
-
 
658
;  al - ­®¬¥à 㧫  ¢ ¤¥à¥¢¥ (®â 1 ¤® 8)
-
 
659
; ebx - ª®®à¤¨­ â  x
-
 
660
; edx - ª®®à¤¨­ â  y
-
 
661
; esi - ª®®à¤¨­ â  z
-
 
662
; ecx - ã஢¥­ì ⥪ã襣® 㧫 
-
 
663
;output:
-
 
664
; ebx - ­®¢ ï ª®®à¤¨­ â  x
-
 
665
; edx - ­®¢ ï ª®®à¤¨­ â  y
-
 
666
; esi - ­®¢ ï ª®®à¤¨­ â  z
-
 
667
align 4
-
 
668
proc vox_corect_coords_pl, v_obj:dword, v_size:dword
-
 
669
	cmp ecx,0
-
 
670
	jl .end_f ;¤«ï ã᪮७¨ï ®âà¨á®¢ª¨
-
 
671
 
-
 
672
	push eax edi
-
 
673
	and eax,15 ;¢ë¤¥«ï¥¬ ­®¬¥à 㧫  ¢ ¤¥à¥¢¥
-
 
674
	mov edi,[v_obj]
-
 
675
	add edi,vox_offs_tree_table
-
 
676
	add edi,8
-
 
677
	sub edi,eax
-
 
678
 
-
 
679
	mov eax,[v_size] ;eax - ¢ëá®â  ®á­®¢ ­¨ï ¥¤¨­¨ç­®£® ¢®ªá¥«ï
-
 
680
	cmp ecx,1
-
 
681
	jl @f ;¢® ¨§¡¥¦ ­¨¥ § æ¨ª«¨¢ ­¨ï
-
 
682
		shl eax,cl
-
 
683
	@@:
-
 
684
 
-
 
685
	bt word[edi],0 ;test voxel coord x
-
 
686
	jnc @f
-
 
687
		add ebx,eax
-
 
688
	@@:
-
 
689
	bt word[edi],1 ;test voxel coord y
-
 
690
	jnc @f
-
 
691
		add esi,eax ;¬¥­ï¥¬ £«ã¡¨­ã ¤«ï ¡ãä¥à  z
-
 
692
	@@:
-
 
693
	bt word[edi],2 ;test voxel coord z
-
 
694
	jnc @f
-
 
695
		sub edx,eax
-
 
696
	@@:
-
 
697
	pop edi eax
-
 
698
	.end_f:
-
 
699
	ret
-
 
700
endp
137
endp
701
 
138
 
702
;
139
;
703
;output:
140
;output:
704
; eax - ç¨á«® 㧫®¢ ¢ ®¡ê¥ªâ¥ v_obj
141
; eax - ç¨á«® 㧫®¢ ¢ ®¡ê¥ªâ¥ v_obj
Line 709... Line 146...
709
	xor eax,eax
146
	xor eax,eax
710
	stdcall vox_obj_rec0
147
	stdcall vox_obj_rec0
711
	ret
148
	ret
712
endp
149
endp
Line -... Line 150...
-
 
150
 
713
 
151
;???
714
;input:
152
;input:
715
; edi - 㪠§ â¥«ì ­  ¤ ­­ë¥ ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
153
; edi - 㪠§ â¥«ì ­  ¤ ­­ë¥ ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
716
;output:
154
;output:
717
; eax - eax + ç¨á«® 㧫®¢ ¢ ¤ ­­ëå ¢®ªá. ®¡ê¥ªâ 
155
; eax - eax + ç¨á«® 㧫®¢ ¢ ¤ ­­ëå ¢®ªá. ®¡ê¥ªâ 
Line 753... Line 191...
753
	shl eax,2
191
	shl eax,2
754
	add eax,vox_offs_data
192
	add eax,vox_offs_data
755
	ret
193
	ret
756
endp
194
endp
Line 757... Line -...
757
 
-
 
758
if 0
-
 
759
;output:
-
 
760
; eax - 㪠§ â¥«ì ­  ¤ ­­ë¥ ¢®ªá¥«ï
-
 
761
align 4
-
 
762
proc buf2d_vox_obj_is_node uses ebx ecx edx edi esi, v_obj:dword,\
-
 
763
coord_x:dword,coord_y:dword,coord_z:dword,k_scale:dword
-
 
764
	mov edi,[v_obj]
-
 
765
	add edi,vox_offs_data
-
 
766
	mov esi,[k_scale]
-
 
767
	xor eax,eax
-
 
768
	xor edx,edx
-
 
769
	stdcall vox_obj_rec1, [v_obj],[coord_x],[coord_y],[coord_z], 0,0,0
-
 
770
	ret
-
 
771
endp
-
 
772
 
-
 
773
;input:
-
 
774
; eax - ...
-
 
775
; edx - ...
-
 
776
; edi - 㪠§ â¥«ì ­  ¤ ­­ë¥ ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
-
 
777
; esi - ã஢¥­ì ¨áª®¬®£® ¢®ªá¥«ï
-
 
778
align 4
-
 
779
proc vox_obj_rec1, v_obj:dword, coord_x:dword,coord_y:dword,coord_z, tc_x:dword,tc_y:dword,tc_z
-
 
780
	cmp edx,esi 
-
 
781
	jne @f
-
 
782
		mov ebx,[tc_x]
-
 
783
		cmp [coord_x],ebx
-
 
784
		jne @f
-
 
785
		mov ebx,[tc_y]
-
 
786
		cmp [coord_y],ebx
-
 
787
		jne @f
-
 
788
		mov ebx,[tc_z]
-
 
789
		cmp [coord_z],ebx
-
 
790
		jne @f
-
 
791
		mov eax,edi
-
 
792
	@@:
-
 
793
 
-
 
794
	cmp eax,0
-
 
795
	jne .end_f ;¥á«¨ 㪠§ â¥«ì 㦥 ­ ©¤¥­
-
 
796
 
-
 
797
	cmp byte[edi+3],0 ;ᬮâਬ ¥áâì «¨ ¯®¤¤¥à¥¢ìï
-
 
798
	je .sub_trees
-
 
799
		inc edx
-
 
800
		shl dword[tc_x],1
-
 
801
		shl dword[tc_y],1
-
 
802
		shl dword[tc_z],1
-
 
803
		;४ãàᨢ­ë© ¯¥à¥¡®à ¯®¤¤¥à¥¢ì¥¢
-
 
804
		
-
 
805
		mov bh,byte[edi+3]
-
 
806
		add edi,4
-
 
807
		;mov bl,8
-
 
808
		xor bl,bl
-
 
809
		.cycle:
-
 
810
			bt bx,8 ;â¥áâ¨à㥬 ⮫쪮 bh
-
 
811
			jnc .c_next
-
 
812
push dword[tc_x]
-
 
813
push dword[tc_y]
-
 
814
push dword[tc_z]
-
 
815
				push edx
-
 
816
				movzx edx,bl
-
 
817
				add edx,[v_obj]
-
 
818
				add edx,vox_offs_tree_table
-
 
819
				bt word[edx],0 ;coord x
-
 
820
				jnc .end_x
-
 
821
					inc dword[tc_x]
-
 
822
				.end_x:
-
 
823
				bt word[edx],1 ;coord y
-
 
824
				jnc .end_y
-
 
825
					inc dword[tc_y]
-
 
826
				.end_y:
-
 
827
				bt word[edx],2 ;coord z
-
 
828
				jnc .end_z
-
 
829
					inc dword[tc_z]
-
 
830
				.end_z:
-
 
831
				pop edx
-
 
832
				push ebx ecx
-
 
833
				stdcall vox_obj_rec1, [v_obj],[coord_x],[coord_y],[coord_z], [tc_x],[tc_y],[tc_z]
-
 
834
				pop ecx ebx
-
 
835
pop dword[tc_z]
-
 
836
pop dword[tc_y]
-
 
837
pop dword[tc_x]
-
 
838
			.c_next:
-
 
839
			shr bh,1
-
 
840
			inc bl
-
 
841
			;jnz .cycle
-
 
842
			cmp bl,8
-
 
843
			jl .cycle
-
 
844
		
-
 
845
		dec edx
-
 
846
		jmp .end_f
-
 
847
	.sub_trees:
-
 
848
		add edi,4
-
 
849
	.end_f:
-
 
850
	ret
-
 
851
endp
-
 
852
end if
-
 
853
 
195
 
854
; ᮧ¤ ­¨¥ ¢®ªá¥«ï ¢ 3 íâ ¯ :
196
; ᮧ¤ ­¨¥ ¢®ªá¥«ï ¢ 3 íâ ¯ :
855
; 1) ¨é¥¬ ¬¥áâ® ¢ áâàãªâãॠ¤¥à¥¢ , ªã¤  ­ ¤® ¢áâ ¢¨âì (¥á«¨ ¢¥â¢ì áãé¥áâ¢ã¥â, 2-© íâ ¯ ¯à®¯ã᪠¥¬)
197
; 1) ¨é¥¬ ¬¥áâ® ¢ áâàãªâãॠ¤¥à¥¢ , ªã¤  ­ ¤® ¢áâ ¢¨âì (¥á«¨ ¢¥â¢ì áãé¥áâ¢ã¥â, 2-© íâ ¯ ¯à®¯ã᪠¥¬)
856
; 2) ¢áâ ¢«ï¥¬ ­®¢ãî ¢¥â¢ì á ¢®ªá¥«¥¬ (3-© íâ ¯ 㦥 ­¥ ¤¥« ¥¬)
198
; 2) ¢áâ ¢«ï¥¬ ­®¢ãî ¢¥â¢ì á ¢®ªá¥«¥¬ (3-© íâ ¯ 㦥 ­¥ ¤¥« ¥¬)
857
; 3) ¬¥­ï¥¬ 梥⠢®ªá¥«ï
199
; 3) ¬¥­ï¥¬ 梥⠢®ªá¥«ï
858
align 4
200
align 4
859
proc buf2d_vox_obj_create_node, v_obj:dword,coord_x:dword,coord_y:dword,\
201
proc buf2d_vox_obj_create_node, v_obj:dword,coord_x:dword,coord_y:dword,\
860
coord_z:dword,color:dword,k_scale:dword
202
coord_z:dword,k_scale:dword,color:dword
861
pushad
203
pushad
862
locals
204
locals
863
	p_node dd 0 ;த¨â¥«ì᪨© 㧥«
205
	p_node dd 0 ;த¨â¥«ì᪨© 㧥«
864
endl
-
 
Line 865... Line 206...
865
;stdcall print_err, txt_f1, txt_b
206
endl
866
 
207
 
867
	mov edi,[v_obj]
208
	mov edi,[v_obj]
868
	add edi,vox_offs_data
209
	add edi,vox_offs_data
Line 873... Line 214...
873
	.found:
214
	.found:
874
	stdcall vox_obj_get_node_position, [v_obj],[coord_x],[coord_y],[coord_z],esi
215
	stdcall vox_obj_get_node_position, [v_obj],[coord_x],[coord_y],[coord_z],esi
875
	movzx bx,byte[edi+3]
216
	movzx bx,byte[edi+3]
876
	mov [p_node],edi
217
	mov [p_node],edi
877
	add edi,4
218
	add edi,4
878
;stdcall print_err, txt_chi, txt_e
-
 
-
 
219
 
879
	cmp eax,0
220
	cmp eax,0
880
	je .end_1
221
	je .end_1
881
	mov ecx,eax
222
	mov ecx,eax
882
	cld
223
	cld
883
	@@: ; 横«  ¤«ï ¯à®¯ã᪠ ¯à¥¤ë¤ãé¨å ¯®¤¤¥à¥¢ì¥¢ ¢ 㧫¥
224
	@@: ;横« ¤«ï ¯à®¯ã᪠ ¯à¥¤ë¤ãé¨å ¯®¤¤¥à¥¢ì¥¢ ¢ 㧫¥
884
		bt bx,0 ;¯à®¢¥à塞 ¥áâì «¨ ¤®ç¥à­¨¥ 㧫ë
225
		bt bx,0 ;¯à®¢¥à塞 ¥áâì «¨ ¤®ç¥à­¨¥ 㧫ë
885
		jnc .end_0
226
		jnc .end_0
886
;stdcall print_err, txt_st, txt_e
-
 
887
			xor eax,eax
227
			xor eax,eax
888
			stdcall vox_obj_rec0 ;¢ eax ¢ëç¨á«ï¥âáï ç¨á«® ¤®ç¥à­¨å 㧫®¢, ¢ ¤ ­­®© ¢¥â¢¨
228
			stdcall vox_obj_rec0 ;¢ eax ¢ëç¨á«ï¥âáï ç¨á«® ¤®ç¥à­¨å 㧫®¢, ¢ ¤ ­­®© ¢¥â¢¨
889
		.end_0:
229
		.end_0:
890
		shr bx,1
230
		shr bx,1
891
		loop @b
231
		loop @b
Line 926... Line 266...
926
	.end_2:
266
	.end_2:
927
popad
267
popad
928
	ret
268
	ret
929
endp
269
endp
Line 930... Line 270...
930
 
270
 
931
; 㤠«¥­¨¥ ¢®ªá¥«ï ¢ 3 íâ ¯ :
271
; 㤠«¥­¨¥ ¢®ªá¥«ï ¢ 2 íâ ¯ :
932
; 1) ¨é¥¬ ¬¥áâ® ¢ áâàãªâãॠ¤¥à¥¢ , £¤¥ ¥áâì 㤠«ï¥¬ë© 㧥« (¥á«¨ ¢¥â¢ì ­¥ áãé¥áâ¢ã¥â, ¢ë室¨¬ ¨§ ä㭪樨)
272
; 1) ¨é¥¬ ¬¥áâ® ¢ áâàãªâãॠ¤¥à¥¢ , £¤¥ ¥áâì 㤠«ï¥¬ë© 㧥« (¥á«¨ ¢¥â¢ì ­¥ áãé¥áâ¢ã¥â, ¢ë室¨¬ ¨§ ä㭪樨)
933
; 2) ¢áâ ¢«ï¥¬ ­®¢ãî ¢¥â¢ì á ¢®ªá¥«¥¬
273
; 2) 㤠«ï¥¬ ¢¥â¢ì á ¢®ªá¥«¥¬
934
align 4
274
align 4
935
proc buf2d_vox_obj_delete_node, v_obj:dword,coord_x:dword,coord_y:dword,\
275
proc buf2d_vox_obj_delete_node, v_obj:dword,coord_x:dword,coord_y:dword,\
936
coord_z:dword,k_scale:dword
276
coord_z:dword,k_scale:dword
937
pushad
277
pushad
Line 1023... Line 363...
1023
	cld
363
	cld
1024
	rep movsd ;ᤢ¨£ ¥¬ ¯ ¬ïâì
364
	rep movsd ;ᤢ¨£ ¥¬ ¯ ¬ïâì
1025
	ret
365
	ret
1026
endp
366
endp
Line -... Line 367...
-
 
367
 
1027
 
368
;???
1028
; ®¯à¥¤¥«¥­¨¥ ¯®§¨æ¨¨ 㧫  ¢ ¤¥à¥¢¥ (®â 0 ¤® 7)
369
; ®¯à¥¤¥«¥­¨¥ ¯®§¨æ¨¨ 㧫  ¢ ¤¥à¥¢¥ (®â 0 ¤® 7)
1029
align 4
370
align 4
1030
proc vox_obj_get_node_position uses ebx ecx edi, v_obj:dword,\
371
proc vox_obj_get_node_position uses ebx ecx edi, v_obj:dword,\
1031
coord_x:dword,coord_y:dword,coord_z:dword,k_scale:dword
372
coord_x:dword,coord_y:dword,coord_z:dword,k_scale:dword
Line 1107... Line 448...
1107
	@@:
448
	@@:
Line 1108... Line 449...
1108
	
449
	
1109
	ret
450
	ret
Line 1110... Line -...
1110
endp
-
 
1111
 
-
 
1112
align 4
-
 
1113
proc buf2d_vox_obj_get_img_w_3g uses ecx, h_br:dword,k_scale:dword
-
 
1114
	mov ecx,[h_br]
-
 
1115
 
-
 
1116
	movzx eax,byte[ecx]
-
 
1117
	cmp dword[k_scale],1
-
 
1118
	jl .end_c0
-
 
1119
		mov ecx,[k_scale]
-
 
1120
		shl eax,cl
-
 
1121
	.end_c0:
-
 
1122
	ret
-
 
1123
endp
-
 
1124
 
-
 
1125
align 4
-
 
1126
proc buf2d_vox_obj_get_img_h_3g uses ecx, h_br:dword,k_scale:dword
-
 
1127
	mov ecx,[h_br]
-
 
1128
 
-
 
1129
	movzx eax,byte[ecx+1]
-
 
1130
	cmp dword[k_scale],1
-
 
1131
	jl .end_c0
-
 
1132
		mov ecx,[k_scale]
-
 
1133
		shl eax,cl
-
 
1134
	.end_c0:
-
 
1135
	ret
-
 
1136
endp
451
endp
1137
 
452
 
1138
;äã­ªæ¨ï ¤«ï à¨á®¢ ­¨ï ¯ «¨âàë
453
;äã­ªæ¨ï ¤«ï à¨á®¢ ­¨ï ¯ «¨âàë
1139
align 4
454
align 4
1140
proc buf2d_draw_palete, buf:dword, coord_x:dword, coord_y:dword,\
455
proc buf2d_draw_palete, buf:dword, coord_x:dword, coord_y:dword,\
Line 1208... Line 523...
1208
	mov al,bl
523
	mov al,bl
1209
	and eax,0xffffff
524
	and eax,0xffffff
1210
	ret
525
	ret
1211
endp
526
endp
Line 1212... Line -...
1212
 
-
 
1213
 
-
 
1214
if 0
-
 
1215
txt_f1 db 13,10,'f1',0
-
 
1216
txt_chi db ' chi',0
-
 
1217
txt_st db '  st',0
-
 
1218
 
-
 
1219
txt_b db 'beg'
-
 
1220
txt_e db 13,10,0
-
 
1221
 
-
 
1222
align 4
-
 
1223
proc print_err, fun:dword, mes:dword ;¢ë¢®¤¨¬ á®®¡é¥­¨¥ ®¡ 訡ª¥ ­  ¤®áªã ®â« ¤ª¨
-
 
1224
	pushad
-
 
1225
	mov eax,63
-
 
1226
	mov ebx,1
-
 
1227
 
-
 
1228
	mov esi,[fun]
-
 
1229
	@@:
-
 
1230
		mov cl,byte[esi]
-
 
1231
		int 0x40
-
 
1232
		inc esi
-
 
1233
		cmp byte[esi],0
-
 
1234
		jne @b
-
 
1235
	mov cl,':'
-
 
1236
	int 0x40
-
 
1237
	mov cl,' '
-
 
1238
	int 0x40
-
 
1239
	mov esi,[mes]
-
 
1240
	@@:
-
 
1241
		mov cl,byte[esi]
-
 
1242
		int 0x40
-
 
1243
		inc esi
-
 
1244
		cmp byte[esi],0
-
 
1245
		jne @b
-
 
1246
	popad
-
 
1247
	ret
-
 
1248
endp
-