1) 'vox_editor' update

2) 'buf2d.obj' add new function 'buf2d_rotate'

git-svn-id: svn://kolibrios.org@2975 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2012-10-01 10:45:57 +00:00
parent ff07aa50ca
commit 0d1db9d12d
6 changed files with 407 additions and 69 deletions

View File

@ -55,6 +55,10 @@ table { font-size: 15px; }
<li><a href="#f_init">lib_init</a></li>
<li><a href="#f_b_create">buf2d_create</a></li>
<li><a href="#f_b_create_f">buf2d_create_f_img</a></li>
<li><a href="#f_b_clear">buf2d_clear</a></li>
<li><a href="#f_b_draw">buf2d_draw</a></li>
<li><a href="#f_b_delete">buf2d_delete</a></li>
<li><a href="#f_b_rotate">buf2d_rotate</a></li>
<li><a href="#f_b_hdiv2">buf2d_img_hdiv2</a></li>
<li><a href="#f_b_wdiv2">buf2d_img_wdiv2</a></li>
<li><a href="#f_c_color">buf2d_crop_color</a></li>
@ -74,7 +78,7 @@ table { font-size: 15px; }
Ĺńňü ôóíęöčč đčńîâŕíč˙ ëčíčé, ęđčâűő Áĺçüĺ, ďđ˙ěîóăîëüíčęîâ, îęđóćíîńňĺé.
Ňŕęćĺ ĺńňü ôóíęöčč äë˙ đčńîâŕíčé âîęńĺëüíîé ăđŕôčęč.</p>
<p>Последнее обновление библиотеки 11.08.12.</p>
<p>Ďîńëĺäíĺĺ îáíîâëĺíčĺ áčáëčîňĺęč 01.10.12.</p>
<h1><a name="format_buf">Ôîđěŕňű áóôĺđîâ</a></h1>
<p>Ďîääĺđćčâŕĺňń˙ 3 ôîđěŕňŕ áóôĺđîâ.
@ -114,19 +118,24 @@ buf_0:
<h4><a name="f_b_create_f">buf2d_create_f_img</a></h4>
<p>Ńîçäŕĺň áóôĺđ íŕ îńíîâĺ čçîáđŕćĺíč˙ â ôîđěŕňĺ <b>rgb</b>.</p>
<h4>buf2d_clear</h4>
<h4><a name="f_b_clear">buf2d_clear</a></h4>
<p>×čńňčň áóôĺđ óęŕçŕíűě öâĺňîě. Ďđčěĺđ:</p>
<pre>buf2d_color equ dword[edi+16] ;öâĺň ôîíŕ áóôĺđŕ
mov edi,buf_0
stdcall [buf2d_clear], edi, buf2d_color ;î÷čůŕĺě ýęđŕí ôîíîâűě öâĺňîě</pre>
<p>ăäĺ buf_0 - ńňđóęňóđŕ áóôĺđŕ.</p>
<h4>buf2d_draw</h4>
<h4><a name="f_b_draw">buf2d_draw</a></h4>
<p>Đčńóĺň áóôĺđ íŕ ýęđŕíĺ (đŕáîňŕĺň ÷ĺđĺç ńčńňĺěíóţ ô. 7). Đčńóţňń˙ ňîëüęî áóôĺđŕ ń ăëóáčíîé öâĺňŕ 24 áčňŕ.</p>
<h4>buf2d_delete</h4>
<h4><a name="f_b_delete">buf2d_delete</a></h4>
<p>Îńâîáîćäŕĺň ďŕě˙ňü çŕí˙ňóţ čçîáđŕćĺíčĺě áóôĺđŕ.</p>
<h4><a name="f_b_rotate">buf2d_rotate</a></h4>
<p>Ďîâîđŕ÷čâŕĺň áóôĺđ íŕ 90 čëč 180 ăđŕäóńîâ. Ďđčěĺđ:</p>
<pre>stdcall [buf2d_rotate], buf_0, 90</pre>
<p>ăäĺ buf_0 - ńňđóęňóđŕ áóôĺđŕ (ěîćĺň áűňü 8, 24 čëč 32 áčňíűě); 90 - óăîë ďîâîđîňŕ.</p>
<h4>buf2d_resize</h4>
<p>Čçěĺí˙ĺň đŕçěĺđű áóôĺđŕ. Ďîęŕ ďîääĺđćčâŕţňń˙ áóôĺđŕ ń ăëóáčíîé öâĺňŕ 24 áčňŕ. Ďđčěĺđ:</p>
<pre>stdcall [buf2d_resize], buf_0, 0,300 ;čçěĺí˙ĺě âűńîňó áóôĺđŕ</pre>
@ -294,6 +303,7 @@ import_buf2d_lib:
buf2d_clear dd sz_buf2d_clear
buf2d_draw dd sz_buf2d_draw
buf2d_delete dd sz_buf2d_delete
buf2d_rotate dd sz_buf2d_rotate
buf2d_resize dd sz_buf2d_resize
buf2d_line dd sz_buf2d_line
buf2d_line_sm dd sz_buf2d_line_sm
@ -335,6 +345,7 @@ import_buf2d_lib:
sz_buf2d_clear db 'buf2d_clear',0
sz_buf2d_draw db 'buf2d_draw',0
sz_buf2d_delete db 'buf2d_delete',0
sz_buf2d_rotate db 'buf2d_rotate',0
sz_buf2d_resize db 'buf2d_resize',0
sz_buf2d_line db 'buf2d_line',0
sz_buf2d_line_sm db 'buf2d_line_sm',0
@ -392,5 +403,6 @@ import_buf2d_lib:
<p>11.05.12 - äîáŕâëĺíŕ ôóíęöč˙ äë˙ âç˙ňč˙ öâĺňŕ ňî÷ęč buf2d_get_pixel, äîđŕáîňęč â buf2d_set_pixel.</p>
<p>12.06.12 - äîáŕâëĺíű ôóíęöčč äë˙ đčńîâŕíč˙ âîęńĺëüíîé ăđŕôčęč.</p>
<p>11.08.12 - ôóíęöčč äë˙ ńćŕňč˙ čçîáđŕćĺíčé buf2d_img_hdiv2 č buf2d_img_wdiv2 đŕáîňŕţň ń 32 áčňíűěč áóôĺđŕěč.</p>
<p>01.10.12 - äîáŕâëĺíŕ ôóíęöč˙ ďîâîđîňŕ čçîáđŕćĺíčé íŕ 90 č 180 ăđŕäóńîâ buf2d_rotate.</p>
</body>
</html>

View File

@ -1071,6 +1071,249 @@ proc buf_resize, buf_struc:dword, new_w:dword, new_h:dword
ret
endp
align 4
rot_table: ;â ¡«¨æ  ¤«ï 㪠§ ­¨ï ­  ¯®¤ä㭪樨 ¤«ï ¯®¢®à®â®¢
dd buf_rotate.8b90,buf_rotate.24b90,buf_rotate.32b90,\
buf_rotate.8b180,buf_rotate.24b180,buf_rotate.32b180
;¯®¢®à®â ¨§®¡à ¦¥­¨ï ­  90 ¨«¨ 180 £à ¤ãᮢ
align 4
proc buf_rotate, buf_struc:dword, angle:dword
locals
n_data dd ?
dec_h dd ? ;ç¨á«® ¡ ©â, ¤«ï 㬥­ì襭¨ï ª®®à¤¨­ âë y
endl
pushad
mov edi,[buf_struc]
mov ebx,buf2d_w
mov ecx,buf2d_h
lea eax,[rot_table]
cmp dword[angle],90 ;¯à®¢¥àª  㣫  ¯®¢®à®â 
je .beg_0
cmp dword[angle],180
jne @f
add eax,12
jmp .beg_0
@@:
jmp .end_f
.beg_0: ;¯à®¢¥àª  ¡¨â­®á⨠¡ãä¥à 
cmp buf2d_bits,8
jne @f
jmp dword[eax]
@@:
cmp buf2d_bits,24
jne @f
add eax,4
jmp dword[eax]
@@:
cmp buf2d_bits,32
jne @f
add eax,8
jmp dword[eax]
@@:
jmp .end_f
.8b90: ;¯®¢®à®â 8 ¡¨â­®£® ¡ãä¥à  ­  90 £à ¤ãᮢ
mov edx,ecx ;edx - buf_h
imul ecx,ebx
invoke mem.alloc,ecx ;¢ë¤¥«ï¥¬ ¢à¥¬¥­­ãî ¯ ¬ïâì
cmp eax,0
je .end_f
mov [n_data],eax
mov [dec_h],ecx
inc dword[dec_h]
;copy buf --> mem
mov edi,[buf_struc]
mov esi,buf2d_data
mov edi,eax ;[n_data]
dec edx ;ª®à¥ªâ¨à㥬 edx ­  1 ¡ ©â, ¤«ï ª®¬¯¥­á æ¨¨ ᤢ¨£  ¢ movsb
add edi,edx
xor eax,eax
cld
.cycle_0:
movsb
add edi,edx
inc eax
cmp eax,ebx
jl @f
xor eax,eax
sub edi,[dec_h]
@@:
loop .cycle_0
;change buf_w <---> buf_h
mov esi,[n_data]
mov edi,[buf_struc]
mov edi,buf2d_data
mov ecx,ebx
inc edx ;¨á¯à ¢«ï¥¬ ᪮४â¨à®¢ ­­ë© edx
imul ecx,edx
;copy buf <-- mem
;cld
rep movsb
invoke mem.free,[n_data]
jmp .change_w_h
.24b90: ;¯®¢®à®â 24 ¡¨â­®£® ¡ãä¥à  ­  90 £à ¤ãᮢ
mov esi,ecx
imul esi,ebx
lea ecx,[ecx+ecx*2]
mov edx,ecx ;edx - buf_h * 3
imul ecx,ebx
invoke mem.alloc,ecx ;¢ë¤¥«ï¥¬ ¢à¥¬¥­­ãî ¯ ¬ïâì
cmp eax,0
je .end_f
mov [n_data],eax
mov [dec_h],ecx
add dword[dec_h],3
;copy buf --> mem
mov edi,[buf_struc]
mov ecx,esi
mov esi,buf2d_data
mov edi,eax ;[n_data]
sub edx,3 ;ª®à¥ªâ¨à㥬 edx ­  3 ¡ ©â , ¤«ï ª®¬¯¥­á æ¨¨ ᤢ¨£ 
add edi,edx
xor eax,eax
cld
.cycle_1:
movsw
movsb
add edi,edx
inc eax
cmp eax,ebx
jl @f
xor eax,eax
sub edi,[dec_h]
@@:
loop .cycle_1
;copy buf <-- mem
mov esi,[n_data]
mov edi,[buf_struc]
mov edi,buf2d_data
mov ecx,ebx
add edx,3 ;¨á¯à ¢«ï¥¬ ᪮४â¨à®¢ ­­ë© edx
imul ecx,edx
;cld
rep movsb
invoke mem.free,[n_data]
jmp .change_w_h
.32b90: ;¯®¢®à®â 32 ¡¨â­®£® ¡ãä¥à  ­  90 £à ¤ãᮢ
shl ecx,2
mov edx,ecx ;edx - buf_h * 4
imul ecx,ebx
invoke mem.alloc,ecx ;¢ë¤¥«ï¥¬ ¢à¥¬¥­­ãî ¯ ¬ïâì
cmp eax,0
je .end_f
mov [n_data],eax
mov [dec_h],ecx
add dword[dec_h],4
;copy buf --> mem
mov edi,[buf_struc]
shr ecx,2
mov esi,buf2d_data
mov edi,eax ;[n_data]
sub edx,4 ;ª®à¥ªâ¨à㥬 edx ­  4 ¡ ©â , ¤«ï ª®¬¯¥­á æ¨¨ ᤢ¨£  ¢ movsd
add edi,edx
xor eax,eax
cld
.cycle_2:
movsd
add edi,edx
inc eax
cmp eax,ebx
jl @f
xor eax,eax
sub edi,[dec_h]
@@:
loop .cycle_2
;copy buf <-- mem
mov esi,[n_data]
mov edi,[buf_struc]
mov edi,buf2d_data
mov ecx,ebx
add edx,4 ;¨á¯à ¢«ï¥¬ ᪮४â¨à®¢ ­­ë© edx
imul ecx,edx
shr ecx,2
;cld
rep movsd
invoke mem.free,[n_data]
;jmp .change_w_h
.change_w_h: ;change buf_w <---> buf_h
mov edi,[buf_struc]
mov eax,buf2d_w
mov ebx,buf2d_h
mov buf2d_h,eax
mov buf2d_w,ebx
jmp .end_f
.8b180: ;¯®¢®à®â 8 ¡¨â­®£® ¡ãä¥à  ­  180 £à ¤ãᮢ
mov edi,buf2d_data
mov esi,edi
imul ecx,ebx
add esi,ecx
dec esi
shr ecx,1 ;ecx - ç¨á«® ¯¨ªá¥«¥© ¡ãä¥à  : 2
std
@@:
lodsb
mov ah,byte[edi]
mov byte[esi+1],ah
mov byte[edi],al
inc edi
loop @b
jmp .end_f
.24b180: ;¯®¢®à®â 24 ¡¨â­®£® ¡ãä¥à  ­  180 £à ¤ãᮢ
mov esi,buf2d_data
mov edi,esi
imul ecx,ebx
mov eax,ecx
lea ecx,[ecx+ecx*2]
add edi,ecx
sub edi,3
shr eax,1
mov ecx,eax ;ecx - ç¨á«® ¯¨ªá¥«¥© ¡ãä¥à  : 2
cld
@@:
lodsw
mov edx,eax
lodsb
mov bx,word[edi]
mov word[esi-3],bx
mov bl,byte[edi+2]
mov byte[esi-1],bl
mov byte[edi+2],al
mov word[edi],dx
sub edi,3
loop @b
jmp .end_f
.32b180: ;¯®¢®à®â 32 ¡¨â­®£® ¡ãä¥à  ­  180 £à ¤ãᮢ
mov edi,buf2d_data
mov esi,edi
imul ecx,ebx
shl ecx,2
add esi,ecx
sub esi,4
shr ecx,3 ;ecx - ç¨á«® ¯¨ªá¥«¥© ¡ãä¥à  : 2
std
@@:
lodsd
mov ebx,dword[edi]
mov dword[esi+4],ebx
mov dword[edi],eax
add edi,4
loop @b
;jmp .end_f
.end_f:
popad
ret
endp
align 4
proc buf_line_brs, buf_struc:dword, coord_x0:dword, coord_y0:dword, coord_x1:dword, coord_y1:dword, color:dword
locals
@ -3238,30 +3481,52 @@ proc vox_create_next_brush uses eax ebx ecx edx edi, buf_v1:dword, buf_v2:dword,
;ecx - è¨à¨­  ¨á室­®£® ¢®ªá¥«ï : 2
;ebx - ¢ëá®â  ¨á室­®£® ¢®ªá¥«ï (¡¥§ ®á­®¢ ­¨ï)
;edx - ¢ëá®â  ®á­®¢ ­¨ï ¨á室­®£® ¢®ªá¥«ï
stdcall vox_add, [buf_v2], [buf_v1], ecx,0,0
stdcall vox_add, [buf_v2], [buf_v1], ecx,ebx,0
mov eax,[h]
stdcall vox_add, [buf_v2], [buf_v1], 0,eax,eax
push eax ;stdcall ...
add eax,ebx
stdcall vox_add, [buf_v2], [buf_v1], 0,eax ;,...
sub eax,ebx
cmp eax,0
je @f
stdcall vox_add, [buf_v2], [buf_v1], ecx,0,0
stdcall vox_add, [buf_v2], [buf_v1], ecx,ebx,0
shl ecx,1
;ecx - č¨ŕ¨­  ¨á厤­ŽŁŽ ˘ŽŞáĽŤď
mov eax,[h]
stdcall vox_add, [buf_v2], [buf_v1], ecx,eax,eax
push eax ;stdcall ...,[h]
add eax,ebx
stdcall vox_add, [buf_v2], [buf_v1], ecx,eax;,[h]
;sub eax,ebx
shr ecx,1
stdcall vox_add, [buf_v2], [buf_v1], 0,eax,eax
push eax ;stdcall ...
add eax,ebx
stdcall vox_add, [buf_v2], [buf_v1], 0,eax ;,...
sub eax,ebx
shl ecx,1
;ecx - è¨à¨­  ¨á室­®£® ¢®ªá¥«ï
stdcall vox_add, [buf_v2], [buf_v1], ecx,eax,eax
push eax ;stdcall ...,[h]
add eax,ebx
stdcall vox_add, [buf_v2], [buf_v1], ecx,eax;,[h]
;sub eax,ebx
shr ecx,1
;ecx - è¨à¨­  ¨á室­®£® ¢®ªá¥«ï : 2
stdcall vox_add, [buf_v2], [buf_v1], ecx,edx,edx
add ebx,edx
stdcall vox_add, [buf_v2], [buf_v1], ecx,ebx,edx
jmp .end_0
@@:
;¥á«¨ h = 0, ⮣¤  ¯®«ãç ¥¬ ª¨áâì ­  2 £à ­¨
;¢ â ª®¬ á«ãç ¥ ¤«ï ¯®«ã祭¨ï £«ã¡¨­ë ¡¥à¥¬ è¨à¨­ã / 2
mov eax,ecx
;2 «¥¢ëå ¢®ªá¥«ï
stdcall vox_add, [buf_v2], [buf_v1], 0,0,eax
stdcall vox_add, [buf_v2], [buf_v1], 0,ebx,eax
shl eax,1
;2 業âà «ì­ëå ¯¥à¥¤­¨å ¢®ªá¥«ï (§ ¤­¨¥ 業âà «ì­ë¥ ­¥ ¢ë¢®¤¨¬)
stdcall vox_add, [buf_v2], [buf_v1], ecx,0,eax
stdcall vox_add, [buf_v2], [buf_v1], ecx,ebx,eax
shr eax,1
shl ecx,1
;2 ¯à ¢ëå ¢®ªá¥«ï
stdcall vox_add, [buf_v2], [buf_v1], ecx,0,eax
stdcall vox_add, [buf_v2], [buf_v1], ecx,ebx,eax
.end_0:
;ecx - č¨ŕ¨­  ¨á厤­ŽŁŽ ˘ŽŞáĽŤď : 2
stdcall vox_add, [buf_v2], [buf_v1], ecx,edx,edx
add ebx,edx
stdcall vox_add, [buf_v2], [buf_v1], ecx,ebx,edx
ret
endp
@ -3666,14 +3931,23 @@ proc vox_go_in_node, buf_i:dword, buf_z:dword, h_br:dword, v_obj:dword
;mov eax,(h-h_osn/2)
mov ebx,[h_br]
movzx eax,byte[ebx+1]
movzx ebx,byte[ebx+2]
shr ebx,1
sub eax,ebx
cmp byte[ebx+2],0
je @f
;¥á«¨ ª¨áâì á 3-¬ï £à ­ï¬¨
movzx ebx,byte[ebx+2]
shr ebx,1
sub eax,ebx
jmp .end_0
@@:
;¥á«¨ ª¨áâì á 2-¬ï £à ­ï¬¨
movzx ebx,byte[ebx]
shr ebx,1
.end_0:
cmp ecx,1
jl .end_c1
jl @f
shl eax,cl
shl ebx,cl
.end_c1:
@@:
add esi,ebx
pop ebx
add edx,eax ;ª®à¥ªâ¨à®¢ª  ¢ëá®âë ¯®¤ ¢®ªá¥«ì ­¨¦­¥£® ã஢­ï
@ -3823,22 +4097,32 @@ endl
pop ecx ebx
cmp ecx,1
jl .no_scale ;˘Ž ¨§ĄĽŚ ­¨Ľ § ć¨ŞŤ¨˘ ­¨ď
jl @f ;¢® ¨§¡¥¦ ­¨¥ § æ¨ª«¨¢ ­¨ï
shl eax,cl
shl dword[osn_w_2],cl
shl dword[vox_h],cl
.no_scale:
@@:
; add esi,eax ;¬¥­ï¥¬ £«ã¡¨­ã ¤«ï ¡ãä¥à  z (ª®¬¯¥­á æ¨ï ¤«ï ª®®à¤¨­ âë y)
bt word[edi],0 ;test voxel coord x
jnc @f
add ebx,[osn_w_2]
cmp eax,0
jne .end_0
add esi,[osn_w_2] ;¬¥­ï¥¬ £«ã¡¨­ã ¤«ï ¡ãä¥à  z
jmp @f
.end_0:
add edx,eax
add esi,eax ;¬¥­ï¥¬ £«ã¡¨­ã ¤«ï ¡ãä¥à  z
@@:
bt word[edi],1 ;test voxel coord y
jnc @f
add ebx,[osn_w_2]
cmp eax,0
jne .end_1
sub esi,[osn_w_2] ;¬¥­ï¥¬ £«ã¡¨­ã ¤«ï ¡ãä¥à  z
jmp @f
.end_1:
sub edx,eax
sub esi,eax ;¬¥­ï¥¬ £«ã¡¨­ã ¤«ï ¡ãä¥à  z
@@:
@ -4456,6 +4740,7 @@ EXPORTS:
dd sz_buf2d_draw, buf_draw_buf
dd sz_buf2d_delete, buf_delete
dd sz_buf2d_resize, buf_resize
dd sz_buf2d_rotate, buf_rotate
dd sz_buf2d_line, buf_line_brs
dd sz_buf2d_line_sm, buf_line_brs_sm
dd sz_buf2d_rect_by_size, buf_rect_by_size
@ -4494,6 +4779,7 @@ EXPORTS:
sz_buf2d_draw db 'buf2d_draw',0
sz_buf2d_delete db 'buf2d_delete',0
sz_buf2d_resize db 'buf2d_resize',0
sz_buf2d_rotate db 'buf2d_rotate',0
sz_buf2d_line db 'buf2d_line',0 ;à¨á®¢ ­¨¥ «¨­¨¨
sz_buf2d_line_sm db 'buf2d_line_sm',0 ;à¨á®¢ ­¨¥ ᣫ ¦¥­­®© «¨­¨¨
sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0 ;à¨á®¢ ­¨¥ à ¬ª¨ ¯àאַ㣮«ì­¨ª , 2-ï ª®®à¤¨­ â  § ¤ ­  ¯® à §¬¥àã

View File

@ -48,7 +48,7 @@ table
</head>
<body>
<h1>Редактор воксельной графики версия от 19.07.2012</h1>
<h1>Редактор воксельной графики версия от 01.10.2012</h1>
<p>Оглавление</p>
<ul>
<li><a href="#about">О программе</a></li>
@ -76,6 +76,7 @@ table
<p><img src="tb_open.png"> - открытие файлов с помощью диалогового окна.</p>
<p><img src="tb_save.png"> - сохранение файлов.</p>
<p><img src="tb_zoom_p.png">, <img src="tb_zoom_m.png"> - увеличение и уменьшение масштаба.</p>
<p><img src="tb_3g_2g.png"> - смена вида камеры (объект виден с 3-мя или 2-мя гранями).</p>
<p><img src="tb_rot_1.png">, <img src="tb_rot_2.png"> - повороты изображения.</p>
<p><img src="tb_pl_p.png">, <img src="tb_pl_m.png"> - сдвиг плоскости сечения.</p>
<p><img src="tb_pen.png"> - установка режима рисования вокселей.</p>

Binary file not shown.

After

Width:  |  Height:  |  Size: 364 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 6.1 KiB

View File

@ -17,7 +17,7 @@ include 'dll.inc'
include 'vox_draw.inc'
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
caption db 'Voxel editor 12.09.12',0 ;¯®¤¯¨áì ®ª­ 
caption db 'Voxel editor 01.10.12',0 ;¯®¤¯¨áì ®ª­ 
struct FileInfoBlock
Function dd ?
@ -34,7 +34,7 @@ image_data dd 0 ;㪠
fn_toolbar db 'toolbar.png',0
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*22
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*23
image_data_toolbar dd 0
cursors_count equ 4
IMAGE_CURSORS_SIZE equ 4096*cursors_count ;à §¬¥à ª à⨭ª¨ á ªãàá®à ¬¨
@ -186,7 +186,8 @@ start:
stdcall [buf2d_create], buf_0z ;ᮧ¤ ­¨¥ ¡ãä¥à  £«ã¡¨­ë
stdcall [buf2d_create], buf_pl ;ᮧ¤ ­¨¥ ¡ãä¥à  ¤«ï á¥ç¥­¨ï
stdcall [buf2d_vox_brush_create], buf_vox, vox_6_7_z
stdcall [buf2d_vox_brush_create], buf_vox_g3, vox_6_7_z
stdcall [buf2d_vox_brush_create], buf_vox_g2, vox_6_4_z
load_image_file fn_toolbar, image_data_toolbar,IMAGE_TOOLBAR_SIZE
@ -258,7 +259,7 @@ mouse:
sub edx,[scaled_zoom]
sub ax,word[buf_0.t]
sub bx,word[buf_0.l]
stdcall get_mouse_ev_scale, buf_vox, ebx, eax, [scaled_zoom],edx
stdcall get_mouse_ev_scale, [buf_vox], ebx, eax, [scaled_zoom],edx
cmp eax,0
je @f
mov ebx,eax
@ -497,6 +498,9 @@ pushad
add ebx,25 shl 16
mov edx,24
int 0x40
add ebx,25 shl 16
mov edx,25
int 0x40
; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
mov eax,7
@ -519,6 +523,9 @@ pushad
add edx,(25 shl 16) ;㬥­ìè. ¬ áèâ ¡
int 0x40
add ebx,IMAGE_TOOLBAR_ICON_SIZE
add edx,(25 shl 16) ;camera 3g 2g
int 0x40
add ebx,IMAGE_TOOLBAR_ICON_SIZE
add edx,(25 shl 16) ;¯®¢®à®â 1
int 0x40
add ebx,IMAGE_TOOLBAR_ICON_SIZE
@ -695,70 +702,74 @@ button:
@@:
cmp ah,8
jne @f
call but_3
call but_camera_3g_2g
@@:
cmp ah,9
jne @f
call but_4
call but_3
@@:
cmp ah,10
jne @f
call but_plane_inc
call but_4
@@:
cmp ah,11
jne @f
call but_plane_dec
call but_plane_inc
@@:
cmp ah,12
jne @f
call but_mode_pen
call but_plane_dec
@@:
cmp ah,13
jne @f
call but_mode_brush
call but_mode_pen
@@:
cmp ah,14
jne @f
call but_mode_clear
call but_mode_brush
@@:
cmp ah,15
jne @f
call but_mode_clear
@@:
cmp ah,16
jne @f
stdcall set_pen_mode,PEN_MODE_SELECT_COLOR,3,((9 shl 8)+9) shl 16
call draw_palete
@@:
cmp ah,16
cmp ah,17
jne @f
call but_light
@@:
cmp ah,17
cmp ah,18
jne @f
call but_rend_2_2
@@:
cmp ah,18
cmp ah,19
jne @f
call but_brush_copy
@@:
cmp ah,19
cmp ah,20
jne @f
call but_brush_draw
@@:
cmp ah,20
cmp ah,21
jne @f
call but_brush_clear
@@:
cmp ah,21
cmp ah,22
jne @f
call but_bru_w_m
@@:
cmp ah,22
cmp ah,23
jne @f
call but_bru_w_p
@@:
cmp ah,23
cmp ah,24
jne @f
call but_bru_h_m
@@:
cmp ah,24
cmp ah,25
jne @f
call but_bru_h_p
@@:
@ -772,7 +783,8 @@ button:
stdcall [buf2d_delete],buf_r_img
stdcall [buf2d_delete],buf_r_z
@@:
stdcall [buf2d_vox_brush_delete], buf_vox
stdcall [buf2d_vox_brush_delete], buf_vox_g3
stdcall [buf2d_vox_brush_delete], buf_vox_g2
stdcall [buf2d_delete],buf_curs
stdcall [buf2d_delete],buf_curs_8
stdcall mem.Free,[image_data_toolbar]
@ -874,6 +886,19 @@ but_save_file:
popad
ret
;ᬥ­  ¢¨¤  ª ¬¥àë ­  ¯à®á¬®âà 3 ¨ 2 £à ­¥©
align 4
but_camera_3g_2g:
cmp dword[buf_vox],buf_vox_g3
je @f
mov dword[buf_vox],buf_vox_g3
jmp .end_0
@@:
mov dword[buf_vox],buf_vox_g2
.end_0:
call draw_objects
ret
;㢥«¨ç¥­¨¥ ¬ áèâ ¡ 
align 4
but_zoom_p:
@ -1113,11 +1138,11 @@ push edi
mov ebx,[scaled_zoom]
sub eax,ebx
inc ebx
stdcall [buf2d_vox_obj_draw_3g_scaled], buf_r_img, buf_r_z, buf_vox,\
stdcall [buf2d_vox_obj_draw_3g_scaled], buf_r_img, buf_r_z, [buf_vox],\
[open_file_vox], 0,0, 0, ebx, [cam_x],[cam_y],[cam_z],eax, [sc.work_graph]
bt dword[mode_light],0
jnc @f
stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, buf_vox, 0,0, 0, ebx, 3
stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, [buf_vox], 0,0, 0, ebx, 3
@@:
xor ebx,ebx
xor ecx,ecx
@ -1130,11 +1155,11 @@ push edi
.end_scaled:
inc eax
stdcall [buf2d_vox_obj_draw_3g], buf_r_img, buf_r_z, buf_vox, [open_file_vox], 0,0, 0, eax
stdcall [buf2d_vox_obj_draw_3g], buf_r_img, buf_r_z, [buf_vox], [open_file_vox], 0,0, 0, eax
stdcall [buf2d_vox_obj_draw_1g], buf_r_img, buf_r_z, [open_file_vox], 0,0, eax
bt dword[mode_light],0
jnc @f
stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, buf_vox, 0,0, 0, eax, 3
stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, [buf_vox], 0,0, 0, eax, 3
@@:
mov edi,buf_r_img
@ -1143,11 +1168,11 @@ push edi
stdcall [buf2d_img_wdiv2], edi
shr buf2d_w,1
stdcall [buf2d_vox_obj_get_img_w_3g], buf_vox,[v_zoom]
stdcall [buf2d_vox_obj_get_img_w_3g], [buf_vox],[v_zoom]
mov ebx,[buf_0.w]
sub ebx,eax
shr ebx,1 ;ebx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® £®à¨§®­â «¨
stdcall [buf2d_vox_obj_get_img_h_3g], buf_vox,[v_zoom]
stdcall [buf2d_vox_obj_get_img_h_3g], [buf_vox],[v_zoom]
cmp eax,[buf_0.h]
jg @f
mov ecx,[buf_0.h]
@ -1433,25 +1458,25 @@ draw_objects:
jmp .end_f
@@:
push eax ebx ecx
stdcall [buf2d_vox_obj_get_img_w_3g], buf_vox,[v_zoom]
stdcall [buf2d_vox_obj_get_img_w_3g], [buf_vox],[v_zoom]
mov ebx,[buf_0.w]
sub ebx,eax
shr ebx,1 ;ebx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® £®à¨§®­â «¨
xor ecx,ecx
stdcall [buf2d_vox_obj_get_img_h_3g], buf_vox,[v_zoom]
stdcall [buf2d_vox_obj_get_img_h_3g], [buf_vox],[v_zoom]
cmp eax,[buf_0.h]
jg @f
mov ecx,[buf_0.h]
sub ecx,eax
shr ecx,1 ;ecx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯®
shr ecx,1 ;ecx - ¤«ï 業â஢ª¨ ¬ «¥­ìª¨å ¨§®¡à ¦¥­¨© ¯® ¢¥à⨪ «¨
@@:
mov eax,[v_zoom]
cmp eax,[scaled_zoom]
jg @f
;®¡ëç­ë© ०¨¬ ¨§®¡à ¦¥­¨ï
stdcall [buf2d_vox_obj_draw_3g], buf_0, buf_0z, buf_vox,\
stdcall [buf2d_vox_obj_draw_3g], buf_0, buf_0z, [buf_vox],\
[open_file_vox], ebx,ecx, 0, eax
stdcall [buf2d_vox_obj_draw_pl], buf_pl, [open_file_vox],\
OT_MAP_X,OT_MAP_Y,[tile_size], eax, [n_plane], [sc.work_graph]
@ -1459,19 +1484,19 @@ draw_objects:
[open_file_vox], 0,0, eax
bt dword[mode_light],0
jnc .end_1
stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, buf_vox, ebx,ecx, 0, eax, 3
stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, [buf_vox], ebx,ecx, 0, eax, 3
.end_1:
jmp .end_0
@@:
;०¨¬ ¬ áèâ ¡¨à®¢ ­¨ï ¨§®¡à ¦¥­¨ï
sub eax,[scaled_zoom]
stdcall [buf2d_vox_obj_draw_3g_scaled], buf_0, buf_0z, buf_vox,\
stdcall [buf2d_vox_obj_draw_3g_scaled], buf_0, buf_0z, [buf_vox],\
[open_file_vox], 0,0, 0, [scaled_zoom], [cam_x],[cam_y],[cam_z],eax, [sc.work_graph] ;scroll -> 2^eax
stdcall [buf2d_vox_obj_draw_pl_scaled], buf_pl, [open_file_vox],\
OT_MAP_X,OT_MAP_Y,[tile_size], [scaled_zoom], [n_plane], [sc.work_graph],[cam_x],[cam_y],[cam_z],eax
bt dword[mode_light],0
jnc .end_2
stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, buf_vox, 0,0, 0, [scaled_zoom], 3
stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, [buf_vox], 0,0, 0, [scaled_zoom], 3
.end_2:
.end_0:
pop ecx ebx eax
@ -1991,7 +2016,7 @@ buf_curs_8: ;
;¤ ­­ë¥ ¤«ï ᮧ¤ ­¨ï ¬¨­¨¬ «ì­®£® ¥¤¨­¨ç­®£® ¢®ªá¥«ï
align 4
vox_6_7_z:
vox_6_7_z: ;¢®ªá¥«ì £¤¥ ¢¨¤­® 3 £à ­¨
dd 0,0,1,1,0,0,\
0,2,2,2,2,0,\
2,2,2,2,2,2,\
@ -2001,10 +2026,24 @@ dd 0,0,1,1,0,0,\
0,0,3,3,0,0
align 4
buf_vox:
vox_6_4_z: ;¢®ªá¥«ì, £¤¥ ¢¨¤­® 2 ¡®ª®¢ë¥ £à ­¨   ¢¥àå­¥© £à ­¨ ­¥ ¢¨¤­®
dd 1,2,3,3,2,1,\
1,2,3,3,2,1,\
1,2,3,3,2,1,\
1,2,3,3,2,1
align 4
buf_vox dd buf_vox_g3
buf_vox_g3:
db 6,7,4,3 ;w,h,h_osn,n
rb BUF_STRUCT_SIZE*(3+1)
align 4
buf_vox_g2:
db 6,4,0,3 ;w,h,h_osn,n
rb BUF_STRUCT_SIZE*(3+1)
i_end:
wnd_s_pos: ;¬¥áâ® ¤«ï ­ áâ஥ª áâ à⮢®© ¯®§¨æ¨¨ ®ª­ 
rq 0