mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +00:00
LibGL: Use correct GLbyte
range in glColor4b
We were only setting half the color intensity that we should have set.
This commit is contained in:
parent
ae88c642c6
commit
4b6b9f272f
1 changed files with 6 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Jesse Buhagiar <jooster669@gmail.com>
|
||||
* Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
||||
* Copyright (c) 2022, Jelle Raaijmakers <jelle@gmta.nl>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -42,7 +43,11 @@ void glColor3ubv(GLubyte const* v)
|
|||
|
||||
void glColor4b(GLbyte r, GLbyte g, GLbyte b, GLbyte a)
|
||||
{
|
||||
g_gl_context->gl_color(r / 255.0, g / 255.0, b / 255.0, a / 255.0);
|
||||
g_gl_context->gl_color(
|
||||
(static_cast<double>(r) + 128) / 127.5 - 1,
|
||||
(static_cast<double>(g) + 128) / 127.5 - 1,
|
||||
(static_cast<double>(b) + 128) / 127.5 - 1,
|
||||
(static_cast<double>(a) + 128) / 127.5 - 1);
|
||||
}
|
||||
|
||||
void glColor4dv(GLdouble const* v)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue