Rev 6328 | Rev 6342 | 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 | |||
1632 | mario79 | 46 | COLOR_ORDER equ MENUETOS |
47 | include 'bmplib.inc' |
||
48 | include 'dialog2.inc' |
||
49 | include 'design.inc' |
||
50 | include 'graphlib.inc' |
||
255 | heavyiron | 51 | |
1632 | mario79 | 52 | include 'cursors.inc' |
255 | heavyiron | 53 | |
1632 | mario79 | 54 | include 'load_from_parameters.inc' |
255 | heavyiron | 55 | |
180 | heavyiron | 56 | START: |
6329 | IgorA | 57 | mcall SF_SYS_MISC,SSF_HEAP_INIT |
1632 | mario79 | 58 | |
59 | load_libraries l_libs_start,end_l_libs |
||
180 | heavyiron | 60 | |
1632 | mario79 | 61 | cmp eax,-1 |
62 | jz close |
||
180 | heavyiron | 63 | ;-------------------------------------------------------- |
64 | ;---------------set events mask-------------------------- |
||
65 | ;-------------------------------------------------------- |
||
6329 | IgorA | 66 | mcall SF_SET_EVENTS_MASK,0x80000067 ; 1100111b |
180 | heavyiron | 67 | ;--------------------------------------------------------- |
255 | heavyiron | 68 | ;-----------------------init data------------------------- |
180 | heavyiron | 69 | ;--------------------------------------------------------- |
1632 | mario79 | 70 | include 'init_data.inc' |
71 | |||
180 | heavyiron | 72 | ;---------------------------------------------------------- |
73 | ;--------get memory and draw window of program------------- |
||
74 | ;---------------------------------------------------------- |
||
1632 | mario79 | 75 | call GetMemory |
76 | call cleare_work_arrea |
||
77 | call load_icons |
||
255 | heavyiron | 78 | |
6329 | IgorA | 79 | ;load cursors |
1632 | mario79 | 80 | mov eax,CursorsID |
81 | call load_cursors |
||
255 | heavyiron | 82 | |
1632 | mario79 | 83 | call drawwin |
255 | heavyiron | 84 | ;--------------------------------------------------------- |
1643 | mario79 | 85 | ;---------Check loading of file from parameters----------- |
255 | heavyiron | 86 | ;--------------------------------------------------------- |
1632 | mario79 | 87 | mov eax,file_path |
88 | cmp [eax],byte 0 |
||
89 | jz @f |
||
90 | call load_picture |
||
6328 | IgorA | 91 | call MovePictureToWorkScreen |
92 | mov [Scroll1CoordinatX],9 |
||
93 | mov [Scroll2CoordinatY],89 |
||
1632 | mario79 | 94 | @@: |
255 | heavyiron | 95 | |
1632 | mario79 | 96 | ;--------------------------------------------------------------------- |
97 | mov edi,filename_area |
||
98 | mov esi,path4+5 |
||
99 | call copy_str_1 |
||
100 | |||
101 | mov edi,file_path |
||
102 | cmp [edi],byte 0 |
||
103 | jne @f |
||
104 | mov esi,path4 |
||
105 | call copy_str_1 |
||
106 | @@: |
||
107 | ;OpenDialog initialisation |
||
108 | push dword OpenDialog_data |
||
109 | call [OpenDialog_Init] |
||
110 | ;--------------------------------------------------------------------- |
||
180 | heavyiron | 111 | ;---------------------------------------------------------- |
112 | ;---------------------MAIN LOOP---------------------------- |
||
113 | ;---------------------------------------------------------- |
||
1643 | mario79 | 114 | red: |
115 | call drawwin |
||
1632 | mario79 | 116 | still: |
117 | call event |
||
1643 | mario79 | 118 | |
1632 | mario79 | 119 | cmp eax,1 |
1643 | mario79 | 120 | je red |
255 | heavyiron | 121 | |
1632 | mario79 | 122 | cmp eax,2 |
123 | je keys |
||
180 | heavyiron | 124 | |
1632 | mario79 | 125 | cmp eax,3 |
126 | je buttons |
||
255 | heavyiron | 127 | |
1632 | mario79 | 128 | cmp eax,6 |
129 | je mouse |
||
255 | heavyiron | 130 | |
1632 | mario79 | 131 | jmp still |
132 | |||
133 | ;--------------------------------------------------------------------- |
||
134 | copy_str_1: |
||
135 | xor eax,eax |
||
136 | cld |
||
137 | @@: |
||
138 | lodsb |
||
139 | stosb |
||
140 | test eax,eax |
||
141 | jnz @b |
||
142 | ret |
||
143 | ;--------------------------------------------------------------------- |
||
180 | heavyiron | 144 | ;--------------------------------------------------------- |
145 | ;--------------------------------------------------------- |
||
146 | ;--------------------------------------------------------- |
||
1632 | mario79 | 147 | include 'events.inc' |
148 | include 'events_of_window.inc' |
||
149 | include 'events_of_keys.inc' |
||
150 | include 'events_of_buttons.inc' |
||
151 | include 'events_of_mouse.inc' |
||
152 | include 'panel_engen.inc' |
||
153 | include 'screen.inc' |
||
1643 | mario79 | 154 | include 'menu_instruments.inc' |
1632 | mario79 | 155 | include 'icons_instruments.inc' |
156 | include 'icons.inc' |
||
157 | include 'sprites.inc' |
||
158 | include 'string.inc' |
||
159 | include 'palette.inc' |
||
160 | include 'files.inc' |
||
161 | include 'time.inc' |
||
162 | include 'memory.inc' |
||
180 | heavyiron | 163 | ;----------------------------------------------------------- |
255 | heavyiron | 164 | ;------------variables and data of program------------------ |
180 | heavyiron | 165 | ;----------------------------------------------------------- |
1632 | mario79 | 166 | sound_havent_memory db 150,64,0 |
1643 | mario79 | 167 | |
1632 | mario79 | 168 | include 'lib_data.inc' |
169 | include 'panel_data.inc' |
||
170 | include 'palitra256.inc' |
||
171 | include 'brushes.inc' |
||
172 | include 'spray.inc' |
||
173 | include 'width_lines.inc' |
||
180 | heavyiron | 174 | ;---------------------------------------------------------- |
255 | heavyiron | 175 | ;-------------------ICON"S picture------------------------- |
180 | heavyiron | 176 | ;---------------------------------------------------------- |
1632 | mario79 | 177 | dd 0 |
255 | heavyiron | 178 | panel_picture: |
6329 | IgorA | 179 | file 'panel_buttons.png' |
6328 | IgorA | 180 | .end: |
255 | heavyiron | 181 | ;****************cursors****************** |
182 | brush_cursor: |
||
183 | file 'brush.cur' |
||
1632 | mario79 | 184 | ;---------------------------------------------------------- |
255 | heavyiron | 185 | flood_fill_cursor: |
186 | file 'flood_fill.cur' |
||
1632 | mario79 | 187 | ;---------------------------------------------------------- |
255 | heavyiron | 188 | lastik_cursor: |
189 | file 'lastik.cur' |
||
1632 | mario79 | 190 | ;---------------------------------------------------------- |
255 | heavyiron | 191 | other_cursor: |
192 | file 'other.cur' |
||
1632 | mario79 | 193 | ;---------------------------------------------------------- |
255 | heavyiron | 194 | pencil_cursor: |
195 | file 'pencil.cur' |
||
1632 | mario79 | 196 | ;---------------------------------------------------------- |
255 | heavyiron | 197 | pipette_cursor: |
198 | file 'pipette.cur' |
||
1632 | mario79 | 199 | ;---------------------------------------------------------- |
255 | heavyiron | 200 | spray_cursor: |
201 | file 'spray.cur' |
||
1632 | mario79 | 202 | ;---------------------------------------------------------- |
255 | heavyiron | 203 | zoom_cursor: |
204 | file 'zoom.cur' |
||
180 | heavyiron | 205 | ;---------------------------------------------------------- |
1632 | mario79 | 206 | IM_END: |
207 | ;----------------------------------------------------------- |
||
208 | ;------------variables and data of program------------------ |
||
209 | ;----------------------------------------------------------- |
||
210 | time rd 1 |
||
211 | PosX rd 1 |
||
212 | PosY rd 1 |
||
213 | PointerToIcons rd 1 |
||
214 | ScreenPointer rd 1 |
||
215 | PointerToPicture rd 1 |
||
216 | PointerToCopyPicture rd 1 |
||
217 | PointerToCopyPicture2 rd 1 |
||
218 | PointerToEditBufer rd 1 |
||
219 | PointerToSpriteBufer rd 1 |
||
220 | PointerToPalette rd 1 |
||
221 | Color rd 1 |
||
222 | Number_Brush rd 1 |
||
223 | Brush_SizeX rd 1 |
||
224 | Brush_SizeY rd 1 |
||
225 | Current_instrument rd 1 |
||
226 | Last_instrument rd 1 |
||
227 | Activate_instrument rb 1 |
||
228 | SColor rd 1 |
||
229 | OldX rd 1 |
||
230 | OldY rd 1 |
||
180 | heavyiron | 231 | |
1632 | mario79 | 232 | MouseX rd 1 |
233 | MouseY rd 1 |
||
234 | Window_SizeX rd 1 |
||
235 | Window_SizeY rd 1 |
||
236 | Window_CordinatX rd 1 |
||
237 | Window_CordinatY rd 1 |
||
238 | Picture_SizeX rd 1 |
||
239 | Picture_SizeY rd 1 |
||
240 | ScreenX rd 1 |
||
241 | ScreenY rd 1 |
||
242 | WorkScreen_SizeX rd 1 |
||
243 | WorkScreen_SizeY rd 1 |
||
244 | MaxWorkScreen_SizeX rd 1 |
||
245 | MaxWorkScreen_SizeY rd 1 |
||
246 | k rd 1 |
||
180 | heavyiron | 247 | |
1632 | mario79 | 248 | ReserveArray rd 1 |
249 | register rd 1 |
||
250 | CounterX rd 1 |
||
251 | CounterY rd 1 |
||
252 | OffsetYPicture rd 1 |
||
253 | OffsetYWorkScreen rd 1 |
||
254 | OffsetYBigPixel rd 1 |
||
255 | |||
256 | Icon_X rd 1 |
||
257 | Icon_Y rd 1 |
||
258 | counter rd 1 |
||
259 | counter2 rd 1 |
||
260 | Icon_text_x rd 1 |
||
261 | Icon_text_y rd 1 |
||
262 | Panel_flag rb 1 |
||
263 | counter_menu rd 1 |
||
264 | menu_coordinat_x rd 1 |
||
265 | menu_size_x rd 1 |
||
266 | menu_counter rd 1 |
||
267 | counter_11 rd 1 |
||
268 | number_panel rd 1 |
||
269 | number_menu rd 1 |
||
270 | |||
271 | Scroll1CoordinatX rd 1 |
||
272 | Scroll1CoordinatY rd 1 |
||
273 | Scroll1MaxSizeX rd 1 |
||
274 | Scroll1MaxSizeY rd 1 |
||
275 | Scroll1SizeX rd 1 |
||
276 | Scroll1FreeX rd 1 |
||
277 | |||
278 | Scroll2CoordinatX rd 1 |
||
279 | Scroll2CoordinatY rd 1 |
||
280 | Scroll2MaxSizeX rd 1 |
||
281 | Scroll2MaxSizeY rd 1 |
||
282 | Scroll2SizeY rd 1 |
||
283 | Scroll2FreeY rd 1 |
||
284 | |||
285 | ;extended_memory rd 1 |
||
286 | type rw 1 |
||
287 | x rd 1 |
||
288 | y rd 1 |
||
289 | save_flag rb 1 |
||
290 | exit_from_work_arrea rb 1 |
||
291 | |||
292 | Radius rd 1 |
||
293 | Dx_ rd 1 |
||
294 | Dy_ rd 1 |
||
295 | line_width rd 1 |
||
296 | lastik_is_active rb 1 |
||
297 | a_ellips rd 1 |
||
298 | b_ellips rd 1 |
||
299 | instrument_used rb 1 |
||
300 | used_OldX rd 1 |
||
301 | used_OldY rd 1 |
||
302 | rectangular_shade_x rd 1 |
||
303 | rectangular_shade_y rd 1 |
||
304 | crossing_old_x rd 1 |
||
305 | crossing_old_y rd 1 |
||
306 | crossing rd 1 |
||
307 | finishing_crossing rd 1 |
||
308 | number_undo rd 1 |
||
309 | DrawSprite_flag rb 1 |
||
310 | Paste_flag rb 1 |
||
311 | SpriteSizeX rd 1 |
||
312 | SpriteSizeY rd 1 |
||
313 | SpriteCoordinatX rd 1 |
||
314 | SpriteCoordinatY rd 1 |
||
315 | SpriteOldCoordinatX rd 1 |
||
316 | SpriteOldCoordinatY rd 1 |
||
317 | ;--------------------------------------------------------------------- |
||
552 | diamond | 318 | IncludeUGlobals |
1632 | mario79 | 319 | ;--------------------------------------------------------------------- |
320 | align 4 |
||
321 | CursorsID rd 10 |
||
322 | ;--------------------------------------------------------------------- |
||
323 | align 4 |
||
6328 | IgorA | 324 | file_path rb 4096 |
325 | filename_area rb 256 |
||
326 | temp_dir_pach rb 4096 |
||
327 | library_path rb 4096 |
||
328 | cur_dir_path rb 4096 |
||
329 | procinfo: rb 1024 |
||
1632 | mario79 | 330 | ;--------------------------------------------------------------------- |
331 | align 4 |
||
332 | rb 4096 |
||
333 | stacktop: |
||
334 | ;--------------------------------------------------------------------- |
||
335 | I_END: |