info3ds: now can edit vertex coordinates

git-svn-id: svn://kolibrios.org@2173 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2011-09-12 11:00:48 +00:00
parent 594b462f7d
commit 9f2f10d775
3 changed files with 185 additions and 19 deletions

View File

@ -1,13 +1,14 @@
if lang eq ru
capt db 'info 3ds ¢¥àá¨ï 09.09.11',0 ;¯®¤¯¨áì ®ª­ 
capt db 'info 3ds ¢¥àá¨ï 12.09.11',0 ;¯®¤¯¨áì ®ª­ 
else
capt db 'info 3ds version 09.09.11',0 ;window caption
capt db 'info 3ds version 12.09.11',0 ;window caption
end if
MAX_FILE_LEVEL equ 20 ;¬ ªá¨¬ «ì­ë© ã஢¥­ì ¢«®¦¥­­®á⨠¡«®ª®¢ ¤«ï  ­ «¨§ 
MAX_FILE_SIZE equ 150*0x400 ;¬ ªá¨¬ «ì­ë© à §¬¥à ä ©«  (0x400=1Kb)
sizeof.block_3ds equ 9
can_save db 0 ;¨§¬¥­ï«áï «¨ ä ©«
macro block_3ds id,icon,par,caption
{

View File

@ -358,10 +358,13 @@ pushad
mov edx,4
int 0x40
;mov ebx,(55 shl 16)+20
;mov ecx,(5 shl 16)+20
;mov edx,5
;int 0x40
cmp byte[can_save],0
je @f
mov ebx,(55 shl 16)+20
mov ecx,(5 shl 16)+20
mov edx,5
int 0x40
@@:
mov ebx,(85 shl 16)+20
mov ecx,(5 shl 16)+20
@ -378,9 +381,12 @@ pushad
mov edx,(32 shl 16)+7 ;open
int 0x40
;add ebx,IMAGE_TOOLBAR_ICON_SIZE
;mov edx,(57 shl 16)+7 ;save
;int 0x40
cmp byte[can_save],0
je @f
add ebx,IMAGE_TOOLBAR_ICON_SIZE
mov edx,(57 shl 16)+7 ;save
int 0x40
@@:
mov dword[w_scr_t1.all_redraw],1
stdcall [tl_draw],dword tree1
@ -433,6 +439,7 @@ button:
align 4
but_new_file:
mov byte[can_save],0
stdcall [tl_info_clear], tree1 ;®ç¨á⪠ ᯨ᪠ ®¡ê¥ªâ®¢
stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
;;;call draw_window
@ -467,6 +474,7 @@ but_open_file:
;mov byte[ebx],0 ;­  á«ãç © ¥á«¨ à ­¥¥ ¡ë« ®âªàëâ ä ©« ¡®«ì襣® à §¬¥à  ç¨á⨬ ª®­¥æ ¡ãä¥à  á ä ©«®¬
;mcall 71,1,openfile_path
mov byte[can_save],0
stdcall [tl_info_clear], tree1 ;®ç¨á⪠ ᯨ᪠ ®¡ê¥ªâ®¢
mov esi,dword[open_file_lif]
@ -813,9 +821,31 @@ endp
align 4
but_save_file:
if debug
stdcall buf_draw_hex_table,dword[open_file_lif],3 ;亢<>◤平言 16-鄖蝑錼 <20>限錼
end if
pushad
copy_path open_dialog_name,communication_area_default_path,file_name,0
mov [OpenDialog_data.type],1
stdcall [OpenDialog_Start],OpenDialog_data
cmp [OpenDialog_data.status],2
je .end_save_file
;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
mov [run_file_70.Function], 2
mov [run_file_70.Position], 0
mov [run_file_70.Flags], 0
mov ebx, dword[open_file_lif]
mov [run_file_70.Buffer], ebx
mov ebx,dword[ebx+2]
mov dword[run_file_70.Count], ebx ;à §¬¥à ä ©« 
mov byte[run_file_70+20], 0
mov dword[run_file_70.FileName], openfile_path
mov ebx,run_file_70
int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
cmp ebx,0xffffffff
je .end_save_file
.end_save_file:
popad
ret
align 4
@ -1169,7 +1199,7 @@ procinfo process_information
align 4
buf_0: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
.l: dw 205 ;+4 left
dw 35 ;+6 top
.t: dw 35 ;+6 top
.w: dd 340 ;+8 w
.h: dd 250 ;+12 h
.color: dd 0xffffd0 ;+16 color

View File

@ -3,14 +3,13 @@
; à ¡®âë ®ª­  á ª®®à¤¨­ â ¬¨
;
prop_edits_top equ 25
prop_edits_height equ 18
prop_wnd_width equ 350 ;è¨à¨­  ®ª­  ᮠ᢮©á⢠¬¨ ®¡ê¥ªâ 
SIZE_ONE_FLOAT equ 14
MAX_OBJECT_SIZE equ (4+SIZE_ONE_FLOAT*3+1)
prop_wnd_run db 0 ;¯¥à¥¬¥­­ ï á«¥¤ïé ï §  ⥬ çâ®-¡ë ­¥ § ¯ã᪠âì ¡®«ìè¥ 1-£® ®ª­  ᮠ᢮©á⢠¬¨ ®¤­®¢à¥¬¥­­®
txt_q db '?',0
txt_space:
db SIZE_ONE_FLOAT dup(' ')
.end:
@ -54,6 +53,7 @@ pushad
cmp word[ebx],CHUNK_VERTLIST
jne .no_object ;¥á«¨ ­¥ â®â ®¡ê¥ªâ
add ebx,8
mov word[NumberSymbolsAD],5
finit
.new_point:
mov dword[obj_point],ebx
@ -82,6 +82,10 @@ pushad
jg .new_point
stdcall dword[tl_cur_beg], tree3
.no_object:
edit_boxes_set_sys_color edit1,editboxes_end,sc ;ãáâ ­®¢ª  á¨á⥬­ëå 梥⮢
stdcall [edit_box_set_text], edit1, txt_q
stdcall [edit_box_set_text], edit2, txt_q
stdcall [edit_box_set_text], edit3, txt_q
popad
align 4
@ -96,15 +100,42 @@ pushad
shl ebx,16
mov bx,prop_wnd_width
mov cx,word[procinfo.box.top]
add cx,word[buf_0.t]
shl ecx,16
mov cx,250
mov edx,0xffffd0
or edx,0x33000000
int 0x40
mov eax,8
mov ebx,(5 shl 16)+20
mov ecx,(195 shl 16)+20
mov edx,3
mov esi,[sc.work_button]
int 0x40
mov ebx,(30 shl 16)+20
mov ecx,(195 shl 16)+20
mov edx,4
int 0x40
mov eax,7
mov ebx,[image_data_toolbar]
add ebx,4*IMAGE_TOOLBAR_ICON_SIZE
mov ecx,(16 shl 16)+16
mov edx,(7 shl 16)+197 ;load
int 0x40
sub ebx,IMAGE_TOOLBAR_ICON_SIZE
mov edx,(32 shl 16)+197 ;save
int 0x40
mov dword[w_scr_t3.all_redraw],1
stdcall [scrollbar_ver_draw],dword w_scr_t3
stdcall [tl_draw], tree3
stdcall [edit_box_draw], edit1
stdcall [edit_box_draw], edit2
stdcall [edit_box_draw], edit3
mcall 12,2
popad
@ -133,6 +164,9 @@ align 4
prop_key:
push eax
mcall 2
stdcall [edit_box_key], edit1
stdcall [edit_box_key], edit2
stdcall [edit_box_key], edit3
stdcall [tl_key], tree3
pop eax
ret
@ -141,6 +175,9 @@ align 4
prop_mouse:
;push ecx edi
stdcall [tl_mouse], tree3
stdcall [edit_box_mouse], edit1
stdcall [edit_box_mouse], edit2
stdcall [edit_box_mouse], edit3
;pop edi ecx
ret
@ -148,10 +185,99 @@ align 4
prop_button:
mcall 17 ;¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨
cmp ah,10
cmp ah,3
jne @f
;;;call but_element_change
mov ah,1 ;¤«ï § ªàëâ¨ï ®ª­ 
;§ £à㧪  ª®®à¤¨­ â ¢ editbox-ë
push ebx
stdcall [tl_node_get_data],tree3
pop ebx
cmp ebx,0
je .no_select_0
mov ebx,[ebx]
mov word[NumberSymbolsAD],8
finit
fld dword[ebx]
fstp qword[Data_Double]
call DoubleFloat_to_String
stdcall [edit_box_set_text], edit1, Data_String
fld dword[ebx+4]
fstp qword[Data_Double]
call DoubleFloat_to_String
stdcall [edit_box_set_text], edit2, Data_String
fld dword[ebx+8]
fstp qword[Data_Double]
call DoubleFloat_to_String
stdcall [edit_box_set_text], edit3, Data_String
stdcall [edit_box_draw], edit1
stdcall [edit_box_draw], edit2
stdcall [edit_box_draw], edit3
.no_select_0:
pop ebx
@@:
cmp ah,4
jne @f
push ebx ecx esi edi
stdcall [tl_node_get_data],tree3
pop ebx
cmp ebx,0
je .no_select_1
mov ebx,[ebx]
finit
mov esi,string1
mov edi,Data_String
cld
mov ecx,32
rep movsb
call String_to_DoubleFloat
fld qword[Data_Double] ;áç¨â뢠¥¬ ª ª double
fstp dword[ebx] ;á®å࠭塞 ª ª float
mov esi,string2
mov edi,Data_String
cld
mov ecx,32
rep movsb
call String_to_DoubleFloat
fld qword[Data_Double] ;áç¨â뢠¥¬ ª ª double
fstp dword[ebx+4] ;á®å࠭塞 ª ª float
mov esi,string3
mov edi,Data_String
cld
mov ecx,32
rep movsb
call String_to_DoubleFloat
fld qword[Data_Double] ;áç¨â뢠¥¬ ª ª double
fstp dword[ebx+8] ;á®å࠭塞 ª ª float
;®¡­®¢«¥­¨¥ ¨§¬¥­¥­­®£® 㧫  ¢ ᯨ᪥ tree3 ¨ £« ¢­®£® ®ª­  (¯® â ©¬¥àã)
mov word[NumberSymbolsAD],5
mov dword[obj_point],ebx
mov dword[obj_point.text],0
cld
mov ecx,3
.coord:
fld dword[ebx]
fstp qword[Data_Double]
call DoubleFloat_to_String
add ebx,4
stdcall str_len, Data_String
mov esi,txt_space
add esi,eax
cmp esi,txt_space.end
jl .normal_size
mov esi,txt_space.end-1 ;¬¨­¨¬ã¬ 1 ¯à®¡¥« ­ã¦­® ¤®¡ ¢¨âì, çâ®-¡ë æ¨äàë ­¥ ᫨¯ «¨áì
.normal_size:
stdcall str_cat, obj_point.text,esi
stdcall str_cat, obj_point.text,Data_String
loop .coord
stdcall dword[tl_node_set_data], obj_point, tree3
stdcall dword[tl_draw], tree3
mov byte[can_save],1 ;¤«ï ¯®ª §  ª­®¯ª¨ '‘®åà ­¨âì'
mov dword[offs_last_timer],0 ;¤«ï ®¡­®¢«¥­¨ï ¡«®ª  ¢ â ©¬¥à¥
.no_select_1:
pop edi esi ecx ebx
@@:
cmp ah,1
@ -166,9 +292,18 @@ prop_button:
;¤¥à¥¢® á ®¡ê¥ªâ ¬¨ ¢ ¯®«ì§®¢ â¥«ì᪮¬ ä ©«¥
tree3 tree_list MAX_OBJECT_SIZE,3,\
tl_key_no_edit+tl_list_box_mode,\
16,16, 0xffffff,0xb0d0ff,0xd000ff, 5,30,300,150, 16, 4,0, el_focus,\
16,16, 0xffffff,0xb0d0ff,0xd000ff, 5,30,300,160, 16, 4,0, el_focus,\
w_scr_t3,0
edit1 edit_box 80, 70, 200, 0xffffff, 0xff, 0x80ff, 0, 0x8000, 34, string1, mouse_dd, 0
edit2 edit_box 80, 154, 200, 0xffffff, 0xff, 0x80ff, 0, 0x8000, 34, string2, mouse_dd, 0
edit3 edit_box 80, 238, 200, 0xffffff, 0xff, 0x80ff, 0, 0x8000, 34, string3, mouse_dd, 0
editboxes_end:
string1 rb 34
string2 rb 34
string3 rb 34
align 4
w_scr_t3:
.size_x dw 16 ;+0