diff --git a/src/dialogxml/keycodes.cpp b/src/dialogxml/keycodes.cpp index df3578de..03ffa8cd 100644 --- a/src/dialogxml/keycodes.cpp +++ b/src/dialogxml/keycodes.cpp @@ -100,6 +100,10 @@ unsigned char applyShift(unsigned char c){ '~', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '{', '|', '}', '~', }; + if (c<' ') + return ' '; + if (c>=0x7f) + return c; return afterShift[c - ' ']; } @@ -112,5 +116,9 @@ unsigned char removeShift(unsigned char c){ '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '[', '\\',']', '`', }; + if (c<' ') + return ' '; + if (c>=0x7f) + return c; return afterUnShift[c - ' ']; } diff --git a/src/dialogxml/keycodes.hpp b/src/dialogxml/keycodes.hpp index 4932611c..c3641a1c 100644 --- a/src/dialogxml/keycodes.hpp +++ b/src/dialogxml/keycodes.hpp @@ -86,4 +86,6 @@ bool operator== (cKey a, cKey b); /// @return true if the needle is in the haystack bool mod_contains(eKeyMod haystack, eKeyMod needle); +unsigned char applyShift(unsigned char c); +unsigned char removeShift(unsigned char c); #endif diff --git a/src/dialogxml/widgets/control.cpp b/src/dialogxml/widgets/control.cpp index 4f222cc9..db960cbe 100644 --- a/src/dialogxml/widgets/control.cpp +++ b/src/dialogxml/widgets/control.cpp @@ -238,39 +238,6 @@ bool cControl::handleClick(location){ return clicked; } -static unsigned char applyShift(unsigned char c){ - static const char afterShift[] = { - ' ', '!', '"', '#', '$', '%', '&', '"', '(', ')', '*', '+', '<', '_', '>', '?', - ')', '!', '@', '#', '$', '%', '^', '&', '*', '(', ':', ':', '<', '+', '>', '?', - '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', - 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '{', '|', '}', '^', '_', - '~', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', - 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '{', '|', '}', '~', - }; - if (c<' ') - return ' '; - if (c>=0x7f) - return c; - return afterShift[c - ' ']; -} - -static unsigned char removeShift(unsigned char c){ - static const char afterUnShift[] = { - ' ', '1', '\'','3', '4', '5', '7', '\'','9', '0', '8', '=', ',', '-', '.', '/', - '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', ';', ';', ',', '=', '.', '/', - '2', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', - 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '[', '\\',']', '6', '-', - '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', - 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '[', '\\',']', '`', - }; - // ASAN: c can be called with 0 by cControl::getAttachedKeyDescription() - if (c<' ') - return ' '; - if (c>=0x7f) - return c; - return afterUnShift[c - ' ']; -} - std::string cControl::getAttachedKeyDescription() { std::string s; if(key.spec) { diff --git a/src/fileio/gzstream/version b/src/fileio/gzstream/gzstream_version similarity index 100% rename from src/fileio/gzstream/version rename to src/fileio/gzstream/gzstream_version diff --git a/src/scenedit/scen.graphics.hpp b/src/scenedit/scen.graphics.hpp index eac83c27..59dc00af 100644 --- a/src/scenedit/scen.graphics.hpp +++ b/src/scenedit/scen.graphics.hpp @@ -1,5 +1,7 @@ #include + +#include "global.hpp" #include "fields.hpp" #include "location.hpp" diff --git a/src/universe/universe.cpp b/src/universe/universe.cpp index ced19230..6ba1ad53 100644 --- a/src/universe/universe.cpp +++ b/src/universe/universe.cpp @@ -1167,15 +1167,12 @@ void cUniverse::exportGraphics() { used_graphics.insert(party[i].which_graphic - 10000 + j); } else if(party[i].which_graphic >= 1000) update_pcs[party[i].which_graphic - 1000].insert(&party[i]); - for(size_t j = 0; j < party[i].items.size(); j++) { - check_item(party[i].items[j]); - } - } - for(size_t i = 0; i < party.stored_items.size(); i++) { - for(size_t j = 0; j < party.stored_items[i].size(); j++) { - check_item(party.stored_items[i][j]); - } + for (auto &item : party[i].items) + check_item(item); } + for (auto &items : party.stored_items) + for (auto &item : items) + check_item(item); for(mon_num_t monst : party.imprisoned_monst) { if(monst > 0 && monst < scenario.scen_monsters.size()) check_monst(scenario.scen_monsters[monst]);