Subversion Repositories Kolibri OS

Rev

Rev 5388 | Rev 6259 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5388 Rev 6175
1
use32
1
use32
2
	org 0x0
2
	org 0x0
3
	db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
3
	db 'MENUET01' ;¨¤¥­â¨ä. ¨á¯®«­ï¥¬®£® ä ©«  ¢á¥£¤  8 ¡ ©â
4
	dd 0x1
-
 
5
	dd start
-
 
6
	dd i_end ;à §¬¥à ¯à¨«®¦¥­¨ï
4
	dd 1,start,i_end,mem,stacktop,0,sys_path
7
	dd mem
-
 
8
	dd stacktop
-
 
9
	dd 0
-
 
10
	dd sys_path
-
 
11
 
5
 
12
include '../../../../programs/macros.inc'
6
include '../../../../programs/macros.inc'
13
include '../../../../programs/proc32.inc'
7
include '../../../../programs/proc32.inc'
-
 
8
include '../../../../programs/KOSfuncs.inc'
14
include '../../../../programs/develop/libraries/box_lib/load_lib.mac'
9
include '../../../../programs/develop/libraries/box_lib/load_lib.mac'
15
include '../../../../programs/dll.inc'
10
include '../../../../programs/dll.inc'
16
include '../trunk/str.inc'
11
include '../trunk/str.inc'
17
 
12
 
18
vox_offs_tree_table equ 4
13
vox_offs_tree_table equ 4
19
vox_offs_data equ 12
14
vox_offs_data equ 12
20
txt_buf rb 8
15
txt_buf rb 8
21
include '../trunk/vox_rotate.inc'
16
include '../trunk/vox_rotate.inc'
22
 
17
 
23
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
18
@use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load
24
caption db 'Voxel creator 29.01.15',0 ;¯®¤¯¨áì ®ª­ 
19
caption db 'Voxel creator 08.02.16',0 ;¯®¤¯¨áì ®ª­ 
25
 
20
 
26
struct FileInfoBlock
21
struct FileInfoBlock
27
	Function dd ?
22
	Function dd ?
28
	Position dd ?
23
	Position dd ?
29
	Flags	 dd ?
24
	Flags	 dd ?
30
	Count	 dd ?
25
	Count	 dd ?
31
	Buffer	 dd ?
26
	Buffer	 dd ?
32
		db ?
27
		db ?
33
	FileName dd ?
28
	FileName dd ?
34
ends
29
ends
35
 
30
 
36
BUF_STRUCT_SIZE equ 21
31
BUF_STRUCT_SIZE equ 21
37
buf2d_data equ dword[edi] ;¤ ­­ë¥ ¡ãä¥à  ¨§®¡à ¦¥­¨ï
32
buf2d_data equ dword[edi] ;¤ ­­ë¥ ¡ãä¥à  ¨§®¡à ¦¥­¨ï
38
buf2d_w equ dword[edi+8] ;è¨à¨­  ¡ãä¥à 
33
buf2d_w equ dword[edi+8] ;è¨à¨­  ¡ãä¥à 
39
buf2d_h equ dword[edi+12] ;¢ëá®â  ¡ãä¥à 
34
buf2d_h equ dword[edi+12] ;¢ëá®â  ¡ãä¥à 
40
buf2d_l equ word[edi+4]
35
buf2d_l equ word[edi+4]
41
buf2d_t equ word[edi+6] ;®âáâ㯠ᢥàåã
36
buf2d_t equ word[edi+6] ;®âáâ㯠ᢥàåã
42
buf2d_size_lt equ dword[edi+4] ;®âáâ㯠᫥¢  ¨ á¯à ¢  ¤«ï ¡ãä¥à 
37
buf2d_size_lt equ dword[edi+4] ;®âáâ㯠᫥¢  ¨ á¯à ¢  ¤«ï ¡ãä¥à 
43
buf2d_color equ dword[edi+16] ;梥â ä®­  ¡ãä¥à 
38
buf2d_color equ dword[edi+16] ;梥â ä®­  ¡ãä¥à 
44
buf2d_bits equ byte[edi+20] ;ª®«¨ç¥á⢮ ¡¨â ¢ 1-© â®çª¥ ¨§®¡à ¦¥­¨ï
39
buf2d_bits equ byte[edi+20] ;ª®«¨ç¥á⢮ ¡¨â ¢ 1-© â®çª¥ ¨§®¡à ¦¥­¨ï
45
 
40
 
46
vox_offs_tree_table equ 4
41
vox_offs_tree_table equ 4
47
vox_offs_data equ 12
42
vox_offs_data equ 12
48
 
43
 
49
run_file_70 FileInfoBlock
44
run_file_70 FileInfoBlock
50
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
45
image_data dd 0 ;㪠§ â¥«ì ­  ¢à¥¬¥­­ãî ¯ ¬ïâì. ¤«ï ­ã¦¥­ ¯à¥®¡à §®¢ ­¨ï ¨§®¡à ¦¥­¨ï
51
vox_obj_size dd 0 ;à §¬¥à ¢®ªá¥«ì­®£® ®¡ê¥ªâ  (¤«ï ã᪮७¨ï ¢áâ ¢ª¨)
46
vox_obj_size dd 0 ;à §¬¥à ¢®ªá¥«ì­®£® ®¡ê¥ªâ  (¤«ï ã᪮७¨ï ¢áâ ¢ª¨)
52
txt_space db ' ',0
47
txt_space db ' ',0
53
txt_pref db ' ¡ ',0,' Š¡',0,' Œ¡',0,' ƒ¡',0 ;¯à¨áâ ¢ª¨: ª¨«®, ¬¥£ , £¨£ 
48
txt_pref db ' ¡ ',0,' Š¡',0,' Œ¡',0,' ƒ¡',0 ;¯à¨áâ ¢ª¨: ª¨«®, ¬¥£ , £¨£ 
54
txt_f_size: db ' §¬¥à: '
49
txt_f_size: db ' §¬¥à: '
55
.size: rb 16
50
.size: rb 16
56
 
51
 
57
fn_toolbar db 'toolbar.png',0
52
fn_toolbar db 'toolbar.png',0
58
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
53
IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3
59
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*9
54
IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*9
60
image_data_toolbar dd 0
55
image_data_toolbar dd 0
61
 
56
 
62
max_open_file_size equ 1024*1024 ;1 Mb
57
max_open_file_size equ 1024*1024 ;1 Mb
63
 
58
 
64
macro load_image_file path,buf,size { ;¬ ªà®á ¤«ï § £à㧪¨ ¨§®¡à ¦¥­¨©
59
macro load_image_file path,buf,size { ;¬ ªà®á ¤«ï § £à㧪¨ ¨§®¡à ¦¥­¨©
65
	;path - ¬®¦¥â ¡ëâì ¯¥à¥¬¥­­®© ¨«¨ áâப®¢ë¬ ¯ à ¬¥â஬
60
	;path - ¬®¦¥â ¡ëâì ¯¥à¥¬¥­­®© ¨«¨ áâப®¢ë¬ ¯ à ¬¥â஬
66
	if path eqtype '' ;¯à®¢¥à塞 § ¤ ­ «¨ áâப®© ¯ à ¬¥âà path
61
	if path eqtype '' ;¯à®¢¥à塞 § ¤ ­ «¨ áâப®© ¯ à ¬¥âà path
67
		jmp @f
62
		jmp @f
68
			local .path_str
63
			local .path_str
69
			.path_str db path ;ä®à¬¨à㥬 «®ª «ì­ãî ¯¥à¥¬¥­­ãî
64
			.path_str db path ;ä®à¬¨à㥬 «®ª «ì­ãî ¯¥à¥¬¥­­ãî
70
			db 0
65
			db 0
71
		@@:
66
		@@:
72
		;32 - áâ ­¤ àâ­ë©  ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥­ ¡ëâì ¡ãä¥à á á¨á⥬­ë¬ ¯ã⥬
67
		;32 - áâ ­¤ àâ­ë©  ¤à¥á ¯® ª®â®à®¬ã ¤®«¦¥­ ¡ëâì ¡ãä¥à á á¨á⥬­ë¬ ¯ã⥬
73
		copy_path .path_str,[32],file_name,0x0
68
		copy_path .path_str,[32],file_name,0
74
	else
69
	else
75
		copy_path path,[32],file_name,0x0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
70
		copy_path path,[32],file_name,0 ;ä®à¬¨à㥬 ¯®«­ë© ¯ãâì ª ä ©«ã ¨§®¡à ¦¥­¨ï, ¯®¤à §ã¬¥¢ ¥¬ çâ® ®­ ¢ ®¤­®© ¯ ¯ª¥ á ¯à®£à ¬¬®©
76
	end if
71
	end if
77
 
72
 
78
	stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
73
	stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
79
	mov [buf],eax
74
	mov [buf],eax
80
 
-
 
81
	mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
75
 
82
	mov [run_file_70.Function], 0
76
	mov [run_file_70.Function], SSF_READ_FILE
83
	mov [run_file_70.Position], 0
77
	mov [run_file_70.Position], 0
84
	mov [run_file_70.Flags], 0
78
	mov [run_file_70.Flags], 0
85
	mov [run_file_70.Count], dword size
79
	mov [run_file_70.Count], dword size
86
	m2m [run_file_70.Buffer], [buf]
80
	mov [run_file_70.Buffer], eax
87
	mov byte[run_file_70+20], 0
81
	mov byte[run_file_70+20], 0
88
	mov [run_file_70.FileName], file_name
82
	mov [run_file_70.FileName], file_name
89
	mov ebx,run_file_70
-
 
90
	int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
83
	mcall SF_FILE,run_file_70 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
91
	cmp ebx,0xffffffff
84
	cmp ebx,0xffffffff
92
	je @f
85
	je @f
93
		;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
86
		;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
94
		stdcall dword[img_decode], dword[buf],ebx,0
87
		stdcall dword[img_decode], dword[buf],ebx,0
95
		mov dword[image_data],eax
88
		mov dword[image_data],eax
96
		;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
89
		;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
97
		stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
90
		stdcall dword[img_to_rgb2], dword[image_data],dword[buf]
98
		;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
91
		;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
99
		stdcall dword[img_destroy], dword[image_data]
92
		stdcall dword[img_destroy], dword[image_data]
100
	@@:
93
	@@:
101
}
94
}
102
 
95
 
103
 
96
 
104
 
97
 
105
align 4
98
align 4
106
start:
99
start:
107
	load_libraries l_libs_start,l_libs_end
100
	load_libraries l_libs_start,l_libs_end
108
	;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ¡¨¡«¨®â¥ª 
101
	;¯à®¢¥àª  ­  ᪮«ìª® 㤠筮 § £ã§¨« áì ¡¨¡«¨®â¥ª 
109
	mov	ebp,lib_0
102
	mov	ebp,lib_0
110
	cmp	dword [ebp+ll_struc_size-4],0
103
	cmp	dword [ebp+ll_struc_size-4],0
111
	jz	@f
104
	jz	@f
112
		mcall -1 ;exit not correct
105
		mcall SF_TERMINATE_PROCESS
113
	@@:
106
	@@:
114
	mcall 48,3,sc,sizeof.system_colors
107
	mcall SF_STYLE_SETTINGS,SSF_GET_COLORS,sc,sizeof.system_colors
115
	mcall 40,0x27
108
	mcall SF_SET_EVENTS_MASK,0x27
116
	stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
109
	stdcall [OpenDialog_Init],OpenDialog_data ;¯®¤£®â®¢ª  ¤¨ «®£ 
117
 
110
 
118
	stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à 
111
	stdcall [buf2d_create], buf_0 ;ᮧ¤ ­¨¥ ¡ãä¥à 
119
	stdcall [buf2d_create], buf_0z
112
	stdcall [buf2d_create], buf_0z
120
	stdcall [buf2d_vox_brush_create], buf_vox, vox_6_7_z
113
	stdcall [buf2d_vox_brush_create], buf_vox, vox_6_7_z
121
 
114
 
122
	load_image_file fn_toolbar, image_data_toolbar,IMAGE_TOOLBAR_SIZE
115
	load_image_file fn_toolbar, image_data_toolbar,IMAGE_TOOLBAR_SIZE
123
 
116
 
124
	stdcall mem.Alloc,max_open_file_size
117
	stdcall mem.Alloc,max_open_file_size
125
	mov dword[open_file_vox],eax
118
	mov dword[open_file_vox],eax
126
	stdcall mem.Alloc,max_open_file_size
119
	stdcall mem.Alloc,max_open_file_size
127
	mov dword[open_file_img],eax
120
	mov dword[open_file_img],eax
128
 
121
 
129
	mcall 26,9
122
	mcall SF_SYSTEM_GET,SSF_TIME_COUNT
130
	mov [last_time],eax
123
	mov [last_time],eax
131
 
124
 
132
align 4
125
align 4
133
red_win:
126
red_win:
134
	call draw_window
127
	call draw_window
135
 
128
 
136
align 4
129
align 4
137
still:
130
still:
138
	mcall 26,9
131
	mcall SF_SYSTEM_GET,SSF_TIME_COUNT
139
	mov ebx,[last_time]
132
	mov ebx,[last_time]
140
	add ebx,10 ;§ ¤¥à¦ª 
133
	add ebx,10 ;§ ¤¥à¦ª 
141
	cmp ebx,eax
134
	cmp ebx,eax
142
	jge @f
135
	jge @f
143
		mov ebx,eax
136
		mov ebx,eax
144
	@@:
137
	@@:
145
	sub ebx,eax
138
	sub ebx,eax
146
	;cmp ebx,10 ;§ ¤¥à¦ª 
139
	mcall SF_WAIT_EVENT_TIMEOUT
147
	;ja timer_funct
-
 
148
	;test ebx,ebx
-
 
149
	;jz timer_funct
-
 
150
	mcall 23
-
 
151
	cmp eax,0
140
	cmp eax,0
152
	je timer_funct
141
	je timer_funct
153
 
142
 
154
	cmp al,1
143
	cmp al,1
155
	jz red_win
144
	jz red_win
156
	cmp al,2
145
	cmp al,2
157
	jz key
146
	jz key
158
	cmp al,3
147
	cmp al,3
159
	jz button
148
	jz button
160
 
149
 
161
	jmp still
150
	jmp still
162
 
151
 
163
align 4
152
align 4
164
timer_funct:
153
timer_funct:
165
	cmp byte[calc],0
154
	cmp byte[calc],0
166
	je still
155
	je still
167
 
156
 
168
	pushad
157
	pushad
169
	mcall 26,9
158
	mcall SF_SYSTEM_GET,SSF_TIME_COUNT
170
	mov [last_time],eax
159
	mov [last_time],eax
171
 
160
 
172
	; ᪨¤ë¢ ¥¬ 㪠§ â¥«¨ ¡ãä¥à®¢ buf_npl_p, buf_npl, buf_npl_n
161
	; ᪨¤ë¢ ¥¬ 㪠§ â¥«¨ ¡ãä¥à®¢ buf_npl_p, buf_npl, buf_npl_n
173
	mov edi,buf_npl_p
162
	mov edi,buf_npl_p
174
	mov eax,buf2d_data
163
	mov eax,buf2d_data
175
	mov edi,buf_npl
164
	mov edi,buf_npl
176
	mov ebx,buf2d_data
165
	mov ebx,buf2d_data
177
	mov edi,buf_npl_n
166
	mov edi,buf_npl_n
178
	mov ecx,buf2d_data
167
	mov ecx,buf2d_data
179
	; change buffer data pointers
168
	; change buffer data pointers
180
	mov buf2d_data,eax
169
	mov buf2d_data,eax
181
	mov edi,buf_npl_p
170
	mov edi,buf_npl_p
182
	mov buf2d_data,ebx
171
	mov buf2d_data,ebx
183
	mov edi,buf_npl
172
	mov edi,buf_npl
184
	mov buf2d_data,ecx
173
	mov buf2d_data,ecx
185
 
174
 
186
	mov eax,[n_plane]
175
	mov eax,[n_plane]
187
	mov ebx,buf2d_w
176
	mov ebx,buf2d_w
188
	dec ebx
177
	dec ebx
189
 
178
 
190
	cmp ebx,eax
179
	cmp ebx,eax
191
	jg @f
180
	jg @f
192
		stdcall create_obj_from_plane,buf_npl,eax ;ᮧ¤ ¥¬ § ¢¥àè î饥 á¥ç¥­¨¥
181
		stdcall create_obj_from_plane,buf_npl,eax ;ᮧ¤ ¥¬ § ¢¥àè î饥 á¥ç¥­¨¥
193
		;¢ë¢®¤ ª®­¥ç­®£® १ã«ìâ â 
182
		;¢ë¢®¤ ª®­¥ç­®£® १ã«ìâ â 
194
		call draw_object
183
		call draw_object
195
		mov byte[calc],0
184
		mov byte[calc],0
196
		jmp .end_f
185
		jmp .end_f
197
	@@:
186
	@@:
198
 
187
 
199
	inc eax
188
	inc eax
200
	stdcall create_plane, buf_npl_n,eax
189
	stdcall create_plane, buf_npl_n,eax
201
 
190
 
202
	; ᮧ¤ ­¨¥ ¢®áª¥«ì­®£® á¥ç¥­¨ï ­  ®á­®¢¥ ¡ãä¥à  buf_npl
191
	; ᮧ¤ ­¨¥ ¢®áª¥«ì­®£® á¥ç¥­¨ï ­  ®á­®¢¥ ¡ãä¥à  buf_npl
203
	mov edi,buf_npl
192
	mov edi,buf_npl
204
	mov edx,[bby_min] ;0
193
	mov edx,[bby_min] ;0
205
	.cycle_0:
194
	.cycle_0:
206
	mov ecx,[btx_min] ;0
195
	mov ecx,[btx_min] ;0
207
	.cycle_1:
196
	.cycle_1:
208
		stdcall [buf2d_get_pixel], edi,ecx,edx
197
		stdcall [buf2d_get_pixel], edi,ecx,edx
209
		cmp eax,buf2d_color
198
		cmp eax,buf2d_color
210
		je @f
199
		je @f
211
			mov esi,eax
200
			mov esi,eax
212
			call need_node
201
			call need_node
213
			cmp eax,buf2d_color
202
			cmp eax,buf2d_color
214
			jne @f ;®âᥨ¢ ¥¬ ¢­ãâ७­¨¥ ¢®ªá¥«¨, ¤«ï ®¯â¨¬¨§ æ¨¨ ¬®¤¥«¨
203
			jne @f ;®âᥨ¢ ¥¬ ¢­ãâ७­¨¥ ¢®ªá¥«¨, ¤«ï ®¯â¨¬¨§ æ¨¨ ¬®¤¥«¨
215
			mov eax,ebx
204
			mov eax,ebx
216
			sub eax,edx
205
			sub eax,edx
217
			stdcall buf2d_vox_obj_create_node, [open_file_vox],ecx,[n_plane],\
206
			stdcall buf2d_vox_obj_create_node, [open_file_vox],ecx,[n_plane],\
218
				eax,[k_scale],esi
207
				eax,[k_scale],esi
219
		@@:
208
		@@:
220
		inc ecx
209
		inc ecx
221
		cmp ecx,ebx
210
		cmp ecx,ebx
222
		jle .cycle_1
211
		jle .cycle_1
223
		inc edx
212
		inc edx
224
		cmp edx,ebx
213
		cmp edx,ebx
225
		jle .cycle_0
214
		jle .cycle_0
226
 
215
 
227
	stdcall [buf2d_draw], buf_npl
216
	stdcall [buf2d_draw], buf_npl
228
	inc dword[n_plane] ;¯¥à¥¬¥é ¥¬ ¯«®áª®áâì á¥ç¥­¨ï
217
	inc dword[n_plane] ;¯¥à¥¬¥é ¥¬ ¯«®áª®áâì á¥ç¥­¨ï
229
	call draw_pok
218
	call draw_pok
230
	.end_f:
219
	.end_f:
231
	popad
220
	popad
232
	jmp still
221
	jmp still
233
 
222
 
234
align 4
223
align 4
235
proc create_plane, buf_img:dword, n_plane:dword
224
proc create_plane, buf_img:dword, n_plane:dword
236
	pushad
225
	pushad
237
	; ª®¯¨à㥬 «¨æ¥¢®¥ ¨§®¡à ¦¥­¨¥ ¢ ¡ãä¥à buf_img
226
	; ª®¯¨à㥬 «¨æ¥¢®¥ ¨§®¡à ¦¥­¨¥ ¢ ¡ãä¥à buf_img
238
	; bby_min - ¨á¯®«ì§ã¥¬ ¤«ï ®¯â¨¬¨§ æ¨¨ (¥á«¨ ᢥàåã ¨§®¡à ¦¥­¨¥ ¯ãá⮥)
227
	; bby_min - ¨á¯®«ì§ã¥¬ ¤«ï ®¯â¨¬¨§ æ¨¨ (¥á«¨ ᢥàåã ¨§®¡à ¦¥­¨¥ ¯ãá⮥)
239
	mov eax,[bby_min]
228
	mov eax,[bby_min]
240
	mov esi,buf_i2
229
	mov esi,buf_i2
241
	mov esi,[esi] ;buf2d_data
230
	mov esi,[esi] ;buf2d_data
242
	mov edi,[buf_img]
231
	mov edi,[buf_img]
243
	mov ecx,buf2d_w
232
	mov ecx,buf2d_w
244
	imul eax,ecx
233
	imul eax,ecx
245
	mov ebx,ecx
234
	mov ebx,ecx
246
	imul ecx,ebx
235
	imul ecx,ebx
247
	sub ecx,eax
236
	sub ecx,eax
248
	lea ecx,[ecx+ecx*2]
237
	lea ecx,[ecx+ecx*2]
249
	mov edi,buf2d_data
238
	mov edi,buf2d_data
250
	lea eax,[eax+eax*2]
239
	lea eax,[eax+eax*2]
251
	add edi,eax
240
	add edi,eax
252
	add esi,eax
241
	add esi,eax
253
	cld
242
	cld
254
	rep movsb
243
	rep movsb
255
 
244
 
256
	mov ecx,ebx
245
	mov ecx,ebx
257
	dec ebx
246
	dec ebx
258
	mov edi,buf_i0
247
	mov edi,buf_i0
259
	.cycle_0:
248
	.cycle_0:
260
		mov eax,ebx
249
		mov eax,ebx
261
		sub eax,[n_plane] ;eax - ¯¥à¥¢¥à­ãâ ï ª®®à¤¨­ â  n_plane
250
		sub eax,[n_plane] ;eax - ¯¥à¥¢¥à­ãâ ï ª®®à¤¨­ â  n_plane
262
		stdcall [buf2d_get_pixel], edi,ecx,eax ;[n_plane]
251
		stdcall [buf2d_get_pixel], edi,ecx,eax ;[n_plane]
263
		cmp eax,buf2d_color
252
		cmp eax,buf2d_color
264
		jne @f
253
		jne @f
265
			;¢ëç¥àª¨¢ ­¨¥ ¢¥à⨪ «ì­®© «¨­¨¨ ¨§ á¥ç¥­¨ï buf_img
254
			;¢ëç¥àª¨¢ ­¨¥ ¢¥à⨪ «ì­®© «¨­¨¨ ¨§ á¥ç¥­¨ï buf_img
266
			stdcall [buf2d_line], [buf_img],ecx,[bby_min],ecx,ebx, buf2d_color
255
			stdcall [buf2d_line], [buf_img],ecx,[bby_min],ecx,ebx, buf2d_color
267
			jmp .end_1
256
			jmp .end_1
268
		@@:
257
		@@:
269
			mov edx,[bby_min] ;xor edx,edx
258
			mov edx,[bby_min] ;xor edx,edx
270
			mov esi,eax
259
			mov esi,eax
271
			.cycle_1: ;横« ¤«ï ­ «®¦¥­¨ï ¢¥àå­¥© ⥪áâãàë
260
			.cycle_1: ;横« ¤«ï ­ «®¦¥­¨ï ¢¥àå­¥© ⥪áâãàë
272
			stdcall [buf2d_get_pixel], [buf_img],ecx,edx
261
			stdcall [buf2d_get_pixel], [buf_img],ecx,edx
273
			cmp eax, buf2d_color
262
			cmp eax, buf2d_color
274
			je .end_0
263
			je .end_0
275
				stdcall [buf2d_set_pixel], [buf_img],ecx,edx, esi ;­ «®¦¥­¨¥ ¢¥àå­¥© ⥪áâãàë
264
				stdcall [buf2d_set_pixel], [buf_img],ecx,edx, esi ;­ «®¦¥­¨¥ ¢¥àå­¥© ⥪áâãàë
276
				jmp .end_1
265
				jmp .end_1
277
			.end_0:
266
			.end_0:
278
			inc edx
267
			inc edx
279
			cmp edx,ebx
268
			cmp edx,ebx
280
			jle .cycle_1
269
			jle .cycle_1
281
		.end_1:
270
		.end_1:
282
		loop .cycle_0
271
		loop .cycle_0
283
 
272
 
284
	;£®à¨§®­â «ì­ë¥ «¨­¨¨ ­  ®á­®¢¥ ¡®ª®¢®© £à ­¨
273
	;£®à¨§®­â «ì­ë¥ «¨­¨¨ ­  ®á­®¢¥ ¡®ª®¢®© £à ­¨
285
	mov ecx,[bby_min]
274
	mov ecx,[bby_min]
286
	mov edi,buf_i1
275
	mov edi,buf_i1
287
	.cycle_2:
276
	.cycle_2:
288
		stdcall [buf2d_get_pixel], edi,[n_plane],ecx
277
		stdcall [buf2d_get_pixel], edi,[n_plane],ecx
289
		cmp eax,buf2d_color
278
		cmp eax,buf2d_color
290
		jne @f
279
		jne @f
291
			;¢ëç¥àª¨¢ ­¨¥ £®à¨§®­â «ì­®© «¨­¨¨ ¨§ á¥ç¥­¨ï buf_img
280
			;¢ëç¥àª¨¢ ­¨¥ £®à¨§®­â «ì­®© «¨­¨¨ ¨§ á¥ç¥­¨ï buf_img
292
			stdcall [buf2d_line], [buf_img],[btx_min],ecx,[btx_max],ecx, buf2d_color
281
			stdcall [buf2d_line], [buf_img],[btx_min],ecx,[btx_max],ecx, buf2d_color
293
			jmp .end_3
282
			jmp .end_3
294
		@@:
283
		@@:
295
			mov edx,[btx_max] ;ebx
284
			mov edx,[btx_max] ;ebx
296
			mov esi,eax
285
			mov esi,eax
297
			.cycle_3: ;横« ¤«ï ­ «®¦¥­¨ï ¡®ª®¢®© ⥪áâãàë
286
			.cycle_3: ;横« ¤«ï ­ «®¦¥­¨ï ¡®ª®¢®© ⥪áâãàë
298
			stdcall [buf2d_get_pixel], [buf_img],edx,ecx
287
			stdcall [buf2d_get_pixel], [buf_img],edx,ecx
299
			cmp eax, buf2d_color
288
			cmp eax, buf2d_color
300
			je .end_2
289
			je .end_2
301
				stdcall [buf2d_set_pixel], [buf_img],edx,ecx, esi ;­ «®¦¥­¨¥ ¡®ª®¢®© ⥪áâãàë
290
				stdcall [buf2d_set_pixel], [buf_img],edx,ecx, esi ;­ «®¦¥­¨¥ ¡®ª®¢®© ⥪áâãàë
302
				jmp .end_3
291
				jmp .end_3
303
			.end_2:
292
			.end_2:
304
			dec edx
293
			dec edx
305
			cmp edx,[btx_min]
294
			cmp edx,[btx_min]
306
			jge .cycle_3
295
			jge .cycle_3
307
		.end_3:
296
		.end_3:
308
		inc ecx
297
		inc ecx
309
		cmp ecx,ebx
298
		cmp ecx,ebx
310
		jle .cycle_2
299
		jle .cycle_2
311
	popad
300
	popad
312
	ret
301
	ret
313
endp
302
endp
314
 
303
 
315
align 4
304
align 4
316
proc create_obj_from_plane, buf_img:dword, n_plane:dword
305
proc create_obj_from_plane, buf_img:dword, n_plane:dword
317
pushad
306
pushad
318
	; ᮧ¤ ­¨¥ ¢®áª¥«ì­®£® á¥ç¥­¨ï ­  ®á­®¢¥ ¡ãä¥à  buf_img
307
	; ᮧ¤ ­¨¥ ¢®áª¥«ì­®£® á¥ç¥­¨ï ­  ®á­®¢¥ ¡ãä¥à  buf_img
319
	mov edi,[buf_img]
308
	mov edi,[buf_img]
320
	mov ebx,buf2d_w
309
	mov ebx,buf2d_w
321
	dec ebx
310
	dec ebx
322
	mov edx,[bby_min] ;0
311
	mov edx,[bby_min] ;0
323
	.cycle_0:
312
	.cycle_0:
324
	mov ecx,[btx_min] ;0
313
	mov ecx,[btx_min] ;0
325
	.cycle_1:
314
	.cycle_1:
326
		stdcall [buf2d_get_pixel], edi,ecx,edx
315
		stdcall [buf2d_get_pixel], edi,ecx,edx
327
		cmp eax,buf2d_color
316
		cmp eax,buf2d_color
328
		je @f
317
		je @f
329
			mov esi,eax
318
			mov esi,eax
330
			;call need_node
319
			;call need_node
331
			;cmp eax,buf2d_color
320
			;cmp eax,buf2d_color
332
			;jne @f ;®âᥨ¢ ¥¬ ¢­ãâ७­¨¥ ¢®ªá¥«¨, ¤«ï ®¯â¨¬¨§ æ¨¨ ¬®¤¥«¨
321
			;jne @f ;®âᥨ¢ ¥¬ ¢­ãâ७­¨¥ ¢®ªá¥«¨, ¤«ï ®¯â¨¬¨§ æ¨¨ ¬®¤¥«¨
333
			mov eax,ebx
322
			mov eax,ebx
334
			sub eax,edx
323
			sub eax,edx
335
			stdcall buf2d_vox_obj_create_node, [open_file_vox],ecx,[n_plane],\
324
			stdcall buf2d_vox_obj_create_node, [open_file_vox],ecx,[n_plane],\
336
				eax,[k_scale],esi
325
				eax,[k_scale],esi
337
		@@:
326
		@@:
338
		inc ecx
327
		inc ecx
339
		cmp ecx,ebx
328
		cmp ecx,ebx
340
		jle .cycle_1
329
		jle .cycle_1
341
		inc edx
330
		inc edx
342
		cmp edx,ebx
331
		cmp edx,ebx
343
		jle .cycle_0
332
		jle .cycle_0
344
	ret
333
	ret
345
popad
334
popad
346
endp
335
endp
347
 
336
 
348
;description:
337
;description:
349
; äã­ªæ¨ï ¯à®¢¥àï¥â ­ã¦­® «¨ ®âᥨ¢ âì ¢®ªá¥«ì á ª®®à¤¨­ â ¬¨ [n_plane],ecx,edx
338
; äã­ªæ¨ï ¯à®¢¥àï¥â ­ã¦­® «¨ ®âᥨ¢ âì ¢®ªá¥«ì á ª®®à¤¨­ â ¬¨ [n_plane],ecx,edx
350
;input:
339
;input:
351
; ebx = max size y - 1
340
; ebx = max size y - 1
352
;output:
341
;output:
353
; eax = buf2d_color if node need
342
; eax = buf2d_color if node need
354
align 4
343
align 4
355
need_node:
344
need_node:
356
	mov eax,buf2d_color
345
	mov eax,buf2d_color
357
	cmp ecx,[btx_min] ;0
346
	cmp ecx,[btx_min] ;0
358
	jle .end_f
347
	jle .end_f
359
	cmp ecx,[btx_max] ;0
348
	cmp ecx,[btx_max] ;0
360
	jge .end_f
349
	jge .end_f
361
	cmp edx,[bby_min] ;0
350
	cmp edx,[bby_min] ;0
362
	jle .end_f
351
	jle .end_f
363
	cmp edx,ebx ;max-1
352
	cmp edx,ebx ;max-1
364
	jge .end_f
353
	jge .end_f
365
		push ecx edx
354
		push ecx edx
366
		stdcall [buf2d_get_pixel], buf_npl_p,ecx,edx ;¯à®¢¥àª  ¯à¥¤ë¤ã饣® á¥ç¥­¨ï
355
		stdcall [buf2d_get_pixel], buf_npl_p,ecx,edx ;¯à®¢¥àª  ¯à¥¤ë¤ã饣® á¥ç¥­¨ï
367
		cmp eax,buf2d_color
356
		cmp eax,buf2d_color
368
		je @f
357
		je @f
369
		stdcall [buf2d_get_pixel], buf_npl_n,ecx,edx ;¯à®¢¥àª  ¯®á«¥¤ãî饣® á¥ç¥­¨ï
358
		stdcall [buf2d_get_pixel], buf_npl_n,ecx,edx ;¯à®¢¥àª  ¯®á«¥¤ãî饣® á¥ç¥­¨ï
370
		cmp eax,buf2d_color
359
		cmp eax,buf2d_color
371
		je @f
360
		je @f
372
		dec ecx
361
		dec ecx
373
		stdcall [buf2d_get_pixel], edi,ecx,edx
362
		stdcall [buf2d_get_pixel], edi,ecx,edx
374
		cmp eax,buf2d_color
363
		cmp eax,buf2d_color
375
		je @f
364
		je @f
376
		add ecx,2
