aboutsummaryrefslogtreecommitdiff
path: root/build/android/res/drawable-mdpi
diff options
context:
space:
mode:
authorLoic Blot <loic.blot@unix-experience.fr>2015-03-04 11:46:31 +0100
committerLoic Blot <loic.blot@unix-experience.fr>2015-03-04 11:46:31 +0100
commit7f8f9785d7e9e120a6708d2f51e32dfef3e50c19 (patch)
tree454240229e803e8ca87a75e889fd54d3110ad426 /build/android/res/drawable-mdpi
parent1b2f64473ed4f222d3b7f02df853730d4382105e (diff)
downloadminetest-7f8f9785d7e9e120a6708d2f51e32dfef3e50c19.tar.gz
minetest-7f8f9785d7e9e120a6708d2f51e32dfef3e50c19.tar.bz2
minetest-7f8f9785d7e9e120a6708d2f51e32dfef3e50c19.zip
ASyncRunStep doesn't need to lock when do setTimeOfDaySpeed.
* setTimeOfDaySpeed already lock a mutex when modify the value, we don't need to lock all environment. * add a fine grain lock for getTimeOfDay and setTimeOfDay to solve environment multithread modifications on this value
Diffstat (limited to 'build/android/res/drawable-mdpi')
0 files changed, 0 insertions, 0 deletions
n140'>140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042
// Copyright (C) 2002-2012 Nikolaus Gebhardt
// Copyright (C) 2019 Irrlick
//
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h

#include "guiSkin.h"
#ifdef _IRR_COMPILE_WITH_GUI_

#include "IGUIFont.h"
#include "IGUISpriteBank.h"
#include "IGUIElement.h"
#include "IVideoDriver.h"
#include "IAttributes.h"

