Subversion Repositories Kolibri OS

Rev

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

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