summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/tiletex.h
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-03 16:18:02 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2009-07-03 16:18:02 +0000
commit2c2a0304ec8308f912860f05dc1099b86f71773c (patch)
tree26a30495b0700fcb595aeafb7b3149c9f73d18d6 /crawl-ref/source/tiletex.h
parent1127ccc6b5bd418aead10e6b968aeef4d6909551 (diff)
downloadcrawl-ref-2c2a0304ec8308f912860f05dc1099b86f71773c.tar.gz
crawl-ref-2c2a0304ec8308f912860f05dc1099b86f71773c.zip
* Fix centaur/naga tiles not being displayed correctly in the character
selection menu. * Add dolls_data to player_save_info struct, to make it easier to read in per-character doll information once we get around to that. Including the tiledef files in externs.h is probably overkill, though, so we might want to move player_save_info into another header file. * Fix Xom's repel stair effect moving shops. * Fix decks granting permanent summons at low power (and only at low power). * Make default settings of the brand options consistent between init.txt and initfile.cc. * Update FAQ. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10086 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/tiletex.h')
-rw-r--r--crawl-ref/source/tiletex.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/crawl-ref/source/tiletex.h b/crawl-ref/source/tiletex.h
index f3e18ca07c..ed5e48da26 100644
--- a/crawl-ref/source/tiletex.h
+++ b/crawl-ref/source/tiletex.h
@@ -20,10 +20,12 @@ enum TextureID
struct tile_def
{
- tile_def(int _tile, TextureID _tex) : tile(_tile), tex(_tex) {}
+ tile_def(int _tile, TextureID _tex, int _ymax = TILE_Y)
+ : tile(_tile), tex(_tex), ymax(_ymax){}
int tile;
TextureID tex;
+ int ymax;
};
class GenericTexture
@@ -100,10 +102,10 @@ inline void TilesTexture::get_coords(int idx, int ofs_x, int ofs_y,
{
const tile_info &inf = get_info(idx);
- float fwidth = m_width;
+ float fwidth = m_width;
float fheight = m_height;
- // center tiles on x, but allow taller tiles to extend upwards
+ // Centre tiles on x, but allow taller tiles to extend upwards.
int size_ox = centre ? TILE_X / 2 - inf.width / 2 : 0;
int size_oy = centre ? TILE_Y - inf.height : 0;
@@ -111,8 +113,8 @@ inline void TilesTexture::get_coords(int idx, int ofs_x, int ofs_y,
if (ymax > 0)
ey = std::min(inf.sy + ymax - inf.offset_y, ey);
- pos_sx += (ofs_x + inf.offset_x + size_ox) / (float)TILE_X;
- pos_sy += (ofs_y + inf.offset_y + size_oy) / (float)TILE_Y;
+ pos_sx += (ofs_x + inf.offset_x + size_ox) / (float) TILE_X;
+ pos_sy += (ofs_y + inf.offset_y + size_oy) / (float) TILE_Y;
pos_ex = pos_sx + (inf.ex - inf.sx) / (float)TILE_X;
pos_ey = pos_sy + (ey - inf.sy) / (float)TILE_Y;
@@ -122,5 +124,4 @@ inline void TilesTexture::get_coords(int idx, int ofs_x, int ofs_y,
tex_ey = ey / fheight;
}
-
#endif