C:/irrlicht/IrrLib/IrrColor.cpp

Go to the documentation of this file.
00001 /*
00002     Irrlicht Library Wrapper
00003     Created by:
00004         Nathan Adams
00005         Denzel Morris
00006     Copyright (C) 2007
00007 
00008     This software is licensed under the GNU/GPL.
00009     This software may not be used for commerical purposes.
00010 */
00011 
00012 #include <iostream>
00013 #include <irrlicht.h>
00014 #include <strings.h>
00015 
00016 //#include "IrrLib.h"
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         /*SColor * temp;
00030         temp = new SColor(alpha, 255, 0, 0);
00031         this->RED = temp;
00032         delete temp;*/
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         /*this->RED = new SColor(alpha, 255, 0, 0);
00045         this->ORANGE = new SColor(alpha, 255, 165, 0);
00046         this->YELLOW = new SColor(alpha, 255, 255, 0);
00047         this->GREEN = new SColor(alpha, 0, 255, 0);
00048         this->BLUE = new SColor(alpha, 0, 0, 255);
00049         this->DARK_GREEN = new SColor(alpha, 0, 100, 0);
00050         this->PINK = new SColor(alpha, 255, 192, 203);
00051         this->GREY = new SColor(alpha, 190, 190, 190);
00052         this->WHITE = new SColor(alpha, 0, 0, 0);
00053         this->BLACK = new SColor(alpha, 0, 0, 0);*/
00054 }
00055 
00056 IrrColor::~IrrColor(){
00057         /*delete this->RED;
00058         delete this->ORANGE;
00059         delete this->YELLOW;
00060         delete this->GREEN;
00061         delete this->BLUE;
00062         delete this->DARK_GREEN;
00063         delete this->PINK;
00064         delete this->GREY;
00065         delete this->WHITE;
00066         delete this->BLACK;*/
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         }// TODO: Make this function modular
00124 }

Generated on Thu Dec 27 18:25:19 2007 for IrrLib by  doxygen 1.5.4