Rev 2933 | Rev 2975 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
2748 | IgorA | 1 | use32 |
2 | org 0x0 |
||
3 | db 'MENUET01' ;идентиф. исполняемого файла всегда 8 байт |
||
4 | dd 0x1 |
||
5 | dd start |
||
6 | dd i_end ;размер приложения |
||
7 | dd mem |
||
8 | dd stacktop |
||
9 | dd 0 |
||
10 | dd sys_path |
||
11 | |||
2759 | IgorA | 12 | include '../../../../programs/macros.inc' |
13 | include '../../../../programs/proc32.inc' |
||
14 | include '../../../../programs/develop/libraries/box_lib/load_lib.mac' |
||
2748 | IgorA | 15 | include 'mem.inc' |
16 | include 'dll.inc' |
||
17 | include 'vox_draw.inc' |
||
18 | |||
19 | @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load |
||
2974 | IgorA | 20 | caption db 'Voxel editor 12.09.12',0 ;подпись окна |
2748 | IgorA | 21 | |
22 | struct FileInfoBlock |
||
23 | Function dd ? |
||
24 | Position dd ? |
||
25 | Flags dd ? |
||
26 | Count dd ? |
||
27 | Buffer dd ? |
||
28 | db ? |
||
29 | FileName dd ? |
||
30 | ends |
||
31 | |||
32 | run_file_70 FileInfoBlock |
||
33 | image_data dd 0 ;указатель на временную память. для нужен преобразования изображения |
||
34 | |||
35 | fn_toolbar db 'toolbar.png',0 |
||
36 | IMAGE_TOOLBAR_ICON_SIZE equ 16*16*3 |
||
2974 | IgorA | 37 | IMAGE_TOOLBAR_SIZE equ IMAGE_TOOLBAR_ICON_SIZE*22 |
2748 | IgorA | 38 | image_data_toolbar dd 0 |
2933 | IgorA | 39 | cursors_count equ 4 |
40 | IMAGE_CURSORS_SIZE equ 4096*cursors_count ;размер картинки с курсорами |
||
2748 | IgorA | 41 | |
2876 | IgorA | 42 | ;значения задаваемые по умолчанию, без ini файла |
43 | ini_def_window_t equ 10 |
||
44 | ini_def_window_l equ 10 |
||
45 | ini_def_window_w equ 550 |
||
46 | ini_def_window_h equ 415 |
||
47 | ini_def_buf_w equ 198 ;=192+6 |
||
48 | ini_def_buf_h equ 231 ;=224+7 |
||
49 | ini_def_s_zoom equ 5 |
||
50 | ini_def_t_size equ 10 |
||
51 | ini_def_color_b equ 0xffffff |
||
52 | ;описание параматров для ini файла |
||
53 | ini_name db 'vox_editor.ini',0 |
||
54 | ini_sec_window db 'Window',0 |
||
55 | key_window_t db 't',0 |
||
56 | key_window_l db 'l',0 |
||
57 | key_window_w db 'w',0 |
||
58 | key_window_h db 'h',0 |
||
59 | key_buf_w db 'buf_w',0 |
||
60 | key_buf_h db 'buf_h',0 |
||
61 | ini_sec_options db 'Options',0 |
||
62 | key_s_zoom db 's_zoom',0 |
||
63 | key_t_size db 'tile_size',0 |
||
64 | key_f_size db 'file_size',0 |
||
65 | key_col_b db 'c_background',0 |
||
2748 | IgorA | 66 | |
67 | macro load_image_file path,buf,size { ;макрос для загрузки изображений |
||
68 | ;path - может быть переменной или строковым параметром |
||
69 | if path eqtype '' ;проверяем задан ли строкой параметр path |
||
70 | jmp @f |
||
71 | local .path_str |
||
72 | .path_str db path ;формируем локальную переменную |
||
73 | db 0 |
||
74 | @@: |
||
75 | ;32 - стандартный адрес по которому должен быть буфер с системным путем |
||
76 | copy_path .path_str,[32],file_name,0x0 |
||
77 | else |
||
78 | copy_path path,[32],file_name,0x0 ;формируем полный путь к файлу изображения, подразумеваем что он в одной папке с программой |
||
79 | end if |
||
80 | |||
81 | stdcall mem.Alloc, dword size ;выделяем память для изображения |
||
82 | mov [buf],eax |
||
83 | |||
84 | mov eax,70 ;70-я функция работа с файлами |
||
85 | mov [run_file_70.Function], 0 |
||
86 | mov [run_file_70.Position], 0 |
||
87 | mov [run_file_70.Flags], 0 |
||
88 | mov [run_file_70.Count], dword size |
||
89 | m2m [run_file_70.Buffer], [buf] |
||
90 | mov byte[run_file_70+20], 0 |
||
91 | mov [run_file_70.FileName], file_name |
||
92 | mov ebx,run_file_70 |
||
93 | int 0x40 ;загружаем файл изображения |
||
94 | cmp ebx,0xffffffff |
||
95 | je @f |
||
96 | ;определяем вид изображения и переводим его во временный буфер image_data |
||
97 | stdcall dword[img_decode], dword[buf],ebx,0 |
||
98 | mov dword[image_data],eax |
||
99 | ;преобразуем изображение к формату rgb |
||
100 | stdcall dword[img_to_rgb2], dword[image_data],dword[buf] |
||
101 | ;удаляем временный буфер image_data |
||
102 | stdcall dword[img_destroy], dword[image_data] |
||
103 | @@: |
||
104 | } |
||
105 | |||
106 | OT_MAP_X equ 0 |
||
107 | OT_MAP_Y equ 0 |
||
2758 | IgorA | 108 | OT_CAPT_X_COLOR equ 5 ;отступ для подписи цвета |
109 | OT_CAPT_Y_COLOR equ 30 |
||
2933 | IgorA | 110 | PEN_MODE_NONE equ -1 |
111 | PEN_MODE_CLEAR equ 0 ;режим стирания |
||
2883 | IgorA | 112 | PEN_MODE_SELECT_COLOR equ 2 ;режим выбора цвета |
2748 | IgorA | 113 | |
114 | align 4 |
||
115 | start: |
||
116 | load_libraries l_libs_start,l_libs_end |
||
117 | ;проверка на сколько удачно загузилась библиотека |
||
118 | mov ebp,lib_2 |
||
119 | cmp dword [ebp+ll_struc_size-4],0 |
||
120 | jz @f |
||
121 | mcall -1 ;exit not correct |
||
122 | @@: |
||
123 | mcall 48,3,sc,sizeof.system_colors |
||
124 | mcall 40,0x27 |
||
125 | stdcall [OpenDialog_Init],OpenDialog_data ;подготовка диалога |
||
126 | |||
2876 | IgorA | 127 | ;--- load ini file --- |
128 | copy_path ini_name,sys_path,file_name,0 |
||
129 | ;window startup pozition |
||
130 | stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_l,ini_def_window_l |
||
131 | mov word[wnd_s_pos+2],ax |
||
132 | stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_w,ini_def_window_w |
||
133 | mov word[wnd_s_pos],ax |
||
134 | stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_t,ini_def_window_t |
||
135 | mov word[wnd_s_pos+6],ax |
||
136 | stdcall dword[ini_get_int],file_name,ini_sec_window,key_window_h,ini_def_window_h |
||
137 | mov word[wnd_s_pos+4],ax |
||
138 | ;image buffer size |
||
139 | stdcall dword[ini_get_int],file_name,ini_sec_window,key_buf_w,ini_def_buf_w |
||
140 | mov [buf_0.w],eax |
||
141 | mov [buf_0z.w],eax |
||
142 | add ax,15 |
||
143 | mov [buf_pl.l],ax ;отступ для правого окна |
||
144 | stdcall dword[ini_get_int],file_name,ini_sec_window,key_buf_h,ini_def_buf_h |
||
145 | mov [buf_0.h],eax |
||
146 | mov [buf_0z.h],eax |
||
147 | ;цвет фона |
||
148 | stdcall dword[ini_get_color],file_name,ini_sec_window,key_col_b,ini_def_color_b |
||
149 | mov [buf_0.color],eax |
||
150 | mov [buf_pl.color],eax |
||
151 | |||
152 | ;мастаб, после которого будет увеличение |
||
153 | stdcall dword[ini_get_int],file_name,ini_sec_options,key_s_zoom,ini_def_s_zoom |
||
154 | mov [scaled_zoom],eax |
||
155 | ;размер квадратика на плоскости сечения |
||
156 | stdcall dword[ini_get_int],file_name,ini_sec_options,key_t_size,ini_def_t_size |
||
157 | mov [tile_size],eax |
||
158 | |||
159 | stdcall dword[ini_get_int],file_name,ini_sec_options,key_f_size,64 |
||
160 | shl eax,10 |
||
161 | mov [max_open_file_size],eax |
||
162 | |||
163 | mov ecx,[scaled_zoom] |
||
164 | xor eax,eax |
||
165 | inc eax |
||
166 | shl eax,cl |
||
167 | imul eax,[tile_size] |
||
168 | mov [buf_pl.w],eax |
||
169 | add eax,[tile_size] |
||
170 | mov [buf_pl.h],eax |
||
171 | |||
2933 | IgorA | 172 | ;*** загрузка курсоров |
173 | load_image_file 'cursors_gr.png',image_data_toolbar,IMAGE_CURSORS_SIZE |
||
174 | stdcall [buf2d_create_f_img], buf_curs_8,[image_data_toolbar] ;создаем буфер |
||
175 | stdcall mem.Free,[image_data_toolbar] ;освобождаем память |
||
176 | |||
177 | load_image_file 'cursors.png',image_data_toolbar, IMAGE_CURSORS_SIZE |
||
178 | stdcall [buf2d_create_f_img], buf_curs,[image_data_toolbar] ;создаем буфер |
||
179 | stdcall mem.Free,[image_data_toolbar] ;освобождаем память |
||
180 | |||
181 | stdcall [buf2d_conv_24_to_8], buf_curs_8,1 ;делаем буфер прозрачности 8бит |
||
182 | stdcall [buf2d_conv_24_to_32],buf_curs,buf_curs_8 ;делаем буфер rgba 32бит |
||
183 | |||
184 | |||
2748 | IgorA | 185 | stdcall [buf2d_create], buf_0 ;создание буфера изображения |
186 | stdcall [buf2d_create], buf_0z ;создание буфера глубины |
||
187 | stdcall [buf2d_create], buf_pl ;создание буфера для сечения |
||
188 | |||
189 | stdcall [buf2d_vox_brush_create], buf_vox, vox_6_7_z |
||
190 | |||
191 | load_image_file fn_toolbar, image_data_toolbar,IMAGE_TOOLBAR_SIZE |
||
192 | |||
2876 | IgorA | 193 | stdcall mem.Alloc,[max_open_file_size] |
2748 | IgorA | 194 | mov dword[open_file_vox],eax |
195 | |||
196 | call but_new_file |
||
197 | |||
2933 | IgorA | 198 | ;первоначальная установка курсора |
199 | stdcall set_pen_mode,1,0,((9 shl 8)+9) shl 16 ;pen |
||
200 | |||
2748 | IgorA | 201 | align 4 |
202 | red_win: |
||
203 | call draw_window |
||
204 | |||
205 | align 4 |
||
206 | still: |
||
207 | mcall 10 |
||
208 | |||
209 | cmp al,1 |
||
210 | jz red_win |
||
211 | cmp al,2 |
||
212 | jz key |
||
213 | cmp al,3 |
||
214 | jz button |
||
215 | cmp al,6 |
||
216 | jne @f |
||
217 | mcall 9,procinfo,-1 |
||
218 | cmp ax,word[procinfo+4] |
||
219 | jne @f ;окно не активно |
||
220 | call mouse |
||
221 | @@: |
||
222 | jmp still |
||
223 | |||
224 | align 4 |
||
225 | mouse: |
||
226 | pushad |
||
227 | mcall 37,2 |
||
2758 | IgorA | 228 | bt eax,1 ;right button |
229 | jnc @f |
||
230 | mcall 37,1 ;get mouse coords |
||
231 | mov ebx,eax |
||
232 | shr ebx,16 |
||
233 | and eax,0xffff |
||
234 | stdcall get_buf_color, buf_0 |
||
235 | stdcall get_buf_color, buf_pl |
||
236 | jmp .end_f |
||
237 | @@: |
||
2748 | IgorA | 238 | bt eax,0 ;left button |
239 | jnc .end_f |
||
240 | mcall 37,1 ;get mouse coords |
||
241 | mov ebx,eax |
||
2758 | IgorA | 242 | shr ebx,16 |
2748 | IgorA | 243 | and eax,0xffff |
244 | |||
2883 | IgorA | 245 | cmp dword[v_pen_mode],PEN_MODE_SELECT_COLOR |
2748 | IgorA | 246 | jne .end_2 |
247 | stdcall get_buf_color, buf_0 |
||
248 | stdcall get_buf_color, buf_pl |
||
249 | jmp .end_f |
||
250 | .end_2: |
||
251 | |||
2758 | IgorA | 252 | |
253 | push eax ebx |
||
254 | mov edx,[v_zoom] |
||
255 | cmp edx,[scaled_zoom] |
||
256 | jle @f |
||
257 | ;режим масштабирования изображения |
||
258 | sub edx,[scaled_zoom] |
||
259 | sub ax,word[buf_0.t] |
||
260 | sub bx,word[buf_0.l] |
||
261 | stdcall get_mouse_ev_scale, buf_vox, ebx, eax, [scaled_zoom],edx |
||
262 | cmp eax,0 |
||
263 | je @f |
||
264 | mov ebx,eax |
||
265 | and eax,0x3fffffff |
||
266 | rol ebx,2 |
||
267 | and ebx,3 |
||
268 | dec ebx |
||
269 | |||
270 | shl ebx,2 |
||
271 | add ebx,cam_x |
||
272 | mov dword[ebx],eax ;change [cam_x] or [cam_y] or [cam_z] |
||
273 | call draw_objects |
||
274 | |||
275 | pop ebx eax |
||
276 | jmp .end_f |
||
277 | @@: |
||
278 | pop ebx eax |
||
279 | |||
280 | |||
281 | ;eax - mouse coord y |
||
282 | ;ebx - mouse coord x |
||
2748 | IgorA | 283 | movzx edx,word[buf_pl.t] |
284 | add edx,OT_MAP_Y |
||
285 | cmp eax,edx |
||
286 | jl .end_f |
||
287 | sub eax,edx |
||
288 | xor edx,edx |
||
2876 | IgorA | 289 | mov ecx,[tile_size] ;H |
2748 | IgorA | 290 | div ecx |
291 | movzx edx,word[buf_pl.l] |
||
292 | add edx,OT_MAP_X |
||
293 | cmp ebx,edx |
||
294 | jl .end_f |
||
295 | call convert_y ;преобразование координаты y |
||
296 | cmp eax,0 |
||
297 | jge .end_0 ;ограничение по нижней координате y |
||
298 | cmp eax,-1 |
||
299 | jne .end_f |
||
300 | ;меняем сечение, попали на квадратик |
||
301 | sub ebx,edx |
||
302 | mov eax,ebx |
||
303 | xor edx,edx |
||
2876 | IgorA | 304 | mov ecx,[tile_size] ;W |
2748 | IgorA | 305 | div ecx |
306 | mov [n_plane],eax |
||
307 | jmp .end_1 |
||
308 | .end_0: |
||
309 | mov [v_cur_y],eax ;Y-coord |
||
310 | sub ebx,edx |
||
311 | mov eax,ebx |
||
312 | xor edx,edx |
||
2876 | IgorA | 313 | mov ecx,[tile_size] ;W |
2748 | IgorA | 314 | div ecx |
315 | mov [v_cur_x],eax ;X-coord |
||
316 | |||
2933 | IgorA | 317 | cmp dword[v_pen_mode],PEN_MODE_CLEAR |
2758 | IgorA | 318 | jl .end_1 |
2748 | IgorA | 319 | cmp dword[v_pen_mode],1 |
2758 | IgorA | 320 | jg .end_1 |
321 | mov eax,[v_cur_x] |
||
322 | mov ebx,[n_plane] |
||
323 | mov edx,[v_cur_y] |
||
2883 | IgorA | 324 | |
2758 | IgorA | 325 | mov ecx,[v_zoom] |
326 | cmp ecx,[scaled_zoom] |
||
327 | jle .no_c_coord_0 |
||
328 | ;преобразование координат, с учетом увеличения |
||
329 | ;sub ecx,[scaled_zoom] ;в ecx прирост масштаба (ecx>0) |
||
330 | mov ecx,[scaled_zoom] |
||
331 | |||
332 | mov edi,[cam_x] |
||
333 | shl edi,cl |
||
334 | add eax,edi |
||
335 | mov edi,[cam_y] |
||
336 | shl edi,cl |
||
337 | add ebx,edi |
||
338 | mov edi,[cam_z] |
||
339 | shl edi,cl |
||
340 | add edx,edi |
||
341 | .no_c_coord_0: |
||
342 | |||
343 | ;отличающийся параметр для функции создания вокселя |
||
344 | cmp dword[v_pen_mode],1 |
||
345 | jne @f |
||
346 | push dword[v_color] |
||
347 | @@: |
||
348 | |||
349 | ;вызов общих параметров для функций |
||
350 | push dword[v_zoom] |
||
351 | push edx |
||
352 | push ebx |
||
353 | push eax |
||
354 | push dword[open_file_vox] |
||
355 | |||
356 | ;вызов функций |
||
357 | cmp dword[v_pen_mode],1 |
||
358 | jne @f |
||
359 | call buf2d_vox_obj_create_node |
||
360 | ;stdcall buf2d_vox_obj_create_node, [open_file_vox], eax,ebx,edx, [v_zoom], [v_color] |
||
361 | jmp .end_1 |
||
362 | @@: |
||
363 | call buf2d_vox_obj_delete_node |
||
364 | ;stdcall buf2d_vox_obj_delete_node, [open_file_vox], eax,ebx,edx, [v_zoom] |
||
365 | |||
2748 | IgorA | 366 | .end_1: |
367 | call draw_objects |
||
368 | call draw_pok |
||
369 | .end_f: |
||
370 | popad |
||
371 | ret |
||
372 | |||
2758 | IgorA | 373 | ;input: |
374 | ; eax - coord y |
||
375 | ; ebx - coord x |
||
2748 | IgorA | 376 | align 4 |
2758 | IgorA | 377 | proc get_buf_color, buf:dword |
378 | pushad |
||
2748 | IgorA | 379 | mov edi,[buf] |
380 | cmp ax,buf2d_t |
||
381 | jl .end_f |
||
382 | sub ax,buf2d_t |
||
383 | cmp eax,buf2d_h |
||
384 | jg .end_f |
||
385 | cmp bx,buf2d_l |
||
386 | jl .end_f |
||
387 | sub bx,buf2d_l |
||
388 | cmp ebx,buf2d_w |
||
389 | jg .end_f |
||
390 | stdcall [buf2d_get_pixel], edi,ebx,eax |
||
391 | mov [v_color],eax |
||
2759 | IgorA | 392 | call on_change_color ;отображаем изменения цвета |
2748 | IgorA | 393 | .end_f: |
2758 | IgorA | 394 | popad |
2748 | IgorA | 395 | ret |
396 | endp |
||
397 | |||
398 | ;преобразовываем координату y (значение должно увеличиваться с низу вверх) |
||
399 | align 4 |
||
400 | convert_y: |
||
401 | push ecx edx |
||
402 | mov ecx,[v_zoom] |
||
2758 | IgorA | 403 | cmp ecx,[scaled_zoom] |
404 | jle @f |
||
405 | mov ecx,[scaled_zoom] |
||
406 | @@: |
||
2748 | IgorA | 407 | mov edx,1 |
408 | cmp ecx,1 |
||
2758 | IgorA | 409 | jl @f |
410 | shl edx,cl |
||
2748 | IgorA | 411 | @@: |
412 | sub edx,eax |
||
413 | dec edx |
||
414 | mov eax,edx |
||
415 | pop edx ecx |
||
416 | ret |
||
417 | |||
418 | align 4 |
||
419 | draw_window: |
||
420 | pushad |
||
421 | mcall 12,1 |
||
422 | |||
423 | ; *** рисование главного окна (выполняется 1 раз при запуске) *** |
||
424 | mov edx,[sc.work] |
||
425 | or edx,(3 shl 24)+0x30000000 |
||
426 | mov edi,caption |
||
2876 | IgorA | 427 | mcall 0,dword[wnd_s_pos],dword[wnd_s_pos+4] |
2748 | IgorA | 428 | |
429 | ; *** создание кнопок на панель *** |
||
430 | mov eax,8 |
||
431 | mov ebx,(5 shl 16)+20 |
||
432 | mov ecx,(5 shl 16)+20 |
||
433 | mov edx,3 |
||
434 | mov esi,[sc.work_button] |
||
435 | int 0x40 |
||
436 | |||
437 | mov ebx,(30 shl 16)+20 |
||
438 | mov edx,4 |
||
439 | int 0x40 |
||
440 | add ebx,25 shl 16 |
||
441 | mov edx,5 |
||
442 | int 0x40 |
||
443 | add ebx,30 shl 16 |
||
444 | mov edx,6 |
||
445 | int 0x40 |
||
446 | add ebx,25 shl 16 |
||
447 | mov edx,7 |
||
448 | int 0x40 |
||
449 | add ebx,25 shl 16 |
||
450 | mov edx,8 |
||
451 | int 0x40 |
||
452 | add ebx,25 shl 16 |
||
453 | mov edx,9 |
||
454 | int 0x40 |
||
455 | add ebx,25 shl 16 |
||
456 | mov edx,10 |
||
457 | int 0x40 |
||
458 | add ebx,25 shl 16 |
||
459 | mov edx,11 |
||
460 | int 0x40 |
||
461 | add ebx,25 shl 16 |
||
462 | mov edx,12 |
||
463 | int 0x40 |
||
464 | add ebx,25 shl 16 |
||
465 | mov edx,13 |
||
466 | int 0x40 |
||
467 | add ebx,25 shl 16 |
||
468 | mov edx,14 |
||
469 | int 0x40 |
||
470 | add ebx,25 shl 16 |
||
471 | mov edx,15 |
||
472 | int 0x40 |
||
473 | add ebx,25 shl 16 |
||
474 | mov edx,16 |
||
475 | int 0x40 |
||
2883 | IgorA | 476 | add ebx,25 shl 16 |
477 | mov edx,17 |
||
478 | int 0x40 |
||
479 | add ebx,25 shl 16 |
||
480 | mov edx,18 |
||
481 | int 0x40 |
||
482 | add ebx,25 shl 16 |
||
483 | mov edx,19 |
||
484 | int 0x40 |
||
485 | add ebx,25 shl 16 |
||
486 | mov edx,20 |
||
487 | int 0x40 |
||
488 | add ebx,25 shl 16 |
||
489 | mov edx,21 |
||
490 | int 0x40 |
||
491 | add ebx,25 shl 16 |
||
492 | mov edx,22 |
||
493 | int 0x40 |
||
494 | add ebx,25 shl 16 |
||
495 | mov edx,23 |
||
496 | int 0x40 |
||
2974 | IgorA | 497 | add ebx,25 shl 16 |
498 | mov edx,24 |
||
499 | int 0x40 |
||
2748 | IgorA | 500 | |
501 | ; *** рисование иконок на кнопках *** |
||
502 | mov eax,7 |
||
503 | mov ebx,[image_data_toolbar] |
||
504 | mov ecx,(16 shl 16)+16 |
||
505 | mov edx,(7 shl 16)+7 ;icon new |
||
506 | int 0x40 |
||
507 | |||
508 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
509 | add edx,(25 shl 16) ;icon open |
||
510 | int 0x40 |
||
511 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
512 | add edx,(25 shl 16) ;icon save |
||
513 | int 0x40 |
||
514 | |||
515 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
2883 | IgorA | 516 | add edx,(30 shl 16) ;увелич. масштаб |
2748 | IgorA | 517 | int 0x40 |
518 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
2883 | IgorA | 519 | add edx,(25 shl 16) ;уменьш. масштаб |
2748 | IgorA | 520 | int 0x40 |
521 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
2883 | IgorA | 522 | add edx,(25 shl 16) ;поворот 1 |
2748 | IgorA | 523 | int 0x40 |
524 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
2883 | IgorA | 525 | add edx,(25 shl 16) ;поворот 2 |
2748 | IgorA | 526 | int 0x40 |
527 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
2883 | IgorA | 528 | add edx,(25 shl 16) ;сдвиг плоскости + |
2748 | IgorA | 529 | int 0x40 |
530 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
2883 | IgorA | 531 | add edx,(25 shl 16) ;сдвиг плоскости - |
2748 | IgorA | 532 | int 0x40 |
533 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
2883 | IgorA | 534 | add edx,(25 shl 16) ;инструмент карандаш |
2748 | IgorA | 535 | int 0x40 |
536 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
2883 | IgorA | 537 | add edx,(25 shl 16) ;инструмент кисть |
2748 | IgorA | 538 | int 0x40 |
539 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
2883 | IgorA | 540 | add edx,(25 shl 16) ;инструмент затирачка |
2748 | IgorA | 541 | int 0x40 |
542 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
2883 | IgorA | 543 | add edx,(25 shl 16) ;выбор цвета |
2748 | IgorA | 544 | int 0x40 |
545 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
2883 | IgorA | 546 | add edx,(25 shl 16) ;освещение |
2748 | IgorA | 547 | int 0x40 |
2883 | IgorA | 548 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
549 | add edx,(25 shl 16) ;рендер 2*2 |
||
550 | int 0x40 |
||
551 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
552 | add edx,(25 shl 16) ;создать кисть |
||
553 | int 0x40 |
||
554 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
555 | add edx,(25 shl 16) ;нарисовать кисть |
||
556 | int 0x40 |
||
557 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
2974 | IgorA | 558 | add edx,(25 shl 16) ;удалить кисть |
559 | int 0x40 |
||
560 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
2883 | IgorA | 561 | add edx,(25 shl 16) ;ширина кисти -1 |
562 | int 0x40 |
||
563 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
564 | add edx,(25 shl 16) ;ширина кисти +1 |
||
565 | int 0x40 |
||
566 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
567 | add edx,(25 shl 16) ;высота кисти -1 |
||
568 | int 0x40 |
||
569 | add ebx,IMAGE_TOOLBAR_ICON_SIZE |
||
570 | add edx,(25 shl 16) ;высота кисти +1 |
||
571 | int 0x40 |
||
2748 | IgorA | 572 | |
573 | ; *** рисование буферов *** |
||
574 | call draw_objects |
||
575 | call draw_pok |
||
576 | |||
577 | mcall 12,2 |
||
578 | popad |
||
579 | ret |
||
580 | |||
581 | align 4 |
||
582 | draw_pok: |
||
583 | mov eax,47 |
||
584 | mov ecx,[v_zoom] |
||
2759 | IgorA | 585 | mov ebx,(3 shl 16)+(1 shl 31) |
2883 | IgorA | 586 | mov edx,((350+6*9) shl 16)+OT_CAPT_Y_COLOR+2 |
2748 | IgorA | 587 | mov esi,[sc.work_button_text] |
588 | or esi,(1 shl 30) |
||
589 | mov edi,[sc.work_button] |
||
590 | int 0x40 ;масштаб |
||
591 | mov ecx,[n_plane] |
||
2883 | IgorA | 592 | add edx,115 shl 16 ;9 |
2759 | IgorA | 593 | int 0x40 ;номер сечения |
2748 | IgorA | 594 | |
2883 | IgorA | 595 | ;обновление параметров курсора |
596 | mov dword[txt_curor.size],0 |
||
597 | mov eax,dword[v_cur_x] |
||
598 | mov edi,txt_curor.size |
||
599 | call convert_int_to_str |
||
600 | stdcall str_cat, edi,txt_mull |
||
601 | mov eax,dword[v_cur_y] |
||
602 | mov edi,txt_buf |
||
603 | call convert_int_to_str |
||
604 | stdcall str_cat, txt_curor.size,edi |
||
605 | stdcall str_cat, txt_curor.size,txt_space ;завершающий пробел |
||
606 | |||
607 | ;обновление параметров кисти |
||
608 | mov dword[txt_brush.size],0 |
||
609 | mov eax,dword[brush_w] |
||
610 | mov edi,txt_brush.size |
||
611 | call convert_int_to_str |
||
612 | stdcall str_cat, edi,txt_mull |
||
613 | mov eax,dword[brush_h] |
||
614 | mov edi,txt_buf |
||
615 | call convert_int_to_str |
||
616 | stdcall str_cat, txt_brush.size,edi |
||
617 | stdcall str_cat, txt_brush.size,txt_space ;завершающий пробел |
||
618 | |||
2758 | IgorA | 619 | mov eax,4 ;рисование текста |
620 | mov ebx,(OT_CAPT_X_COLOR shl 16)+OT_CAPT_Y_COLOR+2 |
||
621 | mov ecx,[sc.work_text] |
||
622 | or ecx,0x80000000 ;or (1 shl 30) |
||
623 | mov edx,txt_color |
||
624 | int 0x40 |
||
625 | |||
2883 | IgorA | 626 | mov edx,txt_curor |
627 | add ebx,115 shl 16 |
||
628 | or ecx,(1 shl 30) |
||
629 | mov edi,[sc.work] |
||
630 | int 0x40 |
||
631 | |||
632 | mov edx,txt_brush |
||
633 | add ebx,115 shl 16 |
||
634 | int 0x40 |
||
635 | |||
636 | mov edx,txt_zoom |
||
637 | add ebx,115 shl 16 |
||
638 | int 0x40 |
||
639 | |||
640 | mov edx,txt_n_plane |
||
641 | add ebx,115 shl 16 |
||
642 | int 0x40 |
||
643 | |||
2759 | IgorA | 644 | call on_change_color |
645 | ret |
||
646 | |||
647 | align 4 |
||
648 | on_change_color: |
||
649 | pushad |
||
2758 | IgorA | 650 | mov ebx,((OT_CAPT_X_COLOR+35) shl 16)+16 ;по оси x |
651 | mov ecx,(OT_CAPT_Y_COLOR shl 16)+12 ;по оси y |
||
652 | mov edx,[v_color] |
||
653 | mcall 13 |
||
2759 | IgorA | 654 | |
655 | mov ebx,(1 shl 8)+(6 shl 16) |
||
656 | mov ecx,edx |
||
657 | mov edx,((OT_CAPT_X_COLOR+55) shl 16)+OT_CAPT_Y_COLOR+2 |
||
658 | mov esi,[sc.work_text] |
||
659 | add esi,(1 shl 30) |
||
660 | mov edi,[sc.work] |
||
661 | mcall 47 |
||
662 | popad |
||
2748 | IgorA | 663 | ret |
664 | |||
665 | align 4 |
||
666 | key: |
||
667 | mcall 2 |
||
668 | jmp still |
||
669 | |||
670 | |||
671 | align 4 |
||
672 | button: |
||
673 | mcall 17 |
||
674 | cmp ah,3 |
||
675 | jne @f |
||
676 | call but_new_file |
||
677 | call draw_objects |
||
678 | call draw_pok |
||
679 | @@: |
||
680 | cmp ah,4 |
||
681 | jne @f |
||
682 | call but_open_file |
||
683 | @@: |
||
684 | cmp ah,5 |
||
685 | jne @f |
||
686 | call but_save_file |
||
687 | @@: |
||
688 | cmp ah,6 |
||
689 | jne @f |
||
2759 | IgorA | 690 | call but_zoom_p |
2748 | IgorA | 691 | @@: |
692 | cmp ah,7 |
||
693 | jne @f |
||
2759 | IgorA | 694 | call but_zoom_m |
2748 | IgorA | 695 | @@: |
696 | cmp ah,8 |
||
697 | jne @f |
||
698 | call but_3 |
||
699 | @@: |
||
700 | cmp ah,9 |
||
701 | jne @f |
||
702 | call but_4 |
||
703 | @@: |
||
704 | cmp ah,10 |
||
705 | jne @f |
||
2974 | IgorA | 706 | call but_plane_inc |
2748 | IgorA | 707 | @@: |
708 | cmp ah,11 |
||
709 | jne @f |
||
2974 | IgorA | 710 | call but_plane_dec |
2748 | IgorA | 711 | @@: |
712 | cmp ah,12 |
||
713 | jne @f |
||
2883 | IgorA | 714 | call but_mode_pen |
2748 | IgorA | 715 | @@: |
716 | cmp ah,13 |
||
717 | jne @f |
||
2883 | IgorA | 718 | call but_mode_brush |
2748 | IgorA | 719 | @@: |
720 | cmp ah,14 |
||
721 | jne @f |
||
2883 | IgorA | 722 | call but_mode_clear |
2748 | IgorA | 723 | @@: |
724 | cmp ah,15 |
||
725 | jne @f |
||
2933 | IgorA | 726 | stdcall set_pen_mode,PEN_MODE_SELECT_COLOR,3,((9 shl 8)+9) shl 16 |
2883 | IgorA | 727 | call draw_palete |
2748 | IgorA | 728 | @@: |
729 | cmp ah,16 |
||
730 | jne @f |
||
2883 | IgorA | 731 | call but_light |
732 | @@: |
||
733 | cmp ah,17 |
||
734 | jne @f |
||
2748 | IgorA | 735 | call but_rend_2_2 |
736 | @@: |
||
2883 | IgorA | 737 | cmp ah,18 |
738 | jne @f |
||
739 | call but_brush_copy |
||
740 | @@: |
||
741 | cmp ah,19 |
||
742 | jne @f |
||
743 | call but_brush_draw |
||
744 | @@: |
||
745 | cmp ah,20 |
||
746 | jne @f |
||
2974 | IgorA | 747 | call but_brush_clear |
2883 | IgorA | 748 | @@: |
749 | cmp ah,21 |
||
750 | jne @f |
||
2974 | IgorA | 751 | call but_bru_w_m |
2883 | IgorA | 752 | @@: |
753 | cmp ah,22 |
||
754 | jne @f |
||
2974 | IgorA | 755 | call but_bru_w_p |
2883 | IgorA | 756 | @@: |
757 | cmp ah,23 |
||
758 | jne @f |
||
2974 | IgorA | 759 | call but_bru_h_m |
760 | @@: |
||
761 | cmp ah,24 |
||
762 | jne @f |
||
2883 | IgorA | 763 | call but_bru_h_p |
764 | @@: |
||
2748 | IgorA | 765 | cmp ah,1 |
766 | jne still |
||
767 | .exit: |
||
768 | stdcall [buf2d_delete],buf_0 |
||
769 | stdcall [buf2d_delete],buf_0z |
||
770 | cmp dword[buf_r_img],0 |
||
771 | je @f |
||
772 | stdcall [buf2d_delete],buf_r_img |
||
773 | stdcall [buf2d_delete],buf_r_z |
||
774 | @@: |
||
775 | stdcall [buf2d_vox_brush_delete], buf_vox |
||
2933 | IgorA | 776 | stdcall [buf2d_delete],buf_curs |
777 | stdcall [buf2d_delete],buf_curs_8 |
||
2748 | IgorA | 778 | stdcall mem.Free,[image_data_toolbar] |
779 | stdcall mem.Free,[open_file_vox] |
||
780 | mcall -1 |
||
781 | |||
2974 | IgorA | 782 | ;данные для инициализации воксельного объекта |
2748 | IgorA | 783 | align 4 |
784 | vox_new_data: |
||
785 | db 2,0,0,0 |
||
2974 | IgorA | 786 | db 0,1,2,3,4,5,6,7 ;default table |
2748 | IgorA | 787 | dd 0 ;null node |
788 | |||
2974 | IgorA | 789 | ;инициализация воксельного объекта |
2748 | IgorA | 790 | align 4 |
791 | proc but_new_file uses ecx edi esi |
||
792 | mov ecx,vox_offs_data+4 |
||
793 | mov esi,vox_new_data |
||
794 | mov edi,[open_file_vox] |
||
795 | cld |
||
796 | rep movsb |
||
797 | ret |
||
798 | endp |
||
799 | |||
800 | align 4 |
||
801 | open_file_vox dd 0 ;указатель на область для открытия файлов |
||
802 | |||
803 | align 4 |
||
804 | but_open_file: |
||
805 | pushad |
||
806 | copy_path open_dialog_name,communication_area_default_path,file_name,0 |
||
807 | mov [OpenDialog_data.type],0 |
||
808 | stdcall [OpenDialog_Start],OpenDialog_data |
||
809 | cmp [OpenDialog_data.status],2 |
||
810 | je .end_open_file |
||
811 | ;код при удачном открытии диалога |
||
812 | |||
813 | mov eax,70 ;70-я функция работа с файлами |
||
814 | mov [run_file_70.Function], 0 |
||
815 | mov [run_file_70.Position], 0 |
||
816 | mov [run_file_70.Flags], 0 |
||
2876 | IgorA | 817 | m2m dword[run_file_70.Count], dword[max_open_file_size] |
2748 | IgorA | 818 | m2m [run_file_70.Buffer], [open_file_vox] |
819 | mov byte[run_file_70+20], 0 |
||
820 | mov dword[run_file_70.FileName], openfile_path |
||
821 | mov ebx,run_file_70 |
||
822 | int 0x40 ;загружаем файл изображения |
||
823 | cmp ebx,0xffffffff |
||
824 | je .end_open_file |
||
825 | |||
2876 | IgorA | 826 | ;add ebx,[open_file_vox] |
827 | ;mov byte[ebx],0 ;на случай если ранее был открыт файл большего размера чистим конец буфера с файлом |
||
2748 | IgorA | 828 | mcall 71,1,openfile_path |
829 | |||
830 | ;--- |
||
831 | ; |
||
832 | mov eax,[open_file_vox] |
||
833 | movzx eax,byte[eax] |
||
834 | and eax,0xff ;берем масштаб по умолчанию |
||
835 | mov dword[v_zoom],eax ;берем масштаб по умолчанию |
||
2759 | IgorA | 836 | mov dword[cam_x],0 |
837 | mov dword[cam_y],0 |
||
838 | mov dword[cam_z],0 |
||
2748 | IgorA | 839 | call draw_objects |
840 | .end_open_file: |
||
841 | popad |
||
842 | ret |
||
843 | |||
844 | align 4 |
||
845 | but_save_file: |
||
846 | pushad |
||
847 | copy_path open_dialog_name,communication_area_default_path,file_name,0 |
||
848 | mov [OpenDialog_data.type],1 |
||
849 | stdcall [OpenDialog_Start],OpenDialog_data |
||
850 | cmp [OpenDialog_data.status],2 |
||
851 | je .end_save_file |
||
852 | ;код при удачном открытии диалога |
||
853 | |||
854 | mov eax,dword[v_zoom] ;задаем масштаб по умолчанию |
||
855 | mov ebx,[open_file_vox] |
||
856 | mov byte[ebx],al |
||
857 | |||
858 | stdcall buf2d_vox_obj_get_size, ebx |
||
859 | mov dword[run_file_70.Count], eax ;размер файла |
||
860 | mov eax,70 ;70-я функция работа с файлами |
||
861 | mov [run_file_70.Function], 2 |
||
862 | mov [run_file_70.Position], 0 |
||
863 | mov [run_file_70.Flags], 0 |
||
864 | mov ebx, dword[open_file_vox] |
||
865 | mov [run_file_70.Buffer], ebx |
||
866 | mov byte[run_file_70+20], 0 |
||
867 | mov dword[run_file_70.FileName], openfile_path |
||
868 | mov ebx,run_file_70 |
||
869 | int 0x40 ;загружаем файл изображения |
||
870 | cmp ebx,0xffffffff |
||
871 | je .end_save_file |
||
872 | |||
873 | .end_save_file: |
||
874 | popad |
||
875 | ret |
||
876 | |||
2758 | IgorA | 877 | ;увеличение масштаба |
2748 | IgorA | 878 | align 4 |
2759 | IgorA | 879 | but_zoom_p: |
2758 | IgorA | 880 | cmp dword[v_zoom],10 ;максимальный размер, до которого можно увеличить 2^10=1024 |
2748 | IgorA | 881 | jge @f |
882 | inc dword[v_zoom] |
||
883 | shl dword[n_plane],1 |
||
2758 | IgorA | 884 | push eax |
885 | mov eax,[v_zoom] |
||
886 | cmp eax,[scaled_zoom] |
||
887 | jl .end_0 |
||
2759 | IgorA | 888 | push ecx |
889 | mov ecx,[scaled_zoom] |
||
890 | xor eax,eax |
||
891 | inc eax |
||
892 | shl eax,cl |
||
2758 | IgorA | 893 | shl dword[cam_x],1 |
894 | shl dword[cam_y],1 |
||
895 | shl dword[cam_z],1 |
||
2759 | IgorA | 896 | cmp eax,[n_plane] |
897 | jg .end_1 |
||
898 | ;коректировка ползунка |
||
899 | sub [n_plane],eax |
||
900 | inc dword[cam_y] |
||
901 | .end_1: |
||
902 | pop ecx |
||
2758 | IgorA | 903 | .end_0: |
904 | pop eax |
||
2748 | IgorA | 905 | call draw_objects |
906 | call draw_pok |
||
907 | @@: |
||
908 | ret |
||
909 | |||
2758 | IgorA | 910 | ;уменьшение масштаба |
2748 | IgorA | 911 | align 4 |
2759 | IgorA | 912 | but_zoom_m: |
913 | cmp dword[v_zoom],1 |
||
2748 | IgorA | 914 | jl @f |
915 | dec dword[v_zoom] |
||
916 | shr dword[n_plane],1 |
||
2758 | IgorA | 917 | push eax |
918 | mov eax,[v_zoom] |
||
919 | cmp eax,[scaled_zoom] |
||
920 | jl .end_0 |
||
921 | shr dword[cam_x],1 |
||
922 | shr dword[cam_y],1 |
||
2759 | IgorA | 923 | jnc .end_1 |
924 | ;коректировка ползунка |
||
925 | push ecx |
||
926 | mov ecx,[scaled_zoom] |
||
927 | dec ecx |
||
928 | xor eax,eax |
||
929 | inc eax |
||
930 | shl eax,cl |
||
931 | add [n_plane],eax |
||
932 | pop ecx |
||
933 | .end_1: |
||
2758 | IgorA | 934 | shr dword[cam_z],1 |
935 | .end_0: |
||
936 | pop eax |
||
2748 | IgorA | 937 | call draw_objects |
938 | call draw_pok |
||
939 | @@: |
||
940 | ret |
||
941 | |||
942 | align 4 |
||
943 | but_3: |
||
944 | stdcall vox_obj_rot_z, [open_file_vox] |
||
945 | call draw_objects |
||
946 | ret |
||
947 | |||
948 | align 4 |
||
949 | but_4: |
||
950 | stdcall vox_obj_rot_x, [open_file_vox] |
||
951 | call draw_objects |
||
952 | ret |
||
953 | |||
2759 | IgorA | 954 | ;сдвигаем плоскость среза |
2748 | IgorA | 955 | align 4 |
2974 | IgorA | 956 | but_plane_inc: |
2759 | IgorA | 957 | push eax ecx |
2748 | IgorA | 958 | inc dword[n_plane] |
2759 | IgorA | 959 | mov eax,[v_zoom] |
960 | cmp eax,[scaled_zoom] |
||
961 | jle .end_0 |
||
962 | ;происходит масштабирование |
||
963 | mov ecx,[scaled_zoom] |
||
964 | xor eax,eax |
||
965 | inc eax |
||
966 | shl eax,cl |
||
967 | cmp eax,[n_plane] |
||
968 | jg @f |
||
969 | mov dword[n_plane],0 |
||
970 | inc dword[cam_y] ;переходим в соседний куб |
||
971 | neg ecx |
||
972 | ;inc ecx |
||
973 | add ecx,[v_zoom] |
||
974 | xor eax,eax |
||
975 | inc eax |
||
976 | shl eax,cl |
||
977 | cmp eax,[cam_y] |
||
978 | jg @f |
||
979 | mov dword[cam_y],0 ;зацикливаем если вылезли за пределы последнего куба |
||
980 | @@: |
||
981 | jmp .end_1 |
||
982 | .end_0: |
||
983 | ;масштабирование не происходит |
||
984 | mov ecx,eax |
||
985 | xor eax,eax |
||
986 | inc eax |
||
987 | shl eax,cl |
||
988 | cmp eax,[n_plane] |
||
989 | jg .end_1 |
||
990 | mov dword[n_plane],0 |
||
991 | .end_1: |
||
2748 | IgorA | 992 | call draw_objects |
993 | call draw_pok |
||
2759 | IgorA | 994 | pop ecx eax |
2748 | IgorA | 995 | ret |
996 | |||
2759 | IgorA | 997 | ;сдвигаем плоскость среза |
2748 | IgorA | 998 | align 4 |
2974 | IgorA | 999 | but_plane_dec: |
2759 | IgorA | 1000 | dec dword[n_plane] |
2748 | IgorA | 1001 | cmp dword[n_plane],0 |
2759 | IgorA | 1002 | jge .end_f |
1003 | push eax ecx |
||
1004 | mov ecx,[scaled_zoom] |
||
1005 | xor eax,eax |
||
1006 | inc eax |
||
1007 | shl eax,cl |
||
1008 | dec eax |
||
1009 | mov dword[n_plane],eax |
||
1010 | |||
1011 | mov eax,[v_zoom] |
||
1012 | cmp eax,[scaled_zoom] |
||
1013 | jle .end_0 |
||
1014 | ;происходит масштабирование |
||
1015 | dec dword[cam_y] ;переходим в соседний куб |
||
1016 | cmp dword[cam_y],0 |
||
1017 | jge .end_0 |
||
1018 | |||
1019 | mov ecx,eax |
||
1020 | sub ecx,[scaled_zoom] |
||
1021 | xor eax,eax |
||
1022 | inc eax |
||
1023 | shl eax,cl |
||
1024 | dec eax |
||
1025 | mov dword[cam_y],eax ;если номер куба оказался меньше 0 исправляем на максимальное значение |
||
1026 | .end_0: |
||
1027 | pop ecx eax |
||
1028 | .end_f: |
||
1029 | call draw_objects |
||
1030 | call draw_pok |
||
2748 | IgorA | 1031 | ret |
1032 | |||
1033 | align 4 |
||
2883 | IgorA | 1034 | but_mode_pen: |
2748 | IgorA | 1035 | push eax |
1036 | mov eax,dword[v_pen_mode] |
||
2933 | IgorA | 1037 | stdcall set_pen_mode,1,0,((9 shl 8)+9) shl 16 ;pen |
2883 | IgorA | 1038 | cmp eax,PEN_MODE_SELECT_COLOR |
2748 | IgorA | 1039 | jne @f |
1040 | call draw_objects |
||
1041 | @@: |
||
1042 | pop eax |
||
1043 | ret |
||
1044 | |||
1045 | align 4 |
||
2883 | IgorA | 1046 | but_mode_brush: |
2748 | IgorA | 1047 | push eax |
1048 | mov eax,dword[v_pen_mode] |
||
2933 | IgorA | 1049 | stdcall set_pen_mode,3,1,((9 shl 8)+9) shl 16 ;brush |
2883 | IgorA | 1050 | cmp eax,PEN_MODE_SELECT_COLOR |
1051 | jne @f |
||
1052 | call draw_objects |
||
1053 | @@: |
||
1054 | pop eax |
||
1055 | ret |
||
1056 | |||
1057 | align 4 |
||
1058 | but_mode_clear: |
||
1059 | push eax |
||
1060 | mov eax,dword[v_pen_mode] |
||
2933 | IgorA | 1061 | stdcall set_pen_mode,PEN_MODE_CLEAR,2,((15 shl 8)+9) shl 16 |
2883 | IgorA | 1062 | cmp eax,PEN_MODE_SELECT_COLOR |
2748 | IgorA | 1063 | jne @f |
1064 | call draw_objects |
||
1065 | @@: |
||
1066 | pop eax |
||
1067 | ret |
||
1068 | |||
1069 | align 4 |
||
1070 | but_light: |
||
1071 | xor dword[mode_light],1 |
||
1072 | call draw_objects |
||
1073 | ret |
||
1074 | |||
1075 | align 4 |
||
1076 | but_rend_2_2: |
||
1077 | push edi |
||
1078 | cmp dword[buf_r_img],0 |
||
1079 | jne @f |
||
1080 | ;создание буфера для рендера |
||
1081 | push ecx esi |
||
1082 | mov edi,buf_r_img |
||
1083 | mov esi,buf_0 |
||
1084 | mov ecx,BUF_STRUCT_SIZE |
||
1085 | cld |
||
1086 | rep movsb ;копируем все параметры с основного буфера |
||
1087 | mov edi,buf_r_img |
||
1088 | mov buf2d_data,0 |
||
1089 | shl buf2d_w,1 ;увеличиваем размер буфера |
||
1090 | shl buf2d_h,1 |
||
1091 | stdcall [buf2d_create],buf_r_img |
||
1092 | |||
1093 | mov edi,buf_r_z |
||
1094 | mov esi,buf_0z |
||
1095 | mov ecx,BUF_STRUCT_SIZE |
||
1096 | cld |
||
1097 | rep movsb ;копируем все параметры с основного буфера |
||
1098 | mov edi,buf_r_z |
||
1099 | mov buf2d_data,0 |
||
1100 | shl buf2d_w,1 ;увеличиваем размер буфера |
||
1101 | shl buf2d_h,1 |
||
1102 | stdcall [buf2d_create],buf_r_z |
||
1103 | pop esi ecx |
||
1104 | @@: |
||
1105 | stdcall [buf2d_clear], buf_r_img, [buf_0.color] ;чистим буфер |
||
1106 | stdcall [buf2d_clear], buf_r_z, 0 ;чистим буфер |
||
1107 | |||
1108 | push eax ebx ecx |
||
1109 | mov eax,[v_zoom] |
||
2758 | IgorA | 1110 | cmp eax,[scaled_zoom] |
1111 | jle .end_scaled |
||
1112 | ;рендер увеличенной части объекта |
||
1113 | mov ebx,[scaled_zoom] |
||
1114 | sub eax,ebx |
||
1115 | inc ebx |
||
2808 | IgorA | 1116 | stdcall [buf2d_vox_obj_draw_3g_scaled], buf_r_img, buf_r_z, buf_vox,\ |
1117 | [open_file_vox], 0,0, 0, ebx, [cam_x],[cam_y],[cam_z],eax, [sc.work_graph] |
||
2758 | IgorA | 1118 | bt dword[mode_light],0 |
1119 | jnc @f |
||
1120 | stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, buf_vox, 0,0, 0, ebx, 3 |
||
1121 | @@: |
||
1122 | xor ebx,ebx |
||
1123 | xor ecx,ecx |
||
1124 | mov edi,buf_r_img |
||
1125 | stdcall [buf2d_img_hdiv2], edi |
||
1126 | shr buf2d_h,1 |
||
1127 | stdcall [buf2d_img_wdiv2], edi |
||
1128 | shr buf2d_w,1 |
||
1129 | jmp .show |
||
1130 | .end_scaled: |
||
1131 | |||
2748 | IgorA | 1132 | inc eax |
2758 | IgorA | 1133 | stdcall [buf2d_vox_obj_draw_3g], buf_r_img, buf_r_z, buf_vox, [open_file_vox], 0,0, 0, eax |
2815 | IgorA | 1134 | stdcall [buf2d_vox_obj_draw_1g], buf_r_img, buf_r_z, [open_file_vox], 0,0, eax |
2748 | IgorA | 1135 | bt dword[mode_light],0 |
1136 | jnc @f |
||
2758 | IgorA | 1137 | stdcall [buf2d_vox_obj_draw_3g_shadows], buf_r_img, buf_r_z, buf_vox, 0,0, 0, eax, 3 |
2748 | IgorA | 1138 | @@: |
1139 | |||
1140 | mov edi,buf_r_img |
||
1141 | stdcall [buf2d_img_hdiv2], edi |
||
1142 | shr buf2d_h,1 |
||
1143 | stdcall [buf2d_img_wdiv2], edi |
||
1144 | shr buf2d_w,1 |
||
1145 | |||
2758 | IgorA | 1146 | stdcall [buf2d_vox_obj_get_img_w_3g], buf_vox,[v_zoom] |
2748 | IgorA | 1147 | mov ebx,[buf_0.w] |
1148 | sub ebx,eax |
||
1149 | shr ebx,1 ;ebx - для центровки маленьких изображений по горизонтали |
||
2758 | IgorA | 1150 | stdcall [buf2d_vox_obj_get_img_h_3g], buf_vox,[v_zoom] |
2748 | IgorA | 1151 | cmp eax,[buf_0.h] |
1152 | jg @f |
||
1153 | mov ecx,[buf_0.h] |
||
1154 | sub ecx,eax |
||
2758 | IgorA | 1155 | shr ecx,1 ;ecx - для центровки маленьких изображений по вертикали |
1156 | @@: |
||
1157 | .show: |
||
2748 | IgorA | 1158 | stdcall [buf2d_bit_blt], buf_0, ebx,ecx, edi |
1159 | shl buf2d_h,1 |
||
1160 | shl buf2d_w,1 |
||
1161 | pop ecx ebx eax |
||
1162 | pop edi |
||
1163 | stdcall [buf2d_draw], buf_0 ;обновляем буфер на экране |
||
1164 | ret |
||
1165 | |||
2883 | IgorA | 1166 | ;уменьшаем ширину кисти |
2748 | IgorA | 1167 | align 4 |
2883 | IgorA | 1168 | but_bru_w_m: |
1169 | cmp dword[brush_w],1 |
||
1170 | jle @f |
||
1171 | dec dword[brush_w] |
||
1172 | pushad |
||
1173 | call draw_pok |
||
1174 | call draw_vox_cursor |
||
1175 | stdcall [buf2d_draw], buf_pl ;обновляем буфер на экране |
||
1176 | popad |
||
1177 | @@: |
||
1178 | ret |
||
1179 | ;увеличиваем ширину кисти |
||
1180 | align 4 |
||
1181 | but_bru_w_p: |
||
1182 | cmp dword[brush_w],32 |
||
1183 | jge @f |
||
1184 | inc dword[brush_w] |
||
1185 | pushad |
||
1186 | call draw_pok |
||
1187 | call draw_vox_cursor |
||
1188 | stdcall [buf2d_draw], buf_pl ;обновляем буфер на экране |
||
1189 | popad |
||
1190 | @@: |
||
1191 | ret |
||
1192 | ;уменьшаем высоту кисти |
||
1193 | align 4 |
||
1194 | but_bru_h_m: |
||
1195 | cmp dword[brush_h],1 |
||
1196 | jle @f |
||
1197 | dec dword[brush_h] |
||
1198 | pushad |
||
1199 | call draw_pok |
||
1200 | call draw_vox_cursor |
||
1201 | stdcall [buf2d_draw], buf_pl ;обновляем буфер на экране |
||
1202 | popad |
||
1203 | @@: |
||
1204 | ret |
||
1205 | ;увеличиваем высоту кисти |
||
1206 | align 4 |
||
1207 | but_bru_h_p: |
||
1208 | cmp dword[brush_h],32 |
||
1209 | jge @f |
||
1210 | inc dword[brush_h] |
||
1211 | pushad |
||
1212 | call draw_pok |
||
1213 | call draw_vox_cursor |
||
1214 | stdcall [buf2d_draw], buf_pl ;обновляем буфер на экране |
||
1215 | popad |
||
1216 | @@: |
||
1217 | ret |
||
1218 | |||
1219 | align 4 |
||
1220 | but_brush_copy: |
||
1221 | cmp dword[v_pen_mode],3 |
||
1222 | jne .end_f |
||
1223 | pushad |
||
1224 | mov eax,[v_cur_x] |
||
1225 | mov ebx,[n_plane] |
||
1226 | mov edx,[v_cur_y] |
||
1227 | |||
1228 | mov ecx,[v_zoom] |
||
1229 | cmp ecx,[scaled_zoom] |
||
1230 | jle @f |
||
1231 | ;преобразование координат, с учетом увеличения |
||
1232 | ;sub ecx,[scaled_zoom] ;в ecx прирост масштаба (ecx>0) |
||
1233 | mov ecx,[scaled_zoom] |
||
1234 | |||
1235 | mov edi,[cam_x] |
||
1236 | shl edi,cl |
||
1237 | add eax,edi |
||
1238 | mov edi,[cam_y] |
||
1239 | shl edi,cl |
||
1240 | add ebx,edi |
||
1241 | mov edi,[cam_z] |
||
1242 | shl edi,cl |
||
1243 | add edx,edi |
||
1244 | @@: |
||
1245 | |||
1246 | cld |
||
1247 | mov edi,brush_data |
||
1248 | mov esi,edx |
||
1249 | sub esi,[brush_h] |
||
1250 | .cycle_0: |
||
1251 | mov ecx,[brush_w] |
||
1252 | @@: |
||
1253 | push eax |
||
1254 | stdcall buf2d_vox_obj_node_get_color, [open_file_vox], eax,ebx,edx, [v_zoom] |
||
1255 | cmp eax,[v_color] |
||
1256 | jne .end_0 |
||
1257 | mov eax,1 shl 30 |
||
1258 | .end_0: |
||
1259 | mov dword[edi],eax ;color |
||
1260 | pop eax |
||
1261 | inc eax |
||
1262 | add edi,4 |
||
1263 | loop @b |
||
1264 | dec edx |
||
1265 | sub eax,[brush_w] |
||
1266 | cmp edx,esi |
||
1267 | jg .cycle_0 |
||
1268 | |||
1269 | call draw_objects |
||
1270 | popad |
||
1271 | .end_f: |
||
1272 | ret |
||
1273 | |||
1274 | align 4 |
||
1275 | but_brush_draw: |
||
1276 | cmp dword[v_pen_mode],3 |
||
1277 | jne .end_f |
||
1278 | pushad |
||
1279 | mov eax,[v_cur_x] |
||
1280 | mov ebx,[n_plane] |
||
1281 | mov edx,[v_cur_y] |
||
1282 | |||
1283 | mov ecx,[v_zoom] |
||
1284 | cmp ecx,[scaled_zoom] |
||
1285 | jle @f |
||
1286 | ;преобразование координат, с учетом увеличения |
||
1287 | ;sub ecx,[scaled_zoom] ;в ecx прирост масштаба (ecx>0) |
||
1288 | mov ecx,[scaled_zoom] |
||
1289 | |||
1290 | mov edi,[cam_x] |
||
1291 | shl edi,cl |
||
1292 | add eax,edi |
||
1293 | mov edi,[cam_y] |
||
1294 | shl edi,cl |
||
1295 | add ebx,edi |
||
1296 | mov edi,[cam_z] |
||
1297 | shl edi,cl |
||
1298 | add edx,edi |
||
1299 | @@: |
||
1300 | |||
1301 | cld |
||
1302 | mov edi,brush_data |
||
1303 | mov esi,edx |
||
1304 | sub esi,[brush_h] |
||
1305 | .cycle_0: |
||
1306 | mov ecx,[brush_w] |
||
1307 | @@: |
||
1308 | bt dword[edi],31 ;бит прозрачности |
||
1309 | jc .end_2 |
||
1310 | bt dword[edi],30 ;бит текущего цвета |
||
1311 | jnc .end_0 |
||
1312 | push dword[v_color] |
||
1313 | jmp .end_1 |
||
1314 | .end_0: |
||
1315 | push dword[edi] |
||
1316 | .end_1: |
||
1317 | stdcall buf2d_vox_obj_create_node, [open_file_vox], eax,ebx,edx, [v_zoom] ;, color |
||
1318 | .end_2: |
||
1319 | inc eax |
||
1320 | add edi,4 |
||
1321 | loop @b |
||
1322 | dec edx |
||
1323 | sub eax,[brush_w] |
||
1324 | cmp edx,esi |
||
1325 | jg .cycle_0 |
||
1326 | |||
1327 | call draw_objects |
||
1328 | popad |
||
1329 | .end_f: |
||
1330 | ret |
||
1331 | |||
1332 | align 4 |
||
2974 | IgorA | 1333 | but_brush_clear: |
1334 | cmp dword[v_pen_mode],3 |
||
1335 | jne .end_f |
||
1336 | pushad |
||
1337 | mov eax,[v_cur_x] |
||
1338 | mov ebx,[n_plane] |
||
1339 | mov edx,[v_cur_y] |
||
1340 | |||
1341 | mov ecx,[v_zoom] |
||
1342 | cmp ecx,[scaled_zoom] |
||
1343 | jle @f |
||
1344 | ;преобразование координат, с учетом увеличения |
||
1345 | ;sub ecx,[scaled_zoom] ;в ecx прирост масштаба (ecx>0) |
||
1346 | mov ecx,[scaled_zoom] |
||
1347 | |||
1348 | mov edi,[cam_x] |
||
1349 | shl edi,cl |
||
1350 | add eax,edi |
||
1351 | mov edi,[cam_y] |
||
1352 | shl edi,cl |
||
1353 | add ebx,edi |
||
1354 | mov edi,[cam_z] |
||
1355 | shl edi,cl |
||
1356 | add edx,edi |
||
1357 | @@: |
||
1358 | |||
1359 | cld |
||
1360 | mov edi,brush_data |
||
1361 | mov esi,edx |
||
1362 | sub esi,[brush_h] |
||
1363 | .cycle_0: |
||
1364 | mov ecx,[brush_w] |
||
1365 | @@: |
||
1366 | bt dword[edi],31 ;бит прозрачности |
||
1367 | jc .end_2 |
||
1368 | stdcall buf2d_vox_obj_delete_node, [open_file_vox], eax,ebx,edx, [v_zoom] |
||
1369 | .end_2: |
||
1370 | inc eax |
||
1371 | add edi,4 |
||
1372 | loop @b |
||
1373 | dec edx |
||
1374 | sub eax,[brush_w] |
||
1375 | cmp edx,esi |
||
1376 | jg .cycle_0 |
||
1377 | |||
1378 | call draw_objects |
||
1379 | popad |
||
1380 | .end_f: |
||
1381 | ret |
||
1382 | |||
1383 | align 4 |
||
2748 | IgorA | 1384 | draw_palete: |
1385 | stdcall [buf2d_clear], buf_0, [buf_0.color] ;чистим буфер |
||
2758 | IgorA | 1386 | stdcall buf2d_draw_palete, buf_0, 5,3, 9,6, 18, 512 |
2748 | IgorA | 1387 | stdcall [buf2d_draw], buf_0 ;обновляем буфер на экране |
1388 | ret |
||
1389 | |||
2883 | IgorA | 1390 | align 4 |
2758 | IgorA | 1391 | v_zoom dd 3 ;текущий масштаб |
2748 | IgorA | 1392 | v_cur_x dd 0 ;координата курсора x |
1393 | v_cur_y dd 0 ;координата курсора y (но ось в объекте z) |
||
1394 | n_plane dd 0 ;плоскость сечения |
||
1395 | v_color dd 0xff ;цвет карандаша |
||
2933 | IgorA | 1396 | v_pen_mode dd PEN_MODE_NONE ;режим работы курсора (см. константы PEN_MODE_...) |
2748 | IgorA | 1397 | mode_light dd 1 ;режим освещения |
2758 | IgorA | 1398 | cam_x dd 0 |
1399 | cam_y dd 0 |
||
1400 | cam_z dd 0 |
||
1401 | scaled_zoom dd 5 ;масштаб после которого начинается рисование части изображения |
||
2876 | IgorA | 1402 | tile_size dd ? ;размер квадратика на плоскости с сечением |
1403 | max_open_file_size dd ? |
||
2883 | IgorA | 1404 | brush_w dd 5 ;ширина кисти |
1405 | brush_h dd 5 ;высота кисти |
||
1406 | brush_data dd 1 shl 31,1 shl 30,1 shl 30,1 shl 30,1 shl 31 |
||
1407 | dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30 |
||
1408 | dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30 |
||
1409 | dd 1 shl 30,1 shl 30,1 shl 30,1 shl 30,1 shl 30 |
||
1410 | dd 1 shl 31,1 shl 30,1 shl 30,1 shl 30,1 shl 31 |
||
1411 | rd 999 ;32*32-25 |
||
2748 | IgorA | 1412 | |
1413 | txt_zoom db 'Масштаб:',0 |
||
2883 | IgorA | 1414 | txt_curor: db 'Курсор: ' |
1415 | .size: rb 10 |
||
2748 | IgorA | 1416 | txt_n_plane db 'Сечение:',0 |
2758 | IgorA | 1417 | txt_color db 'Цвет:',0 |
2883 | IgorA | 1418 | txt_brush: db 'Кисть: ' |
1419 | .size: rb 10 |
||
1420 | txt_mull db '*',0 |
||
1421 | txt_space db ' ',0 |
||
1422 | txt_buf rb 16 |
||
2748 | IgorA | 1423 | |
1424 | align 4 |
||
1425 | draw_objects: |
||
1426 | stdcall [buf2d_clear], buf_0, [buf_0.color] ;чистим буфер |
||
1427 | stdcall [buf2d_clear], buf_0z, 0 ;чистим буфер |
||
1428 | stdcall [buf2d_clear], buf_pl, [buf_pl.color] ;чистим буфер |
||
1429 | |||
2883 | IgorA | 1430 | cmp dword[v_pen_mode],PEN_MODE_SELECT_COLOR |
2748 | IgorA | 1431 | jne @f |
1432 | call draw_palete |
||
1433 | jmp .end_f |
||
1434 | @@: |
||
2758 | IgorA | 1435 | push eax ebx ecx |
1436 | stdcall [buf2d_vox_obj_get_img_w_3g], buf_vox,[v_zoom] |
||
1437 | mov ebx,[buf_0.w] |
||
1438 | sub ebx,eax |
||
1439 | shr ebx,1 ;ebx - для центровки маленьких изображений по горизонтали |
||
2748 | IgorA | 1440 | |
2758 | IgorA | 1441 | xor ecx,ecx |
1442 | stdcall [buf2d_vox_obj_get_img_h_3g], buf_vox,[v_zoom] |
||
1443 | cmp eax,[buf_0.h] |
||
1444 | jg @f |
||
1445 | mov ecx,[buf_0.h] |
||
1446 | sub ecx,eax |
||
1447 | shr ecx,1 ;ecx - для центровки маленьких изображений по |
||
1448 | @@: |
||
2748 | IgorA | 1449 | |
2758 | IgorA | 1450 | mov eax,[v_zoom] |
1451 | cmp eax,[scaled_zoom] |
||
1452 | jg @f |
||
1453 | ;обычный режим изображения |
||
2759 | IgorA | 1454 | stdcall [buf2d_vox_obj_draw_3g], buf_0, buf_0z, buf_vox,\ |
1455 | [open_file_vox], ebx,ecx, 0, eax |
||
1456 | stdcall [buf2d_vox_obj_draw_pl], buf_pl, [open_file_vox],\ |
||
2876 | IgorA | 1457 | OT_MAP_X,OT_MAP_Y,[tile_size], eax, [n_plane], [sc.work_graph] |
2815 | IgorA | 1458 | stdcall [buf2d_vox_obj_draw_1g], buf_0, buf_0z,\ |
1459 | [open_file_vox], 0,0, eax |
||
2748 | IgorA | 1460 | bt dword[mode_light],0 |
2758 | IgorA | 1461 | jnc .end_1 |
1462 | stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, buf_vox, ebx,ecx, 0, eax, 3 |
||
1463 | .end_1: |
||
1464 | jmp .end_0 |
||
1465 | @@: |
||
1466 | ;режим масштабирования изображения |
||
1467 | sub eax,[scaled_zoom] |
||
1468 | stdcall [buf2d_vox_obj_draw_3g_scaled], buf_0, buf_0z, buf_vox,\ |
||
1469 | [open_file_vox], 0,0, 0, [scaled_zoom], [cam_x],[cam_y],[cam_z],eax, [sc.work_graph] ;scroll -> 2^eax |
||
1470 | stdcall [buf2d_vox_obj_draw_pl_scaled], buf_pl, [open_file_vox],\ |
||
2876 | IgorA | 1471 | OT_MAP_X,OT_MAP_Y,[tile_size], [scaled_zoom], [n_plane], [sc.work_graph],[cam_x],[cam_y],[cam_z],eax |
2758 | IgorA | 1472 | bt dword[mode_light],0 |
1473 | jnc .end_2 |
||
1474 | stdcall [buf2d_vox_obj_draw_3g_shadows], buf_0, buf_0z, buf_vox, 0,0, 0, [scaled_zoom], 3 |
||
1475 | .end_2: |
||
2748 | IgorA | 1476 | .end_0: |
2758 | IgorA | 1477 | pop ecx ebx eax |
2748 | IgorA | 1478 | |
2808 | IgorA | 1479 | call draw_vox_cursor |
2748 | IgorA | 1480 | stdcall [buf2d_draw], buf_0 ;обновляем буфер на экране |
1481 | stdcall [buf2d_draw], buf_pl ;обновляем буфер на экране |
||
1482 | .end_f: |
||
1483 | ret |
||
1484 | |||
2808 | IgorA | 1485 | ;рисование курсора |
1486 | align 4 |
||
1487 | draw_vox_cursor: |
||
1488 | pushad |
||
1489 | mov ecx,[v_zoom] |
||
1490 | cmp ecx,[scaled_zoom] |
||
1491 | jle @f |
||
1492 | mov ecx,[scaled_zoom] |
||
1493 | @@: |
||
1494 | xor edx,edx |
||
1495 | inc edx |
||
1496 | shl edx,cl |
||
1497 | |||
1498 | mov eax,[v_cur_x] |
||
1499 | cmp eax,edx |
||
1500 | jge .end_f ;курсор за пределами поля |
||
2876 | IgorA | 1501 | mov edi,[tile_size] |
2808 | IgorA | 1502 | imul eax,edi |
1503 | add eax,OT_MAP_X |
||
1504 | mov ebx,edx |
||
1505 | dec ebx |
||
1506 | sub ebx,[v_cur_y] |
||
1507 | imul ebx,edi |
||
1508 | add ebx,OT_MAP_Y |
||
1509 | inc eax |
||
1510 | inc ebx |
||
1511 | sub edi,2 |
||
1512 | stdcall [buf2d_rect_by_size], buf_pl, eax,ebx, edi,edi,[sc.work_graph] |
||
1513 | dec ebx |
||
1514 | add edi,2 |
||
1515 | |||
2883 | IgorA | 1516 | cmp dword[v_pen_mode],3 |
1517 | je .brush |
||
1518 | |||
2808 | IgorA | 1519 | ;горизонтальные линии |
1520 | sub eax,2 |
||
1521 | mov ecx,edi |
||
1522 | imul edi,edx |
||
1523 | shr ecx,1 |
||
1524 | add ebx,ecx ;центровка по середине клетки |
||
1525 | mov ecx,OT_MAP_X |
||
1526 | add edi,ecx |
||
1527 | stdcall [buf2d_line], buf_pl, ecx,ebx, eax,ebx,[sc.work_graph] |
||
2876 | IgorA | 1528 | add eax,[tile_size] |
2808 | IgorA | 1529 | inc eax |
1530 | cmp eax,edi |
||
1531 | jge @f ;если курсор на краю поля |
||
1532 | dec edi |
||
1533 | stdcall [buf2d_line], buf_pl, eax,ebx, edi,ebx,[sc.work_graph] |
||
1534 | @@: |
||
2883 | IgorA | 1535 | jmp .end_f |
2808 | IgorA | 1536 | |
2883 | IgorA | 1537 | ;рамка для кисти |
1538 | .brush: |
||
1539 | dec eax |
||
1540 | mov ecx,[brush_w] |
||
1541 | imul ecx,[tile_size] |
||
1542 | ;mov edi,eax |
||
1543 | mov edi,ecx |
||
1544 | mov esi,[brush_h] |
||
1545 | imul esi,[tile_size] |
||
1546 | stdcall [buf2d_rect_by_size], buf_pl, eax,ebx, edi,esi,[sc.work_graph] |
||
1547 | |||
2808 | IgorA | 1548 | .end_f: |
1549 | popad |
||
1550 | ret |
||
1551 | |||
2933 | IgorA | 1552 | ;hot_p - координаты горячей точки курсора, смещенные на бит 16 ((cx shl 8) + cy) shl 16 |
1553 | align 4 |
||
1554 | proc set_pen_mode uses eax ebx ecx edx, mode:dword, icon:dword, hot_p:dword |
||
1555 | mov eax,[mode] |
||
1556 | cmp [v_pen_mode],eax |
||
1557 | je @f |
||
1558 | mov [v_pen_mode],eax |
||
1559 | mov edx,[hot_p] |
||
1560 | mov dx,2 ;LOAD_INDIRECT |
||
1561 | mov ecx,[icon] |
||
1562 | shl ecx,12 ;умножаем на 4 кб |
||
1563 | add ecx,[buf_curs.data] |
||
1564 | mcall 37,4 |
||
1565 | |||
1566 | cmp eax,0 |
||
1567 | je @f |
||
1568 | mov [cursor_pointer],eax |
||
1569 | mcall 37,5,[cursor_pointer] |
||
1570 | @@: |
||
1571 | ret |
||
1572 | endp |
||
1573 | |||
2748 | IgorA | 1574 | if 0 |
1575 | ;input: |
||
1576 | ; buf - указатель на строку, число должно быть в 10 или 16 ричном виде |
||
1577 | ;output: |
||
1578 | ; eax - число |
||
1579 | align 4 |
||
1580 | proc conv_str_to_int, buf:dword |
||
1581 | xor eax,eax |
||
1582 | push ebx ecx esi |
||
1583 | xor ebx,ebx |
||
1584 | mov esi,[buf] |
||
1585 | ;определение отрицательных чисел |
||
1586 | xor ecx,ecx |
||
1587 | inc ecx |
||
1588 | cmp byte[esi],'-' |
||
1589 | jne @f |
||
1590 | dec ecx |
||
1591 | inc esi |
||
1592 | @@: |
||
1593 | |||
1594 | cmp word[esi],'0x' |
||
1595 | je .load_digit_16 |
||
1596 | |||
1597 | .load_digit_10: ;считывание 10-тичных цифр |
||
1598 | mov bl,byte[esi] |
||
1599 | cmp bl,'0' |
||
1600 | jl @f |
||
1601 | cmp bl,'9' |
||
1602 | jg @f |
||
1603 | sub bl,'0' |
||
1604 | imul eax,10 |
||
1605 | add eax,ebx |
||
1606 | inc esi |
||
1607 | jmp .load_digit_10 |
||
1608 | jmp @f |
||
1609 | |||
1610 | .load_digit_16: ;считывание 16-ричных цифр |
||
1611 | add esi,2 |
||
1612 | .cycle_16: |
||
1613 | mov bl,byte[esi] |
||
1614 | cmp bl,'0' |
||
1615 | jl @f |
||
1616 | cmp bl,'f' |
||
1617 | jg @f |
||
1618 | cmp bl,'9' |
||
1619 | jle .us1 |
||
1620 | cmp bl,'A' |
||
1621 | jl @f ;отсеиваем символы >'9' и <'A' |
||
1622 | .us1: ;составное условие |
||
1623 | cmp bl,'F' |
||
1624 | jle .us2 |
||
1625 | cmp bl,'a' |
||
1626 | jl @f ;отсеиваем символы >'F' и <'a' |
||
1627 | sub bl,32 ;переводим символы в верхний регистр, для упрощения их последущей обработки |
||
1628 | .us2: ;составное условие |
||
1629 | sub bl,'0' |
||
1630 | cmp bl,9 |
||
1631 | jle .cor1 |
||
1632 | sub bl,7 ;convert 'A' to '10' |
||
1633 | .cor1: |
||
1634 | shl eax,4 |
||
1635 | add eax,ebx |
||
1636 | inc esi |
||
1637 | jmp .cycle_16 |
||
1638 | @@: |
||
1639 | cmp ecx,0 ;если число отрицательное |
||
1640 | jne @f |
||
1641 | sub ecx,eax |
||
1642 | mov eax,ecx |
||
1643 | @@: |
||
1644 | pop esi ecx ebx |
||
1645 | ret |
||
1646 | endp |
||
1647 | end if |
||
1648 | |||
2883 | IgorA | 1649 | ;input: |
1650 | ; eax = value |
||
1651 | ; edi = string buffer |
||
1652 | ;output: |
||
1653 | align 4 |
||
1654 | convert_int_to_str: |
||
1655 | pushad |
||
1656 | mov dword[edi+1],0 |
||
1657 | mov word[edi+5],0 |
||
1658 | call .str |
||
1659 | popad |
||
1660 | ret |
||
1661 | |||
1662 | align 4 |
||
1663 | .str: |
||
1664 | mov ecx,0x0a ;задается система счисления изменяются регистры ebx,eax,ecx,edx входные параметры eax - число |
||
1665 | ;преревод числа в ASCII строку взодные данные ecx=система счисленя edi адрес куда записывать, будем строку, причем конец переменной |
||
1666 | cmp eax,ecx ;сравнить если в eax меньше чем в ecx то перейти на @@-1 т.е. на pop eax |
||
1667 | jb @f |
||
1668 | xor edx,edx ;очистить edx |
||
1669 | div ecx ;разделить - остаток в edx |
||
1670 | push edx ;положить в стек |
||
1671 | ;dec edi ;смещение необходимое для записи с конца строки |
||
1672 | call .str ;перейти на саму себя т.е. вызвать саму себя и так до того момента пока в eax не станет меньше чем в ecx |
||
1673 | pop eax |
||
1674 | @@: ;cmp al,10 ;проверить не меньше ли значение в al чем 10 (для системы счисленя 10 данная команда - лишная)) |
||
1675 | or al,0x30 ;данная команда короче чем две выше |
||
1676 | stosb ;записать элемент из регистра al в ячеку памяти es:edi |
||
1677 | ret ;вернуться чень интересный ход т.к. пока в стеке храниться кол-во вызовов то столько раз мы и будем вызываться |
||
1678 | |||
1679 | align 4 |
||
1680 | proc str_cat, str1:dword, str2:dword |
||
1681 | push eax ecx edi esi |
||
1682 | mov esi,dword[str2] |
||
1683 | stdcall str_len,esi |
||
1684 | mov ecx,eax |
||
1685 | inc ecx |
||
1686 | mov edi,dword[str1] |
||
1687 | stdcall str_len,edi |
||
1688 | add edi,eax |
||
1689 | cld |
||
1690 | repne movsb |
||
1691 | pop esi edi ecx eax |
||
1692 | ret |
||
1693 | endp |
||
1694 | |||
1695 | ;output: |
||
1696 | ; eax = strlen |
||
1697 | align 4 |
||
1698 | proc str_len, str1:dword |
||
1699 | mov eax,[str1] |
||
1700 | @@: |
||
1701 | cmp byte[eax],0 |
||
1702 | je @f |
||
1703 | inc eax |
||
1704 | jmp @b |
||
1705 | @@: |
||
1706 | sub eax,[str1] |
||
1707 | ret |
||
1708 | endp |
||
1709 | |||
2748 | IgorA | 1710 | ;данные для диалога открытия файлов |
1711 | align 4 |
||
1712 | OpenDialog_data: |
||
1713 | .type dd 0 ;0 - открыть, 1 - сохранить, 2 - выбрать дтректорию |
||
1714 | .procinfo dd procinfo ;+4 |
||
1715 | .com_area_name dd communication_area_name ;+8 |
||
1716 | .com_area dd 0 ;+12 |
||
1717 | .opendir_path dd plugin_path ;+16 |
||
1718 | .dir_default_path dd default_dir ;+20 |
||
1719 | .start_path dd file_name ;+24 путь к диалогу открытия файлов |
||
1720 | .draw_window dd draw_window ;+28 |
||
1721 | .status dd 0 ;+32 |
||
1722 | .openfile_path dd openfile_path ;+36 путь к открываемому файлу |
||
1723 | .filename_area dd filename_area ;+40 |
||
1724 | .filter_area dd Filter |
||
1725 | .x: |
||
1726 | .x_size dw 420 ;+48 ; Window X size |
||
1727 | .x_start dw 10 ;+50 ; Window X position |
||
1728 | .y: |
||
1729 | .y_size dw 320 ;+52 ; Window y size |
||
1730 | .y_start dw 10 ;+54 ; Window Y position |
||
1731 | |||
1732 | default_dir db '/rd/1',0 |
||
1733 | |||
1734 | communication_area_name: |
||
1735 | db 'FFFFFFFF_open_dialog',0 |
||
1736 | open_dialog_name: |
||
1737 | db 'opendial',0 |
||
1738 | communication_area_default_path: |
||
1739 | db '/rd/1/File managers/',0 |
||
1740 | |||
1741 | Filter: |
||
1742 | dd Filter.end - Filter ;.1 |
||
1743 | .1: |
||
1744 | db 'VOX',0 |
||
1745 | .end: |
||
1746 | db 0 |
||
1747 | |||
1748 | |||
1749 | |||
1750 | head_f_i: |
||
1751 | head_f_l db 'Системная ошибка',0 |
||
1752 | |||
1753 | system_dir_0 db '/sys/lib/' |
||
1754 | lib_name_0 db 'proc_lib.obj',0 |
||
1755 | err_message_found_lib_0 db 'Не найдена библиотека ',39,'proc_lib.obj',39,0 |
||
1756 | err_message_import_0 db 'Ошибка при импорте библиотеки ',39,'proc_lib.obj',39,0 |
||
1757 | |||
1758 | system_dir_1 db '/sys/lib/' |
||
1759 | lib_name_1 db 'libimg.obj',0 |
||
1760 | err_message_found_lib_1 db 'Не найдена библиотека ',39,'libimg.obj',39,0 |
||
1761 | err_message_import_1 db 'Ошибка при импорте библиотеки ',39,'libimg.obj',39,0 |
||
1762 | |||
1763 | system_dir_2 db '/sys/lib/' |
||
1764 | lib_name_2 db 'buf2d.obj',0 |
||
1765 | err_msg_found_lib_2 db 'Не найдена библиотека ',39,'buf2d.obj',39,0 |
||
1766 | err_msg_import_2 db 'Ошибка при импорте библиотеки ',39,'buf2d',39,0 |
||
1767 | |||
2876 | IgorA | 1768 | system_dir_3 db '/sys/lib/' |
1769 | lib_name_3 db 'libini.obj',0 |
||
1770 | err_msg_found_lib_3 db 'Не найдена библиотека ',39,'libini.obj',39,0 |
||
1771 | err_msg_import_3 db 'Ошибка при импорте библиотеки ',39,'libini',39,0 |
||
1772 | |||
2748 | IgorA | 1773 | l_libs_start: |
1774 | lib0 l_libs lib_name_0, sys_path, file_name, system_dir_0,\ |
||
1775 | err_message_found_lib_0, head_f_l, proclib_import,err_message_import_0, head_f_i |
||
1776 | lib1 l_libs lib_name_1, sys_path, file_name, system_dir_1,\ |
||
1777 | err_message_found_lib_1, head_f_l, import_libimg, err_message_import_1, head_f_i |
||
1778 | lib_2 l_libs lib_name_2, sys_path, library_path, system_dir_2,\ |
||
1779 | err_msg_found_lib_2,head_f_l,import_buf2d,err_msg_import_2,head_f_i |
||
2876 | IgorA | 1780 | lib_3 l_libs lib_name_3, sys_path, library_path, system_dir_3,\ |
1781 | err_msg_found_lib_3,head_f_l,import_libini,err_msg_import_3,head_f_i |
||
2748 | IgorA | 1782 | l_libs_end: |
1783 | |||
1784 | align 4 |
||
1785 | import_libimg: |
||
1786 | dd alib_init1 |
||
1787 | img_is_img dd aimg_is_img |
||
1788 | img_info dd aimg_info |
||
1789 | img_from_file dd aimg_from_file |
||
1790 | img_to_file dd aimg_to_file |
||
1791 | img_from_rgb dd aimg_from_rgb |
||
1792 | img_to_rgb dd aimg_to_rgb |
||
1793 | img_to_rgb2 dd aimg_to_rgb2 |
||
1794 | img_decode dd aimg_decode |
||
1795 | img_encode dd aimg_encode |
||
1796 | img_create dd aimg_create |
||
1797 | img_destroy dd aimg_destroy |
||
1798 | img_destroy_layer dd aimg_destroy_layer |
||
1799 | img_count dd aimg_count |
||
1800 | img_lock_bits dd aimg_lock_bits |
||
1801 | img_unlock_bits dd aimg_unlock_bits |
||
1802 | img_flip dd aimg_flip |
||
1803 | img_flip_layer dd aimg_flip_layer |
||
1804 | img_rotate dd aimg_rotate |
||
1805 | img_rotate_layer dd aimg_rotate_layer |
||
1806 | img_draw dd aimg_draw |
||
1807 | |||
1808 | dd 0,0 |
||
1809 | alib_init1 db 'lib_init',0 |
||
1810 | aimg_is_img db 'img_is_img',0 ;определяет по данным, может ли библиотека сделать из них изображение |
||
1811 | aimg_info db 'img_info',0 |
||
1812 | aimg_from_file db 'img_from_file',0 |
||
1813 | aimg_to_file db 'img_to_file',0 |
||
1814 | aimg_from_rgb db 'img_from_rgb',0 |
||
1815 | aimg_to_rgb db 'img_to_rgb',0 ;преобразование изображения в данные RGB |
||
1816 | aimg_to_rgb2 db 'img_to_rgb2',0 |
||
1817 | aimg_decode db 'img_decode',0 ;автоматически определяет формат графических данных |
||
1818 | aimg_encode db 'img_encode',0 |
||
1819 | aimg_create db 'img_create',0 |
||
1820 | aimg_destroy db 'img_destroy',0 |
||
1821 | aimg_destroy_layer db 'img_destroy_layer',0 |
||
1822 | aimg_count db 'img_count',0 |
||
1823 | aimg_lock_bits db 'img_lock_bits',0 |
||
1824 | aimg_unlock_bits db 'img_unlock_bits',0 |
||
1825 | aimg_flip db 'img_flip',0 |
||
1826 | aimg_flip_layer db 'img_flip_layer',0 |
||
1827 | aimg_rotate db 'img_rotate',0 |
||
1828 | aimg_rotate_layer db 'img_rotate_layer',0 |
||
1829 | aimg_draw db 'img_draw',0 |
||
1830 | |||
1831 | align 4 |
||
1832 | proclib_import: ;описание экспортируемых функций |
||
1833 | OpenDialog_Init dd aOpenDialog_Init |
||
1834 | OpenDialog_Start dd aOpenDialog_Start |
||
1835 | dd 0,0 |
||
1836 | aOpenDialog_Init db 'OpenDialog_init',0 |
||
1837 | aOpenDialog_Start db 'OpenDialog_start',0 |
||
1838 | |||
1839 | align 4 |
||
1840 | import_buf2d: |
||
1841 | init dd sz_init |
||
1842 | buf2d_create dd sz_buf2d_create |
||
1843 | buf2d_create_f_img dd sz_buf2d_create_f_img |
||
1844 | buf2d_clear dd sz_buf2d_clear |
||
1845 | buf2d_draw dd sz_buf2d_draw |
||
1846 | buf2d_delete dd sz_buf2d_delete |
||
1847 | buf2d_line dd sz_buf2d_line |
||
1848 | buf2d_rect_by_size dd sz_buf2d_rect_by_size |
||
1849 | buf2d_filled_rect_by_size dd sz_buf2d_filled_rect_by_size |
||
1850 | buf2d_circle dd sz_buf2d_circle |
||
1851 | buf2d_img_hdiv2 dd sz_buf2d_img_hdiv2 |
||
1852 | buf2d_img_wdiv2 dd sz_buf2d_img_wdiv2 |
||
1853 | buf2d_conv_24_to_8 dd sz_buf2d_conv_24_to_8 |
||
1854 | buf2d_conv_24_to_32 dd sz_buf2d_conv_24_to_32 |
||
1855 | buf2d_bit_blt dd sz_buf2d_bit_blt |
||
1856 | buf2d_bit_blt_transp dd sz_buf2d_bit_blt_transp |
||
1857 | buf2d_bit_blt_alpha dd sz_buf2d_bit_blt_alpha |
||
1858 | buf2d_curve_bezier dd sz_buf2d_curve_bezier |
||
1859 | buf2d_convert_text_matrix dd sz_buf2d_convert_text_matrix |
||
1860 | buf2d_draw_text dd sz_buf2d_draw_text |
||
1861 | buf2d_crop_color dd sz_buf2d_crop_color |
||
1862 | buf2d_offset_h dd sz_buf2d_offset_h |
||
1863 | buf2d_flood_fill dd sz_buf2d_flood_fill |
||
1864 | buf2d_set_pixel dd sz_buf2d_set_pixel |
||
1865 | buf2d_get_pixel dd sz_buf2d_get_pixel |
||
1866 | buf2d_vox_brush_create dd sz_buf2d_vox_brush_create |
||
1867 | buf2d_vox_brush_delete dd sz_buf2d_vox_brush_delete |
||
2758 | IgorA | 1868 | buf2d_vox_obj_get_img_w_3g dd sz_buf2d_vox_obj_get_img_w_3g |
1869 | buf2d_vox_obj_get_img_h_3g dd sz_buf2d_vox_obj_get_img_h_3g |
||
2815 | IgorA | 1870 | buf2d_vox_obj_draw_1g dd sz_buf2d_vox_obj_draw_1g |
2758 | IgorA | 1871 | buf2d_vox_obj_draw_3g dd sz_buf2d_vox_obj_draw_3g |
1872 | buf2d_vox_obj_draw_3g_scaled dd sz_buf2d_vox_obj_draw_3g_scaled |
||
2759 | IgorA | 1873 | buf2d_vox_obj_draw_3g_shadows dd sz_buf2d_vox_obj_draw_3g_shadows |
2758 | IgorA | 1874 | buf2d_vox_obj_draw_pl dd sz_buf2d_vox_obj_draw_pl |
1875 | buf2d_vox_obj_draw_pl_scaled dd sz_buf2d_vox_obj_draw_pl_scaled |
||
2759 | IgorA | 1876 | |
2748 | IgorA | 1877 | dd 0,0 |
1878 | sz_init db 'lib_init',0 |
||
1879 | sz_buf2d_create db 'buf2d_create',0 |
||
1880 | sz_buf2d_create_f_img db 'buf2d_create_f_img',0 |
||
1881 | sz_buf2d_clear db 'buf2d_clear',0 |
||
1882 | sz_buf2d_draw db 'buf2d_draw',0 |
||
1883 | sz_buf2d_delete db 'buf2d_delete',0 |
||
1884 | sz_buf2d_line db 'buf2d_line',0 |
||
1885 | sz_buf2d_rect_by_size db 'buf2d_rect_by_size',0 |
||
1886 | sz_buf2d_filled_rect_by_size db 'buf2d_filled_rect_by_size',0 |
||
1887 | sz_buf2d_circle db 'buf2d_circle',0 |
||
1888 | sz_buf2d_img_hdiv2 db 'buf2d_img_hdiv2',0 |
||
1889 | sz_buf2d_img_wdiv2 db 'buf2d_img_wdiv2',0 |
||
1890 | sz_buf2d_conv_24_to_8 db 'buf2d_conv_24_to_8',0 |
||
1891 | sz_buf2d_conv_24_to_32 db 'buf2d_conv_24_to_32',0 |
||
1892 | sz_buf2d_bit_blt db 'buf2d_bit_blt',0 |
||
1893 | sz_buf2d_bit_blt_transp db 'buf2d_bit_blt_transp',0 |
||
1894 | sz_buf2d_bit_blt_alpha db 'buf2d_bit_blt_alpha',0 |
||
1895 | sz_buf2d_curve_bezier db 'buf2d_curve_bezier',0 |
||
1896 | sz_buf2d_convert_text_matrix db 'buf2d_convert_text_matrix',0 |
||
1897 | sz_buf2d_draw_text db 'buf2d_draw_text',0 |
||
1898 | sz_buf2d_crop_color db 'buf2d_crop_color',0 |
||
1899 | sz_buf2d_offset_h db 'buf2d_offset_h',0 |
||
1900 | sz_buf2d_flood_fill db 'buf2d_flood_fill',0 |
||
1901 | sz_buf2d_set_pixel db 'buf2d_set_pixel',0 |
||
1902 | sz_buf2d_get_pixel db 'buf2d_get_pixel',0 |
||
1903 | sz_buf2d_vox_brush_create db 'buf2d_vox_brush_create',0 |
||
1904 | sz_buf2d_vox_brush_delete db 'buf2d_vox_brush_delete',0 |
||
2758 | IgorA | 1905 | sz_buf2d_vox_obj_get_img_w_3g db 'buf2d_vox_obj_get_img_w_3g',0 |
1906 | sz_buf2d_vox_obj_get_img_h_3g db 'buf2d_vox_obj_get_img_h_3g',0 |
||
2815 | IgorA | 1907 | sz_buf2d_vox_obj_draw_1g db 'buf2d_vox_obj_draw_1g',0 |
2758 | IgorA | 1908 | sz_buf2d_vox_obj_draw_3g db 'buf2d_vox_obj_draw_3g',0 |
1909 | sz_buf2d_vox_obj_draw_3g_scaled db 'buf2d_vox_obj_draw_3g_scaled',0 |
||
2759 | IgorA | 1910 | sz_buf2d_vox_obj_draw_3g_shadows db 'buf2d_vox_obj_draw_3g_shadows',0 |
2758 | IgorA | 1911 | sz_buf2d_vox_obj_draw_pl db 'buf2d_vox_obj_draw_pl',0 |
1912 | sz_buf2d_vox_obj_draw_pl_scaled db 'buf2d_vox_obj_draw_pl_scaled',0 |
||
2748 | IgorA | 1913 | |
2876 | IgorA | 1914 | align 4 |
1915 | import_libini: |
||
1916 | dd alib_init2 |
||
1917 | ini_get_str dd aini_get_str |
||
1918 | ini_get_int dd aini_get_int |
||
1919 | ini_get_color dd aini_get_color |
||
1920 | dd 0,0 |
||
1921 | alib_init2 db 'lib_init',0 |
||
1922 | aini_get_str db 'ini_get_str',0 |
||
1923 | aini_get_int db 'ini_get_int',0 |
||
1924 | aini_get_color db 'ini_get_color',0 |
||
1925 | |||
2748 | IgorA | 1926 | mouse_dd dd 0x0 |
1927 | sc system_colors |
||
1928 | |||
1929 | align 16 |
||
1930 | procinfo process_information |
||
1931 | |||
1932 | ;буфер основного изображения |
||
1933 | align 4 |
||
1934 | buf_0: dd 0 ;указатель на дaные изображения |
||
1935 | .l: dw 5 ;+4 left |
||
1936 | .t: dw 45 ;+6 top |
||
2758 | IgorA | 1937 | .w: dd 192+6 ;+8 w |
1938 | .h: dd 224+7 ;+12 h |
||
2748 | IgorA | 1939 | .color: dd 0xffffff ;+16 color |
1940 | db 24 ;+20 bit in pixel |
||
1941 | |||
1942 | ;буфер глубины основного изображения |
||
1943 | align 4 |
||
1944 | buf_0z: dd 0 |
||
1945 | dw 0 ;+4 left |
||
1946 | dw 0 ;+6 top |
||
2758 | IgorA | 1947 | .w: dd 192+6 ;+8 w |
1948 | .h: dd 224+7 ;+12 h |
||
2748 | IgorA | 1949 | .color: dd 0 ;+16 color |
1950 | db 32 ;+20 bit in pixel |
||
1951 | |||
1952 | ;буфер для рисования среза объекта |
||
1953 | align 4 |
||
1954 | buf_pl: dd 0 |
||
2758 | IgorA | 1955 | .l: dw 15+192+6 ;+4 left |
2748 | IgorA | 1956 | .t: dw 45 ;+6 top |
1957 | .w: dd 320 ;+8 w |
||
1958 | .h: dd 330 ;+12 h |
||
1959 | .color: dd 0xffffff ;+16 color |
||
1960 | db 24 ;+20 bit in pixel |
||
1961 | |||
1962 | ;буфер для улучшеного рендера |
||
1963 | align 4 |
||
1964 | buf_r_img: |
||
1965 | rb BUF_STRUCT_SIZE |
||
1966 | align 4 |
||
1967 | buf_r_z: |
||
1968 | rb BUF_STRUCT_SIZE |
||
1969 | |||
2933 | IgorA | 1970 | align 4 |
1971 | cursor_pointer dd 0 ;указатель на данные для курсора |
||
1972 | |||
1973 | buf_curs: ;буфер с курсорами |
||
1974 | .data: dd 0 ;указатель на буфер изображения |
||
1975 | dw 0 ;+4 left |
||
1976 | dw 0 ;+6 top |
||
1977 | dd 32 ;+8 w |
||
1978 | dd 32*cursors_count ;+12 h |
||
1979 | dd 0 ;+16 color |
||
1980 | db 24 ;+20 bit in pixel |
||
1981 | |||
1982 | align 4 |
||
1983 | buf_curs_8: ;буфер с прозрачностью для курсоров |
||
1984 | .data: dd 0 ;указатель на буфер изображения |
||
1985 | dw 0 ;+4 left |
||
1986 | dw 0 ;+6 top |
||
1987 | dd 32 ;+8 w |
||
1988 | dd 32*cursors_count ;+12 h |
||
1989 | dd 0 ;+16 color |
||
1990 | db 24 ;+20 bit in pixel |
||
1991 | |||
2748 | IgorA | 1992 | ;данные для создания минимального единичного вокселя |
1993 | align 4 |
||
1994 | vox_6_7_z: |
||
1995 | dd 0,0,1,1,0,0,\ |
||
1996 | 0,2,2,2,2,0,\ |
||
1997 | 2,2,2,2,2,2,\ |
||
1998 | 2,3,2,2,3,2,\ |
||
1999 | 2,3,3,3,3,2,\ |
||
2000 | 0,3,3,3,3,0,\ |
||
2001 | 0,0,3,3,0,0 |
||
2002 | |||
2003 | align 4 |
||
2004 | buf_vox: |
||
2005 | db 6,7,4,3 ;w,h,h_osn,n |
||
2876 | IgorA | 2006 | rb BUF_STRUCT_SIZE*(3+1) |
2748 | IgorA | 2007 | |
2008 | i_end: |
||
2876 | IgorA | 2009 | wnd_s_pos: ;место для настроек стартовой позиции окна |
2010 | rq 0 |
||
2011 | rb 4096 ;2048 |
||
2748 | IgorA | 2012 | stacktop: |
2013 | sys_path rb 1024 |
||
2014 | file_name: |
||
2015 | rb 1024 ;4096 |
||
2016 | library_path rb 1024 |
||
2876 | IgorA | 2017 | plugin_path rb 1024 ;4096 |
2018 | openfile_path rb 1024 ;4096 |
||
2748 | IgorA | 2019 | filename_area rb 256 |
2020 | mem:'a' |