From 9b2e7b1002d1917e65b15e2e6b69936774b5e02e Mon Sep 17 00:00:00 2001 From: j-p-e-g Date: Mon, 27 Jul 2009 12:19:31 +0000 Subject: Backport r10424. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@10425 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/docs/changelog.txt | 1 + crawl-ref/settings/tiles_options.txt | 2 +- crawl-ref/source/AppHdr.h | 38 ++++++++++++++++-------------------- crawl-ref/source/describe.cc | 6 +++++- crawl-ref/source/dungeon.cc | 2 ++ crawl-ref/source/itemname.cc | 7 +++++++ crawl-ref/source/tilesdl.cc | 10 ++++++++++ 7 files changed, 43 insertions(+), 23 deletions(-) diff --git a/crawl-ref/docs/changelog.txt b/crawl-ref/docs/changelog.txt index 1c597c35f2..8362f4025b 100644 --- a/crawl-ref/docs/changelog.txt +++ b/crawl-ref/docs/changelog.txt @@ -17,6 +17,7 @@ Disclaimer: These are merely the highlights, not an exhaustive list of changes. * Fixed Xom gifts not being destroyed in deep water. * Fixed magic mapping bugs in the Tiles version. * Fixed AltGr not being recognized in Windows Tiles version. +* Fixed Alt-Tab sometimes locking the Alt key on Windows. * Fixed misbehaviour for temporary weapon brands and throwing. * Fixed Blade Hands not counting as slicing while wearing melded gloves. * Fixed berserking allies taking orders from 'ta'. diff --git a/crawl-ref/settings/tiles_options.txt b/crawl-ref/settings/tiles_options.txt index ae4bd6a41a..b9439a3049 100644 --- a/crawl-ref/settings/tiles_options.txt +++ b/crawl-ref/settings/tiles_options.txt @@ -30,7 +30,7 @@ # tile_excl_centre = darkblue # tile_window_col = yellow -# If Crawl's response rate is to slow, try increasing the update rate. +# If Crawl's response rate is too slow, try increasing the update rate. # tile_update_rate = 1000 # tile_key_repeat_delay = 200 diff --git a/crawl-ref/source/AppHdr.h b/crawl-ref/source/AppHdr.h index e1cbba9582..840480b808 100644 --- a/crawl-ref/source/AppHdr.h +++ b/crawl-ref/source/AppHdr.h @@ -410,29 +410,25 @@ FIXME: replace system(3) with fork(2) and execve(2). */ - // Comment these lines out if you want to leave the save files uncompressed. - #define SAVE_PACKAGE_ZIP -// #define SAVE_PACKAGE_TAR - -#ifdef SAVE_PACKAGE_ZIP - #define PACKAGE_SUFFIX ".zip" - #define SAVE_PACKAGE_CMD "/usr/bin/zip -m -q -j -1 %s.zip %s.*" - #define LOAD_UNPACKAGE_CMD "/usr/bin/unzip -q -o %s.zip -d %s" -#else -#ifdef SAVE_PACKAGE_TAR - #define PACKAGE_SUFFIX ".tgz" - - // The --absolute-names switch is only there to suppress noise on - // stdout. All the paths are removed later by --transform. - #define SAVE_PACKAGE_CMD "tar -zcf %s.tgz --remove-files --absolute-names --transform=s:.*/:: %s.*" - #define LOAD_UNPACKAGE_CMD "tar -zxf %s.tgz -C %s" -#endif -#endif + // The default behaviour is to compress with zip. + // To use GNU tar instead, define SAVE_PACKAGE_TAR. + // To avoid compression entirely, define SAVE_PACKAGE_NONE. + #ifndef SAVE_PACKAGE_NONE + #ifdef SAVE_PACKAGE_TAR + // The --absolute-names switch is only there to suppress noise on stdout. + // All the paths are removed later by --transform. + #define PACKAGE_SUFFIX ".tgz" + #define SAVE_PACKAGE_CMD "tar -zcf %s.tgz --remove-files --absolute-names --transform=s:.*/:: %s.*" + #define LOAD_UNPACKAGE_CMD "tar -zxf %s.tgz -C %s" + #else + #define PACKAGE_SUFFIX ".zip" + #define SAVE_PACKAGE_CMD "/usr/bin/zip -m -q -j -1 %s.zip %s.*" + #define LOAD_UNPACKAGE_CMD "/usr/bin/unzip -q -o %s.zip -d %s" + #endif -#ifdef SAVE_PACKAGE_CMD - // This is used to unpack specific files from the archive. + // This is used to unpack a specific file from the archive. #define UNPACK_SPECIFIC_FILE_CMD LOAD_UNPACKAGE_CMD " %s" -#endif + #endif // This defines the chmod permissions for score and bones files. #define SHARED_FILES_CHMOD_PRIVATE 0664 diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index 2b1f6cde6a..d88c604a3b 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -1002,7 +1002,11 @@ static std::string _describe_weapon(const item_def &item, bool verbose) description += ", and it is better for the dexterous"; description += "."; } - + if (player_size(PSIZE_BODY) < SIZE_MEDIUM + && !check_weapon_wieldable_size(item, player_size(PSIZE_BODY))) + { + description += "$It is too large for you to wield."; + } } if (verbose) diff --git a/crawl-ref/source/dungeon.cc b/crawl-ref/source/dungeon.cc index a2ce0f223e..f5b72b4a9f 100644 --- a/crawl-ref/source/dungeon.cc +++ b/crawl-ref/source/dungeon.cc @@ -2306,8 +2306,10 @@ static builder_rc_type _builder_by_type(int level_number, char level_type) ASSERT(vault); if (!vault) + { end(1, false, "Failed to find Pandemonium level %s!\n", pandemon_level_names[which_demon]); + } _ensure_vault_placed( _build_vaults(level_number, vault), true ); } diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc index 5c123929a2..905270e13e 100644 --- a/crawl-ref/source/itemname.cc +++ b/crawl-ref/source/itemname.cc @@ -2464,6 +2464,13 @@ bool is_useless_item(const item_def &item, bool temp) switch (item.base_type) { case OBJ_WEAPONS: + if (player_size(PSIZE_BODY) < SIZE_MEDIUM + && !check_weapon_wieldable_size(item, player_size(PSIZE_BODY))) + { + // Weapon is too large to be wielded. + return (true); + } + if (!item_type_known(item)) return (false); diff --git a/crawl-ref/source/tilesdl.cc b/crawl-ref/source/tilesdl.cc index bf57e4c8b7..e026e5df39 100644 --- a/crawl-ref/source/tilesdl.cc +++ b/crawl-ref/source/tilesdl.cc @@ -822,6 +822,16 @@ int TilesFramework::getch_ck() switch (event.type) { + case SDL_ACTIVEEVENT: + // When game gains focus back then set mod state clean + // to get rid of stupid Windows/SDL bug with Alt-Tab. + if (event.active.gain != 0) + { + SDL_SetModState(KMOD_NONE); + set_need_redraw(); + } + break; + case SDL_KEYDOWN: m_key_mod |= _get_modifiers(event.key.keysym); key = _translate_keysym(event.key.keysym); -- cgit v1.2.3-54-g00ecf