Subversion Repositories Kolibri OS

Rev

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

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