Rev 6360 | Rev 6365 | 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' |
||
6360 | IgorA | 35 | dd 1, START, IM_END, I_END |
36 | dd stacktop, file_path, cur_dir_path |
||
255 | heavyiron | 37 | |
6360 | IgorA | 38 | include '../../../config.inc' ;for nightbuild |
6328 | IgorA | 39 | include '../../../macros.inc' |
40 | include '../../../proc32.inc' |
||
41 | include '../../../KOSfuncs.inc' |
||
1632 | mario79 | 42 | include '../../../develop/libraries/box_lib/load_lib.mac' |
6328 | IgorA | 43 | include '../../../dll.inc' |
44 | include '../../../libio.inc' |
||
6360 | IgorA | 45 | ;include '../../../develop/libraries/libs-dev/libimg/libimg.inc' |
6328 | IgorA | 46 | |
47 | @use_library_mem mem.Alloc,mem.Free,mem.ReAlloc,dll.Load |
||
48 | |||
6357 | IgorA | 49 | ;--------------------------------------------------------- |
50 | ; *** константы для интерфейса *** |
||
6358 | IgorA | 51 | ; *** constants for interface *** |
6357 | IgorA | 52 | |
6358 | IgorA | 53 | ; корректировки на скин |
6359 | IgorA | 54 | ci_offs_skin_w equ 5 ;корректировка на ширину рамки скина |
55 | ci_offs_skin_h equ 24 ;корректировка на высоту скина |
||
6358 | IgorA | 56 | |
57 | ; главное окно |
||
58 | ci_wnd_min_siz_x equ 585 ;minimum size x |
||
59 | ci_wnd_min_siz_y equ 400 ;minimum size y |
||
60 | |||
6359 | IgorA | 61 | ; панель инструментов |
62 | ci_panel_x_pos equ 0 ;координата x для панели |
||
63 | ci_panel_y_pos equ 20 ;координата y для панели |
||
64 | ci_panel_but_y1 equ ci_panel_y_pos +5 ;координата y для 1-го ряда кнопок |
||
65 | ci_panel_but_y2 equ ci_panel_y_pos+30 ;координата y для 2-го ряда кнопок |
||
66 | ci_palete_y_pos equ ci_panel_y_pos+51 ;координата y для палитры цветов |
||
67 | |||
6357 | IgorA | 68 | ; окно редактора |
6359 | IgorA | 69 | ci_edit_wnd_x_pos equ 0 ;координата x для окна редактора |
70 | ci_edit_wnd_y_pos equ 71 ;координата y для окна редактора |
||
6357 | IgorA | 71 | ci_edit_wnd_border equ 3 ;рамка вокруг окна редактора |
72 | |||
73 | ; скроллинги |
||
6358 | IgorA | 74 | ci_scroll_dim equ 22 ;размеры скроллингов |
6357 | IgorA | 75 | ci_scrollh_coord_x_min equ (ci_edit_wnd_x_pos+3) ;минимальная позиция ползунка |
76 | ;горизонтального скроллинга |
||
77 | ci_scrollv_coord_y_min equ (ci_edit_wnd_y_pos+3) ;минимальная позиция ползунка |
||
78 | ;вертикального скроллинга |
||
79 | ;--------------------------------------------------------- |
||
80 | |||
1632 | mario79 | 81 | include 'bmplib.inc' |
82 | include 'dialog2.inc' |
||
83 | include 'design.inc' |
||
84 | include 'graphlib.inc' |
||
255 | heavyiron | 85 | |
1632 | mario79 | 86 | include 'cursors.inc' |
6342 | IgorA | 87 | include 'memory.inc' |
1632 | mario79 | 88 | include 'load_from_parameters.inc' |
255 | heavyiron | 89 | |
180 | heavyiron | 90 | START: |
6329 | IgorA | 91 | mcall SF_SYS_MISC,SSF_HEAP_INIT |
6359 | IgorA | 92 | mcall SF_STYLE_SETTINGS, SSF_GET_COLORS, syscolors, syscolors_end-syscolors |
1632 | mario79 | 93 | |
94 | load_libraries l_libs_start,end_l_libs |
||
180 | heavyiron | 95 | |
1632 | mario79 | 96 | cmp eax,-1 |
97 | jz close |
||
6357 | IgorA | 98 | |
6329 | IgorA | 99 | mcall SF_SET_EVENTS_MASK,0x80000067 ; 1100111b |
180 | heavyiron | 100 | ;--------------------------------------------------------- |
255 | heavyiron | 101 | ;-----------------------init data------------------------- |
180 | heavyiron | 102 | ;--------------------------------------------------------- |
1632 | mario79 | 103 | include 'init_data.inc' |
104 | |||
180 | heavyiron | 105 | ;---------------------------------------------------------- |
106 | ;--------get memory and draw window of program------------- |
||
107 | ;---------------------------------------------------------- |
||
1632 | mario79 | 108 | call GetMemory |
109 | call cleare_work_arrea |
||
110 | call load_icons |
||
6359 | IgorA | 111 | call init_main_menu |
255 | heavyiron | 112 | |
6329 | IgorA | 113 | ;load cursors |
1632 | mario79 | 114 | mov eax,CursorsID |
115 | call load_cursors |
||
255 | heavyiron | 116 | |
1632 | mario79 | 117 | call drawwin |
255 | heavyiron | 118 | ;--------------------------------------------------------- |
6364 | IgorA | 119 | ;---------check loading of file from parameters----------- |
255 | heavyiron | 120 | ;--------------------------------------------------------- |
1632 | mario79 | 121 | mov eax,file_path |
122 | cmp [eax],byte 0 |
||
123 | jz @f |
||
124 | call load_picture |
||
6328 | IgorA | 125 | call MovePictureToWorkScreen |
1632 | mario79 | 126 | @@: |
255 | heavyiron | 127 | |
1632 | mario79 | 128 | ;--------------------------------------------------------------------- |
129 | mov edi,filename_area |
||
130 | mov esi,path4+5 |
||
131 | call copy_str_1 |
||
132 | |||
133 | mov edi,file_path |
||
134 | cmp [edi],byte 0 |
||
135 | jne @f |
||
136 | mov esi,path4 |
||
137 | call copy_str_1 |
||
138 | @@: |
||
139 | ;OpenDialog initialisation |
||
6360 | IgorA | 140 | stdcall [OpenDialog_Init], OpenDialog_data |
1632 | mario79 | 141 | ;--------------------------------------------------------------------- |
6364 | IgorA | 142 | mov [Current_instrument],10 ;pencil |
143 | call TakeButtonInstruments ;set startup instrument |
||
144 | |||
145 | align 4 |
||
6358 | IgorA | 146 | red: |
6364 | IgorA | 147 | call drawwin |
180 | heavyiron | 148 | ;---------------------------------------------------------- |
6364 | IgorA | 149 | ;---------------------main loop---------------------------- |
180 | heavyiron | 150 | ;---------------------------------------------------------- |
6358 | IgorA | 151 | align 4 |
1632 | mario79 | 152 | still: |
6364 | IgorA | 153 | mcall SF_WAIT_EVENT |
1643 | mario79 | 154 | |
1632 | mario79 | 155 | cmp eax,1 |
1643 | mario79 | 156 | je red |
255 | heavyiron | 157 | |
1632 | mario79 | 158 | cmp eax,2 |
159 | je keys |
||
180 | heavyiron | 160 | |
1632 | mario79 | 161 | cmp eax,3 |
162 | je buttons |
||
255 | heavyiron | 163 | |
1632 | mario79 | 164 | cmp eax,6 |
165 | je mouse |
||
255 | heavyiron | 166 | |
1632 | mario79 | 167 | jmp still |
168 | |||
169 | ;--------------------------------------------------------------------- |
||
170 | copy_str_1: |
||
171 | xor eax,eax |
||
172 | cld |
||
173 | @@: |
||
174 | lodsb |
||
175 | stosb |
||
176 | test eax,eax |
||
177 | jnz @b |
||
178 | ret |
||
179 | ;--------------------------------------------------------------------- |
||
180 | include 'events.inc' |
||
181 | include 'events_of_window.inc' |
||
182 | include 'events_of_keys.inc' |
||
183 | include 'events_of_buttons.inc' |
||
184 | include 'events_of_mouse.inc' |
||
185 | include 'panel_engen.inc' |
||
186 | include 'screen.inc' |
||
1643 | mario79 | 187 | include 'menu_instruments.inc' |
1632 | mario79 | 188 | include 'icons_instruments.inc' |
189 | include 'icons.inc' |
||
190 | include 'sprites.inc' |
||
191 | include 'string.inc' |
||
192 | include 'palette.inc' |
||
193 | include 'files.inc' |
||
194 | include 'time.inc' |
||
6359 | IgorA | 195 | include 'menu.inc' |
180 | heavyiron | 196 | ;----------------------------------------------------------- |
255 | heavyiron | 197 | ;------------variables and data of program------------------ |
180 | heavyiron | 198 | ;----------------------------------------------------------- |
1632 | mario79 | 199 | sound_havent_memory db 150,64,0 |
1643 | mario79 | 200 | |
1632 | mario79 | 201 | include 'lib_data.inc' |
202 | include 'panel_data.inc' |
||
203 | include 'palitra256.inc' |
||
204 | include 'brushes.inc' |
||
205 | include 'spray.inc' |
||
206 | include 'width_lines.inc' |
||
180 | heavyiron | 207 | ;---------------------------------------------------------- |
6364 | IgorA | 208 | ;-------------------icon's picture------------------------- |
180 | heavyiron | 209 | ;---------------------------------------------------------- |
6360 | IgorA | 210 | align 4 |
255 | heavyiron | 211 | panel_picture: |
6329 | IgorA | 212 | file 'panel_buttons.png' |
6328 | IgorA | 213 | .end: |
255 | heavyiron | 214 | ;****************cursors****************** |
215 | brush_cursor: |
||
216 | file 'brush.cur' |
||
217 | flood_fill_cursor: |
||
218 | file 'flood_fill.cur' |
||
219 | lastik_cursor: |
||
220 | file 'lastik.cur' |
||
221 | other_cursor: |
||
222 | file 'other.cur' |
||
223 | pencil_cursor: |
||
224 | file 'pencil.cur' |
||
225 | pipette_cursor: |
||
226 | file 'pipette.cur' |
||
227 | spray_cursor: |
||
228 | file 'spray.cur' |
||
229 | zoom_cursor: |
||
230 | file 'zoom.cur' |
||
180 | heavyiron | 231 | ;---------------------------------------------------------- |
6364 | IgorA | 232 | align 4 |
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 |
6364 | IgorA | 249 | SColor rd 1 |
1632 | mario79 | 250 | Number_Brush rd 1 |
251 | Brush_SizeX rd 1 |
||
252 | Brush_SizeY rd 1 |
||
253 | Current_instrument rd 1 |
||
254 | Last_instrument rd 1 |
||
255 | OldX rd 1 |
||
256 | OldY rd 1 |
||
180 | heavyiron | 257 | |
1632 | mario79 | 258 | MouseX rd 1 |
259 | MouseY rd 1 |
||
260 | Window_SizeX rd 1 |
||
261 | Window_SizeY rd 1 |
||
262 | Window_CordinatX rd 1 |
||
263 | Window_CordinatY rd 1 |
||
264 | Picture_SizeX rd 1 |
||
265 | Picture_SizeY rd 1 |
||
6352 | IgorA | 266 | ScreenX rd 1 ;координата x курсора с учетом масштаба |
267 | ScreenY rd 1 ;координата y курсора с учетом масштаба |
||
1632 | mario79 | 268 | WorkScreen_SizeX rd 1 |
269 | WorkScreen_SizeY rd 1 |
||
270 | MaxWorkScreen_SizeX rd 1 |
||
271 | MaxWorkScreen_SizeY rd 1 |
||
6352 | IgorA | 272 | k rd 1 ;масштаб |
180 | heavyiron | 273 | |
1632 | mario79 | 274 | ReserveArray rd 1 |
275 | register rd 1 |
||
276 | CounterX rd 1 |
||
277 | CounterY rd 1 |
||
278 | OffsetYPicture rd 1 |
||
279 | OffsetYWorkScreen rd 1 |
||
280 | OffsetYBigPixel rd 1 |
||
281 | |||
282 | Icon_X rd 1 |
||
283 | Icon_Y rd 1 |
||
284 | counter rd 1 |
||
285 | counter2 rd 1 |
||
286 | menu_counter rd 1 |
||
287 | counter_11 rd 1 |
||
288 | number_panel rd 1 |
||
289 | number_menu rd 1 |
||
290 | |||
6352 | IgorA | 291 | Scroll1CoordinatX rd 1 ;scroll x screen position |
292 | Scroll1CoordinatY rd 1 ;scroll y screen position |
||
1632 | mario79 | 293 | Scroll1MaxSizeX rd 1 |
294 | Scroll1MaxSizeY rd 1 |
||
6357 | IgorA | 295 | Scroll1SizeX rd 1 ;scroll polzunok size |
1632 | mario79 | 296 | Scroll1FreeX rd 1 |
297 | |||
298 | Scroll2CoordinatX rd 1 |
||
299 | Scroll2CoordinatY rd 1 |
||
300 | Scroll2MaxSizeX rd 1 |
||
301 | Scroll2MaxSizeY rd 1 |
||
302 | Scroll2SizeY rd 1 |
||
303 | Scroll2FreeY rd 1 |
||
304 | |||
305 | x rd 1 |
||
306 | y rd 1 |
||
307 | |||
308 | Radius rd 1 |
||
309 | Dx_ rd 1 |
||
310 | Dy_ rd 1 |
||
311 | line_width rd 1 |
||
312 | a_ellips rd 1 |
||
313 | b_ellips rd 1 |
||
6364 | IgorA | 314 | |
315 | used_OldX rd 1 ;for draw hard contour |
||
1632 | mario79 | 316 | used_OldY rd 1 |
6364 | IgorA | 317 | rectangular_shade_x rd 1 ;координата x области для копирования |
1632 | mario79 | 318 | rectangular_shade_y rd 1 |
319 | crossing_old_x rd 1 |
||
320 | crossing_old_y rd 1 |
||
321 | crossing rd 1 |
||
322 | finishing_crossing rd 1 |
||
323 | number_undo rd 1 |
||
324 | SpriteSizeX rd 1 |
||
325 | SpriteSizeY rd 1 |
||
326 | SpriteCoordinatX rd 1 |
||
327 | SpriteCoordinatY rd 1 |
||
328 | SpriteOldCoordinatX rd 1 |
||
329 | SpriteOldCoordinatY rd 1 |
||
6364 | IgorA | 330 | |
331 | CursorsID rd 10 |
||
332 | |||
333 | Activate_instrument rb 1 |
||
334 | save_flag rb 1 |
||
335 | exit_from_work_arrea rb 1 |
||
336 | lastik_is_active rb 1 |
||
337 | instrument_used rb 1 |
||
338 | DrawSprite_flag rb 1 |
||
339 | Paste_flag rb 1 |
||
1632 | mario79 | 340 | ;--------------------------------------------------------------------- |
552 | diamond | 341 | IncludeUGlobals |
1632 | mario79 | 342 | ;--------------------------------------------------------------------- |
343 | align 4 |
||
6328 | IgorA | 344 | file_path rb 4096 |
345 | filename_area rb 256 |
||
346 | temp_dir_pach rb 4096 |
||
347 | library_path rb 4096 |
||
348 | cur_dir_path rb 4096 |
||
349 | procinfo: rb 1024 |
||
6359 | IgorA | 350 | align 4 |
351 | syscolors rb 192 |
||
352 | syscolors_end: |
||
1632 | mario79 | 353 | ;--------------------------------------------------------------------- |
354 | align 4 |
||
355 | rb 4096 |
||
356 | stacktop: |
||
357 | ;--------------------------------------------------------------------- |
||
358 | I_END: |