diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 23d987f758..29507e02eb 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -242,7 +242,7 @@ New features: - Game can now be completed, game over screens for winning and losing. - Randomizer for "New Battle" mode. - Your settings in "New Battle" mode will be saved for next time you play. -- New translations: Ukranian, Bulgarian, Portuguese (Portugal), Spanish (Latin American), Danish. +- New translations: Ukrainian, Bulgarian, Portuguese (Portugal), Spanish (Latin American), Danish. - New soldier names: Italian, Hungarian. - Aliens progress their equipment levels, races and aggression over time. - Added "Alien Weapon Level" button in New Battle menu. @@ -343,7 +343,7 @@ Bugfixes: Battlescape: - Battlescape buttons are now unavailable during alien turn. - Fixed bug in map generator regarding nodes outside the map. -- Improved map generation of alien base assualt missions. +- Improved map generation of alien base assault missions. - The player no longer reveals the tile an alien is standing on when they detect an alien on an unrevealed tile. - The camera resets after non-reaction shots. - Camera now correctly centers on explosions, and properly detects explosion visibility. diff --git a/src/Battlescape/AlienBAIState.cpp b/src/Battlescape/AlienBAIState.cpp index 46441a92ac..d36091c2c0 100644 --- a/src/Battlescape/AlienBAIState.cpp +++ b/src/Battlescape/AlienBAIState.cpp @@ -797,7 +797,7 @@ void AlienBAIState::setupEscape() const int FIRE_PENALTY = 40; const int BASE_SYSTEMATIC_SUCCESS = 100; const int BASE_DESPERATE_SUCCESS = 110; - const int FAST_PASS_THRESHOLD = 100; // a score that's good engouh to quit the while loop early; it's subjective, hand-tuned and may need tweaking + const int FAST_PASS_THRESHOLD = 100; // a score that's good enough to quit the while loop early; it's subjective, hand-tuned and may need tweaking std::vector randomTileSearch = _save->getTileSearch(); RNG::shuffle(randomTileSearch); diff --git a/src/Battlescape/BattlescapeGenerator.cpp b/src/Battlescape/BattlescapeGenerator.cpp index c7a3a5dcfc..bd980aeed2 100644 --- a/src/Battlescape/BattlescapeGenerator.cpp +++ b/src/Battlescape/BattlescapeGenerator.cpp @@ -2213,7 +2213,7 @@ void BattlescapeGenerator::attachNodeLinks() /** * Selects a position for a map block. - * @param rects the postions to select from, none meaning the whole map. + * @param rects the positions to select from, none meaning the whole map. * @param X the x position for the block gets stored in this variable. * @param Y the y position for the block gets stored in this variable. * @param sizeX the x size of the block we want to add. diff --git a/src/Battlescape/BattlescapeState.cpp b/src/Battlescape/BattlescapeState.cpp index 77e711f54c..5886254568 100644 --- a/src/Battlescape/BattlescapeState.cpp +++ b/src/Battlescape/BattlescapeState.cpp @@ -504,7 +504,7 @@ BattlescapeState::~BattlescapeState() } /** - * Initilizes the battlescapestate. + * Initializes the battlescapestate. */ void BattlescapeState::init() { diff --git a/src/Battlescape/BattlescapeState.h b/src/Battlescape/BattlescapeState.h index cf1422f90d..01a546239b 100644 --- a/src/Battlescape/BattlescapeState.h +++ b/src/Battlescape/BattlescapeState.h @@ -95,7 +95,7 @@ class BattlescapeState : public State BattlescapeState(); /// Cleans up the Battlescape state. ~BattlescapeState(); - /// Initilizes the battlescapestate. + /// Initializes the battlescapestate. void init(); /// Runs the timers and handles popups. void think(); diff --git a/src/Battlescape/CivilianBAIState.cpp b/src/Battlescape/CivilianBAIState.cpp index d738b9865e..754cc67981 100644 --- a/src/Battlescape/CivilianBAIState.cpp +++ b/src/Battlescape/CivilianBAIState.cpp @@ -296,7 +296,7 @@ void CivilianBAIState::setupEscape() const int FIRE_PENALTY = 40; const int BASE_SYSTEMATIC_SUCCESS = 100; const int BASE_DESPERATE_SUCCESS = 110; - const int FAST_PASS_THRESHOLD = 100; // a score that's good engouh to quit the while loop early; it's subjective, hand-tuned and may need tweaking + const int FAST_PASS_THRESHOLD = 100; // a score that's good enough to quit the while loop early; it's subjective, hand-tuned and may need tweaking int tu = _unit->getTimeUnits() / 2; diff --git a/src/Battlescape/CivilianBAIState.h b/src/Battlescape/CivilianBAIState.h index df2b79ff26..d8d9f69a56 100644 --- a/src/Battlescape/CivilianBAIState.h +++ b/src/Battlescape/CivilianBAIState.h @@ -32,7 +32,7 @@ class Node; struct BattleAction; /** - * This is the intial AI state of units, walking around and looking for intruders. + * This is the initial AI state of units, walking around and looking for intruders. */ class CivilianBAIState : public BattleAIState { diff --git a/src/Battlescape/Map.cpp b/src/Battlescape/Map.cpp index 9906fddeee..a4a0e7977d 100644 --- a/src/Battlescape/Map.cpp +++ b/src/Battlescape/Map.cpp @@ -851,7 +851,7 @@ void Map::drawTerrain(Surface *surface) if (unit->getBreathFrame() > 0) { tmpSurface = _res->getSurfaceSet("BREATH-1.PCK")->getFrame(unit->getBreathFrame() - 1); - // we enlarge the unit sprite when aiming to accomodate the weapon. so adjust as necessary. + // we enlarge the unit sprite when aiming to accommodate the weapon. so adjust as necessary. if (unit->getStatus() == STATUS_AIMING) { offset.x = 0; diff --git a/src/Battlescape/Pathfinding.cpp b/src/Battlescape/Pathfinding.cpp index 3703f45f31..c390e9c298 100644 --- a/src/Battlescape/Pathfinding.cpp +++ b/src/Battlescape/Pathfinding.cpp @@ -235,7 +235,7 @@ bool Pathfinding::aStarPath(const Position &startPosition, const Position &endPo } } } - // Unble to reach the target + // Unable to reach the target return false; } diff --git a/src/Battlescape/Projectile.cpp b/src/Battlescape/Projectile.cpp index 8bd8a3b7e2..8499d658c2 100644 --- a/src/Battlescape/Projectile.cpp +++ b/src/Battlescape/Projectile.cpp @@ -457,7 +457,7 @@ Position Projectile::getTarget() /** * Is this projectile drawn back to front or front to back? - * @retun return if this is to be drawn in reverse order. + * @return return if this is to be drawn in reverse order. */ bool Projectile::isReversed() const { diff --git a/src/Battlescape/TileEngine.cpp b/src/Battlescape/TileEngine.cpp index cba0e52676..bd08fffe5b 100644 --- a/src/Battlescape/TileEngine.cpp +++ b/src/Battlescape/TileEngine.cpp @@ -1584,7 +1584,7 @@ int TileEngine::horizontalBlockage(Tile *startTile, Tile *endTile, ItemDamageTyp block = blockage(startTile, MapData::O_NORTHWALL, type); break; case 1: // north east - if (type == DT_NONE) //this is two-way diagonal visiblity check, used in original game + if (type == DT_NONE) //this is two-way diagonal visibility check, used in original game { block = blockage(startTile, MapData::O_NORTHWALL, type) + blockage(endTile, MapData::O_WESTWALL, type); //up+right tmpTile = _save->getTile(startTile->getPosition() + oneTileNorth); @@ -2249,7 +2249,7 @@ int TileEngine::calculateLine(const Position& origin, const Position& target, bo /** * Calculates a parabola trajectory, used for throwing items. - * @param origin Orign in voxelspace. + * @param origin Origin in voxelspace. * @param target Target in voxelspace. * @param storeTrajectory True will store the whole trajectory - otherwise it just stores the last position. * @param trajectory A vector of positions in which the trajectory is stored. @@ -2350,7 +2350,7 @@ bool TileEngine::isVoxelVisible(const Position& voxel) { int zstart = voxel.z+3; // slight Z adjust if ((zstart/24)!=(voxel.z/24)) - return true; // visble! + return true; // visible! Position tmpVoxel = voxel; int zend = (zstart/24)*24 +24; for (int z = zstart; zgetMovementType() == MT_FLY) { - // move to the position you're already in. this will unset the kneeling flag, set teh floating flag, etc. + // move to the position you're already in. this will unset the kneeling flag, set the floating flag, etc. occupant->startWalking(occupant->getDirection(), occupant->getPosition(), _save->getTile(occupant->getPosition() + Position(0,0,-1)), true); // and set our status to standing (rather than walking or flying) to avoid weirdness. occupant->abortTurn(); diff --git a/src/Engine/Adlib/adlplayer.cpp b/src/Engine/Adlib/adlplayer.cpp index 178fe1a43b..65750a602c 100644 --- a/src/Engine/Adlib/adlplayer.cpp +++ b/src/Engine/Adlib/adlplayer.cpp @@ -697,7 +697,7 @@ int decode_op(int instrument, bool* another_loop) } // music initialization function, sets up subblock array, -// tempo, instrument addreses and samples +// tempo, instrument addresses and samples void init_music_data(unsigned char* music_ptr,int length) { unsigned int i, to_add, j; diff --git a/src/Engine/Adlib/fmopl.cpp b/src/Engine/Adlib/fmopl.cpp index ad4de41bbc..7059bcdc02 100644 --- a/src/Engine/Adlib/fmopl.cpp +++ b/src/Engine/Adlib/fmopl.cpp @@ -710,8 +710,8 @@ static void OPLCloseTable( void ) free(VIB_TABLE); } -/* CSM Key Controll */ -INLINE void CSMKeyControll(OPL_CH *CH) +/* CSM Key Control */ +INLINE void CSMKeyControl(OPL_CH *CH) { OPL_SLOT *slot1 = &CH->SLOT[SLOT1]; OPL_SLOT *slot2 = &CH->SLOT[SLOT2]; @@ -1398,7 +1398,7 @@ int OPLTimerOver(FM_OPL *OPL,int c) int ch; if(OPL->UpdateHandler) OPL->UpdateHandler(OPL->UpdateParam,0); for(ch=0;ch<9;ch++) - CSMKeyControll( &OPL->P_CH[ch] ); + CSMKeyControl( &OPL->P_CH[ch] ); } } /* reload timer */ diff --git a/src/Engine/FileMap.cpp b/src/Engine/FileMap.cpp index 141e97cbdd..6102acc029 100644 --- a/src/Engine/FileMap.cpp +++ b/src/Engine/FileMap.cpp @@ -79,7 +79,7 @@ std::set _filterFiles(const T &files, const std::string &ext) for (typename T::const_iterator i = files.begin(); i != files.end(); ++i) { // less-than not less-than-or-equal since we should have at least - // one character in the filename that is not part of the extention + // one character in the filename that is not part of the extension if (extLen < i->length() && 0 == _canonicalize(i->substr(i->length() - (extLen - 1))).compare(canonicalExt)) { ret.insert(*i); diff --git a/src/Engine/FileMap.h b/src/Engine/FileMap.h index 35fd6fc2e9..453d390774 100644 --- a/src/Engine/FileMap.h +++ b/src/Engine/FileMap.h @@ -42,7 +42,7 @@ namespace FileMap /// filesystem paths via getFilePath() const std::set &getVFolderContents(const std::string &relativePath); - /// Returns the subset of the given files that matches the given extention + /// Returns the subset of the given files that matches the given extension std::set filterFiles(const std::vector &files, const std::string &ext); std::set filterFiles(const std::set &files, const std::string &ext); diff --git a/src/Engine/Game.cpp b/src/Engine/Game.cpp index d96eb71e21..363942c32e 100644 --- a/src/Engine/Game.cpp +++ b/src/Engine/Game.cpp @@ -281,7 +281,7 @@ void Game::run() if (_init && _timeUntilNextFrame <= 0) { - // make a note of when this frame update occured. + // make a note of when this frame update occurred. _timeOfLastFrame = SDL_GetTicks(); _fpsCounter->addFrame(); _screen->clear(); diff --git a/src/Engine/Language.cpp b/src/Engine/Language.cpp index cea462d4cd..2c9f09bc17 100644 --- a/src/Engine/Language.cpp +++ b/src/Engine/Language.cpp @@ -433,7 +433,7 @@ void Language::load(ExtraStrings *extras) } /** -* Replaces all special string markers with the approriate characters +* Replaces all special string markers with the appropriate characters * and converts the string encoding. * @param string Original UTF-8 string. * @return New widechar string. diff --git a/src/Engine/LanguagePlurality.cpp b/src/Engine/LanguagePlurality.cpp index 629d4eb48a..44d43ef4fb 100644 --- a/src/Engine/LanguagePlurality.cpp +++ b/src/Engine/LanguagePlurality.cpp @@ -81,7 +81,7 @@ const char *NoSingular::getSuffix(unsigned) const } /** - * Plurality rules for Cyrillic languages (Russian, Ukranian, etc.) + * Plurality rules for Cyrillic languages (Russian, Ukrainian, etc.) * @note one = 1, 21, 31...; few = 2-4, 22-24, 32-34...; many = 0, 5-20, 25-30, 35-40...; other = ... */ class CyrillicPlurality : public LanguagePlurality diff --git a/src/Engine/LocalizedText.cpp b/src/Engine/LocalizedText.cpp index 3b8b4d2dae..98d9026dc7 100644 --- a/src/Engine/LocalizedText.cpp +++ b/src/Engine/LocalizedText.cpp @@ -25,7 +25,7 @@ namespace OpenXcom /** * Replace the next argument placeholder with @a val. * @param val The value to place in the next placeholder's position. - * @return A translated string with all occurences of the marker replaced by @a val. + * @return A translated string with all occurrences of the marker replaced by @a val. */ LocalizedText LocalizedText::arg(const std::wstring &val) const { @@ -46,7 +46,7 @@ LocalizedText LocalizedText::arg(const std::wstring &val) const /** * Replace the next argument placeholder with @a val. * @param val The value to place in the next placeholder's position. - * @return The translated string with all occurences of the marker replaced by @a val. + * @return The translated string with all occurrences of the marker replaced by @a val. */ LocalizedText &LocalizedText::arg(const std::wstring &val) { diff --git a/src/Engine/LocalizedText.h b/src/Engine/LocalizedText.h index fe5b50cf92..61c1ea99ad 100644 --- a/src/Engine/LocalizedText.h +++ b/src/Engine/LocalizedText.h @@ -101,7 +101,7 @@ inline LocalizedText::operator std::wstring const&() const * Replace the next argument placeholder with @a val. * @tparam T The type of the replacement value. It should be streamable to std::owstringstream. * @param val The value to place in the next placeholder's position. - * @return A translated string with all occurences of the marker replaced by @a val. + * @return A translated string with all occurrences of the marker replaced by @a val. */ template LocalizedText LocalizedText::arg(T val) const @@ -127,7 +127,7 @@ LocalizedText LocalizedText::arg(T val) const * Replace the next argument placeholder with @a val. * @tparam T The type of the replacement value. It should be streamable to std::owstringstream. * @param val The value to place in the next placeholder's position. - * @return The translated string with all occurences of the marker replaced by @a val. + * @return The translated string with all occurrences of the marker replaced by @a val. */ template LocalizedText &LocalizedText::arg(T val) diff --git a/src/Engine/RNG.cpp b/src/Engine/RNG.cpp index ad1f540010..5572dd12bd 100644 --- a/src/Engine/RNG.cpp +++ b/src/Engine/RNG.cpp @@ -142,7 +142,7 @@ double boxMuller(double m, double s) } /** - * Generates a random percent chance of an event occuring, + * Generates a random percent chance of an event occurring, * and returns the result * @param value Value percentage (0-100%) * @return True if the chance succeeded. diff --git a/src/Engine/Scalers/init.cpp b/src/Engine/Scalers/init.cpp index 2173581650..0d048c9633 100644 --- a/src/Engine/Scalers/init.cpp +++ b/src/Engine/Scalers/init.cpp @@ -24,7 +24,7 @@ uint32_t YUV1, YUV2; HQX_API void HQX_CALLCONV hqxInit(void) { - /* Initalize RGB to YUV lookup table */ + /* Initialize RGB to YUV lookup table */ uint32_t c, r, g, b, y, u, v; for (c = 0; c < 16777215; c++) { r = (c & 0xFF0000) >> 16; diff --git a/src/Engine/Scalers/scale2x.cpp b/src/Engine/Scalers/scale2x.cpp index 9624db7a23..3f0777d525 100644 --- a/src/Engine/Scalers/scale2x.cpp +++ b/src/Engine/Scalers/scale2x.cpp @@ -1291,7 +1291,7 @@ static inline void scale2x_32_mmx_border(scale2x_uint32* dst, const scale2x_uint * Scale by a factor of 2 a row of pixels of 8 bits. * This is a very fast MMX implementation. * The implementation uses a combination of cmp/and/not operations to - * completly remove the need of conditional jumps. This trick give the + * completely remove the need of conditional jumps. This trick give the * major speed improvement. * Also, using the 8 bytes MMX registers more than one pixel are computed * at the same time. diff --git a/src/Engine/Scalers/scalebit.cpp b/src/Engine/Scalers/scalebit.cpp index d0b2a98bbe..8e032be817 100644 --- a/src/Engine/Scalers/scalebit.cpp +++ b/src/Engine/Scalers/scalebit.cpp @@ -16,7 +16,7 @@ /* * This file contains an example implementation of the Scale effect - * applyed to a generic bitmap. + * applied to a generic bitmap. * * You can find an high level description of the effect at : * diff --git a/src/Engine/Scalers/scalebit.h b/src/Engine/Scalers/scalebit.h index ef8af0aba7..00b1ab6d19 100644 --- a/src/Engine/Scalers/scalebit.h +++ b/src/Engine/Scalers/scalebit.h @@ -16,7 +16,7 @@ /* * This file contains an example implementation of the Scale effect - * applyed to a generic bitmap. + * applied to a generic bitmap. * * You can find an high level description of the effect at : * diff --git a/src/Engine/Scalers/xbrz.cpp b/src/Engine/Scalers/xbrz.cpp index 110ba376c5..bf156df20f 100644 --- a/src/Engine/Scalers/xbrz.cpp +++ b/src/Engine/Scalers/xbrz.cpp @@ -321,7 +321,7 @@ double distHSL(uint32_t pix1, uint32_t pix2, double lightningWeight) double l2 = 0; rgbtoHsl(pix2, h2, s2, l2); - //HSL is in cylindric coordinatates where L represents height, S radius, H angle, + //HSL is in cylindric coordinates where L represents height, S radius, H angle, //however we interpret the cylinder as a bi-conic solid with top/bottom radius 0, middle radius 1 assert(0 <= h1 && h1 <= 1); assert(0 <= h2 && h2 <= 1); @@ -379,7 +379,7 @@ double distYCbCr(uint32_t pix1, uint32_t pix2, double lumaWeight) //YCbCr conversion is a matrix multiplication => take advantage of linearity by subtracting first! const int r_diff = static_cast(getRed (pix1)) - getRed (pix2); //we may delay division by 255 to after matrix multiplication const int g_diff = static_cast(getGreen(pix1)) - getGreen(pix2); // - const int b_diff = static_cast(getBlue (pix1)) - getBlue (pix2); //substraction for int is noticeable faster than for double! + const int b_diff = static_cast(getBlue (pix1)) - getBlue (pix2); //subtraction for int is noticeable faster than for double! const double k_b = 0.0722; //ITU-R BT.709 conversion const double k_r = 0.2126; // @@ -484,7 +484,7 @@ input kernel area naming convention: ----------------- | A | B | C | D | ----|---|---|---| -| E | F | G | H | //evalute the four corners between F, G, J, K +| E | F | G | H | //evaluate the four corners between F, G, J, K ----|---|---|---| //input pixel is at position F | I | J | K | L | ----|---|---|---| @@ -710,7 +710,7 @@ void scaleImage(const uint32_t* src, uint32_t* trg, int srcWidth, int srcHeight, const int x_p1 = std::min(x + 1, srcWidth - 1); const int x_p2 = std::min(x + 2, srcWidth - 1); - Kernel_4x4 ker = {}; //perf: initialization is negligable + Kernel_4x4 ker = {}; //perf: initialization is negligible ker.a = s_m1[x_m1]; //read sequentially from memory as far as possible ker.b = s_m1[x]; ker.c = s_m1[x_p1]; @@ -735,7 +735,7 @@ void scaleImage(const uint32_t* src, uint32_t* trg, int srcWidth, int srcHeight, /* preprocessing blend result: --------- - | F | G | //evalute corner between F, G, J, K + | F | G | //evaluate corner between F, G, J, K ----|---| //input pixel is at position F | J | K | --------- @@ -772,7 +772,7 @@ void scaleImage(const uint32_t* src, uint32_t* trg, int srcWidth, int srcHeight, //evaluate the four corners on bottom-right of current pixel unsigned char blend_xy = 0; //for current (x, y) position { - Kernel_4x4 ker = {}; //perf: initialization is negligable + Kernel_4x4 ker = {}; //perf: initialization is negligible ker.a = s_m1[x_m1]; //read sequentially from memory as far as possible ker.b = s_m1[x]; ker.c = s_m1[x_p1]; @@ -797,7 +797,7 @@ void scaleImage(const uint32_t* src, uint32_t* trg, int srcWidth, int srcHeight, /* preprocessing blend result: --------- - | F | G | //evalute corner between F, G, J, K + | F | G | //evaluate corner between F, G, J, K ----|---| //current input pixel is at position F | J | K | --------- @@ -816,12 +816,12 @@ void scaleImage(const uint32_t* src, uint32_t* trg, int srcWidth, int srcHeight, } //fill block of size scale * scale with the given color - fillBlock(out, trgWidth * sizeof(uint32_t), s_0[x], Scaler::scale); //place *after* preprocessing step, to not overwrite the results while processing the the last pixel! + fillBlock(out, trgWidth * sizeof(uint32_t), s_0[x], Scaler::scale); //place *after* preprocessing step, to not overwrite the results while processing the last pixel! //blend four corners of current pixel if (blendingNeeded(blend_xy)) //good 20% perf-improvement { - Kernel_3x3 ker = {}; //perf: initialization is negligable + Kernel_3x3 ker = {}; //perf: initialization is negligible ker.a = s_m1[x_m1]; //read sequentially from memory as far as possible ker.b = s_m1[x]; @@ -933,7 +933,7 @@ struct Scaler3x { //model a round corner alphaBlend<45, 100>(out.template ref<2, 2>(), col); //exact: 0.4545939598 - //alphaBlend<14, 1000>(out.template ref<2, 1>(), col); //0.01413008627 -> negligable + //alphaBlend<14, 1000>(out.template ref<2, 1>(), col); //0.01413008627 -> negligible //alphaBlend<14, 1000>(out.template ref<1, 2>(), col); //0.01413008627 } }; @@ -1077,7 +1077,7 @@ struct Scaler5x alphaBlend<86, 100>(out.template ref<4, 4>(), col); //exact: 0.8631434088 alphaBlend<23, 100>(out.template ref<4, 3>(), col); //0.2306749731 alphaBlend<23, 100>(out.template ref<3, 4>(), col); //0.2306749731 - //alphaBlend<8, 1000>(out.template ref<4, 2>(), col); //0.008384061834 -> negligable + //alphaBlend<8, 1000>(out.template ref<4, 2>(), col); //0.008384061834 -> negligible //alphaBlend<8, 1000>(out.template ref<2, 4>(), col); //0.008384061834 } }; diff --git a/src/Engine/Screen.cpp b/src/Engine/Screen.cpp index 1f8962e5a4..e38d5852c1 100644 --- a/src/Engine/Screen.cpp +++ b/src/Engine/Screen.cpp @@ -233,7 +233,7 @@ void Screen::setPalette(SDL_Color* colors, int firstcolor, int ncolors, bool imm { if (_numColors && (_numColors != ncolors) && (_firstColor != firstcolor)) { - // an initial palette setup has not been comitted to the screen yet + // an initial palette setup has not been committed to the screen yet // just update it with whatever colors are being sent now memmove(&(deferredPalette[firstcolor]), colors, sizeof(SDL_Color)*ncolors); _numColors = 256; // all the use cases are just a full palette with 16-color follow-ups diff --git a/src/Engine/Surface.cpp b/src/Engine/Surface.cpp index 1c04e4538f..148883f2d0 100644 --- a/src/Engine/Surface.cpp +++ b/src/Engine/Surface.cpp @@ -484,7 +484,7 @@ void Surface::think() * Draws the graphic that the surface contains before it * gets blitted onto other surfaces. The surface is only * redrawn if the flag is set by a property change, to - * avoid unecessary drawing. + * avoid unnecessary drawing. */ void Surface::draw() { diff --git a/src/Engine/Zoom.cpp b/src/Engine/Zoom.cpp index 9c0ca2e282..30eb49194f 100644 --- a/src/Engine/Zoom.cpp +++ b/src/Engine/Zoom.cpp @@ -99,7 +99,7 @@ static int zoomSurface2X_64bit(SDL_Surface *src, SDL_Surface *dst) // boo (void)SDL_SwapLE64(dataSrc); */ -/* expanded form of of data shift: +/* expanded form of data shift: dataDst = (dataSrc & 0xFF) | ((dataSrc & 0xFF) << 8) | ((dataSrc & 0xFF00 ) << 8) | ((dataSrc & 0xFF00)) << 16) | ((dataSrc & 0xFF0000) << 16) | ((dataSrc & 0xFF0000) << 24) | @@ -237,7 +237,7 @@ static int zoomSurface4X_64bit(SDL_Surface *src, SDL_Surface *dst) // boo (void)SDL_SwapLE64(dataSrc); */ - /* expanded form of of data shift: + /* expanded form of data shift: dataDst = (dataSrc & 0xFF) | ((dataSrc & 0xFF) << 8) | ((dataSrc & 0xFF) << 16 | ((datasrc & 0xFF) << 24) | ((dataSrc & 0xFF00 ) << 24) | ((dataSrc & 0xFF00) << 32) | diff --git a/src/Geoscape/DogfightState.cpp b/src/Geoscape/DogfightState.cpp index 8c680295d5..b662a1515c 100644 --- a/src/Geoscape/DogfightState.cpp +++ b/src/Geoscape/DogfightState.cpp @@ -501,7 +501,7 @@ DogfightState::DogfightState(Globe *globe, Craft *craft, Ufo *ufo) : _globe(glob _w2FireInterval = _craft->getWeapons()->at(1)->getRules()->getStandardReload(); } - // Set UFO size - going to be moved to Ufo class to implement simultanous dogfights. + // Set UFO size - going to be moved to Ufo class to implement simultaneous dogfights. std::string ufoSize = _ufo->getRules()->getSize(); if (ufoSize.compare("STR_VERY_SMALL") == 0) { diff --git a/src/Interface/BattlescapeButton.cpp b/src/Interface/BattlescapeButton.cpp index 1a1447dca5..c44c4ad2ff 100644 --- a/src/Interface/BattlescapeButton.cpp +++ b/src/Interface/BattlescapeButton.cpp @@ -140,7 +140,7 @@ void BattlescapeButton::allowClickInversion() /** * Initializes the alternate surface for swapping out as needed. * performs a colour swap for TFTD style buttons, and a palette inversion for coloured buttons - * we use two seperate surfaces because it's far easier to keep track of + * we use two separate surfaces because it's far easier to keep track of * whether or not this surface is inverted. */ void BattlescapeButton::initSurfaces() diff --git a/src/Menu/MainMenuState.h b/src/Menu/MainMenuState.h index 28998e5200..72f0bd9ef9 100644 --- a/src/Menu/MainMenuState.h +++ b/src/Menu/MainMenuState.h @@ -28,7 +28,7 @@ class TextButton; class Window; class Text; -// Utility class for enqueueing a state in the stack that goes to the main menu +// Utility class for enqueuing a state in the stack that goes to the main menu class GoToMainMenuState : public State { public: diff --git a/src/Ruleset/MapBlock.cpp b/src/Ruleset/MapBlock.cpp index d6588bd000..0469bb1178 100644 --- a/src/Ruleset/MapBlock.cpp +++ b/src/Ruleset/MapBlock.cpp @@ -33,7 +33,7 @@ MapBlock::MapBlock(const std::string &name):_name(name), _size_x(10), _size_y(10 } /** - * MapBlock desctruction. + * MapBlock destruction. */ MapBlock::~MapBlock() { diff --git a/src/Ruleset/Ruleset.cpp b/src/Ruleset/Ruleset.cpp index 287f982cd3..3c151d925a 100644 --- a/src/Ruleset/Ruleset.cpp +++ b/src/Ruleset/Ruleset.cpp @@ -896,7 +896,7 @@ RuleBaseFacility *Ruleset::getBaseFacility(const std::string &id) const /** * Returns the list of all base facilities * provided by the ruleset. - * @return List of base faciliies. + * @return List of base facilities. */ const std::vector &Ruleset::getBaseFacilitiesList() const { diff --git a/src/Ruleset/Unit.cpp b/src/Ruleset/Unit.cpp index 81333130cd..2f088a2db0 100644 --- a/src/Ruleset/Unit.cpp +++ b/src/Ruleset/Unit.cpp @@ -280,7 +280,7 @@ const std::vector &Unit::getBuiltInWeapons() const /** * Is this unit a female? - * only really relevent to the scream in the case of civilians. + * only really relevant to the scream in the case of civilians. * @return female or not. */ const bool Unit::isFemale() const diff --git a/src/Savegame/AlienMission.cpp b/src/Savegame/AlienMission.cpp index 77e4b0f767..c8f82407e0 100644 --- a/src/Savegame/AlienMission.cpp +++ b/src/Savegame/AlienMission.cpp @@ -205,7 +205,7 @@ void AlienMission::think(Game &engine, const Globe &globe) } /** - * This function will spawn a UFO according the the mission rules. + * This function will spawn a UFO according the mission rules. * Some code is duplicated between cases, that's ok for now. It's on different * code paths and the function is MUCH easier to read written this way. * @param game The saved game information. @@ -554,7 +554,7 @@ void AlienMission::setId(int id) */ int AlienMission::getId() const { - assert(_uniqueID != 0 && "Uninitalized mission!"); + assert(_uniqueID != 0 && "Uninitialized mission!"); return _uniqueID; } @@ -684,7 +684,7 @@ std::pair AlienMission::getLandPoint(const Globe &globe, const R && tries < 100); if (tries == 100) { - Log(LOG_DEBUG) << "Region: " << region.getType() << " Longitude: " << pos.first << " Lattitude: " << pos.second << " invalid zone: " << zone << " ufo forced to land on water!"; + Log(LOG_DEBUG) << "Region: " << region.getType() << " Longitude: " << pos.first << " Latitude: " << pos.second << " invalid zone: " << zone << " ufo forced to land on water!"; } return pos; diff --git a/src/Savegame/BattleUnit.cpp b/src/Savegame/BattleUnit.cpp index 5c944e5773..dc5e3cb14b 100644 --- a/src/Savegame/BattleUnit.cpp +++ b/src/Savegame/BattleUnit.cpp @@ -139,7 +139,7 @@ BattleUnit::BattleUnit(Soldier *soldier, int depth) : * @param faction Which faction the units belongs to. * @param id Unique unit ID. * @param armor Pointer to unit Armor. - * @param diff difficulty level (for stat adjustement). + * @param diff difficulty level (for stat adjustment). * @param depth the depth of the battlefield (used to determine movement type in case of MT_FLOAT). */ BattleUnit::BattleUnit(Unit *unit, UnitFaction faction, int id, Armor *armor, int diff, int depth) : @@ -1191,7 +1191,7 @@ void BattleUnit::knockOut(BattlescapeGame *battle) } /** - * Intialises the falling sequence. Occurs after death or stunned. + * Initialises the falling sequence. Occurs after death or stunned. */ void BattleUnit::startFalling() { @@ -2794,7 +2794,7 @@ bool BattleUnit::checkViewSector (Position pos) const /** * common function to adjust a unit's stats according to difficulty setting. - * @param diff difficulty level (for stat adjustement). + * @param diff difficulty level (for stat adjustment). */ void BattleUnit::adjustStats(const int diff) { diff --git a/src/Savegame/Production.cpp b/src/Savegame/Production.cpp index 14203afc3d..2e9941abce 100644 --- a/src/Savegame/Production.cpp +++ b/src/Savegame/Production.cpp @@ -230,7 +230,7 @@ void Production::load(const YAML::Node &node) setAmountTotal(node["amount"].as(getAmountTotal())); setInfiniteAmount(node["infinite"].as(getInfiniteAmount())); setSellItems(node["sell"].as(getSellItems())); - // backwards compatiblity + // backwards compatibility if (getAmountTotal() == std::numeric_limits::max()) { setAmountTotal(999); diff --git a/src/Savegame/SavedBattleGame.cpp b/src/Savegame/SavedBattleGame.cpp index 128fd1027d..93b8b27b36 100644 --- a/src/Savegame/SavedBattleGame.cpp +++ b/src/Savegame/SavedBattleGame.cpp @@ -1124,7 +1124,7 @@ void SavedBattleGame::addDestroyedObjective() } /** - * Returns whether the objectives are detroyed. + * Returns whether the objectives are destroyed. * @return True if the objectives are destroyed. */ bool SavedBattleGame::allObjectivesDestroyed() @@ -1186,7 +1186,7 @@ Node *SavedBattleGame::getSpawnNode(int nodeRank, BattleUnit *unit) * @param scout Is the unit scouting? * @param unit Pointer to the unit (to get its position). * @param fromNode Pointer to the node the unit is at. - * @return Pointer to the choosen node. + * @return Pointer to the chosen node. */ Node *SavedBattleGame::getPatrolNode(bool scout, BattleUnit *unit, Node *fromNode) { @@ -1283,7 +1283,7 @@ void SavedBattleGame::prepareNewTurn() // if we're still burning if ((*i)->getFire()) { - // propegate in four cardinal directions (0, 2, 4, 6) + // propagate in four cardinal directions (0, 2, 4, 6) for (int dir = 0; dir <= 6; dir += 2) { Position pos; @@ -1408,7 +1408,7 @@ void SavedBattleGame::prepareNewTurn() } /** - * Checks for units that are unconcious and revives them if they shouldn't be. + * Checks for units that are unconscious and revives them if they shouldn't be. * * Revived units need a tile to stand on. If the unit's current position is occupied, then * all directions around the tile are searched for a free tile to place the unit in. @@ -1798,7 +1798,7 @@ std::vector< std::vector > > &SavedBattleGame::getModuleMap( /** * calculate the number of map modules remaining by counting the map objects * on the top floor who have the baseModule flag set. we store this data in the grid - * as outlined in the comments above, in pairs representing intial and current values. + * as outlined in the comments above, in pairs representing initial and current values. */ void SavedBattleGame::calculateModuleMap() { diff --git a/src/Savegame/SavedBattleGame.h b/src/Savegame/SavedBattleGame.h index 22699a02d0..ab253a6c32 100644 --- a/src/Savegame/SavedBattleGame.h +++ b/src/Savegame/SavedBattleGame.h @@ -189,7 +189,7 @@ class SavedBattleGame void addToObjectiveCount(); /// increments the objective counter. void addDestroyedObjective(); - /// Checks if all the objectives are detroyed. + /// Checks if all the objectives are destroyed. bool allObjectivesDestroyed(); /// Gets the current item ID. int *getCurrentItemId(); diff --git a/src/Savegame/SavedGame.cpp b/src/Savegame/SavedGame.cpp index d7674e6659..0e2042bd9b 100644 --- a/src/Savegame/SavedGame.cpp +++ b/src/Savegame/SavedGame.cpp @@ -1786,7 +1786,7 @@ std::vector *SavedGame::getDeadSoldiers() } /** - * Sets the the last selected armour. + * Sets the last selected armour. * @param value The new value for last selected armor - Armor type string. */ @@ -1796,7 +1796,7 @@ void SavedGame::setLastSelectedArmor(const std::string &value) } /** - * Gets the the last selected armour + * Gets the last selected armour * @return last used armor type string */ std::string SavedGame::getLastSelectedArmor() diff --git a/src/Savegame/SavedGame.h b/src/Savegame/SavedGame.h index ff1e0eec91..d9f803aac2 100644 --- a/src/Savegame/SavedGame.h +++ b/src/Savegame/SavedGame.h @@ -289,9 +289,9 @@ class SavedGame void setSelectedBase(size_t base); /// Evaluate the score of a soldier based on all of his stats, missions and kills. int getSoldierScore(Soldier *soldier); - /// Sets the the last selected armour + /// Sets the last selected armour void setLastSelectedArmor(const std::string &value); - /// Gets the the last selected armour + /// Gets the last selected armour std::string getLastSelectedArmor(); /// Returns the craft corresponding to the specified unique id. Craft *findCraftByUniqueId(const CraftId& craftId) const; diff --git a/src/Savegame/Soldier.cpp b/src/Savegame/Soldier.cpp index ce5142389a..0f2bf2fc3e 100644 --- a/src/Savegame/Soldier.cpp +++ b/src/Savegame/Soldier.cpp @@ -584,7 +584,7 @@ int Soldier::getPsiStrImprovement() /** * Returns the soldier's death details. - * @return Pointer to death data. NULL if no death has occured. + * @return Pointer to death data. NULL if no death has occurred. */ SoldierDeath *Soldier::getDeath() const { diff --git a/src/Savegame/Tile.cpp b/src/Savegame/Tile.cpp index dedfdd264b..2d7023d82e 100644 --- a/src/Savegame/Tile.cpp +++ b/src/Savegame/Tile.cpp @@ -808,7 +808,7 @@ int Tile::getTopItemSprite() */ void Tile::prepareNewTurn() { - // we've recieved new smoke in this turn, but we're not on fire, average out the smoke. + // we've received new smoke in this turn, but we're not on fire, average out the smoke. if ( _overlaps != 0 && _smoke != 0 && _fire == 0) { _smoke = std::max(0, std::min((_smoke / _overlaps)- 1, 15)); diff --git a/src/dirent.h b/src/dirent.h index 6dc8ae57af..b8485f9931 100644 --- a/src/dirent.h +++ b/src/dirent.h @@ -501,7 +501,7 @@ dirent_next( /* Got a file */ p = &dirp->data; } else { - /* The very last entry has been processed or an error occured */ + /* The very last entry has been processed or an error occurred */ FindClose (dirp->handle); dirp->handle = INVALID_HANDLE_VALUE; p = NULL; @@ -588,7 +588,7 @@ opendir( * to 1252 using chcp utility and use Lucida Console font, or (2) use * _cprintf function when writing to console. The _cprinf() will re-encode * ANSI strings to the console code page so many non-ASCII characters will - * display correcly. + * display correctly. */ static struct dirent* readdir( @@ -742,7 +742,7 @@ dirent_mbstowcs_s( wcstr[n] = 0; } - /* Length of resuting multi-byte string WITH zero terminator */ + /* Length of resulting multi-byte string WITH zero terminator */ if (pReturnValue) { *pReturnValue = n + 1; } @@ -797,7 +797,7 @@ dirent_wcstombs_s( mbstr[n] = '\0'; } - /* Lenght of resulting multi-bytes string WITH zero-terminator */ + /* Length of resulting multi-bytes string WITH zero-terminator */ if (pReturnValue) { *pReturnValue = n + 1; } diff --git a/src/lodepng.cpp b/src/lodepng.cpp index e4f35d7dd5..369494f91e 100644 --- a/src/lodepng.cpp +++ b/src/lodepng.cpp @@ -739,7 +739,7 @@ unsigned lodepng_huffman_code_lengths(unsigned* lengths, const unsigned* frequen according to RFC 1951 section 3.2.7. To decoders incorrectly require two. To make these work as well ensure there are at least two symbols. The Package-Merge code below also doesn't work correctly if there's only one - symbol, it'd give it the theoritical 0 bits but in practice zlib wants 1 bit*/ + symbol, it'd give it the theoretical 0 bits but in practice zlib wants 1 bit*/ if(numpresent == 0) { lengths[0] = lengths[1] = 1; /*note that for RFC 1951 section 3.2.7, only lengths[0] = 1 is needed*/ @@ -1694,7 +1694,7 @@ static unsigned deflateDynamic(ucvector* out, size_t* bp, Hash* hash, uivector frequencies_d; /*frequency of dist codes*/ uivector frequencies_cl; /*frequency of code length codes*/ uivector bitlen_lld; /*lit,len,dist code lenghts (int bits), literally (without repeat codes).*/ - uivector bitlen_lld_e; /*bitlen_lld encoded with repeat codes (this is a rudemtary run length compression)*/ + uivector bitlen_lld_e; /*bitlen_lld encoded with repeat codes (this is a rudimentary run length compression)*/ /*bitlen_cl is the code length code lengths ("clcl"). The bit lengths of codes to represent tree_cl (these are written as is in the file, it would be crazy to compress these using yet another huffman tree that needs to be represented by yet another set of code lengths)*/ @@ -1702,7 +1702,7 @@ static unsigned deflateDynamic(ucvector* out, size_t* bp, Hash* hash, size_t datasize = dataend - datapos; /* - Due to the huffman compression of huffman tree representations ("two levels"), there are some anologies: + Due to the huffman compression of huffman tree representations ("two levels"), there are some analogies: bitlen_lld is to tree_cl what data is to tree_ll and tree_d. bitlen_lld_e is to bitlen_lld what lz77_encoded is to data. bitlen_cl is to bitlen_lld_e what bitlen_lld is to lz77_encoded. @@ -1773,7 +1773,7 @@ static unsigned deflateDynamic(ucvector* out, size_t* bp, Hash* hash, 17 (3-10 zeroes), 18 (11-138 zeroes)*/ for(i = 0; i < (unsigned)bitlen_lld.size; i++) { - unsigned j = 0; /*amount of repititions*/ + unsigned j = 0; /*amount of repetitions*/ while(i + j + 1 < (unsigned)bitlen_lld.size && bitlen_lld.data[i + j + 1] == bitlen_lld.data[i]) j++; if(bitlen_lld.data[i] == 0 && j >= 2) /*repeat code for zeroes*/ @@ -3207,7 +3207,7 @@ static unsigned getPixelColorRGBA8(unsigned char* r, unsigned char* g, /*Similar to getPixelColorRGBA8, but with all the for loops inside of the color mode test cases, optimized to convert the colors much faster, when converting -to RGBA or RGB with 8 bit per cannel. buffer must be RGBA or RGB output with +to RGBA or RGB with 8 bit per channel. buffer must be RGBA or RGB output with enough memory, if has_alpha is true the output is RGBA. mode has the color mode of the input buffer.*/ static unsigned getPixelColorsRGBA8(unsigned char* buffer, size_t numpixels, @@ -4221,7 +4221,7 @@ static unsigned postProcessScanlines(unsigned char* out, unsigned char* in, CERROR_TRY_RETURN(unfilter(in, in, w, h, bpp)); removePaddingBits(out, in, w * bpp, ((w * bpp + 7) / 8) * 8, h); } - /*we can immediatly filter into the out buffer, no other steps needed*/ + /*we can immediately filter into the out buffer, no other steps needed*/ else CERROR_TRY_RETURN(unfilter(out, in, w, h, bpp)); } else /*interlace_method is 1 (Adam7)*/ @@ -5566,7 +5566,7 @@ static unsigned preProcessScanlines(unsigned char** out, size_t* outsize, const } else { - /*we can immediatly filter into the out buffer, no other steps needed*/ + /*we can immediately filter into the out buffer, no other steps needed*/ error = filter(*out, in, w, h, &info_png->color, settings); } } diff --git a/src/lodepng.h b/src/lodepng.h index c497a5c608..69f7ca472d 100644 --- a/src/lodepng.h +++ b/src/lodepng.h @@ -281,7 +281,7 @@ struct LodePNGCompressSettings /*deflate = compress*/ unsigned btype; /*the block type for LZ (0, 1, 2 or 3, see zlib standard). Should be 2 for proper compression.*/ unsigned use_lz77; /*whether or not to use LZ77. Should be 1 for proper compression.*/ unsigned windowsize; /*must be a power of two <= 32768. higher compresses more but is slower. Typical value: 2048.*/ - unsigned minmatch; /*mininum lz77 length. 3 is normally best, 6 can be better for some PNGs. Default: 0*/ + unsigned minmatch; /*minimum lz77 length. 3 is normally best, 6 can be better for some PNGs. Default: 0*/ unsigned nicematch; /*stop searching if >= this length found. Set to 258 for best compression. Default: 128*/ unsigned lazymatching; /*use lazy matching: better compression but a bit slower. Default: true*/ @@ -542,7 +542,7 @@ typedef enum LodePNGFilterStrategy { /*every filter at zero*/ LFS_ZERO, - /*Use filter that gives minumum sum, as described in the official PNG filter heuristic.*/ + /*Use filter that gives minimum sum, as described in the official PNG filter heuristic.*/ LFS_MINSUM, /*Use the filter type that gives smallest Shannon entropy for this scanline. Depending on the image, this is better or worse than minsum.*/ @@ -733,7 +733,7 @@ unsigned lodepng_chunk_append(unsigned char** out, size_t* outlength, const unsi Appends new chunk to out. The chunk to append is given by giving its length, type and data separately. The type is a 4-letter string. The out variable and outlength are updated to reflect the new reallocated buffer. -Returne error code (0 if it went ok) +Returns error code (0 if it went ok) */ unsigned lodepng_chunk_create(unsigned char** out, size_t* outlength, unsigned length, const char* type, const unsigned char* data); @@ -1201,7 +1201,7 @@ It can convert from almost any color type to any other color type, except the following conversions: RGB to greyscale is not supported, and converting to a palette when the palette doesn't have a required color is not supported. This is not supported on purpose: this is information loss which requires a color -reduction algorithm that is beyong the scope of a PNG encoder (yes, RGB to grey +reduction algorithm that is beyond the scope of a PNG encoder (yes, RGB to grey is easy, but there are multiple ways if you want to give some channels more weight). @@ -1305,7 +1305,7 @@ have a bit amount that isn't a multiple of 8, then padding bits are used so that scanline starts at a fresh byte. But that is NOT true for the LodePNG raw input and output. The raw input image you give to the encoder, and the raw output image you get from the decoder will NOT have these padding bits, e.g. in the case of a 1-bit image with a width -of 7 pixels, the first pixel of the second scanline will the the 8th bit of the first byte, +of 7 pixels, the first pixel of the second scanline will the 8th bit of the first byte, not the first bit of a new byte. 6.4. A note about 16-bits per channel and endianness @@ -1501,7 +1501,7 @@ follow the C++ standard correctly. *) Comeau C/C++ -Vesion 20070107 compiles without problems on the Comeau C/C++ Online Test Drive +Version 20070107 compiles without problems on the Comeau C/C++ Online Test Drive at http://www.comeaucomputing.com/tryitout in both C90 and C++ mode. *) Compilers on Macintosh @@ -1512,7 +1512,7 @@ for C and C++. *) Other Compilers If you encounter problems on other compilers, feel free to let me know and I may -try to fix it if the compiler is modern standards complient. +try to fix it if the compiler is modern standards compliant. 10. examples