summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--crawl-ref/docs/options_guide.txt30
-rw-r--r--crawl-ref/docs/patch_guide.txt16
-rw-r--r--crawl-ref/settings/init.txt14
-rw-r--r--crawl-ref/source/acr.cc3
-rw-r--r--crawl-ref/source/dat/database/FAQ.txt38
-rw-r--r--crawl-ref/source/decks.cc8
-rw-r--r--crawl-ref/source/externs.h15
-rw-r--r--crawl-ref/source/initfile.cc58
-rw-r--r--crawl-ref/source/menu.cc22
-rw-r--r--crawl-ref/source/newgame.cc18
-rw-r--r--crawl-ref/source/player.cc1
-rw-r--r--crawl-ref/source/tilebuf.cc9
-rw-r--r--crawl-ref/source/tilebuf.h4
-rw-r--r--crawl-ref/source/tilereg.cc7
-rw-r--r--crawl-ref/source/tiles.h7
-rw-r--r--crawl-ref/source/tiletex.h13
16 files changed, 163 insertions, 100 deletions
diff --git a/crawl-ref/docs/options_guide.txt b/crawl-ref/docs/options_guide.txt
index f70401d084..2a48a26872 100644
--- a/crawl-ref/docs/options_guide.txt
+++ b/crawl-ref/docs/options_guide.txt
@@ -630,32 +630,26 @@ By default, only two of the item brands are active (and set to reverse):
heap_brand, feature_item_brand
They can be deactivated by setting them to "none".
-friend_brand = none
- Brand friends in some way. This is very helpful for summoners.
- E.g.
- friend_brand = hi:green
- shows friends with a green background. If the friend is itself
- green, it'll show up as black on green.
-
-neutral_brand = none
+friend_brand = hi:green
+ Brand friends in some way. This is very helpful for summoners. The
+ default setting shows friends with a green background. If the friend is
+ itself green, it'll show up as black on green.
+
+neutral_brand = hi:lightgrey
Brand neutral monsters in some way. Useful both to get out of
a neutral monster's path, and to avoid accidentally killing it.
- E.g.
- neutral_brand = hi:darkgrey
- shows neutrals with a dark grey background. Since there are
- no darkgrey monster glyphs anymore, this works fine.
+ The default setting shows neutrals with a dark grey background. Since
+ there are no darkgrey monster glyphs anymore, this works fine.
-stab_brand = none
+stab_brand = hi:blue
Some deities object to you stabbing monsters. Certain jobs
specialise in stabbing monsters. Still other characters are
happy if they spot a monster before the monster spots them. In
all these cases, it helps to identify monsters that are unaware
of the character (and hence susceptible to being stabbed) without
- using the 'x' command. All the normal 'brand' options apply. For
- example
- stab_brand = hi:blue
+ using the 'x' command. All the normal 'brand' options apply.
-may_stab_brand = none
+may_stab_brand = hi:yellow
Stabbing may be possible even if the monster is not asleep (if
it's confused or distracted, for instance). This option brands
monsters that you *might* be able to stab.
@@ -669,7 +663,7 @@ feature_item_brand = reverse
are hidden by the feature symbol and the feature symbol is
branded.
-trap_item_brand = none
+trap_item_brand = reverse
Brands traps that would otherwise be hidden by items. If you
use this brand, the items on the square are hidden by the trap
symbol (^) and the trap symbol is branded.
diff --git a/crawl-ref/docs/patch_guide.txt b/crawl-ref/docs/patch_guide.txt
index 344c415242..34679dff84 100644
--- a/crawl-ref/docs/patch_guide.txt
+++ b/crawl-ref/docs/patch_guide.txt
@@ -56,13 +56,15 @@ Main steps
You may want to apply the patch against the unmodified folder to test
whether everything worked correctly.
-7.) Upload the patch on the patch tracker of Sourceforge. Here it is immensely
- helpful if you give a summary of what the patch is about. If you created
- it in response to a bug report or feature request, mention the id, and you
- might also want to post a reply in said item pointing out your new patch.
- Please also mention the revision/version you used for patching, e.g. 0.5
- or r10078, and anything you think still may need to be improved or
- modified.
+7.) Upload the patch on the patch tracker of Sourceforge at
+ http://sourceforge.net/tracker/?group_id=143991&atid=757515.
+
+ Here it is immensely helpful if you give a summary of what the patch is
+ about. If you created it in response to a bug report or feature request,
+ mention the id, and you might also want to post a reply in said item
+ pointing out your new patch. Please also mention the revision/version you
+ used for patching, e.g. 0.5 or r10078, and anything you think may still
+ need to be improved or modified.
Thank you! :D
diff --git a/crawl-ref/settings/init.txt b/crawl-ref/settings/init.txt
index 6be1049e00..5622302925 100644
--- a/crawl-ref/settings/init.txt
+++ b/crawl-ref/settings/init.txt
@@ -128,13 +128,13 @@ drop_filter = useless_item
##### 4-d Branding ##############################
#
-friend_brand = hi:green
-neutral_brand = hi:lightgrey
-stab_brand = hi:blue
-may_stab_brand = hi:yellow
-heap_brand = reverse
-feature_item_brand = reverse
-trap_item_brand = reverse
+# friend_brand = hi:green
+# neutral_brand = hi:lightgrey
+# stab_brand = hi:blue
+# may_stab_brand = hi:yellow
+# heap_brand = reverse
+# feature_item_brand = reverse
+# trap_item_brand = reverse
##### 4-e Level Map Functions ###################
#
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 835b08cf6f..5c33712ff5 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -294,6 +294,7 @@ int main( int argc, char *argv[] )
static void _show_commandline_options_help()
{
puts("Command line options:");
+ puts(" -help prints this list of options");
puts(" -name <string> character name");
puts(" -race <arg> preselect race (by letter, abbreviation, or name)");
puts(" -class <arg> preselect class (by letter, abbreviation, or name)");
@@ -307,7 +308,7 @@ static void _show_commandline_options_help()
puts("Command line options override init file options, which override");
puts("environment options (CRAWL_NAME, CRAWL_DIR, CRAWL_RC).");
puts("");
- puts("Highscore list options: (Can now be redirected to more, etc)");
+ puts("Highscore list options: (Can be redirected to more, etc)");
puts(" -scores [N] highscore list");
puts(" -tscores [N] terse highscore list");
puts(" -vscores [N] verbose highscore list");
diff --git a/crawl-ref/source/dat/database/FAQ.txt b/crawl-ref/source/dat/database/FAQ.txt
index 4df69f4124..8ba2da724d 100644
--- a/crawl-ref/source/dat/database/FAQ.txt
+++ b/crawl-ref/source/dat/database/FAQ.txt
@@ -345,6 +345,9 @@ your suggestions under Feature Requests and wait for people to become
enthusiastic and give feedback before you submit a patch. If you want,
you can also write a patch that implements an existing FR or fixes a bug.
+If you'd like to write a patch but don't know how to go about it,
+patch_guide.txt in the docs/ folder is the file for you.
+
We really appreciate your help!
%%%%
Q:help
@@ -411,6 +414,26 @@ the change log in docs/changes.stone_soup.
##############################################
# Questions about the Tiles version
##############################################
+Q:tiles lag
+
+The tiles version is awfully slow on Windows! What can I do to improve that?
+%%%%
+A:tiles lag
+
+First, we're really sorry about that! Stonesoup 0.5 was tested on several
+systems and the gigantic lag on some Windows systems was completely unexpected.
+
+Crawl 0.5 renders graphics using OpenGL and SDL. For most video cards, this
+should be faster than the 0.4 version. However, the default driver that ships
+with Windows is extremely slow. If you are having performance problems, be sure
+to update your video card driver as a first step.
+
+We're working on a solution for this problem, but in the meantime you can try
+to see whether tweaking some options will improve performance. See
+docs/tiles_help.txt for details. If things are still too laggy after all of
+that, you'll have to either continue playing 0.4.5 until the problem has been
+solved, or you could try the non-graphical console version. Sorry!
+%%%%
Q:tiles online
Can I play Tiles online?
@@ -457,3 +480,18 @@ A:tiles options
A: Yes. Play around with the options in settings/tiles_options.txt until
you are satisfied.
%%%%
+Q:tiles doll
+
+Why can I no longer change the look of my character?
+%%%%
+A:tiles doll
+
+That feature got broken when we transitioned to openGL and needs to be
+reimplemented. It will come back, but we can't say, when.
+
+In the meantime we've implemented a really basic menu (still '-') that lets
+you choose between the default look according to job, equipment mode and one
+of a number of predefined dolls.
+
+Sorry about that!
+%%%% \ No newline at end of file
diff --git a/crawl-ref/source/decks.cc b/crawl-ref/source/decks.cc
index 1659903d9b..825ce9601f 100644
--- a/crawl-ref/source/decks.cc
+++ b/crawl-ref/source/decks.cc
@@ -2687,7 +2687,7 @@ static void _summon_demon_card(int power, deck_rarity_type rarity)
// This hack appears later in this file as well.
if (create_monster(
mgen_data(summon_any_demon(dct), BEH_FRIENDLY,
- std::min(power / 50, 6), 0,
+ std::min(power/50 + 1, 6), 0,
you.pos(), MHITYOU),
false) == -1)
{
@@ -2835,7 +2835,7 @@ static void _summon_flying(int power, deck_rarity_type rarity)
create_monster(
mgen_data(result,
friendly ? BEH_FRIENDLY : BEH_HOSTILE,
- std::min(power / 50, 6), 0,
+ std::min(power/50 + 1, 6), 0,
you.pos(), MHITYOU));
}
}
@@ -2850,7 +2850,7 @@ static void _summon_skeleton(int power, deck_rarity_type rarity)
if (create_monster(mgen_data(skeltypes[power_level],
friendly ? BEH_FRIENDLY : BEH_HOSTILE,
- std::min(power / 50, 6), 0,
+ std::min(power/50 + 1, 6), 0,
you.pos(), MHITYOU),
false) == -1)
{
@@ -2872,7 +2872,7 @@ static void _summon_ugly(int power, deck_rarity_type rarity)
if (create_monster(mgen_data(ugly,
friendly ? BEH_FRIENDLY : BEH_HOSTILE,
- std::min(power / 50, 6), 0,
+ std::min(power/50 + 1, 6), 0,
you.pos(), MHITYOU),
false) == -1)
{
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index 068ceb0291..2f0aa523a3 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -28,6 +28,18 @@
#include "store.h"
#ifdef USE_TILE
+// This used to be in tiles.h. (jpeg)
+#include "tiledef-main.h"
+#include "tiledef-dngn.h"
+#include "tiledef-player.h"
+
+struct dolls_data
+{
+ dolls_data() { memset(parts, 0, sizeof(parts)); }
+
+ int parts[TILEP_PART_MAX];
+};
+
struct tile_flavour
{
// The floor tile to use.
@@ -1178,6 +1190,9 @@ struct player_save_info
species_type species;
std::string class_name;
god_type religion;
+#ifdef USE_TILE
+ dolls_data doll;
+#endif
player_save_info operator=(const player& rhs);
bool operator<(const player_save_info& rhs) const;
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index a9c3833a4b..0a61a61c38 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -655,6 +655,9 @@ void game_options::reset_options()
#if !defined(SHORT_FILE_NAMES) && !defined(SAVE_DIR_PATH)
morgue_dir = "morgue/";
#endif
+
+ macro_dir = "settings/";
+
additional_macro_files.clear();
player_name.clear();
@@ -877,15 +880,15 @@ void game_options::reset_options()
sc_entries = 0;
sc_format = -1;
- friend_brand = CHATTR_NORMAL;
- neutral_brand = CHATTR_NORMAL;
- stab_brand = CHATTR_NORMAL;
- may_stab_brand = CHATTR_NORMAL;
+ friend_brand = CHATTR_HILITE | (GREEN << 8);
+ neutral_brand = CHATTR_HILITE | (LIGHTGREY << 8);
+ stab_brand = CHATTR_HILITE | (BLUE << 8);
+ may_stab_brand = CHATTR_HILITE | (YELLOW << 8);
heap_brand = CHATTR_REVERSE;
feature_item_brand = CHATTR_REVERSE;
- trap_item_brand = CHATTR_NORMAL;
+ trap_item_brand = CHATTR_REVERSE;
- no_dark_brand = true;
+ no_dark_brand = true;
#ifdef WIZARD
wiz_mode = WIZ_NO;
@@ -3404,6 +3407,7 @@ enum commandline_option_type {
CLO_MACRO,
CLO_MAPSTAT,
CLO_ARENA,
+ CLO_HELP,
CLO_NOPS
};
@@ -3411,7 +3415,7 @@ enum commandline_option_type {
static const char *cmd_ops[] = {
"scores", "name", "species", "job", "plain", "dir", "rc",
"rcdir", "tscores", "vscores", "scorefile", "morgue", "macro",
- "mapstat", "arena"
+ "mapstat", "arena", "help"
};
const int num_cmd_ops = CLO_NOPS;
@@ -3462,7 +3466,7 @@ bool parse_args( int argc, char **argv, bool rc_only )
return (false);
}
- // look for match (now we also except --scores)
+ // Look for match (we accept both -option and --option).
if (arg[1] == '-')
arg = &arg[2];
else
@@ -3470,10 +3474,12 @@ bool parse_args( int argc, char **argv, bool rc_only )
int o;
for (o = 0; o < num_cmd_ops; o++)
- {
- if (stricmp(cmd_ops[o], arg) == 0)
- break;
- }
+ if (stricmp(cmd_ops[o], arg) == 0)
+ break;
+
+ // Print the list of commandline options for "--help".
+ if (o == CLO_HELP)
+ return (false);
if (o == num_cmd_ops)
{
@@ -3482,22 +3488,22 @@ bool parse_args( int argc, char **argv, bool rc_only )
return (false);
}
- // disallow options specified more than once.
+ // Disallow options specified more than once.
if (arg_seen[o] == true)
return (false);
- // set arg to 'seen'
+ // Set arg to 'seen'.
arg_seen[o] = true;
- // partially parse next argument
+ // Partially parse next argument.
bool next_is_param = false;
- if (next_arg != NULL)
+ if (next_arg != NULL
+ && (next_arg[0] != '-' || strlen(next_arg) == 1))
{
- if (next_arg[0] != '-' || strlen(next_arg) == 1)
- next_is_param = true;
+ next_is_param = true;
}
- //.take action according to the cmd chosen
+ // Take action according to the cmd chosen.
switch (o)
{
case CLO_SCORES:
@@ -3614,7 +3620,7 @@ bool parse_args( int argc, char **argv, bool rc_only )
break;
case CLO_RCDIR:
- // Always parse
+ // Always parse.
if (!next_is_param)
return (false);
@@ -3623,7 +3629,7 @@ bool parse_args( int argc, char **argv, bool rc_only )
break;
case CLO_DIR:
- // ALWAYS PARSE
+ // Always parse.
if (!next_is_param)
return (false);
@@ -3632,16 +3638,20 @@ bool parse_args( int argc, char **argv, bool rc_only )
break;
case CLO_RC:
- // ALWAYS PARSE
+ // Always parse.
if (!next_is_param)
return (false);
SysEnv.crawl_rc = next_arg;
nextUsed = true;
break;
- } // end switch -- which option?
- // update position
+ case CLO_HELP:
+ // Shouldn't happen.
+ return (false);
+ }
+
+ // Update position.
current++;
if (nextUsed)
current++;
diff --git a/crawl-ref/source/menu.cc b/crawl-ref/source/menu.cc
index 431ede02a6..9af8b1681c 100644
--- a/crawl-ref/source/menu.cc
+++ b/crawl-ref/source/menu.cc
@@ -847,20 +847,7 @@ bool PlayerMenuEntry::get_tiles(std::vector<tile_def>& tileset) const
return (false);
const player_save_info &player = *static_cast<player_save_info*>( data );
-
- dolls_data equip_doll;
- for (unsigned int j = 0; j < TILEP_PART_MAX; ++j)
- equip_doll.parts[j] = TILEP_SHOW_EQUIP;
-
- const int gender = TILEP_GENDER_MALE;
- tilep_race_default(player.species, gender, player.experience_level,
- equip_doll.parts);
-
- int job = get_class_by_name(player.class_name.c_str());
- if (job == -1)
- job = JOB_FIGHTER;
-
- tilep_job_default(job, gender, equip_doll.parts);
+ dolls_data equip_doll = player.doll;
// FIXME: A lot of code duplication from DungeonRegion::pack_doll().
int p_order[TILEP_PART_MAX] =
@@ -902,8 +889,6 @@ bool PlayerMenuEntry::get_tiles(std::vector<tile_def>& tileset) const
ASSERT(idx >= TILE_MAIN_MAX && idx < TILEP_PLAYER_MAX);
-#if 0
- // FIXME: Is there any way to make this work with tile_def?
int ymax = TILE_Y;
if (flags[p] == TILEP_FLAG_CUT_CENTAUR
@@ -911,9 +896,8 @@ bool PlayerMenuEntry::get_tiles(std::vector<tile_def>& tileset) const
{
ymax = 18;
}
- buf->add(doll.parts[p], x, y, 0, 0, true, ymax);
-#endif
- tileset.push_back(tile_def(idx, TEX_PLAYER));
+
+ tileset.push_back(tile_def(idx, TEX_PLAYER, ymax));
}
return (true);
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc
index 3f28c38fe2..0b73143e9d 100644
--- a/crawl-ref/source/newgame.cc
+++ b/crawl-ref/source/newgame.cc
@@ -2854,7 +2854,7 @@ static void _jobs_stat_init(job_type which_job)
case JOB_WANDERER: s = 2; i = 2; d = 2; hp = 11; mp = 1; break;
- case JOB_ARTIFICER: s = 2; i = 3; d = 4; hp = 13; mp = 0; break;
+ case JOB_ARTIFICER: s = 2; i = 3; d = 4; hp = 13; mp = 1; break;
default: s = 0; i = 0; d = 0; hp = 10; mp = 0; break;
}
@@ -3259,6 +3259,22 @@ static void _enter_player_name(bool blankOK)
desc = desc.substr(0, get_number_of_cols() - 1);
#ifdef USE_TILE
+ dolls_data equip_doll;
+ for (unsigned int j = 0; j < TILEP_PART_MAX; ++j)
+ equip_doll.parts[j] = TILEP_SHOW_EQUIP;
+
+ const int gender = TILEP_GENDER_MALE;
+ tilep_race_default(existing_chars[i].species, gender,
+ existing_chars[i].experience_level,
+ equip_doll.parts);
+
+ int job = get_class_by_name(existing_chars[i].class_name.c_str());
+ if (job == -1)
+ job = JOB_FIGHTER;
+
+ tilep_job_default(job, gender, equip_doll.parts);
+ existing_chars[i].doll = equip_doll;
+
MenuEntry *me = new PlayerMenuEntry(desc);
#else
MenuEntry *me = new MenuEntry(desc);
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 0003c3774f..492e5219a5 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -327,6 +327,7 @@ bool move_player_to_grid( const coord_def& p, bool stepped, bool allow_shift,
command_type stair_dir = grid_stair_direction(new_grid);
if (stepped && stair_dir != CMD_NO_CMD
+ && new_grid != DNGN_ENTER_SHOP
&& you.duration[DUR_REPEL_STAIRS_MOVE])
{
int pct;
diff --git a/crawl-ref/source/tilebuf.cc b/crawl-ref/source/tilebuf.cc
index 95b083dd7e..10e6bb4e58 100644
--- a/crawl-ref/source/tilebuf.cc
+++ b/crawl-ref/source/tilebuf.cc
@@ -142,16 +142,19 @@ TileBuffer::TileBuffer(const TilesTexture *t) : VertBuffer<PTVert>(t, GL_QUADS)
{
}
-void TileBuffer::add_unscaled(int idx, float x, float y)
+void TileBuffer::add_unscaled(int idx, float x, float y, int ymax)
{
const tile_info &inf = ((TilesTexture*)m_tex)->get_info(idx);
float pos_sx = x + inf.offset_x;
float pos_sy = y + inf.offset_y;
float pos_ex = pos_sx + (inf.ex - inf.sx);
- float pos_ey = pos_sy + (inf.ey - inf.sy);
+ int ey = inf.ey;
+ if (ymax > 0)
+ ey = std::min(inf.sy + ymax - inf.offset_y, ey);
+ float pos_ey = pos_sy + (ey - inf.sy);
- float fwidth = m_tex->width();
+ float fwidth = m_tex->width();
float fheight = m_tex->height();
float tex_sx = inf.sx / fwidth;
diff --git a/crawl-ref/source/tilebuf.h b/crawl-ref/source/tilebuf.h
index f3599b93d1..9460220aad 100644
--- a/crawl-ref/source/tilebuf.h
+++ b/crawl-ref/source/tilebuf.h
@@ -8,6 +8,8 @@
#ifndef TILEBUF_H
#define TILEBUF_H
+#include "tiles.h"
+
class FTFont;
class formatted_string;
class GenericTexture;
@@ -90,7 +92,7 @@ class TileBuffer : public VertBuffer<PTVert>
public:
TileBuffer(const TilesTexture *tex = NULL);
- void add_unscaled(int idx, float x, float y);
+ void add_unscaled(int idx, float x, float y, int ymax = TILE_Y);
void add(int idx, int x, int y, int ox = 0, int oy = 0, bool centre = true, int ymax = -1);
diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc
index 0bd0c025ac..6ac5035efa 100644
--- a/crawl-ref/source/tilereg.cc
+++ b/crawl-ref/source/tilereg.cc
@@ -3074,7 +3074,10 @@ void MenuRegion::place_entries()
int tile = m_entries[i].tiles[t].tile;
TextureID tex = m_entries[i].tiles[t].tex;
m_tile_buf[tex].add_unscaled(tile, m_entries[i].sx,
- m_entries[i].sy);
+ m_entries[i].sy,
+ m_entries[i].tiles[t].ymax);
+// m_tile_buf[tex].add(tile, m_entries[i].sx, m_entries[i].sy,
+// 0, 0, true, TILE_Y);
}
}
else
@@ -3085,7 +3088,7 @@ void MenuRegion::place_entries()
int text_sy = m_entries[i].sy;
text_sy += (entry_height - m_font_entry->char_height()) / 2;
- // Split menu entries that don't fit into a single lines into
+ // Split menu entries that don't fit into a single line into
// two lines.
if (Options.tile_menu_icons
&& text_sx + text_width > entry_start + column_width)
diff --git a/crawl-ref/source/tiles.h b/crawl-ref/source/tiles.h
index f678e3aa50..c7ad19a787 100644
--- a/crawl-ref/source/tiles.h
+++ b/crawl-ref/source/tiles.h
@@ -23,13 +23,6 @@ enum tag_version
TILETAG_CURRENT = 72
};
-struct dolls_data
-{
- dolls_data() { memset(parts, 0, sizeof(parts)); }
-
- int parts[TILEP_PART_MAX];
-};
-
struct demon_data
{
demon_data() { head = body = wings = 0; }
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