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