diff options
author | Aleksey Veresov <aleksey@veresov.pro> | 2021-03-03 02:29:12 +0300 |
---|---|---|
committer | Aleksey Veresov <aleksey@veresov.pro> | 2021-03-03 02:29:12 +0300 |
commit | 05ecdfacb7fe981ec3b321a65a9d183298cb80db (patch) | |
tree | 7c7e001d10f89dc8c06967cfc1e0e534260bc36f /src/player.c | |
parent | 72a022286d0588038019e879a2f475c7a31290c7 (diff) | |
download | takethis-05ecdfacb7fe981ec3b321a65a9d183298cb80db.tar takethis-05ecdfacb7fe981ec3b321a65a9d183298cb80db.tar.xz takethis-05ecdfacb7fe981ec3b321a65a9d183298cb80db.zip |
LIGHT!
Diffstat (limited to 'src/player.c')
-rw-r--r-- | src/player.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/player.c b/src/player.c index edf18e3..ed17b78 100644 --- a/src/player.c +++ b/src/player.c @@ -85,22 +85,30 @@ void tt_player_draw() } { - SDL_SetTextureAlphaMod(tttxr, 32); + SDL_BlendMode bm; + SDL_GetTextureBlendMode(tttxr, &bm); + SDL_SetTextureBlendMode(tttxr, SDL_BLENDMODE_ADD); + SDL_SetTextureAlphaMod(tttxr, 64); SDL_SetRenderTarget(ttrdr, lighttxr); + SDL_SetRenderDrawColor(ttrdr, 192, 192, 192, 255); SDL_RenderClear(ttrdr); int i; for (i = 0; i != r->bodies_count; ++i) { tt_body *b = r->bodies + i; if ((7 == b->txrrow && b->txrcol <= 7) || b->txrrow == 11) { SDL_Rect src = { 16 * 14, 16 * 12, 32, 32 }; - SDL_Rect d = { b->x, b->y, 64, 64 }; + SDL_Rect d = { b->x - 16, b->y - 16, 96, 96 }; + SDL_SetTextureColorMod(tttxr, 255, 255, 255); SDL_RenderCopy(ttrdr, tttxr, &src, &d); } } + SDL_SetTextureColorMod(tttxr, 255, 255, 255); SDL_SetTextureAlphaMod(tttxr, 255); SDL_SetRenderTarget(ttrdr, 0); SDL_Rect dst = { 0, 0, 950, 540 }; SDL_RenderCopy(ttrdr, lighttxr, 0, &dst); + SDL_SetTextureBlendMode(tttxr, bm); + SDL_SetRenderDrawColor(ttrdr, 0, 0, 0, 255); } { |