27,10 → 27,12 |
FileName dd ? |
ends |
|
run_file_70 FileInfoBlock |
align 4 |
fl255 dd 255.0 |
image_data dd 0 ;㪠§ â¥«ì ¢à¥¬¥ãî ¯ ¬ïâì, 㦥 ¤«ï ¯à¥®¡à §®¢ ¨ï ¨§®¡à ¦¥¨ï |
open_file_lif dd 0 ;㪠§ â¥«ì ¯ ¬ïâì ¤«ï ®âªàëâ¨ï ä ©«®¢ 3ds |
open_file_data dd 0 ;㪠§ â¥«ì ¯ ¬ïâì ¤«ï ®âªàëâ¨ï ä ©«®¢ 3ds |
open_file_size dd 0 ;à §¬¥à ®âªàë⮣® ä ©« |
open_b rb 560 |
|
; |
main_wnd_height equ 460 ;¢ëá®â £« ¢®£® ®ª ¯à®£à ¬¬ë |
126,7 → 128,7 |
add ebp,ll_struc_size |
cmp ebp,l_libs_end |
jl .test_lib_open |
mcall 48,3,sc,sizeof.system_colors |
mcall 48,3,sc,sizeof.sys_colors_new |
mcall 40,0x27 |
stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª ¤¨ «®£ |
|
141,12 → 143,16 |
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_Light, 7 |
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 |
stdcall [kmenuitem_new], KMENUITEM_NORMAL, sz_main_menu_Veiw_Reset, 9 |
stdcall [ksubmenu_add], [main_menu_view], eax |
|
mov dword[w_scr_t1.type],1 |
stdcall dword[tl_data_init], tree1 |
171,16 → 177,69 |
|
load_image_file fn_toolbar, image_data_toolbar,IMAGE_TOOLBAR_SIZE |
|
stdcall mem.Alloc,MAX_FILE_SIZE |
mov dword[open_file_lif],eax |
;à ¡®â á ä ©«®¬ áâ஥ª |
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 |
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 26,9 |
mov [last_time],eax |
|
stdcall [kosglMakeCurrent], 5,23,320,240,ctx1 |
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], 0.0,0.0,0.0,0.0 |
stdcall [glClearColor], [color_bk+8],[color_bk+4],[color_bk],0.0 |
stdcall [glShadeModel], GL_SMOOTH |
stdcall [gluNewQuadric] |
mov [qObj],eax |
240,7 → 299,7 |
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_lif] ;¯®«ãç ¥¬ § 票¥ ᤢ¨£ ¢ ¯ ¬ï⨠|
add eax,dword[open_file_data] ;¯®«ãç ¥¬ § 票¥ ᤢ¨£ ¢ ¯ ¬ï⨠|
cmp dword[offs_last_timer],eax |
je @f |
;¥á«¨ ¢ë¤¥«¥ë© ¡«®ª ¤ ëå ¥ ᮢ¯ ¤ ¥â á ¯®á«¥¤¨¬ § ¯®¬¥ë¬ |
257,12 → 316,6 |
stdcall [buf2d_draw], buf_0 ;®¡®¢«ï¥¬ ¡ãä¥à íªà ¥ |
@@: |
popad |
|
;¯à®á¬®âà ®ª á ª®®à¤¨ â ¬¨ â®ç¥ª |
;cmp byte[prop_wnd_run],0 |
;je @f |
; call prop_timer_funct |
;@@: |
jmp still |
|
align 4 |
283,7 → 336,7 |
coord_y dd 55 ;ª®®à¤¨ â y ¤«ï ç « ¢ë¢®¤ â ¡«¨æë |
endl |
mov esi,dword[offs] |
mov edi,dword[open_file_lif] |
mov edi,dword[open_file_data] |
add edi,dword[file_3ds.size] ;edi - 㪠§ â¥«ì ª®¥æ ä ©« ¢ ¯ ¬ï⨠|
mov dword[txt_3ds_offs.dig],0 |
cld |
461,7 → 514,7 |
stdcall [buf2d_delete],buf_0 |
stdcall [buf2d_delete],buf_1 ;㤠«ï¥¬ ¡ãä¥à |
stdcall mem.Free,[image_data_toolbar] |
stdcall mem.Free,[open_file_lif] |
stdcall mem.Free,[open_file_data] |
stdcall [gluDeleteQuadric], [qObj] |
mcall -1 |
|
485,14 → 538,27 |
je .end_open_file |
;ª®¤ ¯à¨ 㤠箬 ®âªàë⨨ ¤¨ «®£ |
|
mov [run_file_70.Function], 5 |
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 70,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], 0 |
mov [run_file_70.Position], 0 |
mov [run_file_70.Flags], 0 |
mov dword[run_file_70.Count], MAX_FILE_SIZE |
m2m [run_file_70.Buffer], dword[open_file_lif] |
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 70,run_file_70 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥¨ï |
mcall 70,run_file_70 ;§ £à㦠¥¬ ä ©« 3ds |
cmp ebx,0xffffffff |
je .end_open_file |
|
517,7 → 583,7 |
init_tree: |
stdcall [tl_info_clear], tree1 ;®ç¨á⪠ᯨ᪠®¡ê¥ªâ®¢ |
|
mov esi,dword[open_file_lif] |
mov esi,dword[open_file_data] |
cmp word[esi],CHUNK_MAIN |
je @f |
call buf_draw_beg |
524,12 → 590,6 |
stdcall [buf2d_draw_text], buf_0, buf_1,txt_no_3ds,5,25,0xff0000 ;à¨á㥬 áâபã á ⥪á⮬ |
jmp .end_open |
@@: |
cmp dword[esi+2],MAX_FILE_SIZE |
jle @f |
call buf_draw_beg |
stdcall [buf2d_draw_text], buf_0, buf_1,txt_3ds_big_file,5,25,0xff0000 ;à¨á㥬 áâபã á ⥪á⮬ |
jmp .end_open |
@@: |
;--- ®¡à ¡®âª ®âªàë⮣® *.3ds ä ©« |
mov eax,file_3ds |
mov dword[level_stack],0 ;®¡ã«ï¥¬ ã஢¥ì á⥪ |
771,7 → 831,7 |
mov bx,word[level] |
|
mov eax,esi |
sub eax,dword[open_file_lif] |
sub eax,dword[open_file_data] |
mov dword[buffer],eax ;ᬥ饨¥ ¡«®ª |
mov ecx,dword[size_bl] |
mov dword[buffer+4],ecx ;à §¬¥à ¡«®ª (¨á¯®«ì§ã¥âáï ¢ äãªæ¨¨ buf_draw_hex_table ¤«ï à¨á®¢ ¨ï «¨¨¨) |
841,14 → 901,17 |
ret |
endp |
|
end if |
|
;input: |
; eax - value |
; edi - string buffer |
; buf - string buffer |
; len - buffer len |
;output: |
align 4 |
proc convert_int_to_str, len:dword |
proc convert_int_to_str, buf:dword, len:dword |
pushad |
mov edi,[buf] |
mov esi,[len] |
add esi,edi |
dec esi |
876,8 → 939,6 |
@@: |
ret |
|
end if |
|
align 4 |
proc hex_in_str, buf:dword,val:dword,zif:dword |
pushad |
917,7 → 978,7 |
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 ebx, dword[open_file_data] |
mov [run_file_70.Buffer], ebx |
mov ebx,dword[ebx+2] |
mov dword[run_file_70.Count], ebx ;à §¬¥à ä ©« |
958,7 → 1019,7 |
mov ecx,[open_file_size] |
mov ebx,dword[eax] ;¯®«ãç ¥¬ § 票¥ ᤢ¨£ ¢ë¡à ®£® ¡«®ª ®â®á¨â¥«ì® ç « ä ©« |
sub ecx,ebx ;ecx - à §¬¥à ¨¦¥© ᤢ¨£ ¥¬®© ç áâ¨ ä ©« |
add ebx,dword[open_file_lif] ;¯®«ãç ¥¬ § 票¥ ᤢ¨£ ¢ ¯ ¬ï⨠|
add ebx,dword[open_file_data] ;¯®«ãç ¥¬ § 票¥ ᤢ¨£ ¢ ¯ ¬ï⨠|
mov edi,ebx |
mov esi,ebx |
add esi,edx |
978,7 → 1039,7 |
jge .cycle_2 |
mov bl,byte[eax+list_offs_chunk_lev] |
mov ecx,[eax] |
add ecx,[open_file_lif] |
add ecx,[open_file_data] |
sub dword[ecx+2],edx |
cmp bl,0 ;¥á«¨ á ¬ë© ¢¥à娩 㧥«, â® bl=0 |
jne .cycle_2 |
1119,6 → 1180,8 |
lib_name_4 db 'kmenu.obj',0 |
system_dir_5 db '/sys/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: |
1135,6 → 1198,8 |
err_msg_import_4 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'kmenu',39,0 |
err_msg_found_lib_5 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',39,'tinygl.obj',39,0 |
err_msg_import_5 db '訡ª ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'tinygl',39,0 |
err_msg_found_lib_6 db '¥ ©¤¥ ¡¨¡«¨®â¥ª ',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 |
1150,6 → 1215,8 |
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 |
1166,6 → 1233,8 |
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, library_path, 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, library_path, 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 |
1387,6 → 1456,18 |
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 0x0 |
last_time dd 0 |
|
1420,10 → 1501,6 |
;sizeof.TinyGLContext = 28 |
|
qObj dd 0 |
angle_x dd 0.0 |
angle_y dd 0.0 |
angle_z dd 0.0 |
delt_size dd 3.0 |
|
light_position dd 0.0, 0.0, -2.0, 1.0 ; ᯮ«®¦¥¨¥ ¨áâ®ç¨ª [0][1][2] |
;[3] = (0.0 - ¡¥áª®¥ç® 㤠«¥ë© ¨áâ®ç¨ª, 1.0 - ¨áâ®ç¨ª ᢥ⠮¯à¥¤¥«¥®¬ à ááâ®ï¨¨) |
1434,10 → 1511,27 |
white_light dd 0.8, 0.8, 0.8, 1.0 ; ¢¥â ¨ ¨â¥á¨¢®áâì ®á¢¥é¥¨ï, £¥¥à¨à㥬®£® ¨áâ®ç¨ª®¬ |
lmodel_ambient dd 0.3, 0.3, 0.3, 1.0 ; à ¬¥âàë ä®®¢®£® ®á¢¥é¥¨ï |
|
if lang eq ru |
capt db 'info 3ds ¢¥àá¨ï 29.11.15',0 ;¯®¤¯¨áì ®ª |
else |
capt db 'info 3ds version 29.11.15',0 ;window caption |
end if |
|
align 16 |
i_end: |
procinfo process_information |
run_file_70 FileInfoBlock |
sc system_colors |
rb sizeof.sys_colors_new-sizeof.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 |
rb 2048 |
align 16 |
thread_coords: |