buf2d.obj:

- new function 'buf2d_resize'
info3ds:
- update resize window
- update function 'block_analiz_data'

git-svn-id: svn://kolibrios.org@2136 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2011-08-30 11:10:56 +00:00
parent 341ced5f56
commit e251af9421
4 changed files with 123 additions and 32 deletions

View File

@ -1,7 +1,7 @@
if lang eq ru
capt db 'info 3ds ¢¥àá¨ï 26.08.11',0 ;¯®¤¯¨áì ®ª­ 
capt db 'info 3ds ¢¥àá¨ï 30.08.11',0 ;¯®¤¯¨áì ®ª­ 
else
capt db 'info 3ds version 26.08.11',0 ;window caption
capt db 'info 3ds version 30.08.11',0 ;window caption
end if
MAX_FILE_LEVEL equ 20 ;¬ ªá¨¬ «ì­ë© ã஢¥­ì ¢«®¦¥­­®á⨠¡«®ª®¢ ¤«ï  ­ «¨§ 

View File

@ -325,6 +325,24 @@ pushad
sub eax,65
mov dword[tree1.box_height],eax
mov word[w_scr_t1+4],ax ;­®¢ë¥ à §¬¥àë áªà®««¨­£ 
cmp eax,dword[buf_0.h] ;㢥«¨ç¨¢ ¥¬ ¢ëá®âã ¡ãä¥à 
jle @f
stdcall [buf2d_resize],buf_0,0,eax
mov dword[offs_last_timer],0 ;¤«ï ®¡­®¢«¥­¨ï ¡ãä¥à  ¢ â ©¬¥à¥
@@:
mov eax,dword[procinfo.box.width]
cmp eax,400
jge @f
mov eax,400
@@:
sub eax,[buf_0.w]
sub eax,41
mov dword[tree1.box_width],eax
add ax,word[tree1.box_left]
mov word[w_scr_t1.start_x],ax
add ax,16+5
mov word[buf_0.l],ax
mov eax,8
mov ebx,(5 shl 16)+20
@ -521,7 +539,6 @@ block_analiz_data:
; ***  ­ «¨§ ¡«®ª®¢ á à §­ë¬¨ ¤ ­­ë¬¨ ¨ ¢ë¤¥«¥­¨¥¬ ¯®¤¡«®ª®¢
cmp dx,CHUNK_OBJBLOCK ;®¡ê¥ªâ
jne @f
.cycle_0:
push ax
cld
xor al,al
@ -531,18 +548,18 @@ block_analiz_data:
sub edi,esi ;edi - strlen
stdcall add_3ds_object, ID_ICON_DATA,ebx,edi,0 ;­ §¢ ­¨¥ ®¡ê¥ªâ 
add esi,edi
sub ecx,edi
;sub ecx,edi ;㦥 ᤥ« ­® ¢ repne
jmp .next_bl
@@:
cmp dx,CHUNK_VERTLIST ;ᯨ᮪ ¢¥à設
je .vertexes
cmp dx,0x4111 ;ä« £¨ ¢¥à設
je .vertexes
cmp dx,CHUNK_FACELIST ;ᯨ᮪ £à ­¥©
cmp dx,CHUNK_MAPLIST ;⥪áâãà­ë¥ ª®®à¤¨­ âë
je .vertexes
jmp @f
.vertexes: ;®¡à ¡®âª  ¡«®ª®¢, ᮤ¥à¦ é¨å ¤ ­­ë¥ ¢¥à設
stdcall add_3ds_object, ID_ICON_DATA,ebx,2,txt_count ;ç¨á«® ¢¥à設 ¨«¨ £à ­¥©
stdcall add_3ds_object, ID_ICON_DATA,ebx,2,txt_count ;ç¨á«® ¢¥à設
add esi,2
sub ecx,2
stdcall add_3ds_object, ID_ICON_DATA,ebx,ecx,0 ;¤ ­­ë¥ ¢¥à設
@ -550,6 +567,53 @@ block_analiz_data:
call block_next
jmp .end_f
@@:
cmp dx,CHUNK_FACELIST ;ᯨ᮪ £à ­¥©
jne @f
stdcall add_3ds_object, ID_ICON_DATA,ebx,2,txt_count ;ç¨á«® £à ­¥©
push eax
xor eax,eax
mov ax,[esi]
shl eax,3
add esi,2
sub ecx,2
stdcall add_3ds_object, ID_ICON_DATA,ebx,eax,0 ;¤ ­­ë¥ ¢¥à設
sub ecx,eax
cmp ecx,1
jl .data_3 ;¯à®¢¥à塞 ¥áâì «¨ ¡«®ª ®¯¨á뢠î騩 ¬ â¥à¨ «, ¯à¨¬¥­ï¥¬ë© ª ®¡ê¥ªâã
add esi,eax
pop eax
jmp .next_bl
;stdcall add_3ds_object, ID_ICON_DATA,ebx,ecx,0 ;¤ ­­ë¥ ¬ â¥à¨ « 
;sub esi,eax ;¢®ááâ ­®¢«¥­¨¥ esi
.data_3:
sub esi,8 ;¢®ááâ ­®¢«¥­¨¥ esi
pop eax
call block_next
jmp .end_f
@@:
cmp dx,CHUNK_FACEMAT ;¬ â¥à¨ «ë £à ­¥©
jne @f
push ax
cld
xor al,al
mov edi,esi
repne scasb
pop ax
sub edi,esi ;edi - strlen
stdcall add_3ds_object, ID_ICON_DATA,ebx,edi,0 ;­ §¢ ­¨¥ ®¡ê¥ªâ 
add esi,edi
;sub ecx,edi ;㦥 ᤥ« ­® ¢ repne
stdcall add_3ds_object, ID_ICON_DATA,ebx,2,txt_count ;ç¨á«® £à ­¥©
add esi,2
sub ecx,2
stdcall add_3ds_object, ID_ICON_DATA,ebx,ecx,0 ;­®¬¥à  £à ­¥©, ª ª®â®àë¬ ¯à¨¬¥­¥­ ¬ â¥à¨ «
sub esi,edi ;¢®ááâ ­®¢«¥­¨¥ esi (1)
sub esi,8 ;¢®ááâ ­®¢«¥­¨¥ esi (2)
call block_next
jmp .end_f
@@:
; ***  ­ «¨§ ¡«®ª  á ¤ ­­ë¬¨ ¯® 㬮«ç ­¨î (¡¥§ ¢ë¤¥«¥­¨ï ¯®¤¡«®ª®¢)
stdcall add_3ds_object, ID_ICON_DATA,ebx,ecx,0
sub esi,6 ;¢®ááâ ­®¢«¥­¨¥ esi
@ -949,19 +1013,6 @@ dd 0,0
aOpenDialog_Init db 'OpenDialog_init',0
aOpenDialog_Start db 'OpenDialog_start',0
; file.find_first db 'file_find_first',0
; file.find_next db 'file_find_next',0
; file.find_close db 'file_find_close',0
; file.size db 'file_size',0
; file.open db 'file_open',0
; file.read db 'file_read',0
; file.write db 'file_write',0
; file.seek db 'file_seek',0
; file.tell db 'file_tell',0
; file.eof? db 'file_iseof',0
; file.truncate db 'file_truncate',0
; file.close db 'file_close',0
align 4
import_buf2d:
dd sz_init0
@ -970,6 +1021,7 @@ import_buf2d:
buf2d_clear dd sz_buf2d_clear
buf2d_draw dd sz_buf2d_draw
buf2d_delete dd sz_buf2d_delete
buf2d_resize dd sz_buf2d_resize
buf2d_line dd sz_buf2d_line
buf2d_rect_by_size dd sz_buf2d_rect_by_size
buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
@ -995,6 +1047,7 @@ import_buf2d:
sz_buf2d_clear db 'buf2d_clear',0
sz_buf2d_draw db 'buf2d_draw',0
sz_buf2d_delete db 'buf2d_delete',0
sz_buf2d_resize db 'buf2d_resize',0
sz_buf2d_line db 'buf2d_line',0
sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
@ -1096,7 +1149,7 @@ procinfo process_information
align 4
buf_0: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
dw 205 ;+4 left
.l: dw 205 ;+4 left
dw 35 ;+6 top
.w: dd 340 ;+8 w
.h: dd 250 ;+12 h
@ -1121,7 +1174,8 @@ tree1 tree_list size_one_list,200+2, tl_key_no_edit+tl_draw_par_line,\
align 4
w_scr_t1:
.size_x dw 16 ;+0
rb 2+2+2
.start_x dw 0
rb 2+2
.btn_high dd 15 ;+8
.type dd 1 ;+12
.max_area dd 100 ;+16

View File

@ -108,6 +108,11 @@ buf_0:
<h4>buf2d_delete</h4>
<p>Îñâîáîæäàåò ïàìÿòü çàíÿòóş èçîáğàæåíèåì áóôåğà.</p>
<h4>buf2d_resize</h4>
<p>Изменяет размеры буфера. Пока поддерживаются буфера с глубиной цвета 24 бита. Пример:</p>
<pre>stdcall [buf2d_resize], buf_0, 0,300 ;изменяем высоту буфера</pre>
<p>где buf_0 - структура буфера в котором будет рисоваться линия; 0 - новая ширина буфера (0 означает не изменять размер); 300 - новая высота буфера.</p>
<h4>buf2d_line</h4>
<p>Ğèñóåò â áóôåğå ëèíèş ñ çàäàííûì öâåòîì è êîîğäèíàòàìè. Ïğèìåğ:</p>
<pre>stdcall [buf2d_line], buf_0, 30,10, 110,70, 0xffff00 ;ğèñóåì ëèíèş</pre>
@ -225,6 +230,7 @@ import_buf2d_lib:
buf2d_clear dd sz_buf2d_clear
buf2d_draw dd sz_buf2d_draw
buf2d_delete dd sz_buf2d_delete
buf2d_resize dd sz_buf2d_resize
buf2d_line dd sz_buf2d_line
buf2d_rect_by_size dd sz_buf2d_rect_by_size
buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
@ -251,6 +257,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_resize db 'buf2d_resize',0
sz_buf2d_line db 'buf2d_line',0
sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
@ -285,5 +292,6 @@ import_buf2d_lib:
<p>02.11.10 - äîáàâëåíà ôóíêöèÿ buf2d_flood_fill.</p>
<p>22.12.10 - èçìåíåíî èìÿ ôóíêöèè buf2d_cruve_bezier íà buf2d_curve_bezier.</p>
<p>25.03.11 - äîáàâëåíà ôóíêöèÿ ğèñîâàíèÿ äëÿ òî÷êè buf2d_set_pixel.</p>
<p>30.08.11 - добавлена функция изменения размеров буфера buf2d_resize.</p>
</body>
</html>

