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