1) fixed a bug with the definition of block size
2) some improvements

git-svn-id: svn://kolibrios.org@2052 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
IgorA 2011-08-17 19:32:25 +00:00
parent 6a725a3db0
commit 4c3f814d33
4 changed files with 63 additions and 33 deletions

View File

@ -1,7 +1,7 @@
if not exist bin mkdir bin
@erase lang.inc
@echo lang fix en >lang.inc
if not exist bin\objects.png @copy objects.png bin\objects.png
@copy objects.png bin\objects.png
if not exist bin\tl_sys_16.png @copy tl_sys_16.png bin\tl_sys_16.png
if not exist bin\toolbar.png @copy toolbar.png bin\toolbar.png
if not exist bin\font8x9.bmp @copy ..\..\fs\kfar\trunk\font8x9.bmp bin\font8x9.bmp

View File

@ -1,7 +1,7 @@
if not exist bin mkdir bin
@erase lang.inc
@echo lang fix ru >lang.inc
if not exist bin\objects.png @copy objects.png bin\objects.png
@copy objects.png bin\objects.png
if not exist bin\tl_sys_16.png @copy tl_sys_16.png bin\tl_sys_16.png
if not exist bin\toolbar.png @copy toolbar.png bin\toolbar.png
if not exist bin\font8x9.bmp @copy ..\..\fs\kfar\trunk\font8x9.bmp bin\font8x9.bmp

View File

@ -20,7 +20,7 @@ include 'lang.inc'
debug equ 0
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
capt db 'info 3ds 17.08.11',0 ;¯®¤¯¨áì ®ª­ 
capt db 'info 3ds 18.08.11',0 ;¯®¤¯¨áì ®ª­ 
struct FileInfoBlock
Function dd ?
@ -45,7 +45,7 @@ image_data_toolbar dd 0
TREE_ICON_SYS16_BMP_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*11+54 ;à §¬¥à bmp ä ©«  á á¨á⥬­ë¬¨ ¨ª®­ª ¬¨
icon_tl_sys dd 0 ;㪠§ â¥¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï á¨á⥬­ëå ¨ª®­®ª
icon_toolbar dd 0 ;㪠§ â¥¥«ì ­  ¯ ¬ïâì ¤«ï åà ­¥­¨ï ¨ª®­®ª ®¡ê¥ªâ®¢
TOOLBAR_ICON_BMP_SIZE equ 256*5 ;à §¬¥à bmp ä ©«  á ¨ª®­ª ¬¨ ®¡ê¥ªâ®¢
TOOLBAR_ICON_BMP_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*6+54 ;à §¬¥à bmp ä ©«  á ¨ª®­ª ¬¨ ®¡ê¥ªâ®¢
;
IMAGE_FILE1_SIZE equ 128*144*3 ;à §¬¥à ä ©«  á ¨§®¡à ¦¥­¨¥¬ 640 x 480
@ -101,7 +101,6 @@ macro block_3ds id,icon,par
CHUNK_MAIN equ 0x4D4D ; [-] á業 
CHUNK_color_1 equ 0x0011 ; [+] 梥â rgb (byte format)
CHUNK_ambient_color equ 0x2100 ; [-] ambient color
CHUNK_VERSIONF equ 0x0002 ; [+] ¨­ä®à¬ æ¨ï ® ¢¥àᨨ ä ©« 
CHUNK_OBJMESH equ 0x3D3D ; [-] ¢áïç¥áª¨¥ ®¡ê¥ªâë
CHUNK_OBJBLOCK equ 0x4000 ; [+] ®¡ê¥ªâ
CHUNK_TRIMESH equ 0x4100 ; [-] trimesh-®¡ê¥ªâ
@ -134,15 +133,21 @@ MAX_FILE_SIZE equ 150*0x400 ;
level_stack dd 0
offs_last_timer dd 0 ;¯®á«¥¤­¨© ᤢ¨£ ¯®ª § ­ë© ¢ ä㭪樨 â ©¬¥à 
ID_ICON_CHUNK_MAIN equ 0
ID_ICON_CHUNK_NOT_FOUND equ 1
ID_ICON_DATA equ 2
ID_ICON_CHUNK_MAIN equ 0 ;¨ª®­ª  £« ¢­®£® ¡«®ª 
ID_ICON_CHUNK_NOT_FOUND equ 1 ;¨ª®­ª  ­¥ ¨§¢¥áâ­®£® ¡«®ª 
ID_ICON_DATA equ 2 ;¨ª®­ª  ¤«ï ¤ ­­ëå ¡«®ª , ­¥ ®¯à¥¤¥«¥­­®© áâàãªâãàë
FILE_ERROR_CHUNK_SIZE equ -3 ;®è¨¡ª  ¢ à §¬¥à¥ ¡«®ª 
align 4
type_bloks:
block_3ds 0x0002,5,1 ;¨­ä®à¬ æ¨ï ® ¢¥àᨨ ä ©« 
block_3ds 0x3d3e,5,1 ;mesh version
block_3ds 0xA010,4,0 ;material ambient color
block_3ds 0xA020,4,0 ;material diffuse color
block_3ds 0xA030,4,0 ;material specular color
block_3ds CHUNK_color_1, 4,1 ; [+] 梥â rgb (byte format)
block_3ds CHUNK_ambient_color,3,0 ; [-] ambient color
block_3ds CHUNK_VERSIONF, 3,1 ; [+] ˆ­ä®à¬ æ¨ï ® ¢¥àᨨ ä ©« 
block_3ds CHUNK_OBJMESH, 3,0 ; [-] ¢áïç¥áª¨¥ ®¡ê¥ªâë
block_3ds CHUNK_OBJBLOCK, 3,1 ; [+] ®¡ê¥ªâ
block_3ds CHUNK_TRIMESH, 3,0 ; [-] trimesh-®¡ê¥ªâ
@ -181,6 +186,7 @@ if lang eq ru
txt_open_3ds db 'Žâªàëâ ä ©«:',0
txt_no_3ds db 'Žâªàëâë© ä ©« ­¥ ¢ ä®à¬ â¥ *.3ds',0
txt_3ds_big_file db '<27> §¬¥à ä ©«  ¡®«ìè¥ MAX_FILE_SIZE',0
txt_3ds_err_sizes db '‚®§¬®¦­® ä ©« ¯®¢à¥¦¤¥­',0
txt_3ds_offs:
db '‘¬¥é¥­¨¥: '
.dig: rb 8
@ -189,6 +195,7 @@ else
txt_open_3ds db 'Open file:',0
txt_no_3ds db 'Žâªàëâë© ä ©« ­¥ ¢ ä®à¬ â¥ *.3ds',0
txt_3ds_big_file db '<27> §¬¥à ä ©«  ¡®«ìè¥ MAX_FILE_SIZE',0
txt_3ds_err_sizes db '‚®§¬®¦­® ä ©« ¯®¢à¥¦¤¥­',0
txt_3ds_offs:
db 'Offset: '
.dig: rb 8
@ -311,6 +318,10 @@ buf_draw_beg:
stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
stdcall [buf2d_draw_text], buf_0, buf_1,txt_open_3ds,5,5,0xff
stdcall [buf2d_draw_text], buf_0, buf_1,openfile_path,5,15,0xff
cmp dword[level_stack],FILE_ERROR_CHUNK_SIZE ;¢®§¬®¦­  ®è¨¡ª  ä ©« 
jne @f
stdcall [buf2d_draw_text], buf_0, buf_1,txt_3ds_err_sizes,5,25,0xff0000
@@:
ret
align 4
@ -321,7 +332,6 @@ proc buf_draw_hex_table, offs:dword, size_line:dword
endl
mov esi,dword[offs]
mov edi,dword[open_file_lif]
add edi,6
add edi,dword[file_3ds+4] ;edi - 㪠§ â¥«ì ­  ª®­¥æ ä ©«  ¢ ¯ ¬ïâ¨
mov dword[txt_3ds_offs.dig],0
cld
@ -375,7 +385,7 @@ draw_window:
pushad
mcall 12,1
xor eax,eax
mov ebx,(20 shl 16)+510
mov ebx,(20 shl 16)+560
mov ecx,(20 shl 16)+315
mov edx,[sc.work]
or edx,(3 shl 24)+0x10000000+0x20000000
@ -394,10 +404,10 @@ pushad
mov edx,4
int 0x40
mov ebx,(55 shl 16)+20
mov ecx,(5 shl 16)+20
mov edx,5
int 0x40
;mov ebx,(55 shl 16)+20
;mov ecx,(5 shl 16)+20
;mov edx,5
;int 0x40
mov eax,7
@ -410,9 +420,9 @@ pushad
mov edx,(32 shl 16)+7 ;open
int 0x40
add ebx,IMAGE_TOOLBAR_ICON_SIZE
mov edx,(57 shl 16)+7 ;open
int 0x40
;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
@ -518,13 +528,17 @@ but_open_file:
stdcall add_3ds_object, ID_ICON_CHUNK_MAIN,0,dword[esi+2]
call block_children ;¢å®¤ ¢ ¤®ç¥à­¨© ¡«®ª
mov edi,dword[file_3ds.offs]
add edi,dword[file_3ds.size]
.cycle_main:
cmp dword[level_stack],0
je .end_cycle
jle .end_cycle
cmp esi,edi ;¥á«¨ ª®­¥æ ä ©« 
jge .end_cycle
call block_analiz
mov edx,dword[esi+2] ;à §¬¥à ¡«®ª  ¡¥§ § £®«®¢ª 
add edx,6 ;à §¬¥à ¡«®ª  ¢¬¥áâ¥ á § £®«®¢ª®¬
mov edx,dword[esi+2] ;à §¬¥à ¡«®ª 
cmp dword[eax],0
jne @f
@ -564,7 +578,8 @@ align 4
block_analiz_data:
pushad
mov ax,word[esi]
mov ecx,dword[esi+2] ;à §¬¥à ¡«®ª 
mov ecx,dword[esi+2]
sub ecx,6 ;à §¬¥à ¤ ­­ëå ¢ ¡«®ª¥
add esi,6
mov ebx,dword[level_stack]
inc ebx
@ -583,15 +598,32 @@ block_analiz_data:
popad
ret
;¢å®¤ ¢ ¤®ç¥à­¨© ¡«®ª
;¢å®¤ ¢ 1-© ¤®ç¥à­¨© ¡«®ª
;output:
; edx - destroy
align 4
block_children:
mov dword[eax],esi ;㪠§ â¥«ì ­  ­ ç «® ¡«®ª 
mov ebx,dword[esi+2]
mov dword[eax+4],ebx ;à §¬¥à ¡«®ª 
add esi,6 ;¯¥à¥å®¤¨¬ ª ¤ ­­ë¬ ¡«®ª 
inc dword[level_stack]
add eax,8
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
;¯¥à¥å®¤ ª á«¥¤ã饬㠡«®ªã ⥪ã饣® ã஢­ï
@ -599,12 +631,10 @@ align 4
block_next:
push ebx
add esi,dword[esi+2] ;¯à®¯ã᪠¥¬ ¤ ­­ë¥ ¡«®ª 
add esi,6
;¯à®¢¥àª  à §¬¥à®¢ த¨â¥«ì᪮£® ¡«®ª , ¤«ï ¢®§¬®¦­®£® ¢ë室  ­  ¢¥àå­¨© ã஢¥­ì ¥á«¨ ª®­¥æ ¡«®ª 
mov ebx,dword[eax-8]
add ebx,dword[eax-4]
add ebx,6
cmp esi,ebx
jl @f
dec dword[level_stack]
@ -1080,7 +1110,7 @@ procinfo process_information
align 4
buf_0: dd 0 ;㪠§ â¥«ì ­  ¡ãä¥à ¨§®¡à ¦¥­¨ï
dw 155 ;+4 left
dw 205 ;+4 left
dw 35 ;+6 top
.w: dd 340 ;+8 w
.h: dd 250 ;+12 h
@ -1099,7 +1129,7 @@ buf_1:
el_focus dd tree1
tree1 tree_list size_one_list,100+2, tl_key_no_edit+tl_draw_par_line,\
16,16, 0xffffff,0xb0d0ff,0xd000ff, 5,35,145-16,250, 0,8,0, el_focus,\
16,16, 0xffffff,0xb0d0ff,0xd000ff, 5,35,195-16,250, 0,8,0, el_focus,\
w_scr_t1,0
align 4

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB