update utilites
git-svn-id: svn://kolibrios.org@6259 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
BIN
programs/media/voxel_editor/trunk/squirrel.vox
Normal file
BIN
programs/media/voxel_editor/trunk/squirrel.vox
Normal file
Binary file not shown.
@@ -6,8 +6,7 @@ use32
|
||||
include '../../../../programs/macros.inc'
|
||||
include '../../../../programs/proc32.inc'
|
||||
include '../../../../programs/KOSfuncs.inc'
|
||||
include '../../../../programs/develop/libraries/box_lib/load_lib.mac'
|
||||
include '../../../../programs/dll.inc'
|
||||
include '../../../../programs/load_img.inc'
|
||||
include '../trunk/str.inc'
|
||||
|
||||
vox_offs_tree_table equ 4
|
||||
@@ -16,17 +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 08.02.16',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
struct FileInfoBlock
|
||||
Function dd ?
|
||||
Position dd ?
|
||||
Flags dd ?
|
||||
Count dd ?
|
||||
Buffer dd ?
|
||||
db ?
|
||||
FileName dd ?
|
||||
ends
|
||||
caption db 'Voxel creator 19.02.16',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
BUF_STRUCT_SIZE equ 21
|
||||
buf2d_data equ dword[edi] ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
@@ -42,7 +31,6 @@ vox_offs_tree_table equ 4
|
||||
vox_offs_data equ 12
|
||||
|
||||
run_file_70 FileInfoBlock
|
||||
image_data dd 0 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD> <20>㦥<EFBFBD> <20>८<EFBFBD>ࠧ<EFBFBD><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
vox_obj_size dd 0 ;ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD>ᥫ쭮<E1A5AB><ECADAE> <20><>ꥪ<EFBFBD><EAA5AA> (<28><><EFBFBD> <20>७<E1AAAE><E0A5AD> <20><>⠢<EFBFBD><E2A0A2>)
|
||||
txt_space db ' ',0
|
||||
txt_pref db ' <20> ',0,' <20><>',0,' <20><>',0,' <20><>',0 ;<3B><><EFBFBD><EFBFBD>⠢<EFBFBD><E2A0A2>: <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>
|
||||
@@ -51,50 +39,10 @@ txt_f_size: db '
|
||||
|
||||
fn_toolbar db 'toolbar.png',0
|
||||
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
|
||||
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*9
|
||||
image_data_toolbar dd 0
|
||||
|
||||
max_open_file_size equ 1024*1024 ;1 Mb
|
||||
|
||||
macro load_image_file path,buf,size { ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>㧪<EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
;path - <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ப<EFBFBD><E0AEAA><EFBFBD><EFBFBD> <20><>ࠬ<EFBFBD><E0A0AC>
|
||||
if path eqtype '' ;<3B><EFBFBD><E0AEA2>塞 <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>ப<EFBFBD><E0AEAA> <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD> path
|
||||
jmp @f
|
||||
local .path_str
|
||||
.path_str db path ;<3B><>ନ<EFBFBD>㥬 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD>
|
||||
db 0
|
||||
@@:
|
||||
;32 - <20>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><>⥬
|
||||
copy_path .path_str,[32],file_name,0
|
||||
else
|
||||
copy_path path,[32],file_name,0 ;<3B><>ନ<EFBFBD>㥬 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>, <20><><EFBFBD>ࠧ㬥<E0A0A7><E3ACA5><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20>ணࠬ<E0AEA3><E0A0AC><EFBFBD>
|
||||
end if
|
||||
|
||||
stdcall mem.Alloc, dword size ;<3B>뤥<EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
mov [buf],eax
|
||||
|
||||
mov [run_file_70.Function], SSF_READ_FILE
|
||||
mov [run_file_70.Position], 0
|
||||
mov [run_file_70.Flags], 0
|
||||
mov [run_file_70.Count], dword size
|
||||
mov [run_file_70.Buffer], eax
|
||||
mov byte[run_file_70+20], 0
|
||||
mov [run_file_70.FileName], file_name
|
||||
mcall SF_FILE,run_file_70 ;<3B><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0> 䠩<> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
cmp ebx,0xffffffff
|
||||
je @f
|
||||
;<3B><>।<EFBFBD><E0A5A4>塞 <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20> <20><>ॢ<EFBFBD><E0A5A2><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> image_data
|
||||
stdcall dword[img_decode], dword[buf],ebx,0
|
||||
mov dword[image_data],eax
|
||||
;<3B>८<EFBFBD>ࠧ㥬 <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20> <20><>ଠ<EFBFBD><E0ACA0> rgb
|
||||
stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
|
||||
;㤠<>塞 <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> image_data
|
||||
stdcall dword[img_destroy], dword[image_data]
|
||||
@@:
|
||||
}
|
||||
|
||||
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_libraries l_libs_start,l_libs_end
|
||||
@@ -112,7 +60,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,IMAGE_TOOLBAR_SIZE
|
||||
load_image_file fn_toolbar, image_data_toolbar
|
||||
|
||||
stdcall mem.Alloc,max_open_file_size
|
||||
mov dword[open_file_vox],eax
|
||||
@@ -603,16 +551,14 @@ but_open_file:
|
||||
je .end_open_file
|
||||
;<3B><><EFBFBD> <20><><EFBFBD> 㤠筮<E3A4A0> <20><><EFBFBD><EFBFBD><EFBFBD>⨨ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mov eax,70 ;70-<2D> <20>㭪<EFBFBD><E3ADAA><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD>
|
||||
mov [run_file_70.Function], 0
|
||||
mov [run_file_70.Function], SSF_READ_FILE
|
||||
mov [run_file_70.Position], 0
|
||||
mov [run_file_70.Flags], 0
|
||||
mov [run_file_70.Count], dword max_open_file_size
|
||||
m2m [run_file_70.Buffer],dword[open_file_vox]
|
||||
mov byte[run_file_70+20], 0
|
||||
mov dword[run_file_70.FileName], openfile_path
|
||||
mov ebx,run_file_70
|
||||
int 0x40 ;<3B><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0> 䠩<> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
mcall SF_FILE,run_file_70
|
||||
cmp ebx,0xffffffff
|
||||
je .end_open_file
|
||||
; <20><EFBFBD>ઠ <20><> <20>ࠢ<EFBFBD><E0A0A2>쭮<EFBFBD><ECADAE><EFBFBD> <20><><EFBFBD>ᥫ쭮<E1A5AB><ECADAE> <20><>ଠ<EFBFBD><E0ACA0>
|
||||
@@ -658,16 +604,14 @@ but_save_file:
|
||||
|
||||
stdcall buf2d_vox_obj_get_size, ebx
|
||||
mov dword[run_file_70.Count], eax ;ࠧ<><E0A0A7><EFBFBD> 䠩<><E4A0A9>
|
||||
mov eax,70 ;70-<2D> <20>㭪<EFBFBD><E3ADAA><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD>
|
||||
mov [run_file_70.Function], 2
|
||||
mov [run_file_70.Function], SSF_CREATE_FILE
|
||||
mov [run_file_70.Position], 0
|
||||
mov [run_file_70.Flags], 0
|
||||
mov ebx, dword[open_file_vox]
|
||||
mov [run_file_70.Buffer], ebx
|
||||
mov byte[run_file_70+20], 0
|
||||
mov dword[run_file_70.FileName], openfile_path
|
||||
mov ebx,run_file_70
|
||||
int 0x40 ;<3B><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0> 䠩<> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
mcall SF_FILE,run_file_70
|
||||
cmp ebx,0xffffffff
|
||||
je .end_save_file
|
||||
|
||||
@@ -1162,39 +1106,35 @@ proc open_image_in_buf, buf:dword
|
||||
;stdcall mem.Alloc, dword size ;<3B>뤥<EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
;mov [buf],eax
|
||||
|
||||
mov eax,70 ;70-<2D> <20>㭪<EFBFBD><E3ADAA><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD>
|
||||
mov [run_file_70.Function], 0
|
||||
mov [run_file_70.Function], SSF_READ_FILE
|
||||
mov [run_file_70.Position], 0
|
||||
mov [run_file_70.Flags], 0
|
||||
mov [run_file_70.Count], dword max_open_file_size
|
||||
m2m [run_file_70.Buffer],dword[open_file_img]
|
||||
mov byte[run_file_70+20], 0
|
||||
mov [run_file_70.FileName], openfile_path
|
||||
mov ebx,run_file_70
|
||||
int 0x40 ;<3B><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0> 䠩<> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
mcall SF_FILE,run_file_70
|
||||
cmp ebx,0xffffffff
|
||||
je .end_0
|
||||
;<3B><>।<EFBFBD><E0A5A4>塞 <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20> <20><>ॢ<EFBFBD><E0A5A2><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> image_data
|
||||
;<3B><>।<EFBFBD><E0A5A4>塞 <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
stdcall dword[img_decode], dword[open_file_img],ebx,0
|
||||
cmp eax,0
|
||||
je .end_0 ;<3B> <20><><EFBFBD><EFBFBD>襭 <20><>ଠ<EFBFBD> 䠩<><E4A0A9>
|
||||
mov dword[image_data],eax
|
||||
or eax,eax
|
||||
jz .end_0 ;<3B> <20><><EFBFBD><EFBFBD>襭 <20><>ଠ<EFBFBD> 䠩<><E4A0A9>
|
||||
mov ebx,eax
|
||||
;<3B>८<EFBFBD>ࠧ㥬 <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20> <20><>ଠ<EFBFBD><E0ACA0> rgb
|
||||
stdcall dword[img_to_rgb2], dword[image_data],dword[open_file_img]
|
||||
stdcall dword[img_to_rgb2], ebx,dword[open_file_img]
|
||||
|
||||
mov eax,dword[image_data]
|
||||
mov edi,[buf]
|
||||
cmp buf2d_data,0
|
||||
jne @f
|
||||
m2m buf2d_w,dword[eax+4] ;+4 = image width
|
||||
m2m buf2d_h,dword[eax+8] ;+8 = image heihht
|
||||
m2m buf2d_w,dword[ebx+4] ;+4 = image width
|
||||
m2m buf2d_h,dword[ebx+8] ;+8 = image heihht
|
||||
stdcall [buf2d_create_f_img], edi,[open_file_img]
|
||||
jmp .end_1
|
||||
@@:
|
||||
mov ebx,dword[eax+4]
|
||||
mov ecx,dword[eax+8]
|
||||
stdcall [buf2d_resize], edi, ebx,ecx,1 ;<3B><><EFBFBD><EFBFBD><EFBFBD>塞 ࠧ<><E0A0A7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
imul ecx,ebx
|
||||
mov ecx,dword[ebx+8]
|
||||
stdcall [buf2d_resize], edi, [ebx+4],ecx,1 ;<3B><><EFBFBD><EFBFBD><EFBFBD>塞 ࠧ<><E0A0A7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
imul ecx,[ebx+4]
|
||||
lea ecx,[ecx+ecx*2]
|
||||
mov edi,buf2d_data
|
||||
mov esi,[open_file_img]
|
||||
@@ -1202,8 +1142,8 @@ proc open_image_in_buf, buf:dword
|
||||
rep movsb ;copy image
|
||||
.end_1:
|
||||
|
||||
;㤠<>塞 <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> image_data
|
||||
stdcall dword[img_destroy], dword[image_data]
|
||||
;㤠<>塞 <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> ebx
|
||||
stdcall dword[img_destroy], ebx
|
||||
.end_0:
|
||||
|
||||
call draw_buffers
|
||||
|
@@ -1,40 +1,22 @@
|
||||
use32
|
||||
org 0x0
|
||||
db 'MENUET01' ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20>ᯮ<EFBFBD><E1AFAE>塞<EFBFBD><EFA5AC><EFBFBD> 䠩<><E4A0A9> <20>ᥣ<EFBFBD><E1A5A3> 8 <20><><EFBFBD><EFBFBD>
|
||||
dd 0x1
|
||||
dd start
|
||||
dd i_end ;ࠧ<><E0A0A7><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd mem
|
||||
dd stacktop
|
||||
dd 0
|
||||
dd sys_path
|
||||
dd 1, start, i_end, mem, stacktop, 0, sys_path
|
||||
|
||||
include '../../../../programs/macros.inc'
|
||||
include '../../../../programs/proc32.inc'
|
||||
include '../../../../programs/develop/libraries/box_lib/load_lib.mac'
|
||||
include '../../../../programs/dll.inc'
|
||||
include '../../../../programs/KOSfuncs.inc'
|
||||
include '../../../../programs/load_img.inc'
|
||||
include '../trunk/vox_draw.inc'
|
||||
include '../trunk/vox_rotate.inc'
|
||||
include '../trunk/str.inc'
|
||||
|
||||
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
caption db 'Voxel mover 29.01.15',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
struct FileInfoBlock
|
||||
Function dd ?
|
||||
Position dd ?
|
||||
Flags dd ?
|
||||
Count dd ?
|
||||
Buffer dd ?
|
||||
db ?
|
||||
FileName dd ?
|
||||
ends
|
||||
caption db 'Voxel mover 19.02.16',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
run_file_70 FileInfoBlock
|
||||
image_data dd 0 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD> <20>㦥<EFBFBD> <20>८<EFBFBD>ࠧ<EFBFBD><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
|
||||
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
|
||||
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*18
|
||||
image_data_toolbar dd 0
|
||||
|
||||
;<3B><><EFBFBD>祭<EFBFBD><E7A5AD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> 㬮<>砭<EFBFBD><E7A0AD>, <20><><EFBFBD> ini 䠩<><E4A0A9>
|
||||
@@ -62,45 +44,6 @@ key_t_size db 'tile_size',0
|
||||
key_f_size db 'file_size',0
|
||||
key_col_b db 'c_background',0
|
||||
|
||||
macro load_image_file path,buf,size { ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>㧪<EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
;path - <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ப<EFBFBD><E0AEAA><EFBFBD><EFBFBD> <20><>ࠬ<EFBFBD><E0A0AC>
|
||||
if path eqtype '' ;<3B><EFBFBD><E0AEA2>塞 <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>ப<EFBFBD><E0AEAA> <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD> path
|
||||
jmp @f
|
||||
local .path_str
|
||||
.path_str db path ;<3B><>ନ<EFBFBD>㥬 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD>
|
||||
db 0
|
||||
@@:
|
||||
;32 - <20>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><>⥬
|
||||
copy_path .path_str,[32],file_name,0x0
|
||||
else
|
||||
copy_path path,[32],file_name,0x0 ;<3B><>ନ<EFBFBD>㥬 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>, <20><><EFBFBD>ࠧ㬥<E0A0A7><E3ACA5><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20>ணࠬ<E0AEA3><E0A0AC><EFBFBD>
|
||||
end if
|
||||
|
||||
stdcall mem.Alloc, dword size ;<3B>뤥<EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
mov [buf],eax
|
||||
|
||||
mov eax,70 ;70-<2D> <20>㭪<EFBFBD><E3ADAA><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD>
|
||||
mov [run_file_70.Function], 0
|
||||
mov [run_file_70.Position], 0
|
||||
mov [run_file_70.Flags], 0
|
||||
mov [run_file_70.Count], dword size
|
||||
m2m [run_file_70.Buffer], [buf]
|
||||
mov byte[run_file_70+20], 0
|
||||
mov [run_file_70.FileName], file_name
|
||||
mov ebx,run_file_70
|
||||
int 0x40 ;<3B><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0> 䠩<> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
cmp ebx,0xffffffff
|
||||
je @f
|
||||
;<3B><>।<EFBFBD><E0A5A4>塞 <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20> <20><>ॢ<EFBFBD><E0A5A2><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> image_data
|
||||
stdcall dword[img_decode], dword[buf],ebx,0
|
||||
mov dword[image_data],eax
|
||||
;<3B>८<EFBFBD>ࠧ㥬 <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20> <20><>ଠ<EFBFBD><E0ACA0> rgb
|
||||
stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
|
||||
;㤠<>塞 <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> image_data
|
||||
stdcall dword[img_destroy], dword[image_data]
|
||||
@@:
|
||||
}
|
||||
|
||||
OT_MAP_X equ 0
|
||||
OT_MAP_Y equ 0
|
||||
OT_CAPT_X_COLOR equ 5 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 梥<><E6A2A5>
|
||||
@@ -116,10 +59,10 @@ start:
|
||||
mov ebp,lib_2
|
||||
cmp dword [ebp+ll_struc_size-4],0
|
||||
jz @f
|
||||
mcall -1 ;exit not correct
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
@@:
|
||||
mcall 48,3,sc,sizeof.system_colors
|
||||
mcall 40,0x27
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
|
||||
mcall SF_SET_EVENTS_MASK,0xC0000027
|
||||
stdcall [OpenDialog_Init],OpenDialog_data ;<3B><><EFBFBD><EFBFBD><EFBFBD>⮢<EFBFBD><E2AEA2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
;--- load ini file ---
|
||||
@@ -174,7 +117,7 @@ start:
|
||||
|
||||
stdcall [buf2d_vox_brush_create], buf_vox, vox_6_7_z
|
||||
|
||||
load_image_file 'toolbar_m.png', image_data_toolbar,IMAGE_TOOLBAR_SIZE
|
||||
load_image_file 'toolbar_m.png', image_data_toolbar
|
||||
|
||||
stdcall mem.Alloc,[max_open_file_size]
|
||||
mov dword[open_file_vox],eax
|
||||
@@ -190,7 +133,7 @@ red_win:
|
||||
|
||||
align 4
|
||||
still:
|
||||
mcall 10
|
||||
mcall SF_WAIT_EVENT
|
||||
|
||||
cmp al,1
|
||||
jz red_win
|
||||
@@ -200,7 +143,7 @@ still:
|
||||
jz button
|
||||
cmp al,6
|
||||
jne @f
|
||||
mcall 9,procinfo,-1
|
||||
mcall SF_THREAD_INFO,procinfo,-1
|
||||
cmp ax,word[procinfo+4]
|
||||
jne @f ;<3B><><EFBFBD><EFBFBD> <20><> <20><>⨢<EFBFBD><E2A8A2>
|
||||
call mouse
|
||||
@@ -210,10 +153,10 @@ still:
|
||||
align 4
|
||||
mouse:
|
||||
pushad
|
||||
mcall 37,2
|
||||
mcall SF_MOUSE_GET,SSF_BUTTON
|
||||
bt eax,1 ;right button
|
||||
jnc @f
|
||||
mcall 37,1 ;get mouse coords
|
||||
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
|
||||
mov ebx,eax
|
||||
shr ebx,16
|
||||
and eax,0xffff
|
||||
@@ -223,7 +166,7 @@ mouse:
|
||||
@@:
|
||||
bt eax,0 ;left button
|
||||
jnc .end_f
|
||||
mcall 37,1 ;get mouse coords
|
||||
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
|
||||
mov ebx,eax
|
||||
shr ebx,16
|
||||
and eax,0xffff
|
||||
@@ -347,16 +290,16 @@ convert_y:
|
||||
align 4
|
||||
draw_window:
|
||||
pushad
|
||||
mcall 12,1
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
|
||||
; *** <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28>믮<EFBFBD><EBAFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 ࠧ <20><><EFBFBD> <20><><EFBFBD><EFBFBD>᪥) ***
|
||||
mov edx,[sc.work]
|
||||
or edx,(3 shl 24)+0x30000000
|
||||
mcall 0,dword[wnd_s_pos],dword[wnd_s_pos+4],,,caption
|
||||
mcall SF_CREATE_WINDOW,dword[wnd_s_pos],dword[wnd_s_pos+4],,,caption
|
||||
|
||||
; *** ᮧ<><E1AEA7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ***
|
||||
mov esi,[sc.work_button]
|
||||
mcall 8,(5 shl 16)+20,(5 shl 16)+20,3
|
||||
mcall SF_DEFINE_BUTTON,(5 shl 16)+20,(5 shl 16)+20,3
|
||||
|
||||
mov ebx,(30 shl 16)+20
|
||||
mov edx,4
|
||||
@@ -412,7 +355,7 @@ pushad
|
||||
|
||||
; *** <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ***
|
||||
mov edx,(7 shl 16)+7 ;icon new
|
||||
mcall 7,[image_data_toolbar],(16 shl 16)+16
|
||||
mcall SF_PUT_IMAGE,[image_data_toolbar],(16 shl 16)+16
|
||||
|
||||
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
||||
add edx,(25 shl 16) ;icon open
|
||||
@@ -471,7 +414,7 @@ pushad
|
||||
call draw_objects
|
||||
call draw_pok
|
||||
|
||||
mcall 12,2
|
||||
mcall SF_REDRAW,SSF_END_DRAW
|
||||
popad
|
||||
ret
|
||||
|
||||
@@ -480,7 +423,7 @@ draw_pok:
|
||||
mov esi,[sc.work_button_text]
|
||||
or esi,(1 shl 30)
|
||||
mov edi,[sc.work_button]
|
||||
mcall 47, (3 shl 16)+(1 shl 31), [v_zoom], ((350+6*9) shl 16)+OT_CAPT_Y_COLOR+2 ;<3B><><EFBFBD><EFBFBD>⠡
|
||||
mcall SF_DRAW_NUMBER, (3 shl 16)+(1 shl 31), [v_zoom], ((350+6*9) shl 16)+OT_CAPT_Y_COLOR+2 ;<3B><><EFBFBD><EFBFBD>⠡
|
||||
mov ecx,[n_plane]
|
||||
add edx,115 shl 16 ;9
|
||||
int 0x40 ;<3B><><EFBFBD><EFBFBD><EFBFBD> <20><>祭<EFBFBD><E7A5AD>
|
||||
@@ -517,7 +460,7 @@ draw_pok:
|
||||
;<3B><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD> ⥪<><E2A5AA><EFBFBD>
|
||||
mov ecx,[sc.work_text]
|
||||
or ecx,0x80000000 ;or (1 shl 30)
|
||||
mcall 4, (OT_CAPT_X_COLOR shl 16)+OT_CAPT_Y_COLOR+2,,txt_color
|
||||
mcall SF_DRAW_TEXT, (OT_CAPT_X_COLOR shl 16)+OT_CAPT_Y_COLOR+2,,txt_color
|
||||
|
||||
mov edx,txt_curor
|
||||
add ebx,115 shl 16
|
||||
@@ -545,26 +488,26 @@ on_change_color:
|
||||
pushad
|
||||
mov ebx,((OT_CAPT_X_COLOR+35) shl 16)+16 ;<3B><> <20><><EFBFBD> x
|
||||
mov ecx,(OT_CAPT_Y_COLOR shl 16)+12 ;<3B><> <20><><EFBFBD> y
|
||||
mcall 13,,,[v_color]
|
||||
mcall SF_DRAW_RECT,,,[v_color]
|
||||
|
||||
mov ecx,edx
|
||||
mov edx,((OT_CAPT_X_COLOR+55) shl 16)+OT_CAPT_Y_COLOR+2
|
||||
mov esi,[sc.work_text]
|
||||
add esi,(1 shl 30)
|
||||
mov edi,[sc.work]
|
||||
mcall 47,(1 shl 8)+(6 shl 16)
|
||||
mcall SF_DRAW_NUMBER,(1 shl 8)+(6 shl 16)
|
||||
popad
|
||||
ret
|
||||
|
||||
align 4
|
||||
key:
|
||||
mcall 2
|
||||
mcall SF_GET_KEY
|
||||
jmp still
|
||||
|
||||
|
||||
align 4
|
||||
button:
|
||||
mcall 17
|
||||
mcall SF_GET_BUTTON
|
||||
cmp ah,3
|
||||
jne @f
|
||||
stdcall but_new_file, [open_file_vox]
|
||||
@@ -659,7 +602,7 @@ button:
|
||||
stdcall mem.Free,[image_data_toolbar]
|
||||
stdcall mem.Free,[open_file_vox]
|
||||
stdcall mem.Free,[moved_file_vox]
|
||||
mcall -1
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
|
||||
;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD>樠<EFBFBD><E6A8A0><EFBFBD><EFBFBD>樨 <20><><EFBFBD>ᥫ쭮<E1A5AB><ECADAE> <20><>ꥪ<EFBFBD><EAA5AA>
|
||||
align 4
|
||||
@@ -693,22 +636,20 @@ but_open_file:
|
||||
je .end_open_file
|
||||
;<3B><><EFBFBD> <20><><EFBFBD> 㤠筮<E3A4A0> <20><><EFBFBD><EFBFBD><EFBFBD>⨨ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mov eax,70 ;70-<2D> <20>㭪<EFBFBD><E3ADAA><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD>
|
||||
mov [run_file_70.Function], 0
|
||||
mov [run_file_70.Function], SSF_READ_FILE
|
||||
mov [run_file_70.Position], 0
|
||||
mov [run_file_70.Flags], 0
|
||||
m2m dword[run_file_70.Count], dword[max_open_file_size]
|
||||
m2m [run_file_70.Buffer], [open_file_vox]
|
||||
mov byte[run_file_70+20], 0
|
||||
mov dword[run_file_70.FileName], openfile_path
|
||||
mov ebx,run_file_70
|
||||
int 0x40 ;<3B><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0> 䠩<> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
mcall SF_FILE,run_file_70
|
||||
cmp ebx,0xffffffff
|
||||
je .end_open_file
|
||||
|
||||
;add ebx,[open_file_vox]
|
||||
;mov byte[ebx],0 ;<3B><> <20><><EFBFBD>砩 <20> ࠭<><E0A0AD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<> <20><><EFBFBD><EFBFBD>襣<EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD> <20><><EFBFBD>⨬ <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD>
|
||||
mcall 71,1,openfile_path
|
||||
mcall SF_SET_CAPTION,1,openfile_path
|
||||
|
||||
;---
|
||||
mov eax,[open_file_vox]
|
||||
@@ -739,16 +680,14 @@ but_save_file:
|
||||
|
||||
stdcall buf2d_vox_obj_get_size, ebx
|
||||
mov dword[run_file_70.Count], eax ;ࠧ<><E0A0A7><EFBFBD> 䠩<><E4A0A9>
|
||||
mov eax,70 ;70-<2D> <20>㭪<EFBFBD><E3ADAA><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD>
|
||||
mov [run_file_70.Function], 2
|
||||
mov [run_file_70.Function], SSF_CREATE_FILE
|
||||
mov [run_file_70.Position], 0
|
||||
mov [run_file_70.Flags], 0
|
||||
mov ebx, dword[moved_file_vox]
|
||||
mov [run_file_70.Buffer], ebx
|
||||
mov byte[run_file_70+20], 0
|
||||
mov dword[run_file_70.FileName], openfile_path
|
||||
mov ebx,run_file_70
|
||||
int 0x40 ;<3B><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0> 䠩<> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
mcall SF_FILE,run_file_70
|
||||
cmp ebx,0xffffffff
|
||||
je .end_save_file
|
||||
|
||||
|
@@ -5,77 +5,26 @@ use32
|
||||
|
||||
include '../../../../programs/macros.inc'
|
||||
include '../../../../programs/proc32.inc'
|
||||
include '../../../../programs/develop/libraries/box_lib/load_lib.mac'
|
||||
include '../../../../programs/dll.inc'
|
||||
include '../../../../programs/KOSfuncs.inc'
|
||||
include '../../../../programs/load_img.inc'
|
||||
include '../../../../programs/develop/libraries/TinyGL/asm_fork/opengl_const.inc'
|
||||
include 'vox_3d.inc'
|
||||
include '../trunk/str.inc'
|
||||
|
||||
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
|
||||
caption db 'Voxel viewer 07.12.15',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
struct FileInfoBlock
|
||||
Function dd ?
|
||||
Position dd ?
|
||||
Flags dd ?
|
||||
Count dd ?
|
||||
Buffer dd ?
|
||||
db ?
|
||||
FileName dd ?
|
||||
ends
|
||||
caption db 'Voxel viewer 19.02.16',0 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
3d_wnd_l equ 5 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> tinygl <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <><E1ABA5>
|
||||
3d_wnd_t equ 30 ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> tinygl <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᢥ<><E1A2A5><EFBFBD>
|
||||
3d_wnd_w equ 512
|
||||
3d_wnd_h equ 512
|
||||
|
||||
image_data dd 0 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD> <20>㦥<EFBFBD> <20>८<EFBFBD>ࠧ<EFBFBD><E0A0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
|
||||
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
|
||||
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*10
|
||||
image_data_toolbar dd 0
|
||||
|
||||
offs_zbuf_pbuf equ 24
|
||||
|
||||
macro load_image_file path,buf,size { ;<3B><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>㧪<EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
;path - <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ப<EFBFBD><E0AEAA><EFBFBD><EFBFBD> <20><>ࠬ<EFBFBD><E0A0AC>
|
||||
if path eqtype '' ;<3B><EFBFBD><E0AEA2>塞 <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><>ப<EFBFBD><E0AEAA> <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD> path
|
||||
jmp @f
|
||||
local .path_str
|
||||
.path_str db path ;<3B><>ନ<EFBFBD>㥬 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD>
|
||||
db 0
|
||||
@@:
|
||||
;32 - <20>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20><>⥬
|
||||
copy_path .path_str,[32],file_name,0
|
||||
else
|
||||
copy_path path,[32],file_name,0 ;<3B><>ନ<EFBFBD>㥬 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> 䠩<><E4A0A9> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>, <20><><EFBFBD>ࠧ㬥<E0A0A7><E3ACA5><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20> <20>ணࠬ<E0AEA3><E0A0AC><EFBFBD>
|
||||
end if
|
||||
|
||||
stdcall mem.Alloc, dword size ;<3B>뤥<EFBFBD>塞 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
mov [buf],eax
|
||||
|
||||
mov [run_file_70.Function], 0
|
||||
mov [run_file_70.Position], 0
|
||||
mov [run_file_70.Flags], 0
|
||||
mov [run_file_70.Count], dword size
|
||||
mov [run_file_70.Buffer], eax
|
||||
mov byte[run_file_70+20], 0
|
||||
mov [run_file_70.FileName], file_name
|
||||
mcall 70,run_file_70 ;<3B><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0> 䠩<> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
cmp ebx,0xffffffff
|
||||
je @f
|
||||
;<3B><>।<EFBFBD><E0A5A4>塞 <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20> <20><>ॢ<EFBFBD><E0A5A2><EFBFBD><EFBFBD> <20><><EFBFBD> <20><> <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> image_data
|
||||
stdcall dword[img_decode], dword[buf],ebx,0
|
||||
mov dword[image_data],eax
|
||||
;<3B>८<EFBFBD>ࠧ㥬 <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD> <20> <20><>ଠ<EFBFBD><E0ACA0> rgb
|
||||
stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
|
||||
;㤠<>塞 <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> image_data
|
||||
stdcall dword[img_destroy], dword[image_data]
|
||||
@@:
|
||||
}
|
||||
|
||||
|
||||
|
||||
align 4
|
||||
start:
|
||||
load_libraries l_libs_start,l_libs_end
|
||||
@@ -83,20 +32,20 @@ start:
|
||||
mov ebp,lib_0
|
||||
cmp dword [ebp+ll_struc_size-4],0
|
||||
jz @f
|
||||
mcall -1 ;exit not correct
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
@@:
|
||||
mcall 48,3,sc,sizeof.system_colors
|
||||
mcall 40,0x27
|
||||
mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
|
||||
mcall SF_SET_EVENTS_MASK,0xC0000027
|
||||
stdcall [OpenDialog_Init],OpenDialog_data ;<3B><><EFBFBD><EFBFBD><EFBFBD>⮢<EFBFBD><E2AEA2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
stdcall [buf2d_create], buf_0 ;ᮧ<><E1AEA7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
load_image_file 'toolbar_t.png', image_data_toolbar,IMAGE_TOOLBAR_SIZE*2 ;*2 for gray icons
|
||||
load_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
|
||||
|
||||
mcall 26,9
|
||||
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
|
||||
@@ -114,7 +63,7 @@ red_win:
|
||||
|
||||
align 4
|
||||
still:
|
||||
mcall 26,9
|
||||
mcall SF_SYSTEM_GET,SSF_TIME_COUNT
|
||||
mov ebx,[last_time]
|
||||
add ebx,50 ;<3B><><EFBFBD><EFBFBD>প<EFBFBD>
|
||||
cmp ebx,eax
|
||||
@@ -122,7 +71,7 @@ still:
|
||||
mov ebx,eax
|
||||
@@:
|
||||
sub ebx,eax
|
||||
mcall 23
|
||||
mcall SF_WAIT_EVENT_TIMEOUT
|
||||
bt word[opt_auto_rotate],0
|
||||
jnc @f
|
||||
or eax,eax
|
||||
@@ -145,7 +94,7 @@ still:
|
||||
align 4
|
||||
timer_funct:
|
||||
pushad
|
||||
mcall 26,9
|
||||
mcall SF_SYSTEM_GET,SSF_TIME_COUNT
|
||||
mov [last_time],eax
|
||||
|
||||
;<3B><>⮬<EFBFBD><E2AEAC><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 㣫<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
@@ -161,17 +110,15 @@ timer_funct:
|
||||
align 4
|
||||
draw_window:
|
||||
pushad
|
||||
mcall 12,1
|
||||
mcall SF_REDRAW,SSF_BEGIN_DRAW
|
||||
|
||||
; *** <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> (<28>믮<EFBFBD><EBAFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 ࠧ <20><><EFBFBD> <20><><EFBFBD><EFBFBD>᪥) ***
|
||||
xor eax,eax
|
||||
mov edx,[sc.work]
|
||||
or edx,(3 shl 24)+0x30000000
|
||||
mcall ,(20 shl 16)+800,(20 shl 16)+570,,,caption
|
||||
mcall SF_CREATE_WINDOW,(20 shl 16)+800,(20 shl 16)+570,,,caption
|
||||
|
||||
; *** ᮧ<><E1AEA7><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ***
|
||||
mov esi,[sc.work_button]
|
||||
mcall 8,(5 shl 16)+20,(5 shl 16)+20,3
|
||||
mcall SF_DEFINE_BUTTON,(5 shl 16)+20,(5 shl 16)+20,3,[sc.work_button]
|
||||
|
||||
mov ebx,(30 shl 16)+20
|
||||
mov edx,4
|
||||
@@ -206,7 +153,7 @@ pushad
|
||||
stdcall [buf2d_draw], buf_0
|
||||
stdcall [kosglSwapBuffers]
|
||||
|
||||
mcall 12,2
|
||||
mcall SF_REDRAW,SSF_END_DRAW
|
||||
popad
|
||||
ret
|
||||
|
||||
@@ -215,7 +162,7 @@ align 4
|
||||
draw_toolbar_i:
|
||||
; *** <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ***
|
||||
mov edx,(7 shl 16)+7 ;icon new
|
||||
mcall 7,[image_data_toolbar],(16 shl 16)+16
|
||||
mcall SF_PUT_IMAGE,[image_data_toolbar],(16 shl 16)+16
|
||||
|
||||
add ebx,IMAGE_TOOLBAR_ICON_SIZE
|
||||
add edx,(25 shl 16) ;icon open
|
||||
@@ -278,7 +225,7 @@ draw_toolbar_i:
|
||||
|
||||
align 4
|
||||
key:
|
||||
mcall 2
|
||||
mcall SF_GET_KEY
|
||||
|
||||
cmp ah,178 ;Up
|
||||
jne @f
|
||||
@@ -319,13 +266,13 @@ key:
|
||||
align 4
|
||||
mouse:
|
||||
push eax ebx
|
||||
mcall 37,3
|
||||
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
|
||||
mcall 37,1 ;get mouse coords
|
||||
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
|
||||
mov ebx,eax
|
||||
shr ebx,16 ;mouse.x
|
||||
cmp ebx,3d_wnd_l
|
||||
@@ -375,7 +322,7 @@ mouse:
|
||||
bt eax,8
|
||||
jnc .end_d
|
||||
;mouse l. but. press
|
||||
mcall 37,1 ;get mouse coords
|
||||
mcall SF_MOUSE_GET,SSF_WINDOW_POSITION
|
||||
mov ebx,eax
|
||||
shr ebx,16 ;mouse.x
|
||||
cmp ebx,3d_wnd_l
|
||||
@@ -400,7 +347,7 @@ mouse:
|
||||
|
||||
align 4
|
||||
button:
|
||||
mcall 17
|
||||
mcall SF_GET_BUTTON
|
||||
cmp ah,3
|
||||
jne @f
|
||||
call but_new_file
|
||||
@@ -448,7 +395,7 @@ button:
|
||||
stdcall mem.Free,[image_data_toolbar]
|
||||
stdcall mem.Free,[open_file_data]
|
||||
stdcall mem.Free,[open_file_ogl]
|
||||
mcall -1
|
||||
mcall SF_TERMINATE_PROCESS
|
||||
|
||||
|
||||
align 4
|
||||
@@ -461,7 +408,6 @@ but_new_file:
|
||||
align 4
|
||||
open_file_data dd 0 ;㪠<><E3AAA0>⥫<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9><EFBFBD>
|
||||
open_file_size dd 0 ;ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>⮣<EFBFBD> 䠩<><E4A0A9>
|
||||
open_b rb 560
|
||||
open_file_ogl dd 0 ;<3B><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD> <20>࠭<EFBFBD><E0A0AD> <20><><EFBFBD>ᥫ<EFBFBD><E1A5AB> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> opengl
|
||||
v_zoom dd 0
|
||||
|
||||
@@ -475,16 +421,14 @@ pushad
|
||||
je .end_open_file
|
||||
;<3B><><EFBFBD> <20><><EFBFBD> 㤠筮<E3A4A0> <20><><EFBFBD><EFBFBD><EFBFBD>⨨ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mov eax,70 ;70-<2D> <20>㭪<EFBFBD><E3ADAA><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD>
|
||||
mov [run_file_70.Function], 5
|
||||
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
|
||||
mov ebx,run_file_70
|
||||
int 0x40
|
||||
mcall SF_FILE,run_file_70
|
||||
|
||||
;mov eax,dword[open_b+32]
|
||||
;mov edi,txt_buf
|
||||
@@ -495,21 +439,19 @@ pushad
|
||||
stdcall mem.ReAlloc,[open_file_data],ecx
|
||||
mov [open_file_data],eax
|
||||
|
||||
mov eax,70 ;70-<2D> <20>㭪<EFBFBD><E3ADAA><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD>
|
||||
mov [run_file_70.Function], 0
|
||||
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
|
||||
mov ebx,run_file_70
|
||||
int 0x40 ;<3B><><EFBFBD><EFBFBD>㦠<EFBFBD><E3A6A0> 䠩<> <20><><EFBFBD><EFBFBD>ࠦ<EFBFBD><E0A0A6><EFBFBD><EFBFBD>
|
||||
mcall SF_FILE,run_file_70
|
||||
cmp ebx,0xffffffff
|
||||
je .end_open_file
|
||||
|
||||
mov [open_file_size],ebx
|
||||
mcall 71,1,openfile_path
|
||||
mcall SF_SET_CAPTION,1,openfile_path
|
||||
|
||||
mov eax,[open_file_data]
|
||||
movzx eax,byte[eax]
|
||||
@@ -624,22 +566,19 @@ but_save_file:
|
||||
je .end_save_file
|
||||
;<3B><><EFBFBD> <20><><EFBFBD> 㤠筮<E3A4A0> <20><><EFBFBD><EFBFBD><EFBFBD>⨨ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
mov eax,70 ;70-<2D> <20>㭪<EFBFBD><E3ADAA><EFBFBD> ࠡ<><E0A0A1><EFBFBD> <20> 䠩<><E4A0A9><EFBFBD><EFBFBD>
|
||||
mov [run_file_70.Function], 2
|
||||
mov [run_file_70.Function], SSF_CREATE_FILE
|
||||
mov [run_file_70.Position], 0
|
||||
mov [run_file_70.Flags], 0
|
||||
mov ebx, dword[open_file_data]
|
||||
;<3B><>襬 <20> 䠩<> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⠡
|
||||
mov edx,dword[v_zoom]
|
||||
mov byte[ebx],dl
|
||||
;
|
||||
mov [run_file_70.Buffer], ebx
|
||||
mov ebx,[open_file_size]
|
||||
mov dword[run_file_70.Count], ebx ;ࠧ<><E0A0A7><EFBFBD> 䠩<><E4A0A9>
|
||||
mov byte[run_file_70+20], 0
|
||||
mov dword[run_file_70.FileName], openfile_path
|
||||
mov ebx,run_file_70
|
||||
int 0x40 ;<3B><><EFBFBD>࠭塞 䠩<>
|
||||
mcall SF_FILE,run_file_70
|
||||
;cmp ebx,0xffffffff
|
||||
;je .end_save_file
|
||||
; ... ᮮ<>饭<EFBFBD><E9A5AD> <20> <20><>㤠筮<E3A4A0> <20><><EFBFBD>࠭<EFBFBD><E0A0AD><EFBFBD><EFBFBD> ...
|
||||
@@ -799,7 +738,7 @@ draw_3d:
|
||||
;<3B><> <20><><EFBFBD> <20><> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ᥪ<EFBFBD><E1A5AA><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>뫥<EFBFBD><EBABA5><EFBFBD> <20><> <20>।<EFBFBD><E0A5A4><EFBFBD> <20><><EFBFBD><EFBFBD>⥩ <20><><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD>
|
||||
;<3B> <20><><EFBFBD>ᨨ opengl <20><><EFBFBD> Win <20><><EFBFBD>न<EFBFBD><E0A4A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> -1.0 <20><> 1.0 <20><>⮬<EFBFBD> ⠬ <20>⮣<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20>㦭<EFBFBD>
|
||||
stdcall [glScalef], [scale], [scale], [scale] ;㢥<><E3A2A5>稢<EFBFBD><E7A8A2><EFBFBD> <20><><EFBFBD>ᥫ<EFBFBD><E1A5AB><EFBFBD><EFBFBD> <20><>ꥪ<EFBFBD>, <20><><EFBFBD>-<2D><> <20><> <20><><EFBFBD> <20>祭<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>쪨<EFBFBD>
|
||||
stdcall [glScalef], 1.0, 1.0, 0.5 ;<3B><><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD> <20><>ꥪ<EFBFBD><EAA5AA> <20><> <20>뫠<EFBFBD><EBABA0><EFBFBD><EFBFBD> <20><> <20>࠭<EFBFBD> <20><><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD>
|
||||
stdcall [glScalef], 1.0, 1.0, 0.25 ;<3B><><EFBFBD>-<2D><> <20><><EFBFBD><EFBFBD> <20><>ꥪ<EFBFBD><EAA5AA> <20><> <20>뫠<EFBFBD><EBABA0><EFBFBD><EFBFBD> <20><> <20>࠭<EFBFBD> <20><><EFBFBD><EFBFBD>祭<EFBFBD><E7A5AD>
|
||||
stdcall [glRotatef], [angle_x],1.0,0.0,0.0
|
||||
stdcall [glRotatef], [angle_y],0.0,1.0,0.0
|
||||
stdcall [glRotatef], [angle_z],0.0,0.0,1.0
|
||||
@@ -915,6 +854,11 @@ lib_name_2 db 'buf2d.obj',0
|
||||
err_msg_found_lib_2 db '<27><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> ',39,'buf2d.obj',39,0
|
||||
err_msg_import_2 db '<27>訡<EFBFBD><E8A8A1> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> ',39,'buf2d',39,0
|
||||
|
||||
system_dir_3 db '/kolibrios/lib/'
|
||||
lib_name_3 db 'tinygl.obj',0
|
||||
err_msg_found_lib_3 db '<27><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> ',39,'tinygl.obj',39,0
|
||||
err_msg_import_3 db '<27>訡<EFBFBD><E8A8A1> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> ',39,'tinygl',39,0
|
||||
|
||||
l_libs_start:
|
||||
lib_0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
|
||||
err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i
|
||||
@@ -1049,13 +993,6 @@ macro E_LIB n
|
||||
}
|
||||
include '../../../../programs/develop/libraries/TinyGL/asm_fork/export.inc'
|
||||
|
||||
;--------------------------------------------------
|
||||
system_dir_3 db '/sys/lib/'
|
||||
lib_name_3 db 'tinygl.obj',0
|
||||
err_msg_found_lib_3 db '<27><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> ',39,'tinygl.obj',39,0
|
||||
err_msg_import_3 db '<27>訡<EFBFBD><E8A8A1> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> ',39,'tinygl',39,0
|
||||
;--------------------------------------------------
|
||||
|
||||
last_time dd 0
|
||||
|
||||
align 4
|
||||
|
Reference in New Issue
Block a user