diff options
author | Aleksey Veresov <aleksey@veresov.pro> | 2021-03-03 15:52:45 +0300 |
---|---|---|
committer | Aleksey Veresov <aleksey@veresov.pro> | 2021-03-03 15:52:45 +0300 |
commit | 92f560abade4b180809bf153cc2270949d77d32a (patch) | |
tree | 335b0ec0a4ce22597332c0838cf159470b640cf0 /src | |
parent | dbac9d0da4587ffe7a4de397a61d6d9af0ad7226 (diff) | |
download | takethis-92f560abade4b180809bf153cc2270949d77d32a.tar takethis-92f560abade4b180809bf153cc2270949d77d32a.tar.xz takethis-92f560abade4b180809bf153cc2270949d77d32a.zip |
o_O
Diffstat (limited to 'src')
-rw-r--r-- | src/body.c | 2 | ||||
-rw-r--r-- | src/game.c | 3 | ||||
-rw-r--r-- | src/map.c | 5 | ||||
-rw-r--r-- | src/player.c | 2 |
4 files changed, 8 insertions, 4 deletions
@@ -33,7 +33,7 @@ void tt_body_move(int d) int eyr = b->yrem; move(b, d); { - SDL_Rect box = { b->x + 5, b->y + 2, 22, 28 }; + SDL_Rect box = { b->x + 5, b->y + 2, 24, 24 }; if (!tt_room_collide(r, &box) && !tt_room_out(r, &box)) continue; } b->x = ex; @@ -4,6 +4,7 @@ #include "map.h" #include <SDL2/SDL.h> #include <stdio.h> +#include <math.h> int magic = 0; int lenin_size = 0; @@ -986,7 +987,7 @@ void changeroom(int out) for (i = 0; i != r->bodies_count; ++i) { tt_body *b = r->bodies + i; if ((6 == b->txrrow && b->txrcol <= 1) || - b->txrrow == 11) { + b->txrrow == 10) { SDL_Rect src = { 16 * 14, 16 * 11, 32, 32 }; SDL_Rect d = { b->x + fullx + transx - 32, b->y + fully + transy - 32, 128, 128 }; @@ -29,7 +29,10 @@ static SDL_Rect *newtile(int row, int col) static void loadroom(tt_room *r, FILE *f) { - int default_floor_id = fgetc(f) - '0'; + int default_floor_id = fgetc(f); + if (default_floor_id < 'a') default_floor_id -= '0'; + else + default_floor_id = default_floor_id - 'a' + 10; fgetc(f); int i, j; for (i = 0; i != 4; ++i) r->neighbours[i] = ttmap + fgetc(f); diff --git a/src/player.c b/src/player.c index abfff35..50101e7 100644 --- a/src/player.c +++ b/src/player.c @@ -104,7 +104,7 @@ void tt_player_draw() int i; for (i = 0; i != r->bodies_count; ++i) { tt_body *b = r->bodies + i; - if ((6 == b->txrrow && b->txrcol <= 1) || b->txrrow == 11) { + if ((6 == b->txrrow && b->txrcol <= 1) || b->txrrow == 10) { SDL_Rect src = { 16 * 14, 16 * 11, 32, 32 }; SDL_Rect d = { b->x - 32, b->y - 32, 128, 128 }; SDL_SetTextureColorMod(tttxr, 255, 255, 255); |