Subversion Repositories Kolibri OS

Rev

Rev 7155 | Rev 7186 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
7089 leency 1
/*
7154 leency 2
 * Icon Editor for KolibriOS
7089 leency 3
 * Author: Leency
4
 * Licence: GPL v2
5
*/
6
 
7151 leency 7
/*
7156 leency 8
TODO:
9
arange tools
10
window colors
11
enhance icon
7151 leency 12
*/
13
 
7096 leency 14
#define MEMSIZE 4096*40
7089 leency 15
 
16
#include "../lib/gui.h"
7151 leency 17
#include "../lib/random.h"
18
#include "../lib/mem.h"
7096 leency 19
#include "../lib/obj/libimg.h"
7089 leency 20
#include "../lib/patterns/rgb.h"
7096 leency 21
#include "../lib/patterns/libimg_load_skin.h"
7089 leency 22
 
7151 leency 23
#include "colors_mas.h"
24
 
7089 leency 25
//===================================================//
26
//                                                   //
27
//                       DATA                        //
28
//                                                   //
29
//===================================================//
30
 
7156 leency 31
#define T_TITLE "Icon Editor 0.15"
7096 leency 32
 
7152 leency 33
#define TOOLBAR_H    24+8
7096 leency 34
#define PALLETE_SIZE 116
7089 leency 35
 
7151 leency 36
rect wrapper = { 10, TOOLBAR_H, NULL, NULL };
37
rect right_bar = { NULL, TOOLBAR_H, 280, NULL };
38
rect canvas = { NULL, NULL, NULL, NULL };
7089 leency 39
 
7150 leency 40
dword active_color_1 = 0x000000;
41
dword active_color_2 = 0xFFFfff;
7089 leency 42
 
43
enum {
7096 leency 44
	BTN_NEW = 40,
45
	BTN_OPEN,
46
	BTN_SAVE,
47
	BTN_MOVE_LEFT,
48
	BTN_MOVE_RIGHT,
49
	BTN_MOVE_UP,
50
	BTN_MOVE_DOWN,
51
	BTN_FLIP_HOR,
52
	BTN_FLIP_VER,
53
	BTN_ROTATE_LEFT,
54
	BTN_ROTATE_RIGHT,
55
	BTN_PICK,
7156 leency 56
	BTN_FILL,
7152 leency 57
	BTN_ZOOM_IN,
58
	BTN_ZOOM_OUT,
7155 leency 59
	BTNS_PALETTE_COLOR_MAS = 100,
60
	BTNS_LAST_USED_COLORS = 400
7089 leency 61
};
62
 
63
proc_info Form;
64
 
7152 leency 65
more_less_box zoom = { NULL, NULL, 11, 1, 40, BTN_ZOOM_IN, BTN_ZOOM_OUT, "Zoom" };
7150 leency 66
 
7152 leency 67
dword default_palette[] = {
7089 leency 68
0x330000,0x331900,0x333300,0x193300,0x003300,0x003319,0x003333,0x001933,0x000033,0x190033,0x330033,0x330019,0x000000,
69
0x660000,0x663300,0x666600,0x336600,0x006600,0x006633,0x006666,0x003366,0x000066,0x330066,0x660066,0x660033,0x202020,
70
0x990000,0x994C00,0x999900,0x4C9900,0x009900,0x00994C,0x009999,0x004C99,0x000099,0x4C0099,0x990099,0x99004C,0x404040,
71
0xCC0000,0xCC6600,0xCCCC00,0x66CC00,0x00CC00,0x00CC66,0x00CCCC,0x0066CC,0x0000CC,0x6600CC,0xCC00CC,0xCC0066,0x606060,
72
0xFF0000,0xFF8000,0xFFFF00,0x80FF00,0x00FF00,0x00FF80,0x00FFFF,0x0080FF,0x0000FF,0x7F00FF,0xFF00FF,0xFF007F,0x808080,
73
0xFF3333,0xFF9933,0xFFFF33,0x99FF33,0x33FF33,0x33FF99,0x33FFFF,0x3399FF,0x3333FF,0x9933FF,0xFF33FF,0xFF3399,0xA0A0A0,
74
0xFF6666,0xFFB266,0xFFFF66,0xB2FF66,0x66FF66,0x66FFB2,0x66FFFF,0x66B2FF,0x6666FF,0xB266FF,0xFF66FF,0xFF66B2,0xC0C0C0,
75
0xFF9999,0xFFCC99,0xFFFF99,0xCCFF99,0x99FF99,0x99FFCC,0x99FFFF,0x99CCFF,0x9999FF,0xCC99FF,0xFF99FF,0xFF99CC,0xE0E0E0,
76
0xFFCCCC,0xFFE5CC,0xFFFFCC,0xE5FFCC,0xCCFFCC,0xCCFFE5,0xCCFFFF,0xCCE5FF,0xCCCCFF,0xE5CCFF,0xFFCCFF,0xFFCCE5,0xFFFFFF
77
};
7155 leency 78
dword last_used_colors[13*2] = {
79
0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,
80
0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF,0xFFFFFF
81
};
7089 leency 82
 
