projects
/
rocksndiamonds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
064971a
)
fixed bugs when using element graphics with non-standard tile size
author
Holger Schemel
<info@artsoft.org>
Sun, 20 Dec 2015 17:53:39 +0000
(18:53 +0100)
committer
Holger Schemel
<info@artsoft.org>
Sun, 20 Dec 2015 17:53:39 +0000
(18:53 +0100)
src/init.c
patch
|
blob
|
history
src/tools.c
patch
|
blob
|
history
diff --git
a/src/init.c
b/src/init.c
index 3a2ccca2a197faf55d116d37b1dcff09bd548ce3..ca820886f380c18d9ca65fc5dfb8a8df0e709d5c 100644
(file)
--- a/
src/init.c
+++ b/
src/init.c
@@
-1076,11
+1076,9
@@
static void set_graphic_parameters_ext(int graphic, int *parameter,
g->tile_size = TILESIZE; /* standard tile size */
#endif
g->tile_size = TILESIZE; /* standard tile size */
#endif
-#if 0
- // CHECK: when setting tile size, should this set width and height?
+ // when setting tile size, also set width and height accordingly
g->width = g->tile_size;
g->height = g->tile_size;
g->width = g->tile_size;
g->height = g->tile_size;
-#endif
}
if (g->use_image_size)
}
if (g->use_image_size)
diff --git
a/src/tools.c
b/src/tools.c
index 5c1f6549daee1d533f5e27333abf84f8d79e97cb..7a15c03e81b4973bbf5d29a533252ade5b43d30d 100644
(file)
--- a/
src/tools.c
+++ b/
src/tools.c
@@
-1065,8
+1065,8
@@
void getSizedGraphicSourceExt(int graphic, int frame, int tilesize,
}
*bitmap = src_bitmap;
}
*bitmap = src_bitmap;
- *x = src_x * tilesize /
TILESIZE
;
- *y = src_y * tilesize /
TILESIZE
;
+ *x = src_x * tilesize /
g->tile_size
;
+ *y = src_y * tilesize /
g->tile_size
;
}
void getFixedGraphicSourceExt(int graphic, int frame, Bitmap **bitmap,
}
void getFixedGraphicSourceExt(int graphic, int frame, Bitmap **bitmap,
@@
-1127,6
+1127,9
@@
inline static void getGraphicSourceExt(int graphic, int frame, Bitmap **bitmap,
*x = src_x + frame * g->offset_x;
*y = src_y + frame * g->offset_y;
}
*x = src_x + frame * g->offset_x;
*y = src_y + frame * g->offset_y;
}
+
+ *x = *x * TILESIZE_VAR / g->tile_size;
+ *y = *y * TILESIZE_VAR / g->tile_size;
}
void getGraphicSource(int graphic, int frame, Bitmap **bitmap, int *x, int *y)
}
void getGraphicSource(int graphic, int frame, Bitmap **bitmap, int *x, int *y)