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