Code Search for Developers
 
 
  

Clr.cpp from FreeOrion at Krugle


Show Clr.cpp syntax highlighted

/* GG is a GUI for SDL and OpenGL.
   Copyright (C) 2003 T. Zachary Laine

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public License
   as published by the Free Software Foundation; either version 2.1
   of the License, or (at your option) any later version.
   
   This library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.
    
   You should have received a copy of the GNU Lesser General Public
   License along with this library; if not, write to the Free
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
   02111-1307 USA

   If you do not wish to comply with the terms of the LGPL please
   contact the author as other terms are available for a fee.
    
   Zach Laine
   whatwasthataddress@hotmail.com */

#include <GG/Clr.h>

using namespace GG;

const Clr GG::CLR_ZERO(0, 0, 0, 0);
const Clr GG::CLR_BLACK(0, 0, 0, 255);
const Clr GG::CLR_WHITE(255, 255, 255, 255);
const Clr GG::CLR_GRAY(127, 127, 127, 255);
const Clr GG::CLR_SHADOW(127, 127, 127, 127);
const Clr GG::CLR_RED(255, 0, 0, 255);
const Clr GG::CLR_GREEN(0, 255, 0, 255);
const Clr GG::CLR_BLUE(0, 0, 255, 255);
const Clr GG::CLR_CYAN(0, 255, 255, 255);
const Clr GG::CLR_YELLOW(255, 255, 0, 255);
const Clr GG::CLR_MAGENTA(255, 0, 255, 255);

////////////////////////////////////////////////
// GG::Clr
////////////////////////////////////////////////
Clr::Clr() :
    r(0),
    g(0),
    b(0),
    a(0)
{}

Clr::Clr(GLubyte r_, GLubyte g_, GLubyte b_, GLubyte a_) :
    r(r_),
    g(g_),
    b(b_),
    a(a_)
{}


////////////////////////////////////////////////
// free function(s)
////////////////////////////////////////////////
Clr GG::FloatClr(float r, float g, float b, float a)
{
    return Clr(static_cast<GLubyte>(r * 255),
               static_cast<GLubyte>(g * 255),
               static_cast<GLubyte>(b * 255),
               static_cast<GLubyte>(a * 255));
}

bool GG::operator==(const Clr& rhs, const Clr& lhs) 
{ return rhs.r == lhs.r && rhs.g == lhs.g && rhs.b == lhs.b && rhs.a == lhs.a; }

bool GG::operator!=(const Clr& rhs, const Clr& lhs) 
{ return !(rhs == lhs); }




See more files for this project here

FreeOrion

FreeOrion brings nation building to a galactic scale with its full-featured grand campaign and in-game racial histories, in addition to the classic 4X model of galactic conquest and tactical combat.

Project homepage: http://sourceforge.net/projects/freeorion
Programming language(s): C,C++
License: other

  Ogre/
    Plugins/
      OISInput.cfg
      OISInput.cpp
      OISInput.h
      OgreGUIInputPlugin.cpp
      OgreGUIInputPlugin.h
      SConscript
    OgreGUI.cpp
    SConscript
  SDL/
    SConscript
    SDLGUI.cpp
  dialogs/
    ColorDlg.cpp
    FileDlg.cpp
    SConscript
    ThreeButtonDlg.cpp
  AlignmentFlags.cpp
  Base.cpp
  BrowseInfoWnd.cpp
  Button.cpp
  Clr.cpp
  Control.cpp
  Cursor.cpp
  DrawUtil.cpp
  DropDownList.cpp
  DynamicGraphic.cpp
  Edit.cpp
  EventPump.cpp
  Font.cpp
  GUI.cpp
  Layout.cpp
  ListBox.cpp
  Menu.cpp
  MultiEdit.cpp
  Plugin.cpp
  PluginInterface.cpp
  PtRect.cpp
  SConscript
  Scroll.cpp
  Slider.cpp
  StaticGraphic.cpp
  StyleFactory.cpp
  TabWnd.cpp
  TextControl.cpp
  Texture.cpp
  Timer.cpp
  Wnd.cpp
  WndEditor.cpp
  WndEvent.cpp
  ZList.cpp
  _vsnprintf.c