From d120c8b8553ad8e36a20a63cfe597b2f1eafceef Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Thu, 18 Jun 2009 21:03:49 +0000 Subject: Another step on the way to player doll customization. Including some predefined doll settings in dolls.txt, so players can actually use this. TODO: Save choice back into file. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9999 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/settings/dolls.txt | 12 +++ crawl-ref/source/cio.cc | 4 +- crawl-ref/source/debug.cc | 8 ++ crawl-ref/source/directn.cc | 54 +++++----- crawl-ref/source/enum.h | 4 - crawl-ref/source/macro.cc | 21 ---- crawl-ref/source/tilepick.cc | 15 +-- crawl-ref/source/tilereg.cc | 243 ++++++++++++++++++++++++++++++------------- crawl-ref/source/tiles.h | 4 +- crawl-ref/source/tilesdl.cc | 7 +- 10 files changed, 241 insertions(+), 131 deletions(-) create mode 100644 crawl-ref/settings/dolls.txt (limited to 'crawl-ref') diff --git a/crawl-ref/settings/dolls.txt b/crawl-ref/settings/dolls.txt new file mode 100644 index 0000000000..7f414be728 --- /dev/null +++ b/crawl-ref/settings/dolls.txt @@ -0,0 +1,12 @@ +MODE=LOADING +NUM=0 +001:001:***:011:034:092:***:023:034:017:000:063 +001:001:***:009:002:040:016:077:***:023:009:040 +001:000:***:014:017:046:020:048:***:010:000:041 +001:001:001:018:000:017:***:190:066:000:009:043 +001:001:005:003:016:137:***:117:005:000:000:*** +001:000:001:021:000:033:***:136:058:007:000:012 +001:001:003:014:000:005:***:194:041:017:000:028 +001:000:***:017:027:068:***:197:050:011:000:068 +001:000:008:011:033:091:007:055:027:008:000:054 +001:001:007:***:026:015:020:170:057:011:000:032 diff --git a/crawl-ref/source/cio.cc b/crawl-ref/source/cio.cc index 166bdb6382..d5c87f7e0a 100644 --- a/crawl-ref/source/cio.cc +++ b/crawl-ref/source/cio.cc @@ -95,9 +95,9 @@ int unmangle_direction_keys(int keyin, KeymapContext keymap, case '8': return 'k'; case '9': return 'u'; -#ifndef USE_TILE + #ifndef USE_TILE default: return unixcurses_get_vi_key(keyin); -#endif + #endif #else case '1': return 'B'; diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc index d3c2343bb9..ebbf6955e5 100644 --- a/crawl-ref/source/debug.cc +++ b/crawl-ref/source/debug.cc @@ -5985,18 +5985,24 @@ void debug_miscast( int target_index ) MiscastEffect *miscast; if (spell != SPELL_NO_SPELL) + { miscast = new MiscastEffect(target, target_index, spell, pow, fail, "", nothing); + } else { if (level != -1) + { miscast = new MiscastEffect(target, target_index, school, level, "wizard testing miscast", nothing); + } else + { miscast = new MiscastEffect(target, target_index, school, pow, fail, "wizard testing miscast", nothing); + } } // Merely creating the miscast object causes one miscast effect to // happen. @@ -6399,8 +6405,10 @@ static void _debug_marker_scan() map_marker_type type = marker->get_type(); if (type < MAT_FEATURE || type >= NUM_MAP_MARKER_TYPES) + { mprf(MSGCH_ERROR, "Makrer #%d at (%d, %d) has invalid type %d", i, marker->pos.x, marker->pos.y, (int) type); + } if (!in_bounds(marker->pos)) { diff --git a/crawl-ref/source/directn.cc b/crawl-ref/source/directn.cc index 15a174c59a..b30fce1734 100644 --- a/crawl-ref/source/directn.cc +++ b/crawl-ref/source/directn.cc @@ -261,12 +261,10 @@ static const char *target_mode_help_text(int mode) } } -static void draw_ray_glyph(const coord_def &pos, int colour, - int glych, int mcol, bool in_range) +#ifndef USE_TILE +static void _draw_ray_glyph(const coord_def &pos, int colour, + int glych, int mcol, bool in_range) { -#ifdef USE_TILE - tile_place_ray(pos, in_range); -#else if (const monsters *mons = monster_at(pos)) { if (mons->alive() && player_monster_visible(mons)) @@ -279,8 +277,8 @@ static void draw_ray_glyph(const coord_def &pos, int colour, cgotoxy(vp.x, vp.y, GOTO_DNGN); textcolor( real_colour(colour) ); putch(glych); -#endif } +#endif // Unseen monsters in shallow water show a "strange disturbance". // (Unless flying!) @@ -1649,8 +1647,8 @@ void direction(dist& moves, targeting_type restricts, if (old_target != moves.target) { have_moved = true; - show_beam = show_beam && find_ray(you.pos(), moves.target, - true, ray, 0, true); + show_beam = show_beam && find_ray(you.pos(), moves.target, + true, ray, 0, true); } if (force_redraw) @@ -1673,13 +1671,17 @@ void direction(dist& moves, targeting_type restricts, #ifdef USE_TILE // Tiles always need a beam redraw if show_beam is true (and valid...) - bool _draw_beam = find_ray(you.pos(), moves.target, true, ray, 0, true) - && show_beam && !_blocked_ray(moves.target); - if (need_beam_redraw || _draw_beam) + if (!need_beam_redraw) { -#else + need_beam_redraw = show_beam + && find_ray(you.pos(), moves.target, true, ray, + 0, true) + && !_blocked_ray(moves.target); + } +#endif if (need_beam_redraw) { +#ifndef USE_TILE viewwindow(true, false); #endif if (show_beam @@ -1700,25 +1702,27 @@ void direction(dist& moves, targeting_type restricts, const bool in_range = (range < 0) || grid_distance(raycopy.pos(), you.pos()) <= range; +#ifdef USE_TILE + tile_place_ray(raycopy.pos(), in_range); +#else const int bcol = in_range ? MAGENTA : DARKGREY; - - draw_ray_glyph(raycopy.pos(), bcol, '*', - bcol | COLFLAG_REVERSE, in_range); + _draw_ray_glyph(raycopy.pos(), bcol, '*', + bcol | COLFLAG_REVERSE, in_range); +#endif } raycopy.advance_through(moves.target); } textcolor(LIGHTGREY); #ifdef USE_TILE - const bool in_range = (range < 0) - || grid_distance(raycopy.pos(), you.pos()) <= range; - draw_ray_glyph(moves.target, MAGENTA, '*', - MAGENTA | COLFLAG_REVERSE, in_range); + const bool in_range + = (range < 0 + || grid_distance(raycopy.pos(), you.pos()) <= range); + tile_place_ray(moves.target, in_range); +#endif } +#ifdef USE_TILE viewwindow(true, false); -#else - } #endif - } skip_iter = false; // Only skip one iteration at most. } @@ -1862,7 +1866,7 @@ void full_describe_square(const coord_def &c) static void _extend_move_to_edge(dist &moves) { - if ( moves.delta.origin() ) + if (moves.delta.origin()) return; // Now the tricky bit - extend the target x,y out to map edge. @@ -3496,8 +3500,8 @@ int targeting_behaviour::get_key() if (!crawl_state.is_replaying_keys()) flush_input_buffer(FLUSH_BEFORE_COMMAND); - return unmangle_direction_keys( getchm(KMC_TARGETING), KMC_TARGETING, - false, false); + return unmangle_direction_keys(getchm(KMC_TARGETING), KMC_TARGETING, + false, false); } command_type targeting_behaviour::get_command(int key) diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 2e95d31c18..8ba862b72b 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -1461,10 +1461,6 @@ enum KeymapContext KMC_CONFIRM, // When being asked y/n/q questions KMC_MENU, // For menus -#ifdef USE_TILE - KMC_TILE, // For context_for_command() -#endif - KMC_CONTEXT_COUNT, // Must always be the last real context KMC_NONE diff --git a/crawl-ref/source/macro.cc b/crawl-ref/source/macro.cc index b53d210f9a..61070cf855 100644 --- a/crawl-ref/source/macro.cc +++ b/crawl-ref/source/macro.cc @@ -63,10 +63,6 @@ static macromap *all_maps[] = &Keymaps[KMC_TARGETING], &Keymaps[KMC_CONFIRM], -#ifdef USE_TILE - &Keymaps[KMC_TILE], -#endif - &Macros, }; @@ -1106,17 +1102,6 @@ command_type key_to_command(int key, KeymapContext context) key_to_cmd_map &key_map = _keys_to_cmds[context]; key_to_cmd_map::iterator it = key_map.find(key); -#if 0 -#ifdef USE_TILE - if (context != KMC_TILE && it == key_map.end()) - { - context = KMC_TILE; - key_map = _keys_to_cmds[KMC_TILE]; - it = key_map.find(key); - } -#endif -#endif - if (it == key_map.end()) return CMD_NO_CMD; @@ -1145,12 +1130,6 @@ int command_to_key(command_type cmd) KeymapContext context_for_command(command_type cmd) { -#if 0 -#ifdef USE_TILE - if (cmd >= CMD_MIN_TILE && cmd <= CMD_MAX_TILE) - return KMC_TILE; -#endif -#endif if (cmd > CMD_NO_CMD && cmd <= CMD_MAX_NORMAL) return KMC_DEFAULT; diff --git a/crawl-ref/source/tilepick.cc b/crawl-ref/source/tilepick.cc index f290df51f6..b635a9d454 100644 --- a/crawl-ref/source/tilepick.cc +++ b/crawl-ref/source/tilepick.cc @@ -2731,21 +2731,24 @@ void tilep_calc_flags(const int parts[], int flag[]) flag[TILEP_PART_BOOTS] = flag[TILEP_PART_LEG] = TILEP_FLAG_HIDE; flag[TILEP_PART_BODY] = TILEP_FLAG_CUT_NAGA; } - - if (parts[TILEP_PART_BASE] == TILEP_BASE_CENTAUR - || parts[TILEP_PART_BASE] == TILEP_BASE_CENTAUR + 1) + else if (parts[TILEP_PART_BASE] == TILEP_BASE_CENTAUR + || parts[TILEP_PART_BASE] == TILEP_BASE_CENTAUR + 1) { flag[TILEP_PART_BOOTS] = flag[TILEP_PART_LEG] = TILEP_FLAG_HIDE; flag[TILEP_PART_BODY] = TILEP_FLAG_CUT_CENTAUR; } - - if (parts[TILEP_PART_BASE] == TILEP_BASE_MERFOLK_WATER - || parts[TILEP_PART_BASE] == TILEP_BASE_MERFOLK_WATER + 1) + else if (parts[TILEP_PART_BASE] == TILEP_BASE_MERFOLK_WATER + || parts[TILEP_PART_BASE] == TILEP_BASE_MERFOLK_WATER + 1) { flag[TILEP_PART_BOOTS] = TILEP_FLAG_HIDE; flag[TILEP_PART_LEG] = TILEP_FLAG_HIDE; flag[TILEP_PART_SHADOW] = TILEP_FLAG_HIDE; } + else if (parts[TILEP_PART_BASE] >= TILEP_BASE_DRACONIAN + && parts[TILEP_PART_BASE] <= TILEP_BASE_DRACONIAN_WHITE + 1) + { + flag[TILEP_PART_HAIR] = flag[TILEP_PART_HELM] = TILEP_FLAG_HIDE; + } } /* diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index 538bc31256..cb16d0111b 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -294,12 +294,13 @@ void DungeonRegion::pack_background(unsigned int bg, int x, int y) m_buf_dngn.add(TILE_RAY_OUT_OF_RANGE, x, y); } +#define NUM_MAX_DOLLS 10 static dolls_data player_doll; static int gender = -1; // static void _load_doll_data(const char *fn, dolls_data *dolls, int max, // int *mode, int *cur) -static void _load_doll_data(const char *fn, dolls_data *doll) +static void _load_doll_data(const char *fn, dolls_data *dolls, int max) { char fbuf[1024]; FILE *fp = NULL; @@ -313,25 +314,22 @@ static void _load_doll_data(const char *fn, dolls_data *doll) // File doesn't exist. By default, use equipment defaults. // This will be saved out (if possible). - // Don't take gender too seriously. -- Enne - tilep_race_default(you.species, coinflip(), - you.experience_level, doll->parts); + // Sanity, in case this hasn't been done before. + for (unsigned int i = 0; i < TILEP_PART_MAX; ++i) + dolls[0].parts[i] = TILEP_SHOW_EQUIP; -#if 0 - // For some reason I can't reset this although it's used identically - // elsewhere. (jpeg) - for (unsigned int j = 0; j < TILEP_PART_MAX; ++j) - doll->parts[j] = TILEP_SHOW_EQUIP; -#endif + // Don't take gender too seriously. -- Enne + tilep_race_default(you.species, gender, + you.experience_level, dolls[0].parts); } else { memset(fbuf, 0, sizeof(fbuf)); if (fscanf(fp, "%s", fbuf) != EOF) { - if (strcmp(fbuf, "MODE=DEFAULT") == 0) + if (max == 1 && strcmp(fbuf, "MODE=DEFAULT") == 0) { - tilep_job_default(you.char_class, gender, doll->parts); + tilep_job_default(you.char_class, gender, dolls[0].parts); fclose(fp); return; } @@ -340,28 +338,39 @@ static void _load_doll_data(const char *fn, dolls_data *doll) int cur = 0; // # of current doll if (fscanf(fp, "%s", fbuf) != EOF) { - if (strncmp(fbuf, "NUM=", 4) == 0) + if (max == 1 && strncmp(fbuf, "NUM=", 4) == 0) { sscanf(fbuf, "NUM=%d", &cur); - if (cur < 0 || cur > 10) + if (cur < 0 || cur >= NUM_MAX_DOLLS) cur = 0; } } - int count = 0; - while (fscanf(fp, "%s", fbuf) != EOF) + if (max == 1) // Load only one doll, namely no. cur. { - if (cur == count++) + int count = 0; + while (fscanf(fp, "%s", fbuf) != EOF) { - tilep_scan_parts(fbuf, doll->parts); - gender = doll->parts[TILEP_PART_BASE] % 2; - break; + if (cur == count++) + { + tilep_scan_parts(fbuf, dolls[0].parts); + gender = dolls[0].parts[TILEP_PART_BASE] % 2; + break; + } + } + if (cur >= count) + { + mprf(MSGCH_WARN, "Doll %d could not be found in '%s'.", + cur, dollsTxt); } } - if (cur >= count) + else // Load up to max dolls from file. { - mprf(MSGCH_WARN, "Doll %d could not be found in '%s'.", - cur, dollsTxt); + for (int count = 0; count < max && fscanf(fp, "%s", fbuf) != EOF; + ++count) + { + tilep_scan_parts(fbuf, dolls[count].parts); + } } fclose(fp); @@ -370,21 +379,57 @@ static void _load_doll_data(const char *fn, dolls_data *doll) void init_player_doll() { - dolls_data default_doll; + dolls_data default_doll[1]; for (unsigned int i = 0; i < TILEP_PART_MAX; ++i) - default_doll.parts[i] = TILEP_SHOW_EQUIP; - - mpr("loaded equipment"); - _load_doll_data("dolls.txt", &default_doll); + default_doll[0].parts[i] = TILEP_SHOW_EQUIP; if (gender == -1) gender = coinflip(); + _load_doll_data("dolls.txt", default_doll, 1); + tilep_race_default(you.species, gender, you.experience_level, - default_doll.parts); + default_doll[0].parts); - player_doll = default_doll; + player_doll = default_doll[0]; +} + +static int _get_random_doll_part(int p) +{ + ASSERT(p >= 0 && p <= TILEP_PART_MAX); + return (tile_player_part_start[p] + + random2(tile_player_part_count[p])); +} + +static void _fill_doll_part(dolls_data &doll, int p) +{ + ASSERT(p >= 0 && p <= TILEP_PART_MAX); + doll.parts[p] = _get_random_doll_part(p); +} + +static void _create_random_doll(dolls_data &rdoll) +{ + // All dolls roll for these. + _fill_doll_part(rdoll, TILEP_PART_BODY); + _fill_doll_part(rdoll, TILEP_PART_HAND1); + _fill_doll_part(rdoll, TILEP_PART_LEG); + _fill_doll_part(rdoll, TILEP_PART_BOOTS); + _fill_doll_part(rdoll, TILEP_PART_HAIR); + + // The following only are rolled with 50% chance. + if (coinflip()) + _fill_doll_part(rdoll, TILEP_PART_CLOAK); + if (coinflip()) + _fill_doll_part(rdoll, TILEP_PART_ARM); + if (coinflip()) + _fill_doll_part(rdoll, TILEP_PART_HAND2); + if (coinflip()) + _fill_doll_part(rdoll, TILEP_PART_HELM); + + // Only male dolls get a chance at a beard. + if (rdoll.parts[TILEP_PART_BASE] % 2 == 1 && one_chance_in(4)) + _fill_doll_part(rdoll, TILEP_PART_BEARD); } void TilePlayerEdit() @@ -399,38 +444,86 @@ void TilePlayerEdit() // * If dolls.txt missing, possibly (C)reate the file with // dummy values (MODE=DEFAULT, 10 variable dolls). - mpr("Pick (d)efault doll for job, use (e)quipment settings, or (l)oad " - "from file?"); - - char ch = (char) getchm(KMC_DEFAULT); - ch = tolower(ch); - + dolls_data equip_doll; dolls_data default_doll; + dolls_data dolls[NUM_MAX_DOLLS]; for (unsigned int i = 0; i < TILEP_PART_MAX; ++i) - default_doll.parts[i] = TILEP_SHOW_EQUIP; + equip_doll.parts[i] = TILEP_SHOW_EQUIP; tilep_race_default(you.species, gender, - you.experience_level, default_doll.parts); + you.experience_level, equip_doll.parts); - mpr("loaded equipment"); - if (ch == 'd') - { - tilep_job_default(you.char_class, gender, default_doll.parts); - } - else if (ch == 'e') + bool done_default = false; + bool loaded = false; + char old_ch = 'x'; // for saving current doll (d/e) into file + while (true) { - // nothing to be done - } - else if (ch == 'l') - { - _load_doll_data("dolls.txt", &default_doll); - } - else - return; + mpr("Pick (d)efault doll for job, use (e)quipment settings, roll a " + "(r)andom doll, or load doll (0-9) from file?", MSGCH_PROMPT); - player_doll = default_doll; + char ch = (char) getchm(KMC_DEFAULT); + ch = tolower(ch); + bool finish = false; + if (ch == 'd') + { + if (!done_default) + { + default_doll = equip_doll; + tilep_job_default(you.char_class, gender, default_doll.parts); + done_default = true; + } + player_doll = default_doll; + } + else if (ch == 'e') + { + player_doll = equip_doll; + // nothing else to be done + } + else if (ch == 'r') + { + dolls_data random_doll = equip_doll; + _create_random_doll(random_doll); + player_doll = random_doll; + } + else if (ch == 's') + { + mpr("I'm sorry, you can't save your settings yet."); + continue; + } + else if (ch >= '0' && ch <= '9') + { + // HACK until I can find the proper function. + int num = ch - '0'; + ASSERT(num >= 0 && num <= 9); + if (num < 0 || num >= NUM_MAX_DOLLS) + finish = true; + else + { + if (!loaded) + { + for (unsigned int i = 0; i < NUM_MAX_DOLLS; ++i) + dolls[i] = equip_doll; + + // This'll have to be replaced by "load doll 0..9". + _load_doll_data("dolls.txt", dolls, NUM_MAX_DOLLS); + loaded = true; + } + player_doll = dolls[num]; + } + } + else + finish = true; + + mesclr(); + + if (finish) + break; + + old_ch = ch; + viewwindow(true, false); + } // TODO 2: Allow saving back of customized dolls. // * Use pack_player (split into 2 methods) to fill the (C)urrent equipment. // * Create (R)andom equipment for player doll. @@ -441,18 +534,12 @@ void TilePlayerEdit() // TODO 3: Change to proper menu. } -void DungeonRegion::pack_player(int x, int y) +void _fill_doll_equipment(dolls_data &result) { - dolls_data result = player_doll; - - const bool halo = inside_halo(you.pos()); - result.parts[TILEP_PART_HALO] = halo ? TILEP_HALO_TSO : 0; - result.parts[TILEP_PART_ENCH] = - (you.duration[DUR_LIQUID_FLAMES] ? TILEP_ENCH_STICKY_FLAME : 0); - + // Main hand. if (result.parts[TILEP_PART_HAND1] == TILEP_SHOW_EQUIP) { - int item = you.equip[EQ_WEAPON]; + const int item = you.equip[EQ_WEAPON]; if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BLADE_HANDS) result.parts[TILEP_PART_HAND1] = TILEP_HAND1_BLADEHAND; else if (item == -1) @@ -460,9 +547,10 @@ void DungeonRegion::pack_player(int x, int y) else result.parts[TILEP_PART_HAND1] = tilep_equ_weapon(you.inv[item]); } + // Off hand. if (result.parts[TILEP_PART_HAND2] == TILEP_SHOW_EQUIP) { - int item = you.equip[EQ_SHIELD]; + const int item = you.equip[EQ_SHIELD]; if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BLADE_HANDS) result.parts[TILEP_PART_HAND2] = TILEP_HAND2_BLADEHAND; else if (item == -1) @@ -470,25 +558,28 @@ void DungeonRegion::pack_player(int x, int y) else result.parts[TILEP_PART_HAND2] = tilep_equ_shield(you.inv[item]); } + // Body armour. if (result.parts[TILEP_PART_BODY] == TILEP_SHOW_EQUIP) { - int item = you.equip[EQ_BODY_ARMOUR]; + const int item = you.equip[EQ_BODY_ARMOUR]; if (item == -1) result.parts[TILEP_PART_BODY] = 0; else result.parts[TILEP_PART_BODY] = tilep_equ_armour(you.inv[item]); } + // Cloak. if (result.parts[TILEP_PART_CLOAK] == TILEP_SHOW_EQUIP) { - int item = you.equip[EQ_CLOAK]; + const int item = you.equip[EQ_CLOAK]; if (item == -1) result.parts[TILEP_PART_CLOAK] = 0; else result.parts[TILEP_PART_CLOAK] = tilep_equ_cloak(you.inv[item]); } + // Helmet. if (result.parts[TILEP_PART_HELM] == TILEP_SHOW_EQUIP) { - int item = you.equip[EQ_HELMET]; + const int item = you.equip[EQ_HELMET]; if (item != -1) { result.parts[TILEP_PART_HELM] = tilep_equ_helm(you.inv[item]); @@ -513,10 +604,10 @@ void DungeonRegion::pack_player(int x, int y) result.parts[TILEP_PART_HELM] = 0; } } - + // Boots. if (result.parts[TILEP_PART_BOOTS] == TILEP_SHOW_EQUIP) { - int item = you.equip[EQ_BOOTS]; + const int item = you.equip[EQ_BOOTS]; if (item != -1) result.parts[TILEP_PART_BOOTS] = tilep_equ_boots(you.inv[item]); else if (player_mutation_level(MUT_HOOVES)) @@ -524,10 +615,10 @@ void DungeonRegion::pack_player(int x, int y) else result.parts[TILEP_PART_BOOTS] = 0; } - + // Gloves. if (result.parts[TILEP_PART_ARM] == TILEP_SHOW_EQUIP) { - int item = you.equip[EQ_GLOVES]; + const int item = you.equip[EQ_GLOVES]; if (item != -1) result.parts[TILEP_PART_ARM] = tilep_equ_gloves(you.inv[item]); else if (you.has_claws(false) >= 3) @@ -536,13 +627,25 @@ void DungeonRegion::pack_player(int x, int y) result.parts[TILEP_PART_ARM] = 0; } + // Various other slots. if (result.parts[TILEP_PART_LEG] == TILEP_SHOW_EQUIP) result.parts[TILEP_PART_LEG] = 0; if (result.parts[TILEP_PART_DRCWING] == TILEP_SHOW_EQUIP) result.parts[TILEP_PART_DRCWING] = 0; if (result.parts[TILEP_PART_DRCHEAD] == TILEP_SHOW_EQUIP) result.parts[TILEP_PART_DRCHEAD] = 0; +} + +void DungeonRegion::pack_player(int x, int y) +{ + dolls_data result = player_doll; + + const bool halo = inside_halo(you.pos()); + result.parts[TILEP_PART_HALO] = halo ? TILEP_HALO_TSO : 0; + result.parts[TILEP_PART_ENCH] = + (you.duration[DUR_LIQUID_FLAMES] ? TILEP_ENCH_STICKY_FLAME : 0); + _fill_doll_equipment(result); pack_doll(result, x, y); } diff --git a/crawl-ref/source/tiles.h b/crawl-ref/source/tiles.h index 885efbcc92..a835817f65 100644 --- a/crawl-ref/source/tiles.h +++ b/crawl-ref/source/tiles.h @@ -194,8 +194,8 @@ enum enum { - TILEP_GENDER_MALE = 0, - TILEP_GENDER_FEMALE = 1, + TILEP_GENDER_FEMALE = 0, + TILEP_GENDER_MALE = 1, TILEP_SHOW_EQUIP = 0x1000 }; diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index 22d6f4d1e8..54b9749dc2 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -743,7 +743,12 @@ int TilesFramework::getch_ck() int key = 0; - const unsigned int ticks_per_redraw = 100; + // When moving the mouse via cursor when targeting update more often. + // For beams, the beam drawing already handles this, and when not targeting + // the normal drawing routines handle it. + const unsigned int ticks_per_redraw + = (mouse_control::current_mode() == MOUSE_MODE_TARGET ? 50 : 100); + unsigned int last_redraw_tick = 0; unsigned int res = Options.tile_tooltip_ms; -- cgit v1.2.3-54-g00ecf