2009-04-18 19:00:33 +02:00
|
|
|
/* Copyright (C) 2009 Wildfire Games.
|
|
|
|
* This file is part of 0 A.D.
|
|
|
|
*
|
|
|
|
* 0 A.D. is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* 0 A.D. 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 General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2009-04-18 19:51:05 +02:00
|
|
|
/*
|
|
|
|
* Convert float RGB(A) colors to unsigned byte
|
2007-05-07 18:33:24 +02:00
|
|
|
*/
|
2004-05-29 22:56:24 +02:00
|
|
|
|
2007-05-07 18:33:24 +02:00
|
|
|
#ifndef INCLUDED_COLOR
|
|
|
|
#define INCLUDED_COLOR
|
2004-05-29 22:56:24 +02:00
|
|
|
|
2008-06-30 21:08:29 +02:00
|
|
|
#include "SColor.h"
|
2006-06-02 04:10:27 +02:00
|
|
|
#include "maths/Vector3D.h"
|
|
|
|
#include "maths/Vector4D.h"
|
2004-05-29 22:56:24 +02:00
|
|
|
|
2006-02-13 15:18:20 +01:00
|
|
|
// simple defines for 3 and 4 component floating point colors - just map to
|
2004-05-29 22:56:24 +02:00
|
|
|
// corresponding vector types
|
|
|
|
typedef CVector3D RGBColor;
|
|
|
|
typedef CVector4D RGBAColor;
|
|
|
|
|
2006-04-14 08:32:05 +02:00
|
|
|
// exposed as function pointer because it is set at init-time to
|
|
|
|
// one of several implementations depending on CPU caps.
|
2008-06-30 21:08:29 +02:00
|
|
|
extern SColor4ub (*ConvertRGBColorTo4ub)(const RGBColor& src);
|
2005-10-03 05:41:42 +02:00
|
|
|
|
2007-05-02 14:07:08 +02:00
|
|
|
// call once ia32_Init has run; detects CPU caps and activates the best
|
2006-04-14 08:32:05 +02:00
|
|
|
// possible codepath.
|
|
|
|
extern void ColorActivateFastImpl();
|
|
|
|
|
2004-05-29 22:56:24 +02:00
|
|
|
#endif
|