View File

@ -911,10 +911,37 @@ endp
align 4
proc buf_delete, buf_struc:dword
push edi
push eax edi
mov edi,dword[buf_struc]
invoke mem.free,buf2d_data
pop edi
pop edi eax
ret
endp
align 4
proc buf_resize, buf_struc:dword, new_w:dword, new_h:dword
pushad
mov edi,dword[buf_struc]
cmp buf2d_bits,24
jne .24bit
mov eax,dword[new_w]
cmp eax,1
jl @f
mov buf2d_w,eax
@@:
mov ecx,buf2d_w
mov eax,dword[new_h]
cmp eax,1
jl @f
mov buf2d_h,eax
@@:
mov ebx,buf2d_h
imul ecx,ebx
lea ecx,[ecx+ecx*2] ; 24 bit = 3
invoke mem.realloc,buf2d_data,ecx ;¨§¬¥­ï¥¬ ¯ ¬ïâì § ­¨¬ ¥¬ãî ¡ãä¥à®¬
mov buf2d_data,eax ;­  á«ãç © ¥á«¨ ¨§¬¥­¨«áï 㪠§ â¥«ì ­  ¤ ­­ë¥
.24bit:
popad
ret
endp
@ -2310,6 +2337,7 @@ EXPORTS:
dd sz_buf2d_clear, buf_clear
dd sz_buf2d_draw, buf_draw_buf
dd sz_buf2d_delete, buf_delete
dd sz_buf2d_resize, buf_resize
dd sz_buf2d_line, buf_line_brs
dd sz_buf2d_rect_by_size, buf_rect_by_size
dd sz_buf2d_filled_rect_by_size, buf_filled_rect_by_size
@ -2335,6 +2363,7 @@ EXPORTS:
sz_buf2d_clear db 'buf2d_clear',0 ;®ç¨á⪠ ¡ãä¥à  㪠§ ­­ë¬ 梥⮬
sz_buf2d_draw db 'buf2d_draw',0
sz_buf2d_delete db 'buf2d_delete',0
sz_buf2d_resize db 'buf2d_resize',0
sz_buf2d_line db 'buf2d_line',0 ;à¨á®¢ ­¨¥ «¨­¨¨
sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0 ;à¨á®¢ ­¨¥ à ¬ª¨ ¯àאַ㣮«ì­¨ª , 2-ï ª®®à¤¨­ â  § ¤ ­  ¯® à §¬¥àã
sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0 ;à¨á®¢ ­¨¥ § «¨â®£® ¯àאַ㣮«ì­¨ª , 2-ï ª®®à¤¨­ â  § ¤ ­  ¯® à §¬¥àã