365
		add ecx,2
377
		stdcall [buf2d_get_pixel], edi,ecx,edx
366
		stdcall [buf2d_get_pixel], edi,ecx,edx
378
		cmp eax,buf2d_color
367
		cmp eax,buf2d_color
379
		je @f
368
		je @f
380
		dec ecx
369
		dec ecx
381
		dec edx
370
		dec edx
382
		stdcall [buf2d_get_pixel], edi,ecx,edx
371
		stdcall [buf2d_get_pixel], edi,ecx,edx
383
		cmp eax,buf2d_color
372
		cmp eax,buf2d_color
384
		je @f
373
		je @f
385
		add edx,2
374
		add edx,2
386
		stdcall [buf2d_get_pixel], edi,ecx,edx
375
		stdcall [buf2d_get_pixel], edi,ecx,edx
387
		;cmp eax,buf2d_color
376
		;cmp eax,buf2d_color
388
		;je @f
377
		;je @f
389
		@@:
378
		@@:
390
		pop edx ecx
379
		pop edx ecx
391
	.end_f:
380
	.end_f:
392
	ret
381
	ret
393
 
382
 
394
align 4
383
align 4
395
draw_window:
384
draw_window:
396
pushad
385
pushad
397
	mcall 12,1
386
	mcall SF_REDRAW,SSF_BEGIN_DRAW
398
 
387
 
399
	; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
-
 
400
	xor eax,eax
388
	; *** à¨á®¢ ­¨¥ £« ¢­®£® ®ª­  (¢ë¯®«­ï¥âáï 1 à § ¯à¨ § ¯ã᪥) ***
401
	mov edx,[sc.work]
389
	mov edx,[sc.work]
402
	or  edx,(3 shl 24)+0x30000000
390
	or  edx,(3 shl 24)+0x30000000
403
	mcall ,(20 shl 16)+410,(20 shl 16)+520,,,caption
391
	mcall SF_CREATE_WINDOW,(20 shl 16)+410,(20 shl 16)+520,,,caption
404
 
392
 
405
	; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
393
	; *** ᮧ¤ ­¨¥ ª­®¯®ª ­  ¯ ­¥«ì ***
406
	mov esi,[sc.work_button]
394
	mov esi,[sc.work_button]
407
	mcall 8,(5 shl 16)+20,(5 shl 16)+20,3
395
	mcall SF_DEFINE_BUTTON,(5 shl 16)+20,(5 shl 16)+20,3
408
 
396
 
409
	mov ebx,(30 shl 16)+20
397
	mov ebx,(30 shl 16)+20
410
	mov edx,4
398
	mov edx,4
411
	int 0x40
399
	int 0x40
412
 
400
 
413
	mov ebx,(55 shl 16)+20
401
	mov ebx,(55 shl 16)+20
414
	mov edx,5
402
	mov edx,5
415
	int 0x40
403
	int 0x40
416
 
404
 
417
	mov ebx,(85 shl 16)+20
405
	mov ebx,(85 shl 16)+20
418
	mov edx,6
406
	mov edx,6
419
	int 0x40
407
	int 0x40
420
 
408
 
421
	add ebx,25 shl 16
409
	add ebx,25 shl 16
422
	mov edx,7
410
	mov edx,7
423
	int 0x40
411
	int 0x40
424
 
412
 
425
	add ebx,25 shl 16
413
	add ebx,25 shl 16
426
	mov edx,8
414
	mov edx,8
427
	int 0x40
415
	int 0x40
428
 
416
 
429
	add ebx,25 shl 16
417
	add ebx,25 shl 16
430
	mov edx,9
418
	mov edx,9
431
	int 0x40
419
	int 0x40
432
 
420
 
433
	add ebx,25 shl 16
421
	add ebx,25 shl 16
434
	mov edx,10
422
	mov edx,10
435
	int 0x40
423
	int 0x40
436
 
424
 
437
	add ebx,25 shl 16
425
	add ebx,25 shl 16
438
	mov edx,11
426
	mov edx,11
439
	int 0x40
427
	int 0x40
440
 
428
 
441
	add ebx,25 shl 16
429
	add ebx,25 shl 16
442
	mov edx,12
430
	mov edx,12
443
	int 0x40
431
	int 0x40
444
 
432
 
445
	; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
433
	; *** à¨á®¢ ­¨¥ ¨ª®­®ª ­  ª­®¯ª å ***
446
	mov edx,(7 shl 16)+7 ;icon new
434
	mov edx,(7 shl 16)+7 ;icon new
447
	mcall 7,[image_data_toolbar],(16 shl 16)+16
435
	mcall SF_PUT_IMAGE,[image_data_toolbar],(16 shl 16)+16
448
 
436
 
449
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
437
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
450
	add edx,(25 shl 16) ;icon open
438
	add edx,(25 shl 16) ;icon open
451
	int 0x40
439
	int 0x40
452
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
440
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
453
	add edx,(25 shl 16) ;icon save
441
	add edx,(25 shl 16) ;icon save
454
	int 0x40
442
	int 0x40
455
 
443
 
456
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
444
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
457
	add edx,(30 shl 16) ;
445
	add edx,(30 shl 16) ;
458
	int 0x40
446
	int 0x40
459
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
447
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
460
	add edx,(25 shl 16) ;
448
	add edx,(25 shl 16) ;
461
	int 0x40
449
	int 0x40
462
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
450
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
463
	add edx,(25 shl 16) ;
451
	add edx,(25 shl 16) ;
464
	int 0x40
452
	int 0x40
465
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
453
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
466
	add edx,(25 shl 16) ;
454
	add edx,(25 shl 16) ;
467
	int 0x40
455
	int 0x40
468
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
456
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
469
	add edx,(25 shl 16) ;
457
	add edx,(25 shl 16) ;
470
	int 0x40
458
	int 0x40
471
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
459
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
472
	add edx,(25 shl 16) ;
460
	add edx,(25 shl 16) ;
473
	int 0x40
461
	int 0x40
474
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
462
	add ebx,IMAGE_TOOLBAR_ICON_SIZE
475
	add edx,(25 shl 16) ;
463
	add edx,(25 shl 16) ;
476
	int 0x40
464
	int 0x40
477
 
465
 
478
	call draw_buffers
466
	call draw_buffers
479
	call draw_pok
467
	call draw_pok
480
 
468
 
481
	mcall 12,2
469
	mcall SF_REDRAW,SSF_END_DRAW
482
popad
470
popad
483
	ret
471
	ret
484
 
472
 
485
align 4
473
align 4
486
draw_buffers:
474
draw_buffers:
487
	; *** à¨á®¢ ­¨¥ ¡ãä¥à  ***
475
	; *** à¨á®¢ ­¨¥ ¡ãä¥à  ***
488
	stdcall [buf2d_draw], buf_0
476
	stdcall [buf2d_draw], buf_0
489
	stdcall [buf2d_draw], buf_i0
477
	stdcall [buf2d_draw], buf_i0
490
	stdcall [buf2d_draw], buf_i1
478
	stdcall [buf2d_draw], buf_i1
491
	stdcall [buf2d_draw], buf_i2
479
	stdcall [buf2d_draw], buf_i2
492
	ret
480
	ret
493
 
481
 
494
align 4
482
align 4
495
draw_pok:
483
draw_pok:
496
	;®¡­®¢«¥­¨¥ ¯®¤¯¨á¨ à §¬¥à  ä ©« 
484
	;®¡­®¢«¥­¨¥ ¯®¤¯¨á¨ à §¬¥à  ä ©« 
497
	mov edi,txt_f_size.size
485
	mov edi,txt_f_size.size
498
	mov eax,dword[vox_obj_size]
486
	mov eax,dword[vox_obj_size]
499
	mov ebx,txt_pref
487
	mov ebx,txt_pref
500
	.cycle:
488
	.cycle:
501
		cmp eax,1024
489
		cmp eax,1024
502
		jl @f
490
		jl @f
503
		shr eax,10
491
		shr eax,10
504
		add ebx,4
492
		add ebx,4
505
		jmp .cycle
493
		jmp .cycle
506
	@@:
494
	@@:
507
 
495
 
508
	stdcall convert_int_to_str, 16
496
	stdcall convert_int_to_str, 16
509
	stdcall str_cat, edi,ebx
497
	stdcall str_cat, edi,ebx
510
	stdcall str_cat, edi,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
498
	stdcall str_cat, edi,txt_space ;§ ¢¥àè î騩 ¯à®¡¥«
511
 
499
 
512
	;à¨á®¢ ­¨¥ ⥪áâ 
500
	;à¨á®¢ ­¨¥ ⥪áâ 
513
	mov ecx,[sc.work_text]
501
	mov ecx,[sc.work_text]
514
	or  ecx,0x80000000 or (1 shl 30)
502
	or  ecx,0x80000000 or (1 shl 30)
515
	mov edi,[sc.work] ;梥â ä®­  ®ª­ 
503
	mov edi,[sc.work] ;梥â ä®­  ®ª­ 
516
	mcall 4,(275 shl 16)+7,,txt_f_size
504
	mcall SF_DRAW_TEXT,(275 shl 16)+7,,txt_f_size
517
 
505
 
518
	ret
506
	ret
519
 
507
 
520
align 4
508
align 4
521
key:
509
key:
522
	mcall 2
510
	mcall SF_GET_KEY
523
	jmp still
511
	jmp still
524
 
512
 
525
 
513
 
526
align 4
514
align 4
527
button:
515
button:
528
	mcall 17
516
	mcall SF_GET_BUTTON
529
	cmp ah,3
517
	cmp ah,3
530
	jne @f
518
	jne @f
531
		call but_new_file
519
		call but_new_file
532
	@@:
520
	@@:
533
	cmp ah,4
521
	cmp ah,4
534
	jne @f
522
	jne @f
535
		call but_open_file
523
		call but_open_file
536
	@@:
524
	@@:
537
	cmp ah,5
525
	cmp ah,5
538
	jne @f
526
	jne @f
539
		call but_save_file
527
		call but_save_file
540
	@@:
528
	@@:
541
	cmp ah,6
529
	cmp ah,6
542
	jne @f
530
	jne @f
543
		call but_1
531
		call but_1
544
	@@:
532
	@@:
545
	cmp ah,7
533
	cmp ah,7
546
	jne @f
534
	jne @f
547
		call but_2
535
		call but_2
548
	@@:
536
	@@:
549
	cmp ah,8
537
	cmp ah,8
550
	jne @f
538
	jne @f
551
		call but_3
539
		call but_3
552
	@@:
540
	@@:
553
	cmp ah,9
541
	cmp ah,9
554
	jne @f
542
	jne @f
555
		stdcall but_run, 0
543
		stdcall but_run, 0
556
	@@:
544
	@@:
557
	cmp ah,10
545
	cmp ah,10
558
	jne @f
546
	jne @f
559
		stdcall but_run, 1
547
		stdcall but_run, 1
560
	@@:
548
	@@:
561
	cmp ah,11
549
	cmp ah,11
562
	jne @f
550
	jne @f
563
		call but_5
551
		call but_5
564
	@@:
552
	@@:
565
	cmp ah,12
553
	cmp ah,12
566
	jne @f
554
	jne @f
567
		call but_rot_z
555
		call but_rot_z
568
	@@:
556
	@@:
569
	cmp ah,1
557
	cmp ah,1
570
	jne still
558
	jne still
571
.exit:
559
.exit:
572
	stdcall [buf2d_delete],buf_0
560
	stdcall [buf2d_delete],buf_0
573
	stdcall [buf2d_delete],buf_0z
561
	stdcall [buf2d_delete],buf_0z
574
	stdcall [buf2d_vox_brush_delete],buf_vox
562
	stdcall [buf2d_vox_brush_delete],buf_vox
575
	stdcall [buf2d_delete],buf_i0
563
	stdcall [buf2d_delete],buf_i0
576
	stdcall [buf2d_delete],buf_i1
564
	stdcall [buf2d_delete],buf_i1
577
	stdcall [buf2d_delete],buf_i2
565
	stdcall [buf2d_delete],buf_i2
578
	stdcall [buf2d_delete],buf_npl_p
566
	stdcall [buf2d_delete],buf_npl_p
579
	stdcall [buf2d_delete],buf_npl
567
	stdcall [buf2d_delete],buf_npl
580
	stdcall [buf2d_delete],buf_npl_n
568
	stdcall [buf2d_delete],buf_npl_n
581
	stdcall mem.Free,[image_data_toolbar]
569
	stdcall mem.Free,[image_data_toolbar]
582
	stdcall mem.Free,[open_file_vox]
570
	stdcall mem.Free,[open_file_vox]
583
	stdcall mem.Free,[open_file_img]
571
	stdcall mem.Free,[open_file_img]
584
	mcall -1
572
	mcall SF_TERMINATE_PROCESS
585
 
573
 
586
 
574
 
587
align 4
575
align 4
588
vox_new_data:
576
vox_new_data:
589
	db 2,0,0,0
577
	db 2,0,0,0
590
	db 000b,001b,010b,011b, 100b,101b,110b,111b ;default table
578
	db 000b,001b,010b,011b, 100b,101b,110b,111b ;default table
591
	dd 0 ;null node
579
	dd 0 ;null node
592
 
580
 
593
align 4
581
align 4
594
proc but_new_file uses ecx edi esi
582
proc but_new_file uses ecx edi esi
595
	mov ecx,vox_offs_data+4
583
	mov ecx,vox_offs_data+4
596
	mov [vox_obj_size],ecx
584
	mov [vox_obj_size],ecx
597
	mov esi,vox_new_data
585
	mov esi,vox_new_data
598
	mov edi,[open_file_vox]
586
	mov edi,[open_file_vox]
599
	cld
587
	cld
600
	rep movsb
588
	rep movsb
601
	ret
589
	ret
602
endp
590
endp
603
 
591
 
604
align 4
592
align 4
605
open_file_vox dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï ®âªàëâ¨ï ä ©«®¢
593
open_file_vox dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï ®âªàëâ¨ï ä ©«®¢
606
open_file_img dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï ®âªàëâ¨ï ⥪áâãà
594
open_file_img dd 0 ;㪠§ â¥«ì ­  ¯ ¬ïâì ¤«ï ®âªàëâ¨ï ⥪áâãà
607
 
595
 
608
align 4
596
align 4
609
but_open_file:
597
but_open_file:
610
	pushad
598
	pushad
611
	copy_path open_dialog_name,communication_area_default_path,file_name,0
599
	copy_path open_dialog_name,communication_area_default_path,file_name,0
612
	mov [OpenDialog_data.type],0
600
	mov [OpenDialog_data.type],0
613
	stdcall [OpenDialog_Start],OpenDialog_data
601
	stdcall [OpenDialog_Start],OpenDialog_data
614
	cmp [OpenDialog_data.status],2
602
	cmp [OpenDialog_data.status],2
615
	je .end_open_file
603
	je .end_open_file
616
	;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
604
	;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
617
 
605
 
618
	mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
606
	mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
619
	mov [run_file_70.Function], 0
607
	mov [run_file_70.Function], 0
620
	mov [run_file_70.Position], 0
608
	mov [run_file_70.Position], 0
621
	mov [run_file_70.Flags], 0
609
	mov [run_file_70.Flags], 0
622
	mov [run_file_70.Count], dword max_open_file_size
610
	mov [run_file_70.Count], dword max_open_file_size
623
	m2m [run_file_70.Buffer],dword[open_file_vox]
611
	m2m [run_file_70.Buffer],dword[open_file_vox]
624
	mov byte[run_file_70+20], 0
612
	mov byte[run_file_70+20], 0
625
	mov dword[run_file_70.FileName], openfile_path
613
	mov dword[run_file_70.FileName], openfile_path
626
	mov ebx,run_file_70
614
	mov ebx,run_file_70
627
	int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
615
	int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
628
	cmp ebx,0xffffffff
616
	cmp ebx,0xffffffff
629
	je .end_open_file
617
	je .end_open_file
630
		; ¯à®¢¥àª  ­  ¯à ¢¨«ì­®áâì ¢®ªá¥«ì­®£® ä®à¬ â 
618
		; ¯à®¢¥àª  ­  ¯à ¢¨«ì­®áâì ¢®ªá¥«ì­®£® ä®à¬ â 
631
		mov edi,[open_file_vox]
619
		mov edi,[open_file_vox]
632
		add edi,vox_offs_tree_table
620
		add edi,vox_offs_tree_table
633
		xor bx,bx
621
		xor bx,bx
634
		mov ecx,8
622
		mov ecx,8
635
		cld
623
		cld
636
		@@:
624
		@@:
637
			movzx ax,byte[edi]
625
			movzx ax,byte[edi]
638
			add bx,ax
626
			add bx,ax
639
			inc edi
627
			inc edi
640
			loop @b
628
			loop @b
641
		cmp bx,28 ;28=0+1+2+...+7
629
		cmp bx,28 ;28=0+1+2+...+7
642
		jne .err_open
630
		jne .err_open
643
 
631
 
644
		mcall 71,1,openfile_path
632
		mcall SF_SET_CAPTION,1,openfile_path
645
		stdcall buf2d_vox_obj_get_size,[open_file_vox]
633
		stdcall buf2d_vox_obj_get_size,[open_file_vox]
646
		mov [vox_obj_size],eax
634
		mov [vox_obj_size],eax
647
		call draw_object
635
		call draw_object
648
		
636
		
649
		jmp .end_open_file
637
		jmp .end_open_file
650
	.err_open:
638
	.err_open:
651
		call but_new_file
639
		call but_new_file
652
		stdcall [mb_create],msgbox_4,thread
640
		stdcall [mb_create],msgbox_4,thread
653
	.end_open_file:
641
	.end_open_file:
654
	popad
642
	popad
655
	ret
643
	ret
656
 
644
 
657
align 4
645
align 4
658
but_save_file:
646
but_save_file:
659
	pushad
647
	pushad
660
		copy_path open_dialog_name,communication_area_default_path,file_name,0
648
		copy_path open_dialog_name,communication_area_default_path,file_name,0
661
		mov [OpenDialog_data.type],1
649
		mov [OpenDialog_data.type],1
662
		stdcall [OpenDialog_Start],OpenDialog_data
650
		stdcall [OpenDialog_Start],OpenDialog_data
663
		cmp [OpenDialog_data.status],2
651
		cmp [OpenDialog_data.status],2
664
		je .end_save_file
652
		je .end_save_file
665
		;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
653
		;ª®¤ ¯à¨ 㤠筮¬ ®âªàë⨨ ¤¨ «®£ 
666
 
654
 
667
		mov eax,6 ;dword[v_zoom] ;§ ¤ ¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
655
		mov eax,6 ;dword[v_zoom] ;§ ¤ ¥¬ ¬ áèâ ¡ ¯® 㬮«ç ­¨î
668
		mov ebx,[open_file_vox]
656
		mov ebx,[open_file_vox]
669
		mov byte[ebx],al
657
		mov byte[ebx],al
670
 
658
 
671
		stdcall buf2d_vox_obj_get_size, ebx
659
		stdcall buf2d_vox_obj_get_size, ebx
672
		mov dword[run_file_70.Count], eax ;à §¬¥à ä ©« 
660
		mov dword[run_file_70.Count], eax ;à §¬¥à ä ©« 
673
		mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
661
		mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
674
		mov [run_file_70.Function], 2
662
		mov [run_file_70.Function], 2
675
		mov [run_file_70.Position], 0
663
		mov [run_file_70.Position], 0
676
		mov [run_file_70.Flags], 0
664
		mov [run_file_70.Flags], 0
677
		mov ebx, dword[open_file_vox]
665
		mov ebx, dword[open_file_vox]
678
		mov [run_file_70.Buffer], ebx
666
		mov [run_file_70.Buffer], ebx
679
		mov byte[run_file_70+20], 0
667
		mov byte[run_file_70+20], 0
680
		mov dword[run_file_70.FileName], openfile_path
668
		mov dword[run_file_70.FileName], openfile_path
681
		mov ebx,run_file_70
669
		mov ebx,run_file_70
682
		int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
670
		int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
683
		cmp ebx,0xffffffff
671
		cmp ebx,0xffffffff
684
		je .end_save_file
672
		je .end_save_file
685
 
673
 
686
		.end_save_file:
674
		.end_save_file:
687
	popad
675
	popad
688
	ret
676
	ret
689
 
677
 
690
align 4
678
align 4
691
but_1:
679
but_1:
692
	stdcall open_image_in_buf, buf_i0
680
	stdcall open_image_in_buf, buf_i0
693
	ret
681
	ret
694
 
682
 
695
align 4
683
align 4
696
but_2:
684
but_2:
697
	stdcall open_image_in_buf, buf_i1
685
	stdcall open_image_in_buf, buf_i1
698
	call set_buf_tabs
686
	call set_buf_tabs
699
	ret
687
	ret
700
 
688
 
701
align 4
689
align 4
702
but_3:
690
but_3:
703
	stdcall open_image_in_buf, buf_i2
691
	stdcall open_image_in_buf, buf_i2
704
	call set_buf_tabs
692
	call set_buf_tabs
705
	ret
693
	ret
706
 
694
 
707
;description:
695
;description:
708
; ¢ § ¢¨á¨¬®á⨠®â è¨à¨­ë 1-£® ¡ãä¥à  ãáâ ­ ¢«¨¢ ¥¬ ®âáâã¯ë ¤«ï 2-£® ¨ 3-£® ¡ãä¥à®¢
696
; ¢ § ¢¨á¨¬®á⨠®â è¨à¨­ë 1-£® ¡ãä¥à  ãáâ ­ ¢«¨¢ ¥¬ ®âáâã¯ë ¤«ï 2-£® ¨ 3-£® ¡ãä¥à®¢
709
align 4
697
align 4
710
set_buf_tabs:
698
set_buf_tabs:
711
push eax ebx edi
699
push eax ebx edi
712
	mov edi,buf_i0
700
	mov edi,buf_i0
713
	cmp buf2d_data,0
701
	cmp buf2d_data,0
714
	je @f
702
	je @f
715
		movzx eax,buf2d_l
703
		movzx eax,buf2d_l
716
		mov ebx,buf2d_w
704
		mov ebx,buf2d_w
717
		cmp ebx,128
705
		cmp ebx,128
718
		jle .end_0
706
		jle .end_0
719
			mov ebx,128
707
			mov ebx,128
720
		.end_0:
708
		.end_0:
721
		mov edi,buf_i1
709
		mov edi,buf_i1
722
		mov buf2d_l,ax
710
		mov buf2d_l,ax
723
		add buf2d_l,bx
711
		add buf2d_l,bx
724
		add buf2d_l,2
712
		add buf2d_l,2
725
		shl ebx,1
713
		shl ebx,1
726
		mov edi,buf_i2
714
		mov edi,buf_i2
727
		mov buf2d_l,ax
715
		mov buf2d_l,ax
728
		add buf2d_l,bx
716
		add buf2d_l,bx
729
		add buf2d_l,4
717
		add buf2d_l,4
730
	@@:	
718
	@@:	
731
pop edi ebx eax
719
pop edi ebx eax
732
	ret
720
	ret
733
 
721
 
734
align 4
722
align 4
735
get_scale:
723
get_scale:
736
push eax edi
724
push eax edi
737
	mov edi,buf_i0
725
	mov edi,buf_i0
738
	mov eax,buf2d_w
726
	mov eax,buf2d_w
739
 
727
 
740
	mov dword[k_scale],-1
728
	mov dword[k_scale],-1
741
	.cycle_s:
729
	.cycle_s:
742
	cmp eax,0
730
	cmp eax,0
743
	je @f
731
	je @f
744
		shr eax,1
732
		shr eax,1
745
		inc dword[k_scale]
733
		inc dword[k_scale]
746
		jmp .cycle_s
734
		jmp .cycle_s
747
	@@:
735
	@@:
748
pop edi eax
736
pop edi eax
749
	ret
737
	ret
750
 
738
 
751
align 4
739
align 4
752
proc set_borders uses eax ebx ecx edx edi
740
proc set_borders uses eax ebx ecx edx edi
753
	mov ecx,dword[k_scale]
741
	mov ecx,dword[k_scale]
754
	mov edx,1
742
	mov edx,1
755
	shl edx,cl
743
	shl edx,cl
756
 
744
 
757
	;®¯à¥¤¥«ï¥¬ ¬¨­¨¬ «ì­ãî ª®®à¤¨­ âã y ­  «¨æ¥¢®© £à ­¨
745
	;®¯à¥¤¥«ï¥¬ ¬¨­¨¬ «ì­ãî ª®®à¤¨­ âã y ­  «¨æ¥¢®© £à ­¨
758
	mov edi,buf_i2
746
	mov edi,buf_i2
759
	mov dword[bby_min],0
747
	mov dword[bby_min],0
760
	xor ecx,ecx
748
	xor ecx,ecx
761
	.cycle_0:
749
	.cycle_0:
762
	xor ebx,ebx
750
	xor ebx,ebx
763
	.cycle_1:
751
	.cycle_1:
764
		stdcall [buf2d_get_pixel],edi,ebx,ecx
752
		stdcall [buf2d_get_pixel],edi,ebx,ecx
765
		cmp eax,buf2d_color
753
		cmp eax,buf2d_color
766
		jne @f
754
		jne @f
767
		inc ebx
755
		inc ebx
768
		cmp ebx,edx
756
		cmp ebx,edx
769
		jl .cycle_1
757
		jl .cycle_1
770
		inc dword[bby_min]
758
		inc dword[bby_min]
771
		inc ecx
759
		inc ecx
772
		cmp ecx,edx
760
		cmp ecx,edx
773
		jl .cycle_0
761
		jl .cycle_0
774
	@@:
762
	@@:
775
 
763
 
776
	;®¯à¥¤¥«ï¥¬ ¬¨­¨¬ «ì­ãî ª®®à¤¨­ âã x ­  «¨æ¥¢®© £à ­¨
764
	;®¯à¥¤¥«ï¥¬ ¬¨­¨¬ «ì­ãî ª®®à¤¨­ âã x ­  «¨æ¥¢®© £à ­¨
777
	mov dword[btx_min],0
765
	mov dword[btx_min],0
778
	xor ebx,ebx
766
	xor ebx,ebx
779
	.cycle_2:
767
	.cycle_2:
780
	mov ecx,[bby_min]
768
	mov ecx,[bby_min]
781
	.cycle_3:
769
	.cycle_3:
782
		stdcall [buf2d_get_pixel],edi,ebx,ecx
770
		stdcall [buf2d_get_pixel],edi,ebx,ecx
783
		cmp eax,buf2d_color
771
		cmp eax,buf2d_color
784
		jne @f
772
		jne @f
785
		inc ecx
773
		inc ecx
786
		cmp ecx,edx
774
		cmp ecx,edx
787
		jl .cycle_3
775
		jl .cycle_3
788
		inc dword[btx_min]
776
		inc dword[btx_min]
789
		inc ebx
777
		inc ebx
790
		cmp ebx,edx
778
		cmp ebx,edx
791
		jl .cycle_2
779
		jl .cycle_2
792
	@@:
780
	@@:
793
 
781
 
794
	;®¯à¥¤¥«ï¥¬ ¬ ªá¨¬ «ì­ãî ª®®à¤¨­ âã x ­  «¨æ¥¢®© £à ­¨
782
	;®¯à¥¤¥«ï¥¬ ¬ ªá¨¬ «ì­ãî ª®®à¤¨­ âã x ­  «¨æ¥¢®© £à ­¨
795
	mov [btx_max],edx
783
	mov [btx_max],edx
796
	dec dword[btx_max]
784
	dec dword[btx_max]
797
	mov ebx,[btx_max]
785
	mov ebx,[btx_max]
798
	.cycle_4:
786
	.cycle_4:
799
	mov ecx,[bby_min]
787
	mov ecx,[bby_min]
800
	.cycle_5:
788
	.cycle_5:
801
		stdcall [buf2d_get_pixel],edi,ebx,ecx
789
		stdcall [buf2d_get_pixel],edi,ebx,ecx
802
		cmp eax,buf2d_color
790
		cmp eax,buf2d_color
803
		jne @f
791
		jne @f
804
		inc ecx
792
		inc ecx
805
		cmp ecx,edx
793
		cmp ecx,edx
806
		jl .cycle_5
794
		jl .cycle_5
807
		dec dword[btx_max]
795
		dec dword[btx_max]
808
		dec ebx
796
		dec ebx
809
		cmp ebx,[btx_min]
797
		cmp ebx,[btx_min]
810
		jg .cycle_4
798
		jg .cycle_4
811
	@@:
799
	@@:
812
	
800
	
813
	;stdcall [buf2d_line], edi, 0,[bby_min],50,[bby_min],255
801
	;stdcall [buf2d_line], edi, 0,[bby_min],50,[bby_min],255
814
	ret
802
	ret
815
endp
803
endp
816
 
804
 
817
align 4
805
align 4
818
btx_min dd 0 ;¡ãä¥à ¢¥àå­¨© ¬¨­. x
806
btx_min dd 0 ;¡ãä¥à ¢¥àå­¨© ¬¨­. x
819
btx_max dd 0
807
btx_max dd 0
820
bty_min dd 0 ;¡ãä¥à ¢¥àå­¨© ¬¨­. y
808
bty_min dd 0 ;¡ãä¥à ¢¥àå­¨© ¬¨­. y
821
bty_max dd 0
809
bty_max dd 0
822
;bbx_min dd 0
810
;bbx_min dd 0
823
;bbx_max dd 0
811
;bbx_max dd 0
824
bby_min dd 0 ;¡ãä¥à ¡®ª®¢®© ¬¨­. y
812
bby_min dd 0 ;¡ãä¥à ¡®ª®¢®© ¬¨­. y
825
bby_max dd 0
813
bby_max dd 0
826
k_scale dd 0
814
k_scale dd 0
827
n_plane dd 0
815
n_plane dd 0
828
 
816
 
829
calc db 0
817
calc db 0
830
 
818
 
831
; ᮧ¤ ­¨¥ ¢®ªá¥«ï ¢ 3 íâ ¯ :
819
; ᮧ¤ ­¨¥ ¢®ªá¥«ï ¢ 3 íâ ¯ :
832
; 1) ¨é¥¬ ¬¥áâ® ¢ áâàãªâãॠ¤¥à¥¢ , ªã¤  ­ ¤® ¢áâ ¢¨âì (¥á«¨ ¢¥â¢ì áãé¥áâ¢ã¥â, 2-© íâ ¯ ¯à®¯ã᪠¥¬)
820
; 1) ¨é¥¬ ¬¥áâ® ¢ áâàãªâãॠ¤¥à¥¢ , ªã¤  ­ ¤® ¢áâ ¢¨âì (¥á«¨ ¢¥â¢ì áãé¥áâ¢ã¥â, 2-© íâ ¯ ¯à®¯ã᪠¥¬)
833
; 2) ¢áâ ¢«ï¥¬ ­®¢ãî ¢¥â¢ì á ¢®ªá¥«¥¬ (3-© íâ ¯ 㦥 ­¥ ¤¥« ¥¬)
821
; 2) ¢áâ ¢«ï¥¬ ­®¢ãî ¢¥â¢ì á ¢®ªá¥«¥¬ (3-© íâ ¯ 㦥 ­¥ ¤¥« ¥¬)
834
; 3) ¬¥­ï¥¬ 梥⠢®ªá¥«ï
822
; 3) ¬¥­ï¥¬ 梥⠢®ªá¥«ï
835
align 4
823
align 4
836
proc buf2d_vox_obj_create_node, v_obj:dword,coord_x:dword,coord_y:dword,\
824
proc buf2d_vox_obj_create_node, v_obj:dword,coord_x:dword,coord_y:dword,\
837
coord_z:dword,k_scale:dword,color:dword
825
coord_z:dword,k_scale:dword,color:dword
838
pushad
826
pushad
839
locals
827
locals
840
	p_node dd 0 ;த¨â¥«ì᪨© 㧥«
828
	p_node dd 0 ;த¨â¥«ì᪨© 㧥«
841
endl
829
endl
842
 
830
 
843
	mov edi,[v_obj]
831
	mov edi,[v_obj]
844
	add edi,vox_offs_data
832
	add edi,vox_offs_data
845
	mov esi,[k_scale]
833
	mov esi,[k_scale]
846
	cmp esi,1
834
	cmp esi,1
847
	jl .change
835
	jl .change
848
	; *** (1) ***
836
	; *** (1) ***
849
	.found:
837
	.found:
850
	stdcall vox_obj_get_node_position, [v_obj],[coord_x],[coord_y],[coord_z],esi
838
	stdcall vox_obj_get_node_position, [v_obj],[coord_x],[coord_y],[coord_z],esi
851
	movzx bx,byte[edi+3]
839
	movzx bx,byte[edi+3]
852
	mov [p_node],edi
840
	mov [p_node],edi
853
	add edi,4
841
	add edi,4
854
 
842
 
855
	cmp eax,0
843
	cmp eax,0
856
	je .end_1
844
	je .end_1
857
	mov ecx,eax
845
	mov ecx,eax
858
	cld
846
	cld
859
	@@: ;横« ¤«ï ¯à®¯ã᪠ ¯à¥¤ë¤ãé¨å ¯®¤¤¥à¥¢ì¥¢ ¢ 㧫¥
847
	@@: ;横« ¤«ï ¯à®¯ã᪠ ¯à¥¤ë¤ãé¨å ¯®¤¤¥à¥¢ì¥¢ ¢ 㧫¥
860
		bt bx,0 ;¯à®¢¥à塞 ¥áâì «¨ ¤®ç¥à­¨¥ 㧫ë
848
		bt bx,0 ;¯à®¢¥à塞 ¥áâì «¨ ¤®ç¥à­¨¥ 㧫ë
861
		jnc .end_0
849
		jnc .end_0
862
			xor eax,eax
850
			xor eax,eax
863
			stdcall vox_obj_rec0 ;¢ eax ¢ëç¨á«ï¥âáï ç¨á«® ¤®ç¥à­¨å 㧫®¢, ¢ ¤ ­­®© ¢¥â¢¨
851
			stdcall vox_obj_rec0 ;¢ eax ¢ëç¨á«ï¥âáï ç¨á«® ¤®ç¥à­¨å 㧫®¢, ¢ ¤ ­­®© ¢¥â¢¨
864
		.end_0:
852
		.end_0:
865
		shr bx,1
853
		shr bx,1
866
		loop @b
854
		loop @b
867
	.end_1:
855
	.end_1:
868
	bt bx,0
856
	bt bx,0
869
	jnc .creat ;¥á«¨ ¯®¤¤¥à¥¢  ­¥ áãé¥áâ¢ã¥â, ¯¥à¥å®¤¨¬ ª ᮧ¤ ­¨î
857
	jnc .creat ;¥á«¨ ¯®¤¤¥à¥¢  ­¥ áãé¥áâ¢ã¥â, ¯¥à¥å®¤¨¬ ª ᮧ¤ ­¨î
870
	dec esi
858
	dec esi
871
	cmp esi,0
859
	cmp esi,0
872
	jg .found
860
	jg .found
873
	jmp .change
861
	jmp .change
874
 
862
 
875
	; *** (2) ***
863
	; *** (2) ***
876
	.creat:
864
	.creat:
877
	mov edx,[color] ;¬¥­ï¥¬ 梥â
865
	mov edx,[color] ;¬¥­ï¥¬ 梥â
878
	and edx,0xffffff ;¤«ï ¯à®ä¨« ªâ¨ª¨
866
	and edx,0xffffff ;¤«ï ¯à®ä¨« ªâ¨ª¨
879
	mov ecx,esi
867
	mov ecx,esi
880
	stdcall vox_obj_add_nodes_mem, [v_obj],edi,ecx ;à áè¨à塞 ¬¥áâ® § ­¨¬ ¥¬®¥ ®¡ê¥ªâ®¬, ¤«ï ¤®¡ ¢«¥­¨ï ­®¢ëå 㧫®¢
868
	stdcall vox_obj_add_nodes_mem, [v_obj],edi,ecx ;à áè¨à塞 ¬¥áâ® § ­¨¬ ¥¬®¥ ®¡ê¥ªâ®¬, ¤«ï ¤®¡ ¢«¥­¨ï ­®¢ëå 㧫®¢
881
	mov ebx,[p_node]
869
	mov ebx,[p_node]
882
	cld
870
	cld
883
	@@:
871
	@@:
884
		mov dword[edi],edx
872
		mov dword[edi],edx
885
		stdcall vox_obj_get_node_bit_mask, [v_obj],[coord_x],[coord_y],[coord_z],esi
873
		stdcall vox_obj_get_node_bit_mask, [v_obj],[coord_x],[coord_y],[coord_z],esi
886
		or byte[ebx+3],al
874
		or byte[ebx+3],al
887
 
875
 
888
		mov ebx,edi
876
		mov ebx,edi
889
		add edi,4
877
		add edi,4
890
		dec esi
878
		dec esi
891
		loop @b
879
		loop @b
892
	jmp .end_2
880
	jmp .end_2
893
 
881
 
894
	; *** (3) ***
882
	; *** (3) ***
895
	.change:
883
	.change:
896
	mov eax,[color] ;¬¥­ï¥¬ 梥â
884
	mov eax,[color] ;¬¥­ï¥¬ 梥â
897
	mov word[edi],ax
885
	mov word[edi],ax
898
	shr eax,16
886
	shr eax,16
899
	mov byte[edi+2],al
887
	mov byte[edi+2],al
900
 
888
 
901
	.end_2:
889
	.end_2:
902
popad
890
popad
903
	ret
891
	ret
904
endp
892
endp
905
 
893
 
906
; ᤢ¨£ ¥â ã§«ë ¤«ï ¤®¡ ¢«¥­¨ï ­®¢ëå 㧫®¢
894
; ᤢ¨£ ¥â ã§«ë ¤«ï ¤®¡ ¢«¥­¨ï ­®¢ëå 㧫®¢
907
;input:
895
;input:
908
; p_insert - ¯®§¨æ¨ï ¤«ï ¢áâ ¢ª¨
896
; p_insert - ¯®§¨æ¨ï ¤«ï ¢áâ ¢ª¨
909
; count - ª®««¨ç¥á⢮ ¢áâ ¢«ï¥¬ëå 㧫®¢
897
; count - ª®««¨ç¥á⢮ ¢áâ ¢«ï¥¬ëå 㧫®¢
910
align 4
898
align 4
911
proc vox_obj_add_nodes_mem uses eax ecx edi esi, v_obj:dword,p_insert:dword,count:dword
899
proc vox_obj_add_nodes_mem uses eax ecx edi esi, v_obj:dword,p_insert:dword,count:dword
912
	mov esi,[v_obj]
900
	mov esi,[v_obj]
913
	;stdcall buf2d_vox_obj_get_size,esi
901
	;stdcall buf2d_vox_obj_get_size,esi
914
	add esi,[vox_obj_size] ;esi - 㪠§ â¥«ì ­  ª®­¥æ ä ©« 
902
	add esi,[vox_obj_size] ;esi - 㪠§ â¥«ì ­  ª®­¥æ ä ©« 
915
	mov edi,[count]
903
	mov edi,[count]
916
	shl edi,2
904
	shl edi,2
917
	add [vox_obj_size],edi
905
	add [vox_obj_size],edi
918
	add edi,esi ;edi - 㪠§ â¥«ì ­  ¡ã¤ã騩 ª®­¥æ ä ©« 
906
	add edi,esi ;edi - 㪠§ â¥«ì ­  ¡ã¤ã騩 ª®­¥æ ä ©« 
919
	mov ecx,esi
907
	mov ecx,esi
920
	sub ecx,[p_insert]
908
	sub ecx,[p_insert]
921
	shr ecx,2 ;ecx - ç¨á«® 横«®¢ ¤«ï ª®¯¨à®¢ ­¨ï
909
	shr ecx,2 ;ecx - ç¨á«® 横«®¢ ¤«ï ª®¯¨à®¢ ­¨ï
922
	sub esi,4 ;esi - 㪠§ â¥«ì ­  ¯®á«¥¤­¨© 㧥«
910
	sub esi,4 ;esi - 㪠§ â¥«ì ­  ¯®á«¥¤­¨© 㧥«
923
	sub edi,4 ;edi - 㪠§ â¥«ì ­  ¡ã¤ã騩 ¯®á«¥¤­¨© 㧥«
911
	sub edi,4 ;edi - 㪠§ â¥«ì ­  ¡ã¤ã騩 ¯®á«¥¤­¨© 㧥«
924
	std
912
	std
925
	rep movsd ;ᤢ¨£ ¥¬ ¯ ¬ïâì
913
	rep movsd ;ᤢ¨£ ¥¬ ¯ ¬ïâì
926
	ret
914
	ret
927
endp
915
endp
928
 
916
 
929
;???
917
;???
930
; ®¯à¥¤¥«¥­¨¥ ¯®§¨æ¨¨ 㧫  ¢ ¤¥à¥¢¥ (®â 0 ¤® 7)
918
; ®¯à¥¤¥«¥­¨¥ ¯®§¨æ¨¨ 㧫  ¢ ¤¥à¥¢¥ (®â 0 ¤® 7)
931
align 4
919
align 4
932
proc vox_obj_get_node_position uses ebx ecx edi, v_obj:dword,\
920
proc vox_obj_get_node_position uses ebx ecx edi, v_obj:dword,\
933
coord_x:dword,coord_y:dword,coord_z:dword,k_scale:dword
921
coord_x:dword,coord_y:dword,coord_z:dword,k_scale:dword
934
	mov ecx,[k_scale]
922
	mov ecx,[k_scale]
935
	dec ecx
923
	dec ecx
936
	mov eax,[coord_x]
924
	mov eax,[coord_x]
937
	mov ebx,[coord_y]
925
	mov ebx,[coord_y]
938
	mov edi,[coord_z]
926
	mov edi,[coord_z]
939
	cmp ecx,1
927
	cmp ecx,1
940
	jl .end_0
928
	jl .end_0
941
		shr eax,cl
929
		shr eax,cl
942
		shr ebx,cl
930
		shr ebx,cl
943
		shr edi,cl
931
		shr edi,cl
944
	.end_0:
932
	.end_0:
945
	and eax,1
933
	and eax,1
946
	bt ebx,0
934
	bt ebx,0
947
	jnc @f
935
	jnc @f
948
		bts eax,1
936
		bts eax,1
949
	@@:
937
	@@:
950
	bt edi,0
938
	bt edi,0
951
	jnc @f
939
	jnc @f
952
		bts eax,2
940
		bts eax,2
953
	@@:
941
	@@:
954
 
942
 
955
	mov edi,[v_obj]
943
	mov edi,[v_obj]
956
	add edi,vox_offs_tree_table
944
	add edi,vox_offs_tree_table
957
	@@:
945
	@@:
958
		cmp al,byte[edi]
946
		cmp al,byte[edi]
959
		je @f
947
		je @f
960
		inc edi
948
		inc edi
961
		jmp @b
949
		jmp @b
962
	@@:
950
	@@:
963
	sub edi,[v_obj]
951
	sub edi,[v_obj]
964
	sub edi,vox_offs_tree_table
952
	sub edi,vox_offs_tree_table
965
	mov eax,edi
953
	mov eax,edi
966
	
954
	
967
	ret
955
	ret
968
endp
956
endp
969
 
957
 
970
;???
958
;???
971
;input:
959
;input:
972
; edi - 㪠§ â¥«ì ­  ¤ ­­ë¥ ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
960
; edi - 㪠§ â¥«ì ­  ¤ ­­ë¥ ¢®ªá¥«ì­®£® ®¡ê¥ªâ 
973
;output:
961
;output:
974
; eax - eax + ç¨á«® 㧫®¢ ¢ ¤ ­­ëå ¢®ªá. ®¡ê¥ªâ 
962
; eax - eax + ç¨á«® 㧫®¢ ¢ ¤ ­­ëå ¢®ªá. ®¡ê¥ªâ 
975
; edi - 㪠§ â¥«ì ­  ᬥ饭­ë¥ ¤ ­­ë¥ ¢®ªá. ®¡ê¥ªâ 
963
; edi - 㪠§ â¥«ì ­  ᬥ饭­ë¥ ¤ ­­ë¥ ¢®ªá. ®¡ê¥ªâ 
976
align 4
964
align 4
977
proc vox_obj_rec0
965
proc vox_obj_rec0
978
	inc eax
966
	inc eax
979
	cmp byte[edi+3],0 ;ᬮâਬ ¥áâì «¨ ¯®¤¤¥à¥¢ìï
967
	cmp byte[edi+3],0 ;ᬮâਬ ¥áâì «¨ ¯®¤¤¥à¥¢ìï
980
	je .sub_trees
968
	je .sub_trees
981
 
969
 
982
		;४ãàᨢ­ë© ¯¥à¥¡®à ¯®¤¤¥à¥¢ì¥¢
970
		;४ãàᨢ­ë© ¯¥à¥¡®à ¯®¤¤¥à¥¢ì¥¢
983
		push ebx ecx
971
		push ebx ecx
984
		mov bh,byte[edi+3]
972
		mov bh,byte[edi+3]
985
		add edi,4
973
		add edi,4
986
		mov bl,8
974
		mov bl,8
987
		.cycle:
975
		.cycle:
988
			bt bx,8 ;â¥áâ¨à㥬 ⮫쪮 bh
976
			bt bx,8 ;â¥áâ¨à㥬 ⮫쪮 bh
989
			jnc .c_next
977
			jnc .c_next
990
				stdcall vox_obj_rec0
978
				stdcall vox_obj_rec0
991
			.c_next:
979
			.c_next:
992
			shr bh,1
980
			shr bh,1
993
			dec bl
981
			dec bl
994
			jnz .cycle
982
			jnz .cycle
995
		pop ecx ebx
983
		pop ecx ebx
996
 
984
 
997
		jmp .end_f
985
		jmp .end_f
998
	.sub_trees:
986
	.sub_trees:
999
		add edi,4
987
		add edi,4
1000
	.end_f:
988
	.end_f:
1001
	ret
989
	ret
1002
endp
990
endp
1003
 
991
 
1004
;output:
992
;output:
1005
; eax - 1,2,4,8,16, ... ,128
993
; eax - 1,2,4,8,16, ... ,128
1006
align 4
994
align 4
1007
proc vox_obj_get_node_bit_mask uses ebx ecx edi, v_obj:dword,\
995
proc vox_obj_get_node_bit_mask uses ebx ecx edi, v_obj:dword,\
1008
coord_x:dword,coord_y:dword,coord_z:dword,k_scale:dword
996
coord_x:dword,coord_y:dword,coord_z:dword,k_scale:dword
1009
	mov ecx,[k_scale]
997
	mov ecx,[k_scale]
1010
	dec ecx
998
	dec ecx
1011
	mov eax,[coord_x]
999
	mov eax,[coord_x]
1012
	mov ebx,[coord_y]
1000
	mov ebx,[coord_y]
1013
	mov edi,[coord_z]
1001
	mov edi,[coord_z]
1014
	cmp ecx,1
1002
	cmp ecx,1
1015
	jl .end_0
1003
	jl .end_0
1016
		shr eax,cl
1004
		shr eax,cl
1017
		shr ebx,cl
1005
		shr ebx,cl
1018
		shr edi,cl
1006
		shr edi,cl
1019
	.end_0:
1007
	.end_0:
1020
	and eax,1
1008
	and eax,1
1021
	bt ebx,0
1009
	bt ebx,0
1022
	jnc @f
1010
	jnc @f
1023
		bts eax,1
1011
		bts eax,1
1024
	@@:
1012
	@@:
1025
	bt edi,0
1013
	bt edi,0
1026
	jnc @f
1014
	jnc @f
1027
		bts eax,2
1015
		bts eax,2
1028
	@@:
1016
	@@:
1029
 
1017
 
1030
	mov ecx,[v_obj]
1018
	mov ecx,[v_obj]
1031
	add ecx,vox_offs_tree_table
1019
	add ecx,vox_offs_tree_table
1032
	@@:
1020
	@@:
1033
		cmp al,byte[ecx]
1021
		cmp al,byte[ecx]
1034
		je @f
1022
		je @f
1035
		inc ecx
1023
		inc ecx
1036
		jmp @b
1024
		jmp @b
1037
	@@:
1025
	@@:
1038
	mov eax,1 ;ãáâ ­ ¢«¨¢ ¥¬ ¯¥à¢®­ ç «ì­®¥ §­ ç¥­¨¥ ¡¨â 
1026
	mov eax,1 ;ãáâ ­ ¢«¨¢ ¥¬ ¯¥à¢®­ ç «ì­®¥ §­ ç¥­¨¥ ¡¨â 
1039
	sub ecx,[v_obj]
1027
	sub ecx,[v_obj]
1040
	sub ecx,vox_offs_tree_table
1028
	sub ecx,vox_offs_tree_table
1041
	jz @f
1029
	jz @f
1042
		shl eax,cl ;ᤢ¨£ ¥¬ ¡¨â
1030
		shl eax,cl ;ᤢ¨£ ¥¬ ¡¨â
1043
	@@:
1031
	@@:
1044
	
1032
	
1045
	ret
1033
	ret
1046
endp
1034
endp
1047
 
1035
 
1048
;
1036
;
1049
;output:
1037
;output:
1050
; eax - à §¬¥à ¢ ¡ ©â å § ­¨¬ ¥¬ë© ®¡ê¥ªâ®¬ v_obj
1038
; eax - à §¬¥à ¢ ¡ ©â å § ­¨¬ ¥¬ë© ®¡ê¥ªâ®¬ v_obj
1051
align 4
1039
align 4
1052
proc buf2d_vox_obj_get_size uses edi, v_obj:dword
1040
proc buf2d_vox_obj_get_size uses edi, v_obj:dword
1053
	mov edi,[v_obj]
1041
	mov edi,[v_obj]
1054
	add edi,vox_offs_data
1042
	add edi,vox_offs_data
1055
	xor eax,eax
1043
	xor eax,eax
1056
	stdcall vox_obj_rec0 ;eax - ç¨á«® 㧫®¢ ¢ ®¡ê¥ªâ¥ v_obj
1044
	stdcall vox_obj_rec0 ;eax - ç¨á«® 㧫®¢ ¢ ®¡ê¥ªâ¥ v_obj
1057
	shl eax,2
1045
	shl eax,2
1058
	add eax,vox_offs_data
1046
	add eax,vox_offs_data
1059
	ret
1047
	ret
1060
endp
1048
endp
1061
 
1049
 
1062
;input:
1050
;input:
1063
; mode_add - ¥á«¨ ­¥ à ¢­® 0 ⮣¤  ᮧ¤ ­¨¥ ¢ ०¨¬¥ ¤®¡ ¢«¥­¨ï ¢®ªá¥«¥©
1051
; mode_add - ¥á«¨ ­¥ à ¢­® 0 ⮣¤  ᮧ¤ ­¨¥ ¢ ०¨¬¥ ¤®¡ ¢«¥­¨ï ¢®ªá¥«¥©
1064
align 4
1052
align 4
1065
proc but_run uses eax ebx edi, mode_add:dword
1053
proc but_run uses eax ebx edi, mode_add:dword
1066
	; ¯à®¢¥àª  à §¬¥à®¢ ¨§®¡à ¦¥­¨© (⥪áâãà)
1054
	; ¯à®¢¥àª  à §¬¥à®¢ ¨§®¡à ¦¥­¨© (⥪áâãà)
1067
	mov edi,buf_i0
1055
	mov edi,buf_i0
1068
	mov ebx,buf2d_h
1056
	mov ebx,buf2d_h
1069
	cmp ebx,2
1057
	cmp ebx,2
1070
	jle .err_size_t
1058
	jle .err_size_t
1071
	cmp buf2d_w,ebx
1059
	cmp buf2d_w,ebx
1072
	jne .err_size_t
1060
	jne .err_size_t
1073
	;
1061
	;
1074
	mov edi,buf_i1
1062
	mov edi,buf_i1
1075
	cmp ebx,buf2d_h
1063
	cmp ebx,buf2d_h
1076
	jne .err_size_tb
1064
	jne .err_size_tb
1077
	mov ebx,buf2d_h
1065
	mov ebx,buf2d_h
1078
	cmp ebx,2
1066
	cmp ebx,2
1079
	jle .err_size_b
1067
	jle .err_size_b
1080
	cmp buf2d_w,ebx
1068
	cmp buf2d_w,ebx
1081
	jne .err_size_b
1069
	jne .err_size_b
1082
 
1070
 
1083
		cmp dword[vox_obj_size],vox_offs_data
1071
		cmp dword[vox_obj_size],vox_offs_data
1084
		jl .n_file ;¥á«¨ à ­ìè¥ ­¥ ¡ë«® ®âªàëâëå ä ©«®¢
1072
		jl .n_file ;¥á«¨ à ­ìè¥ ­¥ ¡ë«® ®âªàëâëå ä ©«®¢
1085
		cmp dword[mode_add],0
1073
		cmp dword[mode_add],0
1086
		jne @f
1074
		jne @f
1087
		.n_file:
1075
		.n_file:
1088
			call but_new_file
1076
			call but_new_file
1089
		@@:
1077
		@@:
1090
 
1078
 
1091
		mov edi,buf_i0
1079
		mov edi,buf_i0
1092
		mov eax,buf2d_w
1080
		mov eax,buf2d_w
1093
		mov edi,buf_npl
1081
		mov edi,buf_npl
1094
		cmp buf2d_data,0
1082
		cmp buf2d_data,0
1095
		jne @f
1083
		jne @f
1096
			; *** ᮧ¤ ¥¬ ¡ãä¥à 
1084
			; *** ᮧ¤ ¥¬ ¡ãä¥à 
1097
			m2m buf2d_w,eax
1085
			m2m buf2d_w,eax
1098
			m2m buf2d_h,eax
1086
			m2m buf2d_h,eax
1099
			stdcall [buf2d_create],edi
1087
			stdcall [buf2d_create],edi
1100
			mov edi,buf_npl_p
1088
			mov edi,buf_npl_p
1101
			m2m buf2d_w,eax
1089
			m2m buf2d_w,eax
1102
			m2m buf2d_h,eax
1090
			m2m buf2d_h,eax
1103
			stdcall [buf2d_create],edi
1091
			stdcall [buf2d_create],edi
1104
			mov edi,buf_npl_n
1092
			mov edi,buf_npl_n
1105
			m2m buf2d_w,eax
1093
			m2m buf2d_w,eax
1106
			m2m buf2d_h,eax
1094
			m2m buf2d_h,eax
1107
			stdcall [buf2d_create],edi
1095
			stdcall [buf2d_create],edi
1108
			jmp .end_0
1096
			jmp .end_0
1109
		@@:
1097
		@@:
1110
			; *** ¨§¬¥­ï¥¬ à §¬¥àë ¡ãä¥à®¢
1098
			; *** ¨§¬¥­ï¥¬ à §¬¥àë ¡ãä¥à®¢
1111
			stdcall [buf2d_resize], edi, eax,eax
1099
			stdcall [buf2d_resize], edi, eax,eax,1
1112
			mov edi,buf_npl_p
1100
			mov edi,buf_npl_p
1113
			stdcall [buf2d_resize], edi, eax,eax
1101
			stdcall [buf2d_resize], edi, eax,eax,1
1114
			mov edi,buf_npl_n
1102
			mov edi,buf_npl_n
1115
			stdcall [buf2d_resize], edi, eax,eax
1103
			stdcall [buf2d_resize], edi, eax,eax,1
1116
		.end_0:
1104
		.end_0:
1117
		mov dword[n_plane],1
1105
		mov dword[n_plane],1
1118
		mov byte[calc],1
1106
		mov byte[calc],1
1119
		call get_scale
1107
		call get_scale
1120
		call set_borders
1108
		call set_borders
1121
 
1109
 
1122
		stdcall create_plane,buf_npl,0
1110
		stdcall create_plane,buf_npl,0
1123
		stdcall create_plane,buf_npl_n,1
1111
		stdcall create_plane,buf_npl_n,1
1124
		stdcall create_obj_from_plane,buf_npl,0 ;ᮧ¤ ¥¬ ­ ç «ì­®¥ á¥ç¥­¨¥
1112
		stdcall create_obj_from_plane,buf_npl,0 ;ᮧ¤ ¥¬ ­ ç «ì­®¥ á¥ç¥­¨¥
1125
 
1113
 
1126
		jmp @f
1114
		jmp @f
1127
	.err_size_t:
1115
	.err_size_t:
1128
		stdcall [mb_create],msgbox_0,thread
1116
		stdcall [mb_create],msgbox_0,thread
1129
		jmp @f
1117
		jmp @f
1130
	.err_size_b:
1118
	.err_size_b:
1131
		stdcall [mb_create],msgbox_1,thread
1119
		stdcall [mb_create],msgbox_1,thread
1132
		jmp @f
1120
		jmp @f
1133
	.err_size_tb:
1121
	.err_size_tb:
1134
		stdcall [mb_create],msgbox_3,thread
1122
		stdcall [mb_create],msgbox_3,thread
1135
		;jmp @f
1123
		;jmp @f
1136
	@@:
1124
	@@:
1137
	ret
1125
	ret
1138
endp
1126
endp
1139
 
1127
 
1140
align 4
1128
align 4
1141
but_5:
1129
but_5:
1142
	cmp byte[calc],0
1130
	cmp byte[calc],0
1143
	je @f
1131
	je @f
1144
		call draw_object
1132
		call draw_object
1145
		mov byte[calc],0
1133
		mov byte[calc],0
1146
	@@:
1134
	@@:
1147
	ret
1135
	ret
1148
 
1136
 
1149
align 4
1137
align 4
1150
but_rot_z:
1138
but_rot_z:
1151
	stdcall vox_obj_rot_z, [open_file_vox]
1139
	stdcall vox_obj_rot_z, [open_file_vox]
1152
	call draw_object
1140
	call draw_object
1153
	ret
1141
	ret
1154
 
1142
 
1155
align 4
1143
align 4
1156
draw_object:
1144
draw_object:
1157
	;¢ë¢®¤ १ã«ìâ â  ­  íªà ­
1145
	;¢ë¢®¤ १ã«ìâ â  ­  íªà ­
1158
	stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
1146
	stdcall [buf2d_clear], buf_0, [buf_0.color] ;ç¨á⨬ ¡ãä¥à
1159
	stdcall [buf2d_clear], buf_0z, 0 ;ç¨á⨬ ¡ãä¥à
1147
	stdcall [buf2d_clear], buf_0z, 0 ;ç¨á⨬ ¡ãä¥à
1160
	stdcall [buf2d_vox_obj_draw_3g], buf_0, buf_0z, buf_vox,\
1148
	stdcall [buf2d_vox_obj_draw_3g], buf_0, buf_0z, buf_vox,\
1161
		[open_file_vox], 0,0, 0, 6 ;[k_scale]
1149
		[open_file_vox], 0,0, 0, 6 ;[k_scale]
1162
	stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
1150
	stdcall [buf2d_draw], buf_0 ;®¡­®¢«ï¥¬ ¡ãä¥à ­  íªà ­¥
1163
	ret
1151
	ret
1164
 
1152
 
1165
align 4
1153
align 4
1166
proc open_image_in_buf, buf:dword
1154
proc open_image_in_buf, buf:dword
1167
	pushad
1155
	pushad
1168
	copy_path open_dialog_name,communication_area_default_path,file_name,0
1156
	copy_path open_dialog_name,communication_area_default_path,file_name,0
1169
	mov [OpenDialog_data.type],0
1157
	mov [OpenDialog_data.type],0
1170
	stdcall [OpenDialog_Start],OpenDialog_data
1158
	stdcall [OpenDialog_Start],OpenDialog_data
1171
	cmp [OpenDialog_data.status],2
1159
	cmp [OpenDialog_data.status],2
1172
	je .end_open_file
1160
	je .end_open_file
1173
 
1161
 
1174
	;stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
1162
	;stdcall mem.Alloc, dword size ;¢ë¤¥«ï¥¬ ¯ ¬ïâì ¤«ï ¨§®¡à ¦¥­¨ï
1175
	;mov [buf],eax
1163
	;mov [buf],eax
1176
 
1164
 
1177
	mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
1165
	mov eax,70 ;70-ï äã­ªæ¨ï à ¡®â  á ä ©« ¬¨
1178
	mov [run_file_70.Function], 0
1166
	mov [run_file_70.Function], 0
1179
	mov [run_file_70.Position], 0
1167
	mov [run_file_70.Position], 0
1180
	mov [run_file_70.Flags], 0
1168
	mov [run_file_70.Flags], 0
1181
	mov [run_file_70.Count], dword max_open_file_size
1169
	mov [run_file_70.Count], dword max_open_file_size
1182
	m2m [run_file_70.Buffer],dword[open_file_img]
1170
	m2m [run_file_70.Buffer],dword[open_file_img]
1183
	mov byte[run_file_70+20], 0
1171
	mov byte[run_file_70+20], 0
1184
	mov [run_file_70.FileName], openfile_path
1172
	mov [run_file_70.FileName], openfile_path
1185
	mov ebx,run_file_70
1173
	mov ebx,run_file_70
1186
	int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
1174
	int 0x40 ;§ £à㦠¥¬ ä ©« ¨§®¡à ¦¥­¨ï
1187
	cmp ebx,0xffffffff
1175
	cmp ebx,0xffffffff
1188
	je .end_0
1176
	je .end_0
1189
		;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
1177
		;®¯à¥¤¥«ï¥¬ ¢¨¤ ¨§®¡à ¦¥­¨ï ¨ ¯¥à¥¢®¤¨¬ ¥£® ¢® ¢à¥¬¥­­ë© ¡ãä¥à image_data
1190
		stdcall dword[img_decode], dword[open_file_img],ebx,0
1178
		stdcall dword[img_decode], dword[open_file_img],ebx,0
1191
		cmp eax,0
1179
		cmp eax,0
1192
		je .end_0 ;¥á«¨ ­ àã襭 ä®à¬ â ä ©« 
1180
		je .end_0 ;¥á«¨ ­ àã襭 ä®à¬ â ä ©« 
1193
		mov dword[image_data],eax
1181
		mov dword[image_data],eax
1194
		;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
1182
		;¯à¥®¡à §ã¥¬ ¨§®¡à ¦¥­¨¥ ª ä®à¬ âã rgb
1195
		stdcall dword[img_to_rgb2], dword[image_data],dword[open_file_img]
1183
		stdcall dword[img_to_rgb2], dword[image_data],dword[open_file_img]
1196
 
1184
 
1197
		mov eax,dword[image_data]
1185
		mov eax,dword[image_data]
1198
		mov edi,[buf]
1186
		mov edi,[buf]
1199
		cmp buf2d_data,0
1187
		cmp buf2d_data,0
1200
		jne @f
1188
		jne @f
1201
			m2m buf2d_w,dword[eax+4] ;+4 = image width
1189
			m2m buf2d_w,dword[eax+4] ;+4 = image width
1202
			m2m buf2d_h,dword[eax+8] ;+8 = image heihht
1190
			m2m buf2d_h,dword[eax+8] ;+8 = image heihht
1203
			stdcall [buf2d_create_f_img], edi,[open_file_img]
1191
			stdcall [buf2d_create_f_img], edi,[open_file_img]
1204
			jmp .end_1
1192
			jmp .end_1
1205
		@@:
1193
		@@:
1206
			mov ebx,dword[eax+4]
1194
			mov ebx,dword[eax+4]
1207
			mov ecx,dword[eax+8]
1195
			mov ecx,dword[eax+8]
1208
			stdcall [buf2d_resize], edi, ebx,ecx ;¨§¬¥­ï¥¬ à §¬¥àë ¡ãä¥à 
1196
			stdcall [buf2d_resize], edi, ebx,ecx,1 ;¨§¬¥­ï¥¬ à §¬¥àë ¡ãä¥à 
1209
			imul ecx,ebx
1197
			imul ecx,ebx
1210
			lea ecx,[ecx+ecx*2]
1198
			lea ecx,[ecx+ecx*2]
1211
			mov edi,buf2d_data
1199
			mov edi,buf2d_data
1212
			mov esi,[open_file_img]
1200
			mov esi,[open_file_img]
1213
			cld
1201
			cld
1214
			rep movsb ;copy image
1202
			rep movsb ;copy image
1215
		.end_1:
1203
		.end_1:
1216
 
1204
 
1217
		;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
1205
		;㤠«ï¥¬ ¢à¥¬¥­­ë© ¡ãä¥à image_data
1218
		stdcall dword[img_destroy], dword[image_data]
1206
		stdcall dword[img_destroy], dword[image_data]
1219
	.end_0:
1207
	.end_0:
1220
 
1208
 
1221
	call draw_buffers
1209
	call draw_buffers
1222
	.end_open_file:
1210
	.end_open_file:
1223
	popad
1211
	popad
1224
	ret
1212
	ret
1225
endp
1213
endp
1226
 
1214
 
1227
msgbox_0:
1215
msgbox_0:
1228
	db 1,0
1216
	db 1,0
1229
	db '‚­¨¬ ­¨¥',0
1217
	db '‚­¨¬ ­¨¥',0
1230
	db ' §¬¥à ¢¥àå­¥£® ¨§®¡à ¦¥­¨ï ­¥ ª®à¥ªâ­ë©',0
1218
	db ' §¬¥à ¢¥àå­¥£® ¨§®¡à ¦¥­¨ï ­¥ ª®à¥ªâ­ë©',0
1231
	db '‡ ªàëâì',0
1219
	db '‡ ªàëâì',0
1232
	db 0
1220
	db 0
1233
 
1221
 
1234
msgbox_1:
1222
msgbox_1:
1235
	db 1,0
1223
	db 1,0
1236
	db '‚­¨¬ ­¨¥',0
1224
	db '‚­¨¬ ­¨¥',0
1237
	db ' §¬¥à ¡®ª®¢®£® ¨§®¡à ¦¥­¨ï ­¥ ª®à¥ªâ­ë©',0
1225
	db ' §¬¥à ¡®ª®¢®£® ¨§®¡à ¦¥­¨ï ­¥ ª®à¥ªâ­ë©',0
1238
	db '‡ ªàëâì',0
1226
	db '‡ ªàëâì',0
1239
	db 0
1227
	db 0
1240
 
1228
 
1241
msgbox_2:
1229
msgbox_2:
1242
	db 1,0
1230
	db 1,0
1243
	db '‚­¨¬ ­¨¥',0
1231
	db '‚­¨¬ ­¨¥',0
1244
	db ' §¬¥à ¯¥à¥¤­¥£® ¨§®¡à ¦¥­¨ï ­¥ ª®à¥ªâ­ë©',0
1232
	db ' §¬¥à ¯¥à¥¤­¥£® ¨§®¡à ¦¥­¨ï ­¥ ª®à¥ªâ­ë©',0
1245
	db '‡ ªàëâì',0
1233
	db '‡ ªàëâì',0
1246
	db 0
1234
	db 0
1247
 
1235
 
1248
msgbox_3:
1236
msgbox_3:
1249
	db 1,0
1237
	db 1,0
1250
	db '‚­¨¬ ­¨¥',0
1238
	db '‚­¨¬ ­¨¥',0
1251
	db ' §¬¥àë ¢¥àå­¥£® ¨ ¡®ª®¢®£® ¨§®¡à ¦¥­¨© ­¥ ᮢ¯ ¤ îâ',13,\
1239
	db ' §¬¥àë ¢¥àå­¥£® ¨ ¡®ª®¢®£® ¨§®¡à ¦¥­¨© ­¥ ᮢ¯ ¤ îâ',13,\
1252
		'Žâªà®©â¥ ¨§®¡à ¦¥­¨ï ®¤¨­ ª®¢ëå à §¬¥à®¢',0
1240
		'Žâªà®©â¥ ¨§®¡à ¦¥­¨ï ®¤¨­ ª®¢ëå à §¬¥à®¢',0
1253
	db '‡ ªàëâì',0
1241
	db '‡ ªàëâì',0
1254
	db 0
1242
	db 0
1255
 
1243
 
1256
msgbox_4:
1244
msgbox_4:
1257
	db 1,0
1245
	db 1,0
1258
	db '‚­¨¬ ­¨¥',0
1246
	db '‚­¨¬ ­¨¥',0
1259
	db 'Žâªà뢠¥¬ë© ä ©« ᮤ¥à¦¨â ­¥ ¢®ªá¥«ì­ë© ä®à¬ â',0
1247
	db 'Žâªà뢠¥¬ë© ä ©« ᮤ¥à¦¨â ­¥ ¢®ªá¥«ì­ë© ä®à¬ â',0
1260
	db '‡ ªàëâì',0
1248
	db '‡ ªàëâì',0
1261
	db 0
1249
	db 0
1262
 
1250
 
1263
;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
1251
;¤ ­­ë¥ ¤«ï ¤¨ «®£  ®âªàëâ¨ï ä ©«®¢
1264
align 4
1252
align 4
1265
OpenDialog_data:
1253
OpenDialog_data:
1266
.type			dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
1254
.type			dd 0 ;0 - ®âªàëâì, 1 - á®åà ­¨âì, 2 - ¢ë¡à âì ¤â४â®à¨î
1267
.procinfo		dd procinfo	;+4
1255
.procinfo		dd procinfo	;+4
1268
.com_area_name		dd communication_area_name	;+8
1256
.com_area_name		dd communication_area_name	;+8
1269
.com_area		dd 0	;+12
1257
.com_area		dd 0	;+12
1270
.opendir_path		dd plugin_path	;+16
1258
.opendir_path		dd plugin_path	;+16
1271
.dir_default_path	dd default_dir ;+20
1259
.dir_default_path	dd default_dir ;+20
1272
.start_path		dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
1260
.start_path		dd file_name ;+24 ¯ãâì ª ¤¨ «®£ã ®âªàëâ¨ï ä ©«®¢
1273
.draw_window		dd draw_window	;+28
1261
.draw_window		dd draw_window	;+28
1274
.status 		dd 0	;+32
1262
.status 		dd 0	;+32
1275
.openfile_path		dd openfile_path	;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
1263
.openfile_path		dd openfile_path	;+36 ¯ãâì ª ®âªà뢠¥¬®¬ã ä ©«ã
1276
.filename_area		dd filename_area	;+40
1264
.filename_area		dd filename_area	;+40
1277
.filter_area		dd Filter
1265
.filter_area		dd Filter
1278
.x:
1266
.x:
1279
.x_size 		dw 420 ;+48 ; Window X size
1267
.x_size 		dw 420 ;+48 ; Window X size
1280
.x_start		dw 10 ;+50 ; Window X position
1268
.x_start		dw 10 ;+50 ; Window X position
1281
.y:
1269
.y:
1282
.y_size 		dw 320 ;+52 ; Window y size
1270
.y_size 		dw 320 ;+52 ; Window y size
1283
.y_start		dw 10 ;+54 ; Window Y position
1271
.y_start		dw 10 ;+54 ; Window Y position
1284
 
1272
 
1285
default_dir db '/rd/1',0
1273
default_dir db '/rd/1',0
1286
 
1274
 
1287
communication_area_name:
1275
communication_area_name:
1288
	db 'FFFFFFFF_open_dialog',0
1276
	db 'FFFFFFFF_open_dialog',0
1289
open_dialog_name:
1277
open_dialog_name:
1290
	db 'opendial',0
1278
	db 'opendial',0
1291
communication_area_default_path:
1279
communication_area_default_path:
1292
	db '/rd/1/File managers/',0
1280
	db '/rd/1/File managers/',0
1293
 
1281
 
1294
Filter:
1282
Filter:
1295
dd Filter.end - Filter ;.1
1283
dd Filter.end - Filter ;.1
1296
.1:
1284
.1:
1297
db 'PNG',0
1285
db 'PNG',0
1298
db 'JPG',0
1286
db 'JPG',0
1299
db 'JPEG',0
1287
db 'JPEG',0
1300
db 'BMP',0
1288
db 'BMP',0
1301
db 'GIF',0
1289
db 'GIF',0
1302
db 'VOX',0
1290
db 'VOX',0
1303
.end:
1291
.end:
1304
db 0
1292
db 0
1305
 
1293
 
1306
 
1294
 
1307
 
1295
 
1308
head_f_i:
1296
head_f_i:
1309
head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
1297
head_f_l db '‘¨á⥬­ ï ®è¨¡ª ',0
1310
 
1298
 
1311
system_dir_0 db '/sys/lib/'
1299
system_dir_0 db '/sys/lib/'
1312
lib_name_0 db 'proc_lib.obj',0
1300
lib_name_0 db 'proc_lib.obj',0
1313
err_message_found_lib_0 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,0
1301
err_message_found_lib_0 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'proc_lib.obj',39,0
1314
err_message_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
1302
err_message_import_0 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'proc_lib.obj',39,0
1315
 
1303
 
1316
system_dir_1 db '/sys/lib/'
1304
system_dir_1 db '/sys/lib/'
1317
lib_name_1 db 'libimg.obj',0
1305
lib_name_1 db 'libimg.obj',0
1318
err_message_found_lib_1 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,0
1306
err_message_found_lib_1 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'libimg.obj',39,0
1319
err_message_import_1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0
1307
err_message_import_1 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'libimg.obj',39,0
1320
 
1308
 
1321
system_dir_2 db '/sys/lib/'
1309
system_dir_2 db '/sys/lib/'
1322
lib_name_2 db 'buf2d.obj',0
1310
lib_name_2 db 'buf2d.obj',0
1323
err_msg_found_lib_2 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'buf2d.obj',39,0
1311
err_msg_found_lib_2 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'buf2d.obj',39,0
1324
err_msg_import_2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,0
1312
err_msg_import_2 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'buf2d',39,0
1325
 
1313
 
1326
system_dir_3 db '/sys/lib/'
1314
system_dir_3 db '/sys/lib/'
1327
lib_name_3 db 'msgbox.obj',0
1315
lib_name_3 db 'msgbox.obj',0
1328
err_msg_found_lib_3 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'msgbox.obj',39,0
1316
err_msg_found_lib_3 db '¥ ­ ©¤¥­  ¡¨¡«¨®â¥ª  ',39,'msgbox.obj',39,0
1329
err_msg_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'msgbox',39,0
1317
err_msg_import_3 db 'Žè¨¡ª  ¯à¨ ¨¬¯®à⥠¡¨¡«¨®â¥ª¨ ',39,'msgbox',39,0
1330
 
1318
 
1331
l_libs_start:
1319
l_libs_start:
1332
	lib_0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
1320
	lib_0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\
1333
		err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i
1321
		err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i
1334
	lib_1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
1322
	lib_1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\
1335
		err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i
1323
		err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i
1336
	lib_2 l_libs lib_name_2, sys_path, library_path, system_dir_2,\
1324
	lib_2 l_libs lib_name_2, sys_path, library_path, system_dir_2,\
1337
		err_msg_found_lib_2,head_f_l,import_buf2d,err_msg_import_2,head_f_i
1325
		err_msg_found_lib_2,head_f_l,import_buf2d,err_msg_import_2,head_f_i
1338
	lib_3 l_libs lib_name_3, sys_path, library_path, system_dir_3,\
1326
	lib_3 l_libs lib_name_3, sys_path, library_path, system_dir_3,\
1339
		err_msg_found_lib_3,head_f_l,import_msgbox_lib,err_msg_import_3,head_f_i
1327
		err_msg_found_lib_3,head_f_l,import_msgbox_lib,err_msg_import_3,head_f_i
1340
l_libs_end:
1328
l_libs_end:
1341
 
1329
 
1342
align 4
1330
align 4
1343
import_libimg:
1331
import_libimg:
1344
	dd alib_init1
1332
	dd alib_init1
1345
	img_is_img  dd aimg_is_img
1333
	img_is_img  dd aimg_is_img
1346
	img_info    dd aimg_info
1334
	img_info    dd aimg_info
1347
	img_from_file dd aimg_from_file
1335
	img_from_file dd aimg_from_file
1348
	img_to_file dd aimg_to_file
1336
	img_to_file dd aimg_to_file
1349
	img_from_rgb dd aimg_from_rgb
1337
	img_from_rgb dd aimg_from_rgb
1350
	img_to_rgb  dd aimg_to_rgb
1338
	img_to_rgb  dd aimg_to_rgb
1351
	img_to_rgb2 dd aimg_to_rgb2
1339
	img_to_rgb2 dd aimg_to_rgb2
1352
	img_decode  dd aimg_decode
1340
	img_decode  dd aimg_decode
1353
	img_encode  dd aimg_encode
1341
	img_encode  dd aimg_encode
1354
	img_create  dd aimg_create
1342
	img_create  dd aimg_create
1355
	img_destroy dd aimg_destroy
1343
	img_destroy dd aimg_destroy
1356
	img_destroy_layer dd aimg_destroy_layer
1344
	img_destroy_layer dd aimg_destroy_layer
1357
	img_count   dd aimg_count
1345
	img_count   dd aimg_count
1358
	img_lock_bits dd aimg_lock_bits
1346
	img_lock_bits dd aimg_lock_bits
1359
	img_unlock_bits dd aimg_unlock_bits
1347
	img_unlock_bits dd aimg_unlock_bits
1360
	img_flip    dd aimg_flip
1348
	img_flip    dd aimg_flip
1361
	img_flip_layer dd aimg_flip_layer
1349
	img_flip_layer dd aimg_flip_layer
1362
	img_rotate  dd aimg_rotate
1350
	img_rotate  dd aimg_rotate
1363
	img_rotate_layer dd aimg_rotate_layer
1351
	img_rotate_layer dd aimg_rotate_layer
1364
	img_draw    dd aimg_draw
1352
	img_draw    dd aimg_draw
1365
 
1353
 
1366
	dd 0,0
1354
	dd 0,0
1367
	alib_init1   db 'lib_init',0
1355
	alib_init1   db 'lib_init',0
1368
	aimg_is_img  db 'img_is_img',0 ;®¯à¥¤¥«ï¥â ¯® ¤ ­­ë¬, ¬®¦¥â «¨ ¡¨¡«¨®â¥ª  ᤥ« âì ¨§ ­¨å ¨§®¡à ¦¥­¨¥
1356
	aimg_is_img  db 'img_is_img',0 ;®¯à¥¤¥«ï¥â ¯® ¤ ­­ë¬, ¬®¦¥â «¨ ¡¨¡«¨®â¥ª  ᤥ« âì ¨§ ­¨å ¨§®¡à ¦¥­¨¥
1369
	aimg_info    db 'img_info',0
1357
	aimg_info    db 'img_info',0
1370
	aimg_from_file db 'img_from_file',0
1358
	aimg_from_file db 'img_from_file',0
1371
	aimg_to_file db 'img_to_file',0
1359
	aimg_to_file db 'img_to_file',0
1372
	aimg_from_rgb db 'img_from_rgb',0
1360
	aimg_from_rgb db 'img_from_rgb',0
1373
	aimg_to_rgb  db 'img_to_rgb',0 ;¯à¥®¡à §®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¢ ¤ ­­ë¥ RGB
1361
	aimg_to_rgb  db 'img_to_rgb',0 ;¯à¥®¡à §®¢ ­¨¥ ¨§®¡à ¦¥­¨ï ¢ ¤ ­­ë¥ RGB
1374
	aimg_to_rgb2 db 'img_to_rgb2',0
1362
	aimg_to_rgb2 db 'img_to_rgb2',0
1375
	aimg_decode  db 'img_decode',0 ; ¢â®¬ â¨ç¥áª¨ ®¯à¥¤¥«ï¥â ä®à¬ â £à ä¨ç¥áª¨å ¤ ­­ëå
1363
	aimg_decode  db 'img_decode',0 ; ¢â®¬ â¨ç¥áª¨ ®¯à¥¤¥«ï¥â ä®à¬ â £à ä¨ç¥áª¨å ¤ ­­ëå
1376
	aimg_encode  db 'img_encode',0
1364
	aimg_encode  db 'img_encode',0
1377
	aimg_create  db 'img_create',0
1365
	aimg_create  db 'img_create',0
1378
	aimg_destroy db 'img_destroy',0
1366
	aimg_destroy db 'img_destroy',0
1379
	aimg_destroy_layer db 'img_destroy_layer',0
1367
	aimg_destroy_layer db 'img_destroy_layer',0
1380
	aimg_count   db 'img_count',0
1368
	aimg_count   db 'img_count',0
1381
	aimg_lock_bits db 'img_lock_bits',0
1369
	aimg_lock_bits db 'img_lock_bits',0
1382
	aimg_unlock_bits db 'img_unlock_bits',0
1370
	aimg_unlock_bits db 'img_unlock_bits',0
1383
	aimg_flip    db 'img_flip',0
1371
	aimg_flip    db 'img_flip',0
1384
	aimg_flip_layer db 'img_flip_layer',0
1372
	aimg_flip_layer db 'img_flip_layer',0
1385
	aimg_rotate  db 'img_rotate',0
1373
	aimg_rotate  db 'img_rotate',0
1386
	aimg_rotate_layer db 'img_rotate_layer',0
1374
	aimg_rotate_layer db 'img_rotate_layer',0
1387
	aimg_draw    db 'img_draw',0
1375
	aimg_draw    db 'img_draw',0
1388
 
1376
 
1389
align 4
1377
align 4
1390
proclib_import: ;®¯¨á ­¨¥ íªá¯®àâ¨à㥬ëå ä㭪権
1378
proclib_import: ;®¯¨á ­¨¥ íªá¯®àâ¨à㥬ëå ä㭪権
1391
	OpenDialog_Init dd aOpenDialog_Init
1379
	OpenDialog_Init dd aOpenDialog_Init
1392
	OpenDialog_Start dd aOpenDialog_Start
1380
	OpenDialog_Start dd aOpenDialog_Start
1393
dd 0,0
1381
dd 0,0
1394
	aOpenDialog_Init db 'OpenDialog_init',0
1382
	aOpenDialog_Init db 'OpenDialog_init',0
1395
	aOpenDialog_Start db 'OpenDialog_start',0
1383
	aOpenDialog_Start db 'OpenDialog_start',0
1396
 
1384
 
1397
align 4
1385
align 4
1398
import_buf2d:
1386
import_buf2d:
1399
	init dd sz_init
1387
	init dd sz_init
1400
	buf2d_create dd sz_buf2d_create
1388
	buf2d_create dd sz_buf2d_create
1401
	buf2d_create_f_img dd sz_buf2d_create_f_img
1389
	buf2d_create_f_img dd sz_buf2d_create_f_img
1402
	buf2d_clear dd sz_buf2d_clear
1390
	buf2d_clear dd sz_buf2d_clear
1403
	buf2d_draw dd sz_buf2d_draw
1391
	buf2d_draw dd sz_buf2d_draw
1404
	buf2d_delete dd sz_buf2d_delete
1392
	buf2d_delete dd sz_buf2d_delete
1405
	buf2d_resize dd sz_buf2d_resize
1393
	buf2d_resize dd sz_buf2d_resize
1406
	buf2d_line dd sz_buf2d_line
1394
	buf2d_line dd sz_buf2d_line
1407
	buf2d_rect_by_size dd sz_buf2d_rect_by_size
1395
	buf2d_rect_by_size dd sz_buf2d_rect_by_size
1408
	buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
1396
	buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size
1409
	buf2d_circle dd sz_buf2d_circle
1397
	buf2d_circle dd sz_buf2d_circle
1410
	buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
1398
	buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2
1411
	buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
1399
	buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2
1412
	buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
1400
	buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8
1413
	buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
1401
	buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32
1414
	buf2d_bit_blt dd sz_buf2d_bit_blt
