Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/graphics/Color.h
/* Copyright (C) 2019 Wildfire Games. | /* Copyright (C) 2020 Wildfire Games. | ||||
* This file is part of 0 A.D. | * This file is part of 0 A.D. | ||||
* | * | ||||
* 0 A.D. is free software: you can redistribute it and/or modify | * 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 | * it under the terms of the GNU General Public License as published by | ||||
* the Free Software Foundation, either version 2 of the License, or | * the Free Software Foundation, either version 2 of the License, or | ||||
* (at your option) any later version. | * (at your option) any later version. | ||||
* | * | ||||
* 0 A.D. is distributed in the hope that it will be useful, | * 0 A.D. is distributed in the hope that it will be useful, | ||||
Show All 17 Lines | |||||
typedef CVector3D RGBColor; | typedef CVector3D RGBColor; | ||||
typedef CVector4D RGBAColor; | typedef CVector4D RGBAColor; | ||||
// Convert float RGB(A) colors to unsigned byte. | // Convert float RGB(A) colors to unsigned byte. | ||||
// Exposed as function pointer because it is set at init-time to | // Exposed as function pointer because it is set at init-time to | ||||
// one of several implementations depending on CPU caps. | // one of several implementations depending on CPU caps. | ||||
extern SColor4ub (*ConvertRGBColorTo4ub)(const RGBColor& src); | extern SColor4ub (*ConvertRGBColorTo4ub)(const RGBColor& src); | ||||
// call once ia32_Init has run; detects CPU caps and activates the best | /** | ||||
// possible codepath. | * Detects CPU caps and activates the best possible codepath. | ||||
*/ | |||||
extern void ColorActivateFastImpl(); | extern void ColorActivateFastImpl(); | ||||
class CStr8; | class CStr8; | ||||
struct CColor | struct CColor | ||||
{ | { | ||||
CColor() : r(-1.f), g(-1.f), b(-1.f), a(1.f) {} | CColor() : r(-1.f), g(-1.f), b(-1.f), a(1.f) {} | ||||
CColor(float cr, float cg, float cb, float ca) : r(cr), g(cg), b(cb), a(ca) {} | CColor(float cr, float cg, float cb, float ca) : r(cr), g(cg), b(cb), a(ca) {} | ||||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator