00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <iostream>
00013 #include <irrlicht.h>
00014 #include <strings.h>
00015
00016
00017 #include "IrrColor.h"
00018
00019 using namespace irr;
00020 using namespace core;
00021 using namespace scene;
00022 using namespace video;
00023 using namespace io;
00024 using namespace gui;
00025
00026 using namespace std;
00027
00028 void IrrColor::Init(){
00029
00030
00031
00032
00033 this->RED = SColor(alpha, 255, 0, 0);
00034 this->ORANGE = SColor(alpha, 255, 165, 0);
00035 this->YELLOW = SColor(alpha, 255, 255, 0);
00036 this->GREEN = SColor(alpha, 0, 255, 0);
00037 this->BLUE = SColor(alpha, 0, 0, 255);
00038 this->DARK_GREEN = SColor(alpha, 0, 100, 0);
00039 this->PINK = SColor(alpha, 255, 192, 203);
00040 this->GREY = SColor(alpha, 190, 190, 190);
00041 this->GRAY = SColor(alpha, 190, 190, 190);
00042 this->WHITE = SColor(alpha, 255, 255, 255);
00043 this->BLACK = SColor(alpha, 0, 0, 0);
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 }
00055
00056 IrrColor::~IrrColor(){
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067 }
00068
00069 IrrColor::IrrColor(){
00070 this->alpha = 255;
00071 Init();
00072 }
00073
00074 IrrColor::IrrColor(irr::u32 alpha){
00075 this->alpha = alpha;
00076 Init();
00077 }
00078
00079 int IrrColor::getAlpha(){
00080 return this->alpha;
00081 }
00082
00083 void IrrColor::setAlpha(int alpha){
00084 this->alpha = alpha;
00085 }
00086
00087 SColor IrrColor::returnColor(stringw color){
00088 int nColor = -1;
00089 if (color == "red")
00090 nColor = 1;
00091 else if (color == "green")
00092 nColor = 2;
00093 else if (color == "blue")
00094 nColor = 3;
00095 else if (color == "dark green")
00096 nColor = 4;
00097 else if (color == "pink")
00098 nColor = 5;
00099 else if (color == "grey")
00100 nColor = 6;
00101 switch (nColor){
00102 case 1:
00103 return SColor(255, 255, 0, 0);
00104 break;
00105 case 2:
00106 return SColor(255, 0, 255, 0);
00107 break;
00108 case 3:
00109 return SColor(255, 0, 0, 255);
00110 break;
00111 case 4:
00112 return SColor(255, 0, 50, 0);
00113 break;
00114 case 5:
00115 return SColor(255, 255, 10, 255);
00116 break;
00117 case 6:
00118 return SColor(255,200,200,200);
00119 break;
00120 default:
00121 return SColor(255,200,200,200);
00122 break;
00123 }
00124 }