namespace irr
{
namespace gui
{

GUISkin::GUISkin(EGUI_SKIN_TYPE type, video::IVideoDriver* driver)
: SpriteBank(0), Driver(driver), Type(type)
{
	#ifdef _DEBUG
	setDebugName("GUISkin");
	#endif

	if ((Type == EGST_WINDOWS_CLASSIC) || (Type == EGST_WINDOWS_METALLIC))
	{
		Colors[EGDC_3D_DARK_SHADOW]     = video::SColor(101,50,50,50);
		Colors[EGDC_3D_SHADOW]          = video::SColor(101,130,130,130);
		Colors[EGDC_3D_FACE]            = video::SColor(220,100,100,100);
		Colors[EGDC_3D_HIGH_LIGHT]      = video::SColor(101,255,255,255);
		Colors[EGDC_3D_LIGHT]           = video::SColor(101,210,210,210);
		Colors[EGDC_ACTIVE_BORDER]      = video::SColor(101,16,14,115);
		Colors[EGDC_ACTIVE_CAPTION]     = video::SColor(255,255,255,255);
		Colors[EGDC_APP_WORKSPACE]      = video::SColor(101,100,100,100);
		Colors[EGDC_BUTTON_TEXT]        = video::SColor(240,10,10,10);
		Colors[EGDC_GRAY_TEXT]          = video::SColor(240,130,130,130);
		Colors[EGDC_HIGH_LIGHT]         = video::SColor(101,8,36,107);
		Colors[EGDC_HIGH_LIGHT_TEXT]    = video::SColor(240,255,255,255);
		Colors[EGDC_INACTIVE_BORDER]    = video::SColor(101,165,165,165);
		Colors[EGDC_INACTIVE_CAPTION]   = video::SColor(255,30,30,30);
		Colors[EGDC_TOOLTIP]            = video::SColor(200,0,0,0);
		Colors[EGDC_TOOLTIP_BACKGROUND] = video::SColor(200,255,255,225);
		Colors[EGDC_SCROLLBAR]          = video::SColor(101,230,230,230);
		Colors[EGDC_WINDOW]             = video::SColor(101,255,255,255);
		Colors[EGDC_WINDOW_SYMBOL]      = video::SColor(200,10,10,10);
		Colors[EGDC_ICON]               = video::SColor(200,255,255,255);
		Colors[EGDC_ICON_HIGH_LIGHT]    = video::SColor(200,8,36,107);
		Colors[EGDC_GRAY_WINDOW_SYMBOL] = video::SColor(240,100,100,100);
		Colors[EGDC_EDITABLE] 			= video::SColor(255,255,255,255);
		Colors[EGDC_GRAY_EDITABLE]		= video::SColor(255,120,120,120);
		Colors[EGDC_FOCUSED_EDITABLE]	= video::SColor(255,240,240,255);


		Sizes[EGDS_SCROLLBAR_SIZE] = 14;
		Sizes[EGDS_MENU_HEIGHT] = 30;
		Sizes[EGDS_WINDOW_BUTTON_WIDTH] = 15;
		Sizes[EGDS_CHECK_BOX_WIDTH] = 18;
		Sizes[EGDS_MESSAGE_BOX_WIDTH] = 500;
		Sizes[EGDS_MESSAGE_BOX_HEIGHT] = 200;
		Sizes[EGDS_BUTTON_WIDTH] = 80;
		Sizes[EGDS_BUTTON_HEIGHT] = 30;

		Sizes[EGDS_TEXT_DISTANCE_X] = 2;
		Sizes[EGDS_TEXT_DISTANCE_Y] = 0;

		Sizes[EGDS_TITLEBARTEXT_DISTANCE_X] = 2;
		Sizes[EGDS_TITLEBARTEXT_DISTANCE_Y] = 0;
	}
	else
	{
		//0x80a6a8af
		Colors[EGDC_3D_DARK_SHADOW] 	=	0x60767982;
		//Colors[EGDC_3D_FACE]			=	0xc0c9ccd4;		// tab background
		Colors[EGDC_3D_FACE]			=	0xc0cbd2d9;		// tab background
		Colors[EGDC_3D_SHADOW]			=	0x50e4e8f1;		// tab background, and left-top highlight
		Colors[EGDC_3D_HIGH_LIGHT]		=	0x40c7ccdc;
		Colors[EGDC_3D_LIGHT]			=	0x802e313a;
		Colors[EGDC_ACTIVE_BORDER]		=	0x80404040;		// window title
		Colors[EGDC_ACTIVE_CAPTION] 	=	0xffd0d0d0;
		Colors[EGDC_APP_WORKSPACE]		=	0xc0646464;		// unused
		Colors[EGDC_BUTTON_TEXT]		=	0xd0161616;
		Colors[EGDC_GRAY_TEXT]			=	0x3c141414;
		Colors[EGDC_HIGH_LIGHT]			=	0x6c606060;
		Colors[EGDC_HIGH_LIGHT_TEXT]	=	0xd0e0e0e0;
		Colors[EGDC_INACTIVE_BORDER]	=	0xf0a5a5a5;
		Colors[EGDC_INACTIVE_CAPTION]	=	0xffd2d2d2;
		Colors[EGDC_TOOLTIP]			=	0xf00f2033;
		Colors[EGDC_TOOLTIP_BACKGROUND]	= 	0xc0cbd2d9;
		Colors[EGDC_SCROLLBAR]			= 	0xf0e0e0e0;
		Colors[EGDC_WINDOW]				= 	0xf0f0f0f0;
		Colors[EGDC_WINDOW_SYMBOL]		= 	0xd0161616;
		Colors[EGDC_ICON]				= 	0xd0161616;
		Colors[EGDC_ICON_HIGH_LIGHT]	= 	0xd0606060;
		Colors[EGDC_GRAY_WINDOW_SYMBOL] = 	0x3c101010;
		Colors[EGDC_EDITABLE] 			= 	0xf0ffffff;
		Colors[EGDC_GRAY_EDITABLE]		= 	0xf0cccccc;
		Colors[EGDC_FOCUSED_EDITABLE]	= 	0xf0fffff0;

		Sizes[EGDS_SCROLLBAR_SIZE] = 14;
		Sizes[EGDS_MENU_HEIGHT] = 48;
		Sizes[EGDS_WINDOW_BUTTON_WIDTH] = 15;
		Sizes[EGDS_CHECK_BOX_WIDTH] = 18;
		Sizes[EGDS_MESSAGE_BOX_WIDTH] = 500;
		Sizes[EGDS_MESSAGE_BOX_HEIGHT] = 200;
		Sizes[EGDS_BUTTON_WIDTH] = 80;
		Sizes[EGDS_BUTTON_HEIGHT] = 30;

		Sizes[EGDS_TEXT_DISTANCE_X] = 3;
		Sizes[EGDS_TEXT_DISTANCE_Y] = 2;

		Sizes[EGDS_TITLEBARTEXT_DISTANCE_X] = 3;
		Sizes[EGDS_TITLEBARTEXT_DISTANCE_Y] = 2;
	}

	Sizes[EGDS_MESSAGE_BOX_GAP_SPACE] = 15;
	Sizes[EGDS_MESSAGE_BOX_MIN_TEXT_WIDTH] = 0;
	Sizes[EGDS_MESSAGE_BOX_MAX_TEXT_WIDTH] = 500;
	Sizes[EGDS_MESSAGE_BOX_MIN_TEXT_HEIGHT] = 0;
	Sizes[EGDS_MESSAGE_BOX_MAX_TEXT_HEIGHT] = 99999;

	Sizes[EGDS_BUTTON_PRESSED_IMAGE_OFFSET_X] = 1;
	Sizes[EGDS_BUTTON_PRESSED_IMAGE_OFFSET_Y] = 1;
	Sizes[EGDS_BUTTON_PRESSED_TEXT_OFFSET_X] = 0;
	Sizes[EGDS_BUTTON_PRESSED_TEXT_OFFSET_Y] = 2;

	Texts[EGDT_MSG_BOX_OK] = L"OK";
	Texts[EGDT_MSG_BOX_CANCEL] = L"Cancel";
	Texts[EGDT_MSG_BOX_YES] = L"Yes";
	Texts[EGDT_MSG_BOX_NO] = L"No";
	Texts[EGDT_WINDOW_CLOSE] = L"Close";
	Texts[EGDT_WINDOW_RESTORE] = L"Restore";
	Texts[EGDT_WINDOW_MINIMIZE] = L"Minimize";
	Texts[EGDT_WINDOW_MAXIMIZE] = L"Maximize";

	Icons[EGDI_WINDOW_MAXIMIZE] = 225;
	Icons[EGDI_WINDOW_RESTORE] = 226;
	Icons[EGDI_WINDOW_CLOSE] = 227;
	Icons[EGDI_WINDOW_MINIMIZE] = 228;
	Icons[EGDI_CURSOR_UP] = 229;
	Icons[EGDI_CURSOR_DOWN] = 230;
	Icons[EGDI_CURSOR_LEFT] = 231;
	Icons[EGDI_CURSOR_RIGHT] = 232;
	Icons[EGDI_MENU_MORE] = 232;
	Icons[EGDI_CHECK_BOX_CHECKED] = 233;
	Icons[EGDI_DROP_DOWN] = 234;
	Icons[EGDI_SMALL_CURSOR_UP] = 235;
	Icons[EGDI_SMALL_CURSOR_DOWN] = 236;
	Icons[EGDI_RADIO_BUTTON_CHECKED] = 237;
	Icons[EGDI_MORE_LEFT] = 238;
	Icons[EGDI_MORE_RIGHT] = 239;
	Icons[EGDI_MORE_UP] = 240;
	Icons[EGDI_MORE_DOWN] = 241;
	Icons[EGDI_WINDOW_RESIZE] = 242;
	Icons[EGDI_EXPAND] = 243;
	Icons[EGDI_COLLAPSE] = 244;

	Icons[EGDI_FILE] = 245;
	Icons[EGDI_DIRECTORY] = 246;

	for (u32 i=0; i<EGDF_COUNT; ++i)
		Fonts[i] = 0;

	UseGradient = (Type == EGST_WINDOWS_METALLIC) || (Type == EGST_BURNING_SKIN) ;
}


//! destructor
GUISkin::~GUISkin()
{
	for (u32 i=0; i<EGDF_COUNT; ++i)
	{
		if (Fonts[i])
			Fonts[i]->drop();
	}

	if (SpriteBank)
		SpriteBank->drop();
}


//! returns default color
video::SColor GUISkin::getColor(EGUI_DEFAULT_COLOR color) const
{
	if ((u32)color < EGDC_COUNT)
		return Colors[color];
	else
		return video::SColor();
}


//! sets a default color
void GUISkin::setColor(EGUI_DEFAULT_COLOR which, video::SColor newColor)
{
	if ((u32)which < EGDC_COUNT)
		Colors[which] = newColor;
}


//! returns size for the given size type
s32 GUISkin::getSize(EGUI_DEFAULT_SIZE size) const
{
	if ((u32)size < EGDS_COUNT)
		return Sizes[size];
	else
		return 0;
}


//! sets a default size
void GUISkin::setSize(EGUI_DEFAULT_SIZE which, s32 size)
{
	if ((u32)which < EGDS_COUNT)
		Sizes[which] = size;
}


//! returns the default font
IGUIFont* GUISkin::getFont(EGUI_DEFAULT_FONT which) const
{
	if (((u32)which < EGDF_COUNT) && Fonts[which])
		return Fonts[which];
	else
		return Fonts[EGDF_DEFAULT];
}


//! sets a default font
void GUISkin::setFont(IGUIFont* font, EGUI_DEFAULT_FONT which)
{
	if ((u32)which >= EGDF_COUNT)
		return;

	if (font)
	{
		font->grab();
		if (Fonts[which])
			Fonts[which]->drop();

		Fonts[which] = font;
	}
}


//! gets the sprite bank stored
IGUISpriteBank* GUISkin::getSpriteBank() const
{
	return SpriteBank;
}


//! set a new sprite bank or remove one by passing 0
void GUISkin::setSpriteBank(IGUISpriteBank* bank)
{
	if (bank)
		bank->grab();

	if (SpriteBank)
		SpriteBank->drop();

	SpriteBank = bank;
}


//! Returns a default icon
u32 GUISkin::getIcon(EGUI_DEFAULT_ICON icon) const
{
	if ((u32)icon < EGDI_COUNT)
		return Icons[icon];
	else
		return 0;
}


//! Sets a default icon
void GUISkin::setIcon(EGUI_DEFAULT_ICON icon, u32 index)
{
	if ((u32)icon < EGDI_COUNT)
		Icons[icon] = index;
}


//! Returns a default text. For example for Message box button captions:
//! "OK", "Cancel", "Yes", "No" and so on.
const wchar_t* GUISkin::getDefaultText(EGUI_DEFAULT_TEXT text) const
{
	if ((u32)text < EGDT_COUNT)
		return Texts[text].c_str();
	else
		return Texts[0].c_str();
}


//! Sets a default text. For example for Message box button captions:
//! "OK", "Cancel", "Yes", "No" and so on.
void GUISkin::setDefaultText(EGUI_DEFAULT_TEXT which, const wchar_t* newText)
{
	if ((u32)which < EGDT_COUNT)
		Texts[which] = newText;
}


//! draws a standard 3d button pane
/**	Used for drawing for example buttons in normal state.
It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and
EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
\param rect: Defining area where to draw.
\param clip: Clip area.
\param element: Pointer to the element which wishes to draw this. This parameter
is usually not used by ISkin, but can be used for example by more complex
implementations to find out how to draw the part exactly. */
// PATCH
void GUISkin::drawColored3DButtonPaneStandard(IGUIElement* element,
					const core::rect<s32>& r,
					const core::rect<s32>* clip,
					const video::SColor* colors)
{
	if (!Driver)
		return;

	if (!colors)
		colors = Colors;

	core::rect<s32> rect = r;

	if ( Type == EGST_BURNING_SKIN )
	{
		rect.UpperLeftCorner.X -= 1;
		rect.UpperLeftCorner.Y -= 1;
		rect.LowerRightCorner.X += 1;
		rect.LowerRightCorner.Y += 1;
		draw3DSunkenPane(element,
					colors[ EGDC_WINDOW ].getInterpolated( 0xFFFFFFFF, 0.9f )
					,false, true, rect, clip);
		return;
	}

	Driver->draw2DRectangle(colors[EGDC_3D_DARK_SHADOW], rect, clip);

	rect.LowerRightCorner.X -= 1;
	rect.LowerRightCorner.Y -= 1;
	Driver->draw2DRectangle(colors[EGDC_3D_HIGH_LIGHT], rect, clip);

	rect.UpperLeftCorner.X += 1;
	rect.UpperLeftCorner.Y += 1;
	Driver->draw2DRectangle(colors[EGDC_3D_SHADOW], rect, clip);

	rect.LowerRightCorner.X -= 1;
	rect.LowerRightCorner.Y -= 1;

	if (!UseGradient)
	{
		Driver->draw2DRectangle(colors[EGDC_3D_FACE], rect, clip);
	}
	else
	{
		const video::SColor c1 = colors[EGDC_3D_FACE];
		const video::SColor c2 = c1.getInterpolated(colors[EGDC_3D_DARK_SHADOW], 0.4f);
		Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip);
	}
}
// END PATCH


//! draws a pressed 3d button pane
/**	Used for drawing for example buttons in pressed state.
It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and
EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
\param rect: Defining area where to draw.
\param clip: Clip area.
\param element: Pointer to the element which wishes to draw this. This parameter
is usually not used by ISkin, but can be used for example by more complex
implementations to find out how to draw the part exactly. */
// PATCH
void GUISkin::drawColored3DButtonPanePressed(IGUIElement* element,
					const core::rect<s32>& r,
					const core::rect<s32>* clip,
					const video::SColor* colors)
{
	if (!Driver)
		return;

	if (!colors)
		colors = Colors;

	core::rect<s32> rect = r;
	Driver->draw2DRectangle(colors[EGDC_3D_HIGH_LIGHT], rect, clip);

	rect.LowerRightCorner.X -= 1;
	rect.LowerRightCorner.Y -= 1;
	Driver->draw2DRectangle(colors[EGDC_3D_DARK_SHADOW], rect, clip);

	rect.UpperLeftCorner.X += 1;
	rect.UpperLeftCorner.Y += 1;
	Driver->draw2DRectangle(colors[EGDC_3D_SHADOW], rect, clip);

	rect.UpperLeftCorner.X += 1;
	rect.UpperLeftCorner.Y += 1;

	if (!UseGradient)
	{
		Driver->draw2DRectangle(colors[EGDC_3D_FACE], rect, clip);
	}
	else
	{
		const video::SColor c1 = colors[EGDC_3D_FACE];
		const video::SColor c2 = c1.getInterpolated(colors[EGDC_3D_DARK_SHADOW], 0.4f);
		Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip);
	}
}
// END PATCH