1402
	buf2d_bit_blt dd sz_buf2d_bit_blt
1415
	buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
1403
	buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp
1416
	buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
1404
	buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha
1417
	buf2d_curve_bezier dd sz_buf2d_curve_bezier
1405
	buf2d_curve_bezier dd sz_buf2d_curve_bezier
1418
	buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
1406
	buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix
1419
	buf2d_draw_text dd sz_buf2d_draw_text
1407
	buf2d_draw_text dd sz_buf2d_draw_text
1420
	buf2d_crop_color dd sz_buf2d_crop_color
1408
	buf2d_crop_color dd sz_buf2d_crop_color
1421
	buf2d_offset_h dd sz_buf2d_offset_h
1409
	buf2d_offset_h dd sz_buf2d_offset_h
1422
	buf2d_flood_fill dd sz_buf2d_flood_fill
1410
	buf2d_flood_fill dd sz_buf2d_flood_fill
1423
	buf2d_set_pixel dd sz_buf2d_set_pixel
1411
	buf2d_set_pixel dd sz_buf2d_set_pixel
1424
	buf2d_get_pixel dd sz_buf2d_get_pixel
1412
	buf2d_get_pixel dd sz_buf2d_get_pixel
1425
	buf2d_vox_brush_create dd sz_buf2d_vox_brush_create
1413
	buf2d_vox_brush_create dd sz_buf2d_vox_brush_create
1426
	buf2d_vox_brush_delete dd sz_buf2d_vox_brush_delete
1414
	buf2d_vox_brush_delete dd sz_buf2d_vox_brush_delete
1427
	buf2d_vox_obj_get_img_w_3g dd sz_buf2d_vox_obj_get_img_w_3g
1415
	buf2d_vox_obj_get_img_w_3g dd sz_buf2d_vox_obj_get_img_w_3g
1428
	buf2d_vox_obj_get_img_h_3g dd sz_buf2d_vox_obj_get_img_h_3g
1416
	buf2d_vox_obj_get_img_h_3g dd sz_buf2d_vox_obj_get_img_h_3g
1429
	buf2d_vox_obj_draw_1g dd sz_buf2d_vox_obj_draw_1g
1417
	buf2d_vox_obj_draw_1g dd sz_buf2d_vox_obj_draw_1g
1430
	buf2d_vox_obj_draw_3g dd sz_buf2d_vox_obj_draw_3g
1418
	buf2d_vox_obj_draw_3g dd sz_buf2d_vox_obj_draw_3g
1431
	buf2d_vox_obj_draw_3g_scaled dd sz_buf2d_vox_obj_draw_3g_scaled
1419
	buf2d_vox_obj_draw_3g_scaled dd sz_buf2d_vox_obj_draw_3g_scaled
1432
	buf2d_vox_obj_draw_3g_shadows dd sz_buf2d_vox_obj_draw_3g_shadows
1420
	buf2d_vox_obj_draw_3g_shadows dd sz_buf2d_vox_obj_draw_3g_shadows
1433
	buf2d_vox_obj_draw_pl dd sz_buf2d_vox_obj_draw_pl
1421
	buf2d_vox_obj_draw_pl dd sz_buf2d_vox_obj_draw_pl
1434
	buf2d_vox_obj_draw_pl_scaled dd sz_buf2d_vox_obj_draw_pl_scaled
1422
	buf2d_vox_obj_draw_pl_scaled dd sz_buf2d_vox_obj_draw_pl_scaled
1435
	dd 0,0
1423
	dd 0,0
1436
	sz_init db 'lib_init',0
1424
	sz_init db 'lib_init',0
1437
	sz_buf2d_create db 'buf2d_create',0
1425
	sz_buf2d_create db 'buf2d_create',0
1438
	sz_buf2d_create_f_img db 'buf2d_create_f_img',0
1426
	sz_buf2d_create_f_img db 'buf2d_create_f_img',0
1439
	sz_buf2d_clear db 'buf2d_clear',0
1427
	sz_buf2d_clear db 'buf2d_clear',0
1440
	sz_buf2d_draw db 'buf2d_draw',0
1428
	sz_buf2d_draw db 'buf2d_draw',0
1441
	sz_buf2d_delete db 'buf2d_delete',0
1429
	sz_buf2d_delete db 'buf2d_delete',0
1442
	sz_buf2d_resize db 'buf2d_resize',0
1430
	sz_buf2d_resize db 'buf2d_resize',0
1443
	sz_buf2d_line db 'buf2d_line',0
1431
	sz_buf2d_line db 'buf2d_line',0
1444
	sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
1432
	sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0
1445
	sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
1433
	sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0
1446
	sz_buf2d_circle db 'buf2d_circle',0
1434
	sz_buf2d_circle db 'buf2d_circle',0
1447
	sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
1435
	sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0
1448
	sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
1436
	sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0
1449
	sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
1437
	sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0
1450
	sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
1438
	sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0
1451
	sz_buf2d_bit_blt db 'buf2d_bit_blt',0
1439
	sz_buf2d_bit_blt db 'buf2d_bit_blt',0
1452
	sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
1440
	sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0
1453
	sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
1441
	sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0
1454
	sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
1442
	sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0
1455
	sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
1443
	sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0
1456
	sz_buf2d_draw_text db 'buf2d_draw_text',0
1444
	sz_buf2d_draw_text db 'buf2d_draw_text',0
1457
	sz_buf2d_crop_color db 'buf2d_crop_color',0
1445
	sz_buf2d_crop_color db 'buf2d_crop_color',0
1458
	sz_buf2d_offset_h db 'buf2d_offset_h',0
1446
	sz_buf2d_offset_h db 'buf2d_offset_h',0
1459
	sz_buf2d_flood_fill db 'buf2d_flood_fill',0
1447
	sz_buf2d_flood_fill db 'buf2d_flood_fill',0
1460
	sz_buf2d_set_pixel db 'buf2d_set_pixel',0
1448
	sz_buf2d_set_pixel db 'buf2d_set_pixel',0
1461
	sz_buf2d_get_pixel db 'buf2d_get_pixel',0
1449
	sz_buf2d_get_pixel db 'buf2d_get_pixel',0
1462
	sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0
1450
	sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0
1463
	sz_buf2d_vox_brush_delete db 'buf2d_vox_brush_delete',0
1451
	sz_buf2d_vox_brush_delete db 'buf2d_vox_brush_delete',0
1464
	sz_buf2d_vox_obj_get_img_w_3g db 'buf2d_vox_obj_get_img_w_3g',0
1452
	sz_buf2d_vox_obj_get_img_w_3g db 'buf2d_vox_obj_get_img_w_3g',0
1465
	sz_buf2d_vox_obj_get_img_h_3g db 'buf2d_vox_obj_get_img_h_3g',0
1453
	sz_buf2d_vox_obj_get_img_h_3g db 'buf2d_vox_obj_get_img_h_3g',0
1466
	sz_buf2d_vox_obj_draw_1g db 'buf2d_vox_obj_draw_1g',0
1454
	sz_buf2d_vox_obj_draw_1g db 'buf2d_vox_obj_draw_1g',0
1467
	sz_buf2d_vox_obj_draw_3g db 'buf2d_vox_obj_draw_3g',0
1455
	sz_buf2d_vox_obj_draw_3g db 'buf2d_vox_obj_draw_3g',0
1468
	sz_buf2d_vox_obj_draw_3g_scaled db 'buf2d_vox_obj_draw_3g_scaled',0
1456
	sz_buf2d_vox_obj_draw_3g_scaled db 'buf2d_vox_obj_draw_3g_scaled',0
1469
	sz_buf2d_vox_obj_draw_3g_shadows db 'buf2d_vox_obj_draw_3g_shadows',0
1457
	sz_buf2d_vox_obj_draw_3g_shadows db 'buf2d_vox_obj_draw_3g_shadows',0
1470
	sz_buf2d_vox_obj_draw_pl db 'buf2d_vox_obj_draw_pl',0
1458
	sz_buf2d_vox_obj_draw_pl db 'buf2d_vox_obj_draw_pl',0
1471
	sz_buf2d_vox_obj_draw_pl_scaled db 'buf2d_vox_obj_draw_pl_scaled',0
1459
	sz_buf2d_vox_obj_draw_pl_scaled db 'buf2d_vox_obj_draw_pl_scaled',0
1472
 
1460
 
1473
align 4
1461
align 4
1474
import_msgbox_lib:
1462
import_msgbox_lib:
1475
	mb_create dd amb_create
1463
	mb_create dd amb_create
1476
;	mb_reinit dd amb_reinit
1464
;	mb_reinit dd amb_reinit
1477
;	mb_setfunctions dd amb_setfunctions
1465
;	mb_setfunctions dd amb_setfunctions
1478
dd 0,0
1466
dd 0,0
1479
	amb_create db 'mb_create',0
1467
	amb_create db 'mb_create',0
1480
;	amb_reinit db 'mb_reinit',0
1468
;	amb_reinit db 'mb_reinit',0
1481
;	amb_setfunctions db 'mb_setfunctions',0
1469
;	amb_setfunctions db 'mb_setfunctions',0
1482
 
1470
 
1483
mouse_dd dd 0x0
1471
mouse_dd dd 0x0
1484
sc system_colors 
1472
sc system_colors 
1485
last_time dd 0
1473
last_time dd 0
1486
 
1474
 
1487
align 16
1475
align 16
1488
procinfo process_information 
1476
procinfo process_information 
1489
 
1477
 
1490
align 4
1478
align 4
1491
buf_0: dd 0
1479
buf_0: dd 0
1492
	dw 5 ;+4 left
1480
	dw 5 ;+4 left
1493
	dw 35 ;+6 top
1481
	dw 35 ;+6 top
1494
.w: dd 6*64 ;+8 w
1482
.w: dd 6*64 ;+8 w
1495
.h: dd 7*64 ;+12 h
1483
.h: dd 7*64 ;+12 h
1496
.color: dd 0xffffff ;+16 color
1484
.color: dd 0xffffff ;+16 color
1497
	db 24 ;+20 bit in pixel
1485
	db 24 ;+20 bit in pixel
1498
 
1486
 
1499
align 4
1487
align 4
1500
buf_0z: dd 0
1488
buf_0z: dd 0
1501
	dw 5 ;+4 left
1489
	dw 5 ;+4 left
1502
	dw 35 ;+6 top
1490
	dw 35 ;+6 top
1503
.w: dd 6*64 ;+8 w
1491
.w: dd 6*64 ;+8 w
1504
.h: dd 7*64 ;+12 h
1492
.h: dd 7*64 ;+12 h
1505
.color: dd 0 ;+16 color
1493
.color: dd 0 ;+16 color
1506
	db 32 ;+20 bit in pixel
1494
	db 32 ;+20 bit in pixel
1507
 
1495
 
1508
align 4
1496
align 4
1509
buf_i0: dd 0
1497
buf_i0: dd 0
1510
	dw 5 ;+4 left
1498
	dw 5 ;+4 left
1511
	dw 35 ;+6 top
1499
	dw 35 ;+6 top
1512
.w: dd 0 ;+8 w
1500
.w: dd 0 ;+8 w
1513
.h: dd 0 ;+12 h
1501
.h: dd 0 ;+12 h
1514
.color: dd 0 ;+16 color
1502
.color: dd 0 ;+16 color
1515
	db 24 ;+20 bit in pixel
1503
	db 24 ;+20 bit in pixel
1516
 
1504
 
1517
align 4
1505
align 4
1518
buf_i1: dd 0
1506
buf_i1: dd 0
1519
	dw 105 ;+4 left
1507
	dw 105 ;+4 left
1520
	dw 35 ;+6 top
1508
	dw 35 ;+6 top
1521
.w: dd 0 ;+8 w
1509
.w: dd 0 ;+8 w
1522
.h: dd 0 ;+12 h
1510
.h: dd 0 ;+12 h
1523
.color: dd 0 ;+16 color
1511
.color: dd 0 ;+16 color
1524
	db 24 ;+20 bit in pixel
1512
	db 24 ;+20 bit in pixel
1525
 
1513
 
1526
align 4
1514
align 4
1527
buf_i2: dd 0
1515
buf_i2: dd 0
1528
	dw 205 ;+4 left
1516
	dw 205 ;+4 left
1529
	dw 35 ;+6 top
1517
	dw 35 ;+6 top
1530
.w: dd 0 ;+8 w
1518
.w: dd 0 ;+8 w
1531
.h: dd 0 ;+12 h
1519
.h: dd 0 ;+12 h
1532
.color: dd 0 ;+16 color
1520
.color: dd 0 ;+16 color
1533
	db 24 ;+20 bit in pixel
1521
	db 24 ;+20 bit in pixel
1534
 
1522
 
1535
align 4
1523
align 4
1536
buf_npl_p: dd 0
1524
buf_npl_p: dd 0
1537
	dw 0 ;+4 left
1525
	dw 0 ;+4 left
1538
	dw 0 ;+6 top
1526
	dw 0 ;+6 top
1539
.w: dd 0 ;+8 w
1527
.w: dd 0 ;+8 w
1540
.h: dd 0 ;+12 h
1528
.h: dd 0 ;+12 h
1541
.color: dd 0 ;+16 color
1529
.color: dd 0 ;+16 color
1542
	db 24 ;+20 bit in pixel
1530
	db 24 ;+20 bit in pixel
1543
 
1531
 
1544
align 4
1532
align 4
1545
buf_npl: dd 0
1533
buf_npl: dd 0
1546
	dw 5 ;+4 left
1534
	dw 5 ;+4 left
1547
	dw 35 ;+6 top
1535
	dw 35 ;+6 top
1548
.w: dd 0 ;+8 w
1536
.w: dd 0 ;+8 w
1549
.h: dd 0 ;+12 h
1537
.h: dd 0 ;+12 h
1550
.color: dd 0 ;+16 color
1538
.color: dd 0 ;+16 color
1551
	db 24 ;+20 bit in pixel
1539
	db 24 ;+20 bit in pixel
1552
 
1540
 
1553
align 4
1541
align 4
1554
buf_npl_n: dd 0
1542
buf_npl_n: dd 0
1555
	dw 0 ;+4 left
1543
	dw 0 ;+4 left
1556
	dw 0 ;+6 top
1544
	dw 0 ;+6 top
1557
.w: dd 0 ;+8 w
1545
.w: dd 0 ;+8 w
1558
.h: dd 0 ;+12 h
1546
.h: dd 0 ;+12 h
1559
.color: dd 0 ;+16 color
1547
.color: dd 0 ;+16 color
1560
	db 24 ;+20 bit in pixel
1548
	db 24 ;+20 bit in pixel
1561
 
1549
 
1562
;¤ ­­ë¥ ¤«ï ᮧ¤ ­¨ï ¬¨­¨¬ «ì­®£® ¥¤¨­¨ç­®£® ¢®ªá¥«ï
1550
;¤ ­­ë¥ ¤«ï ᮧ¤ ­¨ï ¬¨­¨¬ «ì­®£® ¥¤¨­¨ç­®£® ¢®ªá¥«ï
1563
align 4
1551
align 4
1564
vox_6_7_z:
1552
vox_6_7_z:
1565
dd 0,0,1,1,0,0,\
1553
dd 0,0,1,1,0,0,\
1566
   0,2,2,2,2,0,\
1554
   0,2,2,2,2,0,\
1567
   2,2,2,2,2,2,\
1555
   2,2,2,2,2,2,\
1568
   2,3,2,2,3,2,\
1556
   2,3,2,2,3,2,\
1569
   2,3,3,3,3,2,\
1557
   2,3,3,3,3,2,\
1570
   0,3,3,3,3,0,\
1558
   0,3,3,3,3,0,\
1571
   0,0,3,3,0,0
1559
   0,0,3,3,0,0
1572
 
1560
 
1573
align 4
1561
align 4
1574
buf_vox:
1562
buf_vox:
1575
	db 6,7,4,3 ;w,h,h_osn,n
1563
	db 6,7,4,3 ;w,h,h_osn,n
1576
	rb BUF_STRUCT_SIZE*(2+1)
1564
	rb BUF_STRUCT_SIZE*(2+1)
1577
 
1565
 
1578
 
1566
 
1579
align 16
1567
align 16
1580
i_end:
1568
i_end:
1581
		rb 2048
1569
		rb 2048
1582
	thread:
1570
	thread:
1583
		rb 2048
1571
		rb 2048
1584
stacktop:
1572
stacktop:
1585
	sys_path rb 1024
1573
	sys_path rb 1024
1586
	file_name:
1574
	file_name:
1587
		rb 1024 ;4096 
1575
		rb 1024 ;4096 
1588
	library_path rb 1024
1576
	library_path rb 1024
1589
	plugin_path rb 4096
1577
	plugin_path rb 4096
1590
	openfile_path rb 4096
1578
	openfile_path rb 4096
1591
	filename_area rb 256
1579
	filename_area rb 256
1592
mem:
1580
mem: