From 50f205740cbe6255684e79433d7d6aaee9e512f9 Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Wed, 24 Jun 2009 06:52:51 +0000 Subject: Apply my previous commit to trunk. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@10029 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/settings/dolls.txt | 4 ++++ crawl-ref/source/initfile.cc | 4 ++-- crawl-ref/source/monstuff.cc | 4 +++- crawl-ref/source/tilereg.cc | 17 ++++++++++++++--- crawl-ref/source/tilesdl.cc | 10 ++++++---- 5 files changed, 29 insertions(+), 10 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/settings/dolls.txt b/crawl-ref/settings/dolls.txt index ea5a8f9e0e..1ccde89896 100644 --- a/crawl-ref/settings/dolls.txt +++ b/crawl-ref/settings/dolls.txt @@ -1,5 +1,9 @@ MODE=EQUIP NUM=00 +#Legend: +#***:equipment/123:index/000:none +#Shadow/Gender/Cloak/Boots/Legs/Body/Gloves/Weapon/Shield/Hair/Beard/Helmet +#--:Sex:Clk:Bts:Leg:Bdy:Glv:Wpn:Shd:Hai:Brd:Hlm 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 diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc index b4591ef163..a9c3833a4b 100644 --- a/crawl-ref/source/initfile.cc +++ b/crawl-ref/source/initfile.cc @@ -3158,8 +3158,8 @@ void game_options::read_option_line(const std::string &str, bool runscript) else INT_OPTION(tile_key_repeat_delay, 0, INT_MAX); else if (key == "tile_full_screen") tile_full_screen = (screen_mode)_read_bool(field, tile_full_screen); - else INT_OPTION(tile_window_width, 1, INT_MAX); - else INT_OPTION(tile_window_height, 1, INT_MAX); + else INT_OPTION(tile_window_width, 0, INT_MAX); + else INT_OPTION(tile_window_height, 0, INT_MAX); else INT_OPTION(tile_map_pixels, 1, INT_MAX); else INT_OPTION(tile_tooltip_ms, 0, INT_MAX); else INT_OPTION(tile_update_rate, 50, INT_MAX); diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 05305c5b0c..a9094fcba1 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -4905,13 +4905,15 @@ static void _handle_movement(monsters *monster) // If the monster is moving in your direction, whether to attack or // protect you, or towards a monster it intends to attack, check // whether we first need to take a step to the side to make sure the - // reinforcement can follow through. + // reinforcement can follow through. Only do this with 50% chance, + // though, so it's not completely predictable. // First, check whether the monster is smart enough to even consider // this. if ((newpos == you.pos() || mgrd(newpos) != NON_MONSTER && monster->foe == mgrd(newpos)) && mons_intel(monster) >= I_ANIMAL + && coinflip() && !mons_is_confused(monster) && !mons_is_caught(monster) && !monster->has_ench(ENCH_BERSERK)) { diff --git a/crawl-ref/source/tilereg.cc b/crawl-ref/source/tilereg.cc index 1710eab6ee..627c6f7259 100644 --- a/crawl-ref/source/tilereg.cc +++ b/crawl-ref/source/tilereg.cc @@ -364,6 +364,9 @@ static bool _load_doll_data(const char *fn, dolls_data *dolls, int max, int count = 0; while (fscanf(fp, "%s", fbuf) != EOF) { + if (fbuf[0] == '#') // Skip comment lines. + continue; + if (*cur == count++) { tilep_scan_parts(fbuf, dolls[0].parts); @@ -379,10 +382,12 @@ static bool _load_doll_data(const char *fn, dolls_data *dolls, int max, } else // Load up to max dolls from file. { - for (int count = 0; count < max && fscanf(fp, "%s", fbuf) != EOF; - ++count) + for (int count = 0; count < max && fscanf(fp, "%s", fbuf) != EOF; ) { - tilep_scan_parts(fbuf, dolls[count].parts); + if (fbuf[0] == '#') // Skip comment lines. + continue; + + tilep_scan_parts(fbuf, dolls[count++].parts); } } @@ -709,6 +714,12 @@ void TilePlayerEdit() fprintf(fp, "NUM=%02d\n", num == -1 ? 0 : num); + // Print some explanatory comments. May contain no spaces! + fprintf(fp, "#Legend:\n"); + fprintf(fp, "#***:equipment/123:index/000:none\n"); + fprintf(fp, "#Shadow/Gender/Cloak/Boots/Legs/Body/Gloves/Weapon/Shield/Hair/Beard/Helmet\n"); + fprintf(fp, "#--:Sex:Clk:Bts:Leg:Bdy:Glv:Wpn:Shd:Hai:Brd:Hlm\n"); + char fbuf[80]; for (unsigned int i = 0; i < NUM_MAX_DOLLS; ++i) { diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index dc13673f87..c65c540d6b 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -225,7 +225,7 @@ bool TilesFramework::initialise() { const SDL_VideoInfo* video_info = SDL_GetVideoInfo(); - m_screen_width = video_info->current_w; + m_screen_width = video_info->current_w; m_screen_height = video_info->current_h; } @@ -254,8 +254,8 @@ bool TilesFramework::initialise() if (Options.tile_key_repeat_delay > 0) { - int delay = Options.tile_key_repeat_delay; - int interval = SDL_DEFAULT_REPEAT_INTERVAL; + const int delay = Options.tile_key_repeat_delay; + const int interval = SDL_DEFAULT_REPEAT_INTERVAL; if (SDL_EnableKeyRepeat(delay, interval) != 0) printf("Failed to set key repeat mode: %s\n", SDL_GetError()); } @@ -979,7 +979,9 @@ void TilesFramework::do_layout() crawl_view.viewsz.x = Options.view_max_width; crawl_view.viewsz.y = Options.view_max_height; - crawl_view.msgsz.x = crt_width; + crawl_view.msgsz.x = crt_width; + // What *does* msgsz.y get set to? (jpeg) + crawl_view.msgsz.y = crt_height - crawl_view.viewsz.y; // Initial sizes. m_region_tile->dx = m_viewsc.x; -- cgit v1.2.3-54-g00ecf