//! draws a sunken 3d pane
/** Used for drawing the background of edit, combo or check boxes.
\param element: Pointer to the element which wishes to draw this. This parameter
is usually not used by ISkin, but can be used for example by more complex
implementations to find out how to draw the part exactly.
\param bgcolor: Background color.
\param flat: Specifies if the sunken pane should be flat or displayed as sunken
deep into the ground.
\param rect: Defining area where to draw.
\param clip: Clip area.	*/
// PATCH
void GUISkin::drawColored3DSunkenPane(IGUIElement* element, video::SColor bgcolor,
				bool flat, bool fillBackGround,
				const core::rect<s32>& r,
				const core::rect<s32>* clip,
				const video::SColor* colors)
{
	if (!Driver)
		return;

	if (!colors)
		colors = Colors;

	core::rect<s32> rect = r;

	if (fillBackGround)
		Driver->draw2DRectangle(bgcolor, rect, clip);

	if (flat)
	{
		// draw flat sunken pane

		rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 1;
		Driver->draw2DRectangle(colors[EGDC_3D_SHADOW], rect, clip);	// top

		++rect.UpperLeftCorner.Y;
		rect.LowerRightCorner.Y = r.LowerRightCorner.Y;
		rect.LowerRightCorner.X = rect.UpperLeftCorner.X + 1;
		Driver->draw2DRectangle(colors[EGDC_3D_SHADOW], rect, clip);	// left

		rect = r;
		++rect.UpperLeftCorner.Y;
		rect.UpperLeftCorner.X = rect.LowerRightCorner.X - 1;
		Driver->draw2DRectangle(colors[EGDC_3D_HIGH_LIGHT], rect, clip);	// right

		rect = r;
		++rect.UpperLeftCorner.X;
		rect.UpperLeftCorner.Y = r.LowerRightCorner.Y - 1;
		--rect.LowerRightCorner.X;
		Driver->draw2DRectangle(colors[EGDC_3D_HIGH_LIGHT], rect, clip);	// bottom
	}
	else
	{
		// draw deep sunken pane
		rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 1;
		Driver->draw2DRectangle(colors[EGDC_3D_SHADOW], rect, clip);	// top
		++rect.UpperLeftCorner.X;
		++rect.UpperLeftCorner.Y;
		--rect.LowerRightCorner.X;
		++rect.LowerRightCorner.Y;
		Driver->draw2DRectangle(colors[EGDC_3D_DARK_SHADOW], rect, clip);

		rect.UpperLeftCorner.X = r.UpperLeftCorner.X;
		rect.UpperLeftCorner.Y = r.UpperLeftCorner.Y+1;
		rect.LowerRightCorner.X = rect.UpperLeftCorner.X + 1;
		rect.LowerRightCorner.Y = r.LowerRightCorner.Y;
		Driver->draw2DRectangle(colors[EGDC_3D_SHADOW], rect, clip);	// left
		++rect.UpperLeftCorner.X;
		++rect.UpperLeftCorner.Y;
		++rect.LowerRightCorner.X;
		--rect.LowerRightCorner.Y;
		Driver->draw2DRectangle(colors[EGDC_3D_DARK_SHADOW], rect, clip);

		rect = r;
		rect.UpperLeftCorner.X = rect.LowerRightCorner.X - 1;
		++rect.UpperLeftCorner.Y;
		Driver->draw2DRectangle(colors[EGDC_3D_HIGH_LIGHT], rect, clip);	// right
		--rect.UpperLeftCorner.X;
		++rect.UpperLeftCorner.Y;
		--rect.LowerRightCorner.X;
		--rect.LowerRightCorner.Y;
		Driver->draw2DRectangle(colors[EGDC_3D_LIGHT], rect, clip);

		rect = r;
		++rect.UpperLeftCorner.X;
		rect.UpperLeftCorner.Y = r.LowerRightCorner.Y - 1;
		--rect.LowerRightCorner.X;
		Driver->draw2DRectangle(colors[EGDC_3D_HIGH_LIGHT], rect, clip);	// bottom
		++rect.UpperLeftCorner.X;
		--rect.UpperLeftCorner.Y;
		--rect.LowerRightCorner.X;
		--rect.LowerRightCorner.Y;
		Driver->draw2DRectangle(colors[EGDC_3D_LIGHT], rect, clip);
	}
}
// END PATCH

//! draws a window background
// return where to draw title bar text.
// PATCH
core::rect<s32> GUISkin::drawColored3DWindowBackground(IGUIElement* element,
				bool drawTitleBar, video::SColor titleBarColor,
				const core::rect<s32>& r,
				const core::rect<s32>* clip,
				core::rect<s32>* checkClientArea,
				const video::SColor* colors)
{
	if (!Driver)
	{
		if ( checkClientArea )
		{
			*checkClientArea = r;
		}
		return r;
	}

	if (!colors)
		colors = Colors;

	core::rect<s32> rect = r;

	// top border
	rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 1;
	if ( !checkClientArea )
	{
		Driver->draw2DRectangle(colors[EGDC_3D_HIGH_LIGHT], rect, clip);
	}

	// left border
	rect.LowerRightCorner.Y = r.LowerRightCorner.Y;
	rect.LowerRightCorner.X = rect.UpperLeftCorner.X + 1;
	if ( !checkClientArea )
	{
		Driver->draw2DRectangle(colors[EGDC_3D_HIGH_LIGHT], rect, clip);
	}

	// right border dark outer line
	rect.UpperLeftCorner.X = r.LowerRightCorner.X - 1;
	rect.LowerRightCorner.X = r.LowerRightCorner.X;
	rect.UpperLeftCorner.Y = r.UpperLeftCorner.Y;
	rect.LowerRightCorner.Y = r.LowerRightCorner.Y;
	if ( !checkClientArea )
	{
		Driver->draw2DRectangle(colors[EGDC_3D_DARK_SHADOW], rect, clip);
	}

	// right border bright innner line
	rect.UpperLeftCorner.X -= 1;
	rect.LowerRightCorner.X -= 1;
	rect.UpperLeftCorner.Y += 1;
	rect.LowerRightCorner.Y -= 1;
	if ( !checkClientArea )
	{
		Driver->draw2DRectangle(colors[EGDC_3D_SHADOW], rect, clip);
	}

	// bottom border dark outer line
	rect.UpperLeftCorner.X = r.UpperLeftCorner.X;
	rect.UpperLeftCorner.Y = r.LowerRightCorner.Y - 1;
	rect.LowerRightCorner.Y = r.LowerRightCorner.Y;
	rect.LowerRightCorner.X = r.LowerRightCorner.X;
	if ( !checkClientArea )
	{
		Driver->draw2DRectangle(colors[EGDC_3D_DARK_SHADOW], rect, clip);
	}

	// bottom border bright inner line
	rect.UpperLeftCorner.X += 1;
	rect.LowerRightCorner.X -= 1;
	rect.UpperLeftCorner.Y -= 1;
	rect.LowerRightCorner.Y -= 1;
	if ( !checkClientArea )
	{
		Driver->draw2DRectangle(colors[EGDC_3D_SHADOW], rect, clip);
	}

	// client area for background
	rect = r;
	rect.UpperLeftCorner.X +=1;
	rect.UpperLeftCorner.Y +=1;
	rect.LowerRightCorner.X -= 2;
	rect.LowerRightCorner.Y -= 2;
	if (checkClientArea)
	{
		*checkClientArea = rect;
	}

	if ( !checkClientArea )
	{
		if (!UseGradient)
		{
			Driver->draw2DRectangle(colors[EGDC_3D_FACE], rect, clip);
		}
		else if ( Type == EGST_BURNING_SKIN )
		{
			const video::SColor c1 = colors[EGDC_WINDOW].getInterpolated ( 0xFFFFFFFF, 0.9f );
			const video::SColor c2 = colors[EGDC_WINDOW].getInterpolated ( 0xFFFFFFFF, 0.8f );

			Driver->draw2DRectangle(rect, c1, c1, c2, c2, clip);
		}
		else
		{
			const video::SColor c2 = colors[EGDC_3D_SHADOW];
			const video::SColor c1 = colors[EGDC_3D_FACE];
			Driver->draw2DRectangle(rect, c1, c1, c1, c2, clip);
		}
	}

	// title bar
	rect = r;
	rect.UpperLeftCorner.X += 2;
	rect.UpperLeftCorner.Y += 2;
	rect.LowerRightCorner.X -= 2;
	rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + getSize(EGDS_WINDOW_BUTTON_WIDTH) + 2;

	if (drawTitleBar )
	{
		if (checkClientArea)
		{
			(*checkClientArea).UpperLeftCorner.Y = rect.LowerRightCorner.Y;
		}
		else
		{
			// draw title bar
			//if (!UseGradient)
			//	Driver->draw2DRectangle(titleBarColor, rect, clip);
			//else
			if ( Type == EGST_BURNING_SKIN )
			{
				const video::SColor c = titleBarColor.getInterpolated( video::SColor(titleBarColor.getAlpha(),255,255,255), 0.8f);
				Driver->draw2DRectangle(rect, titleBarColor, titleBarColor, c, c, clip);
			}
			else
			{
				const video::SColor c = titleBarColor.getInterpolated(video::SColor(titleBarColor.getAlpha(),0,0,0), 0.2f);
				Driver->draw2DRectangle(rect, titleBarColor, c, titleBarColor, c, clip);
			}
		}
	}

	return rect;
}
// END PATCH


//! draws a standard 3d menu pane
/**	Used for drawing for menus and context menus.
It uses the colors EGDC_3D_DARK_SHADOW, EGDC_3D_HIGH_LIGHT, EGDC_3D_SHADOW and
EGDC_3D_FACE for this. See EGUI_DEFAULT_COLOR for details.
\param element: Pointer to the element which wishes to draw this. This parameter
is usually not used by ISkin, but can be used for example by more complex
implementations to find out how to draw the part exactly.
\param rect: Defining area where to draw.
\param clip: Clip area.	*/
// PATCH
void GUISkin::drawColored3DMenuPane(IGUIElement* element,
			const core::rect<s32>& r, const core::rect<s32>* clip,
			const video::SColor* colors)
{
	if (!Driver)
		return;

	if (!colors)
		colors = Colors;

	core::rect<s32> rect = r;

	if ( Type == EGST_BURNING_SKIN )
	{
		rect.UpperLeftCorner.Y -= 3;
		draw3DButtonPaneStandard(element, rect, clip);
		return;
	}

	// in this skin, this is exactly what non pressed buttons look like,
	// so we could simply call
	// draw3DButtonPaneStandard(element, rect, clip);
	// here.
	// but if the skin is transparent, this doesn't look that nice. So
	// We draw it a little bit better, with some more draw2DRectangle calls,
	// but there aren't that much menus visible anyway.

	rect.LowerRightCorner.Y = rect.UpperLeftCorner.Y + 1;
	Driver->draw2DRectangle(colors[EGDC_3D_HIGH_LIGHT], rect, clip);

	rect.LowerRightCorner.Y = r.LowerRightCorner.Y;
	rect.LowerRightCorner.X = rect.UpperLeftCorner.X + 1;
	Driver->draw2DRectangle(colors[EGDC_3D_HIGH_LIGHT], rect, clip);

	rect.UpperLeftCorner.X = r.LowerRightCorner.X - 1;
	rect.LowerRightCorner.X = r.LowerRightCorner.X;
	rect.UpperLeftCorner.Y = r.UpperLeftCorner.Y;
	rect.LowerRightCorner.Y = r.LowerRightCorner.Y;
	Driver->draw2DRectangle(colors[EGDC_3D_DARK_SHADOW], rect, clip);

	rect.UpperLeftCorner.X -= 1;
	rect.LowerRightCorner.X -= 1;
	rect.UpperLeftCorner.Y += 1;
	rect.LowerRightCorner.Y -= 1;
	Driver->draw2DRectangle(colors[EGDC_3D_SHADOW], rect, clip);

	rect.UpperLeftCorner.X = r.UpperLeftCorner.X;
	rect.UpperLeftCorner.Y = r.LowerRightCorner.Y - 1;
	rect.LowerRightCorner.Y = r.LowerRightCorner.Y;
	rect.LowerRightCorner.X = r.LowerRightCorner.X;
	Driver->draw2DRectangle(colors[EGDC_3D_DARK_SHADOW], rect, clip);

	rect.UpperLeftCorner.X += 1;
	rect.LowerRightCorner.X -= 1;
	rect.UpperLeftCorner.Y -= 1;
	rect.LowerRightCorner.Y -= 1;
	Driver->draw2DRectangle(colors[EGDC_3D_SHADOW], rect, clip);

	rect = r;
	rect.UpperLeftCorner.X +=1;
	rect.UpperLeftCorner.Y +=1;
	rect.LowerRightCorner.X -= 2;
	rect.LowerRightCorner.Y -= 2;

	if (!UseGradient)
		Driver->draw2DRectangle(colors[EGDC_3D_FACE], rect, clip);
	else
	{
		const video::SColor c1 = colors[EGDC_3D_FACE];