summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAleksey Veresov <aleksey@veresov.pro>2021-03-03 15:52:45 +0300
committerAleksey Veresov <aleksey@veresov.pro>2021-03-03 15:52:45 +0300
commit92f560abade4b180809bf153cc2270949d77d32a (patch)
tree335b0ec0a4ce22597332c0838cf159470b640cf0 /src
parentdbac9d0da4587ffe7a4de397a61d6d9af0ad7226 (diff)
downloadtakethis-92f560abade4b180809bf153cc2270949d77d32a.tar
takethis-92f560abade4b180809bf153cc2270949d77d32a.tar.xz
takethis-92f560abade4b180809bf153cc2270949d77d32a.zip
o_O
Diffstat (limited to 'src')
-rw-r--r--src/body.c2
-rw-r--r--src/game.c3
-rw-r--r--src/map.c5
-rw-r--r--src/player.c2
4 files changed, 8 insertions, 4 deletions
diff --git a/src/body.c b/src/body.c
index fa915bb..60e3cb9 100644
--- a/src/body.c
+++ b/src/body.c
@@ -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;
diff --git a/src/game.c b/src/game.c
index 664fa0b..1d5e2d6 100644
--- a/src/game.c
+++ b/src/game.c
@@ -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 };
diff --git a/src/map.c b/src/map.c
index a08749a..d602e29 100644
--- a/src/map.c
+++ b/src/map.c
@@ -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);