7155 leency 83
_image image;
7148 leency 84
 
7151 leency 85
libimg_image open_image;
86
 
7156 leency 87
enum {
88
	PENCIL,
89
	FILL,
90
	PIPET
91
};
92
int active_tool = PENCIL;
93
 
7089 leency 94
//===================================================//
95
//                                                   //
96
//                       CODE                        //
97
//                                                   //
98
//===================================================//
99
 
100
void main()
101
{
102
	word btn;
103
 
7096 leency 104
	load_dll(libio,  #libio_init,  1);
105
	load_dll(libimg, #libimg_init, 1);
106
	Libimg_LoadImage(#skin, "/sys/icons16.png");
7156 leency 107
	//system.color.get();
108
	//Libimg_ReplaceColor(skin.image, skin.w, skin.h, 0xFFfffFFF, system.color.work_text);
7096 leency 109
 
7155 leency 110
	image.create(32, 32);
7089 leency 111
 
7156 leency 112
	if (param[0]) {
7151 leency 113
		Libimg_LoadImage(#open_image, #param);
114
		if (open_image.w==32) && (open_image.h==32) {
7156 leency 115
			image.set_image(open_image.imgsrc);
7151 leency 116
		}
117
		else {
118
			notify("'Error: image format is unacceptable.\nOnly images created in IconEditor (BMP, 32x32x16b) can be opened!' -E");
119
		}
120
	}
121
 
7096 leency 122
	SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER);
123
 
7089 leency 124
	loop() switch(WaitEvent())
125
	{
7096 leency 126
		case evMouse:
127
			mouse.get();
7156 leency 128
			if (mouse.vert) {
7152 leency 129
				if (mouse.vert==65535) zoom.click(BTN_ZOOM_IN);
130
				if (mouse.vert==1) zoom.click(BTN_ZOOM_OUT);
131
				DrawEditArea();
132
			}
7156 leency 133
			if (active_tool == PIPET)
134
			{
135
				 EventPickColor(mouse.lkm, mouse.pkm);
136
			}
137
			if (active_tool == PENCIL) {
7151 leency 138
				if (mouse.x>canvas.x) && (mouse.y>canvas.y)
7150 leency 139
				&& (mouse.y
7148 leency 140
				{
7151 leency 141
					if (mouse.lkm) image.set_pixel(mouse.y-canvas.y/zoom.value,
142
						mouse.x-canvas.x/zoom.value, active_color_1);
143
					if (mouse.pkm) image.set_pixel(mouse.y-canvas.y/zoom.value,
144
						mouse.x-canvas.x/zoom.value, active_color_2);
145
					DrawCanvas();
7148 leency 146
				}
147
			}
7156 leency 148
			if (active_tool == FILL) {
149
				if (mouse.x>canvas.x) && (mouse.y>canvas.y)
150
				&& (mouse.y
151
				{
152
					if (mouse.lkm) EventFill(mouse.y-canvas.y/zoom.value,
153
						mouse.x-canvas.x/zoom.value, active_color_1);
154
					if (mouse.pkm) EventFill(mouse.y-canvas.y/zoom.value,
155
						mouse.x-canvas.x/zoom.value, active_color_2);
156
					DrawCanvas();
157
				}
158
			}
7148 leency 159
			break;
7096 leency 160
 
7089 leency 161
		case evButton:
7148 leency 162
			btn = GetButtonID();
7096 leency 163
			switch(btn)
164
			{
7151 leency 165
				case BTN_NEW:
7155 leency 166
					image.create(32, 32);
7151 leency 167
					DrawCanvas();
168
					break;
169
				case BTN_OPEN:
170
					RunProgram("/sys/lod", sprintf(#param, "*bmp* %s",#program_path));
171
					break;
172
				case BTN_SAVE:
173
					EventSave();
174
					break;
7096 leency 175
				case BTN_MOVE_LEFT:
7151 leency 176
					image.move(MOVE_LEFT);
177
					DrawCanvas();
7096 leency 178
					break;
179
				case BTN_MOVE_RIGHT:
7151 leency 180
					image.move(MOVE_RIGHT);
181
					DrawCanvas();
7096 leency 182
					break;
7147 leency 183
				case BTN_MOVE_UP:
7151 leency 184
					image.move(MOVE_UP);
185
					DrawCanvas();
7147 leency 186
					break;
187
				case BTN_MOVE_DOWN:
7151 leency 188
					image.move(MOVE_DOWN);
189
					DrawCanvas();
7147 leency 190
					break;
7151 leency 191
				case BTN_FLIP_VER:
192
					image.move(FLIP_VER);
193
					DrawCanvas();
194
					break;
195
				case BTN_FLIP_HOR:
196
					image.move(FLIP_HOR);
197
					DrawCanvas();
198
					break;
7096 leency 199
				case BTN_PICK:
200
					EventPickActivate();
201
					break;
7156 leency 202
				case BTN_FILL:
203
					EventFillActivate();
204
					break;
7152 leency 205
				case BTN_ZOOM_IN:
206
				case BTN_ZOOM_OUT:
207
					zoom.click(btn);
208
					DrawEditArea();
209
					break;
210
				case CLOSE_BTN:
211
					ExitProcess();
212
					break;
7096 leency 213
			}
7155 leency 214
			if (btn >= BTNS_PALETTE_COLOR_MAS) && (btn < BTNS_PALETTE_COLOR_MAS+PALLETE_SIZE)
7089 leency 215
			{
7155 leency 216
				if (mouse.lkm) EventSetActiveColor(1, default_palette[btn - BTNS_PALETTE_COLOR_MAS]);
217
				if (mouse.pkm) EventSetActiveColor(2, default_palette[btn - BTNS_PALETTE_COLOR_MAS]);
7089 leency 218
			}
7155 leency 219
			if (btn >= BTNS_LAST_USED_COLORS) && (btn < sizeof(last_used_colors)*sizeof(dword))
220
			{
221
				if (mouse.lkm) active_color_1 = last_used_colors[btn - BTNS_LAST_USED_COLORS];
222
				if (mouse.pkm) active_color_2 = last_used_colors[btn - BTNS_LAST_USED_COLORS];
223
				DrawActiveColor(NULL);
224
			}
7089 leency 225
			break;
226
 
227
		case evKey:
228
			GetKeys();
7156 leency 229
			if (key_scancode == SCAN_CODE_ESC) EventPickDeactivate();
7096 leency 230
			if (key_scancode == SCAN_CODE_KEY_I) EventPickActivate();
7156 leency 231
			//if (key_scancode == SCAN_CODE_KEY_F) EventFillActivate();
7152 leency 232
			if (key_scancode == SCAN_CODE_MINUS) {zoom.click(BTN_ZOOM_OUT); DrawEditArea();}
233
			if (key_scancode == SCAN_CODE_PLUS)  {zoom.click(BTN_ZOOM_IN);  DrawEditArea();}
7089 leency 234
			break;
235
 
236
		case evReDraw:
237
			draw_window();
238
			break;
239
	}
240
}
241
 
7096 leency 242
void DrawToolbarButton(dword _id, _x, _icon_n)
243
{
7152 leency 244
	DrawWideRectangle(_x, 4, 22, 22, 3, 0xFFFfff);
245
	DefineHiddenButton(_x, 4, 21, 21, _id);
246
	img_draw stdcall(skin.image, _x+3, 7, 16, 16, 0, _icon_n*16);
7096 leency 247
}
248
 
7148 leency 249
void DrawStatusBar()
250
{
7150 leency 251
	zoom.y = wrapper.y + wrapper.h + 6;
252
	zoom.x = wrapper.x;
253
	zoom.draw();
254
 
7151 leency 255
	sprintf(#param,"Canvas: %ix%i", image.rows, image.columns);
7150 leency 256
	WriteText(wrapper.x+wrapper.w-calc(strlen(#param)*8), zoom.y+2, 0x90, system.color.work_text, #param);
7148 leency 257
}
258
 
7089 leency 259
void draw_window()
260
{
7096 leency 261
	#define TB_ICON_PADDING 26
262
	incn tx;
7089 leency 263
	system.color.get();
7151 leency 264
	DefineAndDrawWindow(115+random(100), 50+random(100), 700, 540, 0x33, system.color.work, T_TITLE, 0);
7089 leency 265
	GetProcessInfo(#Form, SelfInfo);
7152 leency 266
	if (Form.status_window>2) return;
267
	if (Form.width  < 560) { MoveSize(OLD,OLD,560,OLD); return; }
268
	if (Form.height < 430) { MoveSize(OLD,OLD,OLD,430); return; }
269
 
7150 leency 270
	right_bar.x = Form.cwidth - right_bar.w;
7089 leency 271
 
7155 leency 272
	tx.n = 10-TB_ICON_PADDING;
7148 leency 273
	DrawToolbarButton(BTN_NEW,    tx.inc(TB_ICON_PADDING), 2); //not implemented
274
	DrawToolbarButton(BTN_OPEN,   tx.inc(TB_ICON_PADDING), 0); //not implemented
7151 leency 275
	DrawToolbarButton(BTN_SAVE,   tx.inc(TB_ICON_PADDING), 5);
7148 leency 276
	DrawToolbarButton(BTN_MOVE_LEFT,  tx.inc(TB_ICON_PADDING+8),   30);
7096 leency 277
	DrawToolbarButton(BTN_MOVE_RIGHT, tx.inc(TB_ICON_PADDING),   31);
7147 leency 278
	DrawToolbarButton(BTN_MOVE_UP,    tx.inc(TB_ICON_PADDING),   32);
279
	DrawToolbarButton(BTN_MOVE_DOWN,  tx.inc(TB_ICON_PADDING),   33);
280
 
7155 leency 281
	DrawToolbarButton(BTN_FLIP_HOR,   tx.inc(TB_ICON_PADDING+8), 34);
282
	DrawToolbarButton(BTN_FLIP_VER,   tx.inc(TB_ICON_PADDING),   35);
283
	// DrawToolbarButton(BTN_ROTATE_LEFT,   tx.inc(TB_ICON_PADDING), 36); //not implemented
284
	// DrawToolbarButton(BTN_ROTATE_RIGHT,  tx.inc(TB_ICON_PADDING), 37); //not implemented
7148 leency 285
 
7147 leency 286
	DrawToolbarButton(BTN_PICK,   tx.inc(TB_ICON_PADDING+8), 38);
7156 leency 287
	DrawToolbarButton(BTN_FILL,   tx.inc(TB_ICON_PADDING), 39);
7096 leency 288
 
7150 leency 289
	DrawEditArea();
7096 leency 290
 
7155 leency 291
	DrawActiveColor(right_bar.y);
292
	DrawColorPallets(right_bar.x, right_bar.y + 30);
7089 leency 293
 
7148 leency 294
	DrawStatusBar();
7089 leency 295
}
296
 
7151 leency 297
void DrawEditArea()
7089 leency 298
{
7150 leency 299
	dword color1=0xC0C0C0;
7155 leency 300
	int top_side;
301
	int left_side;
7089 leency 302
 
7150 leency 303
	wrapper.w = Form.cwidth - right_bar.w - 30;
304
	wrapper.h = Form.cheight - TOOLBAR_H - 35;
7148 leency 305
 
7150 leency 306
	//canvas{
7151 leency 307
	canvas.w = image.columns * zoom.value;
308
	canvas.h = image.rows * zoom.value;
309
	if (canvas.w+2 > wrapper.w) || (canvas.h+2 > wrapper.h) {
7154 leency 310
		zoom.click(BTN_ZOOM_OUT);
7151 leency 311
		DrawEditArea();
312
		return;
313
	}
314
	canvas.x = -zoom.value*image.columns+wrapper.w/2 + wrapper.x;
315
	canvas.y = -zoom.value*image.rows+wrapper.h/2 + wrapper.y;
7150 leency 316
	DrawRectangle(canvas.x-1, canvas.y-1, canvas.w+1, canvas.h+1, 0x808080);
7151 leency 317
	DrawCanvas();
7150 leency 318
	//}
7089 leency 319
 
7155 leency 320
	left_side = canvas.x-wrapper.x-1;
321
	top_side = canvas.y-wrapper.y-1;
7148 leency 322
 
7155 leency 323
	DrawRectangle(wrapper.x-1, wrapper.y-1, wrapper.w, wrapper.h, system.color.work_graph);
7150 leency 324
 
7155 leency 325
	if (left_side>0)
7150 leency 326
	{
7155 leency 327
		DrawBar(wrapper.x, wrapper.y, wrapper.w-1, top_side, color1); //top
328
		DrawBar(wrapper.x, wrapper.y+wrapper.h-top_side-1, wrapper.w-1, top_side, color1); //bottom
7150 leency 329
	}
7155 leency 330
	if (top_side>0)
7150 leency 331
	{
7155 leency 332
		DrawBar(wrapper.x, wrapper.y+top_side, left_side, wrapper.h-top_side-top_side, color1); //left
333
		DrawBar(wrapper.x+wrapper.w-left_side-1, wrapper.y+top_side, left_side, wrapper.h-top_side-top_side, color1); //right
7150 leency 334
	}
7089 leency 335
}
336
 
337
void DrawActiveColor(dword iny)
338
{
339
	static dword outy;
340
	if (iny != NULL) outy = iny;
7150 leency 341
	DrawBar(right_bar.x, outy, 20, 20, active_color_1);
342
	sprintf(#param, "%A", active_color_1);
7089 leency 343
	EDI = system.color.work;
7148 leency 344
	WriteText(right_bar.x + 30, outy + 3, 0xD0, system.color.work_text, #param+4);
7151 leency 345
 
346
	DrawBar(right_bar.x+110, outy, 20, 20, active_color_2);
347
	sprintf(#param, "%A", active_color_2);
348
	EDI = system.color.work;
349
	WriteText(right_bar.x+110 + 30, outy + 3, 0xD0, system.color.work_text, #param+4);
7089 leency 350
}
351
 
7155 leency 352
void DrawColorPallets(dword _x, _y)
7089 leency 353
{
7155 leency 354
	int r, c, i=0;
7148 leency 355
	int cellw = 20;
356
 
7155 leency 357
	//Last used colors
358
	for (r = 0; r < 2; r++)
359
	{
360
		for (c = 0; c < 13; c++, i++)
361
		{
362
			DrawBar(c*cellw + _x, r*cellw + _y, cellw, cellw, last_used_colors[i]);
363
			DefineHiddenButton(c*cellw + _x, r*cellw + _y, cellw-1, cellw-1, BTNS_LAST_USED_COLORS+i);
364
 
365
		}
366
	}
367
 
368
	_y += r*cellw + 10;
369
	i=0;
370
 
371
	//Default colors
7089 leency 372
	for (r = 0; r < 9; r++)
373
	{
7155 leency 374
		for (c = 0; c < 13; c++, i++)
7089 leency 375
		{
7152 leency 376
			DrawBar(c*cellw + _x, r*cellw + _y, cellw, cellw, default_palette[PALLETE_SIZE-i]);
7155 leency 377
			DefineHiddenButton(c*cellw + _x, r*cellw + _y, cellw-1, cellw-1, BTNS_PALETTE_COLOR_MAS+PALLETE_SIZE-i);
7089 leency 378
		}
379
	}
380
}
381
 
382
 
7155 leency 383
void DrawCanvas()
384
{
385
	int r, c;
386
	for (r = 0; r < image.rows; r++)
387
	{
388
		for (c = 0; c < image.columns; c++)
389
		{
390
			DrawBar(c*zoom.value + canvas.x, r*zoom.value + canvas.y,
391
				zoom.value, zoom.value, image.get_pixel(r, c));
392
		}
393
	}
394
}
395
 
396
 
7089 leency 397
//===================================================//
398
//                                                   //
399
//                      EVENTS                       //
400
//                                                   //
401
//===================================================//
402
 
7096 leency 403
void EventPickActivate()
404
{
405
	SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE);
7156 leency 406
	active_tool = PIPET;
7096 leency 407
}
408
 
7156 leency 409
void EventPickDeactivate()
410
{
411
	active_tool = PENCIL;
412
}
413
 
414
void EventFillActivate()
415
{
416
	active_tool = FILL;
417
}
418
 
7150 leency 419
void EventPickColor(dword lkm_status, pkm_status)
7096 leency 420
{
7150 leency 421
	active_color_1 = GetPixelColorFromScreen(mouse.x + Form.left + 5, mouse.y + Form.top + skin_height);
7096 leency 422
	DrawActiveColor(NULL);
423
	if (mouse.down) && (mouse.key&MOUSE_LEFT) {
7156 leency 424
		EventPickDeactivate();
7096 leency 425
		SetEventMask(EVM_REDRAW+EVM_KEY+EVM_BUTTON+EVM_MOUSE+EVM_MOUSE_FILTER);
7155 leency 426
		EventSetActiveColor(1, active_color_1);
7096 leency 427
	}
428
}
7150 leency 429
 
7151 leency 430
dword bmp_32x32x16_header[] = FROM "bmp32x32header";
431
void EventSave()
7150 leency 432
{
7151 leency 433
	char save_buf[3126];
434
	memmov(#save_buf, #bmp_32x32x16_header, sizeof(bmp_32x32x16_header));
7152 leency 435
	memmov(#save_buf+sizeof(bmp_32x32x16_header), image.get_image(), sizeof(save_buf)-sizeof(bmp_32x32x16_header));
7151 leency 436
	if (WriteFile(sizeof(save_buf), #save_buf, "/rd/1/saved_image.bmp")==0)
437
	{
438
		notify("'File saved as /rd/1/saved_image.bmp' -O");
7150 leency 439
	}
7151 leency 440
	else {
441
		notify("'Error saving BPM file, probably not enought space on ramdisk!' -E");
442
	}
7150 leency 443
}
7151 leency 444
 
7155 leency 445
void EventSetActiveColor(int _number, _color)
7151 leency 446
{
447
	int i;
7155 leency 448
	for (i=13*2-1; i>0; i--) {
449
		last_used_colors[i] = last_used_colors[i-1];
450
	}
451
	last_used_colors[0] = _color;
7151 leency 452
 
7155 leency 453
	if (_number == 1) active_color_1 = _color;
454
	if (_number == 2) active_color_2 = _color;
455
 
456
	DrawActiveColor(NULL);
457
	DrawColorPallets(right_bar.x, right_bar.y + 30);
7156 leency 458
}
459
 
460
void EventFill(dword _r, _c, _color)
461
{
462
	#define MARKED 6
463
	int r, c, i, restart;
464
 
465
	dword old_color = image.get_pixel(_r, _c);
466
	image.set_pixel(_r, _c, MARKED);
467
 
468
	do {
469
		restart=false;
470
		for (r = 0; r < image.rows; r++)
471
			for (c = 0; c < image.columns; c++)
472
			{
473
				IF (image.get_pixel(r,c) != old_color) continue;
474
				IF (image.get_pixel(r,c) == MARKED) continue;
475
 
476
				IF (c>0)               && (image.get_pixel(r,c-1) == MARKED) restart=true;
477
				IF (c
478
				IF (r>0)               && (image.get_pixel(r-1,c) == MARKED) restart=true;
479
				IF (r
480
 
481
				IF (restart == true) image.set_pixel(r,c,MARKED);
482
			}
483
	}while(restart);
484
 
485
	for (i=0; i
486
			IF (image.mas[i]==MARKED) image.mas[i] = _color;
487
}
488