summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2021-03-04 00:58:26 +0300
committerAleksey Veresov <aleksey@veresov.pro>2021-03-04 00:58:26 +0300
commitf998d6f25ce00f77845543dc3e60aff803d8454d (patch)
treefb72e5adb59cd60174beee8276e5cc7de5982ca9 /src
parentcef64bcb82de6392344924d8aaebd2aa71e05000 (diff)
downloadtakethis-f998d6f25ce00f77845543dc3e60aff803d8454d.tar
takethis-f998d6f25ce00f77845543dc3e60aff803d8454d.tar.xz
takethis-f998d6f25ce00f77845543dc3e60aff803d8454d.zip
Fix.
Diffstat (limited to 'src')
-rw-r--r--src/.game.c.swpbin0 -> 16384 bytes
-rw-r--r--src/game.c51
2 files changed, 29 insertions, 22 deletions
diff --git a/src/.game.c.swp b/src/.game.c.swp
new file mode 100644
index 0000000..8016c6d
--- /dev/null
+++ b/src/.game.c.swp
Binary files 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 };