From 10393dcd17f8249a788c2665718677e2adc28f08 Mon Sep 17 00:00:00 2001 From: IgorA Date: Thu, 22 Mar 2018 20:19:26 +0000 Subject: [PATCH] voxel_editor and utilites: include toolbars into program files git-svn-id: svn://kolibrios.org@7205 a494cfbc-eb01-0410-851d-a64ba20cac60 --- data/Tupfile.lua | 6 ---- .../media/voxel_editor/trunk/build_ru.bat | 3 -- .../media/voxel_editor/trunk/voxel_editor.asm | 11 ++++--- .../media/voxel_editor/utilites/build_ru.bat | 3 -- .../voxel_editor/utilites/vox_creator.asm | 25 +++++++++++----- .../media/voxel_editor/utilites/vox_mover.asm | 30 ++++++++++++------- .../media/voxel_editor/utilites/vox_tgl.asm | 30 +++++++++++-------- 7 files changed, 61 insertions(+), 47 deletions(-) diff --git a/data/Tupfile.lua b/data/Tupfile.lua index 6a4c12f1ed..7d0e54e42c 100644 --- a/data/Tupfile.lua +++ b/data/Tupfile.lua @@ -162,9 +162,6 @@ extra_files = { {"kolibrios/3D/md2view/", "common/3d/md2view/*"}, {"kolibrios/3D/md2view/md2_model/", "common/3d/md2view/md2_model/*"}, {"kolibrios/3D/voxel_editor/VOXEL_EDITOR", PROGS .. "/media/voxel_editor/trunk/voxel_editor"}, - {"kolibrios/3D/voxel_editor/CURSORS.PNG", PROGS .. "/media/voxel_editor/trunk/cursors.png"}, - {"kolibrios/3D/voxel_editor/CURSORS_GR.PNG", PROGS .. "/media/voxel_editor/trunk/cursors_gr.png"}, - {"kolibrios/3D/voxel_editor/TOOLBAR.PNG", PROGS .. "/media/voxel_editor/trunk/toolbar.png"}, {"kolibrios/3D/voxel_editor/VOX_EDITOR.INI", PROGS .. "/media/voxel_editor/trunk/vox_editor.ini"}, {"kolibrios/3D/voxel_editor/HOUSE1.VOX", PROGS .. "/media/voxel_editor/trunk/house1.vox"}, {"kolibrios/3D/voxel_editor/HOUSE2.VOX", PROGS .. "/media/voxel_editor/trunk/house2.vox"}, @@ -173,9 +170,6 @@ extra_files = { {"kolibrios/3D/voxel_utilites/VOX_MOVER" , PROGS .. "/media/voxel_editor/utilites/vox_mover"}, {"kolibrios/3D/voxel_utilites/VOX_TGL" , PROGS .. "/media/voxel_editor/utilites/vox_tgl"}, {"kolibrios/3D/voxel_utilites/VOX_MOVER.INI" , PROGS .. "/media/voxel_editor/utilites/vox_mover.ini"}, - {"kolibrios/3D/voxel_utilites/TOOLBAR.PNG" , PROGS .. "/media/voxel_editor/utilites/toolbar.png"}, - {"kolibrios/3D/voxel_utilites/TOOLBAR_M.PNG" , PROGS .. "/media/voxel_editor/utilites/toolbar_m.png"}, - {"kolibrios/3D/voxel_utilites/TOOLBAR_T.PNG" , PROGS .. "/media/voxel_editor/utilites/toolbar_t.png"}, {"kolibrios/3D/FONT8X9.BMP", PROGS .. "/fs/kfar/trunk/font8x9.bmp"}, {"kolibrios/3D/TOOLB_1.PNG", PROGS .. "/develop/libraries/TinyGL/asm_fork/examples/toolb_1.png"}, {"kolibrios/3D/TEST_GLU1", PROGS .. "/develop/libraries/TinyGL/asm_fork/examples/test_glu1"}, diff --git a/programs/media/voxel_editor/trunk/build_ru.bat b/programs/media/voxel_editor/trunk/build_ru.bat index 6dd0c67594..5544838a43 100644 --- a/programs/media/voxel_editor/trunk/build_ru.bat +++ b/programs/media/voxel_editor/trunk/build_ru.bat @@ -1,7 +1,4 @@ if not exist bin mkdir bin -if not exist bin\cursors.png @copy cursors.png bin\cursors.png -if not exist bin\cursors_gr.png @copy cursors_gr.png bin\cursors_gr.png -if not exist bin\toolbar.png @copy toolbar.png bin\toolbar.png @copy *.vox bin\*.vox if not exist bin\buf2d.obj @fasm.exe -m 16384 ..\..\..\develop\libraries\buf2d\trunk\buf2d.asm bin\buf2d.obj @kpack bin\buf2d.obj diff --git a/programs/media/voxel_editor/trunk/voxel_editor.asm b/programs/media/voxel_editor/trunk/voxel_editor.asm index 407697a178..468cd2c60f 100644 --- a/programs/media/voxel_editor/trunk/voxel_editor.asm +++ b/programs/media/voxel_editor/trunk/voxel_editor.asm @@ -1,5 +1,5 @@ use32 - org 0x0 + org 0 db 'MENUET01' ;идентиф. исполняемого файла всегда 8 байт dd 1, start, i_end, mem, stacktop, openfile_path, sys_path @@ -12,9 +12,8 @@ include 'vox_rotate.inc' include 'str.inc' @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load -caption db 'Voxel editor 17.03.18',0 ;подпись окна +caption db 'Voxel editor 22.03.18',0 ;подпись окна -fn_toolbar db 'toolbar.png',0 IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3 image_data_toolbar dd 0 cursors_count equ 4 @@ -118,11 +117,11 @@ start: mov [buf_pl.h],eax ;*** загрузка курсоров - load_image_file 'cursors_gr.png',image_data_toolbar + include_image_file 'cursors_gr.png',image_data_toolbar stdcall [buf2d_create_f_img], buf_curs_8,[image_data_toolbar] ;создаем буфер stdcall mem.Free,[image_data_toolbar] ;освобождаем память - load_image_file 'cursors.png',image_data_toolbar + include_image_file 'cursors.png',image_data_toolbar stdcall [buf2d_create_f_img], buf_curs,[image_data_toolbar] ;создаем буфер stdcall mem.Free,[image_data_toolbar] ;освобождаем память @@ -137,7 +136,7 @@ start: stdcall [buf2d_vox_brush_create], buf_vox_g3, vox_6_7_z stdcall [buf2d_vox_brush_create], buf_vox_g2, vox_6_4_z - load_image_file fn_toolbar, image_data_toolbar + include_image_file 'toolbar.png', image_data_toolbar stdcall mem.Alloc,[max_open_file_size] mov dword[open_file_vox],eax diff --git a/programs/media/voxel_editor/utilites/build_ru.bat b/programs/media/voxel_editor/utilites/build_ru.bat index 01289404e0..c7c400fec5 100644 --- a/programs/media/voxel_editor/utilites/build_ru.bat +++ b/programs/media/voxel_editor/utilites/build_ru.bat @@ -1,7 +1,4 @@ if not exist bin mkdir bin -if not exist bin\toolbar.png @copy toolbar.png bin\toolbar.png -if not exist bin\toolbar_m.png @copy toolbar_m.png bin\toolbar_m.png -if not exist bin\toolbar_t.png @copy toolbar_t.png bin\toolbar_t.png if not exist bin\buf2d.obj @fasm.exe -m 16384 ..\..\..\develop\libraries\TinyGL\asm_fork\tinygl.asm bin\tinygl.obj @kpack bin\tinygl.obj @fasm.exe -m 16384 vox_creator.asm bin\vox_creator.kex diff --git a/programs/media/voxel_editor/utilites/vox_creator.asm b/programs/media/voxel_editor/utilites/vox_creator.asm index 592e4f024d..c3fd2460dd 100644 --- a/programs/media/voxel_editor/utilites/vox_creator.asm +++ b/programs/media/voxel_editor/utilites/vox_creator.asm @@ -1,7 +1,7 @@ use32 - org 0x0 + org 0 db 'MENUET01' ;идентиф. исполняемого файла всегда 8 байт - dd 1,start,i_end,mem,stacktop,0,sys_path + dd 1,start,i_end,mem,stacktop,openfile_path,sys_path include '../../../../programs/macros.inc' include '../../../../programs/proc32.inc' @@ -15,7 +15,7 @@ txt_buf rb 8 include '../trunk/vox_rotate.inc' @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load -caption db 'Voxel creator 19.02.16',0 ;подпись окна +caption db 'Voxel creator 22.03.18',0 ;подпись окна BUF_STRUCT_SIZE equ 21 buf2d_data equ dword[edi] ;данные буфера изображения @@ -37,7 +37,6 @@ txt_pref db ' txt_f_size: db 'Размер: ' .size: rb 16 -fn_toolbar db 'toolbar.png',0 IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3 image_data_toolbar dd 0 @@ -60,7 +59,7 @@ start: stdcall [buf2d_create], buf_0z stdcall [buf2d_vox_brush_create], buf_vox, vox_6_7_z - load_image_file fn_toolbar, image_data_toolbar + include_image_file 'toolbar.png', image_data_toolbar stdcall mem.Alloc,max_open_file_size mov dword[open_file_vox],eax @@ -69,6 +68,11 @@ start: mcall SF_SYSTEM_GET,SSF_TIME_COUNT mov [last_time],eax + ;проверка командной строки + cmp dword[openfile_path],0 + je @f + call but_open_file_cmd_lin + @@: align 4 red_win: @@ -548,9 +552,16 @@ but_open_file: mov [OpenDialog_data.type],0 stdcall [OpenDialog_Start],OpenDialog_data cmp [OpenDialog_data.status],2 - je .end_open_file - ;код при удачном открытии диалога + je @f + ;код при удачном открытии диалога + call but_open_file_cmd_lin + @@: +popad + ret +align 4 +but_open_file_cmd_lin: +pushad mov [run_file_70.Function], SSF_READ_FILE mov [run_file_70.Position], 0 mov [run_file_70.Flags], 0 diff --git a/programs/media/voxel_editor/utilites/vox_mover.asm b/programs/media/voxel_editor/utilites/vox_mover.asm index 62a6ba3a28..6addf31d78 100644 --- a/programs/media/voxel_editor/utilites/vox_mover.asm +++ b/programs/media/voxel_editor/utilites/vox_mover.asm @@ -1,7 +1,7 @@ use32 - org 0x0 + org 0 db 'MENUET01' ;идентиф. исполняемого файла всегда 8 байт - dd 1, start, i_end, mem, stacktop, 0, sys_path + dd 1, start, i_end, mem, stacktop, openfile_path, sys_path include '../../../../programs/macros.inc' include '../../../../programs/proc32.inc' @@ -12,7 +12,7 @@ include '../trunk/vox_rotate.inc' include '../trunk/str.inc' @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load -caption db 'Voxel mover 19.02.16',0 ;подпись окна +caption db 'Voxel mover 22.03.18',0 ;подпись окна run_file_70 FileInfoBlock @@ -117,7 +117,7 @@ start: stdcall [buf2d_vox_brush_create], buf_vox, vox_6_7_z - load_image_file 'toolbar_m.png', image_data_toolbar + include_image_file 'toolbar_m.png', image_data_toolbar stdcall mem.Alloc,[max_open_file_size] mov dword[open_file_vox],eax @@ -126,6 +126,11 @@ start: stdcall but_new_file, [open_file_vox] stdcall but_new_file, [moved_file_vox] + ;проверка командной строки + cmp dword[openfile_path],0 + je @f + call but_open_file_cmd_lin + @@: align 4 red_win: @@ -628,14 +633,21 @@ moved_file_vox dd 0 align 4 but_open_file: - pushad +pushad copy_path open_dialog_name,communication_area_default_path,file_name,0 mov [OpenDialog_data.type],0 stdcall [OpenDialog_Start],OpenDialog_data cmp [OpenDialog_data.status],2 - je .end_open_file - ;код при удачном открытии диалога + je @f + ;код при удачном открытии диалога + call but_open_file_cmd_lin + @@: +popad + ret +align 4 +but_open_file_cmd_lin: +pushad mov [run_file_70.Function], SSF_READ_FILE mov [run_file_70.Position], 0 mov [run_file_70.Flags], 0 @@ -647,8 +659,6 @@ but_open_file: cmp ebx,0xffffffff je .end_open_file - ;add ebx,[open_file_vox] - ;mov byte[ebx],0 ;на случай если ранее был открыт файл большего размера чистим конец буфера с файлом mcall SF_SET_CAPTION,1,openfile_path ;--- @@ -661,7 +671,7 @@ but_open_file: mov dword[cam_z],0 call draw_objects .end_open_file: - popad +popad ret align 4 diff --git a/programs/media/voxel_editor/utilites/vox_tgl.asm b/programs/media/voxel_editor/utilites/vox_tgl.asm index 67a8143702..1443af5ce8 100644 --- a/programs/media/voxel_editor/utilites/vox_tgl.asm +++ b/programs/media/voxel_editor/utilites/vox_tgl.asm @@ -1,7 +1,7 @@ use32 - org 0x0 + org 0 db 'MENUET01' ;идентиф. исполняемого файла всегда 8 байт - dd 1, start, i_end, mem, stacktop, 0, sys_path + dd 1, start, i_end, mem, stacktop, openfile_path, sys_path include '../../../../programs/macros.inc' include '../../../../programs/proc32.inc' @@ -12,7 +12,7 @@ include 'vox_3d.inc' include '../trunk/str.inc' @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load -caption db 'Voxel viewer 18.04.17',0 ;подпись окна +caption db 'Voxel viewer 22.03.18',0 ;подпись окна 3d_wnd_l equ 5 ;отступ для tinygl буфера слева 3d_wnd_t equ 30 ;отступ для tinygl буфера сверху @@ -40,7 +40,7 @@ start: stdcall [buf2d_create], buf_0 ;создание буфера - load_image_file 'toolbar_t.png', image_data_toolbar,,,6 ;6 - for gray icons + include_image_file 'toolbar_t.png', image_data_toolbar,,,6 ;6 - for gray icons mov eax,[image_data_toolbar] add eax,IMAGE_TOOLBAR_SIZE stdcall img_to_gray, [image_data_toolbar],eax,(IMAGE_TOOLBAR_SIZE)/3 @@ -55,7 +55,11 @@ start: stdcall [glShadeModel], GL_SMOOTH call but_new_file - + ;проверка командной строки + cmp dword[openfile_path],0 + je @f + call but_open_file_cmd_lin + @@: align 4 red_win: @@ -418,9 +422,16 @@ pushad mov [OpenDialog_data.type],0 stdcall [OpenDialog_Start],OpenDialog_data cmp [OpenDialog_data.status],2 - je .end_open_file - ;код при удачном открытии диалога + je @f + ;код при удачном открытии диалога + call but_open_file_cmd_lin + @@: +popad + ret +align 4 +but_open_file_cmd_lin: +pushad mov [run_file_70.Function], SSF_GET_INFO mov [run_file_70.Position], 0 mov [run_file_70.Flags], 0 @@ -430,11 +441,6 @@ pushad mov dword[run_file_70.FileName], openfile_path mcall SF_FILE,run_file_70 - ;mov eax,dword[open_b+32] - ;mov edi,txt_buf - ;call conv_int_to_str - ;notify_window_run txt_buf - mov ecx,dword[open_b+32] ;+32 qword: размер файла в байтах stdcall mem.ReAlloc,[open_file_data],ecx mov [open_file_data],eax