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