diff options
author | Hugo Locurcio <hugo.locurcio@hugo.pro> | 2023-04-04 02:30:05 +0200 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-04-24 16:28:26 +0200 |
commit | 9253f415b3407e1dc96a7b4cb0bbd28ed9fcf991 (patch) | |
tree | a31f447a188b3d4fef00504ddb099820fc7295b9 /servers | |
parent | 214ad50498deac45a805e5612fbf4290dc3575b7 (diff) |
Fix `get_test_texture()` returning an almost fully white texture
The texture's appearance is now similar to the texture that was displayed
on the TestCube node in Godot 2.x.
(cherry picked from commit e4d5cecd4c5e571b6f46b2a7d3e693d09277eb37)
Diffstat (limited to 'servers')
-rw-r--r-- | servers/rendering_server.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/servers/rendering_server.cpp b/servers/rendering_server.cpp index 3d0443b494..8380558e1c 100644 --- a/servers/rendering_server.cpp +++ b/servers/rendering_server.cpp @@ -140,9 +140,9 @@ RID RenderingServer::get_test_texture() { c.b = y; } - w[(y * TEST_TEXTURE_SIZE + x) * 3 + 0] = uint8_t(CLAMP(c.r * 255, 0, 255)); - w[(y * TEST_TEXTURE_SIZE + x) * 3 + 1] = uint8_t(CLAMP(c.g * 255, 0, 255)); - w[(y * TEST_TEXTURE_SIZE + x) * 3 + 2] = uint8_t(CLAMP(c.b * 255, 0, 255)); + w[(y * TEST_TEXTURE_SIZE + x) * 3 + 0] = uint8_t(CLAMP(c.r, 0, 255)); + w[(y * TEST_TEXTURE_SIZE + x) * 3 + 1] = uint8_t(CLAMP(c.g, 0, 255)); + w[(y * TEST_TEXTURE_SIZE + x) * 3 + 2] = uint8_t(CLAMP(c.b, 0, 255)); } } } |