From f998d6f25ce00f77845543dc3e60aff803d8454d Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Thu, 4 Mar 2021 00:58:26 +0300 Subject: Fix. --- src/.game.c.swp | Bin 0 -> 16384 bytes src/game.c | 51 +++++++++++++++++++++++++++++---------------------- 2 files changed, 29 insertions(+), 22 deletions(-) create mode 100644 src/.game.c.swp (limited to 'src') diff --git a/src/.game.c.swp b/src/.game.c.swp new file mode 100644 index 0000000..8016c6d Binary files /dev/null and b/src/.game.c.swp differ diff --git a/src/game.c b/src/game.c index 0b9edc0..e5daeee 100644 --- a/src/game.c +++ b/src/game.c @@ -903,17 +903,6 @@ void changeroom(int out) SDL_Rect d = { 14 + b->x + fullx + transx, 14 + b->y + fully + transy, 32, 32 }; SDL_RenderCopy(ttrdr, tttxr, &s, &d); - if (b->msg) { - SDL_Color c = { 255, 255, 255, 255 }; - SDL_Surface *s = - TTF_RenderText_Blended(ttfont, b->msg, c); - SDL_Texture *t = SDL_CreateTextureFromSurface(ttrdr, s); - SDL_Rect dst = { 50 + b->x + fullx + transx, - 20 + b->y + fully + transy, s->w, s->h }; - SDL_RenderCopy(ttrdr, t, 0, &dst); - SDL_DestroyTexture(t); - SDL_FreeSurface(s); - } } } { @@ -945,17 +934,6 @@ void changeroom(int out) SDL_Rect d = { 14 + b->x + transx, 14 + b->y + transy, 32, 32 }; SDL_RenderCopy(ttrdr, tttxr, &s, &d); - if (b->msg) { - SDL_Color c = { 255, 255, 255, 255 }; - SDL_Surface *s = - TTF_RenderText_Blended(ttfont, b->msg, c); - SDL_Texture *t = SDL_CreateTextureFromSurface(ttrdr, s); - SDL_Rect dst = { 50 + b->x + transx, 20 + b->y + transy, - s->w, s->h }; - SDL_RenderCopy(ttrdr, t, 0, &dst); - SDL_DestroyTexture(t); - SDL_FreeSurface(s); - } } SDL_Rect d = { 14 + ttplayer.x + transx + playx, @@ -1212,6 +1190,35 @@ void changeroom(int out) SDL_SetTextureBlendMode(tttxr, bm); SDL_SetRenderDrawColor(ttrdr, 0, 0, 0, 255); } + for (i = 0; i != r->bodies_count; ++i) { + tt_body *b = r->bodies + i; + if (b->msg) { + SDL_Color c = { 255, 255, 255, 255 }; + SDL_Surface *s = + TTF_RenderText_Blended(ttfont, b->msg, c); + SDL_Texture *t = SDL_CreateTextureFromSurface(ttrdr, s); + SDL_Rect dst = { 50 + b->x + fullx + transx, + 20 + b->y + fully + transy, s->w, s->h }; + SDL_RenderCopy(ttrdr, t, 0, &dst); + SDL_DestroyTexture(t); + SDL_FreeSurface(s); + } + } + r = ttplayer.room; + for (i = 0; i != r->bodies_count; ++i) { + tt_body *b = r->bodies + i; + if (b->msg) { + SDL_Color c = { 255, 255, 255, 255 }; + SDL_Surface *s = + TTF_RenderText_Blended(ttfont, b->msg, c); + SDL_Texture *t = SDL_CreateTextureFromSurface(ttrdr, s); + SDL_Rect dst = { 50 + b->x + transx, 20 + b->y + transy, + s->w, s->h }; + SDL_RenderCopy(ttrdr, t, 0, &dst); + SDL_DestroyTexture(t); + SDL_FreeSurface(s); + } + } } { SDL_Rect d = { 0, 0, 14, 540 }; -- cgit v1.2.3