Tint rendered lights with light_color - #35
Conversation
|
Thank you for your contribution, but unfortunately it wasn't working your fix in my local machine. I tried this steps to tested it;
Can you try to fix it or give me proper way to test your changes in this pull request. Thanks... |
|
Thanks for testing it. I found the missing path: the first patch tinted direct Light(size, light_color=...) usage, but item lights created from items/info.json were still instantiating Light without passing the configured lights.RGB value. I pushed commit 125693e to pass lights.RGB into the item light system and to keep an existing light system in sync with that value. I also added a regression test covering the Temp.decorate() path using a sample lights RGB config. Validation run locally:
For manual verification, use an item entry with lights coords/size/RGB, for example RGB [255, 0, 0]. The rendered item light should now use that red tint instead of staying white. |
|
Thanks for the changes. I've tested and it works perfectly. |
| return surface | ||
|
|
||
|
|
||
| def test_render_tints_light_with_light_color(monkeypatch): |
There was a problem hiding this comment.
Good for testing case, I appreciate it...
Summary
light_colorargument toLightwith the current white behavior as the default.Fixes #33.
Validation
PYTHONPATH=. uv run --no-project --with pytest --with pygame==2.6.1 pytest -q tests/test_light.pyPYTHONPATH=. uv run --no-project --with ruff ruff check game_engine/core/light.py tests/test_light.pypython3 -m py_compile game_engine/core/light.py tests/test_light.pygit diff --check