kolibrios-fun/programs/develop/info3ds/info3ds_u.asm
IgorA f0aeaf2628 add 'voxel_editor' to iso, small fixes in 'info3ds'
git-svn-id: svn://kolibrios.org@6247 a494cfbc-eb01-0410-851d-a64ba20cac60
2016-02-18 21:02:58 +00:00

1431 lines
38 KiB
NASM
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

use32
org 0x0
db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
dd 1, start, i_end, mem, stacktop, file_name, sys_path
include '../../macros.inc'
include '../../proc32.inc'
include '../../KOSfuncs.inc'
include '../../load_img.inc'
include '../../develop/libraries/box_lib/trunk/box_lib.mac'
include '../../develop/libraries/TinyGL/asm_fork/opengl_const.inc'
include 'lang.inc'
include 'info_fun_float.inc'
include 'info_menu.inc'
include 'data.inc'
version_edit equ 0
3d_wnd_l equ 205 ;®âáâ㯠¤«ï tinygl ¡ãä¥à  á«¥¢ 
3d_wnd_t equ 47 ;®âáâ㯠¤«ï tinygl ¡ãä¥à  ᢥàåã
3d_wnd_w equ 344
3d_wnd_h equ 312
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
ID_ICON_CHUNK_MAIN equ 0 ;¨ª®­ª  £« ¢­®£® ¡«®ª 
ID_ICON_CHUNK_NOT_FOUND equ 1 ;¨ª®­ª  ­¥ ¨§¢¥áâ­®£® ¡«®ª 
ID_ICON_DATA equ 2 ;¨ª®­ª  ¤«ï ¤ ­­ëå ¡«®ª , ­¥ ®¯à¥¤¥«¥­­®© áâàãªâãàë
ID_ICON_POINT equ 8
ID_ICON_POINT_SEL equ 9
FILE_ERROR_CHUNK_SIZE equ -3 ;®è¨¡ª  ¢ à §¬¥à¥ ¡«®ª 
include 'info_o3d.inc'
align 4
fl255 dd 255.0
open_file_data dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï ®âªàëâ¨ï ä ©«®¢ 3ds
open_file_size dd 0 ;à §¬¥à ®âªàë⮣® ä ©« 
;
main_wnd_height equ 460 ;¢ëá®â  £« ¢­®£® ®ª­  ¯à®£à ¬¬ë
fn_toolbar db 'toolbar.png',0
IMAGE_TOOLBAR_ICON_SIZE equ 21*21*3
image_data_toolbar dd 0
;
icon_tl_sys dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï á¨á⥬­ëå ¨ª®­®ª
icon_toolbar dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï ¨ª®­®ª ®¡ê¥ªâ®¢
;--------------------------------------
level_stack dd 0
offs_last_timer dd 0 ;¯®á«¥¤­¨© ᤢ¨£ ¯®ª § ­ë© ¢ ä㭪樨 â ©¬¥à 
align 4
file_3ds: ;¯¥à¥¬¥­­ë¥ ¨á¯®«ì§ã¥¬ë¥ ¯à¨ ®âªàë⨨ ä ©« 
.offs: dd 0 ;+0 㪠§ â¥«ì ­  ­ ç «® ¡«®ª 
.size: dd 0 ;+4 à §¬¥à ¡«®ª  (¤«ï 1-£® ¯ à ¬¥âà  = à §¬¥à ä ©«  3ds)
rb 8*MAX_FILE_LEVEL
size_one_list equ 42+sizeof.obj_3d
list_offs_chunk_del equ 8 ;¬®¦¥â «¨ ¡«®ª 㤠«ïâáï
list_offs_chunk_lev equ 9 ;ã஢¥­ì ¡«®ª  (¯à®¯¨á ­ ¢ ¤ ­­ë¥ 㧫 )
list_offs_p_data equ 10 ;㪠§ â¥«ì ­  ¯®¤¯¨áì ¡«®ª 
list_offs_obj3d equ 14 ;㪠§ â¥«ì ­  áâàãªâãàã ¤ ­­ëå ¤«ï 3d ®¡ê¥ªâ 
list_offs_text equ 14+sizeof.obj_3d ;ᤢ¨£ ­ ç «  ⥪áâ  ¢ «¨áâ¥
buffer rb size_one_list ;¡ãä¥à ¤«ï ¤®¡ ¢«¥­¨ï áâàãªâãà ¢ ᯨ᮪ tree1
txt_3ds_symb db 0,0
;--------------------------------------
align 4
start:
;--- copy cmd line ---
mov esi,file_name
mov edi,openfile_path
@@:
lodsd
cmp eax,0
je @f ;¢ë室, ¥á«¨ 0
stosd
jmp @b
@@:
stosd
load_libraries l_libs_start,l_libs_end
;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨«¨áì ¡¨¡«¨®â¥ª¨
mov ebp,lib_0
.test_lib_open:
cmp dword [ebp+ll_struc_size-4],0
jz @f
mcall SF_TERMINATE_PROCESS ;exit not correct
@@:
add ebp,ll_struc_size
cmp ebp,l_libs_end
jl .test_lib_open
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
mcall SF_SET_EVENTS_MASK,0xC0000027
stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
;kmenu initialisation
stdcall [kmenu_init],sc
stdcall [ksubmenu_new]
mov [main_menu], eax
stdcall [ksubmenu_new]
mov [main_menu_view], eax
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Veiw_Vertexes, 10
stdcall [ksubmenu_add], [main_menu_view], eax
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Veiw_Faces, 6
stdcall [ksubmenu_add], [main_menu_view], eax
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Veiw_Faces_Fill, 7
stdcall [ksubmenu_add], [main_menu_view], eax
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Veiw_Light, 8
stdcall [ksubmenu_add], [main_menu_view], eax
stdcall [kmenuitem_new], KMENUITEM_SEPARATOR, 0, 0
stdcall [ksubmenu_add], [main_menu_view], eax
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Veiw_Reset, 9
stdcall [ksubmenu_add], [main_menu_view], eax
stdcall [kmenuitem_new], KMENUITEM_SUBMENU, sz_main_menu_View, [main_menu_view]
stdcall [ksubmenu_add], [main_menu], eax
mov dword[w_scr_t1.type],1
stdcall dword[tl_data_init], tree1
;á¨á⥬­ë¥ ¨ª®­ª¨ 16*16 ¤«ï tree_list
load_image_file 'tl_sys_16.png', icon_tl_sys
;¥á«¨ ¨§®¡à ¦¥­¨¥ ­¥ ®âªàë«®áì, â® ¢ icon_tl_sys ¡ã¤ãâ
;­¥ ¨­¨æ¨ «¨§¨à®¢ ­­ë¥ ¤ ­­ë¥, ­® ®è¨¡ª¨ ­¥ ¡ã¤¥â, â. ª. ¡ãä¥à ­ã¦­®£® à §¬¥à 
mov eax,dword[icon_tl_sys]
mov dword[tree1.data_img_sys],eax
load_image_file 'objects.png', icon_toolbar
mov eax,dword[icon_toolbar]
mov dword[tree1.data_img],eax
load_image_file 'font8x9.bmp', image_data_toolbar
stdcall [buf2d_create_f_img], buf_1,[image_data_toolbar] ;ᮧ¤ ¥¬ ¡ãä¥à
stdcall mem.Free,[image_data_toolbar] ;®á¢®¡®¦¤ ¥¬ ¯ ¬ïâì
stdcall [buf2d_conv_24_to_8], buf_1,1 ;¤¥« ¥¬ ¡ãä¥à ¯à®§à ç­®á⨠8 ¡¨â
stdcall [buf2d_convert_text_matrix], buf_1
load_image_file fn_toolbar, image_data_toolbar
;à ¡®â  á ä ©«®¬ ­ áâ஥ª
copy_path ini_name,sys_path,file_name,0
mov dword[def_dr_mode],0
stdcall dword[ini_get_int],file_name,ini_sec_w3d,key_dv,1
or eax,eax
jz @f
or dword[def_dr_mode], 1 shl bit_vertexes
@@:
stdcall dword[ini_get_int],file_name,ini_sec_w3d,key_df,1
or eax,eax
jz @f
or dword[def_dr_mode], 1 shl bit_faces
@@:
stdcall dword[ini_get_int],file_name,ini_sec_w3d,key_dff,1
or eax,eax
jz @f
or dword[def_dr_mode], 1 shl bit_faces_fill
@@:
stdcall dword[ini_get_int],file_name,ini_sec_w3d,key_dl,1
or eax,eax
jz @f
or dword[def_dr_mode], 1 shl bit_light
@@:
stdcall dword[ini_get_color],file_name,ini_sec_w3d,key_ox,0x0000ff
mov [color_ox],eax
stdcall dword[ini_get_color],file_name,ini_sec_w3d,key_oy,0xff0000
mov [color_oy],eax
stdcall dword[ini_get_color],file_name,ini_sec_w3d,key_oz,0x00ff00
mov [color_oz],eax
stdcall dword[ini_get_color],file_name,ini_sec_w3d,key_bk,0x000000
mov [color_bk],eax
shr eax,8
mov [color_bk+4],eax
shr eax,8
mov [color_bk+8],eax
stdcall dword[ini_get_color],file_name,ini_sec_w3d,key_vert,0xffffff
mov [color_vert],eax
stdcall dword[ini_get_color],file_name,ini_sec_w3d,key_face,0x808080
mov [color_face],eax
stdcall dword[ini_get_color],file_name,ini_sec_w3d,key_select,0xffff00
mov [color_select],eax
finit
fild dword[color_bk+8]
fdiv dword[fl255]
fstp dword[color_bk+8]
mov eax,[color_bk+4]
and eax,0xff
mov [color_bk+4],eax
fild dword[color_bk+4]
fdiv dword[fl255]
fstp dword[color_bk+4]
mov eax,[color_bk]
and eax,0xff
mov [color_bk],eax
fild dword[color_bk]
fdiv dword[fl255]
fstp dword[color_bk]
mcall SF_SYSTEM_GET,SSF_TIME_COUNT
mov [last_time],eax
stdcall [kosglMakeCurrent], 3d_wnd_l,3d_wnd_t,3d_wnd_w,3d_wnd_h,ctx1
stdcall [glEnable], GL_DEPTH_TEST
stdcall [glEnable], GL_NORMALIZE ;¤¥« ¬ ­®à¬ «¨ ®¤¨­ ª®¢®© ¢¥«¨ç¨­ë ¢® ¨§¡¥¦ ­¨¥  àâ¥ä ªâ®¢
stdcall [glClearColor], [color_bk+8],[color_bk+4],[color_bk],0.0
stdcall [glShadeModel], GL_SMOOTH
stdcall [gluNewQuadric]
mov [qObj],eax
mov eax,dword[ctx1] ;eax -> TinyGLContext.GLContext
mov eax,[eax] ;eax -> ZBuffer
mov eax,[eax+offs_zbuf_pbuf] ;eax -> ZBuffer.pbuf
mov dword[buf_ogl],eax
;open file from cmd line
cmp dword[openfile_path],0
je @f
call but_open_file.no_dlg
@@:
call draw_window
align 4
still:
mcall SF_SYSTEM_GET,SSF_TIME_COUNT
mov ebx,[last_time]
add ebx,10 ;§ ¤¥à¦ª 
cmp ebx,eax
jge @f
mov ebx,eax
@@:
sub ebx,eax
mcall SF_WAIT_EVENT_TIMEOUT
cmp eax,0
je timer_funct
cmp al,1
jne @f
call draw_window
jmp still
@@:
cmp al,2
jz key
cmp al,3
jz button
cmp al,6
jne @f
mcall SF_THREAD_INFO,procinfo,-1
cmp ax,word[procinfo+4]
jne @f ;®ª­® ­¥  ªâ¨¢­®
call mouse
@@:
jmp still
align 4
mouse:
push eax ebx
mcall SF_MOUSE_GET,SSF_BUTTON_EXT
bt eax,0
jnc .end_m
;mouse l. but. move
cmp dword[mouse_drag],1
jne .end_m
stdcall [tl_node_get_data],tree1
cmp eax,0
je .end_d
mov ebx,dword[eax]
add ebx,dword[open_file_data] ;¯®«ãç ¥¬ §­ ç¥­¨¥ ᤢ¨£  ¢ ¯ ¬ïâ¨
cmp word[ebx],CHUNK_OBJBLOCK
jne .end_d
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
mov ebx,eax
shr ebx,16 ;mouse.x
cmp ebx,3d_wnd_l
jg @f
mov ebx,3d_wnd_l
@@:
sub ebx,3d_wnd_l
cmp ebx,3d_wnd_w
jle @f
mov ebx,3d_wnd_w
@@:
and eax,0xffff ;mouse.y
cmp eax,3d_wnd_t
jg @f
mov eax,3d_wnd_t
@@:
sub eax,3d_wnd_t
cmp eax,3d_wnd_h
jle @f
mov eax,3d_wnd_h
@@:
finit
fild dword[mouse_y]
mov [mouse_y],eax
fisub dword[mouse_y]
fdiv dword[angle_dxm] ;¥á«¨ ªãàá®à ¤¢¨¦¥âáï ¯® ®á¨ y (¢¢¥àå ¨«¨ ¢­¨§) â® ¯®¢®à®â ¤¥« ¥¬ ¢®ªà㣠®á¨ x
fadd dword[angle_x]
fstp dword[angle_x]
fild dword[mouse_x]
mov [mouse_x],ebx
fisub dword[mouse_x]
fdiv dword[angle_dym] ;¥á«¨ ªãàá®à ¤¢¨¦¥âáï ¯® ®á¨ x (¢¢¥àå ¨«¨ ¢­¨§) â® ¯®¢®à®â ¤¥« ¥¬ ¢®ªà㣠®á¨ y
fadd dword[angle_y]
fstp dword[angle_y]
stdcall [tl_node_get_data],tree1
;cmp eax,0 - ­¥ ­ ¤®, ¡ë«® ᤥ« ­® ¢ëè¥
add eax,list_offs_obj3d
stdcall draw_3d, eax
jmp .end_d
.end_m:
bt eax,16
jnc @f
;mouse l. but. up
mov dword[mouse_drag],0
jmp .end_d
@@:
bt eax,8
jnc .end_d
;mouse l. but. press
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
mov ebx,eax
shr ebx,16 ;mouse.x
cmp ebx,3d_wnd_l
jl .end_d
sub ebx,3d_wnd_l
cmp ebx,3d_wnd_w
jg .end_d
and eax,0xffff ;mouse.y
cmp eax,3d_wnd_t
jl .end_d
sub eax,3d_wnd_t
cmp eax,3d_wnd_h
jg .end_d
mov dword[mouse_drag],1
mov dword[mouse_x],ebx
mov dword[mouse_y],eax
.end_d:
stdcall [tl_mouse], dword tree1
stdcall [kmainmenu_dispatch_cursorevent], [main_menu]
pop ebx eax
ret
align 4
timer_funct:
pushad
mcall SF_SYSTEM_GET,SSF_TIME_COUNT
mov [last_time],eax
;¯à®á¬ âਢ ¥¬ ¢ë¤¥«¥­­ë© ¡«®ª ¤ ­­ëå
stdcall [tl_node_get_data],tree1
cmp eax,0
je .end_f
mov edi,eax
add edi,list_offs_obj3d
mov ebx,eax
mov eax,dword[ebx]
mov ecx,dword[ebx+4] ;à §¬¥à ¡«®ª 
stdcall hex_in_str, txt_3ds_offs.dig, eax,8
stdcall hex_in_str, txt_3ds_offs.siz, ecx,8
add eax,dword[open_file_data] ;¯®«ãç ¥¬ §­ ç¥­¨¥ ᤢ¨£  ¢ ¯ ¬ïâ¨
cmp dword[offs_last_timer],eax
je .end_f
;¥á«¨ ¢ë¤¥«¥­­ë© ¡«®ª ¤ ­­ëå ­¥ ᮢ¯ ¤ ¥â á ¯®á«¥¤­¨¬ § ¯®¬­¥­­ë¬
mov dword[offs_last_timer],eax
cmp word[eax],CHUNK_OBJBLOCK
jne .end_oblo
cmp dword[edi+offs_obj_poi_count],2
jl .ini_oblo
stdcall draw_3d,edi
jmp .end_f
.ini_oblo:
stdcall obj_init,edi ;¯®¯ë⪠ ­ áâநâì ¯¥à¥¬¥­­ë¥ ®¡ê¥ªâ 
cmp dword[edi+offs_obj_poi_count],2
jl .end_f
call mnu_reset_settings ;á¡à®á 㣫®¢ ¯®¢®à®â  ¨ ०¨¬®¢ à¨á®¢ ­¨ï
jmp .end_f
.end_oblo:
cmp word[eax],CHUNK_MATERIAL
jne .end_mblo
cmp dword[edi+offs_mat_name],0
je .ini_mblo
stdcall draw_material,edi
jmp .end_f
.ini_mblo:
stdcall mat_init,edi ;¯®¯ë⪠ ­ áâநâì ¤ ­­ë¥ ¬ â¥à¨ « 
cmp dword[edi+offs_mat_name],0
je .end_f
stdcall draw_material,edi
jmp .end_f
.end_mblo:
stdcall buf_draw_beg, buf_ogl
stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_3ds_offs,5,35,0xb000
mov edx,dword[ebx+list_offs_p_data]
cmp edx,0 ;ᬮâਬ ¥áâì «¨ ®¯¨á ­¨¥ ¡«®ª 
je .no_info
stdcall [buf2d_draw_text], buf_ogl, buf_1,edx,5,45,0xb000
.no_info:
stdcall [buf2d_draw], buf_ogl ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
.end_f:
popad
jmp still
align 4
draw_window:
pushad
mcall SF_REDRAW,SSF_BEGIN_DRAW
mov edx,[sc.work]
or edx,0x33000000
mcall SF_CREATE_WINDOW, (20 shl 16)+560, (20 shl 16)+main_wnd_height,,, capt
mcall SF_THREAD_INFO,procinfo,-1
mov eax,dword[procinfo.box.height]
cmp eax,250
jge @f
mov eax,250
@@:
sub eax,30
sub eax,[tree1.box_top]
mov [tree1.box_height],eax
mov word[w_scr_t1.y_size],ax ;­®¢ë¥ à §¬¥àë áªà®««¨­£ 
stdcall [kmainmenu_draw], [main_menu]
mov esi,[sc.work_button]
mcall SF_DEFINE_BUTTON,(5 shl 16)+20,(24 shl 16)+20,0x40000003
mcall ,(30 shl 16)+20,,0x40000004 ;open
mcall ,(3d_wnd_l shl 16)+20,,0x40000005 ;¢¥àè¨­ë ¢ª«./¢ëª«.
mcall ,((3d_wnd_l+25) shl 16)+20,,0x40000006 ;£à ­¨ ¢ª«./¢ëª«.
mcall ,((3d_wnd_l+50) shl 16)+20,,0x40000007 ;§ «¨¢ª  £à ­¥© ¢ª«./¢ëª«.
mcall ,((3d_wnd_l+75) shl 16)+20,,0x40000008 ;ᢥ⠢ª«./¢ëª«.
mcall ,((3d_wnd_l+100) shl 16)+20,,0x40000009 ;á¡à®á
mcall SF_PUT_IMAGE,[image_data_toolbar],(21 shl 16)+21,(5 shl 16)+24 ;new
add ebx,IMAGE_TOOLBAR_ICON_SIZE
mcall ,,,(30 shl 16)+24 ;open
add ebx,IMAGE_TOOLBAR_ICON_SIZE*6
mcall ,,,((3d_wnd_l) shl 16)+24 ;¢¥àè¨­ë ¢ª«./¢ëª«.
add ebx,IMAGE_TOOLBAR_ICON_SIZE
mcall ,,,((3d_wnd_l+25) shl 16)+24 ;£à ­¨ ¢ª«./¢ëª«.
add ebx,IMAGE_TOOLBAR_ICON_SIZE
mcall ,,,((3d_wnd_l+50) shl 16)+24 ;§ «¨¢ª  £à ­¥© ¢ª«./¢ëª«.
add ebx,IMAGE_TOOLBAR_ICON_SIZE
mcall ,,,((3d_wnd_l+75) shl 16)+24 ;ᢥ⠢ª«./¢ëª«.
add ebx,IMAGE_TOOLBAR_ICON_SIZE
mcall ,,,((3d_wnd_l+100) shl 16)+24 ;á¡à®á
mov dword[w_scr_t1.all_redraw],1
stdcall [tl_draw], tree1
stdcall [buf2d_draw], buf_ogl
mcall SF_REDRAW,SSF_END_DRAW
popad
ret
align 4
key:
mcall SF_GET_KEY
cmp dword[el_focus], tree1
jne @f
stdcall [tl_key], tree1
jmp .end
@@:
cmp ah,178 ;Up
jne @f
fld dword[angle_x]
fadd dword[delt_size]
fstp dword[angle_x]
stdcall [tl_node_get_data],tree1
cmp eax,0
je .end
add eax,list_offs_obj3d
stdcall draw_3d, eax
jmp .end
@@:
cmp ah,177 ;Down
jne @f
fld dword[angle_x]
fsub dword[delt_size]
fstp dword[angle_x]
stdcall [tl_node_get_data],tree1
cmp eax,0
je .end
add eax,list_offs_obj3d
stdcall draw_3d, eax
jmp .end
@@:
cmp ah,176 ;Left
jne @f
fld dword[angle_y]
fadd dword[delt_size]
fstp dword[angle_y]
stdcall [tl_node_get_data],tree1
cmp eax,0
je .end
add eax,list_offs_obj3d
stdcall draw_3d, eax
jmp .end
@@:
cmp ah,179 ;Right
jne @f
fld dword[angle_y]
fsub dword[delt_size]
fstp dword[angle_y]
stdcall [tl_node_get_data],tree1
cmp eax,0
je .end
add eax,list_offs_obj3d
stdcall draw_3d, eax
;jmp .end
@@:
.end:
jmp still
align 4
button:
mcall SF_GET_BUTTON
cmp ah,3
jne @f
call but_new_file
jmp still
@@:
cmp ah,4
jne @f
call but_open_file
jmp still
@@:
;menu functions
cmp ah,5
jne @f
call mnu_vertexes_on
jmp still
@@:
cmp ah,6
jne @f
call mnu_edges_on
jmp still
@@:
cmp ah,7
jne @f
call mnu_faces_on
jmp still
@@:
cmp ah,8
jne @f
call mnu_light_on_off
jmp still
@@:
cmp ah,9
jne @f
call mnu_reset_settings
jmp still
@@:
cmp ah,1
jne still
.exit:
mov dword[tree1.data_img],0
mov dword[tree1.data_img_sys],0
stdcall [tl_data_clear], tree1
stdcall [buf2d_delete],buf_1 ;㤠«ï¥¬ ¡ãä¥à
stdcall mem.Free,[image_data_toolbar]
stdcall mem.Free,[open_file_data]
stdcall [gluDeleteQuadric], [qObj]
mcall SF_TERMINATE_PROCESS
align 4
but_new_file:
push eax ebx
stdcall dword[tl_node_poi_get_info], tree1,0
@@:
cmp eax,0
je @f
mov ebx,eax
stdcall [tl_node_poi_get_data], tree1,ebx
add eax,list_offs_obj3d
stdcall obj_clear_param, eax
stdcall dword[tl_node_poi_get_next_info], tree1,ebx
cmp eax,0
jne @b
@@:
pop ebx eax
stdcall [tl_info_clear], tree1 ;®ç¨á⪠ ᯨ᪠ ®¡ê¥ªâ®¢
stdcall [buf2d_clear], buf_ogl, [buf_ogl.color] ;ç¨á⨬ ¡ãä¥à
stdcall [tl_draw], tree1
stdcall [buf2d_draw], buf_ogl ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
ret
align 4
but_open_file:
copy_path open_dialog_name,communication_area_default_path,file_name,0
pushad
mov [OpenDialog_data.type],0
stdcall [OpenDialog_Start],OpenDialog_data
cmp [OpenDialog_data.status],2
je .end_open_file
;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
jmp @f
.no_dlg: ;¥á«¨ ¬¨­ã¥¬ ¤¨ «®£ ®âªàëâ¨ï ä ©« 
pushad
@@:
mov [run_file_70.Function], SSF_GET_INFO
mov [run_file_70.Position], 0
mov [run_file_70.Flags], 0
mov dword[run_file_70.Count], 0
mov dword[run_file_70.Buffer], open_b
mov byte[run_file_70+20], 0
mov dword[run_file_70.FileName], openfile_path
mcall SF_FILE,run_file_70
mov ecx,dword[open_b+32] ;+32 qword: à §¬¥à ä ©«  ¢ ¡ ©â å
stdcall mem.ReAlloc,[open_file_data],ecx
mov [open_file_data],eax
mov [run_file_70.Function], SSF_READ_FILE
mov [run_file_70.Position], 0
mov [run_file_70.Flags], 0
mov dword[run_file_70.Count], ecx
m2m dword[run_file_70.Buffer], dword[open_file_data]
mov byte[run_file_70+20], 0
mov dword[run_file_70.FileName], openfile_path
mcall SF_FILE,run_file_70 ;§ £à㦠¥¬ ä ©« 3ds
cmp ebx,0xffffffff
je .end_open_file
mov [open_file_size],ebx
;mcall SF_SET_CAPTION,1,openfile_path
call init_tree
stdcall [buf2d_draw], buf_ogl ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
.end_open_file:
popad
ret
align 4
init_tree:
;ç¨á⨬ ¯ ¬ïâì § ­ïâãî ®¡ê¥ªâ ¬¨
stdcall dword[tl_node_poi_get_info], tree1,0
@@:
cmp eax,0
je @f
mov ebx,eax
stdcall [tl_node_poi_get_data], tree1,ebx
cmp eax,0
je @f
add eax,list_offs_obj3d
stdcall obj_clear_param, eax
stdcall dword[tl_node_poi_get_next_info], tree1,ebx
cmp eax,0
jne @b
@@:
stdcall [tl_info_clear], tree1 ;®ç¨á⪠ ᯨ᪠ ®¡ê¥ªâ®¢
mov esi,dword[open_file_data]
cmp word[esi],CHUNK_MAIN
je @f
stdcall buf_draw_beg, buf_ogl
stdcall [buf2d_draw_text], buf_ogl, buf_1,txt_no_3ds,5,25,0xff0000 ;à¨á㥬 áâபã á ⥪á⮬
jmp .end_open
@@:
;--- ®¡à ¡®âª  ®âªàë⮣® *.3ds ä ©« 
mov eax,file_3ds
mov dword[level_stack],0 ;®¡­ã«ï¥¬ ã஢¥­ì á⥪ 
mov dword[offs_last_timer],0
;--- ¤®¡ ¢«¥­¨¥ £« ¢­®£® ¡«®ª  ¢ ᯨ᮪
stdcall add_3ds_object, ID_ICON_CHUNK_MAIN,0,dword[esi+2],0
call block_children ;¢å®¤ ¢ ¤®ç¥à­¨© ¡«®ª
mov edi,dword[file_3ds.offs]
add edi,dword[file_3ds.size]
.cycle_main:
cmp dword[level_stack],0
jle .end_cycle
cmp esi,edi ;¥á«¨ ª®­¥æ ä ©« 
jge .end_cycle
mov edx,dword[esi+2] ;à §¬¥à ¡«®ª 
call block_analiz
cmp word[esi],CHUNK_MATERIAL
je @f
cmp word[esi],CHUNK_OBJMESH
je @f
cmp word[esi],CHUNK_OBJBLOCK
je @f
mov dword[bl_found],0
@@:
cmp dword[bl_found],0
jne @f
;®¡ê¥ªâ ­¥ ¨§¢¥áâ­®£® ¢¨¤ 
call block_next
jmp .cycle_main
@@:
;®¡ê¥ªâ ¨§¢¥áâ­®£® ¢¨¤ 
mov ecx,dword[bl_found]
mov bx,word[ecx+2] ;­®¬¥à ¨ª®­ª¨ ¤«ï ®¡ê¥ªâ 
cmp word[esi],CHUNK_OBJBLOCK
jne .pod1
add esi,6
push esi
sub esi,6
jmp .pod3
.pod1:
cmp word[esi],CHUNK_MATERIAL
jne .pod2
cmp word[esi+6],CHUNK_MATNAME
jne .pod2
add esi,12
push esi
sub esi,12
jmp .pod3
.pod2:
push dword[ecx+5] ;áâ ­¤ àâ­®¥ ­ §¢ ­¨¥ ¡«®ª 
.pod3:
stdcall add_3ds_object, ebx,dword[level_stack],edx
cmp byte[ecx+4],1
je .bl_data
;¡«®ª ᮤ¥à¦¨â ¤®ç¥à­¨¥ ¡«®ª¨
call block_children ;¢å®¤ ¢ ¤®ç¥à­¨© ¡«®ª
jmp .cycle_main
.bl_data:
;¡«®ª ᮤ¥à¦¨â ¤ ­­ë¥
call block_analiz_data
jmp .cycle_main
.end_cycle:
stdcall [tl_cur_beg], tree1
stdcall [tl_draw], tree1
.end_open:
ret
; ­ «¨§ ¤ ­­ëå ¡«®ª 
;input:
; eax - stack pointer
; esi - memory pointer
;output:
; eax - new stack pointer
; esi - new memory pointer
align 4
proc block_analiz_data uses ebx ecx edx edi
mov dx,word[esi]
mov ecx,dword[esi+2]
sub ecx,6 ;à §¬¥à ¤ ­­ëå ¢ ¡«®ª¥
add esi,6
mov ebx,dword[level_stack]
inc ebx
; ***  ­ «¨§ ¡«®ª®¢ á à §­ë¬¨ ¤ ­­ë¬¨ ¨ ¢ë¤¥«¥­¨¥¬ ¯®¤¡«®ª®¢
cmp dx,CHUNK_OBJBLOCK ;®¡ê¥ªâ
jne @f
push ax
cld
xor al,al
mov edi,esi
repne scasb
pop ax
sub edi,esi ;edi - strlen
add esi,edi
;sub ecx,edi ;㦥 ᤥ« ­® ¢ repne
jmp .next_bl
@@:
cmp dx,CHUNK_VERTLIST ;ᯨ᮪ ¢¥à設
je .vertexes
cmp dx,0x4111 ;ä« £¨ ¢¥à設
je .vertexes
cmp dx,CHUNK_MAPLIST ;⥪áâãà­ë¥ ª®®à¤¨­ âë
je .vertexes
jmp @f
.vertexes: ;®¡à ¡®âª  ¡«®ª®¢, ᮤ¥à¦ é¨å ¤ ­­ë¥ ¢¥à設
add esi,2
sub ecx,2
sub esi,8 ;¢®ááâ ­®¢«¥­¨¥ esi
call block_next
jmp .end_f
@@:
cmp dx,CHUNK_FACELIST ;ᯨ᮪ £à ­¥©
jne @f
push eax
movzx eax,word[esi]
shl eax,3
add esi,2
sub ecx,2
sub ecx,eax
cmp ecx,1
jl .data_3 ;¯à®¢¥à塞 ¥áâì «¨ ¡«®ª ®¯¨á뢠î騩 ¬ â¥à¨ «, ¯à¨¬¥­ï¥¬ë© ª ®¡ê¥ªâã
if 1
add esi,eax
mov ecx,dword[esi+2]
stdcall add_3ds_object, 10,ebx,ecx,0 ;¤ ­­ë¥ ¬ â¥à¨ « 
sub esi,eax
else
add esi,eax
pop eax
jmp .next_bl
end if
.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
add esi,2
sub ecx,2
sub esi,edi ;¢®ááâ ­®¢«¥­¨¥ esi (1)
sub esi,8 ;¢®ááâ ­®¢«¥­¨¥ esi (2)
call block_next
jmp .end_f
@@:
; ***  ­ «¨§ ¡«®ª  á ¤ ­­ë¬¨ ¯® 㬮«ç ­¨î (¡¥§ ¢ë¤¥«¥­¨ï ¯®¤¡«®ª®¢)
sub esi,6 ;¢®ááâ ­®¢«¥­¨¥ esi
call block_next
jmp .end_f
.next_bl:
; *** ­ áâனª¨ ¤«ï  ­ «¨§  ®áâ ¢è¨åáï ¯®¤¡«®ª®¢
mov dword[eax],esi ;㪠§ â¥«ì ­  ­ ç «® ¡«®ª 
mov ebx,dword[esi+2]
mov dword[eax+4],ebx ;à §¬¥à ¡«®ª 
inc dword[level_stack]
add eax,8
.end_f:
ret
endp
;¢å®¤ ¢ 1-© ¤®ç¥à­¨© ¡«®ª
;input:
; eax - 㪠§ â¥«ì ­  ¢à¥¬¥­­ë© á⥪ ä ©«  file_3ds
; esi - ­ ç «® த¨â¥«ì᪮£® ¡«®ª 
;output:
; ebx - destroy
; esi - ­ ç «® ¤ ­­ëå த¨â¥«ì᪮£® ¡«®ª 
align 4
block_children:
push ecx
;¯à®¢¥àª  ¯à ¢¨«ì­®á⨠ࠧ¬¥à®¢ ¤®ç¥à­¥£® ¡«®ª 
mov ebx,esi
add ebx,6 ;¯¥à¥å®¤ ­  ­ ç «® ¤®ç¥à­¥£® ¡«®ª 
add ebx,dword[ebx+2] ;¤®¡ ¢«ï¥¬ à §¬¥à ¤®ç¥à­¥£® ¡«®ª 
mov ecx,esi
add ecx,dword[esi+2] ;¤®¡ ¢«ï¥¬ à §¬¥à த¨â¥«ì᪮£® ¡«®ª 
cmp ebx,ecx ;ãç¨â뢠âì § £®«®¢ª¨ ­¥ ­ã¦­®, â. ª. áà ¢­¨¢ îâáï ⮫쪮 ¤ ­­ë¥ ¡«®ª®¢
jle @f
;¤¨ £­®áâ¨à®¢ «¨ ®è¨¡ªã ä ©« , ¤®ç¥à­¨© ¡«®ª ¢ë室¨â §  ¯à¥¤¥«ë த¨â¥«ì᪮£®
mov dword[level_stack],FILE_ERROR_CHUNK_SIZE
jmp .end_f
@@:
mov dword[eax],esi ;㪠§ â¥«ì ­  ­ ç «® ¡«®ª 
mov ebx,dword[esi+2]
mov dword[eax+4],ebx ;à §¬¥à ¡«®ª 
add esi,6 ;¯¥à¥å®¤¨¬ ª ¤ ­­ë¬ ¡«®ª 
inc dword[level_stack]
add eax,8
.end_f:
pop ecx
ret
;¯¥à¥å®¤ ª á«¥¤ã饬㠡«®ªã ⥪ã饣® ã஢­ï
;input:
; eax -  ¤à¥á áâàãªâãàë á ¯¥à¥¬¥­­ë¬¨
align 4
block_next:
push ebx
add esi,dword[esi+2] ;¯à®¯ã᪠¥¬ ¤ ­­ë¥ ¡«®ª 
;¯à®¢¥àª  à §¬¥à®¢ த¨â¥«ì᪮£® ¡«®ª , ¤«ï ¢®§¬®¦­®£® ¢ë室  ­  ¢¥àå­¨© ã஢¥­ì ¥á«¨ ª®­¥æ ¡«®ª 
@@:
mov ebx,dword[eax-8]
add ebx,dword[eax-4]
cmp esi,ebx
jl @f
dec dword[level_stack]
sub eax,8
cmp dword[level_stack],0
jg @b
@@:
pop ebx
ret
;äã­ªæ¨ï ¯®¨áª  áâàãªâãàë ®¯¨á뢠î饩 ¡«®ª
;input:
;esi - memory pointer
;output:
;dword[bl_found] - pointer to chunk struct (= 0 if not found)
align 4
bl_found dd 0
block_analiz:
pushad
mov dword[bl_found],0
mov ecx,type_bloks
@@:
mov bx,word[ecx]
cmp word[esi],bx
je .found
add ecx,sizeof.block_3ds
cmp ecx,type_bloks.end
jl @b
jmp .no_found
.found:
mov dword[bl_found],ecx
.no_found:
popad
ret
;input:
; esi - 㪠§ â¥«ì ­   ­ «¨§¨àã¥¬ë¥ ¤ ­­ë¥
; level - ã஢¥­ì ¢«®¦¥­­®á⨠㧫 
; size_bl - à §¬¥à ¡«®ª 
align 4
proc add_3ds_object, icon:dword,level:dword,size_bl:dword,info_bl:dword
pushad
mov bx,word[icon]
shl ebx,16
mov bx,word[level]
mov eax,esi
sub eax,dword[open_file_data]
mov dword[buffer],eax ;ᬥ饭¨¥ ¡«®ª 
mov ecx,dword[size_bl]
mov dword[buffer+4],ecx ;à §¬¥à ¡«®ª  (¨á¯®«ì§ã¥âáï ¢ ä㭪樨 buf_draw_hex_table ¤«ï à¨á®¢ ­¨ï «¨­¨¨)
mov ecx,dword[bl_found]
cmp ecx,0
je @f
;... §¤¥áì ­ã¦¥­ ¤à㣮©  «£®à¨â¬ § é¨âë ®â 㤠«¥­¨ï
mov cl,byte[ecx+4]
@@:
mov byte[buffer+list_offs_chunk_del],cl
mov ecx,[level]
mov byte[buffer+list_offs_chunk_lev],cl
mov ecx,dword[info_bl]
mov dword[buffer+list_offs_p_data],ecx
stdcall hex_in_str, buffer+list_offs_text,dword[esi+1],2
stdcall hex_in_str, buffer+list_offs_text+2,dword[esi],2 ;ª®¤ 3ds ¡«®ª 
cmp ecx,0
jne @f
mov byte[buffer+list_offs_text+4],0 ;0 - ᨬ¢®« ª®­æ  áâப¨
jmp .no_capt
@@:
mov byte[buffer+list_offs_text+4],' '
mov esi,ecx
mov edi,buffer+list_offs_text+5
mov ecx,size_one_list-(list_offs_text+5)
cld
rep movsb
mov byte[buffer+size_one_list-1],0 ;0 - ᨬ¢®« ª®­æ  áâப¨
.no_capt:
mov ecx,(sizeof.obj_3d)/4
xor eax,eax
mov edi,buffer
add edi,list_offs_obj3d
rep stosd
stdcall [tl_node_add], tree1, ebx, buffer
stdcall [tl_cur_next], tree1
popad
ret
endp
;input:
; eax - value
; buf - string buffer
; len - buffer len
;output:
align 4
proc convert_int_to_str, buf:dword, len:dword
pushad
mov edi,[buf]
mov esi,[len]
add esi,edi
dec esi
call .str
popad
ret
endp
align 4
.str:
mov ecx,0x0a
cmp eax,ecx
jb @f
xor edx,edx
div ecx
push edx
call .str
pop eax
@@:
cmp edi,esi
jge @f
or al,0x30
stosb
mov byte[edi],0
@@:
ret
;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
align 4
OpenDialog_data:
.type dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
.procinfo dd procinfo ;+4
.com_area_name dd communication_area_name ;+8
.com_area dd 0 ;+12
.opendir_path dd plugin_path ;+16
.dir_default_path dd default_dir ;+20
.start_path dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
.draw_window dd draw_window ;+28
.status dd 0 ;+32
.openfile_path dd openfile_path ;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
.filename_area dd filename_area ;+40
.filter_area dd Filter
.x:
.x_size dw 420 ;+48 ; Window X size
.x_start dw 10 ;+50 ; Window X position
.y:
.y_size dw 320 ;+52 ; Window y size
.y_start dw 10 ;+54 ; Window Y position
default_dir db '/rd/1',0
communication_area_name:
db 'FFFFFFFF_open_dialog',0
open_dialog_name:
db 'opendial',0
communication_area_default_path:
db '/rd/1/File managers/',0
Filter:
dd Filter.end - Filter.1
.1:
db '3DS',0
db 'TXT',0
.end:
db 0
align 4
system_dir_0 db '/sys/lib/'
lib_name_0 db 'proc_lib.obj',0
system_dir_1 db '/sys/lib/'
lib_name_1 db 'libimg.obj',0
system_dir_2 db '/sys/lib/'
lib_name_2 db 'box_lib.obj',0
system_dir_3 db '/sys/lib/'
lib_name_3 db 'buf2d.obj',0
system_dir_4 db '/sys/lib/'
lib_name_4 db 'kmenu.obj',0
system_dir_5 db '/kolibrios/lib/'
lib_name_5 db 'tinygl.obj',0
system_dir_6 db '/sys/lib/'
lib_name_6 db 'libini.obj',0
if lang eq ru
head_f_i:
head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
err_msg_found_lib_0 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,0
err_msg_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
err_msg_found_lib_1 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,0
err_msg_import_1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0
err_msg_found_lib_2 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'box_lib.obj',39,0
err_msg_import_2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'box_lib',39,0
err_msg_found_lib_3 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'buf2d.obj',39,0
err_msg_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,0
err_msg_found_lib_4 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'kmenu.obj',39,0
err_msg_import_4 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'kmenu',39,0
err_msg_found_lib_5 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'tinygl.obj',39,0
err_msg_import_5 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'tinygl',39,0
err_msg_found_lib_6 db '<27>¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libini.obj',39,0
err_msg_import_6 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libini',39,0
else
head_f_i:
head_f_l db 'System error',0
err_msg_found_lib_0 db 'Sorry I cannot found library ',39,'proc_lib.obj',39,0
err_msg_import_0 db 'Error on load import library ',39,'proc_lib.obj',39,0
err_msg_found_lib_1 db 'Sorry I cannot found library ',39,'libimg.obj',39,0
err_msg_import_1 db 'Error on load import library ',39,'libimg.obj',39,0
err_msg_found_lib_2 db 'Sorry I cannot found library ',39,'box_lib.obj',39,0
err_msg_import_2 db 'Error on load import library ',39,'box_lib.obj',39,0
err_msg_found_lib_3 db 'Sorry I cannot found library ',39,'buf2d.obj',39,0
err_msg_import_3 db 'Error on load import library ',39,'buf2d.obj',39,0
err_msg_found_lib_4 db 'Sorry I cannot found library ',39,'kmenu.obj',39,0
err_msg_import_4 db 'Error on load import library ',39,'kmenu.obj',39,0
err_msg_found_lib_5 db 'Sorry I cannot found library ',39,'tinygl.obj',39,0
err_msg_import_5 db 'Error on load import library ',39,'tinygl',39,0
err_msg_found_lib_6 db 'Sorry I cannot found library ',39,'libini.obj',39,0
err_msg_import_6 db 'Error on load import library ',39,'libini',39,0
end if
align 4
l_libs_start:
lib_0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
err_msg_found_lib_0, head_f_l, proclib_import,err_msg_import_0,head_f_i
lib_1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
err_msg_found_lib_1, head_f_l, import_libimg, err_msg_import_1,head_f_i
lib_2 l_libs lib_name_2, sys_path, file_name, system_dir_2,\
err_msg_found_lib_2, head_f_l, import_box_lib,err_msg_import_2,head_f_i
lib_3 l_libs lib_name_3, sys_path, file_name, system_dir_3,\
err_msg_found_lib_3, head_f_l, import_buf2d, err_msg_import_3,head_f_i
lib_4 l_libs lib_name_4, sys_path, file_name, system_dir_4,\
err_msg_found_lib_4, head_f_l, import_libkmenu,err_msg_import_4,head_f_i
lib_5 l_libs lib_name_5, sys_path, file_name, system_dir_5,\
err_msg_found_lib_5, head_f_l, import_lib_tinygl,err_msg_import_5,head_f_i
lib_6 l_libs lib_name_6, sys_path, file_name, system_dir_6,\
err_msg_found_lib_6, head_f_l, import_libini, err_msg_import_6,head_f_i
l_libs_end:
align 4
import_libimg:
dd alib_init1
img_is_img dd aimg_is_img
img_info dd aimg_info
img_from_file dd aimg_from_file
img_to_file dd aimg_to_file
img_from_rgb dd aimg_from_rgb
img_to_rgb dd aimg_to_rgb
img_to_rgb2 dd aimg_to_rgb2
img_decode dd aimg_decode
img_encode dd aimg_encode
img_create dd aimg_create
img_destroy dd aimg_destroy
img_destroy_layer dd aimg_destroy_layer
img_count dd aimg_count
img_lock_bits dd aimg_lock_bits
img_unlock_bits dd aimg_unlock_bits
img_flip dd aimg_flip
img_flip_layer dd aimg_flip_layer
img_rotate dd aimg_rotate
img_rotate_layer dd aimg_rotate_layer
img_draw dd aimg_draw
dd 0,0
alib_init1 db 'lib_init',0
aimg_is_img db 'img_is_img',0 ;®¯à¥¤¥«ï¥â ¯® ¤ ­­ë¬, ¬®¦¥â «¨ ¡¨¡«¨®â¥ª  ᤥ« âì ¨§ ­¨å ¨§®¡à ¦¥­¨¥
aimg_info db 'img_info',0
aimg_from_file db 'img_from_file',0
aimg_to_file db 'img_to_file',0
aimg_from_rgb db 'img_from_rgb',0
aimg_to_rgb db 'img_to_rgb',0 ;¯à¥®¡à §®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¢ ¤ ­­ë¥ RGB
aimg_to_rgb2 db 'img_to_rgb2',0
aimg_decode db 'img_decode',0 ; ¢â®¬ â¨ç¥áª¨ ®¯à¥¤¥«ï¥â ä®à¬ â £à ä¨ç¥áª¨å ¤ ­­ëå
aimg_encode db 'img_encode',0
aimg_create db 'img_create',0
aimg_destroy db 'img_destroy',0
aimg_destroy_layer db 'img_destroy_layer',0
aimg_count db 'img_count',0
aimg_lock_bits db 'img_lock_bits',0
aimg_unlock_bits db 'img_unlock_bits',0
aimg_flip db 'img_flip',0
aimg_flip_layer db 'img_flip_layer',0
aimg_rotate db 'img_rotate',0
aimg_rotate_layer db 'img_rotate_layer',0
aimg_draw db 'img_draw',0
align 4
proclib_import: ;®¯¨á ­¨¥ íªá¯®àâ¨à㥬ëå ä㭪権
OpenDialog_Init dd aOpenDialog_Init
OpenDialog_Start dd aOpenDialog_Start
dd 0,0
aOpenDialog_Init db 'OpenDialog_init',0
aOpenDialog_Start db 'OpenDialog_start',0
align 4
import_buf2d:
dd sz_init0
buf2d_create dd sz_buf2d_create
buf2d_create_f_img dd sz_buf2d_create_f_img
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
buf2d_circle dd sz_buf2d_circle
buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
buf2d_bit_blt dd sz_buf2d_bit_blt
buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
buf2d_draw_text dd sz_buf2d_draw_text
buf2d_crop_color dd sz_buf2d_crop_color
buf2d_offset_h dd sz_buf2d_offset_h
buf2d_set_pixel dd sz_buf2d_set_pixel
dd 0,0
sz_init0 db 'lib_init',0
sz_buf2d_create db 'buf2d_create',0
sz_buf2d_create_f_img db 'buf2d_create_f_img',0
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
sz_buf2d_circle db 'buf2d_circle',0
sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
sz_buf2d_bit_blt db 'buf2d_bit_blt',0
sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
sz_buf2d_draw_text db 'buf2d_draw_text',0
sz_buf2d_crop_color db 'buf2d_crop_color',0
sz_buf2d_offset_h db 'buf2d_offset_h',0
sz_buf2d_set_pixel db 'buf2d_set_pixel',0
align 4
import_box_lib:
dd sz_init1
edit_box_draw dd sz_edit_box_draw
edit_box_key dd sz_edit_box_key
edit_box_mouse dd sz_edit_box_mouse
edit_box_set_text dd sz_edit_box_set_text
scrollbar_ver_draw dd sz_scrollbar_ver_draw
scrollbar_hor_draw dd sz_scrollbar_hor_draw
tl_data_init dd sz_tl_data_init
tl_data_clear dd sz_tl_data_clear
tl_info_clear dd sz_tl_info_clear
tl_key dd sz_tl_key
tl_mouse dd sz_tl_mouse
tl_draw dd sz_tl_draw
tl_info_undo dd sz_tl_info_undo
tl_info_redo dd sz_tl_info_redo
tl_node_add dd sz_tl_node_add
tl_node_set_data dd sz_tl_node_set_data
tl_node_get_data dd sz_tl_node_get_data
tl_node_delete dd sz_tl_node_delete
tl_node_move_up dd sz_tl_node_move_up
tl_node_move_down dd sz_tl_node_move_down
tl_cur_beg dd sz_tl_cur_beg
tl_cur_next dd sz_tl_cur_next
tl_cur_perv dd sz_tl_cur_perv
tl_node_close_open dd sz_tl_node_close_open
tl_node_lev_inc dd sz_tl_node_lev_inc
tl_node_lev_dec dd sz_tl_node_lev_dec
tl_node_poi_get_info dd sz_tl_node_poi_get_info
tl_node_poi_get_next_info dd sz_tl_node_poi_get_next_info
tl_node_poi_get_data dd sz_tl_node_poi_get_data
dd 0,0
sz_init1 db 'lib_init',0
sz_edit_box_draw db 'edit_box',0
sz_edit_box_key db 'edit_box_key',0
sz_edit_box_mouse db 'edit_box_mouse',0
sz_edit_box_set_text db 'edit_box_set_text',0
sz_scrollbar_ver_draw db 'scrollbar_v_draw',0
sz_scrollbar_hor_draw db 'scrollbar_h_draw',0
sz_tl_data_init db 'tl_data_init',0
sz_tl_data_clear db 'tl_data_clear',0
sz_tl_info_clear db 'tl_info_clear',0
sz_tl_key db 'tl_key',0
sz_tl_mouse db 'tl_mouse',0
sz_tl_draw db 'tl_draw',0
sz_tl_info_undo db 'tl_info_undo',0
sz_tl_info_redo db 'tl_info_redo',0
sz_tl_node_add db 'tl_node_add',0
sz_tl_node_set_data db 'tl_node_set_data',0
sz_tl_node_get_data db 'tl_node_get_data',0
sz_tl_node_delete db 'tl_node_delete',0
sz_tl_node_move_up db 'tl_node_move_up',0
sz_tl_node_move_down db 'tl_node_move_down',0
sz_tl_cur_beg db 'tl_cur_beg',0
sz_tl_cur_next db 'tl_cur_next',0
sz_tl_cur_perv db 'tl_cur_perv',0
sz_tl_node_close_open db 'tl_node_close_open',0
sz_tl_node_lev_inc db 'tl_node_lev_inc',0
sz_tl_node_lev_dec db 'tl_node_lev_dec',0
sz_tl_node_poi_get_info db 'tl_node_poi_get_info',0
sz_tl_node_poi_get_next_info db 'tl_node_poi_get_next_info',0
sz_tl_node_poi_get_data db 'tl_node_poi_get_data',0
align 4
import_libkmenu:
kmenu_init dd akmenu_init
kmainmenu_draw dd akmainmenu_draw
kmainmenu_dispatch_cursorevent dd akmainmenu_dispatch_cursorevent
ksubmenu_new dd aksubmenu_new
ksubmenu_delete dd aksubmenu_delete
ksubmenu_draw dd aksubmenu_draw
ksubmenu_add dd aksubmenu_add
kmenuitem_new dd akmenuitem_new
kmenuitem_delete dd akmenuitem_delete
kmenuitem_draw dd akmenuitem_draw
dd 0,0
akmenu_init db 'kmenu_init',0
akmainmenu_draw db 'kmainmenu_draw',0
akmainmenu_dispatch_cursorevent db 'kmainmenu_dispatch_cursorevent',0
aksubmenu_new db 'ksubmenu_new',0
aksubmenu_delete db 'ksubmenu_delete',0
aksubmenu_draw db 'ksubmenu_draw',0
aksubmenu_add db 'ksubmenu_add',0
akmenuitem_new db 'kmenuitem_new',0
akmenuitem_delete db 'kmenuitem_delete',0
akmenuitem_draw db 'kmenuitem_draw',0
align 4
import_lib_tinygl:
macro E_LIB n
{
n dd sz_#n
}
include '../../develop/libraries/TinyGL/asm_fork/export.inc'
dd 0,0
macro E_LIB n
{
sz_#n db `n,0
}
include '../../develop/libraries/TinyGL/asm_fork/export.inc'
align 4
import_libini:
dd alib_init0
ini_get_str dd aini_get_str
ini_get_int dd aini_get_int
ini_get_color dd aini_get_color
dd 0,0
alib_init0 db 'lib_init',0
aini_get_str db 'ini_get_str',0
aini_get_int db 'ini_get_int',0
aini_get_color db 'ini_get_color',0
align 4
mouse_dd dd 0
last_time dd 0
angle_dxm dd 1.9111 ;~ 3d_wnd_w/180 - ¯à¨¡ ¢«¥­¨¥ 㣫®¢ ¯®¢®à®â  áæ¥­ë ¯à¨ ¢à é¥­¨¨ ¬ë襩
angle_dym dd 1.7333 ;~ 3d_wnd_h/180
ratio dd 1.1025 ;~ 3d_wnd_w/3d_wnd_h
align 4
buf_ogl:
dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
dw 3d_wnd_l,3d_wnd_t ;+4 left,top
dd 3d_wnd_w,3d_wnd_h ;+8 w,h
.color: dd 0xffffd0
dd 24 ;+16 color,bit in pixel
align 4
buf_1:
dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
dw 0,0 ;+4 left,top
dd 128,144 ;+8 w,h
dd 0,24 ;+16 color,bit in pixel
align 4
el_focus dd tree1
tree1 tree_list size_one_list,300+2, tl_key_no_edit+tl_draw_par_line,\
16,16, 0xffffff,0xb0d0ff,0x400040, 5,47,195-16,250, 16,list_offs_text,0, el_focus,\
w_scr_t1,0
align 4
w_scr_t1 scrollbar 16,0, 3,0, 15, 100, 0,0, 0,0,0, 1
align 4
ctx1 db 28 dup (0) ;TinyGLContext or KOSGLContext
;sizeof.TinyGLContext = 28
qObj dd 0
light_position dd 0.0, 0.0, -2.0, 1.0 ; <20> á¯®«®¦¥­¨¥ ¨áâ®ç­¨ª  [0][1][2]
;[3] = (0.0 - ¡¥áª®­¥ç­® 㤠«¥­­ë© ¨áâ®ç­¨ª, 1.0 - ¨áâ®ç­¨ª á¢¥â  ­  ®¯à¥¤¥«¥­­®¬ à ááâ®ï­¨¨)
light_dir dd 0.0,0.0,0.0 ;­ ¯à ¢«¥­¨¥ « ¬¯ë
mat_specular dd 0.3, 0.3, 0.3, 1.0 ; –¢¥â ¡«¨ª 
mat_shininess dd 3.0 ; <20> §¬¥à ¡«¨ª  (®¡à â­ ï ¯à®¯®àæ¨ï)
white_light dd 0.8, 0.8, 0.8, 1.0 ; –¢¥â ¨ ¨­â¥­á¨¢­®áâì ®á¢¥é¥­¨ï, £¥­¥à¨à㥬®£® ¨áâ®ç­¨ª®¬
lmodel_ambient dd 0.3, 0.3, 0.3, 1.0 ; <20> à ¬¥âàë ä®­®¢®£® ®á¢¥é¥­¨ï
if lang eq ru
capt db 'info 3ds [user] ¢¥àá¨ï 18.02.16',0 ;¯®¤¯¨áì ®ª­ 
else
capt db 'info 3ds [user] version 18.02.16',0 ;window caption
end if
align 16
i_end:
procinfo process_information
run_file_70 FileInfoBlock
sc system_colors
angle_x rd 1 ;ã£«ë ¯®¢®à®â  á業ë
angle_y rd 1
angle_z rd 1
color_ox rd 1
color_oy rd 1
color_oz rd 1
color_bk rd 3
color_vert rd 1
color_face rd 1
color_select rd 1
rb 2048
align 16
thread_coords:
rb 2048
stacktop:
sys_path rb 2048
file_name rb 4096
plugin_path rb 4096
openfile_path rb 4096
filename_area rb 256
mem: