Rev 6358 | Rev 6360 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
255 | heavyiron | 1 | ;******************************************************* |
2 | ;**************GRAPHICS EDITOR ANIMAGE ***************** |
||
3 | ;******************************************************* |
||
6359 | IgorA | 4 | ; version: 1.5 |
5 | ; last update: 21.03.2016 |
||
6 | ; changes: Use library 'kmenu.obj' |
||
7 | ; autors: IgorA, Veliant |
||
8 | ;-------------------------------------------------------- |
||
6328 | IgorA | 9 | ; version: 1.4 |
6359 | IgorA | 10 | ; last update: 12.03.2016 |
6328 | IgorA | 11 | ; changes: Use library 'libimg.obj' |
6359 | IgorA | 12 | ; autors: IgorA |
6328 | IgorA | 13 | ;-------------------------------------------------------- |
6359 | IgorA | 14 | ; version: 1.3 |
15 | ; last update: 05.10.2010 |
||
1643 | mario79 | 16 | ; written by: Marat Zakiyanov aka Mario79, aka Mario |
17 | ; changes: Fixed window flicker when redrawing, |
||
18 | ; Fixed memory leak for stack |
||
19 | ;-------------------------------------------------------- |
||
6359 | IgorA | 20 | ; version: 1.2 |
21 | ; last update: 30.09.2010 |
||
1632 | mario79 | 22 | ; written by: Marat Zakiyanov aka Mario79, aka Mario |
23 | ; changes: Program used function 68 instead 64 is now, |
||
24 | ; select path with OpenDialog |
||
25 | ;-------------------------------------------------------- |
||
6359 | IgorA | 26 | ; version: 1.1 |
27 | ; last update: 09.12.2006 |
||
28 | ; autors: |
||
255 | heavyiron | 29 | ; programming by andrew_programmer |
1632 | mario79 | 30 | ; design by golus |
255 | heavyiron | 31 | |
180 | heavyiron | 32 | use32 |
1632 | mario79 | 33 | org 0x0 |
34 | db 'MENUET01' |
||
35 | dd 0x1 |
||
36 | dd START |
||
37 | dd IM_END |
||
6328 | IgorA | 38 | dd I_END |
39 | dd stacktop |
||
1632 | mario79 | 40 | dd file_path ;parameters |
41 | dd cur_dir_path |
||
255 | heavyiron | 42 | |
1702 | Lrz | 43 | include '../../../config.inc' ;for nightbuild |
6328 | IgorA | 44 | include '../../../macros.inc' |
45 | include '../../../proc32.inc' |
||
46 | include '../../../KOSfuncs.inc' |
||
1632 | mario79 | 47 | include '../../../develop/libraries/box_lib/load_lib.mac' |
6328 | IgorA | 48 | include '../../../dll.inc' |
49 | include '../../../libio.inc' |
||
50 | |||
51 | @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load |
||
52 | |||
6357 | IgorA | 53 | ;--------------------------------------------------------- |
54 | ; *** константы для интерфейса *** |
||
6358 | IgorA | 55 | ; *** constants for interface *** |
6357 | IgorA | 56 | |
6358 | IgorA | 57 | ; корректировки на скин |
6359 | IgorA | 58 | ci_offs_skin_w equ 5 ;корректировка на ширину рамки скина |
59 | ci_offs_skin_h equ 24 ;корректировка на высоту скина |
||
6358 | IgorA | 60 | |
61 | ; главное окно |
||
62 | ci_wnd_min_siz_x equ 585 ;minimum size x |
||
63 | ci_wnd_min_siz_y equ 400 ;minimum size y |
||
64 | |||
6359 | IgorA | 65 | ; панель инструментов |
66 | ci_panel_x_pos equ 0 ;координата x для панели |
||
67 | ci_panel_y_pos equ 20 ;координата y для панели |
||
68 | ci_panel_but_y1 equ ci_panel_y_pos +5 ;координата y для 1-го ряда кнопок |
||
69 | ci_panel_but_y2 equ ci_panel_y_pos+30 ;координата y для 2-го ряда кнопок |
||
70 | ci_palete_y_pos equ ci_panel_y_pos+51 ;координата y для палитры цветов |
||
71 | |||
6357 | IgorA | 72 | ; окно редактора |
6359 | IgorA | 73 | ci_edit_wnd_x_pos equ 0 ;координата x для окна редактора |
74 | ci_edit_wnd_y_pos equ 71 ;координата y для окна редактора |
||
6357 | IgorA | 75 | ci_edit_wnd_border equ 3 ;рамка вокруг окна редактора |
76 | |||
77 | ; скроллинги |
||
6358 | IgorA | 78 | ci_scroll_dim equ 22 ;размеры скроллингов |
6357 | IgorA | 79 | ci_scrollh_coord_x_min equ (ci_edit_wnd_x_pos+3) ;минимальная позиция ползунка |
80 | ;горизонтального скроллинга |
||
81 | ci_scrollv_coord_y_min equ (ci_edit_wnd_y_pos+3) ;минимальная позиция ползунка |
||
82 | ;вертикального скроллинга |
||
83 | ;--------------------------------------------------------- |
||
84 | |||
1632 | mario79 | 85 | include 'bmplib.inc' |
86 | include 'dialog2.inc' |
||
87 | include 'design.inc' |
||
88 | include 'graphlib.inc' |
||
255 | heavyiron | 89 | |
1632 | mario79 | 90 | include 'cursors.inc' |
6342 | IgorA | 91 | include 'memory.inc' |
1632 | mario79 | 92 | include 'load_from_parameters.inc' |
255 | heavyiron | 93 | |
180 | heavyiron | 94 | START: |
6329 | IgorA | 95 | mcall SF_SYS_MISC,SSF_HEAP_INIT |
6359 | IgorA | 96 | mcall SF_STYLE_SETTINGS, SSF_GET_COLORS, syscolors, syscolors_end-syscolors |
1632 | mario79 | 97 | |
98 | load_libraries l_libs_start,end_l_libs |
||
180 | heavyiron | 99 | |
1632 | mario79 | 100 | cmp eax,-1 |
101 | jz close |
||
6357 | IgorA | 102 | |
6329 | IgorA | 103 | mcall SF_SET_EVENTS_MASK,0x80000067 ; 1100111b |
180 | heavyiron | 104 | ;--------------------------------------------------------- |
255 | heavyiron | 105 | ;-----------------------init data------------------------- |
180 | heavyiron | 106 | ;--------------------------------------------------------- |
1632 | mario79 | 107 | include 'init_data.inc' |
108 | |||
180 | heavyiron | 109 | ;---------------------------------------------------------- |
110 | ;--------get memory and draw window of program------------- |
||
111 | ;---------------------------------------------------------- |
||
1632 | mario79 | 112 | call GetMemory |
113 | call cleare_work_arrea |
||
114 | call load_icons |
||
6359 | IgorA | 115 | call init_main_menu |
255 | heavyiron | 116 | |
6329 | IgorA | 117 | ;load cursors |
1632 | mario79 | 118 | mov eax,CursorsID |
119 | call load_cursors |
||
255 | heavyiron | 120 | |
1632 | mario79 | 121 | call drawwin |
255 | heavyiron | 122 | ;--------------------------------------------------------- |
1643 | mario79 | 123 | ;---------Check loading of file from parameters----------- |
255 | heavyiron | 124 | ;--------------------------------------------------------- |
1632 | mario79 | 125 | mov eax,file_path |
126 | cmp [eax],byte 0 |
||
127 | jz @f |
||
128 | call load_picture |
||
6328 | IgorA | 129 | call MovePictureToWorkScreen |
1632 | mario79 | 130 | @@: |
255 | heavyiron | 131 | |
1632 | mario79 | 132 | ;--------------------------------------------------------------------- |
133 | mov edi,filename_area |
||
134 | mov esi,path4+5 |
||
135 | call copy_str_1 |
||
136 | |||
137 | mov edi,file_path |
||
138 | cmp [edi],byte 0 |
||
139 | jne @f |
||
140 | mov esi,path4 |
||
141 | call copy_str_1 |
||
142 | @@: |
||
143 | ;OpenDialog initialisation |
||
144 | push dword OpenDialog_data |
||
145 | call [OpenDialog_Init] |
||
146 | ;--------------------------------------------------------------------- |
||
6358 | IgorA | 147 | red: |
148 | call drawwin |
||
180 | heavyiron | 149 | ;---------------------------------------------------------- |
150 | ;---------------------MAIN LOOP---------------------------- |
||
151 | ;---------------------------------------------------------- |
||
6358 | IgorA | 152 | align 4 |
1632 | mario79 | 153 | still: |
154 | call event |
||
1643 | mario79 | 155 | |
1632 | mario79 | 156 | cmp eax,1 |
1643 | mario79 | 157 | je red |
255 | heavyiron | 158 | |
1632 | mario79 | 159 | cmp eax,2 |
160 | je keys |
||
180 | heavyiron | 161 | |
1632 | mario79 | 162 | cmp eax,3 |
163 | je buttons |
||
255 | heavyiron | 164 | |
1632 | mario79 | 165 | cmp eax,6 |
166 | je mouse |
||
255 | heavyiron | 167 | |
1632 | mario79 | 168 | jmp still |
169 | |||
170 | ;--------------------------------------------------------------------- |
||
171 | copy_str_1: |
||
172 | xor eax,eax |
||
173 | cld |
||
174 | @@: |
||
175 | lodsb |
||
176 | stosb |
||
177 | test eax,eax |
||
178 | jnz @b |
||
179 | ret |
||
180 | ;--------------------------------------------------------------------- |
||
181 | include 'events.inc' |
||
182 | include 'events_of_window.inc' |
||
183 | include 'events_of_keys.inc' |
||
184 | include 'events_of_buttons.inc' |
||
185 | include 'events_of_mouse.inc' |
||
186 | include 'panel_engen.inc' |
||
187 | include 'screen.inc' |
||
1643 | mario79 | 188 | include 'menu_instruments.inc' |
1632 | mario79 | 189 | include 'icons_instruments.inc' |
190 | include 'icons.inc' |
||
191 | include 'sprites.inc' |
||
192 | include 'string.inc' |
||
193 | include 'palette.inc' |
||
194 | include 'files.inc' |
||
195 | include 'time.inc' |
||
6359 | IgorA | 196 | include 'menu.inc' |
180 | heavyiron | 197 | ;----------------------------------------------------------- |
255 | heavyiron | 198 | ;------------variables and data of program------------------ |
180 | heavyiron | 199 | ;----------------------------------------------------------- |
1632 | mario79 | 200 | sound_havent_memory db 150,64,0 |
1643 | mario79 | 201 | |
1632 | mario79 | 202 | include 'lib_data.inc' |
203 | include 'panel_data.inc' |
||
204 | include 'palitra256.inc' |
||
205 | include 'brushes.inc' |
||
206 | include 'spray.inc' |
||
207 | include 'width_lines.inc' |
||
180 | heavyiron | 208 | ;---------------------------------------------------------- |
255 | heavyiron | 209 | ;-------------------ICON"S picture------------------------- |
180 | heavyiron | 210 | ;---------------------------------------------------------- |
1632 | mario79 | 211 | dd 0 |
255 | heavyiron | 212 | panel_picture: |
6329 | IgorA | 213 | file 'panel_buttons.png' |
6328 | IgorA | 214 | .end: |
255 | heavyiron | 215 | ;****************cursors****************** |
216 | brush_cursor: |
||
217 | file 'brush.cur' |
||
218 | flood_fill_cursor: |
||
219 | file 'flood_fill.cur' |
||
220 | lastik_cursor: |
||
221 | file 'lastik.cur' |
||
222 | other_cursor: |
||
223 | file 'other.cur' |
||
224 | pencil_cursor: |
||
225 | file 'pencil.cur' |
||
226 | pipette_cursor: |
||
227 | file 'pipette.cur' |
||
228 | spray_cursor: |
||
229 | file 'spray.cur' |
||
230 | zoom_cursor: |
||
231 | file 'zoom.cur' |
||
180 | heavyiron | 232 | ;---------------------------------------------------------- |
1632 | mario79 | 233 | IM_END: |
234 | ;----------------------------------------------------------- |
||
235 | ;------------variables and data of program------------------ |
||
236 | ;----------------------------------------------------------- |
||
237 | time rd 1 |
||
6352 | IgorA | 238 | PosX rd 1 ;scroll x file position |
239 | PosY rd 1 ;scroll y file position |
||
1632 | mario79 | 240 | PointerToIcons rd 1 |
241 | ScreenPointer rd 1 |
||
242 | PointerToPicture rd 1 |
||
243 | PointerToCopyPicture rd 1 |
||
244 | PointerToCopyPicture2 rd 1 |
||
245 | PointerToEditBufer rd 1 |
||
246 | PointerToSpriteBufer rd 1 |
||
6352 | IgorA | 247 | PointerToPalette rd 1 ;указатель на пилитру (нужен для сохранения в *.bmp) |
1632 | mario79 | 248 | Color rd 1 |
249 | Number_Brush rd 1 |
||
250 | Brush_SizeX rd 1 |
||
251 | Brush_SizeY rd 1 |
||
252 | Current_instrument rd 1 |
||
253 | Last_instrument rd 1 |
||
254 | Activate_instrument rb 1 |
||
255 | SColor rd 1 |
||
256 | OldX rd 1 |
||
257 | OldY rd 1 |
||
180 | heavyiron | 258 | |
1632 | mario79 | 259 | MouseX rd 1 |
260 | MouseY rd 1 |
||
261 | Window_SizeX rd 1 |
||
262 | Window_SizeY rd 1 |
||
263 | Window_CordinatX rd 1 |
||
264 | Window_CordinatY rd 1 |
||
265 | Picture_SizeX rd 1 |
||
266 | Picture_SizeY rd 1 |
||
6352 | IgorA | 267 | ScreenX rd 1 ;координата x курсора с учетом масштаба |
268 | ScreenY rd 1 ;координата y курсора с учетом масштаба |
||
1632 | mario79 | 269 | WorkScreen_SizeX rd 1 |
270 | WorkScreen_SizeY rd 1 |
||
271 | MaxWorkScreen_SizeX rd 1 |
||
272 | MaxWorkScreen_SizeY rd 1 |
||
6352 | IgorA | 273 | k rd 1 ;масштаб |
180 | heavyiron | 274 | |
1632 | mario79 | 275 | ReserveArray rd 1 |
276 | register rd 1 |
||
277 | CounterX rd 1 |
||
278 | CounterY rd 1 |
||
279 | OffsetYPicture rd 1 |
||
280 | OffsetYWorkScreen rd 1 |
||
281 | OffsetYBigPixel rd 1 |
||
282 | |||
283 | Icon_X rd 1 |
||
284 | Icon_Y rd 1 |
||
285 | counter rd 1 |
||
286 | counter2 rd 1 |
||
287 | Icon_text_x rd 1 |
||
288 | Icon_text_y rd 1 |
||
289 | Panel_flag rb 1 |
||
290 | counter_menu rd 1 |
||
291 | menu_coordinat_x rd 1 |
||
292 | menu_size_x rd 1 |
||
293 | menu_counter rd 1 |
||
294 | counter_11 rd 1 |
||
295 | number_panel rd 1 |
||
296 | number_menu rd 1 |
||
297 | |||
6352 | IgorA | 298 | Scroll1CoordinatX rd 1 ;scroll x screen position |
299 | Scroll1CoordinatY rd 1 ;scroll y screen position |
||
1632 | mario79 | 300 | Scroll1MaxSizeX rd 1 |
301 | Scroll1MaxSizeY rd 1 |
||
6357 | IgorA | 302 | Scroll1SizeX rd 1 ;scroll polzunok size |
1632 | mario79 | 303 | Scroll1FreeX rd 1 |
304 | |||
305 | Scroll2CoordinatX rd 1 |
||
306 | Scroll2CoordinatY rd 1 |
||
307 | Scroll2MaxSizeX rd 1 |
||
308 | Scroll2MaxSizeY rd 1 |
||
309 | Scroll2SizeY rd 1 |
||
310 | Scroll2FreeY rd 1 |
||
311 | |||
312 | ;extended_memory rd 1 |
||
313 | type rw 1 |
||
314 | x rd 1 |
||
315 | y rd 1 |
||
316 | save_flag rb 1 |
||
317 | exit_from_work_arrea rb 1 |
||
318 | |||
319 | Radius rd 1 |
||
320 | Dx_ rd 1 |
||
321 | Dy_ rd 1 |
||
322 | line_width rd 1 |
||
323 | lastik_is_active rb 1 |
||
324 | a_ellips rd 1 |
||
325 | b_ellips rd 1 |
||
326 | instrument_used rb 1 |
||
327 | used_OldX rd 1 |
||
328 | used_OldY rd 1 |
||
329 | rectangular_shade_x rd 1 |
||
330 | rectangular_shade_y rd 1 |
||
331 | crossing_old_x rd 1 |
||
332 | crossing_old_y rd 1 |
||
333 | crossing rd 1 |
||
334 | finishing_crossing rd 1 |
||
335 | number_undo rd 1 |
||
336 | DrawSprite_flag rb 1 |
||
337 | Paste_flag rb 1 |
||
338 | SpriteSizeX rd 1 |
||
339 | SpriteSizeY rd 1 |
||
340 | SpriteCoordinatX rd 1 |
||
341 | SpriteCoordinatY rd 1 |
||
342 | SpriteOldCoordinatX rd 1 |
||
343 | SpriteOldCoordinatY rd 1 |
||
344 | ;--------------------------------------------------------------------- |
||
552 | diamond | 345 | IncludeUGlobals |
1632 | mario79 | 346 | ;--------------------------------------------------------------------- |
347 | align 4 |
||
348 | CursorsID rd 10 |
||
349 | ;--------------------------------------------------------------------- |
||
350 | align 4 |
||
6328 | IgorA | 351 | file_path rb 4096 |
352 | filename_area rb 256 |
||
353 | temp_dir_pach rb 4096 |
||
354 | library_path rb 4096 |
||
355 | cur_dir_path rb 4096 |
||
356 | procinfo: rb 1024 |
||
6359 | IgorA | 357 | align 4 |
358 | syscolors rb 192 |
||
359 | syscolors_end: |
||
1632 | mario79 | 360 | ;--------------------------------------------------------------------- |
361 | align 4 |
||
362 | rb 4096 |
||
363 | stacktop: |
||
364 | ;--------------------------------------------------------------------- |
||
365 | I_END: |