diff --git a/binaries/data/mods/mod/audio/interface/ui/ui_button_click.xml b/binaries/data/mods/mod/audio/interface/ui/ui_button_click.xml index 24027d4809..a55590f747 100644 --- a/binaries/data/mods/mod/audio/interface/ui/ui_button_click.xml +++ b/binaries/data/mods/mod/audio/interface/ui/ui_button_click.xml @@ -11,4 +11,4 @@ audio/interface/ui ui_button_click.ogg ui_button_longclick.ogg - \ No newline at end of file + diff --git a/binaries/data/mods/mod/globalscripts/l10n.js b/binaries/data/mods/mod/globalscripts/l10n.js index 9a3a176081..feb4e216c6 100644 --- a/binaries/data/mods/mod/globalscripts/l10n.js +++ b/binaries/data/mods/mod/globalscripts/l10n.js @@ -116,11 +116,11 @@ function translateMessageObject(object) } /** - * Translates any string value in the specified JavaScript object + * Translates any string value in the specified JavaScript object * that is associated with a key included in the specified keys array. * * it accepts an object in the form of - * + * * { * translatedString1: "my first message", * unTranslatedString1: "some English string", @@ -139,7 +139,7 @@ function translateMessageObject(object) * } * * Together with a keys list to translate the strings and objects - * ["translatedString1", "translatedString2", "translatedObject1", + * ["translatedString1", "translatedString2", "translatedObject1", * "translatedObject2"] * * The result will be (f.e. in Dutch) @@ -151,11 +151,11 @@ function translateMessageObject(object) * unTranslatedString2: "some English string" * }, * translatedObject1: "mijn derde bericht", - * translatedObject2: "lijst, van, teksten", + * translatedObject2: "lijst, van, teksten", * } * * So you see that the keys array can also contain lower-level keys, - * And that you can include objects in the keys array to translate + * And that you can include objects in the keys array to translate * them with a context, or to join a list of translations. * * Also, the keys array may be an object where properties are keys to translate diff --git a/binaries/data/mods/mod/globalscripts/sprintf.js b/binaries/data/mods/mod/globalscripts/sprintf.js index 8191e10a2b..1ebf4cfb26 100644 --- a/binaries/data/mods/mod/globalscripts/sprintf.js +++ b/binaries/data/mods/mod/globalscripts/sprintf.js @@ -223,4 +223,4 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. }) } } -})(typeof window === "undefined" ? this : window); \ No newline at end of file +})(typeof window === "undefined" ? this : window); diff --git a/binaries/data/mods/mod/hwdetect/hwdetect.js b/binaries/data/mods/mod/hwdetect/hwdetect.js index b3de494d7b..71a28ea279 100644 --- a/binaries/data/mods/mod/hwdetect/hwdetect.js +++ b/binaries/data/mods/mod/hwdetect/hwdetect.js @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/binaries/data/mods/public/audio/voice/greek/civ/civ_female_what_is_it.xml b/binaries/data/mods/public/audio/voice/greek/civ/civ_female_what_is_it.xml index c8929f1a79..0e46d5db69 100644 --- a/binaries/data/mods/public/audio/voice/greek/civ/civ_female_what_is_it.xml +++ b/binaries/data/mods/public/audio/voice/greek/civ/civ_female_what_is_it.xml @@ -5,7 +5,7 @@ 1 0 1 - 1 + 1 1 0.8 0.7 diff --git a/binaries/data/mods/public/audio/voice/latin/civ/civ_female_what_is_it.xml b/binaries/data/mods/public/audio/voice/latin/civ/civ_female_what_is_it.xml index ff2e317ee9..33c1c0579d 100644 --- a/binaries/data/mods/public/audio/voice/latin/civ/civ_female_what_is_it.xml +++ b/binaries/data/mods/public/audio/voice/latin/civ/civ_female_what_is_it.xml @@ -5,7 +5,7 @@ 1 0 1 - 1 + 1 1 0.8 0.7 diff --git a/binaries/data/mods/public/audio/voice/latin/civ/civ_male_what_is_it.xml b/binaries/data/mods/public/audio/voice/latin/civ/civ_male_what_is_it.xml index 61bf4b7678..1d4998412f 100644 --- a/binaries/data/mods/public/audio/voice/latin/civ/civ_male_what_is_it.xml +++ b/binaries/data/mods/public/audio/voice/latin/civ/civ_male_what_is_it.xml @@ -5,7 +5,7 @@ 1 0 1 - 1 + 1 1 0.8 0.7 diff --git a/binaries/data/mods/public/globalscripts/Math.js b/binaries/data/mods/public/globalscripts/Math.js index 01054972ef..f8b22aabb3 100644 --- a/binaries/data/mods/public/globalscripts/Math.js +++ b/binaries/data/mods/public/globalscripts/Math.js @@ -1,6 +1,6 @@ /** * Safe, platform consistent implementations of some Math functions - * + * * These functions are implemented in JS to avoid observed differences * between results of different floating point libraries, see * https://bugzilla.mozilla.org/show_bug.cgi?id=531915 @@ -27,11 +27,11 @@ Math.cos = function(a) // if a > pi/2 send a to pi-a, otherwise just send a to -a which has no effect // Using the symmetry cos(x) = -cos(pi-x) to bring a to the 0 to pi/2 range. - a = b*Math.PI - a; + a = b*Math.PI - a; var c = 1 - 2*b; // sign of the output - // Taylor expansion about 0 with a correction term in the quadratic to make cos(pi/2)=0 + // Taylor expansion about 0 with a correction term in the quadratic to make cos(pi/2)=0 return c * (1 - a*a*(0.5000000025619951 - a*a*(1/24 - a*a*(1/720 - a*a*(1/40320 - a*a*(1/3628800 - a*a/479001600)))))); }; @@ -74,7 +74,7 @@ Math.atan = function(a) tanPiBy6Shift = Math.PI/6; a = (a - tanPiBy6) / (1 + tanPiBy6*a); } - // Now a will be in the range [-tan(pi/12), tan(pi/12)] + // Now a will be in the range [-tan(pi/12), tan(pi/12)] // Use the taylor expansion around 0 with a correction to the linear term to match the pi/12 boundary // atan(x) = x - x^3/3 + x^5/5 - ... @@ -198,7 +198,7 @@ Math.exp = function(x) for (var i = 22; i > 0; i--) dPart = 1+x*dPart/i; - // total precision ~=~ 17 decimal digits + // total precision ~=~ 17 decimal digits return iPart*dPart; }; @@ -222,7 +222,7 @@ Math.log = function(x) // start with calculating the binary logarithm // based on http://en.wikipedia.org/wiki/Binary_logarithm#Real_number - // calculate to 50 fractional bits -> error ~=~ 10^-16 + // calculate to 50 fractional bits -> error ~=~ 10^-16 var precisionBits = 50; // calculate integer log, rounded down diff --git a/binaries/data/mods/public/globalscripts/Technologies.js b/binaries/data/mods/public/globalscripts/Technologies.js index b6783e2ab5..1af45a4dc5 100644 --- a/binaries/data/mods/public/globalscripts/Technologies.js +++ b/binaries/data/mods/public/globalscripts/Technologies.js @@ -4,7 +4,7 @@ * any global state, but each context should do its own caching as needed. * Also it cannot directly access the simulation and requires data passed to it. */ - + /** * Returns modified property value modified by the applicable tech * modifications. diff --git a/binaries/data/mods/public/globalscripts/vector.js b/binaries/data/mods/public/globalscripts/vector.js index 77e77471a3..2c8cb51b00 100644 --- a/binaries/data/mods/public/globalscripts/vector.js +++ b/binaries/data/mods/public/globalscripts/vector.js @@ -133,7 +133,7 @@ Vector2D.prototype.distanceTo = function(v) // Static 2D functions // -// Static functions that return a new vector object. +// Static functions that return a new vector object. // Note that object creation is slow in JS, so use them only when necessary Vector2D.clone = function(v) @@ -243,7 +243,7 @@ Vector3D.prototype.normalize = function() var mag = this.length(); if (!mag) return this; - + return this.div(mag); }; @@ -308,7 +308,7 @@ Vector3D.prototype.horizDistanceTo = function(v) // Static 3D functions // -// Static functions that return a new vector object. +// Static functions that return a new vector object. // Note that object creation is slow in JS, so use them only when really necessary Vector3D.clone = function(v) diff --git a/binaries/data/mods/public/maps/scenarios/Eire and Albion.xml b/binaries/data/mods/public/maps/scenarios/Eire and Albion.xml index b9e608b3de..bb684de028 100644 --- a/binaries/data/mods/public/maps/scenarios/Eire and Albion.xml +++ b/binaries/data/mods/public/maps/scenarios/Eire and Albion.xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:390847b7cc49818cfa5b1ca2c3c538b835e97b4cc59bc35d03f0d0fb6ff9fffc -size 2432 +oid sha256:81edd86dd3a785a09eac499477c4341352734efd3d3b87c488d513b07d3a92d8 +size 2433 diff --git a/binaries/data/mods/public/maps/scenarios/Fast Oasis.xml b/binaries/data/mods/public/maps/scenarios/Fast Oasis.xml index d53a3cfbf0..b40c99d11b 100644 --- a/binaries/data/mods/public/maps/scenarios/Fast Oasis.xml +++ b/binaries/data/mods/public/maps/scenarios/Fast Oasis.xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0e4a897481e228f7662be05394572d2cc0295dea5050e3b7ad6ae7ffa84f0b82 -size 224164 +oid sha256:83d94a071e02f59490fda3b7d5d3b2446c2a0f31180c011c2385a967f2f342a4 +size 224165 diff --git a/binaries/data/mods/public/maps/scenarios/Height Map Import - Demo (Fractal).xml b/binaries/data/mods/public/maps/scenarios/Height Map Import - Demo (Fractal).xml index 4985d3e78d..ef9b117564 100644 --- a/binaries/data/mods/public/maps/scenarios/Height Map Import - Demo (Fractal).xml +++ b/binaries/data/mods/public/maps/scenarios/Height Map Import - Demo (Fractal).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1ab69b6aaa8ce07671e452ca7d19f41491cbd3d526916331776a434abd3cfd31 -size 1336 +oid sha256:90babbb0609affac821b5dbd974e1083986957976121c020371a044f8f103461 +size 1337 diff --git a/binaries/data/mods/public/maps/scenarios/Height Map Import - Demo (Greece).xml b/binaries/data/mods/public/maps/scenarios/Height Map Import - Demo (Greece).xml index 808541aeb5..ccdcdbee01 100644 --- a/binaries/data/mods/public/maps/scenarios/Height Map Import - Demo (Greece).xml +++ b/binaries/data/mods/public/maps/scenarios/Height Map Import - Demo (Greece).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7cc10cdabc3fd794179ac361272688003037a15dcbe0be78f2d263048aa7b167 -size 1544 +oid sha256:68f403d8440a3849b29a469c1555efcb1b70f0fa59e8e6d5e0129db9c279afc1 +size 1545 diff --git a/binaries/data/mods/public/maps/scenarios/Height Map Import - Demo (Greece-Small).xml b/binaries/data/mods/public/maps/scenarios/Height Map Import - Demo (Greece-Small).xml index 4c20913c4d..4d84084fdf 100644 --- a/binaries/data/mods/public/maps/scenarios/Height Map Import - Demo (Greece-Small).xml +++ b/binaries/data/mods/public/maps/scenarios/Height Map Import - Demo (Greece-Small).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1c4da406b63c620a1fd9b07db966c7c0dd8dd6c50f19e75e459ed408641ccd01 -size 1443 +oid sha256:740a0348415739a18619e2eac766fe47f69388f3983d32ebfc221d9aa82a74af +size 1444 diff --git a/binaries/data/mods/public/maps/scenarios/Introductory Tutorial.xml b/binaries/data/mods/public/maps/scenarios/Introductory Tutorial.xml index 28a82bf9e6..9fa1ad3555 100644 --- a/binaries/data/mods/public/maps/scenarios/Introductory Tutorial.xml +++ b/binaries/data/mods/public/maps/scenarios/Introductory Tutorial.xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:42278e057e96e03066193de8fbdf5d3722f020e3c5456cb532a6770616c02c96 -size 152339 +oid sha256:b1271296be5a9c1eeb7cd9e92e8475f959fc5a9166bb670187f4a2fc4a45e04a +size 152340 diff --git a/binaries/data/mods/public/maps/scenarios/Polynesia.xml b/binaries/data/mods/public/maps/scenarios/Polynesia.xml index 6ece7ab9b0..91682290d9 100644 --- a/binaries/data/mods/public/maps/scenarios/Polynesia.xml +++ b/binaries/data/mods/public/maps/scenarios/Polynesia.xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5f969c0c4df2944b13d46494c471c61c1be91080d6404ad04e7800454c048a47 -size 76584 +oid sha256:395d227d2a7ea97dc3b5e8053b2b741dda06c0449ddfc3cb157d87c753431c3a +size 76585 diff --git a/binaries/data/mods/public/maps/scenarios/Saharan Oases.xml b/binaries/data/mods/public/maps/scenarios/Saharan Oases.xml index d6444ceeba..a51478fede 100644 --- a/binaries/data/mods/public/maps/scenarios/Saharan Oases.xml +++ b/binaries/data/mods/public/maps/scenarios/Saharan Oases.xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f74f1e228da63ab1612c19a4707bfc4362f13e9eec8dba1b17d23dd3e25466dd -size 485057 +oid sha256:85650d73044ab2a067dcfc11feb825dde62102e1eb50fa1d6148564d79db3627 +size 485058 diff --git a/binaries/data/mods/public/maps/scenarios/Sahel.xml b/binaries/data/mods/public/maps/scenarios/Sahel.xml index bc01bf888f..0f188904b0 100644 --- a/binaries/data/mods/public/maps/scenarios/Sahel.xml +++ b/binaries/data/mods/public/maps/scenarios/Sahel.xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ccc3303686ee4e7276906abdf2c194d3dd287290efb8d98df190de6d8e879a72 -size 628695 +oid sha256:a641b8968a04951042ca9657266ac96f3c8f0dbd75e2dcded5adfda96d5dfcd4 +size 628696 diff --git a/binaries/data/mods/public/maps/scenarios/Sandbox - Mauryans.xml b/binaries/data/mods/public/maps/scenarios/Sandbox - Mauryans.xml index 4c8a46d8e1..e4922bef68 100644 --- a/binaries/data/mods/public/maps/scenarios/Sandbox - Mauryans.xml +++ b/binaries/data/mods/public/maps/scenarios/Sandbox - Mauryans.xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5418c573c0a33012a82b000940923e0a1d134df29b6afaf33dee671d168e4b70 -size 941546 +oid sha256:89106416ee5f6916309fa0bff5baa588a6b3fea5cf8672208308052be6d4d9d2 +size 941547 diff --git a/binaries/data/mods/public/maps/scenarios/Sandbox - Romans.xml b/binaries/data/mods/public/maps/scenarios/Sandbox - Romans.xml index 58b2e79fa2..d15b55f966 100644 --- a/binaries/data/mods/public/maps/scenarios/Sandbox - Romans.xml +++ b/binaries/data/mods/public/maps/scenarios/Sandbox - Romans.xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f439f4a3338b8af8bf56c800ecd8eaf3fffa3033202adeba6ce9d3228cad7d78 -size 359855 +oid sha256:7900f7287ff0413f12357f33bb225658c62da7add9a9410063c3bf2170201d3a +size 359856 diff --git a/binaries/data/mods/public/maps/scenarios/reservoir.xml b/binaries/data/mods/public/maps/scenarios/reservoir.xml index f620b92853..9fc974724f 100644 --- a/binaries/data/mods/public/maps/scenarios/reservoir.xml +++ b/binaries/data/mods/public/maps/scenarios/reservoir.xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ae4e34a51f9a338acee891719f16f6bad04baa0c428f29916d5f1f52a3b87693 -size 12357 +oid sha256:b18b05f1fcab4a1fdc9ad356b332103cae7e325d5c1f24832bd6e4e7723b0eec +size 12358 diff --git a/binaries/data/mods/public/maps/skirmishes/Acropolis Bay (2).xml b/binaries/data/mods/public/maps/skirmishes/Acropolis Bay (2).xml index b962d1f47a..80e04f5ff2 100644 --- a/binaries/data/mods/public/maps/skirmishes/Acropolis Bay (2).xml +++ b/binaries/data/mods/public/maps/skirmishes/Acropolis Bay (2).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1329fd3319ade11d1e86fee2e9da3357e45558d80cd5ac64282e62d588120dff -size 873510 +oid sha256:c189c68e000d52258dbaac38b2da9362871dac4cd69d2c0ee3b9ca59549bd62c +size 873511 diff --git a/binaries/data/mods/public/maps/skirmishes/Alpine_Valleys_(2).xml b/binaries/data/mods/public/maps/skirmishes/Alpine_Valleys_(2).xml index fa90b6dda1..b5fd5ce1fb 100644 --- a/binaries/data/mods/public/maps/skirmishes/Alpine_Valleys_(2).xml +++ b/binaries/data/mods/public/maps/skirmishes/Alpine_Valleys_(2).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2ec7fa98293d970ab7ca9038f4700991295b61186e252f81489acca50e90fb9c -size 443263 +oid sha256:8f15a2f4a028707680f905837152157f96f0ca466c3d09693b7fd757a84ba95a +size 443264 diff --git a/binaries/data/mods/public/maps/skirmishes/Bactria (2).xml b/binaries/data/mods/public/maps/skirmishes/Bactria (2).xml index 9f74f6a2fa..4dd93b8435 100644 --- a/binaries/data/mods/public/maps/skirmishes/Bactria (2).xml +++ b/binaries/data/mods/public/maps/skirmishes/Bactria (2).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6682913cccc68f911c268ba75ce59bef6e2771d231e19d6fc6dfb8794fced70c -size 313998 +oid sha256:26c409d4fd1e0f07cba350f158f70ec38ddcfe845e51becfde8703283b92569c +size 313999 diff --git a/binaries/data/mods/public/maps/skirmishes/Belgian Bog (2).xml b/binaries/data/mods/public/maps/skirmishes/Belgian Bog (2).xml index 85a60b7bf8..6734a0f7cd 100644 --- a/binaries/data/mods/public/maps/skirmishes/Belgian Bog (2).xml +++ b/binaries/data/mods/public/maps/skirmishes/Belgian Bog (2).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fcb88a1d064ab2f781918e7155ece3f62491fd21dd4b51515d66a5411f651ed8 -size 753853 +oid sha256:9347cce9b4252716c0147410266d4024653f7df8f5f96ce294ad16a2cbb97024 +size 753854 diff --git a/binaries/data/mods/public/maps/skirmishes/Caspian Sea (2v2).xml b/binaries/data/mods/public/maps/skirmishes/Caspian Sea (2v2).xml index 8965652f30..1a444c15e9 100644 --- a/binaries/data/mods/public/maps/skirmishes/Caspian Sea (2v2).xml +++ b/binaries/data/mods/public/maps/skirmishes/Caspian Sea (2v2).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:21ceebc4a781dbc89c595ce0c2142f31f17642d33b159d7ceb37142d028ad18f -size 885084 +oid sha256:7d958cae34d7f269eadd0ad98ebdf8c27e8b8b2f2a1b1851e169d80c141fb5fe +size 885085 diff --git a/binaries/data/mods/public/maps/skirmishes/Corinthian Isthmus (4).xml b/binaries/data/mods/public/maps/skirmishes/Corinthian Isthmus (4).xml index df97899a20..968a94c5fb 100644 --- a/binaries/data/mods/public/maps/skirmishes/Corinthian Isthmus (4).xml +++ b/binaries/data/mods/public/maps/skirmishes/Corinthian Isthmus (4).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:28e4f8b36a928b1862b49365e61131f53b1aea33007a1e63c1b06cf0409f0b5c -size 12800 +oid sha256:df3a28b4f47db73318f54c5c6924cc929756e1f4bcb97c37727e5aeafa572d57 +size 12801 diff --git a/binaries/data/mods/public/maps/skirmishes/Death Canyon (2).xml b/binaries/data/mods/public/maps/skirmishes/Death Canyon (2).xml index 5e34443d32..ae8a84c4bb 100644 --- a/binaries/data/mods/public/maps/skirmishes/Death Canyon (2).xml +++ b/binaries/data/mods/public/maps/skirmishes/Death Canyon (2).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2a12fc941514e6cb552d5be79f0a097ebf9a21232acd63a27934d34960c796be -size 597150 +oid sha256:44df0adb3df698310a2257fcb22c131badfef616217132c1770129f2eec289ce +size 597151 diff --git a/binaries/data/mods/public/maps/skirmishes/Deccan Plateau (2).xml b/binaries/data/mods/public/maps/skirmishes/Deccan Plateau (2).xml index 73d66df1fc..33c80d7d53 100644 --- a/binaries/data/mods/public/maps/skirmishes/Deccan Plateau (2).xml +++ b/binaries/data/mods/public/maps/skirmishes/Deccan Plateau (2).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a9789223826607816adf4340259d071eab353833cf5764e9b5533795246d77b5 -size 739609 +oid sha256:3362bbf36517d041f8bde749a9dd4b189fbd0103fb66ce8ce57d13ba3c461035 +size 739610 diff --git a/binaries/data/mods/public/maps/skirmishes/Dueling Cliffs (3v3).xml b/binaries/data/mods/public/maps/skirmishes/Dueling Cliffs (3v3).xml index 0dad1e6198..0841225665 100644 --- a/binaries/data/mods/public/maps/skirmishes/Dueling Cliffs (3v3).xml +++ b/binaries/data/mods/public/maps/skirmishes/Dueling Cliffs (3v3).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6348d0b4d4134b120386b9192a51649477232395cdbed45dbb6b19ad27e2d1b5 -size 686403 +oid sha256:4ff618f43aeab7737a66c24a73224ea61365e4b53c48290acd40521260654fa7 +size 686404 diff --git a/binaries/data/mods/public/maps/skirmishes/Gambia River (3).xml b/binaries/data/mods/public/maps/skirmishes/Gambia River (3).xml index cea5af6028..1b442bdfe1 100644 --- a/binaries/data/mods/public/maps/skirmishes/Gambia River (3).xml +++ b/binaries/data/mods/public/maps/skirmishes/Gambia River (3).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:bfd92db95b41dfc6a83d4ba4b09027d2127d0a96fe90129ec8c968b5c10abf3d -size 2089528 +oid sha256:0bed51ef462c5d3aa13af8994e886ccfc0db459d259e94fdd10d833e8ff7433e +size 2089529 diff --git a/binaries/data/mods/public/maps/skirmishes/Golden Oasis (2).xml b/binaries/data/mods/public/maps/skirmishes/Golden Oasis (2).xml index c6840d7e27..0b8e41e181 100644 --- a/binaries/data/mods/public/maps/skirmishes/Golden Oasis (2).xml +++ b/binaries/data/mods/public/maps/skirmishes/Golden Oasis (2).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:34e5f0053cd41a5be5db55de6ff6747c843da2eecb1611e0458c67349d5b115a -size 384110 +oid sha256:aca24200393f23089be6f2796c5bfc18fa6e2a896523d6a56dce4a6e5af16578 +size 384111 diff --git a/binaries/data/mods/public/maps/skirmishes/Libyan Oases (4).xml b/binaries/data/mods/public/maps/skirmishes/Libyan Oases (4).xml index 3ecb505cb3..0cb99b69b4 100644 --- a/binaries/data/mods/public/maps/skirmishes/Libyan Oases (4).xml +++ b/binaries/data/mods/public/maps/skirmishes/Libyan Oases (4).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4b2fe103ba48dee538ccc2a702b8325076e903a5574747bb95d3295fccc32e89 -size 535654 +oid sha256:06bef5e457ab8f8fe0feed8fe336f19c3327a6efe4863940ed26d9347ae9dbaf +size 535655 diff --git a/binaries/data/mods/public/maps/skirmishes/Lorraine Plain (2).xml b/binaries/data/mods/public/maps/skirmishes/Lorraine Plain (2).xml index 1ab64c8958..af32df4ec3 100644 --- a/binaries/data/mods/public/maps/skirmishes/Lorraine Plain (2).xml +++ b/binaries/data/mods/public/maps/skirmishes/Lorraine Plain (2).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f144ac340c6e7be8fc58f4ec03e59d18239c8b4942e78d2cc0ecd0fb367c2ce6 -size 548852 +oid sha256:0a32f37c7c762fc0ffaa6afaa54ac1f6b20f72d6cbefdf0e7fe0cd78cc9cbf0c +size 548853 diff --git a/binaries/data/mods/public/maps/skirmishes/Neareastern Badlands (2).xml b/binaries/data/mods/public/maps/skirmishes/Neareastern Badlands (2).xml index fe08678c24..592f783545 100644 --- a/binaries/data/mods/public/maps/skirmishes/Neareastern Badlands (2).xml +++ b/binaries/data/mods/public/maps/skirmishes/Neareastern Badlands (2).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:10bb21ff644c8ccb5ad2d1787dc678340561690399d578ae8c49c354e91e99c2 -size 389233 +oid sha256:eaf268e992d3f598de54f2df165389702bde7bdb63de2bea1ab486c42cf39a22 +size 389234 diff --git a/binaries/data/mods/public/maps/skirmishes/Neareastern Badlands (4).xml b/binaries/data/mods/public/maps/skirmishes/Neareastern Badlands (4).xml index cb50c25d40..0708f96a49 100644 --- a/binaries/data/mods/public/maps/skirmishes/Neareastern Badlands (4).xml +++ b/binaries/data/mods/public/maps/skirmishes/Neareastern Badlands (4).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:df478a7fe5f54da39e5b3ae10fa7cfac57e0a85b7d4625f42886685010cfc5b7 -size 491264 +oid sha256:0a879cdefcaec4230938e55d451faa64fb6e3aec669d9054d659bdb54dcf2225 +size 491265 diff --git a/binaries/data/mods/public/maps/skirmishes/Northern Island (2).xml b/binaries/data/mods/public/maps/skirmishes/Northern Island (2).xml index c509c0d0d4..a5a77cbf83 100644 --- a/binaries/data/mods/public/maps/skirmishes/Northern Island (2).xml +++ b/binaries/data/mods/public/maps/skirmishes/Northern Island (2).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:df8b796376e05a072f10ab95cf99638a5916b29dbc953f2596182f9c425d13a5 -size 192181 +oid sha256:ca16f5179fd37135ee3159b18a0331e056fa25a709a35ee29d94bc0aedfe732b +size 192182 diff --git a/binaries/data/mods/public/maps/skirmishes/Persian Highlands (4).xml b/binaries/data/mods/public/maps/skirmishes/Persian Highlands (4).xml index e81c9d7116..a4fe0b09cc 100644 --- a/binaries/data/mods/public/maps/skirmishes/Persian Highlands (4).xml +++ b/binaries/data/mods/public/maps/skirmishes/Persian Highlands (4).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:fc64d91e8bf384fa84d1ef6641ed822501d18ae5e5f51764da597ac02f619bcb -size 446008 +oid sha256:7267b26298b7099440e7b1eab0c746835fdcce1bffe918f7819a0fbcac55a730 +size 446009 diff --git a/binaries/data/mods/public/maps/skirmishes/Punbjab (2).xml b/binaries/data/mods/public/maps/skirmishes/Punbjab (2).xml index d97c44f24e..da03eeff6a 100644 --- a/binaries/data/mods/public/maps/skirmishes/Punbjab (2).xml +++ b/binaries/data/mods/public/maps/skirmishes/Punbjab (2).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:5190154eb11d578848264d6a5b0cb01009180ee4ce2c1fa142a6b9492a480f00 -size 938294 +oid sha256:b83a441630c5d7a4da4f87ef3da51b369ee15086543b4591267e5ba0a1b4991a +size 938295 diff --git a/binaries/data/mods/public/maps/skirmishes/Saharan Oases (4).xml b/binaries/data/mods/public/maps/skirmishes/Saharan Oases (4).xml index db38786cfb..b4c1bd2060 100644 --- a/binaries/data/mods/public/maps/skirmishes/Saharan Oases (4).xml +++ b/binaries/data/mods/public/maps/skirmishes/Saharan Oases (4).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a4d499489c90ff474b12f4b7b55b15ede88a5fb253c9445e9eac57c809a1f57a -size 509629 +oid sha256:4e2ada8cdd2233d818e45dcbc55f80f06d3f4c1009bb123cbbfc7bbe8713d46a +size 509630 diff --git a/binaries/data/mods/public/maps/skirmishes/Sahel (4).xml b/binaries/data/mods/public/maps/skirmishes/Sahel (4).xml index b632b507d0..edaaa7b777 100644 --- a/binaries/data/mods/public/maps/skirmishes/Sahel (4).xml +++ b/binaries/data/mods/public/maps/skirmishes/Sahel (4).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:31dc7557360b34c15bec752630f011b5eba786a27d8be56b3a552d2da5260414 -size 681871 +oid sha256:629aa85eb254d132880f385a9ff59084467193d1ce99765fafc64745ff0c2b2a +size 681872 diff --git a/binaries/data/mods/public/maps/skirmishes/Savanna River.xml b/binaries/data/mods/public/maps/skirmishes/Savanna River.xml index b073585fcb..8a20bcbd57 100644 --- a/binaries/data/mods/public/maps/skirmishes/Savanna River.xml +++ b/binaries/data/mods/public/maps/skirmishes/Savanna River.xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4475388b14963fd529fa724320af6b66e7e6748ec60efcba1d189ceca7cb4daf -size 893567 +oid sha256:1be242f9bc9b74a84b33b2468294aa161db08a0ed5a8289acde6a9b6b96beb82 +size 893568 diff --git a/binaries/data/mods/public/maps/skirmishes/Sicilia (2).xml b/binaries/data/mods/public/maps/skirmishes/Sicilia (2).xml index 380b2cb70b..804b0d0775 100644 --- a/binaries/data/mods/public/maps/skirmishes/Sicilia (2).xml +++ b/binaries/data/mods/public/maps/skirmishes/Sicilia (2).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:091b7e35ad51726268bb27558074f585493de282cf031362e892493ca66196de -size 519799 +oid sha256:445a5ace2dc6a9da23335431e414ad23a3d186761fe95bc432a5c3c3d4dfed45 +size 519800 diff --git a/binaries/data/mods/public/maps/skirmishes/Siwa Oasis (2).xml b/binaries/data/mods/public/maps/skirmishes/Siwa Oasis (2).xml index 836d91332b..9ff2f3b353 100644 --- a/binaries/data/mods/public/maps/skirmishes/Siwa Oasis (2).xml +++ b/binaries/data/mods/public/maps/skirmishes/Siwa Oasis (2).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c9df1f5eb97d1e19e7bb55982ca644565d39197f75a724cacc0e9cd4be8035ee -size 601446 +oid sha256:0b042a499d4a33374656919ec576da65b854c00402d1185562fa3ad3b8acf0a0 +size 601447 diff --git a/binaries/data/mods/public/maps/skirmishes/Syria (2).xml b/binaries/data/mods/public/maps/skirmishes/Syria (2).xml index 089daa0e1a..db7bcca69d 100644 --- a/binaries/data/mods/public/maps/skirmishes/Syria (2).xml +++ b/binaries/data/mods/public/maps/skirmishes/Syria (2).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b53082ca0adab2b9f2d7430fd18e14a7c9d084670203a64af629aefdf9dc648f -size 845670 +oid sha256:c534b1497ae87108ba288db2d66cc0e988295543b5163ca308bfe997b4cfbb6f +size 845671 diff --git a/binaries/data/mods/public/maps/skirmishes/Team Oasis - 2v2.xml b/binaries/data/mods/public/maps/skirmishes/Team Oasis - 2v2.xml index 50f0db6638..2368e0dd12 100644 --- a/binaries/data/mods/public/maps/skirmishes/Team Oasis - 2v2.xml +++ b/binaries/data/mods/public/maps/skirmishes/Team Oasis - 2v2.xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a15491415665ecc0e5d35947080c7dbb7c534958d4cff26734d58fab506bb4aa -size 391395 +oid sha256:c6f5f3b239c18fe9268ca03bc8e9266c48724c5223830a64b2bd2855c3b284df +size 391396 diff --git a/binaries/data/mods/public/maps/skirmishes/Watering Holes (4).xml b/binaries/data/mods/public/maps/skirmishes/Watering Holes (4).xml index 72eba860b0..9f4721308a 100644 --- a/binaries/data/mods/public/maps/skirmishes/Watering Holes (4).xml +++ b/binaries/data/mods/public/maps/skirmishes/Watering Holes (4).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:93dd26ff934834ee67d34dd14026e571d71c1740d83a6d5ec56447e4d8c75211 -size 494034 +oid sha256:71790b5b4df8f912fae07734273ba567655802e3df95ab7b6f358707916a9915 +size 494035 diff --git a/binaries/data/mods/public/maps/skirmishes/Zagros Mountains (2).xml b/binaries/data/mods/public/maps/skirmishes/Zagros Mountains (2).xml index 1451d6a1b1..66d91958da 100644 --- a/binaries/data/mods/public/maps/skirmishes/Zagros Mountains (2).xml +++ b/binaries/data/mods/public/maps/skirmishes/Zagros Mountains (2).xml @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:9ce75f6f83d85a4c547f5373f679f67f92f267fd6a9ea70b7c4fa7b0d199b863 -size 714472 +oid sha256:0e8eb071ae2454073827157670f69b2b0036f4e3b7c87fd69ef6433526292aca +size 714473 diff --git a/binaries/data/mods/public/shaders/arb/overlayline.xml b/binaries/data/mods/public/shaders/arb/overlayline.xml index c0b46f1563..eeb8ca02ba 100644 --- a/binaries/data/mods/public/shaders/arb/overlayline.xml +++ b/binaries/data/mods/public/shaders/arb/overlayline.xml @@ -1,12 +1,12 @@ - - + diff --git a/binaries/data/mods/public/shaders/effects/model_transparent.xml b/binaries/data/mods/public/shaders/effects/model_transparent.xml index b4187a9b7d..2f2fb63ef8 100644 --- a/binaries/data/mods/public/shaders/effects/model_transparent.xml +++ b/binaries/data/mods/public/shaders/effects/model_transparent.xml @@ -111,7 +111,7 @@ - + diff --git a/binaries/data/mods/public/shaders/effects/sky_simple.xml b/binaries/data/mods/public/shaders/effects/sky_simple.xml index d58f93b543..8453d4043a 100644 --- a/binaries/data/mods/public/shaders/effects/sky_simple.xml +++ b/binaries/data/mods/public/shaders/effects/sky_simple.xml @@ -1,6 +1,6 @@ - + diff --git a/binaries/data/mods/public/simulation/ai/common-api/filters.js b/binaries/data/mods/public/simulation/ai/common-api/filters.js index ecabdb16d1..77d85536be 100644 --- a/binaries/data/mods/public/simulation/ai/common-api/filters.js +++ b/binaries/data/mods/public/simulation/ai/common-api/filters.js @@ -8,38 +8,38 @@ m.Filters = { }, "dynamicProperties": []}; }, - + byClass: function(cls){ return {"func" : function(ent){ return ent.hasClass(cls); }, "dynamicProperties": []}; }, - + byClassesAnd: function(clsList){ return {"func" : function(ent){ let ret = true; for (let cls of clsList) ret = ret && ent.hasClass(cls); return ret; - }, + }, "dynamicProperties": []}; }, - + byClassesOr: function(clsList){ return {"func" : function(ent){ let ret = false; for (let cls of clsList) ret = ret || ent.hasClass(cls); return ret; - }, + }, "dynamicProperties": []}; }, byMetadata: function(player, key, value){ return {"func" : function(ent){ return ent.getMetadata(player, key) == value; - }, + }, "dynamicProperties": ['metadata.' + key]}; }, @@ -50,7 +50,7 @@ m.Filters = { }, "dynamicProperties": []}; }, - + byHasMetadata: function(player, key){ return {"func" : function(ent){ return ent.getMetadata(player, key) !== undefined; @@ -61,45 +61,45 @@ m.Filters = { and: function(filter1, filter2){ return {"func": function(ent){ return filter1.func(ent) && filter2.func(ent); - }, + }, "dynamicProperties": filter1.dynamicProperties.concat(filter2.dynamicProperties)}; }, - + or: function(filter1, filter2){ return {"func" : function(ent){ return filter1.func(ent) || filter2.func(ent); - }, + }, "dynamicProperties": filter1.dynamicProperties.concat(filter2.dynamicProperties)}; }, - + not: function(filter){ return {"func": function(ent){ return !filter.func(ent); }, "dynamicProperties": filter.dynamicProperties}; }, - + byOwner: function(owner){ return {"func" : function(ent){ return ent.owner() === owner; - }, + }, "dynamicProperties": ['owner']}; }, - + byNotOwner: function(owner){ return {"func" : function(ent){ return ent.owner() !== owner; - }, + }, "dynamicProperties": ['owner']}; }, - + byOwners: function(owners){ return {"func" : function(ent){ for (let owner of owners) if (ent.owner() === owner) return true; return false; - }, + }, "dynamicProperties": ['owner']}; }, @@ -112,7 +112,7 @@ m.Filters = { byTrainingQueue: function(){ return {"func" : function(ent){ return ent.trainingQueue(); - }, + }, "dynamicProperties": ['trainingQueue']}; }, byResearchAvailable: function(civ){ @@ -127,14 +127,14 @@ m.Filters = { }, "dynamicProperties": ['unitAIOrderData']}; }, - + byCanAttack: function(saidClass){ return {"func" : function(ent){ return ent.canAttackClass(saidClass); }, "dynamicProperties": []}; }, - + isGarrisoned: function(){ return {"func" : function(ent){ return ent.position() === undefined; @@ -145,17 +145,17 @@ m.Filters = { isSoldier: function(){ return {"func" : function(ent){ return Filters.byClassesOr(["CitizenSoldier", "Super"])(ent); - }, + }, "dynamicProperties": []}; }, - + isIdle: function(){ return {"func" : function(ent){ return ent.isIdle(); - }, + }, "dynamicProperties": ['idle']}; }, - + isFoundation: function(){ return {"func": function(ent){ return ent.foundationProgress() !== undefined; @@ -185,8 +185,8 @@ m.Filters = { }, "dynamicProperties": ['position']}; }, - - // Distance filter with no auto updating, use with care + + // Distance filter with no auto updating, use with care byStaticDistance: function(startPoint, dist){ return {"func": function(ent){ if (!ent.position()) @@ -195,7 +195,7 @@ m.Filters = { }, "dynamicProperties": []}; }, - + byTerritory: function(Map, territoryIndex){ return {"func": function(ent){ return Map.point(ent.position()) == territoryIndex; @@ -209,7 +209,7 @@ m.Filters = { }, "dynamicProperties": []}; }, - + byResource: function(resourceType){ return {"func" : function(ent){ if (!ent.resourceSupplyMax()) @@ -224,7 +224,7 @@ m.Filters = { return false; // Don't go for floating treasures since we won't be able to reach them and it kills the pathfinder. - if (ent.templateName() == "other/special_treasure_shipwreck_debris" || + if (ent.templateName() == "other/special_treasure_shipwreck_debris" || ent.templateName() == "other/special_treasure_shipwreck" ) return false; @@ -245,7 +245,7 @@ m.Filters = { // Skip targets that are too hard to hunt if (!ent.isHuntable()) return false; - // And don't go for the fish! TODO: better accessibility checks + // And don't go for the fish! TODO: better accessibility checks if (ent.hasClass("SeaCreature")) return false; return true; diff --git a/binaries/data/mods/public/simulation/ai/common-api/gamestate.js b/binaries/data/mods/public/simulation/ai/common-api/gamestate.js index 0af5658105..32669ef336 100644 --- a/binaries/data/mods/public/simulation/ai/common-api/gamestate.js +++ b/binaries/data/mods/public/simulation/ai/common-api/gamestate.js @@ -85,7 +85,7 @@ m.GameState.prototype.updatingGlobalCollection = function(id, filter, collection let newCollection = collection !== undefined ? collection.filter(filter) : this.entities.filter(filter); newCollection.registerUpdates(); - this.EntCollecNames.set(id, newCollection); + this.EntCollecNames.set(id, newCollection); return newCollection; }; @@ -212,11 +212,11 @@ m.GameState.prototype.canResearch = function(techTemplateName, noRequirementChec if (noRequirementCheck === true) return true; - + // not already researched, check if we can. // basically a copy of the function in technologyManager since we can't use it. // Checks the requirements for a technology to see if it can be researched at the current time - + // The technology which this technology supersedes is required if (template.supersedes() && !this.playerData.researchedTechs[template.supersedes()]) return false; @@ -243,7 +243,7 @@ m.GameState.prototype.checkTechRequirements = function(reqs) // If there are no requirements then all requirements are met if (!reqs) return true; - + if (reqs.all) return reqs.all.every(r => this.checkTechRequirements(r)); if (reqs.any) @@ -255,12 +255,12 @@ m.GameState.prototype.checkTechRequirements = function(reqs) if (reqs.tech) return this.playerData.researchedTechs[reqs.tech] !== undefined && this.playerData.researchedTechs[reqs.tech]; if (reqs.class && reqs.numberOfTypes) - return this.playerData.typeCountsByClass[reqs.class] && + return this.playerData.typeCountsByClass[reqs.class] && Object.keys(this.playerData.typeCountsByClass[reqs.class]).length >= reqs.numberOfTypes; if (reqs.class && reqs.number) return this.playerData.classCounts[reqs.class] && this.playerData.classCounts[reqs.class] >= reqs.number; - + // The technologies requirements are not a recognised format error("Bad requirements " + uneval(reqs)); return false; @@ -404,7 +404,7 @@ m.GameState.prototype.isEntityEnemy = function(ent) return false; return this.playerData.isEnemy[ent.owner()]; }; - + m.GameState.prototype.isEntityOwn = function(ent) { if (!ent) @@ -681,7 +681,7 @@ m.GameState.prototype.findTrainableUnits = function(classes, anticlasses) let template = this.getTemplate(trainable); if (!template || !template.available(this)) continue; - + let okay = true; for (let clas of classes) { @@ -718,7 +718,7 @@ m.GameState.prototype.findTrainableUnits = function(classes, anticlasses) * If there are pairs, both techs are returned. */ m.GameState.prototype.findAvailableTech = function() -{ +{ let allResearchable = []; let civ = this.playerData.civ; this.getOwnEntities().forEach(function(ent) { @@ -754,7 +754,7 @@ m.GameState.prototype.findAvailableTech = function() * Return true if we have a building able to train that template */ m.GameState.prototype.hasTrainer = function(template) -{ +{ let civ = this.playerData.civ; for (let ent of this.getOwnTrainingFacilities().values()) { @@ -769,7 +769,7 @@ m.GameState.prototype.hasTrainer = function(template) * Find buildings able to train that template. */ m.GameState.prototype.findTrainers = function(template) -{ +{ let civ = this.playerData.civ; return this.getOwnTrainingFacilities().filter(function(ent) { let trainable = ent.trainableEntities(civ); diff --git a/binaries/data/mods/public/simulation/ai/common-api/map-module.js b/binaries/data/mods/public/simulation/ai/common-api/map-module.js index c48b5798b4..b41160daa6 100644 --- a/binaries/data/mods/public/simulation/ai/common-api/map-module.js +++ b/binaries/data/mods/public/simulation/ai/common-api/map-module.js @@ -65,10 +65,10 @@ m.Map.prototype.addInfluence = function(cx, cy, maxDist, strength, type = "linea // code duplicating for speed if (type === "linear") { - let str = strength / maxDist; + let str = strength / maxDist; for (let y = y0; y < y1; ++y) { - let dy = y - cy; + let dy = y - cy; for (let x = x0; x < x1; ++x) { let dx = x - cx; @@ -91,7 +91,7 @@ m.Map.prototype.addInfluence = function(cx, cy, maxDist, strength, type = "linea let str = strength / maxDist2; for (let y = y0; y < y1; ++y) { - let dy = y - cy; + let dy = y - cy; for (let x = x0; x < x1; ++x) { let dx = x - cx; @@ -99,7 +99,7 @@ m.Map.prototype.addInfluence = function(cx, cy, maxDist, strength, type = "linea if (r2 >= maxDist2) continue; let quant = str * (maxDist2 - r2); - let w = x + y * this.width; + let w = x + y * this.width; if (this.map[w] + quant < 0) this.map[w] = 0; else if (this.map[w] + quant > this.maxVal) @@ -120,7 +120,7 @@ m.Map.prototype.addInfluence = function(cx, cy, maxDist, strength, type = "linea let r2 = dx*dx + dy*dy; if (r2 >= maxDist2) continue; - let w = x + y * this.width; + let w = x + y * this.width; if (this.map[w] + strength < 0) this.map[w] = 0; else if (this.map[w] + strength > this.maxVal) diff --git a/binaries/data/mods/public/simulation/ai/common-api/shared.js b/binaries/data/mods/public/simulation/ai/common-api/shared.js index b7566b3130..cbfb9dbe6b 100644 --- a/binaries/data/mods/public/simulation/ai/common-api/shared.js +++ b/binaries/data/mods/public/simulation/ai/common-api/shared.js @@ -81,7 +81,7 @@ m.g_ResourceForbiddenComponents = { }; m.SharedScript.prototype.GetTemplate = function(name) -{ +{ if (this._templates[name]) return this._templates[name]; @@ -92,24 +92,24 @@ m.SharedScript.prototype.GetTemplate = function(name) if (name.indexOf("foundation|") !== -1) { let base = this.GetTemplate(name.substr(11)); - + let foundation = {}; for (let key in base) if (!m.g_FoundationForbiddenComponents[key]) foundation[key] = base[key]; - + this._derivedTemplates[name] = foundation; return foundation; } else if (name.indexOf("resource|") !== -1) { let base = this.GetTemplate(name.substr(9)); - + let resource = {}; for (let key in base) if (!m.g_ResourceForbiddenComponents[key]) resource[key] = base[key]; - + this._derivedTemplates[name] = resource; return resource; } @@ -234,13 +234,13 @@ m.SharedScript.prototype.onUpdate = function(state) this.passabilityMap.cellSize = this.mapSize / this.passabilityMap.width; this.territoryMap = state.territoryMap; this.territoryMap.cellSize = this.mapSize / this.territoryMap.width; - + for (let i in this.gameState) this.gameState[i].update(this); // TODO: merge this with "ApplyEntitiesDelta" since after all they do the same. this.updateResourceMaps(this.events); - + Engine.ProfileStop(); }; @@ -249,7 +249,7 @@ m.SharedScript.prototype.ApplyEntitiesDelta = function(state) Engine.ProfileStart("Shared ApplyEntitiesDelta"); let foundationFinished = {}; - + // by order of updating: // we "Destroy" last because we want to be able to switch Metadata first. @@ -263,7 +263,7 @@ m.SharedScript.prototype.ApplyEntitiesDelta = function(state) let entity = new m.Entity(this, state.entities[evt.entity]); this._entities.set(evt.entity, entity); this.entities.addEnt(entity); - + // Update all the entity collections since the create operation affects static properties as well as dynamic for (let entCol of this._entityCollections.values()) entCol.updateEnt(entity); @@ -305,7 +305,7 @@ m.SharedScript.prototype.ApplyEntitiesDelta = function(state) for (let key in evt.metadata) this.setMetadata(evt.owner, this._entities.get(evt.id), key, evt.metadata[key]); } - + let DestroyEvents = state.events.Destroy; for (let i = 0; i < DestroyEvents.length; ++i) { @@ -447,7 +447,7 @@ m.SharedScript.prototype.deleteMetadata = function(player, ent, key) return true; metadata[key] = undefined; delete metadata[key]; - this.updateEntityCollections('metadata', ent); + this.updateEntityCollections('metadata', ent); this.updateEntityCollections('metadata.' + key, ent); return true; }; diff --git a/binaries/data/mods/public/simulation/ai/common-api/technology.js b/binaries/data/mods/public/simulation/ai/common-api/technology.js index 09f650478e..14788a768a 100644 --- a/binaries/data/mods/public/simulation/ai/common-api/technology.js +++ b/binaries/data/mods/public/simulation/ai/common-api/technology.js @@ -136,7 +136,7 @@ m.Technology.prototype.isAffected = function(classes) { if (!this._template.affects) return false; - + for (let affect of this._template.affects) { let reqClasses = affect.split(" "); diff --git a/binaries/data/mods/public/simulation/ai/common-api/terrain-analysis.js b/binaries/data/mods/public/simulation/ai/common-api/terrain-analysis.js index 0639911fff..beae877667 100644 --- a/binaries/data/mods/public/simulation/ai/common-api/terrain-analysis.js +++ b/binaries/data/mods/public/simulation/ai/common-api/terrain-analysis.js @@ -3,7 +3,7 @@ var API3 = function(m) /** * TerrainAnalysis, inheriting from the Map Component. - * + * * This creates a suitable passability map. * This is part of the Shared Script, and thus should only be used for things that are non-player specific. * This.map is a map of the world, where particular stuffs are pointed with a value @@ -36,12 +36,12 @@ m.TerrainAnalysis.prototype.init = function(sharedScript, rawState) 201 is shallow water (passable by land units and water units) 255 is land (or extremely shallow water where ships can't go). */ - + for (let i = 0; i < passabilityMap.data.length; ++i) { // If impassable for land units, set to 0, else to 255. obstructionTiles[i] = (passabilityMap.data[i] & obstructionMaskLand) ? 0 : 255; - + if (!(passabilityMap.data[i] & obstructionMaskWater) && obstructionTiles[i] === 0) obstructionTiles[i] = 200; // if navigable and not walkable (ie basic water), set to 200. else if (!(passabilityMap.data[i] & obstructionMaskWater) && obstructionTiles[i] === 255) @@ -53,14 +53,14 @@ m.TerrainAnalysis.prototype.init = function(sharedScript, rawState) /** * Accessibility inherits from TerrainAnalysis - * + * * This can easily and efficiently determine if any two points are connected. * it can also determine if any point is "probably" reachable, assuming the unit can get close enough * for optimizations it's called after the TerrainAnalyser has finished initializing his map * so this can use the land regions already. */ m.Accessibility = function() -{ +{ }; m.copyPrototype(m.Accessibility, m.TerrainAnalysis); @@ -76,12 +76,12 @@ m.Accessibility.prototype.init = function(rawState, terrainAnalyser) this.regionType = []; // "inaccessible", "land" or "water"; // ID of the region associated with an array of region IDs. this.regionLinks = []; - + // initialized to 0, it's more optimized to start at 1 (I'm checking that if it's not 0, then it's already aprt of a region, don't touch); // However I actually store all unpassable as region 1 (because if I don't, on some maps the toal nb of region is over 256, and it crashes as the mapis 8bit.) // So start at 2. this.regionID = 2; - + for (let i = 0; i < this.landPassMap.length; ++i) { if (this.map[i] !== 0) @@ -97,7 +97,7 @@ m.Accessibility.prototype.init = function(rawState, terrainAnalyser) this.floodFill(i,1,true); } } - + // calculating region links. Regions only touching diagonaly are not linked. // since we're checking all of them, we'll check from the top left to the bottom right let w = this.width; @@ -135,7 +135,7 @@ m.Accessibility.prototype.init = function(rawState, terrainAnalyser) } } } - + //Engine.DumpImage("LandPassMap.png", this.landPassMap, this.width, this.height, 255); //Engine.DumpImage("NavalPassMap.png", this.navalPassMap, this.width, this.height, 255); }; @@ -276,7 +276,7 @@ m.Accessibility.prototype.floodFill = function(startIndex, value, onWater) this.landPassMap[startIndex] = 1; // impassable for land return false; } - + // here we'll be able to start. for (let i = this.regionSize.length; i <= value; ++i) { @@ -292,7 +292,7 @@ m.Accessibility.prototype.floodFill = function(startIndex, value, onWater) let IndexArray = [startIndex]; let newIndex; while(IndexArray.length) - { + { newIndex = IndexArray.pop(); y = 0; @@ -317,7 +317,7 @@ m.Accessibility.prototype.floodFill = function(startIndex, value, onWater) let index; do { index = newIndex + w*y; - + if (floodFor === "land" && this.landPassMap[index] === 0 && this.map[index] !== 0 && this.map[index] !== 200) { this.landPassMap[index] = value; @@ -330,7 +330,7 @@ m.Accessibility.prototype.floodFill = function(startIndex, value, onWater) } else break; - + if (index%w > 0) { if (floodFor === "land" && this.landPassMap[index -1] === 0 && this.map[index -1] !== 0 && this.map[index -1] !== 200) diff --git a/binaries/data/mods/public/simulation/ai/common-api/utils.js b/binaries/data/mods/public/simulation/ai/common-api/utils.js index c989cb3dc9..af58efd44a 100644 --- a/binaries/data/mods/public/simulation/ai/common-api/utils.js +++ b/binaries/data/mods/public/simulation/ai/common-api/utils.js @@ -97,7 +97,7 @@ m.getMapIndices = function(i, map1, map2) }; /** - * Returns the list of points of map2 contained inside the cell i of map1 + * Returns the list of points of map2 contained inside the cell i of map1 * map1.cellSize must be a multiple of map2.cellSize */ m.getMapPoints = function(i, map1, map2) diff --git a/binaries/data/mods/public/simulation/ai/petra/army.js b/binaries/data/mods/public/simulation/ai/petra/army.js index e6e0e7de60..8f571b882a 100644 --- a/binaries/data/mods/public/simulation/ai/petra/army.js +++ b/binaries/data/mods/public/simulation/ai/petra/army.js @@ -259,7 +259,7 @@ m.Army.prototype.isCapturing = function (gameState) return false; let ent = gameState.getEntityById(this.foeEntities[0]); return ent && ent.hasClass("Structure"); -}; +}; /** * this one is "undefined entity" proof because it's called at odd times. @@ -305,7 +305,7 @@ m.Army.prototype.merge = function (gameState, otherArmy) } for (let i in otherArmy.assignedTo) this.assignedTo[i] = otherArmy.assignedTo[i]; - + for (let id of otherArmy.foeEntities) this.addFoe(gameState, id, true); // TODO: reassign those ? @@ -314,7 +314,7 @@ m.Army.prototype.merge = function (gameState, otherArmy) this.recalculatePosition(gameState, true); this.recalculateStrengths(gameState); - + return true; }; @@ -395,7 +395,7 @@ m.Army.prototype.onUpdate = function (gameState) let breakaways = []; // TODO: assign unassigned defenders, cleanup of a few things. // perhaps occasional strength recomputation - + // occasional update or breakaways, positions… if (gameState.ai.elapsedTime - this.positionLastUpdate > 5) { diff --git a/binaries/data/mods/public/simulation/ai/petra/attackManager.js b/binaries/data/mods/public/simulation/ai/petra/attackManager.js index 47fcf08641..673899a76f 100644 --- a/binaries/data/mods/public/simulation/ai/petra/attackManager.js +++ b/binaries/data/mods/public/simulation/ai/petra/attackManager.js @@ -362,7 +362,7 @@ m.AttackManager.prototype.getEnemyPlayer = function(gameState, attack) let veto = {}; for (let i in this.defeated) veto[i] = true; - // No rush if enemy too well defended (i.e. iberians) + // No rush if enemy too well defended (i.e. iberians) if (attack.type === "Rush") { for (let i = 1; i < gameState.sharedScript.playersData.length; ++i) diff --git a/binaries/data/mods/public/simulation/ai/petra/baseManager.js b/binaries/data/mods/public/simulation/ai/petra/baseManager.js index 1c823c74a6..c8226971a2 100644 --- a/binaries/data/mods/public/simulation/ai/petra/baseManager.js +++ b/binaries/data/mods/public/simulation/ai/petra/baseManager.js @@ -24,7 +24,7 @@ m.BaseManager = function(gameState, Config) this.accessIndex = undefined; // Maximum distance (from any dropsite) to look for resources - // 3 areas are used: from 0 to max/4, from max/4 to max/2 and from max/2 to max + // 3 areas are used: from 0 to max/4, from max/4 to max/2 and from max/2 to max this.maxDistResourceSquare = 360*360; this.constructing = false; @@ -45,7 +45,7 @@ m.BaseManager.prototype.init = function(gameState, state) // entitycollections this.units = gameState.getOwnUnits().filter(API3.Filters.byMetadata(PlayerID, "base", this.ID)); this.workers = this.units.filter(API3.Filters.byMetadata(PlayerID, "role", "worker")); - this.buildings = gameState.getOwnStructures().filter(API3.Filters.byMetadata(PlayerID, "base", this.ID)); + this.buildings = gameState.getOwnStructures().filter(API3.Filters.byMetadata(PlayerID, "base", this.ID)); this.units.registerUpdates(); this.workers.registerUpdates(); @@ -134,7 +134,7 @@ m.BaseManager.prototype.checkEvents = function (gameState, events, queues) continue; if (evt.newentity == evt.entity) // repaired building continue; - + if (ent.getMetadata(PlayerID, "base") == this.ID) if (ent.resourceDropsiteTypes() && !ent.hasClass("Elephant")) this.assignResourceToDropsite(gameState, ent); @@ -238,7 +238,7 @@ m.BaseManager.prototype.assignResourceToDropsite = function (gameState, dropsite if (dist < maxDistResourceSquare) { if (dist < maxDistResourceSquare/16) // distmax/4 - nearby.push({ "dropsite": dropsiteId, "id": supply.id(), "ent": supply, "dist": dist }); + nearby.push({ "dropsite": dropsiteId, "id": supply.id(), "ent": supply, "dist": dist }); else if (dist < maxDistResourceSquare/4) // distmax/2 medium.push({ "dropsite": dropsiteId, "id": supply.id(), "ent": supply, "dist": dist }); else @@ -253,13 +253,13 @@ m.BaseManager.prototype.assignResourceToDropsite = function (gameState, dropsite /* let debug = false; if (debug) { - faraway.forEach(function(res){ + faraway.forEach(function(res){ Engine.PostCommand(PlayerID,{"type": "set-shading-color", "entities": [res.ent.id()], "rgb": [2,0,0]}); }); - medium.forEach(function(res){ + medium.forEach(function(res){ Engine.PostCommand(PlayerID,{"type": "set-shading-color", "entities": [res.ent.id()], "rgb": [0,2,0]}); }); - nearby.forEach(function(res){ + nearby.forEach(function(res){ Engine.PostCommand(PlayerID,{"type": "set-shading-color", "entities": [res.ent.id()], "rgb": [0,0,2]}); }); } */ @@ -304,11 +304,11 @@ m.BaseManager.prototype.removeDropsite = function (gameState, ent) }; /** - * Returns the position of the best place to build a new dropsite for the specified resource + * Returns the position of the best place to build a new dropsite for the specified resource */ m.BaseManager.prototype.findBestDropsiteLocation = function(gameState, resource) { - + let template = gameState.getTemplate(gameState.applyCiv("structures/{civ}_storehouse")); let halfSize = 0; if (template.get("Footprint/Square")) @@ -521,7 +521,7 @@ m.BaseManager.prototype.checkResourceLevels = function (gameState, queues) this.gatherers[type].lost = 0; } } - + }; /** Adds the estimated gather rates from this base to the currentRates */ @@ -537,7 +537,7 @@ m.BaseManager.prototype.getGatherRates = function(gameState, currentRates) this.gatherersByType(gameState, res).forEach(function (ent) { if (ent.isIdle() || !ent.position()) - return; + return; let gRate = ent.currentGatherRate(); if (gRate) currentRates[res] += Math.log(1+gRate)/1.1; @@ -600,7 +600,7 @@ m.BaseManager.prototype.setWorkersIdleByPriority = function(gameState) for (let i = mostNeeded.length-1; i > 0; --i) { let lessNeed = mostNeeded[i]; - for (let j = 0; j < i; ++j) + for (let j = 0; j < i; ++j) { let moreNeed = mostNeeded[j]; let lastFailed = gameState.ai.HQ.lastFailedGather[moreNeed.type]; @@ -616,7 +616,7 @@ m.BaseManager.prototype.setWorkersIdleByPriority = function(gameState) if (lessNeed.type === "food" && gatherers.filter(API3.Filters.byClass("CitizenSoldier")).hasEntities()) only = "CitizenSoldier"; else if ((lessNeed.type === "stone" || lessNeed.type === "metal") && moreNeed.type !== "stone" && moreNeed.type !== "metal" && - gatherers.filter(API3.Filters.byClass("Female")).hasEntities()) + gatherers.filter(API3.Filters.byClass("Female")).hasEntities()) only = "Female"; gatherers.forEach( function (ent) { @@ -743,11 +743,11 @@ m.BaseManager.prototype.pickBuilders = function(gameState, workers, number) /** * If we have some foundations, and we don't have enough builder-workers, - * try reassigning some other workers who are nearby + * try reassigning some other workers who are nearby * AI tries to use builders sensibly, not completely stopping its econ. */ m.BaseManager.prototype.assignToFoundations = function(gameState, noRepair) -{ +{ let foundations = this.buildings.filter(API3.Filters.and(API3.Filters.isFoundation(),API3.Filters.not(API3.Filters.byClass("Field")))).toEntityArray(); let damagedBuildings = this.buildings.filter(ent => ent.foundationProgress() === undefined && ent.needsRepair()); @@ -791,7 +791,7 @@ m.BaseManager.prototype.assignToFoundations = function(gameState, noRepair) } } - let builderTot = builderWorkers.length - idleBuilderWorkers.length; + let builderTot = builderWorkers.length - idleBuilderWorkers.length; for (let target of foundations) { @@ -868,7 +868,7 @@ m.BaseManager.prototype.assignToFoundations = function(gameState, noRepair) coeffB *= 0.5 * (1 + Math.sqrt(coeffB)/5/time); else if (workerB.getMetadata(PlayerID, "gather-type") === "food") coeffB *= 3; - return coeffA - coeffB; + return coeffA - coeffB; }); let current = 0; let nonBuilderTot = nonBuilderWorkers.length; @@ -941,7 +941,7 @@ m.BaseManager.prototype.assignToFoundations = function(gameState, noRepair) }); let num = Math.min(nonBuilderWorkers.length, targetNB-assigned); let nearestNonBuilders = nonBuilderWorkers.filterNearest(target.position(), num); - + nearestNonBuilders.forEach(function(ent) { assigned++; builderTot++; diff --git a/binaries/data/mods/public/simulation/ai/petra/defenseManager.js b/binaries/data/mods/public/simulation/ai/petra/defenseManager.js index 66e24e9b71..5406e251b1 100644 --- a/binaries/data/mods/public/simulation/ai/petra/defenseManager.js +++ b/binaries/data/mods/public/simulation/ai/petra/defenseManager.js @@ -130,7 +130,7 @@ m.DefenseManager.prototype.isDangerous = function(gameState, entity) // TODO the 30 is to take roughly into account the structure size in following checks. Can be improved if (entity.attackTypes().indexOf("Ranged") !== -1) dist2Min = (entity.attackRange("Ranged").max + 30) * (entity.attackRange("Ranged").max + 30); - + for (let targetId of this.targetList) { let target = gameState.getEntityById(targetId); @@ -187,7 +187,7 @@ m.DefenseManager.prototype.checkEnemyUnits = function(gameState) { if (!this.armies.length) { - // check if we can recover capture points from any of our notdecaying structures + // check if we can recover capture points from any of our notdecaying structures for (let ent of gameState.getOwnStructures().values()) { if (ent.decaying()) @@ -356,7 +356,7 @@ m.DefenseManager.prototype.assignDefenders = function(gameState) { if (this.armies.length === 0) return; - + let armiesNeeding = []; // let's add defenders for (let army of this.armies) @@ -364,7 +364,7 @@ m.DefenseManager.prototype.assignDefenders = function(gameState) let needsDef = army.needsDefenders(gameState); if (needsDef === false) continue; - + // Okay for now needsDef is the total needed strength. // we're dumb so we don't choose if we have a defender shortage. armiesNeeding.push( {"army": army, "need": needsDef} ); @@ -374,7 +374,7 @@ m.DefenseManager.prototype.assignDefenders = function(gameState) return; // let's get our potential units - let potentialDefenders = []; + let potentialDefenders = []; gameState.getOwnUnits().forEach(function(ent) { if (!ent.position()) return; @@ -398,7 +398,7 @@ m.DefenseManager.prototype.assignDefenders = function(gameState) } potentialDefenders.push(ent.id()); }); - + for (let a = 0; a < armiesNeeding.length; ++a) armiesNeeding[a].army.recalculatePosition(gameState); @@ -566,7 +566,7 @@ m.DefenseManager.prototype.checkEvents = function(gameState, events) continue; } - // try to garrison any attacked range siege unit + // try to garrison any attacked range siege unit if (target.hasClass("Siege") && !target.hasClass("Melee") && !target.getMetadata(PlayerID, "transport") && plan !== -2 && plan !== -3) { @@ -617,7 +617,7 @@ m.DefenseManager.prototype.garrisonRangedUnitsInside = function(gameState, targe if (ent.getMetadata(PlayerID, "plan") !== undefined && ent.getMetadata(PlayerID, "plan") !== -1) { let subrole = ent.getMetadata(PlayerID, "subrole"); - if (subrole && (subrole === "completing" || subrole === "walking" || subrole === "attacking")) + if (subrole && (subrole === "completing" || subrole === "walking" || subrole === "attacking")) continue; } if (gameState.ai.accessibility.getAccessValue(ent.position()) !== index) diff --git a/binaries/data/mods/public/simulation/ai/petra/diplomacyManager.js b/binaries/data/mods/public/simulation/ai/petra/diplomacyManager.js index dfe802894c..c84af3df3d 100644 --- a/binaries/data/mods/public/simulation/ai/petra/diplomacyManager.js +++ b/binaries/data/mods/public/simulation/ai/petra/diplomacyManager.js @@ -58,7 +58,7 @@ m.DiplomacyManager.prototype.tributes = function(gameState) mostNeeded = gameState.ai.HQ.pickMostNeededResources(gameState); for (let k = 0; k < 2; ++k) { - if (mostNeeded[k].type == res && mostNeeded[k].wanted > 0) + if (mostNeeded[k].type == res && mostNeeded[k].wanted > 0) { this.nextTributeRequest.set("all", gameState.ai.elapsedTime + 90); this.nextTributeRequest.set(res, gameState.ai.elapsedTime + 240); diff --git a/binaries/data/mods/public/simulation/ai/petra/garrisonManager.js b/binaries/data/mods/public/simulation/ai/petra/garrisonManager.js index 1c9d223703..053c92e5b1 100644 --- a/binaries/data/mods/public/simulation/ai/petra/garrisonManager.js +++ b/binaries/data/mods/public/simulation/ai/petra/garrisonManager.js @@ -71,7 +71,7 @@ m.GarrisonManager.prototype.update = function(gameState, events) let ent = gameState.getEntityById(list[j]); if (!ent) // unit must have been killed while garrisoning - list.splice(j--, 1); + list.splice(j--, 1); else if (holder.garrisoned().indexOf(list[j]) !== -1) // unit is garrisoned { this.leaveGarrison(ent); @@ -155,13 +155,13 @@ m.GarrisonManager.prototype.update = function(gameState, events) } } - // Warning new garrison orders (as in the following lines) should be done after having updated the holders + // Warning new garrison orders (as in the following lines) should be done after having updated the holders // (or TODO we should add a test that the garrison order is from a previous turn when updating) for (let [id, gmin] of this.decayingStructures.entries()) { let ent = gameState.getEntityById(id); if (!ent || ent.owner() !== PlayerID) - this.decayingStructures.delete(id); + this.decayingStructures.delete(id); else if (this.numberOfGarrisonedUnits(ent) < gmin) gameState.ai.HQ.defenseManager.garrisonRangedUnitsInside(gameState, ent, {"min": gmin, "type": "decay"}); } @@ -231,7 +231,7 @@ m.GarrisonManager.prototype.keepGarrisoned = function(ent, holder, enemiesAround case 'decay': return this.decayingStructures.has(holder.id()); default: - if (ent.getMetadata(PlayerID, "onBoard") === "onBoard") // transport is not (yet ?) managed by garrisonManager + if (ent.getMetadata(PlayerID, "onBoard") === "onBoard") // transport is not (yet ?) managed by garrisonManager return true; API3.warn("unknown type in garrisonManager " + ent.getMetadata(PlayerID, "garrisonType") + " for " + ent.id() + " inside " + holder.id()); diff --git a/binaries/data/mods/public/simulation/ai/petra/mapModule.js b/binaries/data/mods/public/simulation/ai/petra/mapModule.js index 0cf9cf822a..7b8f1797a4 100644 --- a/binaries/data/mods/public/simulation/ai/petra/mapModule.js +++ b/binaries/data/mods/public/simulation/ai/petra/mapModule.js @@ -114,7 +114,7 @@ m.createTerritoryMap = function(gameState) { let map = gameState.ai.territoryMap; - let ret = new API3.Map(gameState.sharedScript, "territory", map.data); + let ret = new API3.Map(gameState.sharedScript, "territory", map.data); ret.getOwner = function(p) { return this.point(p) & m.TERRITORY_PLAYER_MASK; }; ret.getOwnerIndex = function(p) { return this.map[p] & m.TERRITORY_PLAYER_MASK; }; return ret; diff --git a/binaries/data/mods/public/simulation/ai/petra/navalManager.js b/binaries/data/mods/public/simulation/ai/petra/navalManager.js index ed90af2022..217486dbdd 100644 --- a/binaries/data/mods/public/simulation/ai/petra/navalManager.js +++ b/binaries/data/mods/public/simulation/ai/petra/navalManager.js @@ -14,7 +14,7 @@ var PETRA = function(m) m.NavalManager = function(Config) { this.Config = Config; - + // ship subCollections. Also exist for land zones, idem, not caring. this.seaShips = []; this.seaTransportShips = []; @@ -28,7 +28,7 @@ m.NavalManager = function(Config) // needed NB per zone. this.neededTransportShips = []; this.neededWarShips = []; - + this.transportPlans = []; // shore-line regions where we can load and unload units @@ -42,7 +42,7 @@ m.NavalManager.prototype.init = function(gameState, deserializing) this.docks = gameState.getOwnStructures().filter(API3.Filters.and(API3.Filters.byClassesOr(["Dock", "Shipyard"]), API3.Filters.not(API3.Filters.isFoundation()))); this.docks.registerUpdates(); - + this.ships = gameState.getOwnUnits().filter(API3.Filters.and(API3.Filters.byClass("Ship"), API3.Filters.not(API3.Filters.byMetadata(PlayerID, "role", "trader")))); // note: those two can overlap (some transport ships are warships too and vice-versa). this.transportShips = this.ships.filter(API3.Filters.and(API3.Filters.byCanGarrison(), API3.Filters.not(API3.Filters.byClass("FishingBoat")))); @@ -53,7 +53,7 @@ m.NavalManager.prototype.init = function(gameState, deserializing) this.transportShips.registerUpdates(); this.warShips.registerUpdates(); this.fishShips.registerUpdates(); - + let fishes = gameState.getFishableSupplies(); let availableFishes = {}; for (let fish of fishes.values()) diff --git a/binaries/data/mods/public/simulation/ai/petra/queueManager.js b/binaries/data/mods/public/simulation/ai/petra/queueManager.js index 671131db61..0ca04a177c 100644 --- a/binaries/data/mods/public/simulation/ai/petra/queueManager.js +++ b/binaries/data/mods/public/simulation/ai/petra/queueManager.js @@ -408,7 +408,7 @@ m.QueueManager.prototype.update = function(gameState) if (this.Config.debug > 1 && gameState.ai.playedTurn%50 === 0) this.printQueues(gameState); - + Engine.ProfileStop(); }; @@ -533,7 +533,7 @@ m.QueueManager.prototype.removeQueue = function(queueName) delete this.queues[queueName]; delete this.priorities[queueName]; delete this.accounts[queueName]; - + this.queueArrays = []; for (let q in this.queues) this.queueArrays.push([q, this.queues[q]]); diff --git a/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js b/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js index b2485271ef..13e69ef380 100644 --- a/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js +++ b/binaries/data/mods/public/simulation/ai/petra/queueplanBuilding.js @@ -294,7 +294,7 @@ m.ConstructionPlan.prototype.findGoodPosition = function(gameState) } } - // Find the best non-obstructed: + // Find the best non-obstructed: // Find target building's approximate obstruction radius, and expand by a bit to make sure we're not too close, // this allows room for units to walk between buildings. // note: not for houses and dropsites who ought to be closer to either each other or a resource. @@ -468,7 +468,7 @@ m.ConstructionPlan.prototype.findDockPosition = function(gameState) if (bestVal < 0) return false; - // if no good place with enough water around and still in first phase, wait for expansion at the next phase + // if no good place with enough water around and still in first phase, wait for expansion at the next phase if (!this.metadata.proximity && bestWater < 10 && gameState.currentPhase() == 1) return false; @@ -517,7 +517,7 @@ m.ConstructionPlan.prototype.getDockAngle = function(gameState, x, z, size) let angle = (i/numPoints)*2*Math.PI; pos = [x - (1+dist)*size*Math.sin(angle), z + (1+dist)*size*Math.cos(angle)]; pos = gameState.ai.accessibility.gamePosToMapPos(pos); - if (pos[0] < 0 || pos[0] >= gameState.ai.accessibility.width || + if (pos[0] < 0 || pos[0] >= gameState.ai.accessibility.width || pos[1] < 0 || pos[1] >= gameState.ai.accessibility.height) continue; let j = pos[0] + pos[1]*gameState.ai.accessibility.width; @@ -595,21 +595,21 @@ m.ConstructionPlan.prototype.checkDockPlacement = function(gameState, x, z, half for (let i = 1; i < 5; ++i) { pos = gameState.ai.accessibility.gamePosToMapPos([x + sz + i*(sp+sw), z + cz + i*(cp-cw)]); - if (pos[0] < 0 || pos[0] >= gameState.ai.accessibility.width || + if (pos[0] < 0 || pos[0] >= gameState.ai.accessibility.width || pos[1] < 0 || pos[1] >= gameState.ai.accessibility.height) break; j = pos[0] + pos[1]*gameState.ai.accessibility.width; if (gameState.ai.accessibility.landPassMap[j] > 1 || gameState.ai.accessibility.navalPassMap[j] < 2) break; pos = gameState.ai.accessibility.gamePosToMapPos([x + sz + i*sp, z + cz + i*cp]); - if (pos[0] < 0 || pos[0] >= gameState.ai.accessibility.width || + if (pos[0] < 0 || pos[0] >= gameState.ai.accessibility.width || pos[1] < 0 || pos[1] >= gameState.ai.accessibility.height) break; j = pos[0] + pos[1]*gameState.ai.accessibility.width; if (gameState.ai.accessibility.landPassMap[j] > 1 || gameState.ai.accessibility.navalPassMap[j] < 2) break; pos = gameState.ai.accessibility.gamePosToMapPos([x + sz + i*(sp-sw), z + cz + i*(cp+cw)]); - if (pos[0] < 0 || pos[0] >= gameState.ai.accessibility.width || + if (pos[0] < 0 || pos[0] >= gameState.ai.accessibility.width || pos[1] < 0 || pos[1] >= gameState.ai.accessibility.height) break; j = pos[0] + pos[1]*gameState.ai.accessibility.width; diff --git a/binaries/data/mods/public/simulation/ai/petra/researchManager.js b/binaries/data/mods/public/simulation/ai/petra/researchManager.js index c4ac8a814a..955f7e9236 100644 --- a/binaries/data/mods/public/simulation/ai/petra/researchManager.js +++ b/binaries/data/mods/public/simulation/ai/petra/researchManager.js @@ -20,7 +20,7 @@ m.ResearchManager.prototype.checkPhase = function(gameState, queues) let townPhase = gameState.townPhase(); let cityPhase = gameState.cityPhase(); - + if (gameState.canResearch(townPhase,true) && gameState.getPopulation() >= this.Config.Economy.popForTown - 10 && gameState.hasResearchers(townPhase, true)) { @@ -153,7 +153,7 @@ m.ResearchManager.prototype.researchPreferredTechs = function(gameState, techs) continue; } for (let i in template.modifications) - { + { if (template.modifications[i].value === "ResourceGatherer/Rates/stone.rock") return tech[0]; else if (template.modifications[i].value === "ResourceGatherer/Rates/metal.ore") diff --git a/binaries/data/mods/public/simulation/ai/petra/startingStrategy.js b/binaries/data/mods/public/simulation/ai/petra/startingStrategy.js index 7c1932ade9..71dc415631 100644 --- a/binaries/data/mods/public/simulation/ai/petra/startingStrategy.js +++ b/binaries/data/mods/public/simulation/ai/petra/startingStrategy.js @@ -88,7 +88,7 @@ m.HQ.prototype.assignStartingEntities = function(gameState) if (sea > 1 && !this.navalRegions[sea]) this.navalRegions[sea] = true; - // if garrisoned units inside, ungarrison them except if a ship in which case we will make a transport + // if garrisoned units inside, ungarrison them except if a ship in which case we will make a transport // when a construction will start (see createTransportIfNeeded) if (ent.isGarrisonHolder() && ent.garrisoned().length && !ent.hasClass("Ship")) for (let id of ent.garrisoned()) @@ -176,7 +176,7 @@ m.HQ.prototype.regionAnalysis = function(gameState) let totalSize = passabilityMap.width * passabilityMap.width; let minLandSize = Math.floor(0.1*totalSize); let minWaterSize = Math.floor(0.2*totalSize); - let cellArea = passabilityMap.cellSize * passabilityMap.cellSize; + let cellArea = passabilityMap.cellSize * passabilityMap.cellSize; for (let i = 0; i < accessibility.regionSize.length; ++i) { if (landIndex && i == landIndex) @@ -269,7 +269,7 @@ m.HQ.prototype.buildFirstBase = function(gameState) goal = "dock"; } - // We first choose as startingPoint the point where we have the more units + // We first choose as startingPoint the point where we have the more units let startingPoint = []; for (let ent of gameState.getOwnUnits().values()) { diff --git a/binaries/data/mods/public/simulation/ai/petra/tradeManager.js b/binaries/data/mods/public/simulation/ai/petra/tradeManager.js index 56a0c05d7a..9a528bb61e 100644 --- a/binaries/data/mods/public/simulation/ai/petra/tradeManager.js +++ b/binaries/data/mods/public/simulation/ai/petra/tradeManager.js @@ -156,7 +156,7 @@ m.TradeManager.prototype.setTradingGoods = function(gameState) let tradingGoods = {}; for (let res in gameState.ai.HQ.wantedRates) tradingGoods[res] = 0; - // first, try to anticipate future needs + // first, try to anticipate future needs let stocks = gameState.ai.HQ.getTotalResourceLevel(gameState); let mostNeeded = gameState.ai.HQ.pickMostNeededResources(gameState); let remaining = 100; @@ -247,7 +247,7 @@ m.TradeManager.prototype.performBarter = function(gameState) else if (available[sell] > 1000) barterRateMin = 10; } - else + else { barterRateMin = 70; if (available[sell] > 1000) @@ -386,7 +386,7 @@ m.TradeManager.prototype.checkEvents = function(gameState, events) /** * fills the best trade route in this.tradeRoute and the best potential route in this.potentialTradeRoute - * If an index is given, it returns the best route with this index or the best land route if index is a land index + * If an index is given, it returns the best route with this index or the best land route if index is a land index */ m.TradeManager.prototype.checkRoutes = function(gameState, accessIndex) { diff --git a/binaries/data/mods/public/simulation/ai/petra/transportPlan.js b/binaries/data/mods/public/simulation/ai/petra/transportPlan.js index d7a7b67913..8dac52cb4e 100644 --- a/binaries/data/mods/public/simulation/ai/petra/transportPlan.js +++ b/binaries/data/mods/public/simulation/ai/petra/transportPlan.js @@ -18,7 +18,7 @@ var PETRA = function(m) * = "onBoard" when garrisoned in a ship * = undefined otherwise * endPos = position of destination - * + * * metadata for ships * transporter = this.ID */ @@ -81,7 +81,7 @@ m.TransportPlan.prototype.init = function(gameState) this.units = gameState.getOwnUnits().filter(API3.Filters.byMetadata(PlayerID, "transport", this.ID)); this.ships = gameState.ai.HQ.navalManager.ships.filter(API3.Filters.byMetadata(PlayerID, "transporter", this.ID)); this.transportShips = gameState.ai.HQ.navalManager.transportShips.filter(API3.Filters.byMetadata(PlayerID, "transporter", this.ID)); - + this.units.registerUpdates(); this.ships.registerUpdates(); this.transportShips.registerUpdates(); @@ -290,7 +290,7 @@ m.TransportPlan.prototype.onBoarding = function(gameState) self.boardingPos[shipId] = self.getBoardingPos(gameState, ship, self.startIndex, self.sea, undefined, false); } ship.move(self.boardingPos[shipId][0], self.boardingPos[shipId][1]); - ship.setMetadata(PlayerID, "timeGarrison", time); + ship.setMetadata(PlayerID, "timeGarrison", time); } else if (time - ent.getMetadata(PlayerID, "timeGarrison") > 2) { diff --git a/binaries/data/mods/public/simulation/ai/petra/worker.js b/binaries/data/mods/public/simulation/ai/petra/worker.js index 7d4efe5a50..732b2c4319 100644 --- a/binaries/data/mods/public/simulation/ai/petra/worker.js +++ b/binaries/data/mods/public/simulation/ai/petra/worker.js @@ -136,7 +136,7 @@ m.Worker.prototype.update = function(gameState, ent) { if (unitAIStateOrder === "REPAIR") { - // update our target in case UnitAI sent us to a different foundation because of autocontinue + // update our target in case UnitAI sent us to a different foundation because of autocontinue if (ent.unitAIOrderData()[0] && ent.unitAIOrderData()[0].target && ent.getMetadata(PlayerID, "target-foundation") !== ent.unitAIOrderData()[0].target) ent.setMetadata(PlayerID, "target-foundation", ent.unitAIOrderData()[0].target); @@ -533,7 +533,7 @@ m.Worker.prototype.startHunting = function(gameState, position) if (!position && this.gatherTreasure(gameState)) return true; - let resources = gameState.getHuntableSupplies(); + let resources = gameState.getHuntableSupplies(); if (!resources.hasEntities()) return false; @@ -587,7 +587,7 @@ m.Worker.prototype.startHunting = function(gameState, position) return; let canFlee = !supply.hasClass("Domestic") && supply.templateName().indexOf("resource|") == -1; - // Only cavalry and range units should hunt fleeing animals + // Only cavalry and range units should hunt fleeing animals if (canFlee && !isCavalry && !isRanged) return; @@ -766,11 +766,11 @@ m.Worker.prototype.gatherNearestField = function(gameState, baseID) /** * WARNING with the present options of AI orders, the unit will not gather after building the farm. - * This is done by calling the gatherNearestField function when construction is completed. + * This is done by calling the gatherNearestField function when construction is completed. */ m.Worker.prototype.buildAnyField = function(gameState, baseID) { - let baseFoundations = gameState.getOwnFoundations().filter(API3.Filters.byMetadata(PlayerID, "base", baseID)); + let baseFoundations = gameState.getOwnFoundations().filter(API3.Filters.byMetadata(PlayerID, "base", baseID)); let maxGatherers = gameState.getTemplate(gameState.applyCiv("structures/{civ}_field")).maxGatherers(); let bestFarmEnt = false; let bestFarmDist = 10000000; diff --git a/binaries/data/mods/public/simulation/ai/tutorial-ai/config.js b/binaries/data/mods/public/simulation/ai/tutorial-ai/config.js index 88524c1564..5db0a7d0a4 100644 --- a/binaries/data/mods/public/simulation/ai/tutorial-ai/config.js +++ b/binaries/data/mods/public/simulation/ai/tutorial-ai/config.js @@ -5,7 +5,7 @@ var baseConfig = { "enemyRatio" : 1.5, // attackMoveToLocation "groupSize" : 10 // military }, - + // defence "defence" : { "acquireDistance" : 220, @@ -15,7 +15,7 @@ var baseConfig = { "groupMergeRadius" : 10, "defenderRatio" : 2 }, - + // military "buildings" : { "moderate" : { @@ -46,7 +46,7 @@ var baseConfig = { "defenceBuilding" : 17, "civilCentre" : 1000 }, - + "debug" : false }; diff --git a/binaries/data/mods/public/simulation/ai/tutorial-ai/timer.js b/binaries/data/mods/public/simulation/ai/tutorial-ai/timer.js index ad4848ac06..dd385da3ac 100644 --- a/binaries/data/mods/public/simulation/ai/tutorial-ai/timer.js +++ b/binaries/data/mods/public/simulation/ai/tutorial-ai/timer.js @@ -12,39 +12,39 @@ var Timer = function() { ///Private array. var alarmList = []; - + ///Private methods function num_alarms() { return alarmList.length; }; - + function get_alarm(id) { return alarmList[id]; }; - + function add_alarm(index, alarm) { alarmList[index] = alarm; }; - + function delete_alarm(id) { // Set the array element to undefined delete alarmList[id]; }; - + ///Privileged methods // Add an new alarm to the list this.setTimer = function(gameState, interval, delay, repeat) { delay = delay || 0; repeat = repeat || -1; - + var index = num_alarms(); - + //Add a new alarm to the list add_alarm(index, new alarm(gameState, index, interval, delay, repeat)); return index; }; - - + + // Check if a alarm has reached its interval. this.checkTimer = function(gameState,id) { var alarm = get_alarm(id); @@ -54,7 +54,7 @@ var Timer = function() { return false; var time = gameState.getTimeElapsed(); var alarmState = false; - + // If repeat forever (repeat is -1). Or if the alarm has rung less times than repeat. if (alarm.repeat < 0 || alarm.counter < alarm.repeat) { var time_difference = time - alarm.start_time - alarm.delay - alarm.interval * alarm.counter; @@ -63,26 +63,26 @@ var Timer = function() { alarm.counter++; } } - + // Check if the alarm has rung 'alarm.repeat' times if so, delete the alarm. if (alarm.counter >= alarm.repeat && alarm.repeat != -1) { this.clearTimer(id); } - + return alarmState; }; - + // Remove an alarm from the list. this.clearTimer = function(id) { delete_alarm(id); }; - + // Activate a deactivated alarm. this.activateTimer = function(id) { var alarm = get_alarm(id); alarm.active = true; }; - + // Deactivate an active alarm but don't delete it. this.deactivateTimer = function(id) { var alarm = get_alarm(id); @@ -97,7 +97,7 @@ var alarm = function(gameState, id, interval, delay, repeat) { this.interval = interval; this.delay = delay; this.repeat = repeat; - + this.start_time = gameState.getTimeElapsed(); this.active = true; this.counter = 0; diff --git a/binaries/data/mods/public/simulation/ai/tutorial-ai/tutorial.js b/binaries/data/mods/public/simulation/ai/tutorial-ai/tutorial.js index 6f7139a347..0e534f930c 100644 --- a/binaries/data/mods/public/simulation/ai/tutorial-ai/tutorial.js +++ b/binaries/data/mods/public/simulation/ai/tutorial-ai/tutorial.js @@ -1,15 +1,15 @@ var TutorialAI = (function() { var m = {}; - + m.TutorialAI = function(settings) { API3.BaseAI.call(this, settings); this.turn = 0; - + this.firstTime = true; this.savedEvents = []; - + this.toUpdate = []; } @@ -19,21 +19,21 @@ m.TutorialAI.prototype = new API3.BaseAI(); m.TutorialAI.prototype.runInit = function(gameState) { if (this.firstTime){ this.firstTime = false; - + this.chooseTutorial(gameState); - + if (this.tutorial === undefined) return; - + this.currentPos = 0; this.currentState = this.tutorial[this.currentPos]; - + this.lastChat = -1000000; } }; m.TutorialAI.prototype.chooseTutorial = function(gameState) { var trees = gameState.updatingCollection("trees", API3.Filters.byClass("ForestPlant"), gameState.getEntities()); - + var numTrees = trees.length; switch (numTrees) { case 945: @@ -50,22 +50,22 @@ m.TutorialAI.prototype.OnUpdate = function() { if (this.gameFinished){ return; } - + if (this.events.length) this.savedEvents = this.savedEvents.concat(this.events); - + Engine.ProfileStart("tutorialBot"); - + var gameState = this.gameState; this.runInit(gameState); - + if (this.tutorial === undefined) return; - + if (gameState.getTimeElapsed() - this.lastChat > 30000){ this.chat(this.currentState.instructions); this.lastChat = gameState.getTimeElapsed(); } - + // check to see if we need to change state var nextState = this.tutorial[this.currentPos + 1]; var doNext = false; @@ -73,7 +73,7 @@ m.TutorialAI.prototype.OnUpdate = function() { case "near_cc": var ents = gameState.getEnemyEntities(); var CC = gameState.updatingCollection("cc", API3.Filters.and(API3.Filters.byClass("CivCentre"), API3.Filters.byOwner(2)), gameState.getEntities()); - + ents.forEach(function(ent) { if (!ent.position()){ return; @@ -114,7 +114,7 @@ m.TutorialAI.prototype.OnUpdate = function() { break; case "entity_count": var ents = gameState.updatingCollection( - nextState.template, + nextState.template, API3.Filters.byType(nextState.template), gameState.getEnemyEntities()); if (ents.length >= nextState.count) { @@ -125,7 +125,7 @@ m.TutorialAI.prototype.OnUpdate = function() { doNext = true; for (var i = 0; i < nextState.templates.length; i++) { var ents = gameState.updatingCollection( - nextState.templates[i], + nextState.templates[i], API3.Filters.byType(nextState.templates[i]), gameState.getEnemyEntities()); if (ents.length < nextState.counts[i]) { @@ -161,13 +161,13 @@ m.TutorialAI.prototype.OnUpdate = function() { if (this.currentState.action) { this.currentState.action(gameState); } - + if (this.currentPos >= this.tutorial.length - 1){ gameState.getOwnEntities().destroy(); this.gameFinished = true; } } - + delete this.savedEvents; this.savedEvents = []; @@ -189,7 +189,7 @@ m.TutorialAI.prototype.Serialize = function() return { _rawEntities: this._rawEntities, _ownEntities: this._ownEntities, - _entityMetadata: {} // We store fancy data structures in entity metadata so + _entityMetadata: {} // We store fancy data structures in entity metadata so //don't try and serialize it }; }; diff --git a/binaries/data/mods/public/simulation/components/AIInterface.js b/binaries/data/mods/public/simulation/components/AIInterface.js index 965671db64..8a1f095319 100644 --- a/binaries/data/mods/public/simulation/components/AIInterface.js +++ b/binaries/data/mods/public/simulation/components/AIInterface.js @@ -91,7 +91,7 @@ AIInterface.prototype.GetNonEntityRepresentation = function() // Return the same game state as the GUI uses let state = cmpGuiInterface.GetSimulationState(-1); - + // Add some extra AI-specific data // add custom events and reset them for the next turn state.events = {}; @@ -132,7 +132,7 @@ AIInterface.prototype.GetRepresentation = function() * Intended to be called first, during the map initialization: no caching */ AIInterface.prototype.GetFullRepresentation = function(flushEvents) -{ +{ let state = this.GetNonEntityRepresentation(); if (flushEvents) @@ -146,7 +146,7 @@ AIInterface.prototype.GetFullRepresentation = function(flushEvents) for (let id of Engine.GetEntitiesWithInterface(IID_AIProxy)) state.entities[id] = Engine.QueryInterface(id, IID_AIProxy).GetFullRepresentation(); Engine.ProfileStop(); - + state.changedTemplateInfo = this.changedTemplateInfo; this.changedTemplateInfo = {}; state.changedEntityTemplateInfo = this.changedEntityTemplateInfo; diff --git a/binaries/data/mods/public/simulation/components/AIProxy.js b/binaries/data/mods/public/simulation/components/AIProxy.js index 82ff93d68e..7799ec01d4 100644 --- a/binaries/data/mods/public/simulation/components/AIProxy.js +++ b/binaries/data/mods/public/simulation/components/AIProxy.js @@ -146,7 +146,7 @@ AIProxy.prototype.OnGarrisonedUnitsChanged = function(msg) { if (!this.NotifyChange()) return; - + let cmpGarrisonHolder = Engine.QueryInterface(this.entity, IID_GarrisonHolder); this.changes.garrisoned = cmpGarrisonHolder.GetEntities(); @@ -329,7 +329,7 @@ AIProxy.prototype.GetFullRepresentation = function() AIProxy.prototype.OnOwnershipChanged = function(msg) { this.NotifyChange(); - + if (msg.from === -1) { this.cmpAIInterface.PushEvent("Create", {"entity" : msg.entity}); @@ -341,7 +341,7 @@ AIProxy.prototype.OnOwnershipChanged = function(msg) this.needsFullGet = true; return; } - + this.changes.owner = msg.to; this.cmpAIInterface.PushEvent("OwnershipChanged", msg); }; diff --git a/binaries/data/mods/public/simulation/components/AlertRaiser.js b/binaries/data/mods/public/simulation/components/AlertRaiser.js index 1ee34cfa95..5ae020e8df 100644 --- a/binaries/data/mods/public/simulation/components/AlertRaiser.js +++ b/binaries/data/mods/public/simulation/components/AlertRaiser.js @@ -1,10 +1,10 @@ function AlertRaiser() {} -AlertRaiser.prototype.Schema = +AlertRaiser.prototype.Schema = "" + ""; -AlertRaiser.prototype.Init = function() +AlertRaiser.prototype.Init = function() { this.level = 0; @@ -39,7 +39,7 @@ AlertRaiser.prototype.SoundAlert = function() AlertRaiser.prototype.UpdateUnits = function(units) { - var level = this.GetLevel(); + var level = this.GetLevel(); for each (var unit in units) { var cmpUnitAI = Engine.QueryInterface(unit, IID_UnitAI); @@ -117,7 +117,7 @@ AlertRaiser.prototype.EndOfAlert = function() continue; cmpUnitAI.ResetAlert(); - + if (cmpUnitAI.HasWorkOrders()) cmpUnitAI.BackToWork(); else @@ -136,7 +136,7 @@ AlertRaiser.prototype.EndOfAlert = function() // If the garrison building was destroyed, the unit is already ejected if (!cmpGarrisonHolder || cmpGarrisonHolder.PerformEject([slot.unit], true)) { - cmpUnitAI.ResetAlert(); + cmpUnitAI.ResetAlert(); if (cmpUnitAI.HasWorkOrders()) cmpUnitAI.BackToWork(); } diff --git a/binaries/data/mods/public/simulation/components/Armour.js b/binaries/data/mods/public/simulation/components/Armour.js index 1a819f8acb..2aca73555a 100644 --- a/binaries/data/mods/public/simulation/components/Armour.js +++ b/binaries/data/mods/public/simulation/components/Armour.js @@ -16,7 +16,7 @@ Armour.prototype.Schema = "" + "" + "" + - "" + + "" + "" + "" + "" + @@ -48,7 +48,7 @@ Armour.prototype.SetInvulnerability = function(invulnerability) */ Armour.prototype.TakeDamage = function(hack, pierce, crush) { - if (this.invulnerable) + if (this.invulnerable) return { "killed": false, "change": 0 }; // Adjust damage values based on armour; exponential armour: damage = attack * 0.9^armour @@ -71,17 +71,17 @@ Armour.prototype.GetArmourStrengths = function() // Work out the armour values with technology effects var applyMods = (type, foundation) => { var strength; - if (foundation) + if (foundation) { strength = +this.template.Foundation[type]; type = "Foundation/" + type; } else strength = +this.template[type]; - + return ApplyValueModificationsToEntity("Armour/" + type, strength, this.entity); }; - + var foundation = Engine.QueryInterface(this.entity, IID_Foundation) && this.template.Foundation; return { diff --git a/binaries/data/mods/public/simulation/components/Attack.js b/binaries/data/mods/public/simulation/components/Attack.js index 210481f105..bed9af485b 100644 --- a/binaries/data/mods/public/simulation/components/Attack.js +++ b/binaries/data/mods/public/simulation/components/Attack.js @@ -461,7 +461,7 @@ Attack.prototype.PerformAttack = function(type, target) { let attackerOwner = Engine.QueryInterface(this.entity, IID_Ownership).GetOwner(); let cmpDamage = Engine.QueryInterface(SYSTEM_ENTITY, IID_Damage); - + // If this is a ranged attack, then launch a projectile if (type == "Ranged") { @@ -556,7 +556,7 @@ Attack.prototype.PerformAttack = function(type, target) { if (attackerOwner == -1) return; - + let multiplier = this.GetAttackBonus(type, target); let cmpHealth = Engine.QueryInterface(target, IID_Health); if (!cmpHealth || cmpHealth.GetHitpoints() == 0) diff --git a/binaries/data/mods/public/simulation/components/AttackDetection.js b/binaries/data/mods/public/simulation/components/AttackDetection.js index 8fe3989321..384a119d11 100644 --- a/binaries/data/mods/public/simulation/components/AttackDetection.js +++ b/binaries/data/mods/public/simulation/components/AttackDetection.js @@ -58,7 +58,7 @@ AttackDetection.prototype.OnGlobalAttacked = function(msg) AttackDetection.prototype.AttackAlert = function(target, attacker, attackerOwner) { let playerID = Engine.QueryInterface(this.entity, IID_Player).GetPlayerID(); - + // Don't register attacks dealt against other players if (Engine.QueryInterface(target, IID_Ownership).GetOwner() != playerID) return; @@ -73,7 +73,7 @@ AttackDetection.prototype.AttackAlert = function(target, attacker, attackerOwner // and generally are not so valuable as other units/buildings, // we have a lower priority notification for it, which can be // overriden by a regular one. - var cmpTargetIdentity = Engine.QueryInterface(target, IID_Identity); + var cmpTargetIdentity = Engine.QueryInterface(target, IID_Identity); var targetIsDomesticAnimal = cmpTargetIdentity && cmpTargetIdentity.HasClass("Animal") && cmpTargetIdentity.HasClass("Domestic"); var cmpPosition = Engine.QueryInterface(target, IID_Position); diff --git a/binaries/data/mods/public/simulation/components/BuildRestrictions.js b/binaries/data/mods/public/simulation/components/BuildRestrictions.js index 75c0c4853d..5a4c8b705f 100644 --- a/binaries/data/mods/public/simulation/components/BuildRestrictions.js +++ b/binaries/data/mods/public/simulation/components/BuildRestrictions.js @@ -267,7 +267,7 @@ BuildRestrictions.prototype.CheckPlacement = function() var cmpIdentity = Engine.QueryInterface(id, IID_Identity); return cmpIdentity.GetClassesList().indexOf(cat) > -1; }; - + if (this.template.Distance.MinDistance) { var dist = +this.template.Distance.MinDistance; diff --git a/binaries/data/mods/public/simulation/components/Builder.js b/binaries/data/mods/public/simulation/components/Builder.js index 84577d234a..2cecb12aa6 100644 --- a/binaries/data/mods/public/simulation/components/Builder.js +++ b/binaries/data/mods/public/simulation/components/Builder.js @@ -35,11 +35,11 @@ Builder.prototype.GetEntitiesList = function() if (cmpIdentity) string = string.replace(/\{civ\}/g, cmpIdentity.GetCiv()); entities = string.split(/\s+/); - + // Remove disabled entities var cmpPlayer = QueryOwnerInterface(this.entity, IID_Player); var disabledEntities = cmpPlayer.GetDisabledTemplates(); - + for (var i = entities.length - 1; i >= 0; --i) if (disabledEntities[entities[i]]) entities.splice(i, 1); diff --git a/binaries/data/mods/public/simulation/components/Capturable.js b/binaries/data/mods/public/simulation/components/Capturable.js index f8ab38af29..55fdde044c 100644 --- a/binaries/data/mods/public/simulation/components/Capturable.js +++ b/binaries/data/mods/public/simulation/components/Capturable.js @@ -13,7 +13,7 @@ Capturable.prototype.Schema = Capturable.prototype.Init = function() { - // Cache this value + // Cache this value this.maxCp = +this.template.CapturePoints; this.cp = []; }; diff --git a/binaries/data/mods/public/simulation/components/Damage.js b/binaries/data/mods/public/simulation/components/Damage.js index ddc13b2849..5b3d6ba0c9 100644 --- a/binaries/data/mods/public/simulation/components/Damage.js +++ b/binaries/data/mods/public/simulation/components/Damage.js @@ -1,8 +1,8 @@ function Damage() {} -Damage.prototype.Schema = +Damage.prototype.Schema = ""; - + Damage.prototype.Init = function() { }; @@ -86,7 +86,7 @@ Damage.prototype.MissileHit = function(data, lateness) { if (!data.position) return; - + // Do this first in case the direct hit kills the target if (data.isSplash) { @@ -114,7 +114,7 @@ Damage.prototype.MissileHit = function(data, lateness) } let cmpProjectileManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_ProjectileManager); - + // Deal direct damage if we hit the main target if (this.TestCollision(data.target, data.position, lateness)) { @@ -122,7 +122,7 @@ Damage.prototype.MissileHit = function(data, lateness) cmpProjectileManager.RemoveProjectile(data.projectileId); return; } - + let targetPosition = this.InterpolatedLocation(data.target, lateness); if (!targetPosition) return; @@ -264,7 +264,7 @@ Damage.prototype.TargetKilled = function(attacker, target, attackerOwner) { let cmpAttackerOwnership = Engine.QueryInterface(attacker, IID_Ownership); let atkOwner = cmpAttackerOwnership && cmpAttackerOwnership.GetOwner() != -1 ? cmpAttackerOwnership.GetOwner() : attackerOwner; - + // Add to killer statistics. let cmpKillerPlayerStatisticsTracker = QueryPlayerIDInterface(atkOwner, IID_StatisticsTracker); if (cmpKillerPlayerStatisticsTracker) @@ -279,5 +279,5 @@ Damage.prototype.TargetKilled = function(attacker, target, attackerOwner) if (cmpLooter) cmpLooter.Collect(target); }; - + Engine.RegisterSystemComponentType(IID_Damage, "Damage", Damage); diff --git a/binaries/data/mods/public/simulation/components/EndGameManager.js b/binaries/data/mods/public/simulation/components/EndGameManager.js index d6a8d54e0b..348db7bfa4 100644 --- a/binaries/data/mods/public/simulation/components/EndGameManager.js +++ b/binaries/data/mods/public/simulation/components/EndGameManager.js @@ -6,7 +6,7 @@ function EndGameManager() {} EndGameManager.prototype.Schema = ""; - + EndGameManager.prototype.Init = function() { this.gameType = "conquest"; diff --git a/binaries/data/mods/public/simulation/components/EntityLimits.js b/binaries/data/mods/public/simulation/components/EntityLimits.js index 4bd07474df..c18480d064 100644 --- a/binaries/data/mods/public/simulation/components/EntityLimits.js +++ b/binaries/data/mods/public/simulation/components/EntityLimits.js @@ -67,7 +67,7 @@ const BUILD = "build"; EntityLimits.prototype.Init = function() { this.limit = {}; - this.count = {}; // counts entities which change the limit of the given category + this.count = {}; // counts entities which change the limit of the given category this.changers = {}; this.removers = {}; this.classCount = {}; // counts entities with the given class, used in the limit removal @@ -151,7 +151,7 @@ EntityLimits.prototype.AllowedToCreate = function(limitType, category, count) // Allow unspecified categories and those with no limit if (this.count[category] === undefined || this.limit[category] === undefined) return true; - + if (this.count[category] + count > this.limit[category]) { var cmpPlayer = Engine.QueryInterface(this.entity, IID_Player); @@ -173,17 +173,17 @@ EntityLimits.prototype.AllowedToCreate = function(limitType, category, count) } var cmpGUIInterface = Engine.QueryInterface(SYSTEM_ENTITY, IID_GuiInterface); cmpGUIInterface.PushNotification(notification); - + return false; } - + return true; }; EntityLimits.prototype.AllowedToBuild = function(category) { // We pass count 0 as the creation of the building has already taken place and - // the ownership has been set (triggering OnGlobalOwnershipChanged) + // the ownership has been set (triggering OnGlobalOwnershipChanged) return this.AllowedToCreate(BUILD, category, 0); }; @@ -205,7 +205,7 @@ EntityLimits.prototype.OnGlobalOwnershipChanged = function(msg) var modifier = -1; else if (msg.to == cmpPlayer.GetPlayerID()) var modifier = 1; - else + else return; // Update entity counts diff --git a/binaries/data/mods/public/simulation/components/Formation.js b/binaries/data/mods/public/simulation/components/Formation.js index 796fcf09b3..4533497ffb 100644 --- a/binaries/data/mods/public/simulation/components/Formation.js +++ b/binaries/data/mods/public/simulation/components/Formation.js @@ -69,7 +69,7 @@ Formation.prototype.Schema = "" + "" + "" + - ""; + ""; var g_ColumnDistanceThreshold = 128; // distance at which we'll switch between column/box formations @@ -367,7 +367,7 @@ Formation.prototype.RemoveMembers = function(ents) Formation.prototype.AddMembers = function(ents) { this.offsets = undefined; - this.inPosition = []; + this.inPosition = []; for each (var ent in this.formationMembersWithAura) { @@ -385,7 +385,7 @@ Formation.prototype.AddMembers = function(ents) { var cmpUnitAI = Engine.QueryInterface(ent, IID_UnitAI); cmpUnitAI.SetFormationController(this.entity); - + var cmpAuras = Engine.QueryInterface(ent, IID_Auras); if (cmpAuras && cmpAuras.HasFormationAura()) { @@ -517,8 +517,8 @@ Formation.prototype.MoveMembersIntoFormation = function(moveCenter, force) var cmpUnitAI = Engine.QueryInterface(offset.ent, IID_UnitAI); if (!cmpUnitAI) continue; - - var data = + + var data = { "target": this.entity, "x": offset.x, @@ -604,9 +604,9 @@ Formation.prototype.ComputeFormationOffsets = function(active, positions) var sortingClasses = this.sortingClasses.slice(); sortingClasses.push("Unknown"); - // the entities will be assigned to positions in the formation in + // the entities will be assigned to positions in the formation in // the same order as the types list is ordered - var types = {}; + var types = {}; for (var i = 0; i < sortingClasses.length; ++i) types[sortingClasses[i]] = []; @@ -750,7 +750,7 @@ Formation.prototype.ComputeFormationOffsets = function(active, positions) if (this.sortingOrder == "fillFromTheSides") offsets.sort(function(o1, o2) { return Math.abs(o1.x) < Math.abs(o2.x);}); else if (this.sortingOrder == "fillToTheCenter") - offsets.sort(function(o1, o2) { + offsets.sort(function(o1, o2) { return Math.max(Math.abs(o1.x), Math.abs(o1.y)) < Math.max(Math.abs(o2.x), Math.abs(o2.y)); }); @@ -820,7 +820,7 @@ Formation.prototype.GetRealOffsetPositions = function(offsets, pos) }; /** - * calculate the estimated rotation of the formation + * calculate the estimated rotation of the formation * based on the first unitAI target position when ordered to walk, * based on the current rotation in other cases * Return the sine and cosine of the angle @@ -875,7 +875,7 @@ Formation.prototype.ComputeMotionParameters = function() Formation.prototype.ShapeUpdate = function() { - // Check the distance to twin formations, and merge if when + // Check the distance to twin formations, and merge if when // the formations could collide for (var i = this.twinFormations.length - 1; i >= 0; --i) { diff --git a/binaries/data/mods/public/simulation/components/FormationAttack.js b/binaries/data/mods/public/simulation/components/FormationAttack.js index 6a56ffd9fb..aa72815247 100644 --- a/binaries/data/mods/public/simulation/components/FormationAttack.js +++ b/binaries/data/mods/public/simulation/components/FormationAttack.js @@ -35,7 +35,7 @@ FormationAttack.prototype.GetRange = function(target) if (!type) continue; - // if the formation can attack, take the minimum max range (so units are certainly in range), + // if the formation can attack, take the minimum max range (so units are certainly in range), // If the formation can't attack, take the maximum max range as the point where the formation will be disbanded // Always take the minimum min range (to not get impossible situations) var range = cmpAttack.GetRange(type); diff --git a/binaries/data/mods/public/simulation/components/Foundation.js b/binaries/data/mods/public/simulation/components/Foundation.js index 50d513aa7b..509c6364ea 100644 --- a/binaries/data/mods/public/simulation/components/Foundation.js +++ b/binaries/data/mods/public/simulation/components/Foundation.js @@ -14,7 +14,7 @@ Foundation.prototype.Init = function() this.builders = []; // builder entities this.buildMultiplier = 1; // Multiplier for the amount of work builders do. - + this.previewEntity = INVALID_ENTITY; // Penalty for multiple builders @@ -43,7 +43,7 @@ Foundation.prototype.InitialiseConstruction = function(owner, template) }; /** - * Moving the revelation logic from Build to here makes the building sink if + * Moving the revelation logic from Build to here makes the building sink if * it is attacked. */ Foundation.prototype.OnHealthChanged = function(msg) @@ -52,7 +52,7 @@ Foundation.prototype.OnHealthChanged = function(msg) var cmpPosition = Engine.QueryInterface(this.previewEntity, IID_Position); if (cmpPosition) cmpPosition.SetConstructionProgress(this.GetBuildProgress()); - + Engine.PostMessage(this.entity, MT_FoundationProgressChanged, { "to": this.GetBuildPercentage() }); }; @@ -173,7 +173,7 @@ Foundation.prototype.Build = function(builderEnt, work) // this won't happen much) if (this.GetBuildProgress() == 1.0) return; - + // If there's any units in the way, ask them to move away // and return early from this method. var cmpObstruction = Engine.QueryInterface(this.entity, IID_Obstruction); @@ -219,7 +219,7 @@ Foundation.prototype.Build = function(builderEnt, work) if (cmpObstruction && cmpObstruction.GetBlockMovementFlag()) cmpObstruction.SetDisableBlockMovementPathfinding(false, false, -1); - // Call the related trigger event + // Call the related trigger event var cmpTrigger = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger); cmpTrigger.CallEvent("ConstructionStarted", { "foundation": this.entity, @@ -354,7 +354,7 @@ Foundation.prototype.Build = function(builderEnt, work) return; } cmpBuildingOwnership.SetOwner(owner); - + /* Copy over the obstruction control group IDs from the foundation entities. This is needed to ensure that when a foundation is completed @@ -367,21 +367,21 @@ Foundation.prototype.Build = function(builderEnt, work) new control group containing only itself, and will hence block construction of any surrounding foundations that it was previously in the same control group with. - + Note that this will result in the completed building entities having control group IDs that equal entity IDs of old (and soon to be deleted) foundation entities. This should not have any consequences, however, since the control group IDs are only meant to be unique identifiers, which is still true when reusing the old ones. */ - + var cmpBuildingObstruction = Engine.QueryInterface(building, IID_Obstruction); if (cmpObstruction && cmpBuildingObstruction) { cmpBuildingObstruction.SetControlGroup(cmpObstruction.GetControlGroup()); cmpBuildingObstruction.SetControlGroup2(cmpObstruction.GetControlGroup2()); } - + var cmpPlayerStatisticsTracker = QueryOwnerInterface(this.entity, IID_StatisticsTracker); if (cmpPlayerStatisticsTracker) cmpPlayerStatisticsTracker.IncreaseConstructedBuildingsCounter(building); diff --git a/binaries/data/mods/public/simulation/components/Gate.js b/binaries/data/mods/public/simulation/components/Gate.js index faa5c11db1..d091fba0cd 100644 --- a/binaries/data/mods/public/simulation/components/Gate.js +++ b/binaries/data/mods/public/simulation/components/Gate.js @@ -217,7 +217,7 @@ Gate.prototype.CloseGate = function() // The gate can't be closed if there are entities colliding with it. var collisions = cmpObstruction.GetUnitCollisions(); if (collisions.length) - { + { if (!this.timer) { // Set an "instant" timer which will run on the next simulation turn. diff --git a/binaries/data/mods/public/simulation/components/Guard.js b/binaries/data/mods/public/simulation/components/Guard.js index 6c078cc57a..e90e9747f6 100644 --- a/binaries/data/mods/public/simulation/components/Guard.js +++ b/binaries/data/mods/public/simulation/components/Guard.js @@ -37,7 +37,7 @@ Guard.prototype.AddGuard = function(ent) { if (this.entities.indexOf(ent) != -1) return; - this.entities.push(ent); + this.entities.push(ent); }; Guard.prototype.RemoveGuard = function(ent) diff --git a/binaries/data/mods/public/simulation/components/Health.js b/binaries/data/mods/public/simulation/components/Health.js index 27631bbcd1..f3f2445dee 100644 --- a/binaries/data/mods/public/simulation/components/Health.js +++ b/binaries/data/mods/public/simulation/components/Health.js @@ -17,16 +17,16 @@ Health.prototype.Schema = "" + "" + "" + - "" + - "" + - "" + - "" + - "" + - "0" + - "1" + - "" + - "" + - "" + + "" + + "" + + "" + + "" + + "" + + "0" + + "1" + + "" + + "" + + "" + "" + "" + "" + @@ -97,7 +97,7 @@ Health.prototype.SetHitpoints = function(value) var old = this.hitpoints; this.hitpoints = Math.max(1, Math.min(this.GetMaxHitpoints(), value)); - + var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); if (cmpRangeManager) { @@ -154,7 +154,7 @@ Health.prototype.ExecuteRegeneration = function() if (regen > 0) this.Increase(regen); - else + else this.Reduce(-regen); }; @@ -272,7 +272,7 @@ Health.prototype.Increase = function(amount) var old = this.hitpoints; this.hitpoints = Math.min(this.hitpoints + amount, this.GetMaxHitpoints()); - + if (this.hitpoints == this.GetMaxHitpoints()) { var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); @@ -361,19 +361,19 @@ Health.prototype.UpdateActor = function() return; let ratio = this.GetHitpoints() / this.GetMaxHitpoints(); let newDamageVariant = "alive"; - if (ratio > 0) - { + if (ratio > 0) + { let minTreshold = 1; - for (let key in this.template.DamageVariants) - { + for (let key in this.template.DamageVariants) + { let treshold = +this.template.DamageVariants[key]; - if (treshold < ratio || treshold > minTreshold) + if (treshold < ratio || treshold > minTreshold) continue; newDamageVariant = key; minTreshold = treshold; - } - } - else + } + } + else newDamageVariant = "death"; if (this.damageVariant && this.damageVariant == newDamageVariant) @@ -402,10 +402,10 @@ Health.prototype.OnValueModification = function(msg) let oldRegenRate = this.regenRate; this.regenRate = ApplyValueModificationsToEntity("Health/RegenRate", +this.template.RegenRate, this.entity); - + let oldIdleRegenRate = this.idleRegenRate; this.idleRegenRate = ApplyValueModificationsToEntity("Health/IdleRegenRate", +this.template.IdleRegenRate, this.entity); - + if (this.regenRate != oldRegenRate || this.idleRegenRate != oldIdleRegenRate) this.CheckRegenTimer(); }; diff --git a/binaries/data/mods/public/simulation/components/Market.js b/binaries/data/mods/public/simulation/components/Market.js index 853965eef0..a60bf7f925 100644 --- a/binaries/data/mods/public/simulation/components/Market.js +++ b/binaries/data/mods/public/simulation/components/Market.js @@ -23,7 +23,7 @@ Market.prototype.Init = function() Market.prototype.AddTrader = function(ent) { - this.traders.add(ent); + this.traders.add(ent); }; Market.prototype.RemoveTrader = function(ent) diff --git a/binaries/data/mods/public/simulation/components/PlayerManager.js b/binaries/data/mods/public/simulation/components/PlayerManager.js index 4576704758..50fc773dce 100644 --- a/binaries/data/mods/public/simulation/components/PlayerManager.js +++ b/binaries/data/mods/public/simulation/components/PlayerManager.js @@ -24,7 +24,7 @@ PlayerManager.prototype.AddPlayer = function(ent) } newDiplo[id] = 1; cmpPlayer.SetDiplomacy(newDiplo); - + return id; }; @@ -97,7 +97,7 @@ PlayerManager.prototype.RemoveAllPlayers = function() PlayerManager.prototype.RemoveLastPlayer = function() { - if (this.playerEntities.length == 0) + if (this.playerEntities.length == 0) return; var lastId = this.playerEntities.pop(); diff --git a/binaries/data/mods/public/simulation/components/ProductionQueue.js b/binaries/data/mods/public/simulation/components/ProductionQueue.js index 2fbc688418..ea36319669 100644 --- a/binaries/data/mods/public/simulation/components/ProductionQueue.js +++ b/binaries/data/mods/public/simulation/components/ProductionQueue.js @@ -14,15 +14,15 @@ ProductionQueue.prototype.Schema = "" + "" + "" + - "" + + "" + "" + "" + "tokens" + "" + "" + "" + - "" + - "" + + "" + + "" + "" + "" + "tokens" + @@ -52,7 +52,7 @@ ProductionQueue.prototype.Init = function() // "timeTotal": 15000, // msecs // "timeRemaining": 10000, // msecs // } - // + // // { // "id": 1, // "player": 1, // who paid for this research; we need this to cope with refunds cleanly @@ -321,7 +321,7 @@ ProductionQueue.prototype.AddBatch = function(templateName, type, count, metadat "timeRemaining": time*1000, }); - // Call the related trigger event + // Call the related trigger event var cmpTrigger = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger); cmpTrigger.CallEvent("TrainingQueued", {"playerid": cmpPlayer.GetPlayerID(), "unitTemplate": templateName, "count": count, "metadata": metadata, "trainerEntity": this.entity}); } @@ -354,7 +354,7 @@ ProductionQueue.prototype.AddBatch = function(templateName, type, count, metadat if (!cmpPlayer.TrySubtractResources(cost)) return; - // Tell the technology manager that we have started researching this so that people can't research the same + // Tell the technology manager that we have started researching this so that people can't research the same // thing twice. var cmpTechnologyManager = QueryOwnerInterface(this.entity, IID_TechnologyManager); cmpTechnologyManager.QueuedResearch(templateName, this.entity); @@ -372,7 +372,7 @@ ProductionQueue.prototype.AddBatch = function(templateName, type, count, metadat "timeRemaining": time*1000, }); - // Call the related trigger event + // Call the related trigger event var cmpTrigger = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger); cmpTrigger.CallEvent("ResearchQueued", {"playerid": cmpPlayer.GetPlayerID(), "technologyTemplate": templateName, "researcherEntity": this.entity}); } @@ -641,7 +641,7 @@ ProductionQueue.prototype.SpawnUnits = function(templateName, count, metadata) if (spawnedEnts.length > 0 && !cmpAutoGarrison) { - // If a rally point is set, walk towards it (in formation) using a suitable command based on where the + // If a rally point is set, walk towards it (in formation) using a suitable command based on where the // rally point is placed. if (cmpRallyPoint) { diff --git a/binaries/data/mods/public/simulation/components/Promotion.js b/binaries/data/mods/public/simulation/components/Promotion.js index 9ad78c8421..de183fa727 100644 --- a/binaries/data/mods/public/simulation/components/Promotion.js +++ b/binaries/data/mods/public/simulation/components/Promotion.js @@ -86,7 +86,7 @@ Promotion.prototype.Promote = function(promotedTemplateName) if (cmpCurrentUnitAI.IsGarrisoned()) cmpPromotedUnitAI.SetGarrisoned(); if (cmpCurrentUnitPosition.IsInWorld()) // do not cheer if not visibly garrisoned - cmpPromotedUnitAI.Cheer(); + cmpPromotedUnitAI.Cheer(); cmpPromotedUnitAI.AddOrders(orders); var workOrders = cmpCurrentUnitAI.GetWorkOrders(); diff --git a/binaries/data/mods/public/simulation/components/RallyPoint.js b/binaries/data/mods/public/simulation/components/RallyPoint.js index c42e3e568e..be5a8a15bf 100644 --- a/binaries/data/mods/public/simulation/components/RallyPoint.js +++ b/binaries/data/mods/public/simulation/components/RallyPoint.js @@ -34,7 +34,7 @@ RallyPoint.prototype.GetPositions = function() // Update the rallypoint coordinates if the target is alive if (!this.data[i] || !this.data[i].target || !this.TargetIsAlive(this.data[i].target)) continue; - + // and visible if (cmpRangeManager && cmpOwnership && cmpRangeManager.GetLosVisibility(this.data[i].target, cmpOwnership.GetOwner()) != "visible") @@ -69,7 +69,7 @@ RallyPoint.prototype.AddData = function(data) }; // Returns an array with the data associated with this rally point. Each element has the structure: -// {"type": "walk/gather/garrison/...", "target": targetEntityId, "resourceType": "tree/fruit/ore/..."} where target +// {"type": "walk/gather/garrison/...", "target": targetEntityId, "resourceType": "tree/fruit/ore/..."} where target // and resourceType (specific resource type) are optional, also target may be an invalid entity, check for existence. RallyPoint.prototype.GetData = function() { diff --git a/binaries/data/mods/public/simulation/components/ResourceGatherer.js b/binaries/data/mods/public/simulation/components/ResourceGatherer.js index cbb6d03e1e..4d408b6f14 100644 --- a/binaries/data/mods/public/simulation/components/ResourceGatherer.js +++ b/binaries/data/mods/public/simulation/components/ResourceGatherer.js @@ -177,9 +177,9 @@ ResourceGatherer.prototype.TryInstantGather = function(target) if (cmpStatisticsTracker) cmpStatisticsTracker.IncreaseTreasuresCollectedCounter(); - let cmpTrigger = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger); - if (cmpTrigger && cmpPlayer) - cmpTrigger.CallEvent("TreasureCollected", {"player": cmpPlayer.GetPlayerID(), "type": type.specific, "amount": status.amount }); + let cmpTrigger = Engine.QueryInterface(SYSTEM_ENTITY, IID_Trigger); + if (cmpTrigger && cmpPlayer) + cmpTrigger.CallEvent("TreasureCollected", {"player": cmpPlayer.GetPlayerID(), "type": type.specific, "amount": status.amount }); return true; }; diff --git a/binaries/data/mods/public/simulation/components/ResourceSupply.js b/binaries/data/mods/public/simulation/components/ResourceSupply.js index 63da7b73c0..e7a7ed85f3 100644 --- a/binaries/data/mods/public/simulation/components/ResourceSupply.js +++ b/binaries/data/mods/public/simulation/components/ResourceSupply.js @@ -78,7 +78,7 @@ ResourceSupply.prototype.GetMaxGatherers = function() ResourceSupply.prototype.GetNumGatherers = function() { - return this.gatherers.reduce((a, b) => a + b.length, 0); + return this.gatherers.reduce((a, b) => a + b.length, 0); }; /* The rate of each additionnal gatherer rate follow a geometric sequence, with diminishingReturns as common ratio. */ @@ -139,14 +139,14 @@ ResourceSupply.prototype.AddGatherer = function(player, gathererID) { if (!this.IsAvailable(player, gathererID)) return false; - + if (this.gatherers[player].indexOf(gathererID) === -1) { this.gatherers[player].push(gathererID); // broadcast message, mainly useful for the AIs. Engine.PostMessage(this.entity, MT_ResourceSupplyNumGatherersChanged, { "to": this.GetNumGatherers() }); } - + return true; }; diff --git a/binaries/data/mods/public/simulation/components/ResourceTrickle.js b/binaries/data/mods/public/simulation/components/ResourceTrickle.js index fb4b151041..b0122c6c20 100644 --- a/binaries/data/mods/public/simulation/components/ResourceTrickle.js +++ b/binaries/data/mods/public/simulation/components/ResourceTrickle.js @@ -1,6 +1,6 @@ function ResourceTrickle() {} -ResourceTrickle.prototype.Schema = +ResourceTrickle.prototype.Schema = "Controls the resource trickle ability of the unit." + "" + Resources.BuildSchema("nonNegativeDecimal") + diff --git a/binaries/data/mods/public/simulation/components/SkirmishReplacer.js b/binaries/data/mods/public/simulation/components/SkirmishReplacer.js index 59f37cf8d7..c082c4d0eb 100644 --- a/binaries/data/mods/public/simulation/components/SkirmishReplacer.js +++ b/binaries/data/mods/public/simulation/components/SkirmishReplacer.js @@ -1,6 +1,6 @@ function SkirmishReplacer() {} -SkirmishReplacer.prototype.Schema = +SkirmishReplacer.prototype.Schema = "" + "" + "" + @@ -17,7 +17,7 @@ SkirmishReplacer.prototype.Serialize = null; // We have no dynamic state to save //this function gets the replacement entities from the {civ}.json file function getReplacementEntities(civ) -{ +{ var rawCivData = Engine.ReadCivJSONFile(civ+".json"); if (rawCivData && rawCivData.SkirmishReplacements) return rawCivData.SkirmishReplacements; @@ -36,10 +36,10 @@ SkirmishReplacer.prototype.ReplaceEntities = function() var cmpPlayer = QueryOwnerInterface(this.entity); var civ = cmpPlayer.GetCiv(); var replacementEntities = getReplacementEntities(civ); - + var cmpTemplateManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_TemplateManager); var templateName = cmpTemplateManager.GetCurrentTemplateName(this.entity); - + if (templateName in replacementEntities) templateName = replacementEntities[templateName]; else if (this.template && "general" in this.template) @@ -52,7 +52,7 @@ SkirmishReplacer.prototype.ReplaceEntities = function() Engine.DestroyEntity(this.entity); return; } - + templateName = templateName.replace(/\{civ\}/g, civ); var cmpCurPosition = Engine.QueryInterface(this.entity, IID_Position); @@ -70,7 +70,7 @@ SkirmishReplacer.prototype.ReplaceEntities = function() var cmpCurOwnership = Engine.QueryInterface(this.entity, IID_Ownership); var cmpReplacementOwnership = Engine.QueryInterface(replacement, IID_Ownership); cmpReplacementOwnership.SetOwner(cmpCurOwnership.GetOwner()); - + Engine.BroadcastMessage(MT_EntityRenamed, { "entity": this.entity, "newentity": replacement }); Engine.DestroyEntity(this.entity); }; diff --git a/binaries/data/mods/public/simulation/components/StatusBars.js b/binaries/data/mods/public/simulation/components/StatusBars.js index 962f090e21..3a2e5ce1bc 100644 --- a/binaries/data/mods/public/simulation/components/StatusBars.js +++ b/binaries/data/mods/public/simulation/components/StatusBars.js @@ -16,7 +16,7 @@ StatusBars.prototype.Schema = /** * For every sprite, the code will call their "Add" method when regenerating * the sprites. Every sprite adder should return the height it needs. - * + * * Modders who need extra sprites can just modify this array, and * provide the right methods. */ @@ -241,29 +241,29 @@ StatusBars.prototype.AddAuraIcons = function(cmpOverlayRenderer, yoffset) let iconSet = new Set(); for (let ent of sources) { - let cmpAuras = Engine.QueryInterface(ent, IID_Auras); - if (!cmpAuras) // probably the ent just died - continue; - for (let name of this.auraSources.get(ent)) - iconSet.add(cmpAuras.GetOverlayIcon(name)); + let cmpAuras = Engine.QueryInterface(ent, IID_Auras); + if (!cmpAuras) // probably the ent just died + continue; + for (let name of this.auraSources.get(ent)) + iconSet.add(cmpAuras.GetOverlayIcon(name)); } // World-space offset from the unit's position let offset = { "x": 0, "y": +this.template.HeightOffset + yoffset, "z": 0 }; - let iconSize = +this.template.BarWidth / 2; + let iconSize = +this.template.BarWidth / 2; let xoffset = -iconSize * (iconSet.size - 1) * 0.6; - for (let icon of iconSet) - { - cmpOverlayRenderer.AddSprite( - icon, - { "x": xoffset - iconSize/2, "y": yoffset }, - { "x": xoffset + iconSize/2, "y": iconSize + yoffset }, + for (let icon of iconSet) + { + cmpOverlayRenderer.AddSprite( + icon, + { "x": xoffset - iconSize/2, "y": yoffset }, + { "x": xoffset + iconSize/2, "y": iconSize + yoffset }, offset, NATURAL_COLOR - ); + ); xoffset += iconSize * 1.2; - } + } return iconSize + this.template.BarHeight / 2; }; diff --git a/binaries/data/mods/public/simulation/components/TechnologyManager.js b/binaries/data/mods/public/simulation/components/TechnologyManager.js index f1f9cc7e90..f5a17a78de 100644 --- a/binaries/data/mods/public/simulation/components/TechnologyManager.js +++ b/binaries/data/mods/public/simulation/components/TechnologyManager.js @@ -5,7 +5,7 @@ TechnologyManager.prototype.Schema = TechnologyManager.prototype.Serialize = function() { - // The modifications cache will be affected by property reads from the GUI and other places so we shouldn't + // The modifications cache will be affected by property reads from the GUI and other places so we shouldn't // serialize it. var ret = {}; @@ -25,7 +25,7 @@ TechnologyManager.prototype.Init = function() this.researchStarted = {}; // technologies which are being researched currently (non-queued) // This stores the modifications to unit stats from researched technologies - // Example data: {"ResourceGatherer/Rates/food.grain": [ + // Example data: {"ResourceGatherer/Rates/food.grain": [ // {"multiply": 1.15, "affects": ["Female", "Infantry Swordsman"]}, // {"add": 2} // ]} @@ -38,7 +38,7 @@ TechnologyManager.prototype.Init = function() this.typeCountsByClass = {}; // stores the number of entities of each type for each class i.e. // {"someClass": {"unit/spearman": 2, "unit/cav": 5} "someOtherClass":...} - // Some technologies are automatically researched when their conditions are met. They have no cost and are + // Some technologies are automatically researched when their conditions are met. They have no cost and are // researched instantly. This allows civ bonuses and more complicated technologies. this.autoResearchTech = {}; var allTechs = Engine.QueryInterface(SYSTEM_ENTITY, IID_DataTemplateManager).GetAllTechs(); @@ -49,7 +49,7 @@ TechnologyManager.prototype.Init = function() } }; -TechnologyManager.prototype.OnUpdate = function() +TechnologyManager.prototype.OnUpdate = function() { this.UpdateAutoResearch(); }; @@ -287,7 +287,7 @@ TechnologyManager.prototype.ResearchTechnology = function(tech) var modification = template.modifications[i]; if (!this.modifications[modification.value]) this.modifications[modification.value] = []; - + var modAffects = affects.slice(); if (modification.affects) { @@ -314,7 +314,7 @@ TechnologyManager.prototype.ResearchTechnology = function(tech) if (template.replaces && template.replaces.length > 0) { - for (var i of template.replaces) + for (var i of template.replaces) { if (!i || this.IsTechnologyResearched(i)) continue; @@ -348,7 +348,7 @@ TechnologyManager.prototype.ResearchTechnology = function(tech) if (cmpPlayerEntityLimits) cmpPlayerEntityLimits.UpdateLimitsFromTech(tech); - // always send research finished message + // always send research finished message Engine.PostMessage(this.entity, MT_ResearchFinished, {"player": playerID, "tech": tech}); for (var component in modifiedComponents) diff --git a/binaries/data/mods/public/simulation/components/Trader.js b/binaries/data/mods/public/simulation/components/Trader.js index 771a814ffb..84ce02b399 100644 --- a/binaries/data/mods/public/simulation/components/Trader.js +++ b/binaries/data/mods/public/simulation/components/Trader.js @@ -226,7 +226,7 @@ Trader.prototype.GetGoods = function() */ Trader.prototype.HasMarket = function(market) { - return this.markets.indexOf(market) != -1; + return this.markets.indexOf(market) != -1; }; /** diff --git a/binaries/data/mods/public/simulation/components/TriggerPoint.js b/binaries/data/mods/public/simulation/components/TriggerPoint.js index 395531e61a..487a4bccbc 100644 --- a/binaries/data/mods/public/simulation/components/TriggerPoint.js +++ b/binaries/data/mods/public/simulation/components/TriggerPoint.js @@ -39,7 +39,7 @@ TriggerPoint.prototype.OnDestroy = function() */ TriggerPoint.prototype.RegisterRangeTrigger = function(action, data) { - + if (data.players) var players = data.players; else @@ -52,7 +52,7 @@ TriggerPoint.prototype.RegisterRangeTrigger = function(action, data) var minRange = data.minRange || 0; var maxRange = data.maxRange || -1; var cid = data.requiredComponent || -1; - + var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); var tag = cmpRangeManager.CreateActiveQuery(this.entity, minRange, maxRange, players, cid, cmpRangeManager.GetEntityFlagMask("normal")); @@ -73,7 +73,7 @@ TriggerPoint.prototype.OnRangeUpdate = function(msg) if (index > -1) collection.splice(index, 1); } - + for each (var entity in msg.added) collection.push(entity); diff --git a/binaries/data/mods/public/simulation/components/UnitAI.js b/binaries/data/mods/public/simulation/components/UnitAI.js index ca48804a13..d3a81321da 100644 --- a/binaries/data/mods/public/simulation/components/UnitAI.js +++ b/binaries/data/mods/public/simulation/components/UnitAI.js @@ -5581,7 +5581,7 @@ UnitAI.prototype.FindWalkAndFightTargets = function() // healers on a walk-and-fight order should heal injured units if (this.IsHealer()) return this.FindNewHealTargets(); - + return false; }; diff --git a/binaries/data/mods/public/simulation/components/UnitMotionFlying.js b/binaries/data/mods/public/simulation/components/UnitMotionFlying.js index 55b1bd5c03..a03c3b59d5 100644 --- a/binaries/data/mods/public/simulation/components/UnitMotionFlying.js +++ b/binaries/data/mods/public/simulation/components/UnitMotionFlying.js @@ -63,7 +63,7 @@ UnitMotionFlying.prototype.OnUpdate = function(msg) var cmpHealth = Engine.QueryInterface(this.entity, IID_Health); var cmpPosition = Engine.QueryInterface(this.entity, IID_Position); var pos = cmpPosition.GetPosition(); - var angle = cmpPosition.GetRotation().y; + var angle = cmpPosition.GetRotation().y; var cmpTerrain = Engine.QueryInterface(SYSTEM_ENTITY, IID_Terrain); var cmpWaterManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_WaterManager); var ground = Math.max(cmpTerrain.GetGroundLevel(pos.x, pos.z), cmpWaterManager.GetWaterLevel(pos.x, pos.z)); @@ -82,11 +82,11 @@ UnitMotionFlying.prototype.OnUpdate = function(msg) else this.speed = Math.max(0, this.speed - turnLength * this.template.BrakingRate); canTurn = false; - // Clamp to ground if below it, or descend if above + // Clamp to ground if below it, or descend if above if (pos.y < ground) pos.y = ground; else if (pos.y > ground) - pos.y = Math.max(ground, pos.y - turnLength * this.template.ClimbRate); + pos.y = Math.max(ground, pos.y - turnLength * this.template.ClimbRate); } else if (this.speed == 0 && this.onGround) { @@ -100,7 +100,7 @@ UnitMotionFlying.prototype.OnUpdate = function(msg) cmpGarrisonHolder.AllowGarrisoning(true,"UnitMotionFlying"); canTurn = false; this.hasTarget = false; - this.landing = false; + this.landing = false; // summon planes back from the edge of the map var terrainSize = cmpTerrain.GetTilesPerSide() * 4; var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager); @@ -130,7 +130,7 @@ UnitMotionFlying.prototype.OnUpdate = function(msg) // Final Approach // We need to slow down to land! this.speed = Math.max(this.template.LandingSpeed, this.speed - turnLength * this.template.SlowingRate); - canTurn = false; + canTurn = false; var targetHeight = ground; // Steep, then gradual descent. if ((pos.y - targetHeight) / this.template.FlyingHeight > 1 / SHORT_FINAL) @@ -144,11 +144,11 @@ UnitMotionFlying.prototype.OnUpdate = function(msg) pos.y = Math.max(targetHeight, pos.y - turnLength * descentRate); if (targetHeight == pos.y) { - this.onGround = true; + this.onGround = true; if (targetHeight == cmpWaterManager.GetWaterLevel(pos.x, pos.z) && this.template.DiesInWater) - this.waterDeath = true; + this.waterDeath = true; } - } + } } else { @@ -187,12 +187,12 @@ UnitMotionFlying.prototype.OnUpdate = function(msg) pos.y = Math.min(targetHeight, pos.y + turnLength * this.template.ClimbRate); else if (pos.y > targetHeight) { - pos.y = Math.max(targetHeight, pos.y - turnLength * this.template.ClimbRate); + pos.y = Math.max(targetHeight, pos.y - turnLength * this.template.ClimbRate); this.pitch = -1 * this.pitch; - } + } } } - + // If we're in range of the target then tell people that we've reached it // (TODO: quantisation breaks this) var distFromTarget = Math.sqrt(Math.pow(this.targetX - pos.x, 2) + Math.pow(this.targetZ - pos.z, 2)); diff --git a/binaries/data/mods/public/simulation/components/ValueModificationManager.js b/binaries/data/mods/public/simulation/components/ValueModificationManager.js index 5277c7c555..f2b7c48b06 100644 --- a/binaries/data/mods/public/simulation/components/ValueModificationManager.js +++ b/binaries/data/mods/public/simulation/components/ValueModificationManager.js @@ -1,7 +1,7 @@ function ValueModificationManager() {} /* - * A component to give the C++ defined components access to all value modifying components + * A component to give the C++ defined components access to all value modifying components * via the helper script. */ ValueModificationManager.prototype.Schema = diff --git a/binaries/data/mods/public/simulation/components/WallSet.js b/binaries/data/mods/public/simulation/components/WallSet.js index 48fcba5f7b..52eb35a6a3 100644 --- a/binaries/data/mods/public/simulation/components/WallSet.js +++ b/binaries/data/mods/public/simulation/components/WallSet.js @@ -4,8 +4,8 @@ WallSet.prototype.Schema = "" + "" + "" + - "" + - "" + + "" + + "" + "" + "" + "" + @@ -21,13 +21,13 @@ WallSet.prototype.Schema = "" + "" + "" + - "" + - "" + - "" + - "0.01.0" + + "" + "" + - "" + - "0.01.0" + + "" + + "0.01.0" + + "" + + "" + + "0.01.0" + ""; diff --git a/binaries/data/mods/public/simulation/components/tests/setup.js b/binaries/data/mods/public/simulation/components/tests/setup.js index ebbb14a26f..6497991c3e 100644 --- a/binaries/data/mods/public/simulation/components/tests/setup.js +++ b/binaries/data/mods/public/simulation/components/tests/setup.js @@ -62,7 +62,7 @@ Engine.PostMessage = function(ent, iid, message) Engine.BroadcastMessage = function(iid, message) { // TODO: make this send a message if necessary -}; +}; global.ResetState = function() { diff --git a/binaries/data/mods/public/simulation/components/tests/test_Damage.js b/binaries/data/mods/public/simulation/components/tests/test_Damage.js index b5d7e26c05..627f5dbe39 100644 --- a/binaries/data/mods/public/simulation/components/tests/test_Damage.js +++ b/binaries/data/mods/public/simulation/components/tests/test_Damage.js @@ -33,7 +33,7 @@ let type = "Melee"; let damageTaken = false; cmpAttack.GetAttackStrengths = (type) => ({ "hack": 0, "pierce": 0, "crush": damage }); -cmpAttack.GetAttackBonus = (type, target) => 1.0; +cmpAttack.GetAttackBonus = (type, target) => 1.0; let data = { "attacker": attacker, @@ -55,9 +55,9 @@ AddMock(SYSTEM_ENTITY, IID_PlayerManager, { GetPlayerByID: (id) => atkPlayerEntity, }); -AddMock(SYSTEM_ENTITY, IID_RangeManager, { - ExecuteQueryAroundPos: () => [target], - GetElevationAdaptedRange: (pos, rot, max, bonus, a) => max, +AddMock(SYSTEM_ENTITY, IID_RangeManager, { + ExecuteQueryAroundPos: () => [target], + GetElevationAdaptedRange: (pos, rot, max, bonus, a) => max, }); AddMock(SYSTEM_ENTITY, IID_ProjectileManager, { @@ -73,7 +73,7 @@ AddMock(target, IID_Position, { }); AddMock(target, IID_Health, {}); - + AddMock(target, IID_DamageReceiver, { TakeDamage: (hack, pierce, crush) => { damageTaken = true; return { "killed": false, "change": -crush }; }, }); @@ -91,7 +91,7 @@ AddMock(attacker, IID_Ownership, { GetOwner: () => attackerOwner, }); -AddMock(attacker, IID_Position, { +AddMock(attacker, IID_Position, { GetPosition: () => new Vector3D(2, 0, 3), GetRotation: () => new Vector3D(1, 2, 3), IsInWorld: () => true, diff --git a/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js b/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js index 30826515f2..da08b6ed0c 100644 --- a/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js +++ b/binaries/data/mods/public/simulation/components/tests/test_GuiInterface.js @@ -124,19 +124,19 @@ AddMock(100, IID_TechnologyManager, { }); AddMock(100, IID_StatisticsTracker, { - GetBasicStatistics: function() { + GetBasicStatistics: function() { return { "resourcesGathered": { - "food": 100, - "wood": 0, - "metal": 0, + "food": 100, + "wood": 0, + "metal": 0, "stone": 0, - "vegetarianFood": 0, + "vegetarianFood": 0, }, "percentMapExplored": 10 }; }, - GetStatistics: function() { + GetStatistics: function() { return { "unitsTrained": 10, "unitsLost": 9, @@ -145,11 +145,11 @@ AddMock(100, IID_StatisticsTracker, { "buildingsLost": 4, "civCentresBuilt": 1, "resourcesGathered": { - "food": 100, - "wood": 0, - "metal": 0, + "food": 100, + "wood": 0, + "metal": 0, "stone": 0, - "vegetarianFood": 0, + "vegetarianFood": 0, }, "treasuresCollected": 0, "lootCollected": 0, @@ -208,19 +208,19 @@ AddMock(101, IID_TechnologyManager, { }); AddMock(101, IID_StatisticsTracker, { - GetBasicStatistics: function() { + GetBasicStatistics: function() { return { "resourcesGathered": { - "food": 100, - "wood": 0, - "metal": 0, + "food": 100, + "wood": 0, + "metal": 0, "stone": 0, - "vegetarianFood": 0, + "vegetarianFood": 0, }, "percentMapExplored": 10 }; }, - GetStatistics: function() { + GetStatistics: function() { return { "unitsTrained": 10, "unitsLost": 9, @@ -229,11 +229,11 @@ AddMock(101, IID_StatisticsTracker, { "buildingsLost": 4, "civCentresBuilt": 1, "resourcesGathered": { - "food": 100, - "wood": 0, - "metal": 0, + "food": 100, + "wood": 0, + "metal": 0, "stone": 0, - "vegetarianFood": 0, + "vegetarianFood": 0, }, "treasuresCollected": 0, "lootCollected": 0, @@ -292,7 +292,7 @@ TS_ASSERT_UNEVAL_EQUALS(cmp.GetSimulationState(), { wood: 0, metal: 0, stone: 0, - vegetarianFood: 0, + vegetarianFood: 0, }, percentMapExplored: 10 }, @@ -334,7 +334,7 @@ TS_ASSERT_UNEVAL_EQUALS(cmp.GetSimulationState(), { wood: 0, metal: 0, stone: 0, - vegetarianFood: 0, + vegetarianFood: 0, }, percentMapExplored: 10 }, @@ -410,7 +410,7 @@ TS_ASSERT_UNEVAL_EQUALS(cmp.GetExtendedSimulationState(), { wood: 0, metal: 0, stone: 0, - vegetarianFood: 0, + vegetarianFood: 0, }, treasuresCollected: 0, lootCollected: 0, @@ -465,7 +465,7 @@ TS_ASSERT_UNEVAL_EQUALS(cmp.GetExtendedSimulationState(), { wood: 0, metal: 0, stone: 0, - vegetarianFood: 0, + vegetarianFood: 0, }, treasuresCollected: 0, lootCollected: 0, diff --git a/binaries/data/mods/public/simulation/data/cheats/changePhase.json b/binaries/data/mods/public/simulation/data/cheats/changePhase.json index 36a9476073..f9bd3f2e37 100644 --- a/binaries/data/mods/public/simulation/data/cheats/changePhase.json +++ b/binaries/data/mods/public/simulation/data/cheats/changePhase.json @@ -1,6 +1,6 @@ -{ - "Name": "back to the future", +{ + "Name": "back to the future", "Data": { "Action": "changephase" } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/simulation/data/cheats/researchTechnology.json b/binaries/data/mods/public/simulation/data/cheats/researchTechnology.json index d80e7c5d7c..ec55ce86fe 100644 --- a/binaries/data/mods/public/simulation/data/cheats/researchTechnology.json +++ b/binaries/data/mods/public/simulation/data/cheats/researchTechnology.json @@ -1,7 +1,7 @@ -{ - "Name": "brainiac", - "Data": { - "Action": "researchTechnology", - "DefaultParameter": "" +{ + "Name": "brainiac", + "Data": { + "Action": "researchTechnology", + "DefaultParameter": "" } -} \ No newline at end of file +} diff --git a/binaries/data/mods/public/simulation/data/civs/brit.json b/binaries/data/mods/public/simulation/data/civs/brit.json index d89fad1070..a86e534d1e 100644 --- a/binaries/data/mods/public/simulation/data/civs/brit.json +++ b/binaries/data/mods/public/simulation/data/civs/brit.json @@ -20,13 +20,13 @@ { "Name": "Sevili Dusios", "History": "The Britons took up the practice of either making permanent marks on their body in the form of tattoos or temporarily painted their bodies with woad paint. The effect was very frightening.", - "Description": "Increased attack and movement rate for melee soldiers." + "Description": "Increased attack and movement rate for melee soldiers." }, { "Name": "Turos Maros", "History": "'Great Tower'; Celtic legends abound with stories of massive tall towers built by the most powerful kings, and the remains of some very large towers have been found.", - "Description": "Increases the height bonus of units garrisoned in a tower." - } + "Description": "Increases the height bonus of units garrisoned in a tower." + } ], "Heroes": [ @@ -35,14 +35,14 @@ "Class": "", "Armament": "", "Emblem": "", - "History": "Caractacus, the Roman form, is a simple change from Karatakos, his actual name, which was printed on his many, many coins. Under this name he is remembered as a fierce defender of Britain against the Romans after their invasion in 43 A.D. Son of King Cunobelin of the Catuvellauni tribal confederation, Karatakos fought for nine years against the Romans with little success, eventually fleeing to the tribes in Wales, where he was defeated decisively. Finally he entered Northern Britain, where was handed over to the Romans. Taken to Rome, Karatakos was allowed to live by the Emperor Claudius and died in Italy. Tradition states he converted to Christianity when his wife did, but there is nothing known of this as definite. Probably more notable is the matter that he was allowed to live once captured. Roman policy was typically to have such men killed in public displays to celebrate. Karatakos was brought before the Emperor and Senate at his request to explain himself. What he said is not known for certainty, but Tacitus applies to him a famous speech..." + "History": "Caractacus, the Roman form, is a simple change from Karatakos, his actual name, which was printed on his many, many coins. Under this name he is remembered as a fierce defender of Britain against the Romans after their invasion in 43 A.D. Son of King Cunobelin of the Catuvellauni tribal confederation, Karatakos fought for nine years against the Romans with little success, eventually fleeing to the tribes in Wales, where he was defeated decisively. Finally he entered Northern Britain, where was handed over to the Romans. Taken to Rome, Karatakos was allowed to live by the Emperor Claudius and died in Italy. Tradition states he converted to Christianity when his wife did, but there is nothing known of this as definite. Probably more notable is the matter that he was allowed to live once captured. Roman policy was typically to have such men killed in public displays to celebrate. Karatakos was brought before the Emperor and Senate at his request to explain himself. What he said is not known for certainty, but Tacitus applies to him a famous speech..." }, { "Name": "Kunobelinos", "Class": "", "Armament": "", "Emblem": "", - "History": "Kunobelinos (perhaps better known by the latinized form of Cunobelin) was a powerful ruler of the Catuvellauni. He was referred to by Romans as the King of the Britons. His domains extended around the city of Kamulodunon (known as Camulodunum), modern day Colchester. The Roman defeat in the battle of Teutoburg Forest (Germania) allowed Kunobelinos to conquer a neighboring tribe, the Trinovantes, who were Roman allies and couldn't receive Roman aide. Kunobelinos seems to have been indifferent to the Romans. He traded with them freely, but had few qualms subjugating known Roman allies, and even sent his youngest son Adminius as a fosterling to be educated in Roman Gaul. This accounted for Adminius's friendships among the Romans. Adminius was given lordship over the Cantaci, who inhabited Kent, by his father. This area was the prime area of Roman influence and trade in Britain, and Kunobelinos shrewdly observed his youngest son's friendship with powerful Roman and Gallo-Roman politicians and traders would be of use administrating the region. His other sons though had no love for the Romans. When Kunobelinos died of disease, he was replaced by his son Togdumnos, who arrested, executed, or expelled numerous Roman sympathizers. These included his own brother Adminius, and the deposed Atrebates king, Verica, who appealed to their connections in the Roman Empire for aide in recovering their lands. Togdumnos died in battle with the Romans, and was subsequently replaced by his brother, Karatakos. It is an irony that it was his third son that initially invited this Roman reprisal. Kunobelinos in his own time though was possibly one of the greatest of all British kings. He conquered the great majority of the southern half of Britain (his coins were being minted as far as the borders of what would become Wales). He started ruling over only four minor tribes in a confederation, the Catuvellauni, and ended up achieving recognition as king of Britain. This recognition was so great that tribes in Cambria even came to assist his sons against the Romans and their British allies, and Kunobelinos was held up by the post-Roman Britons as one of their great heroes; a conqueror and uniter of petty kingdoms, something the post-Roman Britons or Romano-British sorely needed." + "History": "Kunobelinos (perhaps better known by the latinized form of Cunobelin) was a powerful ruler of the Catuvellauni. He was referred to by Romans as the King of the Britons. His domains extended around the city of Kamulodunon (known as Camulodunum), modern day Colchester. The Roman defeat in the battle of Teutoburg Forest (Germania) allowed Kunobelinos to conquer a neighboring tribe, the Trinovantes, who were Roman allies and couldn't receive Roman aide. Kunobelinos seems to have been indifferent to the Romans. He traded with them freely, but had few qualms subjugating known Roman allies, and even sent his youngest son Adminius as a fosterling to be educated in Roman Gaul. This accounted for Adminius's friendships among the Romans. Adminius was given lordship over the Cantaci, who inhabited Kent, by his father. This area was the prime area of Roman influence and trade in Britain, and Kunobelinos shrewdly observed his youngest son's friendship with powerful Roman and Gallo-Roman politicians and traders would be of use administrating the region. His other sons though had no love for the Romans. When Kunobelinos died of disease, he was replaced by his son Togdumnos, who arrested, executed, or expelled numerous Roman sympathizers. These included his own brother Adminius, and the deposed Atrebates king, Verica, who appealed to their connections in the Roman Empire for aide in recovering their lands. Togdumnos died in battle with the Romans, and was subsequently replaced by his brother, Karatakos. It is an irony that it was his third son that initially invited this Roman reprisal. Kunobelinos in his own time though was possibly one of the greatest of all British kings. He conquered the great majority of the southern half of Britain (his coins were being minted as far as the borders of what would become Wales). He started ruling over only four minor tribes in a confederation, the Catuvellauni, and ended up achieving recognition as king of Britain. This recognition was so great that tribes in Cambria even came to assist his sons against the Romans and their British allies, and Kunobelinos was held up by the post-Roman Britons as one of their great heroes; a conqueror and uniter of petty kingdoms, something the post-Roman Britons or Romano-British sorely needed." }, { "Name": "Boudicca", @@ -50,30 +50,30 @@ "Armament": "", "Emblem": "", "History": "Ammianus Marcellinus described how difficult it would be for a band of foreigners to deal with a Celt if he called in the help of his wife. For she was stronger than he was and could rain blows and kicks upon the assailants equal in force to the shots of a catapult. Boudicca, queen of the Iceni, was said to be 'very tall and terrifying in appearance; her voice was very harsh and a great mass of red hair fell over her shoulders. She wore a tunic of many colors over which a thick cloak was fastened by a brooch. Boudicca had actually at first been a Roman ally, along with her husband, Prasutagus, king of the Iceni. Prasutagus had been a close Roman ally after a brief uprising, respected as being forethinking even by his former enemies, now allied Romans, and free to rule his kingdom as their native tradition dictated, except in one case. Prasutagus, realizing he was going to die, agreed upon a will with his wife and subordinates; his daughters would inherit the physical running of the territory, under Boudicca's stewardship until they were adults, and the Emperor of Rome would have overlordship, collecting taxes and being allowed to request military aid. Much the same situation as he already held. The problem lay in that the Romans did not recognize female heirs, and thus asserted, upon Prasutagus's death, that only the Emperor's claim to the kingdom of Icenia was valid. They further noted it was regular Roman practice to only allow a client kingdom to be independent for the lifetime of the initial king, such as had occurred in Galatia. The Empire formally annexed the kingdom, and began extracting harsh taxes immediately, citing that Prasutagus was indebted to the Romans, having taken several loans during his lifetime that he had failed to repay. Boudicca's complaint about this treatment and the defiance of her deceased husband's will was met with brutality; Roman soldiers flogged her, and her daughters, only children, were raped. Boudicca and her subjects were infuriated at the disgrace done to their queen and the children. With the Roman governor of Britain engaged with the druids in Cambria, now Wales, Boudicca was able to attract more followers from outside the Iceni, as they were hardly the only British tribe growing rapidly disillusioned with the Romans. Boudicca and her army laid waste to three cities, routed a Roman legion, and called on the memory of Arminius, a German who had routed the Romans from his lands, and their own ancestors who had driven off Caesar near a century earlier. Boudicca was defeated by a major tactical blunder in the Battle of Watling Street, leading to much of her force being slaughtered as they could not withdraw to safety. Boudicca herself escaped, and then slew her daughters, and then herself, to avoid further shame at Roman hands." - } - ] - } + } + ] + } ], "CivBonuses": [ { "Name": "Ardiosmanae", "History": "Represents Celtic farming methods. ", - "Description": "Enhanced food gained from ranching and farming. " + "Description": "Enhanced food gained from ranching and farming. " }, { "Name": "Deas Celtica", "History": "Celtic religion and druidry inspired their warlike mindset. ", - "Description": "Druids increase attack rates of soldiers near them slightly." - } + "Description": "Druids increase attack rates of soldiers near them slightly." + } ], "TeamBonuses": [ { "Name": "Druides", "History": "The Druids of the Celts maintained an organized religion that advanced the technology of their people even during wartime.", - "Description": "Bonus to tech speed." - } + "Description": "Bonus to tech speed." + } ], "Structures": [ @@ -84,13 +84,13 @@ "History": "The Britons were known for breeding war dogs.", "Requirements": "", "Phase": "", - "Special": "" - } + "Special": "" + } ], "StartEntities": [ { - "Template": "structures/brit_civil_centre" + "Template": "structures/brit_civil_centre" }, { "Template": "units/brit_support_female_citizen", @@ -98,18 +98,18 @@ }, { "Template": "units/brit_infantry_spearman_b", - "Count": 2 - }, + "Count": 2 + }, { "Template": "units/brit_infantry_slinger_b", - "Count": 2 - }, + "Count": 2 + }, { "Template": "units/brit_cavalry_javelinist_b", "Count": 1 }, { - "Template": "units/brit_war_dog_e" + "Template": "units/brit_war_dog_e" } ], "Formations": diff --git a/binaries/data/mods/public/simulation/data/civs/cart.json b/binaries/data/mods/public/simulation/data/civs/cart.json index c6e9efbd0b..d72d3b0805 100644 --- a/binaries/data/mods/public/simulation/data/civs/cart.json +++ b/binaries/data/mods/public/simulation/data/civs/cart.json @@ -110,7 +110,7 @@ "Requirements":".", "Phase":"", "Special":"Hire Iberian mercenaries." - } + } ], "StartEntities": [ diff --git a/binaries/data/mods/public/simulation/data/civs/gaul.json b/binaries/data/mods/public/simulation/data/civs/gaul.json index 28b4953a09..189a91a3aa 100644 --- a/binaries/data/mods/public/simulation/data/civs/gaul.json +++ b/binaries/data/mods/public/simulation/data/civs/gaul.json @@ -20,13 +20,13 @@ { "Name": "Uae Uictos", "History": "Means Woe to the Defeated. It was the words that the Gallic Leader, Brennos, spoke at the Capitol at Rome after they took their plunder.", - "Description": "A set amount of metal and food from every structure destroyed or captured." + "Description": "A set amount of metal and food from every structure destroyed or captured." }, { "Name": "Carnutes", "History": "The Carnutes were druids from Aulercia. They fought when needed, and were largely responsible for turning back the Belgae incursions into Armorica and Aulercia.", - "Description": "Gallic druids gain a small melee attack." - } + "Description": "Gallic druids gain a small melee attack." + } ], "Heroes": [ @@ -49,31 +49,31 @@ "Class": "", "Armament": "", "Emblem": "", - "History": "Vercingetorix (Gaulish: Ver-Rix Cingetos) was the chieftain of the Arverni tribe in Gaul (modern France). Starting in 52 B.C. he led a revolt against the invading Romans under Julius Caesar, his actions during the revolt are remembered to this day. Vercingetorix was probably born near his tribes capital (Gergovia). From what little info we have Vercingetorix was probably born in 72 B.C., his father was Celtius and we don't know who his mother was. Because we only know of him from Roman sources we don't know much about Vercingetorix as a child or young man, except that perhaps he was probably very high spirited and probably gained some renown in deeds." - } - ] - } + "History": "Vercingetorix (Gaulish: Ver-Rix Cingetos) was the chieftain of the Arverni tribe in Gaul (modern France). Starting in 52 B.C. he led a revolt against the invading Romans under Julius Caesar, his actions during the revolt are remembered to this day. Vercingetorix was probably born near his tribes capital (Gergovia). From what little info we have Vercingetorix was probably born in 72 B.C., his father was Celtius and we don't know who his mother was. Because we only know of him from Roman sources we don't know much about Vercingetorix as a child or young man, except that perhaps he was probably very high spirited and probably gained some renown in deeds." + } + ] + } ], "CivBonuses": [ { "Name": "Ardiosmanae", "History": "Represents Celtic farming methods. ", - "Description": "Enhanced food gained from ranching and farming. " + "Description": "Enhanced food gained from ranching and farming. " }, { "Name": "Deas Celtica", "History": "Celtic religion and druidry inspired their warlike mindset. ", - "Description": "Druids increase attack rates of soldiers near them slightly." - } + "Description": "Druids increase attack rates of soldiers near them slightly." + } ], "TeamBonuses": [ { "Name": "Druides", "History": "The Druids of the Celts maintained an organized religion that advanced the technology of their people even during wartime.", - "Description": "Bonus to tech speed." - } + "Description": "Bonus to tech speed." + } ], "Structures": [ @@ -84,13 +84,13 @@ "History": "The Celts developed the first rotary flour mill.", "Requirements": "", "Phase": "", - "Special": "" - } + "Special": "" + } ], "StartEntities": [ { - "Template": "structures/gaul_civil_centre" + "Template": "structures/gaul_civil_centre" }, { "Template": "units/gaul_support_female_citizen", @@ -98,14 +98,14 @@ }, { "Template": "units/gaul_infantry_spearman_b", - "Count": 2 + "Count": 2 }, { "Template": "units/gaul_infantry_javelinist_b", - "Count": 2 + "Count": 2 }, { - "Template": "units/gaul_cavalry_javelinist_b" + "Template": "units/gaul_cavalry_javelinist_b" } ], "Formations": diff --git a/binaries/data/mods/public/simulation/data/civs/iber.json b/binaries/data/mods/public/simulation/data/civs/iber.json index 5f893c4ee8..3b5eb41ba6 100644 --- a/binaries/data/mods/public/simulation/data/civs/iber.json +++ b/binaries/data/mods/public/simulation/data/civs/iber.json @@ -18,13 +18,13 @@ { "Name": "Suzko Txabalina", "History": "Iberian tribesmen were noted for wrapping bundles of grass about the shafts of their throwing spears, soaking that in some sort of flammable pitch, then setting it afire just before throwing.", - "Description": "Causes targets struck to become inflamed and lose hitpoints at a constant rate until and if either healed or repaired, as appropriate." + "Description": "Causes targets struck to become inflamed and lose hitpoints at a constant rate until and if either healed or repaired, as appropriate." }, { "Name": "Maisu Burdina Langileak", "History": "The Iberians were known to produce the finest iron and steel implements and weapons of the age. The famous 'Toledo Steel.'", - "Description": "Metal costs for units and technologies reduced by 50%." - } + "Description": "Metal costs for units and technologies reduced by 50%." + } ], "Heroes": [ @@ -48,9 +48,9 @@ "Armament": "", "Emblem": "", "History": "Indibil was king of the Ilergetes, a large federation ranged principally along the Ebro River in the northwest of the Iberian Peninsula. During the Barcid expansion, from 212 B.C. he had initially been talked into allying himself with the Carthaginians who had taken control of a lot of territory to the south and west, however after loss and his capture in a major battle he was convinced, some say tricked, to switch to the Roman side by Scipio Africanus. But that alliance didn't last long, as Roman promises were hollow and the Romans acted more like conquerors than allies. So, while the Romans and their allies had ended Carthaginian presence in 'Hispania' in 206 B.C., Indibil and another tribal prince by the name of Mandonio, who may have been his brother, rose up in rebellion against the Romans. They were defeated in battle, but rose up in a 2nd even larger rebellion that had unified all the Ilergetes again in 205 B.C. Outnumbered and outarmed they were again defeated, Indibil losing his life in the final battle and Mandonio being captured then later put to death. From that date onward the Ilergetes remained a pacified tribe under Roman rule." - } + } ] - } + } ], "CivBonuses": [ @@ -63,7 +63,7 @@ "Name": "Zaldi Saldoa", "History": "Not unlike Numidia in North Africa, the Iberian Peninsula was known as 'horse country', capable of producing up to 100,000 new mounts each year.", "Description": "The resource cost of training horse-mounted units (cavalry) is reduced by 5% per animal corralled." - } + } ], "TeamBonuses": [ @@ -71,7 +71,7 @@ "Name": "Saripeko", "History": "The Iberians were long known to provide mercenary soldiers to other nations to serve as auxiliaries to their armies in foreign wars. Carthage is the most well known example, and we have evidence of them serving in such a capacity in Aquitania.", "Description": "Citizen-soldier infantry skirmishers and cavalry skirmishers -20% cost for allies." - } + } ], "Structures": [ @@ -83,7 +83,7 @@ "Requirements": "", "Phase": "", "Special": "Defensive Aura - Gives all Iberian units and buildings within vision range of the monument a 10-15% attack boost. Build Limit: Only 5 may be built per map." - } + } ], "StartEntities": [ diff --git a/binaries/data/mods/public/simulation/data/civs/maur.json b/binaries/data/mods/public/simulation/data/civs/maur.json index 5d230aeabd..0d6829751b 100644 --- a/binaries/data/mods/public/simulation/data/civs/maur.json +++ b/binaries/data/mods/public/simulation/data/civs/maur.json @@ -71,7 +71,7 @@ "Name": "Evangelism.", "History": "Ashoka the Great sent embassies West to spread knowledge of the Buddha.", "Description": "Allied Temple techs -50% cost and research time." - } + } ], "Structures": [ diff --git a/binaries/data/mods/public/simulation/data/civs/pers.json b/binaries/data/mods/public/simulation/data/civs/pers.json index a0c8b7e924..04f20a945a 100644 --- a/binaries/data/mods/public/simulation/data/civs/pers.json +++ b/binaries/data/mods/public/simulation/data/civs/pers.json @@ -34,7 +34,7 @@ "Name": "Nisean War Horses", "History": "The beautiful and powerful breed of Nisean horses increases health for Persian cavalry.", "Description": "+25% health for cavalry, but +10% train time." - } + } ], "Heroes": [ @@ -43,14 +43,14 @@ "Class": "", "Armament": "", "Emblem": "", - "History": "Cyrus (ruled 559-530 B.C.) The son of a Median princess and the ruler of Anshan; justly called the 'Father of the Empire', Cyrus the Great conquered Media, Lydia, Babylonia and Bactria, thereby establishing the Persian Empire. He was also renown as a benevolent conqueror. (OP - Kurush). Technically the second ruler of the Persians by that name, and so appears as Kurush II on his documents and coins. Kurush I was his grandfather." + "History": "Cyrus (ruled 559-530 B.C.) The son of a Median princess and the ruler of Anshan; justly called the 'Father of the Empire', Cyrus the Great conquered Media, Lydia, Babylonia and Bactria, thereby establishing the Persian Empire. He was also renown as a benevolent conqueror. (OP - Kurush). Technically the second ruler of the Persians by that name, and so appears as Kurush II on his documents and coins. Kurush I was his grandfather." }, { "Name": "Darayavahush I", "Class": "", "Armament": "", "Emblem": "", - "History": "Darius (ruled 522-486 B.C.) The son of Vishtaspa (Hystaspes), the satrap of Parthia and Hyrcania; a great administrator as well as a decent general, Darius introduced the division of the empire into satrapies and conquered NW India, Thrace and Macedonia. He was called the 'Merchant of the Empire'." + "History": "Darius (ruled 522-486 B.C.) The son of Vishtaspa (Hystaspes), the satrap of Parthia and Hyrcania; a great administrator as well as a decent general, Darius introduced the division of the empire into satrapies and conquered NW India, Thrace and Macedonia. He was called the 'Merchant of the Empire'." }, { "Name": "Xsayarsa I", @@ -58,9 +58,9 @@ "Armament": "", "Emblem": "", "History": "Xerxes (ruled 485-465 B.C.) The son of Darius the Great and Atoosa, a daughter of Cyrus the Great, Xerxes was an able administrator, who also extended Imperial rule into Chorasmia. Apart from his failed invasion of Greece, he was famous for his extensive building programme, especially at Persepolis." - } + } ] - } + } ], "CivBonuses": [ @@ -73,7 +73,7 @@ "Name": "Great King's Levy", "History": "The Persians could and did levy a large number of infantry during wartime due to the sheer size of the Achaemenid Empire and the way in which it was set-up. In general the Persian infantry was well trained and fought with great tenacity. However while this was true the infantry were poor hand-to-hand, close combat fighters. Also, with the exception of the elite regiments, the Persian infantry was not a standing professional force.", "Description": "Persians have a +10% population cap bonus (e.g. 330 pop cap instead of the usual 300)." - } + } ], "TeamBonuses": [ @@ -81,7 +81,7 @@ "Name": "Royal Road", "History": "Coinage was invented by the Lydians in 7th Century B.C., but it was not very common until the Persian period. Darius the Great standardized coined money and his golden coins (known as 'darics') became commonplace not only throughout his empire, but as far to the west as Central Europe.", "Description": "+25% trade profit land routes." - } + } ], "Structures": [ @@ -92,7 +92,7 @@ "History": "The Persian Empire's best soldiers were Eastern horsemen.", "Requirements": "", "Phase": "Town", - "Special": "Train Cavalry citizen-soldiers." + "Special": "Train Cavalry citizen-soldiers." }, { "Name": "Apadana", @@ -101,7 +101,7 @@ "History": "The term Apadana designates a large hypostyle palace found in Persia. The best known example, and by far the largest, was the great Apadana at Persepolis. Functioning as the empire's central audience hall, the palace is famous for the reliefs of the tribute-bearers and of the army, including the Immortals.", "Requirements": "", "Phase": "City", - "Special": "Train heroes and Persian Immortals. Gives a slow trickle of all resources as 'Satrapy Tribute.'" + "Special": "Train heroes and Persian Immortals. Gives a slow trickle of all resources as 'Satrapy Tribute.'" } ], "StartEntities": @@ -115,14 +115,14 @@ }, { "Template": "units/pers_infantry_spearman_b", - "Count": 2 + "Count": 2 }, { "Template": "units/pers_infantry_archer_b", - "Count": 2 + "Count": 2 }, { - "Template": "units/pers_cavalry_javelinist_b" + "Template": "units/pers_cavalry_javelinist_b" } ], "Formations": diff --git a/binaries/data/mods/public/simulation/data/civs/rome.json b/binaries/data/mods/public/simulation/data/civs/rome.json index c79048a444..3e14f3ccf6 100644 --- a/binaries/data/mods/public/simulation/data/civs/rome.json +++ b/binaries/data/mods/public/simulation/data/civs/rome.json @@ -43,22 +43,22 @@ "Armament": "", "Emblem": "", "History": "He was the first really successful Roman general against the Carthaginians. His campaigns in Spain and Africa helped to bring Carthage to its knees during the Second Punic War. He defeated Hannibal at the Battle of Zama in 202 B.C." - } + } ] - } + } ], "CivBonuses": [ { "Name": "Testudo Formation", "History": "The Romans commonly used the Testudo or 'turtle' formation for defense: Legionaries were formed into hollow squares with twelve men on each side, standing so close together that their shields overlapped like fish scales.", - "Description": "Roman Legionaries can form a Testudo." + "Description": "Roman Legionaries can form a Testudo." }, { "Name": "Citizenship", "History": "Roman Citizenship was highly prized in the ancient world. Basic rights and privileges were afforded Roman citizens that were denied other conquered peoples. It is said that harming a Roman citizen was akin to harming Rome herself, and would cause the entire might of Rome to fall upon the perpetrator.", "Description": "Any Roman citizen-soldier fighting within Roman territory gains a non-permanent +10% bonus in armor." - } + } ], "TeamBonuses": [ @@ -66,7 +66,7 @@ "Name": "Socii", "History": "Being allied with Rome came with great benefits (as well as great peril).", "Description": "Allied citizen-soldiers gain a +15% attack when in Roman territory." - } + } ], "Structures": [ @@ -77,7 +77,7 @@ "History": "Sometimes it was a temporary camp built facing the route by which the army is to march, other times a defensive or offensive (for sieges) structure. Within the Praetorian gate, which should either front the east or the enemy, the tents of the first centuries or cohorts are pitched, and the dracos (ensigns of cohorts) and other ensigns planted. The Decumane gate is directly opposite to the Praetorian in the rear of the camp, and through this the soldiers are conducted to the place appointed for punishment or execution. It has a turf wall, and it's surrounded by a canal filled with water whenever possible for extra defense. Many towns started up as bigger military camps to evolve to more complicated cities.", "Requirements": "", "Phase": "", - "Special": "Trains citizen-soldiers from neutral or enemy territory." + "Special": "Trains citizen-soldiers from neutral or enemy territory." }, { "Name": "Murus Latericius", @@ -86,8 +86,8 @@ "History": "Turf walls built by legionaries during sieges.", "Requirements": "", "Phase": "", - "Special": "Can be built in neutral and enemy territory to strangle enemy towns." - } + "Special": "Can be built in neutral and enemy territory to strangle enemy towns." + } ], "StartEntities": [ @@ -101,7 +101,7 @@ { "Template": "units/rome_infantry_swordsman_b", "Count": 2 - }, + }, { "Template": "units/rome_infantry_javelinist_b", "Count": 2 diff --git a/binaries/data/mods/public/simulation/data/civs/sele.json b/binaries/data/mods/public/simulation/data/civs/sele.json index 39619c14e8..4da3e84887 100644 --- a/binaries/data/mods/public/simulation/data/civs/sele.json +++ b/binaries/data/mods/public/simulation/data/civs/sele.json @@ -35,7 +35,7 @@ "Name": "Nisean War Horses", "History": "The beautiful and powerful breed of Nisean horses increases health for Seleucid cavalry.", "Description": "+25% health for cavalry, but +10% train time." - } + } ], "Heroes": [ diff --git a/binaries/data/mods/public/simulation/data/civs/spart.json b/binaries/data/mods/public/simulation/data/civs/spart.json index fee64cc3ac..c5e500a3a3 100644 --- a/binaries/data/mods/public/simulation/data/civs/spart.json +++ b/binaries/data/mods/public/simulation/data/civs/spart.json @@ -117,7 +117,7 @@ { "Template": "units/spart_infantry_spearman_b", "Count": 2 - }, + }, { "Template": "units/spart_infantry_javelinist_b", "Count": 2 diff --git a/binaries/data/mods/public/simulation/data/settings/wonder_times.json b/binaries/data/mods/public/simulation/data/settings/wonder_times.json index 5dd31c00d5..3898c7d7fb 100644 --- a/binaries/data/mods/public/simulation/data/settings/wonder_times.json +++ b/binaries/data/mods/public/simulation/data/settings/wonder_times.json @@ -1,4 +1,4 @@ { - "Times": [0, 1, 3, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 75, 90, 105, 120], + "Times": [0, 1, 3, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 75, 90, 105, 120], "Default": 20 } diff --git a/binaries/data/mods/public/simulation/data/technologies/attack_cav_lance.json b/binaries/data/mods/public/simulation/data/technologies/attack_cav_lance.json index 3f45087d47..86e9073121 100644 --- a/binaries/data/mods/public/simulation/data/technologies/attack_cav_lance.json +++ b/binaries/data/mods/public/simulation/data/technologies/attack_cav_lance.json @@ -1,5 +1,5 @@ { - "pair": "pair_cav_01", + "pair": "pair_cav_01", "genericName": "Cavalry Lance", "specificName": { "mace": "Xystón", diff --git a/binaries/data/mods/public/simulation/data/technologies/attack_champions_elite.json b/binaries/data/mods/public/simulation/data/technologies/attack_champions_elite.json index 871ac394bb..0b4ed4d756 100644 --- a/binaries/data/mods/public/simulation/data/technologies/attack_champions_elite.json +++ b/binaries/data/mods/public/simulation/data/technologies/attack_champions_elite.json @@ -1,4 +1,4 @@ -{ +{ "genericName": "Heroism", "specificName": { "mace": "Andreía", diff --git a/binaries/data/mods/public/simulation/data/technologies/buildtime_walls_rubble.json b/binaries/data/mods/public/simulation/data/technologies/buildtime_walls_rubble.json index a45e86d00e..f5b4ca6763 100644 --- a/binaries/data/mods/public/simulation/data/technologies/buildtime_walls_rubble.json +++ b/binaries/data/mods/public/simulation/data/technologies/buildtime_walls_rubble.json @@ -1,5 +1,5 @@ { - "pair": "pair_walls_01", + "pair": "pair_walls_01", "genericName": "Rubble Materials", "description": "Using rubble materials reduces the costs and build times of walls.", "cost": {"food": 0, "wood": 200, "stone": 0, "metal": 0}, diff --git a/binaries/data/mods/public/simulation/data/technologies/gather_capacity_basket.json b/binaries/data/mods/public/simulation/data/technologies/gather_capacity_basket.json index b63bd6b5b3..22a1c08391 100644 --- a/binaries/data/mods/public/simulation/data/technologies/gather_capacity_basket.json +++ b/binaries/data/mods/public/simulation/data/technologies/gather_capacity_basket.json @@ -11,7 +11,7 @@ {"value": "ResourceGatherer/Capacities/food", "add": 5}, {"value": "ResourceGatherer/Capacities/wood", "add": 5}, {"value": "ResourceGatherer/Capacities/stone", "add": 5}, - {"value": "ResourceGatherer/Capacities/metal", "add": 5} + {"value": "ResourceGatherer/Capacities/metal", "add": 5} ], "affects": ["Worker"], "soundComplete": "interface/alarm/alarm_upgradearmory.xml" diff --git a/binaries/data/mods/public/simulation/data/technologies/gather_capacity_carts.json b/binaries/data/mods/public/simulation/data/technologies/gather_capacity_carts.json index a31dff4b9f..84d9f3397d 100644 --- a/binaries/data/mods/public/simulation/data/technologies/gather_capacity_carts.json +++ b/binaries/data/mods/public/simulation/data/technologies/gather_capacity_carts.json @@ -12,7 +12,7 @@ {"value": "ResourceGatherer/Capacities/food", "add": 10}, {"value": "ResourceGatherer/Capacities/wood", "add": 10}, {"value": "ResourceGatherer/Capacities/stone", "add": 10}, - {"value": "ResourceGatherer/Capacities/metal", "add": 10} + {"value": "ResourceGatherer/Capacities/metal", "add": 10} ], "affects": ["Worker"], "soundComplete": "interface/alarm/alarm_upgradearmory.xml" diff --git a/binaries/data/mods/public/simulation/data/technologies/gather_capacity_wheelbarrow.json b/binaries/data/mods/public/simulation/data/technologies/gather_capacity_wheelbarrow.json index cba1b0144f..be4a6ea853 100644 --- a/binaries/data/mods/public/simulation/data/technologies/gather_capacity_wheelbarrow.json +++ b/binaries/data/mods/public/simulation/data/technologies/gather_capacity_wheelbarrow.json @@ -12,7 +12,7 @@ {"value": "ResourceGatherer/Capacities/food", "add": 5}, {"value": "ResourceGatherer/Capacities/wood", "add": 5}, {"value": "ResourceGatherer/Capacities/stone", "add": 5}, - {"value": "ResourceGatherer/Capacities/metal", "add": 5} + {"value": "ResourceGatherer/Capacities/metal", "add": 5} ], "affects": ["Worker"], "soundComplete": "interface/alarm/alarm_upgradearmory.xml" diff --git a/binaries/data/mods/public/simulation/data/technologies/gather_lumbering_ironaxes.json b/binaries/data/mods/public/simulation/data/technologies/gather_lumbering_ironaxes.json index 3a0fee5696..e500e2ab96 100644 --- a/binaries/data/mods/public/simulation/data/technologies/gather_lumbering_ironaxes.json +++ b/binaries/data/mods/public/simulation/data/technologies/gather_lumbering_ironaxes.json @@ -1,4 +1,4 @@ -{ +{ "genericName": "Iron Ax Heads", "description": "Increases wood gathering rates for trees.", "cost": {"food": 0, "wood": 200, "stone": 0, "metal": 50}, diff --git a/binaries/data/mods/public/simulation/data/technologies/gather_mining_serfs.json b/binaries/data/mods/public/simulation/data/technologies/gather_mining_serfs.json index 0be7bae9d4..520a298a0b 100644 --- a/binaries/data/mods/public/simulation/data/technologies/gather_mining_serfs.json +++ b/binaries/data/mods/public/simulation/data/technologies/gather_mining_serfs.json @@ -1,4 +1,4 @@ -{ +{ "genericName": "Serfs", "specificName": { "mace": "Heílōtes", diff --git a/binaries/data/mods/public/simulation/data/technologies/health_walls_geometric_masonry.json b/binaries/data/mods/public/simulation/data/technologies/health_walls_geometric_masonry.json index acdb9c85eb..1382fd8192 100644 --- a/binaries/data/mods/public/simulation/data/technologies/health_walls_geometric_masonry.json +++ b/binaries/data/mods/public/simulation/data/technologies/health_walls_geometric_masonry.json @@ -1,5 +1,5 @@ { - "pair": "pair_walls_01", + "pair": "pair_walls_01", "genericName": "Geometric Masonry", "description": "Using geometric masonry increases the sturdiness of defensive walls.", "cost": {"food": 0, "wood": 0, "stone": 200, "metal": 0}, diff --git a/binaries/data/mods/public/simulation/data/technologies/training_levy_cavalry.json b/binaries/data/mods/public/simulation/data/technologies/training_levy_cavalry.json index 2fc9a81f02..75761d702d 100644 --- a/binaries/data/mods/public/simulation/data/technologies/training_levy_cavalry.json +++ b/binaries/data/mods/public/simulation/data/technologies/training_levy_cavalry.json @@ -1,5 +1,5 @@ { - "pair": "pair_levy_01", + "pair": "pair_levy_01", "genericName": "Levy Cavalry", "description": "Calling up cavalry levies in time of war helps bolster the ranks of a king's army.", "cost": {"food": 100, "wood": 0, "stone": 0, "metal": 0}, diff --git a/binaries/data/mods/public/simulation/data/technologies/training_levy_infantry.json b/binaries/data/mods/public/simulation/data/technologies/training_levy_infantry.json index fb15f0fde4..5c6d66e6bf 100644 --- a/binaries/data/mods/public/simulation/data/technologies/training_levy_infantry.json +++ b/binaries/data/mods/public/simulation/data/technologies/training_levy_infantry.json @@ -1,5 +1,5 @@ { - "pair": "pair_levy_01", + "pair": "pair_levy_01", "genericName": "Levy Infantry", "description": "Calling up infantry levies in time of war helps bolster the ranks of a king's army.", "cost": {"food": 100, "wood": 0, "stone": 0, "metal": 0}, diff --git a/binaries/data/mods/public/simulation/helpers/FSM.js b/binaries/data/mods/public/simulation/helpers/FSM.js index 05271b8198..44ecb034d5 100644 --- a/binaries/data/mods/public/simulation/helpers/FSM.js +++ b/binaries/data/mods/public/simulation/helpers/FSM.js @@ -240,7 +240,7 @@ function FSM(spec) FSM.prototype.Init = function(obj, initialState) { this.deferFromState = undefined; - + obj.fsmStateName = ""; obj.fsmNextState = undefined; this.SwitchToNextState(obj, initialState); @@ -306,7 +306,7 @@ FSM.prototype.DeferMessage = function(obj, msg) var func = state[msg.type]; if (!func) error("Failed to defer event '" + msg.type + "' from state '" + obj.fsmStateName + "'"); - func.apply(obj, [msg]); + func.apply(obj, [msg]); // Restore the changes we made this.deferFromState = old; @@ -336,7 +336,7 @@ FSM.prototype.SwitchToNextState = function(obj, nextStateName) { var fromState = this.decompose[obj.fsmStateName]; var toState = this.decompose[nextStateName]; - + if (!toState) error("Tried to change to non-existent state '" + nextStateName + "'"); @@ -348,11 +348,11 @@ FSM.prototype.SwitchToNextState = function(obj, nextStateName) for (var equalPrefix = 0; fromState[equalPrefix] && fromState[equalPrefix] === toState[equalPrefix]; ++equalPrefix) { } - + // Check if we should exit and enter the current state due to the reenter parameter. If so we go up 1 level if (obj.fsmReenter && equalPrefix > 0 && equalPrefix === toState.length) --equalPrefix; - + for (var i = fromState.length-1; i >= equalPrefix; --i) { var leave = this.states[fromState[i]].leave; @@ -366,7 +366,7 @@ FSM.prototype.SwitchToNextState = function(obj, nextStateName) } } } - + for (var i = equalPrefix; i < toState.length; ++i) { var enter = this.states[toState[i]].enter; diff --git a/binaries/data/mods/public/simulation/helpers/InitGame.js b/binaries/data/mods/public/simulation/helpers/InitGame.js index 1541946a79..0da8fa95f8 100644 --- a/binaries/data/mods/public/simulation/helpers/InitGame.js +++ b/binaries/data/mods/public/simulation/helpers/InitGame.js @@ -6,10 +6,10 @@ function PreInitGame() { // We need to replace skirmish "default" entities with real ones. // This needs to happen before AI initialization (in InitGame). - // And we need to flush destroyed entities otherwise the AI gets the wrong game state in + // And we need to flush destroyed entities otherwise the AI gets the wrong game state in // the beginning and a bunch of "destroy" messages on turn 0, which just shouldn't happen. Engine.BroadcastMessage(MT_SkirmishReplace, {}); - Engine.FlushDestroyedEntities(); + Engine.FlushDestroyedEntities(); let numPlayers = Engine.QueryInterface(SYSTEM_ENTITY, IID_PlayerManager).GetNumPlayers(); for (let i = 1; i < numPlayers; ++i) // ignore gaia diff --git a/binaries/data/mods/public/simulation/helpers/Player.js b/binaries/data/mods/public/simulation/helpers/Player.js index 833176f059..ea104917bb 100644 --- a/binaries/data/mods/public/simulation/helpers/Player.js +++ b/binaries/data/mods/public/simulation/helpers/Player.js @@ -113,7 +113,7 @@ function LoadPlayerSettings(settings, newPlayers) if (getSetting(playerData, playerDefaults, i, "DisabledTechnologies") !== undefined) cmpPlayer.SetDisabledTechnologies(getSetting(playerData, playerDefaults, i, "DisabledTechnologies")); - let disabledTemplates = []; + let disabledTemplates = []; if (settings.DisabledTemplates !== undefined) disabledTemplates = settings.DisabledTemplates; if (getSetting(playerData, playerDefaults, i, "DisabledTemplates") !== undefined) diff --git a/binaries/data/mods/public/simulation/helpers/RallyPointCommands.js b/binaries/data/mods/public/simulation/helpers/RallyPointCommands.js index e8648c97b1..6fae3d4718 100644 --- a/binaries/data/mods/public/simulation/helpers/RallyPointCommands.js +++ b/binaries/data/mods/public/simulation/helpers/RallyPointCommands.js @@ -36,7 +36,7 @@ function GetRallyPointCommands(cmpRallyPoint, spawnedEnts) "queued": true }); break; - case "repair": + case "repair": case "build": ret.push({ "type": "repair", @@ -46,7 +46,7 @@ function GetRallyPointCommands(cmpRallyPoint, spawnedEnts) "autocontinue": i == rallyPos.length - 1 }); break; - case "garrison": + case "garrison": ret.push({ "type": "garrison", "entities": spawnedEnts, diff --git a/binaries/data/mods/public/simulation/helpers/Setup.js b/binaries/data/mods/public/simulation/helpers/Setup.js index 5c3b8aa153..b2fa1e6c0b 100644 --- a/binaries/data/mods/public/simulation/helpers/Setup.js +++ b/binaries/data/mods/public/simulation/helpers/Setup.js @@ -63,7 +63,7 @@ function LoadMapSettings(settings) else cmpGarrisonHolder.initGarrison = settings.Garrison[holder]; } - + let cmpCeasefireManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_CeasefireManager); if (settings.Ceasefire) cmpCeasefireManager.StartCeasefire(settings.Ceasefire * 60 * 1000); diff --git a/binaries/data/mods/public/simulation/helpers/ValueModification.js b/binaries/data/mods/public/simulation/helpers/ValueModification.js index b7f8f07a51..70fa62fd9d 100644 --- a/binaries/data/mods/public/simulation/helpers/ValueModification.js +++ b/binaries/data/mods/public/simulation/helpers/ValueModification.js @@ -30,7 +30,7 @@ function ApplyValueModificationsToTemplate(tech_type, current_value, playerID, t if (cmpTechnologyManager) value = cmpTechnologyManager.ApplyModificationsTemplate(tech_type, current_value, template); - let cmpAuraManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_AuraManager); + let cmpAuraManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_AuraManager); if (!cmpAuraManager) return value; return cmpAuraManager.ApplyTemplateModifications(tech_type, value, playerID, template); diff --git a/binaries/data/mods/public/simulation/helpers/Walls.js b/binaries/data/mods/public/simulation/helpers/Walls.js index 9e875785d7..a3e2eb5c34 100644 --- a/binaries/data/mods/public/simulation/helpers/Walls.js +++ b/binaries/data/mods/public/simulation/helpers/Walls.js @@ -4,9 +4,9 @@ * - 'template': the template name of the entity * - 'pos': position of the entity, as an object with keys 'x' and 'z' * - 'angle': orientation of the entity, as an angle in radians - * + * * All the pieces in the resulting array are ordered left-to-right (or right-to-left) as they appear in the physical wall. - * + * * @param placementData Object that associates the wall piece template names with information about those kinds of pieces. * Expects placementData[templateName].templateData to contain the parsed template information about * the template whose filename is templateName. @@ -108,13 +108,13 @@ function GetWallPlacement(placementData, wallSet, start, end) /** * Helper function for GetWallPlacement. Finds a list of wall segments and the corresponding remaining spacing/overlap * distance "r" that will suffice to construct a wall of the given distance. It is understood that two extra towers will - * be placed centered at the starting and ending points of the wall. - * + * be placed centered at the starting and ending points of the wall. + * * @param d Total distance between starting and ending points (constant throughout calls). * @param candidateSegments List of candidate segments (constant throughout calls). Should be ordered longer-to-shorter * for better execution speed. * @param minOverlap Minimum overlap factor (constant throughout calls). Must have a value between 0 (meaning walls are - * not allowed to overlap towers) and 1 (meaning they're allowed to overlap towers entirely). + * not allowed to overlap towers) and 1 (meaning they're allowed to overlap towers entirely). * Must be <= maxOverlap. * @param maxOverlap Maximum overlap factor (constant throughout calls). Must have a value between 0 (meaning walls are * not allowed to overlap towers) and 1 (meaning they're allowed to overlap towers entirely). @@ -125,7 +125,7 @@ function GetWallPlacement(placementData, wallSet, start, end) */ function GetWallSegmentsRec(d, candidateSegments, minOverlap, maxOverlap, t, distSoFar, segments) { - // The idea is to find a number N of wall segments (excluding towers) so that the sum of their lengths adds up to a + // The idea is to find a number N of wall segments (excluding towers) so that the sum of their lengths adds up to a // value that is within certain bounds of the distance 'd' between the starting and ending points of the wall. This // creates either a positive or negative 'buffer' of space, that can be compensated for by spacing the wall segments // out away from each other, or inwards, overlapping each other. The spaces or overlaps can then be covered up by @@ -136,7 +136,7 @@ function GetWallSegmentsRec(d, candidateSegments, minOverlap, maxOverlap, t, dis // They are allowed to contribute to the buffer space. // // The buffer space equals the difference between d and the sum of the lengths of all the wall segments, and is denoted - // 'r' for 'remaining space'. Positive values of r mean that the walls will need to be spaced out, negative values of r + // 'r' for 'remaining space'. Positive values of r mean that the walls will need to be spaced out, negative values of r // mean that they will need to overlap. Clearly, there are limits to how far wall segments can be spaced out or // overlapped, depending on how much 'buffer space' each tower provides, and how far 'into' towers the wall segments are // allowed to overlap. @@ -144,26 +144,26 @@ function GetWallSegmentsRec(d, candidateSegments, minOverlap, maxOverlap, t, dis // Let 't' signify the width of a tower. When there are N wall segments, then the maximum distance that can be covered // using only these walls (plus the towers covering up any gaps) is achieved when the walls and towers touch outer-border- // to-outer-border. Therefore, the maximum value of r is then given by: - // + // // rMax = t/2 + (N-1)*t + t/2 // = N*t - // + // // where the two half-tower widths are buffer space contributed by the implied towers on the starting and ending points. // Similarly, a value rMin = -N*t can be derived for the minimal value of r. Note that a value of r = 0 means that the // wall segment lengths add up to exactly d, meaning that each one starts and ends right in the center of a tower. - // + // // Thus, we establish: // -Nt <= r <= Nt // // We can further generalize this by adding in parameters to control the depth to within which wall segments are allowed to // overlap with a tower. The bounds above assume that a wall segment is allowed to overlap across the entire range of 0 // (not overlapping at all, as in the upper boundary) to 1 (overlapping maximally, as in the lower boundary). - // + // // By requiring that walls overlap towers to a degree of at least 0 < minOverlap <= 1, it is clear that this lowers the // distance that can be maximally reached by the same set of wall segments, compared to the value of minOverlap = 0 that // we assumed to initially find Nt. - // - // Consider a value of minOverlap = 0.5, meaning that any wall segment must protrude at least halfway into towers; in this + // + // Consider a value of minOverlap = 0.5, meaning that any wall segment must protrude at least halfway into towers; in this // situation, wall segments must at least touch boundaries or overlap mutually, implying that the sum of their lengths // must equal or exceed 'd', establishing an upper bound of 0 for r. // Similarly, consider a value of minOverlap = 1, meaning that any wall segment must overlap towers maximally; this situation @@ -171,23 +171,23 @@ function GetWallSegmentsRec(d, candidateSegments, minOverlap, maxOverlap, t, dis // // With the implicit value minOverlap = 0 that yielded the upper bound Nt above, simple interpolation and a similar exercise // for maxOverlap, we find: - // (1-2*maxOverlap) * Nt <= r <= (1-2*minOverlap) * Nt + // (1-2*maxOverlap) * Nt <= r <= (1-2*minOverlap) * Nt // // To find N segments that satisfy this requirement, we try placing L, M and S wall segments in turn and continue recursively - // as long as the value of r is not within the bounds. If continuing recursively returns an impossible configuration, we + // as long as the value of r is not within the bounds. If continuing recursively returns an impossible configuration, we // backtrack and try a wall segment of the next length instead. Note that we should prefer to use the long segments first since // they can be replaced by gates. - + for (let candSegment of candidateSegments) { segments.push(candSegment); - + let newDistSoFar = distSoFar + candSegment.len; let r = d - newDistSoFar; - + let rLowerBound = (1 - 2 * maxOverlap) * segments.length * t; let rUpperBound = (1 - 2 * minOverlap) * segments.length * t; - + if (r < rLowerBound) { // we've allocated too much wall length, pop the last segment and try the next @@ -210,7 +210,7 @@ function GetWallSegmentsRec(d, candidateSegments, minOverlap, maxOverlap, t, dis return { "segments": segments, "r": r }; } - + return false; } diff --git a/binaries/data/mods/public/simulation/templates/formations/syntagma.xml b/binaries/data/mods/public/simulation/templates/formations/syntagma.xml index 8cd8f3c17d..5fc4836cc3 100644 --- a/binaries/data/mods/public/simulation/templates/formations/syntagma.xml +++ b/binaries/data/mods/public/simulation/templates/formations/syntagma.xml @@ -23,8 +23,8 @@ 1..2,1..-1: syntagma_front_run; 3..4,1..-1: syntagma_med_run; 4..8,1..-1: syntagma_back_run - - + + true diff --git a/binaries/data/mods/public/simulation/templates/other/bridge_hele.xml b/binaries/data/mods/public/simulation/templates/other/bridge_hele.xml index dbe722fcfe..1f36efb444 100644 --- a/binaries/data/mods/public/simulation/templates/other/bridge_hele.xml +++ b/binaries/data/mods/public/simulation/templates/other/bridge_hele.xml @@ -21,7 +21,7 @@ - + diff --git a/binaries/data/mods/public/simulation/templates/other/bridge_wooden.xml b/binaries/data/mods/public/simulation/templates/other/bridge_wooden.xml index 89b4e7ebc4..b55ad7b4c7 100644 --- a/binaries/data/mods/public/simulation/templates/other/bridge_wooden.xml +++ b/binaries/data/mods/public/simulation/templates/other/bridge_wooden.xml @@ -21,7 +21,7 @@ - + diff --git a/binaries/data/mods/public/simulation/templates/special/marker_object_sound.xml b/binaries/data/mods/public/simulation/templates/special/marker_object_sound.xml index 48acc29c88..6dfdff13ed 100644 --- a/binaries/data/mods/public/simulation/templates/special/marker_object_sound.xml +++ b/binaries/data/mods/public/simulation/templates/special/marker_object_sound.xml @@ -18,7 +18,7 @@ - + diff --git a/binaries/data/mods/public/simulation/templates/template_structure.xml b/binaries/data/mods/public/simulation/templates/template_structure.xml index ec926508a2..f3bc3255c3 100644 --- a/binaries/data/mods/public/simulation/templates/template_structure.xml +++ b/binaries/data/mods/public/simulation/templates/template_structure.xml @@ -45,10 +45,10 @@ - - 0.85 - 0.65 - 0.35 + + 0.85 + 0.65 + 0.35 corpse 0 diff --git a/binaries/data/mods/public/simulation/templates/template_structure_defense_wallset.xml b/binaries/data/mods/public/simulation/templates/template_structure_defense_wallset.xml index e4d4028d7f..fb8409128d 100644 --- a/binaries/data/mods/public/simulation/templates/template_structure_defense_wallset.xml +++ b/binaries/data/mods/public/simulation/templates/template_structure_defense_wallset.xml @@ -1,6 +1,6 @@ diff --git a/binaries/data/mods/public/simulation/templates/template_unit_hero.xml b/binaries/data/mods/public/simulation/templates/template_unit_hero.xml index e6b09646f6..71fd442f5d 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_hero.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_hero.xml @@ -10,7 +10,7 @@ 15 4 1000 - + hero_garrison diff --git a/binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_fire.xml b/binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_fire.xml index 61d712afbc..8b2b58a63b 100644 --- a/binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_fire.xml +++ b/binaries/data/mods/public/simulation/templates/template_unit_mechanical_ship_fire.xml @@ -23,9 +23,9 @@ 500 -3 - 0.85 - 0.65 - 0.35 + 0.85 + 0.65 + 0.35 diff --git a/binaries/data/mods/public/simulation/templates/units/cart_hero_hannibal.xml b/binaries/data/mods/public/simulation/templates/units/cart_hero_hannibal.xml index 7bb6e54693..76abf2e141 100644 --- a/binaries/data/mods/public/simulation/templates/units/cart_hero_hannibal.xml +++ b/binaries/data/mods/public/simulation/templates/units/cart_hero_hannibal.xml @@ -7,7 +7,7 @@ Ḥannibaʿal Baraq Carthage's most famous son. Hannibal Barca was the eldest son of Hamilcar Barca and proved an even greater commander than his father. Lived 247-182 BC. While he ultimately lost the Second Punic War, his victories at Trebia, Lake Trasimene, and Cannae, and the feat of crossing the Alps have secured his position as among the best tacticians and strategists in history. units/cart_hero_hannibal.png - "Strategist" Ability (TBD): The player can see changes within the fog of war while Hannibal lives. + "Strategist" Ability (TBD): The player can see changes within the fog of war while Hannibal lives. Can run amok. diff --git a/binaries/data/mods/public/simulation/templates/units/spart_support_female_citizen.xml b/binaries/data/mods/public/simulation/templates/units/spart_support_female_citizen.xml index 238869e7de..11865d1bf3 100644 --- a/binaries/data/mods/public/simulation/templates/units/spart_support_female_citizen.xml +++ b/binaries/data/mods/public/simulation/templates/units/spart_support_female_citizen.xml @@ -29,8 +29,8 @@ units/hele_support_female_citizen.png units/spart_support_female_citizen - - standground + + standground units/spartans/female_citizen.xml diff --git a/build/android/sdl-project/jni/src/pyrogenesis_wrapper.cpp b/build/android/sdl-project/jni/src/pyrogenesis_wrapper.cpp index e01ed37edd..40b0b6e0b6 100644 --- a/build/android/sdl-project/jni/src/pyrogenesis_wrapper.cpp +++ b/build/android/sdl-project/jni/src/pyrogenesis_wrapper.cpp @@ -27,4 +27,4 @@ int main(int argc, char* argv[]) __android_log_print(ANDROID_LOG_INFO, "pyrogenesis", "Launching engine code"); return ((int(*)(int, char*[]))pyromain)(argc, argv); -} \ No newline at end of file +} diff --git a/source/collada/GeomReindex.cpp b/source/collada/GeomReindex.cpp index 1e6527eb6a..2bbaf65381 100644 --- a/source/collada/GeomReindex.cpp +++ b/source/collada/GeomReindex.cpp @@ -36,7 +36,7 @@ typedef std::pair uv_pair_type; struct VertexData { - VertexData(const float* pos, const float* norm, const std::vector &uvs, + VertexData(const float* pos, const float* norm, const std::vector &uvs, const std::vector& weights) : x(pos[0]), y(pos[1]), z(pos[2]), nx(norm[0]), ny(norm[1]), nz(norm[2]), diff --git a/source/collada/PMDConvert.cpp b/source/collada/PMDConvert.cpp index db76eb7915..ec02151e4d 100644 --- a/source/collada/PMDConvert.cpp +++ b/source/collada/PMDConvert.cpp @@ -222,7 +222,7 @@ public: size_t jointCount = std::min(skin->GetJointCount(), controllerInstance.GetJointCount()); if (skin->GetJointCount() != controllerInstance.GetJointCount()) { - Log(LOG_WARNING, "Mismatched bone counts (skin has %d, skeleton has %d)", + Log(LOG_WARNING, "Mismatched bone counts (skin has %d, skeleton has %d)", skin->GetJointCount(), controllerInstance.GetJointCount()); for (size_t i = 0; i < skin->GetJointCount(); ++i) Log(LOG_INFO, "Skin joint %d: %s", i, skin->GetJoint(i)->GetId().c_str()); @@ -503,9 +503,9 @@ public: output("PSMD", 4); // magic number write(output, (uint32)4); // version number write(output, (uint32)( - // for UVs, we add one uint32 (i.e. 4 bytes) per model that gives the number of - // texcoord sets in the model, plus 2 floats per new UV - // pair per vertex (i.e. 8 bytes * number of pairs * vertex count) + // for UVs, we add one uint32 (i.e. 4 bytes) per model that gives the number of + // texcoord sets in the model, plus 2 floats per new UV + // pair per vertex (i.e. 8 bytes * number of pairs * vertex count) 4 + 11*4*vertexCount + 4 + 8*texcoords.size()*vertexCount + // vertices 4 + 6*faceCount + // faces 4 + 7*4*boneCount + // bones diff --git a/source/graphics/CinemaManager.cpp b/source/graphics/CinemaManager.cpp index 86e4991e0b..ee1610df73 100644 --- a/source/graphics/CinemaManager.cpp +++ b/source/graphics/CinemaManager.cpp @@ -100,8 +100,8 @@ void CCinemaManager::SetEnabled(bool enabled) // TODO: Enabling/Disabling does not work if the session GUI page is not the top page. // This can happen in various situations, for example when the player wins/looses the game - // while the cinematic is running (a message box is the top page in this case). - // It might be better to disable the whole GUI during the cinematic instead of a specific + // while the cinematic is running (a message box is the top page in this case). + // It might be better to disable the whole GUI during the cinematic instead of a specific // GUI object. // sn - session gui object diff --git a/source/graphics/LOSTexture.cpp b/source/graphics/LOSTexture.cpp index ee12cd85d6..b4cab5aae8 100644 --- a/source/graphics/LOSTexture.cpp +++ b/source/graphics/LOSTexture.cpp @@ -157,7 +157,7 @@ void CLOSTexture::InterpolateLOS() glGetIntegerv(GL_FRAMEBUFFER_BINDING_EXT, &originalFBO); pglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_smoothFbo); - pglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, + pglFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, whichTex ? m_TextureSmooth2 : m_TextureSmooth1, 0); GLenum status = pglCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT); diff --git a/source/graphics/MaterialManager.cpp b/source/graphics/MaterialManager.cpp index 74462a0ccd..144e00220f 100644 --- a/source/graphics/MaterialManager.cpp +++ b/source/graphics/MaterialManager.cpp @@ -133,7 +133,7 @@ CMaterial CMaterialManager::LoadMaterial(const VfsPath& pathname) { typeID = DCOND_DISTANCE; - float valmin = -1.0f; + float valmin = -1.0f; float valmax = -1.0f; CStr conf = attrs.GetNamedItem(at_conf); @@ -171,8 +171,8 @@ CMaterial CMaterialManager::LoadMaterial(const VfsPath& pathname) } } - material.AddConditionalDefine(attrs.GetNamedItem(at_name).c_str(), - attrs.GetNamedItem(at_value).c_str(), + material.AddConditionalDefine(attrs.GetNamedItem(at_name).c_str(), + attrs.GetNamedItem(at_value).c_str(), typeID, args); } else if (token == el_uniform) diff --git a/source/graphics/Model.cpp b/source/graphics/Model.cpp index d85f512923..2506c29347 100644 --- a/source/graphics/Model.cpp +++ b/source/graphics/Model.cpp @@ -140,7 +140,7 @@ void CModel::CalcStaticObjectBounds() } ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// CalcAnimatedObjectBound: calculate bounds encompassing all vertex positions for given animation +// CalcAnimatedObjectBound: calculate bounds encompassing all vertex positions for given animation void CModel::CalcAnimatedObjectBounds(CSkeletonAnimDef* anim, CBoundingBoxAligned& result) { result.SetEmpty(); @@ -215,26 +215,26 @@ const CBoundingBoxAligned CModel::GetObjectSelectionBoundsRec() if (propSelectionBounds.IsEmpty()) continue; // submodel does not wish to participate in selection box, exclude it - // We have the prop's bounds in its own object-space; now we need to transform them so they can be properly added + // We have the prop's bounds in its own object-space; now we need to transform them so they can be properly added // to the bounds in our object-space. For that, we need the transform of the prop attachment point. - // + // // We have the prop point information; however, it's not trivial to compute its exact location in our object-space // since it may or may not be attached to a bone (see SPropPoint), which in turn may or may not be in the middle of - // an animation. The bone matrices might be of interest, but they're really only meant to be used for the animation + // an animation. The bone matrices might be of interest, but they're really only meant to be used for the animation // system and are quite opaque to use from the outside (see @ref ValidatePosition). - // - // However, a nice side effect of ValidatePosition is that it also computes the absolute world-space transform of + // + // However, a nice side effect of ValidatePosition is that it also computes the absolute world-space transform of // our props and sets it on their respective models. In particular, @ref ValidatePosition will compute the prop's // world-space transform as either - // + // // T' = T x B x O - // or + // or // T' = T x O - // + // // where T' is the prop's world-space transform, T is our world-space transform, O is the prop's local - // offset/rotation matrix, and B is an optional transformation matrix of the bone the prop is attached to + // offset/rotation matrix, and B is an optional transformation matrix of the bone the prop is attached to // (taking into account animation and everything). - // + // // From this, it is clear that either O or B x O is the object-space transformation matrix of the prop. So, // all we need to do is apply our own inverse world-transform T^(-1) to T' to get our desired result. Luckily, // this is precomputed upon setting the transform matrix (see @ref SetTransform), so it is free to fetch. @@ -253,7 +253,7 @@ const CBoundingBoxAligned CModel::GetObjectSelectionBoundsRec() } ///////////////////////////////////////////////////////////////////////////////////////////////////////////// -// BuildAnimation: load raw animation frame animation from given file, and build a +// BuildAnimation: load raw animation frame animation from given file, and build a // animation specific to this model CSkeletonAnim* CModel::BuildAnimation(const VfsPath& pathname, const CStr& name, int frequency, float speed, float actionpos, float actionpos2, float soundpos) { @@ -376,7 +376,7 @@ void CModel::ValidatePosition() m_BoneMatrices[i].Concatenate(transform); } - // our own position is now valid; now we can safely update our props' positions without fearing + // our own position is now valid; now we can safely update our props' positions without fearing // that doing so will cause a revalidation of this model (see recursion above). m_PositionValid = true; @@ -401,7 +401,7 @@ void CModel::ValidatePosition() } // Adjust prop height to terrain level when needed - if (prop.m_MaxHeight != 0.f || prop.m_MinHeight != 0.f) + if (prop.m_MaxHeight != 0.f || prop.m_MinHeight != 0.f) { CVector3D propTranslation = proptransform.GetTranslation(); CVector3D objTranslation = m_Transform.GetTranslation(); @@ -483,9 +483,9 @@ bool CModel::SetAnimation(CSkeletonAnim* anim, bool once) m_ObjectBounds.SetEmpty(); InvalidateBounds(); - // start anim from beginning + // start anim from beginning m_AnimTime = 0; - } + } m_Anim = anim; diff --git a/source/graphics/ModelDef.cpp b/source/graphics/ModelDef.cpp index d2891f18d2..9607156723 100644 --- a/source/graphics/ModelDef.cpp +++ b/source/graphics/ModelDef.cpp @@ -246,7 +246,7 @@ CModelDef::~CModelDef() delete[] m_pBlendIndices; } -// FindPropPoint: find and return pointer to prop point matching given name; +// FindPropPoint: find and return pointer to prop point matching given name; // return null if no match (case insensitive search) const SPropPoint* CModelDef::FindPropPoint(const char* name) const { @@ -273,11 +273,11 @@ CModelDef* CModelDef::Load(const VfsPath& filename, const VfsPath& name) std::unique_ptr mdef (new CModelDef()); mdef->m_Name = name; - // now unpack everything + // now unpack everything mdef->m_NumVertices = unpacker.UnpackSize(); // versions prior to 4 only support 1 UV set, 4 and later store it here - if (unpacker.GetVersion() <= 3) + if (unpacker.GetVersion() <= 3) { mdef->m_NumUVsPerVertex = 1; } diff --git a/source/graphics/ObjectBase.cpp b/source/graphics/ObjectBase.cpp index 860615f80f..3aca1870d6 100644 --- a/source/graphics/ObjectBase.cpp +++ b/source/graphics/ObjectBase.cpp @@ -563,7 +563,7 @@ std::set CObjectBase::CalculateRandomRemainingSelections(rng_t& rng, const if (randNum < 0) { remainingSelections.insert((*grp)[i].m_VariantName); - // (If this change to 'remainingSelections' interferes with earlier choices, then + // (If this change to 'remainingSelections' interferes with earlier choices, then // we'll get some non-fatal inconsistencies that just break the randomness. But that // shouldn't happen, much.) // (As an example, suppose you have a group with variants "a" and "b", and another diff --git a/source/graphics/ObjectEntry.cpp b/source/graphics/ObjectEntry.cpp index 3f1b3e3915..145ae90154 100644 --- a/source/graphics/ObjectEntry.cpp +++ b/source/graphics/ObjectEntry.cpp @@ -87,7 +87,7 @@ bool CObjectEntry::BuildVariation(const std::vector >& selections textureProps.SetWrap(GL_CLAMP_TO_BORDER); CTexturePtr texture = g_Renderer.GetTextureManager().CreateTexture(textureProps); // TODO: Should check which renderpath is selected and only preload the necessary textures. - texture->Prefetch(); + texture->Prefetch(); material.AddSampler(CMaterial::TextureSampler(samp.m_SamplerName, texture)); } @@ -121,7 +121,7 @@ bool CObjectEntry::BuildVariation(const std::vector >& selections return false; } - // delete old model, create new + // delete old model, create new CModel* model = new CModel(objectManager.GetSkeletonAnimManager(), m_Simulation); delete m_Model; m_Model = model; @@ -137,10 +137,10 @@ bool CObjectEntry::BuildVariation(const std::vector >& selections CTextureProperties textureProps(samp.m_SamplerFile); textureProps.SetWrap(GL_CLAMP_TO_EDGE); CTexturePtr texture = g_Renderer.GetTextureManager().CreateTexture(textureProps); - // if we've loaded this model we're probably going to render it soon, so prefetch its texture. + // if we've loaded this model we're probably going to render it soon, so prefetch its texture. // All textures are prefetched even in the fixed pipeline, including the normal maps etc. // TODO: Should check which renderpath is selected and only preload the necessary textures. - texture->Prefetch(); + texture->Prefetch(); model->GetMaterial().AddSampler(CMaterial::TextureSampler(samp.m_SamplerName, texture)); } diff --git a/source/graphics/ShaderManager.cpp b/source/graphics/ShaderManager.cpp index 007b9f5d66..6feb528698 100644 --- a/source/graphics/ShaderManager.cpp +++ b/source/graphics/ShaderManager.cpp @@ -253,7 +253,7 @@ bool CShaderManager::NewProgram(const char* name, const CShaderDefines& baseDefi else if (t == "samplerCube") type = GL_TEXTURE_CUBE_MAP; - fragmentUniforms[CStrIntern(Attrs.GetNamedItem(at_name))] = + fragmentUniforms[CStrIntern(Attrs.GetNamedItem(at_name))] = std::make_pair(Attrs.GetNamedItem(at_loc).ToInt(), type); } } diff --git a/source/graphics/SkeletonAnimDef.cpp b/source/graphics/SkeletonAnimDef.cpp index baea05e844..2fe657f31b 100644 --- a/source/graphics/SkeletonAnimDef.cpp +++ b/source/graphics/SkeletonAnimDef.cpp @@ -34,13 +34,13 @@ CSkeletonAnimDef::CSkeletonAnimDef() : m_FrameTime(0), m_NumKeys(0), m_NumFrames /////////////////////////////////////////////////////////////////////////////////////////// // CSkeletonAnimDef destructor -CSkeletonAnimDef::~CSkeletonAnimDef() +CSkeletonAnimDef::~CSkeletonAnimDef() { delete[] m_Keys; } /////////////////////////////////////////////////////////////////////////////////////////// -// BuildBoneMatrices: build matrices for all bones at the given time (in MS) in this +// BuildBoneMatrices: build matrices for all bones at the given time (in MS) in this // animation void CSkeletonAnimDef::BuildBoneMatrices(float time, CMatrix3D* matrices, bool loop) const { @@ -48,10 +48,10 @@ void CSkeletonAnimDef::BuildBoneMatrices(float time, CMatrix3D* matrices, bool l size_t startframe = (size_t)(int)(time/m_FrameTime); float deltatime = fstartframe-startframe; - startframe %= m_NumFrames; + startframe %= m_NumFrames; size_t endframe = startframe + 1; - endframe %= m_NumFrames; + endframe %= m_NumFrames; if (!loop && endframe == 0) { diff --git a/source/graphics/SkeletonAnimManager.cpp b/source/graphics/SkeletonAnimManager.cpp index fa4f121247..722ed5af86 100644 --- a/source/graphics/SkeletonAnimManager.cpp +++ b/source/graphics/SkeletonAnimManager.cpp @@ -47,7 +47,7 @@ CSkeletonAnimManager::~CSkeletonAnimManager() } /////////////////////////////////////////////////////////////////////////////// -// GetAnimation: return a given animation by filename; return null if filename +// GetAnimation: return a given animation by filename; return null if filename // doesn't refer to valid animation file CSkeletonAnimDef* CSkeletonAnimManager::GetAnimation(const VfsPath& pathname) { diff --git a/source/graphics/TerritoryBoundary.cpp b/source/graphics/TerritoryBoundary.cpp index 34d4ae4592..e426af33da 100644 --- a/source/graphics/TerritoryBoundary.cpp +++ b/source/graphics/TerritoryBoundary.cpp @@ -49,35 +49,35 @@ std::vector CTerritoryBoundaryCalculator::ComputeBoundaries( const int CURVE_CCW = 1; // === Find territory boundaries === - // - // The territory boundaries delineate areas of tiles that belong to the same player, and that all have the same - // connected-to-a-root-influence-entity status (see also STerritoryBoundary for a more wordy definition). Note that the grid - // values contain bit-packed information (i.e. not just the owning player ID), so we must be careful to only compare grid + // + // The territory boundaries delineate areas of tiles that belong to the same player, and that all have the same + // connected-to-a-root-influence-entity status (see also STerritoryBoundary for a more wordy definition). Note that the grid + // values contain bit-packed information (i.e. not just the owning player ID), so we must be careful to only compare grid // values using the player ID and connected flag bits. The joint mask to select these is referred to as the discriminator mask. - // - // The idea is to scan the (i,j)-grid going up row by row and look for tiles that have a different territory assignment from - // the one right underneath it (or, if it's a tile on the first row, they need only have a territory assignment). These tiles - // are necessarily edge tiles of a territory, and hence a territory boundary must pass through their bottom edge. Therefore, + // + // The idea is to scan the (i,j)-grid going up row by row and look for tiles that have a different territory assignment from + // the one right underneath it (or, if it's a tile on the first row, they need only have a territory assignment). These tiles + // are necessarily edge tiles of a territory, and hence a territory boundary must pass through their bottom edge. Therefore, // we start tracing the outline of the territory starting from said bottom edge, and go CCW around the territory boundary. // Tracing continues until the starting point is reached, at which point the boundary is complete. - // + // // While tracing a boundary, every tile in which the boundary passes through the bottom edge are marked as 'processed', so that - // we know not to start a new run from these tiles when scanning continues (when the boundary is complete). This information - // is maintained in the grid values themselves by means of the 'processed' bit mask (stressing the importance of using the + // we know not to start a new run from these tiles when scanning continues (when the boundary is complete). This information + // is maintained in the grid values themselves by means of the 'processed' bit mask (stressing the importance of using the // discriminator mask to compare only player ID and connected flag). - // - // Thus, we can identify the following conditions for starting a trace from a tile (i,j). Let g(i,j) indicate the + // + // Thus, we can identify the following conditions for starting a trace from a tile (i,j). Let g(i,j) indicate the // discriminator grid value at position (i,j); then the conditions are: // - g(i,j) != 0; the tile must not be neutral // - j=0 or g(i,j) != g(i,j-1); the tile directly underneath it must have a different owner and/or connected flag // - the tile must not already be marked as 'processed' - // + // // Additionally, there is one more point to be made; the algorithm initially assumes it's tracing CCW around the territory. - // If it's tracing an inner edge, however, this will actually cause it to trace in the CW direction (because inner edges curve - // 'backwards' compared to the outer edges when starting the trace in the same direction). This turns out to actually be + // If it's tracing an inner edge, however, this will actually cause it to trace in the CW direction (because inner edges curve + // 'backwards' compared to the outer edges when starting the trace in the same direction). This turns out to actually be // exactly what the renderer needs to render two territory boundaries on the same edge back-to-back (instead of overlapping // each other). - // + // // In either case, we keep track of the way the outline curves while we're tracing to determine whether we're going CW or CCW. // If at some point we ever need to revert the winding order or external code needs to know about it explicitly, then we can // do this by looking at a curvature value which we define to start at 0, and which is incremented by 1 for every CCW turn and diff --git a/source/i18n/L10n.cpp b/source/i18n/L10n.cpp index bff2f58ec9..6b9276a0d1 100644 --- a/source/i18n/L10n.cpp +++ b/source/i18n/L10n.cpp @@ -102,7 +102,7 @@ bool L10n::ValidateLocale(const std::string& localeCode) const } // Returns true if both of these conditions are true: -// 1. ICU has resources for that locale (which also ensures it's a valid locale string) +// 1. ICU has resources for that locale (which also ensures it's a valid locale string) // 2. Either a dictionary for language_country or for language is available. bool L10n::ValidateLocale(const Locale& locale) const { @@ -392,7 +392,7 @@ std::string L10n::FormatMillisecondsIntoDateString(const UDate& milliseconds, co Calendar* calendar = Calendar::createInstance(*timeZone, currentLocale, status); if (U_FAILURE(status)) LOGERROR("Error creating calendar: %s", u_errorName(status)); - + dateFormat->adoptCalendar(calendar); dateFormat->format(milliseconds, dateString); delete dateFormat; diff --git a/source/lib/allocators/arena.cpp b/source/lib/allocators/arena.cpp index 0c60e1d6b7..b02863e00d 100644 --- a/source/lib/allocators/arena.cpp +++ b/source/lib/allocators/arena.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/allocators/dynarray.cpp b/source/lib/allocators/dynarray.cpp index 22cab0691f..ad85069f35 100644 --- a/source/lib/allocators/dynarray.cpp +++ b/source/lib/allocators/dynarray.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/allocators/freelist.cpp b/source/lib/allocators/freelist.cpp index 6d14237572..d265c12358 100644 --- a/source/lib/allocators/freelist.cpp +++ b/source/lib/allocators/freelist.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/allocators/headerless.cpp b/source/lib/allocators/headerless.cpp index b30e564139..3ed9a65099 100644 --- a/source/lib/allocators/headerless.cpp +++ b/source/lib/allocators/headerless.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/allocators/page_aligned.cpp b/source/lib/allocators/page_aligned.cpp index 26c84c9333..dd9ded6c48 100644 --- a/source/lib/allocators/page_aligned.cpp +++ b/source/lib/allocators/page_aligned.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/allocators/pool.cpp b/source/lib/allocators/pool.cpp index 330c50b92e..e945de2a37 100644 --- a/source/lib/allocators/pool.cpp +++ b/source/lib/allocators/pool.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/allocators/shared_ptr.cpp b/source/lib/allocators/shared_ptr.cpp index 78639312da..363dcfab97 100644 --- a/source/lib/allocators/shared_ptr.cpp +++ b/source/lib/allocators/shared_ptr.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/allocators/unique_range.cpp b/source/lib/allocators/unique_range.cpp index 758e433dd8..300990e311 100644 --- a/source/lib/allocators/unique_range.cpp +++ b/source/lib/allocators/unique_range.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/app_hooks.cpp b/source/lib/app_hooks.cpp index 496ebc97f1..0c1c393985 100644 --- a/source/lib/app_hooks.cpp +++ b/source/lib/app_hooks.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/base32.cpp b/source/lib/base32.cpp index 22449d72f5..55199fcfa3 100644 --- a/source/lib/base32.cpp +++ b/source/lib/base32.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/bits.cpp b/source/lib/bits.cpp index 74f2986a9a..7538b69f80 100644 --- a/source/lib/bits.cpp +++ b/source/lib/bits.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/byte_order.cpp b/source/lib/byte_order.cpp index 0c7bcd74e2..910d27ded0 100644 --- a/source/lib/byte_order.cpp +++ b/source/lib/byte_order.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/debug.cpp b/source/lib/debug.cpp index df29334cd6..8e81aeaaf7 100644 --- a/source/lib/debug.cpp +++ b/source/lib/debug.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/debug_stl.cpp b/source/lib/debug_stl.cpp index ecc6e5fdfe..ff4d4ed025 100644 --- a/source/lib/debug_stl.cpp +++ b/source/lib/debug_stl.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/external_libraries/dbghelp.cpp b/source/lib/external_libraries/dbghelp.cpp index 0cdec41cb5..381f8cf2c7 100644 --- a/source/lib/external_libraries/dbghelp.cpp +++ b/source/lib/external_libraries/dbghelp.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/archive/archive.cpp b/source/lib/file/archive/archive.cpp index fc140279ca..64cbc29d14 100644 --- a/source/lib/file/archive/archive.cpp +++ b/source/lib/file/archive/archive.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/archive/archive_zip.cpp b/source/lib/file/archive/archive_zip.cpp index 32c3766e6e..03c606840b 100644 --- a/source/lib/file/archive/archive_zip.cpp +++ b/source/lib/file/archive/archive_zip.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -720,7 +720,7 @@ private: static const wchar_t* incompressibleExtensions[] = { L".zip", L".rar", - L".jpg", L".jpeg", L".png", + L".jpg", L".jpeg", L".png", L".ogg", L".mp3" }; diff --git a/source/lib/file/archive/codec.cpp b/source/lib/file/archive/codec.cpp index 2b6e7b6283..288596def5 100644 --- a/source/lib/file/archive/codec.cpp +++ b/source/lib/file/archive/codec.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/archive/codec_zlib.cpp b/source/lib/file/archive/codec_zlib.cpp index 72beebe894..f2bcf441ac 100644 --- a/source/lib/file/archive/codec_zlib.cpp +++ b/source/lib/file/archive/codec_zlib.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/archive/stream.cpp b/source/lib/file/archive/stream.cpp index 4428125eb3..f8c51ae734 100644 --- a/source/lib/file/archive/stream.cpp +++ b/source/lib/file/archive/stream.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/common/file_loader.cpp b/source/lib/file/common/file_loader.cpp index 05abe53575..3953e58e11 100644 --- a/source/lib/file/common/file_loader.cpp +++ b/source/lib/file/common/file_loader.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/common/file_stats.cpp b/source/lib/file/common/file_stats.cpp index a8f06dc361..2a1d96cb5c 100644 --- a/source/lib/file/common/file_stats.cpp +++ b/source/lib/file/common/file_stats.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/common/real_directory.cpp b/source/lib/file/common/real_directory.cpp index 7f6d2816fa..dc729275a0 100644 --- a/source/lib/file/common/real_directory.cpp +++ b/source/lib/file/common/real_directory.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/common/trace.cpp b/source/lib/file/common/trace.cpp index 5d2cb6c5e3..371f383f79 100644 --- a/source/lib/file/common/trace.cpp +++ b/source/lib/file/common/trace.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/file.cpp b/source/lib/file/file.cpp index 2b03c23799..72901d78e6 100644 --- a/source/lib/file/file.cpp +++ b/source/lib/file/file.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/file_system.cpp b/source/lib/file/file_system.cpp index d7da0d1c3b..0d59bb11a6 100644 --- a/source/lib/file/file_system.cpp +++ b/source/lib/file/file_system.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/io/io.cpp b/source/lib/file/io/io.cpp index b0a8fcb279..4bfe959465 100644 --- a/source/lib/file/io/io.cpp +++ b/source/lib/file/io/io.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/io/write_buffer.cpp b/source/lib/file/io/write_buffer.cpp index bfceee00b3..82b9ee67e1 100644 --- a/source/lib/file/io/write_buffer.cpp +++ b/source/lib/file/io/write_buffer.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/vfs/file_cache.cpp b/source/lib/file/vfs/file_cache.cpp index d0f39aae3f..7bf249785d 100644 --- a/source/lib/file/vfs/file_cache.cpp +++ b/source/lib/file/vfs/file_cache.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/vfs/vfs.cpp b/source/lib/file/vfs/vfs.cpp index 09be9e7975..66667717a2 100644 --- a/source/lib/file/vfs/vfs.cpp +++ b/source/lib/file/vfs/vfs.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/vfs/vfs_lookup.cpp b/source/lib/file/vfs/vfs_lookup.cpp index 28e61b20b0..96e318ce5d 100644 --- a/source/lib/file/vfs/vfs_lookup.cpp +++ b/source/lib/file/vfs/vfs_lookup.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/vfs/vfs_path.cpp b/source/lib/file/vfs/vfs_path.cpp index 6f02d93afb..f006b16af4 100644 --- a/source/lib/file/vfs/vfs_path.cpp +++ b/source/lib/file/vfs/vfs_path.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/vfs/vfs_populate.cpp b/source/lib/file/vfs/vfs_populate.cpp index c00febeccf..c5a0e37982 100644 --- a/source/lib/file/vfs/vfs_populate.cpp +++ b/source/lib/file/vfs/vfs_populate.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/vfs/vfs_tree.cpp b/source/lib/file/vfs/vfs_tree.cpp index c0d0b2ec0e..c1d203eadb 100644 --- a/source/lib/file/vfs/vfs_tree.cpp +++ b/source/lib/file/vfs/vfs_tree.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/file/vfs/vfs_util.cpp b/source/lib/file/vfs/vfs_util.cpp index 663887aac4..f40e18e97c 100644 --- a/source/lib/file/vfs/vfs_util.cpp +++ b/source/lib/file/vfs/vfs_util.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -103,7 +103,7 @@ void NextNumberedFilename(const PIVFS& fs, const VfsPath& pathnameFormat, size_t // highest matching filename found. this avoids filling "holes" in // the number series due to deleted files, which could be confusing. // example: add 1st and 2nd; [exit] delete 1st; [restart] - // add 3rd -> without this measure it would get number 1, not 3. + // add 3rd -> without this measure it would get number 1, not 3. if(nextNumber == 0) { const VfsPath nameFormat = pathnameFormat.Filename(); diff --git a/source/lib/fnv_hash.cpp b/source/lib/fnv_hash.cpp index 3ccc25664b..756a859d43 100644 --- a/source/lib/fnv_hash.cpp +++ b/source/lib/fnv_hash.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/frequency_filter.cpp b/source/lib/frequency_filter.cpp index 5c80a18ba8..8537f0a121 100644 --- a/source/lib/frequency_filter.cpp +++ b/source/lib/frequency_filter.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/input.cpp b/source/lib/input.cpp index 3b2d9277d6..6f7b4d18df 100644 --- a/source/lib/input.cpp +++ b/source/lib/input.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/lib.cpp b/source/lib/lib.cpp index e15548b54f..e2b0623c70 100644 --- a/source/lib/lib.cpp +++ b/source/lib/lib.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/module_init.cpp b/source/lib/module_init.cpp index 7325cabff2..9ff966277d 100644 --- a/source/lib/module_init.cpp +++ b/source/lib/module_init.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/ogl.cpp b/source/lib/ogl.cpp index 5c701fd980..9156095761 100644 --- a/source/lib/ogl.cpp +++ b/source/lib/ogl.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/path.cpp b/source/lib/path.cpp index d4056e1376..9aa0bb7c7a 100644 --- a/source/lib/path.cpp +++ b/source/lib/path.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/posix/posix.cpp b/source/lib/posix/posix.cpp index 8e6eee82f5..e5b942aa75 100644 --- a/source/lib/posix/posix.cpp +++ b/source/lib/posix/posix.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/rand.cpp b/source/lib/rand.cpp index d92b398a5a..c1d72987e5 100644 --- a/source/lib/rand.cpp +++ b/source/lib/rand.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/regex.cpp b/source/lib/regex.cpp index 2ec72d5e08..95b4ef28e4 100644 --- a/source/lib/regex.cpp +++ b/source/lib/regex.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/res/graphics/cursor.cpp b/source/lib/res/graphics/cursor.cpp index 68ef96faff..c02ca42e0a 100644 --- a/source/lib/res/graphics/cursor.cpp +++ b/source/lib/res/graphics/cursor.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/res/graphics/ogl_tex.cpp b/source/lib/res/graphics/ogl_tex.cpp index ce1cb80534..9c66efb20d 100644 --- a/source/lib/res/graphics/ogl_tex.cpp +++ b/source/lib/res/graphics/ogl_tex.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -199,9 +199,9 @@ static bool q_flags_valid(int q_flags) // change default settings - these affect performance vs. quality. // may be overridden for individual textures via parameter to // ogl_tex_upload or ogl_tex_set_filter, respectively. -// +// // pass 0 to keep the current setting; defaults and legal values are: -// - q_flags: OGL_TEX_FULL_QUALITY; combination of OglTexQualityFlags +// - q_flags: OGL_TEX_FULL_QUALITY; combination of OglTexQualityFlags // - filter: GL_LINEAR; any valid OpenGL minification filter void ogl_tex_set_defaults(int q_flags, GLint filter) { diff --git a/source/lib/res/h_mgr.cpp b/source/lib/res/h_mgr.cpp index 3e782ba074..7cdb6ebdf7 100644 --- a/source/lib/res/h_mgr.cpp +++ b/source/lib/res/h_mgr.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -80,7 +80,7 @@ STATUS_ADD_DEFINITIONS(hStatusDefinitions); // // 0 = invalid handle value -// < 0 is an error code (we assume < 0 <==> MSB is set - +// < 0 is an error code (we assume < 0 <==> MSB is set - // true for 1s and 2s complement and sign-magnitude systems) // fields: diff --git a/source/lib/secure_crt.cpp b/source/lib/secure_crt.cpp index 861c189bde..6349c69953 100644 --- a/source/lib/secure_crt.cpp +++ b/source/lib/secure_crt.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/status.cpp b/source/lib/status.cpp index f1b814f1b6..5b40afbf2b 100644 --- a/source/lib/status.cpp +++ b/source/lib/status.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/svn_revision.cpp b/source/lib/svn_revision.cpp index 868432f83f..44ef60684e 100644 --- a/source/lib/svn_revision.cpp +++ b/source/lib/svn_revision.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/acpi.cpp b/source/lib/sysdep/acpi.cpp index fd3b6cb8c8..2a24ce0117 100644 --- a/source/lib/sysdep/acpi.cpp +++ b/source/lib/sysdep/acpi.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -155,7 +155,7 @@ static void* TransactPhysicalMemory(uintptr_t physicalAddress, size_t numBytes, // Root System Descriptor Pointer struct BiosDataArea -{ +{ u16 serialBase[4]; u16 parallelBase[3]; u16 ebdaSegment; diff --git a/source/lib/sysdep/arch/aarch64/aarch64.cpp b/source/lib/sysdep/arch/aarch64/aarch64.cpp index 46638396b7..b9ac9d2781 100644 --- a/source/lib/sysdep/arch/aarch64/aarch64.cpp +++ b/source/lib/sysdep/arch/aarch64/aarch64.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/arch/amd64/amd64.cpp b/source/lib/sysdep/arch/amd64/amd64.cpp index 5bf76c7220..52c3376a57 100644 --- a/source/lib/sysdep/arch/amd64/amd64.cpp +++ b/source/lib/sysdep/arch/amd64/amd64.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/arch/arm/arm.cpp b/source/lib/sysdep/arch/arm/arm.cpp index 6f876b0451..42ca803bc5 100644 --- a/source/lib/sysdep/arch/arm/arm.cpp +++ b/source/lib/sysdep/arch/arm/arm.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/arch/ia32/ia32.cpp b/source/lib/sysdep/arch/ia32/ia32.cpp index 67f0c27474..8c774318ae 100644 --- a/source/lib/sysdep/arch/ia32/ia32.cpp +++ b/source/lib/sysdep/arch/ia32/ia32.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/arch/x86_x64/apic.cpp b/source/lib/sysdep/arch/x86_x64/apic.cpp index 3dd3eef038..e8ecddde81 100644 --- a/source/lib/sysdep/arch/x86_x64/apic.cpp +++ b/source/lib/sysdep/arch/x86_x64/apic.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/arch/x86_x64/cache.cpp b/source/lib/sysdep/arch/x86_x64/cache.cpp index 717da409e6..23cc191b9c 100644 --- a/source/lib/sysdep/arch/x86_x64/cache.cpp +++ b/source/lib/sysdep/arch/x86_x64/cache.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -624,7 +624,7 @@ static Status DetectCacheAndTLB() else { size_t descriptorFlags = 0; - if(CPUID4::DetectCache()) // success, ignore less reliable CPUID.2 cache information + if(CPUID4::DetectCache()) // success, ignore less reliable CPUID.2 cache information descriptorFlags |= CPUID2::SKIP_CACHE_DESCRIPTORS; CPUID2::DetectCacheAndTLB(descriptorFlags); } diff --git a/source/lib/sysdep/arch/x86_x64/msr.cpp b/source/lib/sysdep/arch/x86_x64/msr.cpp index 38c81bdd67..8a835abb72 100644 --- a/source/lib/sysdep/arch/x86_x64/msr.cpp +++ b/source/lib/sysdep/arch/x86_x64/msr.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/arch/x86_x64/topology.cpp b/source/lib/sysdep/arch/x86_x64/topology.cpp index 28e06721b5..bcdee70eb8 100644 --- a/source/lib/sysdep/arch/x86_x64/topology.cpp +++ b/source/lib/sysdep/arch/x86_x64/topology.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/arch/x86_x64/x86_x64.cpp b/source/lib/sysdep/arch/x86_x64/x86_x64.cpp index aa13e8ee4f..28c37aab04 100644 --- a/source/lib/sysdep/arch/x86_x64/x86_x64.cpp +++ b/source/lib/sysdep/arch/x86_x64/x86_x64.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/cpu.cpp b/source/lib/sysdep/cpu.cpp index 52d3636b5a..d791856e2b 100644 --- a/source/lib/sysdep/cpu.cpp +++ b/source/lib/sysdep/cpu.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/gfx.cpp b/source/lib/sysdep/gfx.cpp index 57ba511913..cee3a6b0a0 100644 --- a/source/lib/sysdep/gfx.cpp +++ b/source/lib/sysdep/gfx.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/android/android.cpp b/source/lib/sysdep/os/android/android.cpp index 105068ad73..9c727d8d99 100644 --- a/source/lib/sysdep/os/android/android.cpp +++ b/source/lib/sysdep/os/android/android.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/bsd/bcpu.cpp b/source/lib/sysdep/os/bsd/bcpu.cpp index 609bca942b..23725c71ec 100644 --- a/source/lib/sysdep/os/bsd/bcpu.cpp +++ b/source/lib/sysdep/os/bsd/bcpu.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/bsd/bdbg.cpp b/source/lib/sysdep/os/bsd/bdbg.cpp index 89cb1aa339..beb0607d8a 100644 --- a/source/lib/sysdep/os/bsd/bdbg.cpp +++ b/source/lib/sysdep/os/bsd/bdbg.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/bsd/bsd.cpp b/source/lib/sysdep/os/bsd/bsd.cpp index 36fe3497b4..b385a4e70c 100644 --- a/source/lib/sysdep/os/bsd/bsd.cpp +++ b/source/lib/sysdep/os/bsd/bsd.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/bsd/dir_watch.cpp b/source/lib/sysdep/os/bsd/dir_watch.cpp index 904ba54ee0..3b9f9e4c4a 100644 --- a/source/lib/sysdep/os/bsd/dir_watch.cpp +++ b/source/lib/sysdep/os/bsd/dir_watch.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/linux/dir_watch_inotify.cpp b/source/lib/sysdep/os/linux/dir_watch_inotify.cpp index 4f7f5b9dc1..c8d83c4208 100644 --- a/source/lib/sysdep/os/linux/dir_watch_inotify.cpp +++ b/source/lib/sysdep/os/linux/dir_watch_inotify.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -57,7 +57,7 @@ static int initialized = 0; // Inotify file descriptor static int inotifyfd; - + // With inotify, using a map seems to be a good alternative to FAM's userdata typedef std::map DirWatchMap; static DirWatchMap g_paths; @@ -183,7 +183,7 @@ Status dir_watch_Add(const OsPath& path, PDirWatch& dirWatch) if(!initialized) { errno = 0; - if((inotifyfd = inotify_init()) < 0) + if((inotifyfd = inotify_init()) < 0) { // Check for error ? int err = errno; diff --git a/source/lib/sysdep/os/linux/lcpu.cpp b/source/lib/sysdep/os/linux/lcpu.cpp index 79fa566625..5990783a1a 100644 --- a/source/lib/sysdep/os/linux/lcpu.cpp +++ b/source/lib/sysdep/os/linux/lcpu.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/linux/ldbg.cpp b/source/lib/sysdep/os/linux/ldbg.cpp index 6edbfb3b5b..b48c394d94 100644 --- a/source/lib/sysdep/os/linux/ldbg.cpp +++ b/source/lib/sysdep/os/linux/ldbg.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/linux/linux.cpp b/source/lib/sysdep/os/linux/linux.cpp index 34f894b1b4..6e51fe6057 100644 --- a/source/lib/sysdep/os/linux/linux.cpp +++ b/source/lib/sysdep/os/linux/linux.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/osx/dir_watch.cpp b/source/lib/sysdep/os/osx/dir_watch.cpp index 00f836ea71..8e5c57c3d4 100644 --- a/source/lib/sysdep/os/osx/dir_watch.cpp +++ b/source/lib/sysdep/os/osx/dir_watch.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -31,13 +31,13 @@ #include "lib/posix/posix_filesystem.h" // mode_t #include // MAC_OS_X_VERSION_MIN_REQUIRED -#include -#include +#include +#include #include "ps/CLogger.h" -static FSEventStreamRef g_Stream = NULL; +static FSEventStreamRef g_Stream = NULL; struct DirWatch { @@ -53,8 +53,8 @@ static DirWatchNotifications g_QueuedDirs; static bool CanRunNotifications() { int major = 0; - int minor = 0; - int bugfix = 0; + int minor = 0; + int bugfix = 0; GetSystemVersion( major, minor, bugfix); @@ -83,7 +83,7 @@ static void fsevent_callback( { unsigned long i; char **paths = (char **)eventPaths; - + for (i=0; i 0) { - result = XGetWindowProperty (disp, selOwner, + result = XGetWindowProperty (disp, selOwner, pty, 0, bytes_left, 0, AnyPropertyType, &type, &format, &len, &dummy, &data); diff --git a/source/lib/sysdep/os/win/mahaf.cpp b/source/lib/sysdep/os/win/mahaf.cpp index cf583088b5..a1269ad2c8 100644 --- a/source/lib/sysdep/os/win/mahaf.cpp +++ b/source/lib/sysdep/os/win/mahaf.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/manifest.cpp b/source/lib/sysdep/os/win/manifest.cpp index e4b7478b6c..2dcae1312a 100644 --- a/source/lib/sysdep/os/win/manifest.cpp +++ b/source/lib/sysdep/os/win/manifest.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wclipboard.cpp b/source/lib/sysdep/os/win/wclipboard.cpp index e4c617d7cb..f688456eb1 100644 --- a/source/lib/sysdep/os/win/wclipboard.cpp +++ b/source/lib/sysdep/os/win/wclipboard.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wcpu.cpp b/source/lib/sysdep/os/win/wcpu.cpp index 26ecd99225..a07383efb0 100644 --- a/source/lib/sysdep/os/win/wcpu.cpp +++ b/source/lib/sysdep/os/win/wcpu.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wcursor.cpp b/source/lib/sysdep/os/win/wcursor.cpp index 46fcdbf525..7ab6065274 100644 --- a/source/lib/sysdep/os/win/wcursor.cpp +++ b/source/lib/sysdep/os/win/wcursor.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wdbg.cpp b/source/lib/sysdep/os/win/wdbg.cpp index 55f08d88f3..210f8511d8 100644 --- a/source/lib/sysdep/os/win/wdbg.cpp +++ b/source/lib/sysdep/os/win/wdbg.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wdbg_heap.cpp b/source/lib/sysdep/os/win/wdbg_heap.cpp index 138ab85dcd..a702606244 100644 --- a/source/lib/sysdep/os/win/wdbg_heap.cpp +++ b/source/lib/sysdep/os/win/wdbg_heap.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wdbg_sym.cpp b/source/lib/sysdep/os/win/wdbg_sym.cpp index 0ca635ce10..d51188d6a9 100644 --- a/source/lib/sysdep/os/win/wdbg_sym.cpp +++ b/source/lib/sysdep/os/win/wdbg_sym.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -827,7 +827,7 @@ static Status DetermineSymbolAddress(DWORD id, const SYMBOL_INFOW* sym, const Du // called by dump_sym; lock is held. static Status dump_sym_array(DWORD type_id, const u8* p, DumpState& state) -{ +{ ULONG64 size64 = 0; if(!pSymGetTypeInfo(hProcess, state.moduleBase, type_id, TI_GET_LENGTH, &size64)) WARN_RETURN(ERR::SYM_TYPE_INFO_UNAVAILABLE); @@ -846,7 +846,7 @@ static Status dump_sym_array(DWORD type_id, const u8* p, DumpState& state) ENSURE(el_size != 0); const size_t num_elements = size/el_size; ENSURE(num_elements != 0); - + return dump_array(p, num_elements, el_type_id, el_size, state); } @@ -883,7 +883,7 @@ static Status dump_sym_base_type(DWORD type_id, const u8* p, DumpState& state) const wchar_t* fmt = L""; u64 data = movzx_le64(p, size); - // if value is 0xCC..CC (uninitialized mem), we display as hex. + // if value is 0xCC..CC (uninitialized mem), we display as hex. // the output would otherwise be garbage; this makes it obvious. // note: be very careful to correctly handle size=0 (e.g. void*). for(size_t i = 0; i < size; i++) diff --git a/source/lib/sysdep/os/win/wdir_watch.cpp b/source/lib/sysdep/os/win/wdir_watch.cpp index a73948dcaf..d9ec3d0564 100644 --- a/source/lib/sysdep/os/win/wdir_watch.cpp +++ b/source/lib/sysdep/os/win/wdir_watch.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wdll_delay_load.cpp b/source/lib/sysdep/os/win/wdll_delay_load.cpp index 272cbc3487..f643b426e6 100644 --- a/source/lib/sysdep/os/win/wdll_delay_load.cpp +++ b/source/lib/sysdep/os/win/wdll_delay_load.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -355,7 +355,7 @@ extern "C" FARPROC WINAPI __delayLoadHelper2(PCImgDelayDescr pidd, FARPROC* ppfn 0, 1, PULONG_PTR(rgpdli)); // If we get to here, we blindly assume that the handler of the exception - // has magically fixed everything up and left the function pointer in + // has magically fixed everything up and left the function pointer in // dli.pfnCur. // return dli.pfnCur; @@ -376,7 +376,7 @@ extern "C" FARPROC WINAPI __delayLoadHelper2(PCImgDelayDescr pidd, FARPROC* ppfn else { ::FreeLibrary(hmod); } - + } // Go for the procedure now. @@ -423,7 +423,7 @@ extern "C" FARPROC WINAPI __delayLoadHelper2(PCImgDelayDescr pidd, FARPROC* ppfn 0, 1, PULONG_PTR(rgpdli)); // If we get to here, we blindly assume that the handler of the exception - // has magically fixed everything up and left the function pointer in + // has magically fixed everything up and left the function pointer in // dli.pfnCur. // pfnRet = dli.pfnCur; diff --git a/source/lib/sysdep/os/win/wdll_ver.cpp b/source/lib/sysdep/os/win/wdll_ver.cpp index 6769bb2cd5..17c43359fb 100644 --- a/source/lib/sysdep/os/win/wdll_ver.cpp +++ b/source/lib/sysdep/os/win/wdll_ver.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wfirmware.cpp b/source/lib/sysdep/os/win/wfirmware.cpp index 8554568045..cd0c2325a1 100644 --- a/source/lib/sysdep/os/win/wfirmware.cpp +++ b/source/lib/sysdep/os/win/wfirmware.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wgfx.cpp b/source/lib/sysdep/os/win/wgfx.cpp index badc664c26..06151d55cc 100644 --- a/source/lib/sysdep/os/win/wgfx.cpp +++ b/source/lib/sysdep/os/win/wgfx.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/whrt/counter.cpp b/source/lib/sysdep/os/win/whrt/counter.cpp index eda7fb7152..a94fe4dac4 100644 --- a/source/lib/sysdep/os/win/whrt/counter.cpp +++ b/source/lib/sysdep/os/win/whrt/counter.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/whrt/hpet.cpp b/source/lib/sysdep/os/win/whrt/hpet.cpp index de584c2c3f..ac6874b23d 100644 --- a/source/lib/sysdep/os/win/whrt/hpet.cpp +++ b/source/lib/sysdep/os/win/whrt/hpet.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/whrt/pmt.cpp b/source/lib/sysdep/os/win/whrt/pmt.cpp index 4932ca1202..0b3f2bb9d1 100644 --- a/source/lib/sysdep/os/win/whrt/pmt.cpp +++ b/source/lib/sysdep/os/win/whrt/pmt.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/whrt/qpc.cpp b/source/lib/sysdep/os/win/whrt/qpc.cpp index 61c6293e46..85131e7779 100644 --- a/source/lib/sysdep/os/win/whrt/qpc.cpp +++ b/source/lib/sysdep/os/win/whrt/qpc.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/whrt/tgt.cpp b/source/lib/sysdep/os/win/whrt/tgt.cpp index e38063b922..5ae0afa179 100644 --- a/source/lib/sysdep/os/win/whrt/tgt.cpp +++ b/source/lib/sysdep/os/win/whrt/tgt.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/whrt/tsc.cpp b/source/lib/sysdep/os/win/whrt/tsc.cpp index adc51cee07..07c3b5a8ca 100644 --- a/source/lib/sysdep/os/win/whrt/tsc.cpp +++ b/source/lib/sysdep/os/win/whrt/tsc.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/whrt/whrt.cpp b/source/lib/sysdep/os/win/whrt/whrt.cpp index 0ff0ca3480..e1464b850b 100644 --- a/source/lib/sysdep/os/win/whrt/whrt.cpp +++ b/source/lib/sysdep/os/win/whrt/whrt.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/winit.cpp b/source/lib/sysdep/os/win/winit.cpp index 2231f14b1c..f895e7d22b 100644 --- a/source/lib/sysdep/os/win/winit.cpp +++ b/source/lib/sysdep/os/win/winit.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wiocp.cpp b/source/lib/sysdep/os/win/wiocp.cpp index f2b0648456..4c8d38bf32 100644 --- a/source/lib/sysdep/os/win/wiocp.cpp +++ b/source/lib/sysdep/os/win/wiocp.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wmi.cpp b/source/lib/sysdep/os/win/wmi.cpp index df792ac2c7..fc7d7632f3 100644 --- a/source/lib/sysdep/os/win/wmi.cpp +++ b/source/lib/sysdep/os/win/wmi.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -88,7 +88,7 @@ static void Shutdown() /* From MSDN documentation: A thread must call CoUninitialize once for each successful call * it has made to the CoInitialize or CoInitializeEx function, including any call that returns * S_FALSE. Only the CoUninitialize call corresponding to the CoInitialize or CoInitializeEx - * call that initialized the library can close it. + * call that initialized the library can close it. * * So it should be perfectly safe to call this, since it balances out the CoInitialize in Init */ diff --git a/source/lib/sysdep/os/win/wnuma.cpp b/source/lib/sysdep/os/win/wnuma.cpp index 1cecaa5219..bbc548f796 100644 --- a/source/lib/sysdep/os/win/wnuma.cpp +++ b/source/lib/sysdep/os/win/wnuma.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wposix/waio.cpp b/source/lib/sysdep/os/win/wposix/waio.cpp index 802710c451..519d6cf757 100644 --- a/source/lib/sysdep/os/win/wposix/waio.cpp +++ b/source/lib/sysdep/os/win/wposix/waio.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wposix/wdlfcn.cpp b/source/lib/sysdep/os/win/wposix/wdlfcn.cpp index c24069bfaa..4238a1a606 100644 --- a/source/lib/sysdep/os/win/wposix/wdlfcn.cpp +++ b/source/lib/sysdep/os/win/wposix/wdlfcn.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wposix/wfilesystem.cpp b/source/lib/sysdep/os/win/wposix/wfilesystem.cpp index 37a36bd35d..7bde541da6 100644 --- a/source/lib/sysdep/os/win/wposix/wfilesystem.cpp +++ b/source/lib/sysdep/os/win/wposix/wfilesystem.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wposix/wmman.cpp b/source/lib/sysdep/os/win/wposix/wmman.cpp index 6754968374..7ce9a84a0f 100644 --- a/source/lib/sysdep/os/win/wposix/wmman.cpp +++ b/source/lib/sysdep/os/win/wposix/wmman.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wposix/wposix.cpp b/source/lib/sysdep/os/win/wposix/wposix.cpp index bebf64d8bc..6c0cdc5174 100644 --- a/source/lib/sysdep/os/win/wposix/wposix.cpp +++ b/source/lib/sysdep/os/win/wposix/wposix.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wposix/wpthread.cpp b/source/lib/sysdep/os/win/wposix/wpthread.cpp index 508a28fa5e..ed02b80be9 100644 --- a/source/lib/sysdep/os/win/wposix/wpthread.cpp +++ b/source/lib/sysdep/os/win/wposix/wpthread.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wposix/wtime.cpp b/source/lib/sysdep/os/win/wposix/wtime.cpp index 94f2fd00f7..d3177757eb 100644 --- a/source/lib/sysdep/os/win/wposix/wtime.cpp +++ b/source/lib/sysdep/os/win/wposix/wtime.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -177,19 +177,19 @@ int usleep(useconds_t us) /* * Copyright (c) 1999 Kungliga Tekniska Hogskolan -* (Royal Institute of Technology, Stockholm, Sweden). -* All rights reserved. +* (Royal Institute of Technology, Stockholm, Sweden). +* All rights reserved. * -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions +* are met: * -* 1. Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. +* 1. Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. * -* 2. Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. +* 2. Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. * * 3. Neither the name of KTH nor the names of its contributors may be * used to endorse or promote products derived from this software without diff --git a/source/lib/sysdep/os/win/wposix/wutsname.cpp b/source/lib/sysdep/os/win/wposix/wutsname.cpp index b77822284a..cba1975a47 100644 --- a/source/lib/sysdep/os/win/wposix/wutsname.cpp +++ b/source/lib/sysdep/os/win/wposix/wutsname.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wprofiler.cpp b/source/lib/sysdep/os/win/wprofiler.cpp index d5af0a9563..6e03ac11d9 100644 --- a/source/lib/sysdep/os/win/wprofiler.cpp +++ b/source/lib/sysdep/os/win/wprofiler.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wseh.cpp b/source/lib/sysdep/os/win/wseh.cpp index 13817ce6b2..30d97ae37e 100644 --- a/source/lib/sysdep/os/win/wseh.cpp +++ b/source/lib/sysdep/os/win/wseh.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -54,7 +54,7 @@ struct XTypeInfo struct XTypeInfoArray { - DWORD count; + DWORD count; const XTypeInfo* types[1]; }; diff --git a/source/lib/sysdep/os/win/wsnd.cpp b/source/lib/sysdep/os/win/wsnd.cpp index 35a71a0465..ee2d2c3b96 100644 --- a/source/lib/sysdep/os/win/wsnd.cpp +++ b/source/lib/sysdep/os/win/wsnd.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wstartup.cpp b/source/lib/sysdep/os/win/wstartup.cpp index 40d7b355b8..4a9b56dbda 100644 --- a/source/lib/sysdep/os/win/wstartup.cpp +++ b/source/lib/sysdep/os/win/wstartup.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wsysdep.cpp b/source/lib/sysdep/os/win/wsysdep.cpp index b121b36982..383d7b41a9 100644 --- a/source/lib/sysdep/os/win/wsysdep.cpp +++ b/source/lib/sysdep/os/win/wsysdep.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wutil.cpp b/source/lib/sysdep/os/win/wutil.cpp index b712cef533..f358c53b9f 100644 --- a/source/lib/sysdep/os/win/wutil.cpp +++ b/source/lib/sysdep/os/win/wutil.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wversion.cpp b/source/lib/sysdep/os/win/wversion.cpp index e18b82806d..0d787c667e 100644 --- a/source/lib/sysdep/os/win/wversion.cpp +++ b/source/lib/sysdep/os/win/wversion.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os/win/wvm.cpp b/source/lib/sysdep/os/win/wvm.cpp index c679fa7842..8367f6eb3c 100644 --- a/source/lib/sysdep/os/win/wvm.cpp +++ b/source/lib/sysdep/os/win/wvm.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/os_cpu.cpp b/source/lib/sysdep/os_cpu.cpp index 7a72b193c3..1102ccf1cd 100644 --- a/source/lib/sysdep/os_cpu.cpp +++ b/source/lib/sysdep/os_cpu.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/rtl/gcc/gcc.cpp b/source/lib/sysdep/rtl/gcc/gcc.cpp index a60c399492..6222afe4cb 100644 --- a/source/lib/sysdep/rtl/gcc/gcc.cpp +++ b/source/lib/sysdep/rtl/gcc/gcc.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/rtl/msc/msc.cpp b/source/lib/sysdep/rtl/msc/msc.cpp index d8e41eba6a..1557847c0b 100644 --- a/source/lib/sysdep/rtl/msc/msc.cpp +++ b/source/lib/sysdep/rtl/msc/msc.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/smbios.cpp b/source/lib/sysdep/smbios.cpp index 357360b77c..b1a49250ec 100644 --- a/source/lib/sysdep/smbios.cpp +++ b/source/lib/sysdep/smbios.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/sysdep/snd.cpp b/source/lib/sysdep/snd.cpp index 3a1ab8567e..094536abcb 100644 --- a/source/lib/sysdep/snd.cpp +++ b/source/lib/sysdep/snd.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/tex/tex.cpp b/source/lib/tex/tex.cpp index 1ea8ff139e..15bc186517 100644 --- a/source/lib/tex/tex.cpp +++ b/source/lib/tex/tex.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/tex/tex_bmp.cpp b/source/lib/tex/tex_bmp.cpp index 83a0ab62fe..231e89910e 100644 --- a/source/lib/tex/tex_bmp.cpp +++ b/source/lib/tex/tex_bmp.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -32,7 +32,7 @@ #pragma pack(push, 1) struct BmpHeader -{ +{ // BITMAPFILEHEADER u16 bfType; // "BM" u32 bfSize; // of file diff --git a/source/lib/tex/tex_codec.cpp b/source/lib/tex/tex_codec.cpp index 5b69666678..418dbc168d 100644 --- a/source/lib/tex/tex_codec.cpp +++ b/source/lib/tex/tex_codec.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/tex/tex_dds.cpp b/source/lib/tex/tex_dds.cpp index ea44e6bd93..91765c0d53 100644 --- a/source/lib/tex/tex_dds.cpp +++ b/source/lib/tex/tex_dds.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -303,7 +303,7 @@ static Status s3tc_decompress(Tex* t) // DDS file format //----------------------------------------------------------------------------- -// bit values and structure definitions taken from +// bit values and structure definitions taken from // http://msdn.microsoft.com/en-us/library/ee417785(VS.85).aspx #pragma pack(push, 1) diff --git a/source/lib/tex/tex_png.cpp b/source/lib/tex/tex_png.cpp index 6e0a78f13f..f0216c8ca9 100644 --- a/source/lib/tex/tex_png.cpp +++ b/source/lib/tex/tex_png.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -46,7 +46,7 @@ //----------------------------------------------------------------------------- -// +// //----------------------------------------------------------------------------- class MemoryStream diff --git a/source/lib/tex/tex_tga.cpp b/source/lib/tex/tex_tga.cpp index a4a53df93a..7c1055da35 100644 --- a/source/lib/tex/tex_tga.cpp +++ b/source/lib/tex/tex_tga.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/timer.cpp b/source/lib/timer.cpp index 37b81145d1..0f8053176a 100644 --- a/source/lib/timer.cpp +++ b/source/lib/timer.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lib/utf8.cpp b/source/lib/utf8.cpp index 31f5c65326..962de8704a 100644 --- a/source/lib/utf8.cpp +++ b/source/lib/utf8.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -36,9 +36,9 @@ STATUS_ADD_DEFINITIONS(utf8StatusDefinitions); // which bears the following notice: /* * Copyright 2001-2004 Unicode, Inc. -* +* * Disclaimer -* +* * This source code is provided as is by Unicode, Inc. No claims are * made as to fitness for any particular purpose. No warranties of any * kind are expressed or implied. The recipient agrees to determine @@ -46,9 +46,9 @@ STATUS_ADD_DEFINITIONS(utf8StatusDefinitions); * purchased on magnetic or optical media from Unicode, Inc., the * sole remedy for any claim will be exchange of defective media * within 90 days of receipt. -* +* * Limitations on Rights to Redistribute This Code -* +* * Unicode, Inc. hereby grants the right to freely use the information * supplied in this file in the creation of products supporting the * Unicode Standard, and to make copies of this file in any form diff --git a/source/lib/wsecure_crt.cpp b/source/lib/wsecure_crt.cpp index 1fa5555436..8d102d573e 100644 --- a/source/lib/wsecure_crt.cpp +++ b/source/lib/wsecure_crt.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/lobby/XmppClient.cpp b/source/lobby/XmppClient.cpp index 9f8e69b596..405ab02134 100644 --- a/source/lobby/XmppClient.cpp +++ b/source/lobby/XmppClient.cpp @@ -1035,7 +1035,7 @@ std::string XmppClient::StanzaErrorToString(gloox::StanzaError err) const /** * Convert a gloox connection error enum to string * Keep in sync with Gloox documentation - * + * * @param err Error to be converted * @return Converted error string */ @@ -1074,7 +1074,7 @@ std::string XmppClient::ConnectionErrorToString(gloox::ConnectionError err) cons /** * Convert a gloox registration result enum to string * Keep in sync with Gloox documentation - * + * * @param err Enum to be converted * @return Converted string */ diff --git a/source/lobby/glooxwrapper/glooxwrapper.cpp b/source/lobby/glooxwrapper/glooxwrapper.cpp index 1f5e08db4f..75e7ea3966 100644 --- a/source/lobby/glooxwrapper/glooxwrapper.cpp +++ b/source/lobby/glooxwrapper/glooxwrapper.cpp @@ -181,7 +181,7 @@ public: m_Wrapped->handleMUCError(NULL, error); } - virtual void handleMUCInfo(gloox::MUCRoom* UNUSED(room), int UNUSED(features), const std::string& UNUSED(name), const gloox::DataForm* UNUSED(infoForm)) + virtual void handleMUCInfo(gloox::MUCRoom* UNUSED(room), int UNUSED(features), const std::string& UNUSED(name), const gloox::DataForm* UNUSED(infoForm)) { /* Not supported */ } diff --git a/source/main.cpp b/source/main.cpp index fb330c4222..61cdbad40a 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -273,7 +273,7 @@ static void Frame() bool need_update = true; // If we are not running a multiplayer game, disable updates when the game is - // minimized or out of focus and relinquish the CPU a bit, in order to make + // minimized or out of focus and relinquish the CPU a bit, in order to make // debugging easier. if(g_PauseOnFocusLoss && !g_NetClient && !g_app_has_focus) { @@ -284,7 +284,7 @@ static void Frame() } // Throttling: limit update and render frequency to the minimum to 50 FPS - // in the "inactive" state, so that other windows get enough CPU time, + // in the "inactive" state, so that other windows get enough CPU time, // (and it's always nice for power+thermal management). // TODO: when the game performance is high enough, implementing a limit for // in-game framerate might be sensible. diff --git a/source/maths/BoundingBoxAligned.cpp b/source/maths/BoundingBoxAligned.cpp index a0839d9da3..5eb653d4a3 100644 --- a/source/maths/BoundingBoxAligned.cpp +++ b/source/maths/BoundingBoxAligned.cpp @@ -199,7 +199,7 @@ void CBoundingBoxAligned::Transform(const CMatrix3D& transform, CBoundingBoxOrie void CBoundingBoxAligned::IntersectFrustumConservative(const CFrustum& frustum) { // if this bound is empty, then the result must be empty (we should not attempt to intersect with - // a brush, may cause crashes due to the numeric representation of empty bounds -- see + // a brush, may cause crashes due to the numeric representation of empty bounds -- see // http://trac.wildfiregames.com/ticket/1027) if (IsEmpty()) return; diff --git a/source/maths/Brush.cpp b/source/maths/Brush.cpp index a9e3501c96..2156b04a5d 100644 --- a/source/maths/Brush.cpp +++ b/source/maths/Brush.cpp @@ -112,8 +112,8 @@ struct SliceOpInfo std::vector nvInfo; /** - * Indices into nvInfo; during the execution of the slicing algorithm, holds the previously inserted new vertex on - * one of the edges of the face that's currently being evaluated for slice points, or NO_VERTEX if no such vertex + * Indices into nvInfo; during the execution of the slicing algorithm, holds the previously inserted new vertex on + * one of the edges of the face that's currently being evaluated for slice points, or NO_VERTEX if no such vertex * exists. */ size_t thisFaceNewVertexIdx; @@ -229,7 +229,7 @@ void CBrush::Slice(const CPlane& plane, CBrush& result) const // Transfer faces. (Recall how faces are specified; see CBrush::m_Faces). The idea is to examine each face separately, // and see where its edges cross the slicing plane (meaning that exactly one of the vertices of that edge was cut away). - // On those edges, new vertices are introduced where the edge intersects the plane, and the resulting brush's m_Faces + // On those edges, new vertices are introduced where the edge intersects the plane, and the resulting brush's m_Faces // array is updated to refer to the newly inserted vertices instead of the original one that got cut away. size_t currentFaceStartIdx = NO_VERTEX; // index of the first vertex of the current face in the original brush @@ -289,7 +289,7 @@ void CBrush::Slice(const CPlane& plane, CBrush& result) const ENSURE(currentFaceStartIdx == NO_VERTEX); // Create the face that lies in the slicing plane. Remember, all the intersections of the slicing plane with face - // edges of the brush have been stored in sliceOp.nvInfo by the SliceNewVertex function, and refer to their direct + // edges of the brush have been stored in sliceOp.nvInfo by the SliceNewVertex function, and refer to their direct // neighbours in the slicing plane face using the neighbIdx1 and neighbIdx2 fields (in no consistent winding order). if (sliceOp.nvInfo.size()) @@ -297,9 +297,9 @@ void CBrush::Slice(const CPlane& plane, CBrush& result) const // push the starting vertex result.m_Faces.push_back(sliceOp.nvInfo[0].resIdx); - // At this point, there is no consistent winding order in the neighbX fields, so at each vertex we need to figure + // At this point, there is no consistent winding order in the neighbX fields, so at each vertex we need to figure // out whether neighb1 or neighb2 points 'onwards' along the face, according to an initially chosen winding direction. - // (or, equivalently, which one points back to the one we were just at). At each vertex, we then set neighb1 to be the + // (or, equivalently, which one points back to the one we were just at). At each vertex, we then set neighb1 to be the // one to point onwards, deleting any pointers which we no longer need to complete the trace. size_t idx; @@ -360,7 +360,7 @@ void CBrush::Intersect(const CFrustum& frustum, CBrush& result) const const CBrush* prev = this; CBrush* next; - // Repeatedly slice this brush with each plane of the frustum, alternating between 'result' and 'buf' to + // Repeatedly slice this brush with each plane of the frustum, alternating between 'result' and 'buf' to // save intermediate results. Set up the starting brush so that the final version always ends up in 'result'. if (frustum.GetNumPlanes() & 1) @@ -380,14 +380,14 @@ void CBrush::Intersect(const CFrustum& frustum, CBrush& result) const ENSURE(prev == &result); } -std::vector CBrush::GetVertices() const +std::vector CBrush::GetVertices() const { return m_Vertices; } void CBrush::GetFaces(std::vector >& out) const { - // split the back-to-back faces into separate face vectors, so that they're in a + // split the back-to-back faces into separate face vectors, so that they're in a // user-friendlier format than the back-to-back vertex index array // i.e. split 'x--xy------yz----z' into 'x--x', 'y-------y', 'z---z' diff --git a/source/maths/Matrix3D.cpp b/source/maths/Matrix3D.cpp index 54576a2108..d1c1b604c1 100644 --- a/source/maths/Matrix3D.cpp +++ b/source/maths/Matrix3D.cpp @@ -55,7 +55,7 @@ void CMatrix3D::SetOrtho (float l, float r, float b, float t, float n, float f) ); } -//The following clear the matrix and set the +//The following clear the matrix and set the //rotation of each of the 3 axes void CMatrix3D::SetXRotation (float angle) @@ -276,11 +276,11 @@ void CMatrix3D::RotateTransposed(const CVector3D& vector,CVector3D& result) cons void CMatrix3D::GetInverse(CMatrix3D& dst) const { - float tmp[12]; // temp array for pairs - float src[16]; // array of transpose source matrix - float det; // determinant + float tmp[12]; // temp array for pairs + float src[16]; // array of transpose source matrix + float det; // determinant - // transpose matrix + // transpose matrix for (int i = 0; i < 4; ++i) { src[i] = _data[i*4]; src[i + 4] = _data[i*4 + 1]; @@ -288,7 +288,7 @@ void CMatrix3D::GetInverse(CMatrix3D& dst) const src[i + 12] = _data[i*4 + 3]; } - // calculate pairs for first 8 elements (cofactors) + // calculate pairs for first 8 elements (cofactors) tmp[0] = src[10] * src[15]; tmp[1] = src[11] * src[14]; tmp[2] = src[9] * src[15]; @@ -312,7 +312,7 @@ void CMatrix3D::GetInverse(CMatrix3D& dst) const dst._data[6] = (tmp[3]-tmp[2])*src[0] + (tmp[6]-tmp[7])*src[1] + (tmp[11]-tmp[10])*src[3]; dst._data[7] = (tmp[4]-tmp[5])*src[0] + (tmp[9]-tmp[8])*src[1] + (tmp[10]-tmp[11])*src[2]; - // calculate pairs for second 8 elements (cofactors) + // calculate pairs for second 8 elements (cofactors) tmp[0] = src[2]*src[7]; tmp[1] = src[3]*src[6]; tmp[2] = src[1]*src[7]; @@ -326,7 +326,7 @@ void CMatrix3D::GetInverse(CMatrix3D& dst) const tmp[10] = src[0]*src[5]; tmp[11] = src[1]*src[4]; - // calculate second 8 elements (cofactors) + // calculate second 8 elements (cofactors) dst._data[8] = (tmp[0]-tmp[1])*src[13] + (tmp[3]-tmp[2])*src[14] + (tmp[4]-tmp[5])*src[15]; dst._data[9] = (tmp[1]-tmp[0])*src[12] + (tmp[6]-tmp[7])*src[14] + (tmp[9]-tmp[8])*src[15]; dst._data[10] = (tmp[2]-tmp[3])*src[12] + (tmp[7]-tmp[6])*src[13] + (tmp[10]-tmp[11])*src[15]; @@ -336,7 +336,7 @@ void CMatrix3D::GetInverse(CMatrix3D& dst) const dst._data[14] = (tmp[6]-tmp[7])*src[9] + (tmp[11]-tmp[10])*src[11] + (tmp[3]-tmp[2])*src[8]; dst._data[15] = (tmp[10]-tmp[11])*src[10] + (tmp[4]-tmp[5])*src[8] + (tmp[9]-tmp[8])*src[9]; - // calculate matrix inverse + // calculate matrix inverse det=src[0]*dst._data[0]+src[1]*dst._data[1]+src[2]*dst._data[2]+src[3]*dst._data[3]; det = 1/det; for ( int j = 0; j < 16; j++) { diff --git a/source/maths/NUSpline.cpp b/source/maths/NUSpline.cpp index 0024f229c1..32a3a2bac6 100644 --- a/source/maths/NUSpline.cpp +++ b/source/maths/NUSpline.cpp @@ -19,19 +19,19 @@ #include "NUSpline.h" #include "Matrix3D.h" -//Note: column major order! Each set of 4 constitutes a column. -CMatrix3D HermiteSpline(2.f, -3.f, 0.f, 1.f, - -2.f, 3.f, 0.f, 0.f, - 1.f, -2.f, 1.f, 0.f, +//Note: column major order! Each set of 4 constitutes a column. +CMatrix3D HermiteSpline(2.f, -3.f, 0.f, 1.f, + -2.f, 3.f, 0.f, 0.f, + 1.f, -2.f, 1.f, 0.f, 1.f, -1.f, 0.f, 0.f); // Matrix H in article // cubic curve defined by 2 positions and 2 velocities CVector3D GetPositionOnCubic(const CVector3D& startPos, const CVector3D& startVel, const CVector3D& endPos, const CVector3D& endVel, float time) { - CMatrix3D m(startPos.X, endPos.X, startVel.X, endVel.X, + CMatrix3D m(startPos.X, endPos.X, startVel.X, endVel.X, startPos.Y, endPos.Y, startVel.Y, endVel.Y, - startPos.Z, endPos.Z, startVel.Z, endVel.Z, + startPos.Z, endPos.Z, startVel.Z, endVel.Z, 0.0f, 0.0f, 0.0f, 1.0f); m = m * HermiteSpline; // multiply by the mixer @@ -136,7 +136,7 @@ const std::vector& RNSpline::GetAllNodes() const return Node; } -// internal. Based on Equation 14 +// internal. Based on Equation 14 CVector3D RNSpline::GetStartVelocity(int index) { if (index >= NodeCount - 1 || index < 0) @@ -145,7 +145,7 @@ CVector3D RNSpline::GetStartVelocity(int index) return (temp - Node[index+1].Velocity)*0.5f; } -// internal. Based on Equation 15 +// internal. Based on Equation 15 CVector3D RNSpline::GetEndVelocity(int index) { if (index >= NodeCount || index < 1) diff --git a/source/maths/Noise.cpp b/source/maths/Noise.cpp index 2f83c58bf6..9d8b1ac6bf 100644 --- a/source/maths/Noise.cpp +++ b/source/maths/Noise.cpp @@ -19,7 +19,7 @@ * 2D and 3D seamless Perlin noise */ -// Based on http://www.cs.cmu.edu/~mzucker/code/perlin-noise-math-faq.html +// Based on http://www.cs.cmu.edu/~mzucker/code/perlin-noise-math-faq.html // and http://mrl.nyu.edu/~perlin/paper445.pdf. // Not optimized for speed yet. @@ -28,7 +28,7 @@ #include #include -namespace +namespace { /// Random number generator (Boost Mersenne Twister) boost::mt19937 rng; @@ -39,20 +39,20 @@ namespace } /// Utility function used in both noises as an ease curve - float easeCurve(float t) + float easeCurve(float t) { return t*t*t*(t*(t*6-15)+10); } } -Noise2D::Noise2D(int f) +Noise2D::Noise2D(int f) { freq = f; grads = new CVector2D*[freq]; - for(int i=0; i (.5f-EPSILON)*unit) + if (test > (.5f-EPSILON)*unit) { // singularity at north pole heading = 2 * atan2( m_V.X, m_W); attitude = (float)M_PI/2; bank = 0; } - else if (test < (-.5f+EPSILON)*unit) + else if (test < (-.5f+EPSILON)*unit) { // singularity at south pole heading = -2 * atan2(m_V.X, m_W); attitude = -(float)M_PI/2; bank = 0; } - else + else { heading = atan2(2.f * (m_V.X*m_V.Y + m_V.Z*m_W),(sqx - sqy - sqz + sqw)); - bank = atan2(2.f * (m_V.Y*m_V.Z + m_V.X*m_W),(-sqx - sqy + sqz + sqw)); + bank = atan2(2.f * (m_V.Y*m_V.Z + m_V.X*m_W),(-sqx - sqy + sqz + sqw)); attitude = asin(-2.f * (m_V.X*m_V.Z - m_V.Y*m_W)); } return CVector3D(bank, attitude, heading); @@ -232,7 +232,7 @@ void CQuaternion::Slerp(const CQuaternion& from, const CQuaternion& to, float ra } else { - // "from" and "to" quaternions are very close + // "from" and "to" quaternions are very close // ... so we can do a linear interpolation scale0 = 1.0f - ratio; scale1 = ratio; diff --git a/source/maths/Vector3D.cpp b/source/maths/Vector3D.cpp index dc0ad3c4a0..aa8c594b90 100644 --- a/source/maths/Vector3D.cpp +++ b/source/maths/Vector3D.cpp @@ -34,7 +34,7 @@ CVector3D::CVector3D(const CFixedVector3D& v) : { } -int CVector3D::operator ! () const +int CVector3D::operator ! () const { if (X != 0.0f || Y != 0.0f || @@ -45,12 +45,12 @@ int CVector3D::operator ! () const return 1; } -float CVector3D::LengthSquared () const +float CVector3D::LengthSquared () const { return ( SQR(X) + SQR(Y) + SQR(Z) ); } -float CVector3D::Length () const +float CVector3D::Length () const { return sqrtf ( LengthSquared() ); } diff --git a/source/ps/CConsole.cpp b/source/ps/CConsole.cpp index 2482823523..c764b458a6 100644 --- a/source/ps/CConsole.cpp +++ b/source/ps/CConsole.cpp @@ -366,7 +366,7 @@ void CConsole::InsertChar(const int szChar, const wchar_t cooked) m_szBuffer[m_iBufferPos] = '\0'; m_iBufferLength = m_iBufferPos; } - else + else { // Delete just one char and move the others left for(int j=m_iBufferPos; j. */ -#include "precompiled.h" +#include "precompiled.h" #include "lib/sysdep/sysdep.h" #include "ps/CStr.h" diff --git a/source/ps/Game.cpp b/source/ps/Game.cpp index 48e793044b..9e28a1a671 100644 --- a/source/ps/Game.cpp +++ b/source/ps/Game.cpp @@ -296,7 +296,7 @@ PSRETURN CGame::ReallyStartGame() // Call the script function InitGame only for new games, not saved games if (!m_IsSavedGame) { - // Perform some simulation initializations (replace skirmish entities, explore territories, etc.) + // Perform some simulation initializations (replace skirmish entities, explore territories, etc.) // that needs to be done before setting up the AI and shouldn't be done in Atlas if (!g_AtlasGameLoop->running) m_Simulation2->PreInitGame(); diff --git a/source/ps/GameSetup/GameSetup.cpp b/source/ps/GameSetup/GameSetup.cpp index ebcb4ecb54..fa8a92bb8c 100644 --- a/source/ps/GameSetup/GameSetup.cpp +++ b/source/ps/GameSetup/GameSetup.cpp @@ -487,7 +487,7 @@ static void InitVfs(const CmdLineArgs& args, int flags) const size_t cacheSize = ChooseCacheSize(); g_VFS = CreateVfs(cacheSize); - + const OsPath readonlyConfig = paths.RData()/"config"/""; g_VFS->Mount(L"config/", readonlyConfig); @@ -576,7 +576,7 @@ static void InitInput() in_add_handler(gui_handler); in_add_handler(touch_input_handler); - + in_add_handler(cinema_manager_handler); // must be registered after (called before) the GUI which relies on these globals @@ -589,7 +589,7 @@ static void ShutdownPs() SAFE_DELETE(g_GUI); UnloadHotkeys(); - + // disable the special Windows cursor, or free textures for OGL cursors cursor_draw(g_VFS, 0, g_mouse_x, g_yres-g_mouse_y, false); } @@ -625,7 +625,7 @@ static void InitRenderer() g_ConfigDB.SetValueBool(CFG_SYSTEM, "waterrefraction", g_WaterRefraction); g_Renderer.SetOptionBool(CRenderer::OPT_SHADOWSONWATER, g_WaterShadows); g_ConfigDB.SetValueBool(CFG_SYSTEM, "watershadows", g_WaterShadows); - + g_Renderer.SetRenderPath(CRenderer::GetRenderPathByName(g_RenderPath)); g_Renderer.SetOptionBool(CRenderer::OPT_SHADOWPCF, g_ShadowPCF); g_ConfigDB.SetValueBool(CFG_SYSTEM, "shadowpcf", g_ShadowPCF); @@ -932,8 +932,8 @@ bool Init(const CmdLineArgs& args, int flags) // g_ConfigDB, command line args, globals CONFIG_Init(args); - - // Using a global object for the runtime is a workaround until Simulation and AI use + + // Using a global object for the runtime is a workaround until Simulation and AI use // their own threads and also their own runtimes. const int runtimeSize = 384 * 1024 * 1024; const int heapGrowthBytesGCTrigger = 20 * 1024 * 1024; @@ -1208,7 +1208,7 @@ CStr8 LoadSettingsOfScenarioMap(const VfsPath &mapPath) * Examples: * 1) "Bob" will host a 2 player game on the Arcadia map: * -autostart="scenarios/Arcadia 02" -autostart-host -autostart-host-players=2 -autostart-playername="Bob" - * + * * 2) Load Alpine Lakes random map with random seed, 2 players (Athens and Britons), and player 2 is PetraBot: * -autostart="random/alpine_lakes" -autostart-seed=-1 -autostart-players=2 -autostart-civ=1:athen -autostart-civ=2:brit -autostart-ai=2:petra */ @@ -1255,7 +1255,7 @@ bool Autostart(const CmdLineArgs& args) else seed = seedArg.ToULong(); } - + // Random map definition will be loaded from JSON file, so we need to parse it std::wstring scriptPath = L"maps/" + autoStartName.FromUTF8() + L".json"; JS::RootedValue scriptData(cx); @@ -1313,7 +1313,7 @@ bool Autostart(const CmdLineArgs& args) // partially configured CStr8 mapSettingsJSON = LoadSettingsOfScenarioMap("maps/" + autoStartName + ".xml"); scriptInterface.ParseJSON(mapSettingsJSON, &settings); - + // Initialize the playerData array being modified by autostart // with the real map data, so sensible values are present: scriptInterface.GetProperty(settings, "PlayerData", &playerData); @@ -1358,7 +1358,7 @@ bool Autostart(const CmdLineArgs& args) std::vector civArgs = args.GetMultiple("autostart-team"); for (size_t i = 0; i < civArgs.size(); ++i) { - int playerID = civArgs[i].BeforeFirst(":").ToInt(); + int playerID = civArgs[i].BeforeFirst(":").ToInt(); // Instead of overwriting existing player data, modify the array JS::RootedValue player(cx); @@ -1426,7 +1426,7 @@ bool Autostart(const CmdLineArgs& args) scriptInterface.Eval("({})", &player); } - int difficulty = civArgs[i].AfterFirst(":").ToInt(); + int difficulty = civArgs[i].AfterFirst(":").ToInt(); scriptInterface.SetProperty(player, "AIDiff", difficulty); scriptInterface.SetPropertyInt(playerData, playerID-offset, player); } @@ -1453,7 +1453,7 @@ bool Autostart(const CmdLineArgs& args) } scriptInterface.Eval("({})", &player); } - + CStr name = civArgs[i].AfterFirst(":"); scriptInterface.SetProperty(player, "Civ", std::string(name)); scriptInterface.SetPropertyInt(playerData, playerID-offset, player); @@ -1554,7 +1554,7 @@ void CancelLoad(const CStrW& message) shared_ptr pScriptInterface = g_GUI->GetActiveGUI()->GetScriptInterface(); JSContext* cx = pScriptInterface->GetContext(); JSAutoRequest rq(cx); - + JS::RootedValue global(cx, pScriptInterface->GetGlobalObject()); // Cancel loader LDR_Cancel(); diff --git a/source/ps/GameSetup/Paths.cpp b/source/ps/GameSetup/Paths.cpp index b54772acfe..474364e845 100644 --- a/source/ps/GameSetup/Paths.cpp +++ b/source/ps/GameSetup/Paths.cpp @@ -66,7 +66,7 @@ Paths::Paths(const CmdLineArgs& args) /* For reasoning behind our Windows paths, see the discussion here: * http://www.wildfiregames.com/forum/index.php?showtopic=14759 - * + * * Summary: * 1. Local appdata: for bulky unfriendly data like the cache, * which can be recreated if deleted; doesn't need backing up. diff --git a/source/ps/Hotkey.cpp b/source/ps/Hotkey.cpp index 301a7208f9..03ddcf93df 100644 --- a/source/ps/Hotkey.cpp +++ b/source/ps/Hotkey.cpp @@ -262,7 +262,7 @@ InReaction HotkeyInputHandler(const SDL_Event_* ev) bool typeKeyDown = ( ev->ev.type == SDL_KEYDOWN ) || ( ev->ev.type == SDL_MOUSEBUTTONDOWN ) || (ev->ev.type == SDL_MOUSEWHEEL); - // -- KEYDOWN SECTION -- + // -- KEYDOWN SECTION -- std::vector closestMapNames; size_t closestMapMatch = 0; diff --git a/source/ps/KeyName.cpp b/source/ps/KeyName.cpp index 0246f833c7..f37212744d 100644 --- a/source/ps/KeyName.cpp +++ b/source/ps/KeyName.cpp @@ -171,7 +171,7 @@ static const SKeycodeMapping keycodeMapping[] = { SDLK_LALT, "Left Alt", "LeftAlt" }, { SDLK_LGUI, "Left Super", "LeftWin" }, /* "Windows" keys */ - { SDLK_RGUI, "Right Super", "RightWin" }, + { SDLK_RGUI, "Right Super", "RightWin" }, { SDLK_MODE, "Alt Gr", "AltGr" }, diff --git a/source/ps/Profile.cpp b/source/ps/Profile.cpp index 7aa3f4308a..32e7407b3c 100644 --- a/source/ps/Profile.cpp +++ b/source/ps/Profile.cpp @@ -527,15 +527,15 @@ static intptr_t alloc_count = 0; // This behaviour can cause two types of problems: // // 1. Infinite recursion due to free call -// Problem occurs if: We use any of the dl* functions in our free function and free gets called with an internal +// Problem occurs if: We use any of the dl* functions in our free function and free gets called with an internal // error message buffer allocated. // What happens: Our call to the dl* function causes another free-call insdie glibc which calls our free function // and can cause infinite recursion. -// +// // 2. Use after free -// Problem occurs if: An external library (or any other function) calls a dl* function that stores an internal +// Problem occurs if: An external library (or any other function) calls a dl* function that stores an internal // error string, then calls dlerror to receive the message and then calls any of our malloc/calloc/realloc/free fuctions. -// Our function uses one of the dl* functions too. After calling our function, it tries to use the error message pointer +// Our function uses one of the dl* functions too. After calling our function, it tries to use the error message pointer // it got with dlerror before. // What happens: Our call to the dl* function will free the storage of the message and the pointer in the external library // becomes invalid. We get undefined behaviour if the extern library uses the error message pointer after that. @@ -619,7 +619,7 @@ void* calloc(size_t nm, size_t sz) void free(void* ptr) { - // Might be triggered if free is called before any calloc/malloc calls or if the dlsym call inside + // Might be triggered if free is called before any calloc/malloc calls or if the dlsym call inside // our calloc/malloc function causes a free call. Read the known issue comment block a few lines above. ENSURE (libc_free != NULL); diff --git a/source/ps/ProfileViewer.cpp b/source/ps/ProfileViewer.cpp index cb84955a71..7297547643 100644 --- a/source/ps/ProfileViewer.cpp +++ b/source/ps/ProfileViewer.cpp @@ -491,7 +491,7 @@ namespace { } - // std::for_each requires a move constructor and the use of JS::PersistentRooted apparently breaks a requirement for an + // std::for_each requires a move constructor and the use of JS::PersistentRooted apparently breaks a requirement for an // automatic move constructor DumpTable(DumpTable && original) : m_ScriptInterface(original.m_ScriptInterface), diff --git a/source/ps/Profiler2.cpp b/source/ps/Profiler2.cpp index b44e140c3c..16d2988c88 100644 --- a/source/ps/Profiler2.cpp +++ b/source/ps/Profiler2.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. @@ -370,7 +370,7 @@ void CProfiler2::ThreadStorage::WriteHold(EItem type, const void* item, u32 item std::string CProfiler2::ThreadStorage::GetBuffer() { // Called from an arbitrary thread (not the one writing to the buffer). - // + // // See comments on m_BufferPos0 etc. shared_ptr buffer(new u8[BUFFER_SIZE], ArrayDeleter()); diff --git a/source/ps/Profiler2GPU.cpp b/source/ps/Profiler2GPU.cpp index 4b698f32b9..3b1ff331cb 100644 --- a/source/ps/Profiler2GPU.cpp +++ b/source/ps/Profiler2GPU.cpp @@ -7,10 +7,10 @@ * distribute, sublicense, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice shall be included * in all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. diff --git a/source/ps/Shapes.cpp b/source/ps/Shapes.cpp index 5ee79487ab..bda1a545a2 100644 --- a/source/ps/Shapes.cpp +++ b/source/ps/Shapes.cpp @@ -82,7 +82,7 @@ bool CColor::ParseString(const CStr8& Value, int DefaultAlpha) bool CColor::operator == (const CColor &color) const { - return r==color.r && + return r==color.r && g==color.g && b==color.b && a==color.a; @@ -90,8 +90,8 @@ bool CColor::operator == (const CColor &color) const /*************************************************************************/ -CRect::CRect() : - left(0.f), top(0.f), right(0.f), bottom(0.f) +CRect::CRect() : + left(0.f), top(0.f), right(0.f), bottom(0.f) { } @@ -177,19 +177,19 @@ CRect CRect::operator + (const CSize& a) const // - CRect CRect::operator - (const CRect& a) const -{ +{ return CRect(left-a.left, top-a.top, right-a.right, bottom-a.bottom); } // - CRect CRect::operator - (const CPos& a) const -{ +{ return CRect(left-a.x, top-a.y, right-a.x, bottom-a.y); } // - CRect CRect::operator - (const CSize& a) const -{ +{ return CRect(left-a.cx, top-a.cy, right-a.cx, bottom-a.cy); } @@ -247,7 +247,7 @@ void CRect::operator -=(const CSize& a) bottom -= a.cy; } -float CRect::GetWidth() const +float CRect::GetWidth() const { return right-left; } @@ -360,13 +360,13 @@ CPos CPos::operator + (const CSize& a) const // - CPos CPos::operator - (const CPos& a) const -{ +{ return CPos(x-a.x, y-a.y); } // - CPos CPos::operator - (const CSize& a) const -{ +{ return CPos(x-a.cx, y-a.cy); } @@ -400,15 +400,15 @@ void CPos::operator -=(const CSize& a) /*************************************************************************/ -CSize::CSize() : cx(0.f), cy(0.f) +CSize::CSize() : cx(0.f), cy(0.f) { } -CSize::CSize(const CRect &rect) : cx(rect.GetWidth()), cy(rect.GetHeight()) +CSize::CSize(const CRect &rect) : cx(rect.GetWidth()), cy(rect.GetHeight()) { } -CSize::CSize(const CPos &pos) : cx(pos.x), cy(pos.y) +CSize::CSize(const CPos &pos) : cx(pos.x), cy(pos.y) { } @@ -456,7 +456,7 @@ CSize CSize::operator + (const CSize& a) const // - CSize CSize::operator - (const CSize& a) const -{ +{ return CSize(cx-a.cx, cy-a.cy); } @@ -468,7 +468,7 @@ CSize CSize::operator / (const float& a) const // * CSize CSize::operator * (const float& a) const -{ +{ return CSize(cx*a, cy*a); } diff --git a/source/ps/XML/XMLWriter.cpp b/source/ps/XML/XMLWriter.cpp index 9c3e9a016e..d425b94184 100644 --- a/source/ps/XML/XMLWriter.cpp +++ b/source/ps/XML/XMLWriter.cpp @@ -245,7 +245,7 @@ template <> void XMLWriter_Element::Text(const wchar_t* text, bo Text( CStrW(text).ToUTF8().c_str(), cdata ); } -// +// template <> void XMLWriter_File::ElementAttribute(const char* name, const char* const& value, bool newelement) { diff --git a/source/ps/scripting/JSInterface_VFS.cpp b/source/ps/scripting/JSInterface_VFS.cpp index 2daa18142a..21047cdfb4 100644 --- a/source/ps/scripting/JSInterface_VFS.cpp +++ b/source/ps/scripting/JSInterface_VFS.cpp @@ -88,7 +88,7 @@ JS::Value JSI_VFS::BuildDirEntList(ScriptInterface::CxPrivate* pCxPrivate, const const wchar_t* filter = 0; if (!filterStr.empty()) filter = filterStr.c_str(); - + int flags = recurse ? vfs::DIR_RECURSIVE : 0; JSContext* cx = pCxPrivate->pScriptInterface->GetContext(); diff --git a/source/renderer/AlphaMapCalculator.cpp b/source/renderer/AlphaMapCalculator.cpp index e860265f8e..541a274781 100644 --- a/source/renderer/AlphaMapCalculator.cpp +++ b/source/renderer/AlphaMapCalculator.cpp @@ -40,7 +40,7 @@ struct Blend4 { }; /////////////////////////////////////////////////////////////////////////////// -// Blend8: structure mapping a blend shape for N,NE,E,SE,S,SW,W,NW to a +// Blend8: structure mapping a blend shape for N,NE,E,SE,S,SW,W,NW to a // particular map struct Blend8 { Blend8(BlendShape8 shape,int alphamap) : m_Shape(shape), m_AlphaMap(alphamap) {} @@ -50,39 +50,39 @@ struct Blend8 { }; /////////////////////////////////////////////////////////////////////////////// -// Data tables for mapping between shapes and blend maps +// Data tables for mapping between shapes and blend maps /////////////////////////////////////////////////////////////////////////////// -const Blend4 Blends1Neighbour[] = -{ +const Blend4 Blends1Neighbour[] = +{ Blend4(BlendShape4(1,0,0,0), 12) }; -const Blend4 Blends2Neighbour[] = -{ - Blend4(BlendShape4(0,1,1,0), 7), - Blend4(BlendShape4(1,0,1,0), 10) +const Blend4 Blends2Neighbour[] = +{ + Blend4(BlendShape4(0,1,1,0), 7), + Blend4(BlendShape4(1,0,1,0), 10) }; -const Blend8 Blends2Neighbour8[] = -{ - Blend8(BlendShape8(1,1,0,0,0,0,0,0), 12), - Blend8(BlendShape8(1,0,0,0,0,1,0,0), 12), +const Blend8 Blends2Neighbour8[] = +{ + Blend8(BlendShape8(1,1,0,0,0,0,0,0), 12), + Blend8(BlendShape8(1,0,0,0,0,1,0,0), 12), Blend8(BlendShape8(0,1,0,1,0,0,0,0), 0) , - Blend8(BlendShape8(0,1,0,0,0,1,0,0), 0) + Blend8(BlendShape8(0,1,0,0,0,1,0,0), 0) }; -const Blend4 Blends3Neighbour[] = -{ - Blend4(BlendShape4(1,1,1,0), 4) +const Blend4 Blends3Neighbour[] = +{ + Blend4(BlendShape4(1,1,1,0), 4) }; -const Blend8 Blends3Neighbour8[] = -{ +const Blend8 Blends3Neighbour8[] = +{ Blend8(BlendShape8(1,1,0,0,1,0,0,0), 10), Blend8(BlendShape8(1,1,0,0,0,0,0,1), 12), - Blend8(BlendShape8(1,1,1,0,0,0,0,0), 1), + Blend8(BlendShape8(1,1,1,0,0,0,0,0), 1), Blend8(BlendShape8(0,1,1,0,1,0,0,0), 7), Blend8(BlendShape8(0,0,1,0,1,0,1,0), 4), Blend8(BlendShape8(1,1,0,0,0,1,0,0), 12), @@ -92,8 +92,8 @@ const Blend8 Blends3Neighbour8[] = Blend8(BlendShape8(0,1,0,1,0,1,0,0), 0) }; -const Blend8 Blends4Neighbour8[] = -{ +const Blend8 Blends4Neighbour8[] = +{ Blend8(BlendShape8(1,1,0,0,1,0,0,1), 10), Blend8(BlendShape8(1,1,0,1,1,0,0,0), 10), Blend8(BlendShape8(1,1,0,0,1,1,0,0), 10), @@ -108,8 +108,8 @@ const Blend8 Blends4Neighbour8[] = Blend8(BlendShape8(0,1,0,1,0,1,0,1), 0) }; -const Blend8 Blends5Neighbour8[] = -{ +const Blend8 Blends5Neighbour8[] = +{ Blend8(BlendShape8(1,1,1,1,1,0,0,0), 2), Blend8(BlendShape8(1,1,1,1,0,0,0,1), 1), Blend8(BlendShape8(1,1,1,0,1,0,0,1), 3), @@ -122,8 +122,8 @@ const Blend8 Blends5Neighbour8[] = Blend8(BlendShape8(0,1,1,0,1,1,0,1), 7) }; -const Blend8 Blends6Neighbour8[] = -{ +const Blend8 Blends6Neighbour8[] = +{ Blend8(BlendShape8(1,1,1,1,1,1,0,0), 2), Blend8(BlendShape8(1,1,1,1,1,0,1,0), 8), Blend8(BlendShape8(1,1,1,1,0,1,0,1), 1), @@ -132,8 +132,8 @@ const Blend8 Blends6Neighbour8[] = Blend8(BlendShape8(1,1,0,1,1,1,0,1), 10) }; -const Blend8 Blends7Neighbour8[] = -{ +const Blend8 Blends7Neighbour8[] = +{ Blend8(BlendShape8(1,1,1,1,1,1,0,1), 2), Blend8(BlendShape8(1,1,1,1,1,1,1,0), 9) }; @@ -143,7 +143,7 @@ const Blend8 Blends7Neighbour8[] = /////////////////////////////////////////////////////////////////////////////// -// MatchBlendShapeFlipped: test if the given shape can be made to fit the +// MatchBlendShapeFlipped: test if the given shape can be made to fit the // template in either unflipped state, or by flipping the shape in U or V template bool MatchBlendShapeFlipped(const T& templateshape,const T& shape,unsigned int& flags) @@ -151,7 +151,7 @@ bool MatchBlendShapeFlipped(const T& templateshape,const T& shape,unsigned int& // test unrotated shape if (shape==templateshape) { return true; - } + } // test against shape flipped in U T tstShape; @@ -159,7 +159,7 @@ bool MatchBlendShapeFlipped(const T& templateshape,const T& shape,unsigned int& if (shape==tstShape) { flags|=BLENDMAP_FLIPU; return true; - } + } // test against shape flipped in V templateshape.FlipV(tstShape); @@ -187,7 +187,7 @@ int MatchBlendShape(const T& templateshape,const T& shape,unsigned int& flags) T tstShape; templateshape.Rotate90(tstShape); if (MatchBlendShapeFlipped(tstShape,shape,flags)) { - // update flags - note if we've flipped in u or v, we need to rotate in + // update flags - note if we've flipped in u or v, we need to rotate in // the opposite direction flags|=flags ? BLENDMAP_ROTATE270 : BLENDMAP_ROTATE90; return true; @@ -201,7 +201,7 @@ int MatchBlendShape(const T& templateshape,const T& shape,unsigned int& flags) templateshape.Rotate270(tstShape); if (MatchBlendShapeFlipped(tstShape,shape,flags)) { - // update flags - note if we've flipped in u or v, we need to rotate in + // update flags - note if we've flipped in u or v, we need to rotate in // the opposite direction flags|=flags ? BLENDMAP_ROTATE90 : BLENDMAP_ROTATE270; return true; @@ -211,7 +211,7 @@ int MatchBlendShape(const T& templateshape,const T& shape,unsigned int& flags) } /////////////////////////////////////////////////////////////////////////////// -// LookupBlend: find and return the blendmap fitting the given shape by +// LookupBlend: find and return the blendmap fitting the given shape by // iterating through the given data table and testing each shape in flipped and // rotated forms until a match is found template @@ -225,8 +225,8 @@ int LookupBlend(int tableSize,const S* table,const T& shape,unsigned int& flags) } } - // eh? shouldn't get here if we've correctly considered all possible cases; - // keep the compiler happy, and, while we're still debugging possible shapes, + // eh? shouldn't get here if we've correctly considered all possible cases; + // keep the compiler happy, and, while we're still debugging possible shapes, // return bad blend to highlight suspect alphamap logic return 13; } @@ -281,7 +281,7 @@ int Calculate(BlendShape8 shape,unsigned int& flags) } - // we've got this far, so now we've got to consider the remaining choices, all containing + // we've got this far, so now we've got to consider the remaining choices, all containing // diagonal elements switch (count) { case 1: @@ -297,7 +297,7 @@ int Calculate(BlendShape8 shape,unsigned int& flags) case 4: return LookupBlend(sizeof(Blends4Neighbour8)/sizeof(Blend8),Blends4Neighbour8,shape,flags); - case 5: + case 5: return LookupBlend(sizeof(Blends5Neighbour8)/sizeof(Blend8),Blends5Neighbour8,shape,flags); case 6: @@ -309,8 +309,8 @@ int Calculate(BlendShape8 shape,unsigned int& flags) } - // Shouldn't get here if we've correctly considered all possible cases; - // keep the compiler happy, and, while we're still debugging possible shapes, + // Shouldn't get here if we've correctly considered all possible cases; + // keep the compiler happy, and, while we're still debugging possible shapes, // return bad blend to highlight suspect alphamap logic return 13; } diff --git a/source/renderer/DecalRData.cpp b/source/renderer/DecalRData.cpp index 9dec8f0d07..84dbb0b065 100644 --- a/source/renderer/DecalRData.cpp +++ b/source/renderer/DecalRData.cpp @@ -74,7 +74,7 @@ void CDecalRData::Update(CSimulation2* simulation) } } -void CDecalRData::RenderDecals(std::vector& decals, const CShaderDefines& context, +void CDecalRData::RenderDecals(std::vector& decals, const CShaderDefines& context, ShadowMap* shadow, bool isDummyShader, const CShaderProgramPtr& dummy) { CShaderDefines contextDecal = context; @@ -93,7 +93,7 @@ void CDecalRData::RenderDecals(std::vector& decals, const CShaderD } int numPasses = 1; - CShaderTechniquePtr techBase; + CShaderTechniquePtr techBase; if (!isDummyShader) { diff --git a/source/renderer/InstancingModelRenderer.cpp b/source/renderer/InstancingModelRenderer.cpp index 0355774be5..e951dcdd0b 100644 --- a/source/renderer/InstancingModelRenderer.cpp +++ b/source/renderer/InstancingModelRenderer.cpp @@ -158,7 +158,7 @@ IModelDef::IModelDef(const CModelDefPtr& mdef, bool gpuSkinning, bool calculateT Normal[i] = CVector3D(vertexDataOut[q + 0], vertexDataOut[q + 1], vertexDataOut[q + 2]); q += 3; - Tangent[i] = CVector4D(vertexDataOut[q + 0], vertexDataOut[q + 1], vertexDataOut[q + 2], + Tangent[i] = CVector4D(vertexDataOut[q + 0], vertexDataOut[q + 1], vertexDataOut[q + 2], vertexDataOut[q + 3]); q += 4; @@ -192,7 +192,7 @@ IModelDef::IModelDef(const CModelDefPtr& mdef, bool gpuSkinning, bool calculateT size_t idxidx = 0; // reindex geometry and upload index - for (size_t j = 0; j < mdef->GetNumFaces(); ++j) + for (size_t j = 0; j < mdef->GetNumFaces(); ++j) { Indices[idxidx++] = remapTable[j * 3 + 0]; Indices[idxidx++] = remapTable[j * 3 + 1]; diff --git a/source/renderer/MikktspaceWrap.cpp b/source/renderer/MikktspaceWrap.cpp index eb10368b6c..a2a8bba905 100644 --- a/source/renderer/MikktspaceWrap.cpp +++ b/source/renderer/MikktspaceWrap.cpp @@ -32,7 +32,7 @@ -MikkTSpace::MikkTSpace(const CModelDefPtr& m, std::vector& v, bool gpuSkinning) : m_Model(m), +MikkTSpace::MikkTSpace(const CModelDefPtr& m, std::vector& v, bool gpuSkinning) : m_Model(m), m_NewVertices(v), m_GpuSkinning(gpuSkinning) { // ensure that m_NewVertices is empty @@ -70,7 +70,7 @@ int MikkTSpace::getNumVerticesOfFace(const SMikkTSpaceContext* UNUSED(pContext), } -void MikkTSpace::getPosition(const SMikkTSpaceContext *pContext, +void MikkTSpace::getPosition(const SMikkTSpaceContext *pContext, float fvPosOut[], const int iFace, const int iVert) { SModelFace &face = ((MikkTSpace*)pContext->m_pUserData)->m_Model->GetFaces()[iFace]; @@ -83,7 +83,7 @@ void MikkTSpace::getPosition(const SMikkTSpaceContext *pContext, } -void MikkTSpace::getNormal(const SMikkTSpaceContext *pContext, +void MikkTSpace::getNormal(const SMikkTSpaceContext *pContext, float fvNormOut[], const int iFace, const int iVert) { SModelFace &face = ((MikkTSpace*)pContext->m_pUserData)->m_Model->GetFaces()[iFace]; @@ -96,7 +96,7 @@ void MikkTSpace::getNormal(const SMikkTSpaceContext *pContext, } -void MikkTSpace::getTexCoord(const SMikkTSpaceContext *pContext, +void MikkTSpace::getTexCoord(const SMikkTSpaceContext *pContext, float fvTexcOut[], const int iFace, const int iVert) { SModelFace &face = ((MikkTSpace*)pContext->m_pUserData)->m_Model->GetFaces()[iFace]; @@ -109,8 +109,8 @@ void MikkTSpace::getTexCoord(const SMikkTSpaceContext *pContext, } -void MikkTSpace::setTSpace(const SMikkTSpaceContext * pContext, const float fvTangent[], - const float UNUSED(fvBiTangent)[], const float UNUSED(fMagS), const float UNUSED(fMagT), +void MikkTSpace::setTSpace(const SMikkTSpaceContext * pContext, const float fvTangent[], + const float UNUSED(fvBiTangent)[], const float UNUSED(fMagS), const float UNUSED(fMagT), const tbool bIsOrientationPreserving, const int iFace, const int iVert) { SModelFace &face = ((MikkTSpace*)pContext->m_pUserData)->m_Model->GetFaces()[iFace]; diff --git a/source/renderer/ModelRenderer.cpp b/source/renderer/ModelRenderer.cpp index be385dc6c2..765e75250d 100644 --- a/source/renderer/ModelRenderer.cpp +++ b/source/renderer/ModelRenderer.cpp @@ -373,16 +373,16 @@ void ShaderModelRenderer::Render(const RenderModifierPtr& modifier, const CShade /* * Rendering approach: - * + * * m->submissions contains the list of CModels to render. - * + * * The data we need to render a model is: * - CShaderTechnique * - CTexture * - CShaderUniforms * - CModelDef (mesh data) * - CModel (model instance data) - * + * * For efficient rendering, we need to batch the draw calls to minimise state changes. * (Uniform and texture changes are assumed to be cheaper than binding new mesh data, * and shader changes are assumed to be most expensive.) @@ -390,35 +390,35 @@ void ShaderModelRenderer::Render(const RenderModifierPtr& modifier, const CShade * Within those groups, sub-group by CModelDef. * Within those sub-groups, sub-sub-group by CTexture. * Within those sub-sub-groups, sub-sub-sub-group by CShaderUniforms. - * + * * Alpha-blended models have to be sorted by distance from camera, * then we can batch as long as the order is preserved. * Non-alpha-blended models can be arbitrarily reordered to maximise batching. - * + * * For each model, the CShaderTechnique is derived from: * - The current global 'context' defines * - The CModel's material's defines * - The CModel's material's shader effect name - * + * * There are a smallish number of materials, and a smaller number of techniques. - * + * * To minimise technique lookups, we first group models by material, * in 'materialBuckets' (a hash table). - * + * * For each material bucket we then look up the appropriate shader technique. * If the technique requires sort-by-distance, the model is added to the * 'sortByDistItems' list with its computed distance. * Otherwise, the bucket's list of models is sorted by modeldef+texture+uniforms, * then the technique and model list is added to 'techBuckets'. - * + * * 'techBuckets' is then sorted by technique, to improve batching when multiple * materials map onto the same technique. - * + * * (Note that this isn't perfect batching: we don't sort across models in * multiple buckets that share a technique. In practice that shouldn't reduce * batching much (we rarely have one mesh used with multiple materials), * and it saves on copying and lets us sort smaller lists.) - * + * * Extra tech buckets are added for the sorted-by-distance models without reordering. * Finally we render by looping over each tech bucket, then looping over the model * list in each, rebinding the GL state whenever it changes. @@ -602,13 +602,13 @@ void ShaderModelRenderer::Render(const RenderModifierPtr& modifier, const CShade size_t idxTechStart = 0; // This vector keeps track of texture changes during rendering. It is kept outside the - // loops to avoid excessive reallocations. The token allocation of 64 elements + // loops to avoid excessive reallocations. The token allocation of 64 elements // should be plenty, though it is reallocated below (at a cost) if necessary. typedef ProxyAllocator TextureListAllocator; std::vector currentTexs((TextureListAllocator(arena))); currentTexs.reserve(64); - // texBindings holds the identifier bindings in the shader, which can no longer be defined + // texBindings holds the identifier bindings in the shader, which can no longer be defined // statically in the ShaderRenderModifier class. texBindingNames uses interned strings to // keep track of when bindings need to be reevaluated. typedef ProxyAllocator BindingListAllocator; diff --git a/source/renderer/OverlayRenderer.cpp b/source/renderer/OverlayRenderer.cpp index 9373d3480d..0e35ed51ed 100644 --- a/source/renderer/OverlayRenderer.cpp +++ b/source/renderer/OverlayRenderer.cpp @@ -100,7 +100,7 @@ struct OverlayRendererInternals VertexArray::Attribute quadAttributeUV; VertexIndexArray quadIndices; - /// Maximum amount of quad overlays we support for rendering. This limit is set to be able to + /// Maximum amount of quad overlays we support for rendering. This limit is set to be able to /// render all quads from a single dedicated VB without having to reallocate it, which is much /// faster in the typical case of rendering only a handful of quads. When modifying this value, /// you must take care for the new amount of quads to fit in a single VBO (which is not likely diff --git a/source/renderer/PatchRData.cpp b/source/renderer/PatchRData.cpp index 0f18b72b39..cee9e4ce5a 100644 --- a/source/renderer/PatchRData.cpp +++ b/source/renderer/PatchRData.cpp @@ -314,7 +314,7 @@ void CPatchRData::BuildBlends() } } -void CPatchRData::AddBlend(std::vector& blendVertices, std::vector& blendIndices, +void CPatchRData::AddBlend(std::vector& blendVertices, std::vector& blendIndices, u16 i, u16 j, u8 shape, CTerrainTextureEntry* texture) { CTerrain* terrain = m_Patch->m_Parent; @@ -724,7 +724,7 @@ typedef POOLED_BATCH_MAP(CVertexBuffer*, IndexBufferBatches) VertexBufferBatches // Group batches by texture typedef POOLED_BATCH_MAP(CTerrainTextureEntry*, VertexBufferBatches) TextureBatches; -void CPatchRData::RenderBases(const std::vector& patches, const CShaderDefines& context, +void CPatchRData::RenderBases(const std::vector& patches, const CShaderDefines& context, ShadowMap* shadow, bool isDummyShader, const CShaderProgramPtr& dummy) { Allocators::DynamicArena arena(1 * MiB); @@ -901,7 +901,7 @@ struct SBlendStackItem SplatStack splats; }; -void CPatchRData::RenderBlends(const std::vector& patches, const CShaderDefines& context, +void CPatchRData::RenderBlends(const std::vector& patches, const CShaderDefines& context, ShadowMap* shadow, bool isDummyShader, const CShaderProgramPtr& dummy) { Allocators::DynamicArena arena(1 * MiB); diff --git a/source/renderer/PostprocManager.cpp b/source/renderer/PostprocManager.cpp index fd35ea6126..5df29d9242 100644 --- a/source/renderer/PostprocManager.cpp +++ b/source/renderer/PostprocManager.cpp @@ -37,7 +37,7 @@ #if !CONFIG2_GLES CPostprocManager::CPostprocManager() - : m_IsInitialized(false), m_PingFbo(0), m_PongFbo(0), m_PostProcEffect(L"default"), m_ColorTex1(0), m_ColorTex2(0), + : m_IsInitialized(false), m_PingFbo(0), m_PongFbo(0), m_PostProcEffect(L"default"), m_ColorTex1(0), m_ColorTex2(0), m_DepthTex(0), m_BloomFbo(0), m_BlurTex2a(0), m_BlurTex2b(0), m_BlurTex4a(0), m_BlurTex4b(0), m_BlurTex8a(0), m_BlurTex8b(0), m_WhichBuffer(true) { @@ -111,7 +111,7 @@ void CPostprocManager::RecreateBuffers() glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); \ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - // Two fullscreen ping-pong textures. + // Two fullscreen ping-pong textures. GEN_BUFFER_RGBA(m_ColorTex1, m_Width, m_Height); GEN_BUFFER_RGBA(m_ColorTex2, m_Width, m_Height); @@ -344,7 +344,7 @@ void CPostprocManager::ApplyBlur() ApplyBlurDownscale2x(tex1, tex2, width, height); \ width /= 2; \ height /= 2; \ - ApplyBlurGauss(tex2, temptex, width, height); + ApplyBlurGauss(tex2, temptex, width, height); // We do the same thing for each scale, incrementally adding more and more blur. SCALE_AND_BLUR(m_WhichBuffer ? m_ColorTex1 : m_ColorTex2, m_BlurTex2a, m_BlurTex2b); @@ -361,7 +361,7 @@ void CPostprocManager::CaptureRenderOutput() { ENSURE(m_IsInitialized); - // clear both FBOs and leave m_PingFbo selected for rendering; + // clear both FBOs and leave m_PingFbo selected for rendering; // m_WhichBuffer stays true at this point pglBindFramebufferEXT(GL_FRAMEBUFFER_EXT, m_PongFbo); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); @@ -391,7 +391,7 @@ void CPostprocManager::ReleaseRenderOutput() pglBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, m_PongFbo); pglBindFramebufferEXT(GL_DRAW_FRAMEBUFFER_EXT, 0); - pglBlitFramebufferEXT(0, 0, m_Width, m_Height, 0, 0, m_Width, m_Height, + pglBlitFramebufferEXT(0, 0, m_Width, m_Height, 0, 0, m_Width, m_Height, GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, GL_NEAREST); pglBindFramebufferEXT(GL_READ_FRAMEBUFFER_EXT, 0); @@ -497,7 +497,7 @@ void CPostprocManager::ApplyPostproc() // First render blur textures. Note that this only happens ONLY ONCE, before any effects are applied! // (This may need to change depending on future usage, however that will have a fps hit) - ApplyBlur(); + ApplyBlur(); for (int pass = 0; pass < m_PostProcTech->GetNumPasses(); ++pass) ApplyEffect(m_PostProcTech, pass); diff --git a/source/renderer/RenderModifiers.cpp b/source/renderer/RenderModifiers.cpp index bd2f0c9676..65b2344ce9 100644 --- a/source/renderer/RenderModifiers.cpp +++ b/source/renderer/RenderModifiers.cpp @@ -82,7 +82,7 @@ void ShaderRenderModifier::BeginPass(const CShaderProgramPtr& shader) shader->Uniform(str_shadowTransform, GetShadowMap()->GetTextureMatrix()); int width = GetShadowMap()->GetWidth(); int height = GetShadowMap()->GetHeight(); - shader->Uniform(str_shadowScale, width, height, 1.0f / width, 1.0f / height); + shader->Uniform(str_shadowScale, width, height, 1.0f / width, 1.0f / height); } if (GetLightEnv()) diff --git a/source/renderer/Renderer.cpp b/source/renderer/Renderer.cpp index 7ff3d165be..9dd9bcfc0f 100644 --- a/source/renderer/Renderer.cpp +++ b/source/renderer/Renderer.cpp @@ -1064,7 +1064,7 @@ void CRenderer::RenderTransparentModels(const CShaderDefines& context, int cullG // - worldPlane is a clip plane in world space (worldPlane.Dot(v) >= 0 for any vector v passing the clipping test) void CRenderer::SetObliqueFrustumClipping(CCamera& camera, const CVector4D& worldPlane) const { - // First, we'll convert the given clip plane to camera space, then we'll + // First, we'll convert the given clip plane to camera space, then we'll // Get the view matrix and normal matrix (top 3x3 part of view matrix) CMatrix3D normalMatrix = camera.m_Orientation.GetTranspose(); CVector4D camPlane = normalMatrix.Transform(worldPlane); @@ -1575,7 +1575,7 @@ void CRenderer::RenderSubmissions(const CBoundingBoxAligned& waterScissor) } #if !CONFIG2_GLES - // Clean up texture blend mode so particles and other things render OK + // Clean up texture blend mode so particles and other things render OK // (really this should be cleaned up by whoever set it) glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); #endif diff --git a/source/renderer/TexturedLineRData.cpp b/source/renderer/TexturedLineRData.cpp index e40cfae580..ffd50ad9a8 100644 --- a/source/renderer/TexturedLineRData.cpp +++ b/source/renderer/TexturedLineRData.cpp @@ -60,10 +60,10 @@ void CTexturedLineRData::Render(const SOverlayTexturedLine& line, const CShaderP u8* indexBase = m_VBIndices->m_Owner->Bind(); shader->AssertPointersBound(); - glDrawElements(GL_TRIANGLES, m_VBIndices->m_Count, GL_UNSIGNED_SHORT, indexBase + sizeof(u16)*m_VBIndices->m_Index); + glDrawElements(GL_TRIANGLES, m_VBIndices->m_Count, GL_UNSIGNED_SHORT, indexBase + sizeof(u16)*m_VBIndices->m_Index); g_Renderer.GetStats().m_DrawCalls++; - g_Renderer.GetStats().m_OverlayTris += m_VBIndices->m_Count/3; + g_Renderer.GetStats().m_OverlayTris += m_VBIndices->m_Count/3; } void CTexturedLineRData::Update(const SOverlayTexturedLine& line) @@ -109,7 +109,7 @@ void CTexturedLineRData::Update(const SOverlayTexturedLine& line) // grab the ending point so as to close the loop p0 = CVector3D(line.m_Coords[(n-1)*2], 0, line.m_Coords[(n-1)*2+1]); else - // we don't want to loop around and use the direction towards the other end of the line, so create an artificial p0 that + // we don't want to loop around and use the direction towards the other end of the line, so create an artificial p0 that // extends the p2 -> p1 direction, and use that point instead p0 = p1 + (p1 - p2); @@ -175,7 +175,7 @@ void CTexturedLineRData::Update(const SOverlayTexturedLine& line) indices.push_back(index1); indices.push_back(index2); } - else + else { u16 index1Prev = vertices.size() - 4; // index of the vertex1 in the previous iteration (BR of this quad) u16 index2Prev = vertices.size() - 3; // index of the vertex2 in the previous iteration (BL of this quad) @@ -235,7 +235,7 @@ void CTexturedLineRData::Update(const SOverlayTexturedLine& line) else { // Create start and end caps. On either end, this is done by taking the centroid between the last and second-to-last pair of - // vertices that was generated along the path (i.e. the vertex1's and vertex2's from above), taking a directional vector + // vertices that was generated along the path (i.e. the vertex1's and vertex2's from above), taking a directional vector // between them, and drawing the line cap in the plane given by the two butt-end corner points plus said vector. std::vector capIndices; std::vector capVertices; @@ -336,25 +336,25 @@ void CTexturedLineRData::CreateLineCap(const SOverlayTexturedLine& line, const C // fall-through case SOverlayTexturedLine::LINECAP_ROUND: { - // Draw a rounded line cap in the 3D plane of the line specified by the two corner points and the normal vector of the + // Draw a rounded line cap in the 3D plane of the line specified by the two corner points and the normal vector of the // line's direction. The terrain normal at the centroid between the two corner points is perpendicular to this plane. - // The way this works is by taking a vector from the corner points' centroid to one of the corner points (which is then - // of radius length), and rotate it around the terrain normal vector in that centroid. This will rotate the vector in + // The way this works is by taking a vector from the corner points' centroid to one of the corner points (which is then + // of radius length), and rotate it around the terrain normal vector in that centroid. This will rotate the vector in // the line's plane, producing the desired rounded cap. - // To please OpenGL's winding order, this angle needs to be negated depending on whether we start rotating from - // the (center -> corner1) or (center -> corner2) vector. For the (center -> corner2) vector, we apparently need to use + // To please OpenGL's winding order, this angle needs to be negated depending on whether we start rotating from + // the (center -> corner1) or (center -> corner2) vector. For the (center -> corner2) vector, we apparently need to use // the negated angle. float stepAngle = -(float)(M_PI/(roundCapPoints-1)); // Push the vertices in triangle fan order (easy to generate GL_TRIANGLES indices for afterwards) - // Note that we're manually adding the corner vertices instead of having them be generated by the rotating vector. + // Note that we're manually adding the corner vertices instead of having them be generated by the rotating vector. // This is because we want to support an overly large radius to make the sharp line ending look sharper. - verticesOut.push_back(centerVertex); + verticesOut.push_back(centerVertex); verticesOut.push_back(SVertex(corner2, 0.f, 0.f)); // Get the base vector that we will incrementally rotate in the cap plane to produce the radial sample points. - // Normally corner2 - centerPoint would suffice for this since it is of radius length, but we want to support custom + // Normally corner2 - centerPoint would suffice for this since it is of radius length, but we want to support custom // radii to support tuning the 'sharpness' of sharp end caps (see above) CVector3D rotationBaseVector = (corner2 - centerPoint).Normalized() * radius; // Calculate the normal vector of the plane in which we're going to be drawing the line cap. This is the vector that @@ -370,45 +370,45 @@ void CTexturedLineRData::CreateLineCap(const SOverlayTexturedLine& line, const C quatRotation.FromAxisAngle(capPlaneNormal, i * stepAngle); CVector3D worldPos3D = centerPoint + quatRotation.Rotate(rotationBaseVector); - // Let v range from 0 to 1 as we move along the semi-circle, keep u fixed at 0 (i.e. curve the left vertical edge + // Let v range from 0 to 1 as we move along the semi-circle, keep u fixed at 0 (i.e. curve the left vertical edge // of the texture around the edge of the semicircle) float u = 0.f; float v = clamp((i/(float)(roundCapPoints-1)), 0.f, 1.f); // pos, u, v verticesOut.push_back(SVertex(worldPos3D, u, v)); } - // connect back to the other butt-end corner point to complete the semicircle - verticesOut.push_back(SVertex(corner1, 0.f, 1.f)); + // connect back to the other butt-end corner point to complete the semicircle + verticesOut.push_back(SVertex(corner1, 0.f, 1.f)); - // now push indices in GL_TRIANGLES order; vertices[indexOffset] is the center vertex, vertices[indexOffset + 1] is the - // first corner point, then a bunch of radial samples, and then at the end we have the other corner point again. So: + // now push indices in GL_TRIANGLES order; vertices[indexOffset] is the center vertex, vertices[indexOffset + 1] is the + // first corner point, then a bunch of radial samples, and then at the end we have the other corner point again. So: for (int i=1; i < roundCapPoints; ++i) { - indicesOut.push_back(indexOffset); // center vertex - indicesOut.push_back(indexOffset + i); - indicesOut.push_back(indexOffset + i + 1); + indicesOut.push_back(indexOffset); // center vertex + indicesOut.push_back(indexOffset + i); + indicesOut.push_back(indexOffset + i + 1); } } break; case SOverlayTexturedLine::LINECAP_SQUARE: { - // Extend the (corner1 -> corner2) vector along the direction normal and draw a square line ending consisting of + // Extend the (corner1 -> corner2) vector along the direction normal and draw a square line ending consisting of // three triangles (sort of like a triangle fan) // NOTE: The order in which the vertices are pushed out determines the visibility, as they // are rendered only one-sided; the wrong order of vertices will make the cap visible only from the bottom. verticesOut.push_back(centerVertex); verticesOut.push_back(SVertex(corner2, 0.f, 0.f)); - verticesOut.push_back(SVertex(corner2 + (lineDirectionNormal * (line.m_Thickness)), 0.f, 0.33333f)); // extend butt corner point 2 along the normal vector - verticesOut.push_back(SVertex(corner1 + (lineDirectionNormal * (line.m_Thickness)), 0.f, 0.66666f)); // extend butt corner point 1 along the normal vector - verticesOut.push_back(SVertex(corner1, 0.f, 1.0f)); // push butt corner point 1 + verticesOut.push_back(SVertex(corner2 + (lineDirectionNormal * (line.m_Thickness)), 0.f, 0.33333f)); // extend butt corner point 2 along the normal vector + verticesOut.push_back(SVertex(corner1 + (lineDirectionNormal * (line.m_Thickness)), 0.f, 0.66666f)); // extend butt corner point 1 along the normal vector + verticesOut.push_back(SVertex(corner1, 0.f, 1.0f)); // push butt corner point 1 - for (int i=1; i < 4; ++i) - { - indicesOut.push_back(indexOffset); // center point - indicesOut.push_back(indexOffset + i); + for (int i=1; i < 4; ++i) + { + indicesOut.push_back(indexOffset); // center point + indicesOut.push_back(indexOffset + i); indicesOut.push_back(indexOffset + i + 1); - } + } } break; diff --git a/source/renderer/VertexBuffer.cpp b/source/renderer/VertexBuffer.cpp index 0f0fa747d5..150951fb77 100644 --- a/source/renderer/VertexBuffer.cpp +++ b/source/renderer/VertexBuffer.cpp @@ -42,7 +42,7 @@ CVertexBuffer::CVertexBuffer(size_t vertexSize, GLenum usage, GLenum target) if (target == GL_ARRAY_BUFFER) // vertex data buffer { // We want to store 16-bit indices to any vertex in a buffer, so the - // buffer must never be bigger than vertexSize*64K bytes since we can + // buffer must never be bigger than vertexSize*64K bytes since we can // address at most 64K of them with 16-bit indices size = std::min(size, vertexSize*65536); } @@ -96,8 +96,8 @@ bool CVertexBuffer::CompatibleVertexType(size_t vertexSize, GLenum usage, GLenum } /////////////////////////////////////////////////////////////////////////////// -// Allocate: try to allocate a buffer of given number of vertices (each of -// given size), with the given type, and using the given texture - return null +// Allocate: try to allocate a buffer of given number of vertices (each of +// given size), with the given type, and using the given texture - return null // if no free chunks available CVertexBuffer::VBChunk* CVertexBuffer::Allocate(size_t vertexSize, size_t numVertices, GLenum usage, GLenum target, void* backingStore) { @@ -135,7 +135,7 @@ CVertexBuffer::VBChunk* CVertexBuffer::Allocate(size_t vertexSize, size_t numVer chunk->m_Dirty = false; chunk->m_Needed = false; - // split chunk into two; - allocate a new chunk using all unused vertices in the + // split chunk into two; - allocate a new chunk using all unused vertices in the // found chunk, and add it to the free list if (chunk->m_Count > numVertices) { diff --git a/source/renderer/VertexBufferManager.cpp b/source/renderer/VertexBufferManager.cpp index 0efed3ff19..2a9ab0d1b0 100644 --- a/source/renderer/VertexBufferManager.cpp +++ b/source/renderer/VertexBufferManager.cpp @@ -44,8 +44,8 @@ void CVertexBufferManager::Shutdown() /////////////////////////////////////////////////////////////////////////////// -// Allocate: try to allocate a buffer of given number of vertices (each of -// given size), with the given type, and using the given texture - return null +// Allocate: try to allocate a buffer of given number of vertices (each of +// given size), with the given type, and using the given texture - return null // if no free chunks available CVertexBuffer::VBChunk* CVertexBufferManager::Allocate(size_t vertexSize, size_t numVertices, GLenum usage, GLenum target, void* backingStore) { @@ -74,7 +74,7 @@ CVertexBuffer::VBChunk* CVertexBufferManager::Allocate(size_t vertexSize, size_t } #endif - // iterate through all existing buffers testing for one that'll + // iterate through all existing buffers testing for one that'll // satisfy the allocation for (Iter iter = m_Buffers.begin(); iter != m_Buffers.end(); ++iter) { CVertexBuffer* buffer = *iter; diff --git a/source/scriptinterface/ScriptConversions.cpp b/source/scriptinterface/ScriptConversions.cpp index cdb7a4ff1e..d4dff529de 100644 --- a/source/scriptinterface/ScriptConversions.cpp +++ b/source/scriptinterface/ScriptConversions.cpp @@ -305,10 +305,10 @@ template<> void ScriptInterface::ToJSVal(JSContext* UNUSED(cx), J ret.set(JS::NumberValue((int)val)); } -// (s)size_t are considered to be identical to (unsigned) int by GCC and -// their specializations would cause conflicts there. On x86_64 GCC, s/size_t -// is equivalent to (unsigned) long, but the same solution applies; use the -// long and unsigned long specializations instead of s/size_t. +// (s)size_t are considered to be identical to (unsigned) int by GCC and +// their specializations would cause conflicts there. On x86_64 GCC, s/size_t +// is equivalent to (unsigned) long, but the same solution applies; use the +// long and unsigned long specializations instead of s/size_t. // for some reason, x64 MSC treats size_t as distinct from unsigned long: #if MSC_VERSION && ARCH_AMD64 diff --git a/source/scriptinterface/ScriptInterface.cpp b/source/scriptinterface/ScriptInterface.cpp index c52ac4f317..34b15a15f0 100644 --- a/source/scriptinterface/ScriptInterface.cpp +++ b/source/scriptinterface/ScriptInterface.cpp @@ -729,7 +729,7 @@ bool ScriptInterface::GetPropertyInt_(JS::HandleValue obj, int name, JS::Mutable bool ScriptInterface::HasProperty(JS::HandleValue obj, const char* name) { - // TODO: proper errorhandling + // TODO: proper errorhandling JSAutoRequest rq(m->m_cx); if (!obj.isObject()) return false; diff --git a/source/scriptinterface/ScriptRuntime.cpp b/source/scriptinterface/ScriptRuntime.cpp index 8d6632b968..75269848f2 100644 --- a/source/scriptinterface/ScriptRuntime.cpp +++ b/source/scriptinterface/ScriptRuntime.cpp @@ -159,16 +159,16 @@ void ScriptRuntime::MaybeIncrementalGC(double delay) if (JS::IsIncrementalGCEnabled(m_rt)) { // The idea is to get the heap size after a completed GC and trigger the next GC when the heap size has - // reached m_LastGCBytes + X. + // reached m_LastGCBytes + X. // In practice it doesn't quite work like that. When the incremental marking is completed, the sweeping kicks in. // The sweeping actually frees memory and it does this in a background thread (if JS_USE_HELPER_THREADS is set). // While the sweeping is happening we already run scripts again and produce new garbage. const int GCSliceTimeBudget = 30; // Milliseconds an incremental slice is allowed to run - // Have a minimum time in seconds to wait between GC slices and before starting a new GC to distribute the GC - // load and to hopefully make it unnoticeable for the player. This value should be high enough to distribute - // the load well enough and low enough to make sure we don't run out of memory before we can start with the + // Have a minimum time in seconds to wait between GC slices and before starting a new GC to distribute the GC + // load and to hopefully make it unnoticeable for the player. This value should be high enough to distribute + // the load well enough and low enough to make sure we don't run out of memory before we can start with the // sweeping. if (timer_Time() - m_LastGCCheck < delay) return; @@ -189,7 +189,7 @@ void ScriptRuntime::MaybeIncrementalGC(double delay) m_LastGCBytes = gcBytes; } - // Run an additional incremental GC slice if the currently running incremental GC isn't over yet + // Run an additional incremental GC slice if the currently running incremental GC isn't over yet // ... or // start a new incremental GC if the JS heap size has grown enough for a GC to make sense if (JS::IsIncrementalGCInProgress(m_rt) || (gcBytes - m_LastGCBytes > m_HeapGrowthBytesGCTrigger)) @@ -199,9 +199,9 @@ void ScriptRuntime::MaybeIncrementalGC(double delay) printf("An incremental GC cycle is in progress. \n"); else printf("GC needed because JSGC_BYTES - m_LastGCBytes > m_HeapGrowthBytesGCTrigger \n" - " JSGC_BYTES: %d KB \n m_LastGCBytes: %d KB \n m_HeapGrowthBytesGCTrigger: %d KB \n", - gcBytes / 1024, - m_LastGCBytes / 1024, + " JSGC_BYTES: %d KB \n m_LastGCBytes: %d KB \n m_HeapGrowthBytesGCTrigger: %d KB \n", + gcBytes / 1024, + m_LastGCBytes / 1024, m_HeapGrowthBytesGCTrigger / 1024); #endif diff --git a/source/simulation2/components/CCmpAIManager.cpp b/source/simulation2/components/CCmpAIManager.cpp index 2a891b775c..eff5ac52f2 100644 --- a/source/simulation2/components/CCmpAIManager.cpp +++ b/source/simulation2/components/CCmpAIManager.cpp @@ -80,7 +80,7 @@ private: public: CAIPlayer(CAIWorker& worker, const std::wstring& aiName, player_id_t player, u8 difficulty, shared_ptr scriptInterface) : - m_Worker(worker), m_AIName(aiName), m_Player(player), m_Difficulty(difficulty), + m_Worker(worker), m_AIName(aiName), m_Player(player), m_Difficulty(difficulty), m_ScriptInterface(scriptInterface), m_Obj(scriptInterface->GetJSRuntime()) { } @@ -392,7 +392,7 @@ public: OsPath path = L"simulation/ai/common-api/"; // Constructor name is SharedScript, it's in the module API3 - // TODO: Hardcoding this is bad, we need a smarter way. + // TODO: Hardcoding this is bad, we need a smarter way. JS::RootedValue AIModule(cx); JS::RootedValue global(cx, m_ScriptInterface->GetGlobalObject()); JS::RootedValue ctor(cx); @@ -466,7 +466,7 @@ public: return true; } - bool RunGamestateInit(const shared_ptr& gameState, const Grid& passabilityMap, const Grid& territoryMap, + bool RunGamestateInit(const shared_ptr& gameState, const Grid& passabilityMap, const Grid& territoryMap, const std::map& nonPathfindingPassClassMasks, const std::map& pathfindingPassClassMasks) { // this will be run last by InitGame.Js, passing the full game representation. @@ -698,7 +698,7 @@ public: SerializeMap()(serializer, "pathfinding pass classes", m_PathfindingPassClasses); serializer.NumberU16_Unbounded("pathfinder grid w", m_PassabilityMap.m_W); serializer.NumberU16_Unbounded("pathfinder grid h", m_PassabilityMap.m_H); - serializer.RawBytes("pathfinder grid data", (const u8*)m_PassabilityMap.m_Data, + serializer.RawBytes("pathfinder grid data", (const u8*)m_PassabilityMap.m_Data, m_PassabilityMap.m_W*m_PassabilityMap.m_H*sizeof(NavcellData)); } diff --git a/source/simulation2/components/CCmpObstruction.cpp b/source/simulation2/components/CCmpObstruction.cpp index a45b1e4970..3d937355be 100644 --- a/source/simulation2/components/CCmpObstruction.cpp +++ b/source/simulation2/components/CCmpObstruction.cpp @@ -91,7 +91,7 @@ public: * Optional secondary control group identifier. Similar to m_ControlGroup; if set to a valid value, * then this field identifies an additional, secondary control group to which this entity's shape * belongs. Set to INVALID_ENTITY to not assign any secondary group. Defaults to INVALID_ENTITY. - * + * * These are only necessary in case it is not sufficient for an entity to belong to only one control * group. Otherwise, they can be ignored. */ @@ -396,7 +396,7 @@ public: else if (m_Type == UNIT) m_Tag = cmpObstructionManager->AddUnitShape(GetEntityId(), pos.X, pos.Y, m_Clearance, (flags_t)(m_Flags | (m_Moving ? ICmpObstructionManager::FLAG_MOVING : 0)), m_ControlGroup); - else + else AddClusterShapes(pos.X, pos.Y, cmpPosition->GetRotation().Y); } else if (!active && m_Active) @@ -554,7 +554,7 @@ public: pass_class_t passClass = cmpPathfinder->GetPassabilityClass(className); // Ignore collisions within the same control group, or with other non-foundation-blocking shapes. - // Note that, since the control group for each entity defaults to the entity's ID, this is typically + // Note that, since the control group for each entity defaults to the entity's ID, this is typically // equivalent to only ignoring the entity's own shape and other non-foundation-blocking shapes. SkipControlGroupsRequireFlagObstructionFilter filter(m_ControlGroup, m_ControlGroup2, ICmpObstructionManager::FLAG_BLOCK_FOUNDATION); @@ -595,7 +595,7 @@ public: return !cmpObstructionManager->TestUnitShape(filter, pos.X, pos.Y, m_Clearance, NULL); else return !cmpObstructionManager->TestStaticShape(filter, pos.X, pos.Y, cmpPosition->GetRotation().Y, m_Size0, m_Size1, NULL ); - } + } virtual std::vector GetUnitCollisions() { @@ -648,12 +648,12 @@ public: UpdateControlGroups(); } - virtual entity_id_t GetControlGroup() + virtual entity_id_t GetControlGroup() { return m_ControlGroup; } - virtual entity_id_t GetControlGroup2() + virtual entity_id_t GetControlGroup2() { return m_ControlGroup2; } @@ -704,7 +704,7 @@ public: CFixedVector2D pos = cmpPosition->GetPosition2D(); // Ignore collisions within the same control group, or with other non-foundation-blocking shapes. - // Note that, since the control group for each entity defaults to the entity's ID, this is typically + // Note that, since the control group for each entity defaults to the entity's ID, this is typically // equivalent to only ignoring the entity's own shape and other non-foundation-blocking shapes. SkipControlGroupsRequireFlagObstructionFilter filter(m_ControlGroup, m_ControlGroup2, ICmpObstructionManager::FLAG_BLOCK_FOUNDATION); diff --git a/source/simulation2/components/CCmpPathfinder.cpp b/source/simulation2/components/CCmpPathfinder.cpp index e0e725fe51..6562c8f975 100644 --- a/source/simulation2/components/CCmpPathfinder.cpp +++ b/source/simulation2/components/CCmpPathfinder.cpp @@ -66,18 +66,18 @@ void CCmpPathfinder::Init(const CParamNode& UNUSED(paramNode)) // Previously all move commands during a turn were // queued up and processed asynchronously at the start - // of the next turn. Now we are processing queued up + // of the next turn. Now we are processing queued up // events several times duing the turn. This improves // responsiveness and units move more smoothly especially. - // when in formation. There is still a call at the - // beginning of a turn to process all outstanding moves - - // this will handle any moves above the MaxSameTurnMoves - // threshold. + // when in formation. There is still a call at the + // beginning of a turn to process all outstanding moves - + // this will handle any moves above the MaxSameTurnMoves + // threshold. // - // TODO - The moves processed at the beginning of the - // turn do not count against the maximum moves per turn - // currently. The thinking is that this will eventually - // happen in another thread. Either way this probably + // TODO - The moves processed at the beginning of the + // turn do not count against the maximum moves per turn + // currently. The thinking is that this will eventually + // happen in another thread. Either way this probably // will require some adjustment and rethinking. const CParamNode pathingSettings = externalParamNode.GetChild("Pathfinder"); m_MaxSameTurnMoves = (u16)pathingSettings.GetChild("MaxSameTurnMoves").ToInt(); @@ -651,7 +651,7 @@ void CCmpPathfinder::TerrainUpdateHelper(bool expandPassability) // Expand the impassability grid, for any class with non-zero clearance, // so that we can stop units getting too close to impassable navcells. // Note: It's not possible to perform this expansion once for all passabilities - // with the same clearance, because the impassable cells are not necessarily the + // with the same clearance, because the impassable cells are not necessarily the // same for all these passabilities. for (PathfinderPassability& passability : m_PassClasses) { diff --git a/source/simulation2/components/CCmpPosition.cpp b/source/simulation2/components/CCmpPosition.cpp index 391684315a..6b2eedd63f 100644 --- a/source/simulation2/components/CCmpPosition.cpp +++ b/source/simulation2/components/CCmpPosition.cpp @@ -192,12 +192,12 @@ public: const char* anchor = "???"; switch (m_AnchorType) { - case PITCH: - anchor = "pitch"; + case PITCH: + anchor = "pitch"; break; - case PITCH_ROLL: - anchor = "pitch-roll"; + case PITCH_ROLL: + anchor = "pitch-roll"; break; case ROLL: @@ -205,8 +205,8 @@ public: break; case UPRIGHT: // upright is the default - default: - anchor = "upright"; + default: + anchor = "upright"; break; } serialize.StringASCII("anchor", anchor, 0, 16); @@ -501,26 +501,26 @@ public: return CFixedVector2D(m_X, m_Z); } - virtual CFixedVector3D GetPreviousPosition() - { - if (!m_InWorld) - { - LOGERROR("CCmpPosition::GetPreviousPosition called on entity when IsInWorld is false"); - return CFixedVector3D(); - } + virtual CFixedVector3D GetPreviousPosition() + { + if (!m_InWorld) + { + LOGERROR("CCmpPosition::GetPreviousPosition called on entity when IsInWorld is false"); + return CFixedVector3D(); + } - return CFixedVector3D(m_PrevX, GetHeightFixed(), m_PrevZ); - } + return CFixedVector3D(m_PrevX, GetHeightFixed(), m_PrevZ); + } - virtual CFixedVector2D GetPreviousPosition2D() - { - if (!m_InWorld) - { - LOGERROR("CCmpPosition::GetPreviousPosition2D called on entity when IsInWorld is false"); - return CFixedVector2D(); - } + virtual CFixedVector2D GetPreviousPosition2D() + { + if (!m_InWorld) + { + LOGERROR("CCmpPosition::GetPreviousPosition2D called on entity when IsInWorld is false"); + return CFixedVector2D(); + } - return CFixedVector2D(m_PrevX, m_PrevZ); + return CFixedVector2D(m_PrevX, m_PrevZ); } virtual void TurnTo(entity_angle_t y) @@ -700,7 +700,7 @@ public: CMatrix3D m; - // linear interpolation is good enough (for RotX/Z). + // linear interpolation is good enough (for RotX/Z). // As you always stay close to zero angle. m.SetXRotation(Interpolate(m_LastInterpolatedRotX, m_InterpolatedRotX, frameOffset)); m.RotateZ(Interpolate(m_LastInterpolatedRotZ, m_InterpolatedRotZ, frameOffset)); diff --git a/source/simulation2/components/CCmpRallyPointRenderer.cpp b/source/simulation2/components/CCmpRallyPointRenderer.cpp index 9710e69c4c..54f028a297 100644 --- a/source/simulation2/components/CCmpRallyPointRenderer.cpp +++ b/source/simulation2/components/CCmpRallyPointRenderer.cpp @@ -46,7 +46,7 @@ struct SVisibilitySegment size_t m_StartIndex; size_t m_EndIndex; // inclusive - SVisibilitySegment(bool visible, size_t startIndex, size_t endIndex) + SVisibilitySegment(bool visible, size_t startIndex, size_t endIndex) : m_Visible(visible), m_StartIndex(startIndex), m_EndIndex(endIndex) {} @@ -87,9 +87,9 @@ public: protected: - /// Display position of the rally points. Note that this are merely the display positions; they not necessarily the same as the + /// Display position of the rally points. Note that this are merely the display positions; they not necessarily the same as the /// actual positions used in the simulation at any given time. In particular, we need this separate copy to support - /// instantaneously rendering the rally point markers/lines when the user sets one in-game (instead of waiting until the + /// instantaneously rendering the rally point markers/lines when the user sets one in-game (instead of waiting until the /// network-synchronization code sets it on the RallyPoint component, which might take up to half a second). std::vector m_RallyPoints; /// Full path to the rally points as returned by the pathfinder, with some post-processing applied to reduce zig/zagging. @@ -118,7 +118,7 @@ protected: CTexturePtr m_Texture; CTexturePtr m_TextureMask; - /// Textured overlay lines to be used for rendering the marker line. There can be multiple because we may need to render + /// Textured overlay lines to be used for rendering the marker line. There can be multiple because we may need to render /// dashes for segments that are inside the SoD. std::vector > m_TexturedOverlayLines; @@ -308,7 +308,7 @@ public: UpdateMarkers(); // Check for changes to the SoD and update the overlay lines accordingly. We need to do this here because this method - // only takes effect when the display flag is active; we need to pick up changes to the SoD that might have occurred + // only takes effect when the display flag is active; we need to pick up changes to the SoD that might have occurred // while this rally point was not being displayed. UpdateOverlayLines(); @@ -352,7 +352,7 @@ private: /** * Repositions the rally point markers; moves them outside of the world (ie. hides them), or positions them at the currently * set rally points. Also updates the actor's variation according to the entity's current owning player's civilization. - * + * * Should be called whenever either the position of a rally point changes (including whether it is set or not), or the display * flag changes, or the ownership of the entity changes. */ @@ -361,14 +361,14 @@ private: /** * Recomputes all the full paths from this entity to the rally point and from the rally point to the next, and does all the necessary * post-processing to make them prettier. - * + * * Should be called whenever all rally points' position changes. */ void RecomputeAllRallyPointPaths(); /** * Recomputes the full path for m_Path[ @p index], and does all the necessary post-processing to make it prettier. - * + * * Should be called whenever either the starting position or the rally point's position changes. */ void RecomputeRallyPointPath_wrapper(size_t index); @@ -376,33 +376,33 @@ private: /** * Recomputes the full path from this entity/the previous rally point to the next rally point, and does all the necessary * post-processing to make it prettier. This doesn't check if we have a valid position or if a rally point is set. - * + * * You shouldn't need to call this method directly. */ void RecomputeRallyPointPath(size_t index, CmpPtr& cmpPosition, CmpPtr& cmpFootprint, CmpPtr cmpPathfinder); /** - * Checks for changes to the SoD to the previously saved state, and reconstructs the visibility segments and overlay lines to + * Checks for changes to the SoD to the previously saved state, and reconstructs the visibility segments and overlay lines to * match if necessary. Does nothing if the rally point lines are not currently set to be displayed, or if no rally point is set. */ void UpdateOverlayLines(); /** - * Sets up all overlay lines for rendering according to the current full path and visibility segments. Splits the line into solid - * and dashed pieces (for the SoD). Should be called whenever the SoD has changed. If no full path is currently set, this method + * Sets up all overlay lines for rendering according to the current full path and visibility segments. Splits the line into solid + * and dashed pieces (for the SoD). Should be called whenever the SoD has changed. If no full path is currently set, this method * does nothing. */ void ConstructAllOverlayLines(); /** - * Sets up the overlay lines for rendering according to the full path and visibility segments at @p index. Splits the line into - * solid and dashed pieces (for the SoD). Should be called whenever the SoD of the path at @p index has changed. + * Sets up the overlay lines for rendering according to the full path and visibility segments at @p index. Splits the line into + * solid and dashed pieces (for the SoD). Should be called whenever the SoD of the path at @p index has changed. */ void ConstructOverlayLines(size_t index); /** - * Removes points from @p coords that are obstructed by the originating building's footprint, and links up the last point - * nicely to the edge of the building's footprint. Only needed if the pathfinder can possibly return obstructed tile waypoints, + * Removes points from @p coords that are obstructed by the originating building's footprint, and links up the last point + * nicely to the edge of the building's footprint. Only needed if the pathfinder can possibly return obstructed tile waypoints, * i.e. when pathfinding is started from an obstructed tile. */ void FixFootprintWaypoints(std::vector& coords, CmpPtr cmpPosition, CmpPtr cmpFootprint); @@ -413,13 +413,13 @@ private: void GetClosestsEdgePointFrom(CFixedVector2D& result, CFixedVector2D& start, CmpPtr cmpPosition, CmpPtr cmpFootprint); /** - * Returns a list of indices of waypoints in the current path (m_Path[index]) where the LOS visibility changes, ordered from + * Returns a list of indices of waypoints in the current path (m_Path[index]) where the LOS visibility changes, ordered from * building/previous rally point to rally point. Used to construct the overlay line segments and track changes to the SoD. */ void GetVisibilitySegments(std::deque& out, size_t index); /** - * Simplifies the path by removing waypoints that lie between two points that are visible from one another. This is primarily + * Simplifies the path by removing waypoints that lie between two points that are visible from one another. This is primarily * intended to reduce some unnecessary curviness of the path; the pathfinder returns a mathematically (near-)optimal path, which * will happily curve and bend to reduce costs. Visually, it doesn't make sense for a rally point path to curve and bend when it * could just as well have gone in a straight line; that's why we have this, to make it look more natural. @@ -433,7 +433,7 @@ private: void ReduceSegmentsByVisibility(std::vector& coords, unsigned maxSegmentLinks = 0, bool floating = true); /** - * Helper function to GetVisibilitySegments, factored out for testing. Merges single-point segments with its neighbouring + * Helper function to GetVisibilitySegments, factored out for testing. Merges single-point segments with its neighbouring * segments. You should not have to call this method directly. */ static void MergeVisibilitySegments(std::deque& segments); @@ -688,7 +688,7 @@ void CCmpRallyPointRenderer::RecomputeRallyPointPath(size_t index, CmpPtr= m_TexturedOverlayLines.size()) { @@ -812,10 +812,10 @@ void CCmpRallyPointRenderer::ConstructOverlayLines(size_t index) int numFitUnmodified = floor(distance/(dashSize + clearSize)); float remainderDistance = distance - (numFitUnmodified * (dashSize + clearSize)); - // Now we want to make remainderDistance equal exactly one dash size (i.e. maxDashSize) by scaling dashSize and clearSize slightly. + // Now we want to make remainderDistance equal exactly one dash size (i.e. maxDashSize) by scaling dashSize and clearSize slightly. // We have (remainderDistance - maxDashSize) of space to distribute over numFitUnmodified instances of (dashSize + clearSize) to make - // it fit, so each (dashSize + clearSize) pair needs to adjust its length by (remainderDistance - maxDashSize)/numFitUnmodified - // (which will be positive or negative accordingly). This number can then be distributed further proportionally among the dash's + // it fit, so each (dashSize + clearSize) pair needs to adjust its length by (remainderDistance - maxDashSize)/numFitUnmodified + // (which will be positive or negative accordingly). This number can then be distributed further proportionally among the dash's // length and the clear's length. // we always want to have at least one dash/clear pair (i.e., "|===| |===|"); also, we need to avoid division by zero below. @@ -885,7 +885,7 @@ void CCmpRallyPointRenderer::ConstructOverlayLines(size_t index) void CCmpRallyPointRenderer::UpdateOverlayLines() { - // We should only do this if the rally point is currently being displayed and set inside the world, otherwise it's a massive + // We should only do this if the rally point is currently being displayed and set inside the world, otherwise it's a massive // waste of time to calculate all this stuff (this method is called every turn) if (!m_Displayed || !IsSet()) return; @@ -1100,7 +1100,7 @@ void CCmpRallyPointRenderer::ReduceSegmentsByVisibility(std::vector& // find out whether curNode is visible from baseNode (careful; this is in 2D only; terrain height differences are ignored!) bool curNodeVisible = cmpPathFinder->CheckMovement(obstructionFilter, baseNodeX, baseNodeZ, curNodeX, curNodeZ, lineRadius, passabilityClass); - // since height differences are ignored by CheckMovement, let's call two points visible from one another only if they're at + // since height differences are ignored by CheckMovement, let's call two points visible from one another only if they're at // roughly the same terrain elevation curNodeVisible = curNodeVisible && (fabsf(curNodeY - baseNodeY) < 3.f); // TODO: this could probably use some tuning if (maxSegmentLinks > 0) @@ -1195,7 +1195,7 @@ void CCmpRallyPointRenderer::GetVisibilitySegments(std::deque& segments) { // Scan for single-point segments; if they are inbetween two other segments, delete them and merge the surrounding segments. - // If they're at either end of the path, include them in their bordering segment (but only if those bordering segments aren't + // If they're at either end of the path, include them in their bordering segment (but only if those bordering segments aren't // themselves single-point segments, because then we would want those to get absorbed by its surrounding ones first). // first scan for absorptions of single-point surrounded segments (i.e. excluding edge segments) diff --git a/source/simulation2/components/CCmpRangeManager.cpp b/source/simulation2/components/CCmpRangeManager.cpp index b07c9ba433..9d955b7440 100644 --- a/source/simulation2/components/CCmpRangeManager.cpp +++ b/source/simulation2/components/CCmpRangeManager.cpp @@ -1844,8 +1844,8 @@ public: { // Warning: Code related to fogging (like ForceMiraging) shouldn't be // invoked while iterating through m_EntityData. - // Otherwise, by deleting mirage entities and so on, that code will - // change the indexes in the map, leading to segfaults. + // Otherwise, by deleting mirage entities and so on, that code will + // change the indexes in the map, leading to segfaults. // So we just remember what entities to mirage and do that later. std::vector miragableEntities; diff --git a/source/simulation2/components/CCmpSelectable.cpp b/source/simulation2/components/CCmpSelectable.cpp index 88a0db02ca..df7f187689 100644 --- a/source/simulation2/components/CCmpSelectable.cpp +++ b/source/simulation2/components/CCmpSelectable.cpp @@ -63,7 +63,7 @@ public: DEFAULT_COMPONENT_ALLOCATOR(Selectable) CCmpSelectable() - : m_DebugBoundingBoxOverlay(NULL), m_DebugSelectionBoxOverlay(NULL), + : m_DebugBoundingBoxOverlay(NULL), m_DebugSelectionBoxOverlay(NULL), m_BuildingOverlay(NULL), m_UnitOverlay(NULL), m_FadeBaselineAlpha(0.f), m_FadeDeltaAlpha(0.f), m_FadeProgress(0.f), m_Selected(false), m_Cached(false), m_Visible(false) @@ -219,7 +219,7 @@ public: void RenderSubmit(SceneCollector& collector); /** - * Called from RenderSubmit if using a static outline; responsible for ensuring that the static overlay + * Called from RenderSubmit if using a static outline; responsible for ensuring that the static overlay * is up-to-date before it is rendered. Has no effect unless the static overlay is explicitly marked as * invalid first (see InvalidateStaticOverlay). */ @@ -320,7 +320,7 @@ void CCmpSelectable::HandleMessage(const CMessage& msg, bool UNUSED(global)) break; } - case MT_OwnershipChanged: + case MT_OwnershipChanged: { const CMessageOwnershipChanged& msgData = static_cast (msg); @@ -431,12 +431,12 @@ void CCmpSelectable::UpdateStaticOverlay() entity_pos_t fpSize0_fixed, fpSize1_fixed, fpHeight_fixed; cmpFootprint->GetShape(fpShape, fpSize0_fixed, fpSize1_fixed, fpHeight_fixed); - CTextureProperties texturePropsBase(m_OverlayDescriptor.m_LineTexture.c_str()); - texturePropsBase.SetWrap(GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE); + CTextureProperties texturePropsBase(m_OverlayDescriptor.m_LineTexture.c_str()); + texturePropsBase.SetWrap(GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE); texturePropsBase.SetMaxAnisotropy(4.f); CTextureProperties texturePropsMask(m_OverlayDescriptor.m_LineTextureMask.c_str()); - texturePropsMask.SetWrap(GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE); + texturePropsMask.SetWrap(GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE); texturePropsMask.SetMaxAnisotropy(4.f); // ------------------------------------------------------------------------------------- @@ -538,12 +538,12 @@ void CCmpSelectable::UpdateDynamicOverlay(float frameOffset) m_UnitOverlay = new SOverlayQuad; // Assuming we don't need the capability of swapping textures on-demand. - CTextureProperties texturePropsBase(m_OverlayDescriptor.m_QuadTexture.c_str()); - texturePropsBase.SetWrap(GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE); + CTextureProperties texturePropsBase(m_OverlayDescriptor.m_QuadTexture.c_str()); + texturePropsBase.SetWrap(GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE); texturePropsBase.SetMaxAnisotropy(4.f); CTextureProperties texturePropsMask(m_OverlayDescriptor.m_QuadTextureMask.c_str()); - texturePropsMask.SetWrap(GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE); + texturePropsMask.SetWrap(GL_CLAMP_TO_BORDER, GL_CLAMP_TO_EDGE); texturePropsMask.SetMaxAnisotropy(4.f); m_UnitOverlay->m_Texture = g_Renderer.GetTextureManager().CreateTexture(texturePropsBase); @@ -552,7 +552,7 @@ void CCmpSelectable::UpdateDynamicOverlay(float frameOffset) m_UnitOverlay->m_Color = m_Color; - // TODO: some code duplication here :< would be nice to factor out getting the corner points of an + // TODO: some code duplication here :< would be nice to factor out getting the corner points of an // entity based on its footprint sizes (and regardless of whether it's a circle or a square) float s = sinf(-rotY); @@ -652,10 +652,10 @@ void CCmpSelectable::RenderSubmit(SceneCollector& collector) if (!m_DebugSelectionBoxOverlay) m_DebugSelectionBoxOverlay = new SOverlayLine; CmpPtr cmpVisual(GetEntityHandle()); - if (cmpVisual) + if (cmpVisual) { SimRender::ConstructBoxOutline(cmpVisual->GetBounds(), *m_DebugBoundingBoxOverlay); - m_DebugBoundingBoxOverlay->m_Thickness = 2; + m_DebugBoundingBoxOverlay->m_Thickness = 2; m_DebugBoundingBoxOverlay->m_Color = CColor(1.f, 0.f, 0.f, 1.f); SimRender::ConstructBoxOutline(cmpVisual->GetSelectionBox(), *m_DebugSelectionBoxOverlay); diff --git a/source/simulation2/components/CCmpSoundManager.cpp b/source/simulation2/components/CCmpSoundManager.cpp index d33d4a8168..49132a6e46 100644 --- a/source/simulation2/components/CCmpSoundManager.cpp +++ b/source/simulation2/components/CCmpSoundManager.cpp @@ -68,7 +68,7 @@ public: CmpPtr cmpRangeManager(GetSystemEntity()); int currentPlayer = GetSimContext().GetCurrentDisplayedPlayer(); - if ( !cmpRangeManager || + if ( !cmpRangeManager || ( cmpRangeManager->GetLosVisibility(source, currentPlayer) != ICmpRangeManager::VIS_VISIBLE ) ) return; diff --git a/source/simulation2/components/CCmpTerritoryManager.cpp b/source/simulation2/components/CCmpTerritoryManager.cpp index e3742c2e9d..454ba794b0 100644 --- a/source/simulation2/components/CCmpTerritoryManager.cpp +++ b/source/simulation2/components/CCmpTerritoryManager.cpp @@ -444,7 +444,7 @@ void CCmpTerritoryManager::CalculateTerritories() u8 owner = (u8)pair.first; const std::vector& ents = pair.second; // With 2^16 entities, we're safe against overflows as the weight is also limited to 2^16 - ENSURE(ents.size() < 1 << 16); + ENSURE(ents.size() < 1 << 16); // Compute the influence map of the current entity, then add it to the player grid for (entity_id_t ent : ents) { @@ -771,7 +771,7 @@ bool CCmpTerritoryManager::IsTerritoryBlinking(entity_pos_t x, entity_pos_t z) } TerritoryOverlay::TerritoryOverlay(CCmpTerritoryManager& manager) : - TerrainTextureOverlay((float)Pathfinding::NAVCELLS_PER_TILE / ICmpTerritoryManager::NAVCELLS_PER_TERRITORY_TILE), + TerrainTextureOverlay((float)Pathfinding::NAVCELLS_PER_TILE / ICmpTerritoryManager::NAVCELLS_PER_TERRITORY_TILE), m_TerritoryManager(manager) { } diff --git a/source/simulation2/components/CCmpUnitMotion.cpp b/source/simulation2/components/CCmpUnitMotion.cpp index 595d570444..04a7a00faa 100644 --- a/source/simulation2/components/CCmpUnitMotion.cpp +++ b/source/simulation2/components/CCmpUnitMotion.cpp @@ -405,7 +405,7 @@ public: } case MT_ValueModification: { - const CMessageValueModification& msgData = static_cast (msg); + const CMessageValueModification& msgData = static_cast (msg); if (msgData.component != L"UnitMotion") break; } @@ -657,7 +657,7 @@ private: /** * Returns an appropriate obstruction filter for use with path requests. - * noTarget is true only when used inside tryGoingStraightToTargetEntity, + * noTarget is true only when used inside tryGoingStraightToTargetEntity, * in which case we do not want the target obstruction otherwise it would always fail */ ControlGroupMovementObstructionFilter GetObstructionFilter(bool noTarget = false) const; @@ -1573,12 +1573,12 @@ bool CCmpUnitMotion::MoveToTargetRange(entity_id_t target, entity_pos_t minRange entity_pos_t distance = Geometry::DistanceToSquare(pos - CFixedVector2D(obstruction.x, obstruction.z), obstruction.u, obstruction.v, halfSize, true); - // Compare with previous obstruction + // Compare with previous obstruction ICmpObstructionManager::ObstructionSquare previousObstruction; cmpObstruction->GetPreviousObstructionSquare(previousObstruction); entity_pos_t previousDistance = Geometry::DistanceToSquare(pos - CFixedVector2D(previousObstruction.x, previousObstruction.z), obstruction.u, obstruction.v, halfSize, true); - bool inside = distance.IsZero() && !Geometry::DistanceToSquare(pos - CFixedVector2D(obstruction.x, obstruction.z), obstruction.u, obstruction.v, halfSize).IsZero(); + bool inside = distance.IsZero() && !Geometry::DistanceToSquare(pos - CFixedVector2D(obstruction.x, obstruction.z), obstruction.u, obstruction.v, halfSize).IsZero(); if ((distance < minRange && previousDistance < minRange) || inside) { // Too close to the square - need to move away diff --git a/source/simulation2/components/CCmpUnitRenderer.cpp b/source/simulation2/components/CCmpUnitRenderer.cpp index 5c1595737a..14f7f20ea2 100644 --- a/source/simulation2/components/CCmpUnitRenderer.cpp +++ b/source/simulation2/components/CCmpUnitRenderer.cpp @@ -270,7 +270,7 @@ public: virtual void PickAllEntitiesAtPoint(std::vector >& outEntities, const CVector3D& origin, const CVector3D& dir, bool allowEditorSelectables) { - // First, make a rough test with the worst-case bounding boxes to pick all + // First, make a rough test with the worst-case bounding boxes to pick all // entities/models that could possibly be hit by the ray. std::vector candidates; for (size_t i = 0; i < m_Units.size(); ++i) @@ -303,7 +303,7 @@ public: // see: http://trac.wildfiregames.com/ticket/1032 // Decals are flat objects without a selectionShape defined, // but they should still be selectable in the editor to move them - // around or delete them after they are placed. + // around or delete them after they are placed. // Check campaigns/labels/ in the Actors tab of atlas for examples. CBoundingBoxAligned aABBox = cmpVisual->GetBounds(); if (aABBox.IsEmpty()) diff --git a/source/simulation2/components/ICmpPosition.cpp b/source/simulation2/components/ICmpPosition.cpp index 6342db615a..194c10ae2f 100644 --- a/source/simulation2/components/ICmpPosition.cpp +++ b/source/simulation2/components/ICmpPosition.cpp @@ -40,8 +40,8 @@ DEFINE_INTERFACE_METHOD_1("SetFloating", void, ICmpPosition, SetFloating, bool) DEFINE_INTERFACE_METHOD_1("SetConstructionProgress", void, ICmpPosition, SetConstructionProgress, fixed) DEFINE_INTERFACE_METHOD_0("GetPosition", CFixedVector3D, ICmpPosition, GetPosition) DEFINE_INTERFACE_METHOD_0("GetPosition2D", CFixedVector2D, ICmpPosition, GetPosition2D) -DEFINE_INTERFACE_METHOD_0("GetPreviousPosition", CFixedVector3D, ICmpPosition, GetPreviousPosition) -DEFINE_INTERFACE_METHOD_0("GetPreviousPosition2D", CFixedVector2D, ICmpPosition, GetPreviousPosition2D) +DEFINE_INTERFACE_METHOD_0("GetPreviousPosition", CFixedVector3D, ICmpPosition, GetPreviousPosition) +DEFINE_INTERFACE_METHOD_0("GetPreviousPosition2D", CFixedVector2D, ICmpPosition, GetPreviousPosition2D) DEFINE_INTERFACE_METHOD_1("TurnTo", void, ICmpPosition, TurnTo, entity_angle_t) DEFINE_INTERFACE_METHOD_1("SetYRotation", void, ICmpPosition, SetYRotation, entity_angle_t) DEFINE_INTERFACE_METHOD_2("SetXZRotation", void, ICmpPosition, SetXZRotation, entity_angle_t, entity_angle_t) diff --git a/source/simulation2/helpers/LongPathfinder.cpp b/source/simulation2/helpers/LongPathfinder.cpp index f5d03b8066..6769841777 100644 --- a/source/simulation2/helpers/LongPathfinder.cpp +++ b/source/simulation2/helpers/LongPathfinder.cpp @@ -375,7 +375,7 @@ public: ////////////////////////////////////////////////////////// -LongPathfinder::LongPathfinder() : +LongPathfinder::LongPathfinder() : m_UseJPSCache(false), m_Grid(NULL), m_GridSize(0), m_DebugOverlay(NULL), m_DebugGrid(NULL), m_DebugPath(NULL) @@ -1020,7 +1020,7 @@ void LongPathfinder::ImprovePathWaypoints(WaypointPath& path, pass_class_t passC if (maxDist > fixed::Zero() && (curr - prev).CompareLength(maxDist) > 0) { - // We are too far away from the previous waypoint, so create one in + // We are too far away from the previous waypoint, so create one in // between and continue with the improvement of the path prev = prev + (curr - prev) / 2; newWaypoints.emplace_back(Waypoint{ prev.X, prev.Y }); @@ -1072,7 +1072,7 @@ void LongPathfinder::SetDebugOverlay(bool enabled) SAFE_DELETE(m_DebugOverlay); } -void LongPathfinder::ComputePath(entity_pos_t x0, entity_pos_t z0, const PathGoal& origGoal, +void LongPathfinder::ComputePath(entity_pos_t x0, entity_pos_t z0, const PathGoal& origGoal, pass_class_t passClass, std::vector excludedRegions, WaypointPath& path) { GenerateSpecialMap(passClass, excludedRegions); diff --git a/source/simulation2/helpers/Render.cpp b/source/simulation2/helpers/Render.cpp index 0f2cd4213e..9d245bb3c1 100644 --- a/source/simulation2/helpers/Render.cpp +++ b/source/simulation2/helpers/Render.cpp @@ -204,7 +204,7 @@ void SimRender::ConstructSquareOnGround(const CSimContext& context, float x, flo void SimRender::ConstructBoxOutline(const CBoundingBoxAligned& bound, SOverlayLine& overlayLine) { - overlayLine.m_Coords.clear(); + overlayLine.m_Coords.clear(); if (bound.IsEmpty()) return; @@ -212,13 +212,13 @@ void SimRender::ConstructBoxOutline(const CBoundingBoxAligned& bound, SOverlayLi const CVector3D& pMin = bound[0]; const CVector3D& pMax = bound[1]; - // floor square + // floor square overlayLine.PushCoords(pMin.X, pMin.Y, pMin.Z); overlayLine.PushCoords(pMax.X, pMin.Y, pMin.Z); overlayLine.PushCoords(pMax.X, pMin.Y, pMax.Z); overlayLine.PushCoords(pMin.X, pMin.Y, pMax.Z); overlayLine.PushCoords(pMin.X, pMin.Y, pMin.Z); - // roof square + // roof square overlayLine.PushCoords(pMin.X, pMax.Y, pMin.Z); overlayLine.PushCoords(pMax.X, pMax.Y, pMin.Z); overlayLine.PushCoords(pMax.X, pMax.Y, pMax.Z); diff --git a/source/simulation2/helpers/Selection.cpp b/source/simulation2/helpers/Selection.cpp index bf79b594be..bd51f2d3b7 100644 --- a/source/simulation2/helpers/Selection.cpp +++ b/source/simulation2/helpers/Selection.cpp @@ -162,7 +162,7 @@ std::vector EntitySelection::PickEntitiesInRect(CSimulation2& simul return hitEnts; } -std::vector EntitySelection::PickSimilarEntities(CSimulation2& simulation, const CCamera& camera, +std::vector EntitySelection::PickSimilarEntities(CSimulation2& simulation, const CCamera& camera, const std::string& templateName, player_id_t owner, bool includeOffScreen, bool matchRank, bool allowEditorSelectables, bool allowFoundations) { diff --git a/source/simulation2/scripting/EngineScriptConversions.cpp b/source/simulation2/scripting/EngineScriptConversions.cpp index b7f2e28870..5aa970c14e 100644 --- a/source/simulation2/scripting/EngineScriptConversions.cpp +++ b/source/simulation2/scripting/EngineScriptConversions.cpp @@ -272,7 +272,7 @@ template<> void ScriptInterface::ToJSVal >(JSContext* cx, JS::MutableHa ret.setObject(*obj); } - + template<> void ScriptInterface::ToJSVal >(JSContext* cx, JS::MutableHandleValue ret, const Grid& val) { JSAutoRequest rq(cx); @@ -284,7 +284,7 @@ template<> void ScriptInterface::ToJSVal >(JSContext* cx, JS::MutableH JS::AutoCheckCannotGC nogc; memcpy((void*)JS_GetUint16ArrayData(objArr, nogc), val.m_Data, nbytes); } - + JS::RootedValue data(cx, JS::ObjectValue(*objArr)); JS::RootedValue w(cx); JS::RootedValue h(cx); diff --git a/source/simulation2/serialization/BinarySerializer.cpp b/source/simulation2/serialization/BinarySerializer.cpp index 5c3c9ab1ac..84d81560f0 100644 --- a/source/simulation2/serialization/BinarySerializer.cpp +++ b/source/simulation2/serialization/BinarySerializer.cpp @@ -55,7 +55,7 @@ static u8 GetArrayType(js::Scalar::Type arrayType) } CBinarySerializerScriptImpl::CBinarySerializerScriptImpl(ScriptInterface& scriptInterface, ISerializer& serializer) : - m_ScriptInterface(scriptInterface), m_Serializer(serializer), m_ScriptBackrefs(scriptInterface.GetRuntime()), + m_ScriptInterface(scriptInterface), m_Serializer(serializer), m_ScriptBackrefs(scriptInterface.GetRuntime()), m_SerializablePrototypes(new ObjectIdCache(scriptInterface.GetRuntime())), m_ScriptBackrefsNext(1) { m_ScriptBackrefs.init(); @@ -383,7 +383,7 @@ void CBinarySerializerScriptImpl::HandleScriptVal(JS::HandleValue val) // To reduce the size of the serialized data, we handle integers and doubles separately. // We can't check for val.isInt32 and val.isDouble directly, because integer numbers are not guaranteed // to be represented as integers. A number like 33 could be stored as integer on the computer of one player - // and as double on the other player's computer. That would cause out of sync errors in multiplayer games because + // and as double on the other player's computer. That would cause out of sync errors in multiplayer games because // their binary representation and thus the hash would be different. double d; diff --git a/source/simulation2/serialization/StdDeserializer.cpp b/source/simulation2/serialization/StdDeserializer.cpp index e37aebfdcd..f007fc52c9 100644 --- a/source/simulation2/serialization/StdDeserializer.cpp +++ b/source/simulation2/serialization/StdDeserializer.cpp @@ -28,7 +28,7 @@ #include "lib/byte_order.h" CStdDeserializer::CStdDeserializer(ScriptInterface& scriptInterface, std::istream& stream) : - m_ScriptInterface(scriptInterface), m_Stream(stream), + m_ScriptInterface(scriptInterface), m_Stream(stream), m_dummyObject(scriptInterface.GetJSRuntime()) { JSContext* cx = m_ScriptInterface.GetContext(); diff --git a/source/simulation2/system/ComponentManager.cpp b/source/simulation2/system/ComponentManager.cpp index 7ea7e2e82a..fc01c65b1e 100644 --- a/source/simulation2/system/ComponentManager.cpp +++ b/source/simulation2/system/ComponentManager.cpp @@ -494,10 +494,10 @@ void CComponentManager::Script_DestroyEntity(ScriptInterface::CxPrivate* pCxPriv componentManager->DestroyComponentsSoon(ent); } -void CComponentManager::Script_FlushDestroyedEntities(ScriptInterface::CxPrivate *pCxPrivate) -{ - CComponentManager* componentManager = static_cast (pCxPrivate->pCBData); - componentManager->FlushDestroyedComponents(); +void CComponentManager::Script_FlushDestroyedEntities(ScriptInterface::CxPrivate *pCxPrivate) +{ + CComponentManager* componentManager = static_cast (pCxPrivate->pCBData); + componentManager->FlushDestroyedComponents(); } void CComponentManager::ResetState() diff --git a/source/simulation2/system/ParamNode.cpp b/source/simulation2/system/ParamNode.cpp index 0a04495dbe..07f996261b 100644 --- a/source/simulation2/system/ParamNode.cpp +++ b/source/simulation2/system/ParamNode.cpp @@ -99,12 +99,12 @@ void CParamNode::ApplyLayer(const XMBFile& xmb, const XMBElement& element, const } else if (attr.Name == at_op) { - if (std::wstring(attr.Value.begin(), attr.Value.end()) == L"add") - op = ADD; - else if (std::wstring(attr.Value.begin(), attr.Value.end()) == L"mul") - op = MUL; - else - LOGWARNING("Invalid op '%ls'", attr.Value); + if (std::wstring(attr.Value.begin(), attr.Value.end()) == L"add") + op = ADD; + else if (std::wstring(attr.Value.begin(), attr.Value.end()) == L"mul") + op = MUL; + else + LOGWARNING("Invalid op '%ls'", attr.Value); } } } @@ -152,22 +152,22 @@ void CParamNode::ApplyLayer(const XMBFile& xmb, const XMBElement& element, const // Add this element as a child node CParamNode& node = m_Childs[name]; - if (op != INVALID) - { + if (op != INVALID) + { // TODO: Support parsing of data types other than fixed; log warnings in other cases fixed oldval = node.ToFixed(); fixed mod = fixed::FromString(CStrW(value)); - switch (op) - { - case ADD: - node.m_Value = (oldval + mod).ToString().FromUTF8(); - break; - case MUL: - node.m_Value = (oldval.Multiply(mod)).ToString().FromUTF8(); - break; - } - hasSetValue = true; - } + switch (op) + { + case ADD: + node.m_Value = (oldval + mod).ToString().FromUTF8(); + break; + case MUL: + node.m_Value = (oldval.Multiply(mod)).ToString().FromUTF8(); + break; + } + hasSetValue = true; + } if (!hasSetValue) node.m_Value = value; @@ -250,7 +250,7 @@ fixed CParamNode::ToFixed() const return fixed::FromString(CStrW(m_Value)); } -float CParamNode::ToFloat() const +float CParamNode::ToFloat() const { float ret = 0; std::wstringstream strm; diff --git a/source/soundmanager/SoundManager.cpp b/source/soundmanager/SoundManager.cpp index 99b125af26..405ef3e6dd 100644 --- a/source/soundmanager/SoundManager.cpp +++ b/source/soundmanager/SoundManager.cpp @@ -193,9 +193,9 @@ void ISoundManager::CreateSoundManager() void ISoundManager::SetEnabled(bool doEnable) { - if (g_SoundManager && !doEnable) + if (g_SoundManager && !doEnable) SAFE_DELETE(g_SoundManager); - else if (!g_SoundManager && doEnable) + else if (!g_SoundManager && doEnable) ISoundManager::CreateSoundManager(); } void ISoundManager::CloseGame() diff --git a/source/soundmanager/data/OggData.cpp b/source/soundmanager/data/OggData.cpp index 631497bf6d..45c6f16177 100644 --- a/source/soundmanager/data/OggData.cpp +++ b/source/soundmanager/data/OggData.cpp @@ -76,7 +76,7 @@ bool COggData::InitOggFile(const VfsPath& itemPath) alGenBuffers(buffersToStart, m_Buffer); ALenum err = alGetError(); - if (err != AL_NO_ERROR) + if (err != AL_NO_ERROR) { LOGERROR("Failed to create initial buffer. OpenAL error: %s\n", alGetString(err)); return false; diff --git a/source/soundmanager/data/SoundData.cpp b/source/soundmanager/data/SoundData.cpp index 938c8652e8..bc624290f0 100644 --- a/source/soundmanager/data/SoundData.cpp +++ b/source/soundmanager/data/SoundData.cpp @@ -70,7 +70,7 @@ CSoundData* CSoundData::SoundDataFromFile(const VfsPath& itemPath) if (fExt == ".ogg") answer = SoundDataFromOgg(itemPath); - if (answer && answer->IsOneShot()) + if (answer && answer->IsOneShot()) { CSoundData::sSoundData[itemPath.string()] = answer; } diff --git a/source/soundmanager/items/CSoundBase.cpp b/source/soundmanager/items/CSoundBase.cpp index f3b48e08f9..428072c58d 100644 --- a/source/soundmanager/items/CSoundBase.cpp +++ b/source/soundmanager/items/CSoundBase.cpp @@ -240,11 +240,11 @@ bool CSoundBase::HandleFade() else if (curGain == m_EndVolume) { if (m_ALSource != 0) - alSourcef(m_ALSource, AL_GAIN, curGain); + alSourcef(m_ALSource, AL_GAIN, curGain); ResetFade(); } else if (m_ALSource != 0) - alSourcef(m_ALSource, AL_GAIN, curGain); + alSourcef(m_ALSource, AL_GAIN, curGain); AL_CHECK; } diff --git a/source/soundmanager/scripting/JSInterface_Sound.cpp b/source/soundmanager/scripting/JSInterface_Sound.cpp index 7385eeefc6..a1e3f9d07f 100644 --- a/source/soundmanager/scripting/JSInterface_Sound.cpp +++ b/source/soundmanager/scripting/JSInterface_Sound.cpp @@ -51,7 +51,7 @@ namespace JSI_Sound } void AddPlaylistItem(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::wstring& filename) - { + { if ( CSoundManager* sndManager = (CSoundManager*)g_SoundManager ) sndManager->AddPlayListItem(VfsPath(filename)); } diff --git a/source/tools/atlas/AtlasUI/CustomControls/DraggableListCtrl/DraggableListCtrl.cpp b/source/tools/atlas/AtlasUI/CustomControls/DraggableListCtrl/DraggableListCtrl.cpp index cf2b912997..fc485585fb 100644 --- a/source/tools/atlas/AtlasUI/CustomControls/DraggableListCtrl/DraggableListCtrl.cpp +++ b/source/tools/atlas/AtlasUI/CustomControls/DraggableListCtrl/DraggableListCtrl.cpp @@ -156,7 +156,7 @@ BEGIN_EVENT_TABLE(DraggableListCtrl, EditableListCtrl) EVT_LIST_BEGIN_DRAG(wxID_ANY, DraggableListCtrl::OnBeginDrag) EVT_LIST_ITEM_SELECTED(wxID_ANY, DraggableListCtrl::OnItemSelected) EVT_MOTION(DraggableListCtrl::OnMouseEvent) - EVT_LEFT_UP(DraggableListCtrl::OnMouseEvent) + EVT_LEFT_UP(DraggableListCtrl::OnMouseEvent) EVT_CHAR(DraggableListCtrl::OnChar) EVT_MOUSE_CAPTURE_LOST(DraggableListCtrl::OnMouseCaptureLost) END_EVENT_TABLE() diff --git a/source/tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.cpp b/source/tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.cpp index f5eab4f7d8..ad63593537 100644 --- a/source/tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.cpp +++ b/source/tools/atlas/AtlasUI/CustomControls/MapDialog/MapDialog.cpp @@ -36,7 +36,7 @@ static const wxString scenarioPath(L"maps/scenarios/"); static const wxString skirmishPath(L"maps/skirmishes/"); MapDialog::MapDialog(wxWindow* parent, MapDialogType type, const wxIcon& icon) - : wxDialog(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(600,400), wxCAPTION|wxRESIZE_BORDER|wxCLOSE_BOX|wxSYSTEM_MENU), + : wxDialog(parent, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(600,400), wxCAPTION|wxRESIZE_BORDER|wxCLOSE_BOX|wxSYSTEM_MENU), m_Type(type), m_SelectedPage(0) { Freeze(); @@ -106,7 +106,7 @@ MapDialog::MapDialog(wxWindow* parent, MapDialogType type, const wxIcon& icon) wxSizer* buttonSizer = new wxBoxSizer(wxHORIZONTAL); if (m_Type == MAPDIALOG_OPEN) - buttonSizer->Add(new wxButton(this, wxID_OPEN, _("Open"))); + buttonSizer->Add(new wxButton(this, wxID_OPEN, _("Open"))); else // MAPDIALOG_SAVE buttonSizer->Add(new wxButton(this, wxID_SAVE, _("Save"))); buttonSizer->AddSpacer(5); diff --git a/source/tools/atlas/AtlasUI/CustomControls/VirtualDirTreeCtrl/virtualdirtreectrl.cpp b/source/tools/atlas/AtlasUI/CustomControls/VirtualDirTreeCtrl/virtualdirtreectrl.cpp index be6b519b84..7c316ba156 100644 --- a/source/tools/atlas/AtlasUI/CustomControls/VirtualDirTreeCtrl/virtualdirtreectrl.cpp +++ b/source/tools/atlas/AtlasUI/CustomControls/VirtualDirTreeCtrl/virtualdirtreectrl.cpp @@ -487,9 +487,9 @@ bool wxVirtualDirTreeCtrl::IsFileNode(const wxTreeItemId &id) /** Appends subdirs up until root. This is done by finding the root first and going back down to the original caller. This is faster because no copying takes place */ -void wxVirtualDirTreeCtrl::AppendPathRecursively(VdtcTreeItemBase *b, wxFileName &dir, bool useRoot) +void wxVirtualDirTreeCtrl::AppendPathRecursively(VdtcTreeItemBase *b, wxFileName &dir, bool useRoot) { - wxCHECK2(b, return); + wxCHECK2(b, return); VdtcTreeItemBase *parent = GetParent(b); if(parent) diff --git a/source/tools/atlas/AtlasUI/ScenarioEditor/Tools/TransformObject.cpp b/source/tools/atlas/AtlasUI/ScenarioEditor/Tools/TransformObject.cpp index 65a0a6a36a..ba2d5f19d9 100644 --- a/source/tools/atlas/AtlasUI/ScenarioEditor/Tools/TransformObject.cpp +++ b/source/tools/atlas/AtlasUI/ScenarioEditor/Tools/TransformObject.cpp @@ -123,7 +123,7 @@ public: POST_MESSAGE(SetSelectionPreview, (g_SelectedObjects)); // is the source code get here now you can add the objects to scene(preview) - // store id to move + // store id to move child = root->GetChildren(); while (child) @@ -532,7 +532,7 @@ public: } else if (evt.LeftDown()) { - //Place the object and update + //Place the object and update obj->OnPasteEnd(false); return true; } diff --git a/source/tools/atlas/GameInterface/GameLoop.cpp b/source/tools/atlas/GameInterface/GameLoop.cpp index 342f983248..2d39acf7f6 100644 --- a/source/tools/atlas/GameInterface/GameLoop.cpp +++ b/source/tools/atlas/GameInterface/GameLoop.cpp @@ -272,7 +272,7 @@ static void* RunEngine(void* data) return NULL; } -bool BeginAtlas(const CmdLineArgs& args, const DllLoader& dll) +bool BeginAtlas(const CmdLineArgs& args, const DllLoader& dll) { // Load required symbols from the DLL try diff --git a/source/tools/atlas/GameInterface/Handlers/CameraCtrlHandlers.cpp b/source/tools/atlas/GameInterface/Handlers/CameraCtrlHandlers.cpp index 22b6b9e633..2bde31129e 100644 --- a/source/tools/atlas/GameInterface/Handlers/CameraCtrlHandlers.cpp +++ b/source/tools/atlas/GameInterface/Handlers/CameraCtrlHandlers.cpp @@ -236,7 +236,7 @@ QUERYHANDLER(GetView) quatRot.Normalize(); CVector3D rotation = quatRot.ToEulerAngles(); - info.rX = RADTODEG(rotation.X); + info.rX = RADTODEG(rotation.X); info.rY = RADTODEG(rotation.Y); info.rZ = RADTODEG(rotation.Z); diff --git a/source/tools/atlas/GameInterface/Handlers/CinemaHandler.cpp b/source/tools/atlas/GameInterface/Handlers/CinemaHandler.cpp index ad237efb50..57bb3301f0 100644 --- a/source/tools/atlas/GameInterface/Handlers/CinemaHandler.cpp +++ b/source/tools/atlas/GameInterface/Handlers/CinemaHandler.cpp @@ -121,7 +121,7 @@ void SetCurrentPaths(const std::vector& atlasPaths) for ( size_t j=0; jGetRotation(); quatRot.Normalize(); CVector3D rotation = quatRot.ToEulerAngles(); - rotation.X = RADTODEG(rotation.X); + rotation.X = RADTODEG(rotation.X); rotation.Y = RADTODEG(rotation.Y); rotation.Z = RADTODEG(rotation.Z); CVector3D translation = cam->GetTranslation(); diff --git a/source/tools/atlas/GameInterface/Handlers/MiscHandlers.cpp b/source/tools/atlas/GameInterface/Handlers/MiscHandlers.cpp index 7ca7b9cd73..e9c485b046 100644 --- a/source/tools/atlas/GameInterface/Handlers/MiscHandlers.cpp +++ b/source/tools/atlas/GameInterface/Handlers/MiscHandlers.cpp @@ -123,7 +123,7 @@ QUERYHANDLER(Ping) { UNUSED2(msg); } - + MESSAGEHANDLER(SimStopMusic) { UNUSED2(msg); diff --git a/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp b/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp index f081fe7bfa..332b3de9c2 100644 --- a/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp +++ b/source/tools/atlas/GameInterface/Handlers/ObjectHandlers.cpp @@ -469,7 +469,7 @@ MESSAGEHANDLER(MoveObjectPreview) if (g_PreviewEntitiesID.size()==0) return; - //TODO:Change pivot + //TODO:Change pivot entity_id_t referenceEntity = *g_PreviewEntitiesID.begin(); // All selected objects move relative to a pivot object, diff --git a/source/tools/atlas/GameInterface/Handlers/TriggerHandler.cpp b/source/tools/atlas/GameInterface/Handlers/TriggerHandler.cpp index ef9a3e4941..5f7e048c7f 100644 --- a/source/tools/atlas/GameInterface/Handlers/TriggerHandler.cpp +++ b/source/tools/atlas/GameInterface/Handlers/TriggerHandler.cpp @@ -75,7 +75,7 @@ sTrigger TriggerToAtlas(const MapTrigger& trigger) atlasBlocks.push_back( (int)it->index ); atlasNots.push_back( it->negated ); } - for ( std::set::const_iterator it = trigger.logicBlockEnds.begin(); + for ( std::set::const_iterator it = trigger.logicBlockEnds.begin(); it != trigger.logicBlockEnds.end(); ++it ) { atlasBlockEnds.push_back( (int)*it ); @@ -98,7 +98,7 @@ sTrigger TriggerToAtlas(const MapTrigger& trigger) atlasCondition.negated = it->negated; std::vector parameters; - for ( std::list::const_iterator it2=it->parameters.begin(); + for ( std::list::const_iterator it2=it->parameters.begin(); it2 != it->parameters.end(); ++it2 ) { parameters.push_back( std::wstring(it2->c_str()) ); @@ -117,7 +117,7 @@ sTrigger TriggerToAtlas(const MapTrigger& trigger) atlasEffect.functionName = it->functionName; atlasEffect.displayName = it->displayName; - for ( std::list::const_iterator it2 = it->parameters.begin(); + for ( std::list::const_iterator it2 = it->parameters.begin(); it2 != it->parameters.end(); ++it2 ) { parameters.push_back( std::wstring(it2->c_str()) ); @@ -139,7 +139,7 @@ sTriggerGroup GroupToAtlas(const MapTriggerGroup& group) std::vector atlasTriggers; std::vector atlasChildren; - for ( std::list::const_iterator it = group.triggers.begin(); + for ( std::list::const_iterator it = group.triggers.begin(); it != group.triggers.end(); ++it ) { atlasTriggers.push_back( TriggerToAtlas(*it) ); @@ -221,7 +221,7 @@ MapTriggerGroup AtlasToGroup(const sTriggerGroup& group) std::vector atlasChildren = *group.children; std::vector atlasTriggers = *group.triggers; - for ( std::vector::const_iterator it = atlasTriggers.begin(); + for ( std::vector::const_iterator it = atlasTriggers.begin(); it != atlasTriggers.end(); ++it ) { engineTriggers.push_back( AtlasToTrigger(*it) ); @@ -303,10 +303,10 @@ QUERYHANDLER(GetTriggerChoices) { choices.clear(); const std::list& groups = g_TriggerManager.GetAllTriggerGroups(); - for ( std::list::const_iterator it = groups.begin(); + for ( std::list::const_iterator it = groups.begin(); it != groups.end(); ++it ) { - for ( std::list::const_iterator it2 = it->triggers.begin(); + for ( std::list::const_iterator it2 = it->triggers.begin(); it2 != it->triggers.end(); ++it2 ) { choices.push_back(it2->name); @@ -318,7 +318,7 @@ QUERYHANDLER(GetTriggerChoices) { choices.clear(); const std::list& groups = g_TriggerManager.GetAllTriggerGroups(); - for ( std::list::const_iterator it = groups.begin(); + for ( std::list::const_iterator it = groups.begin(); it != groups.end(); ++it ) { choices.push_back(it->name); diff --git a/source/tools/atlas/GameInterface/MessagePasserImpl.cpp b/source/tools/atlas/GameInterface/MessagePasserImpl.cpp index ff882d7e6e..1eb058b9cd 100644 --- a/source/tools/atlas/GameInterface/MessagePasserImpl.cpp +++ b/source/tools/atlas/GameInterface/MessagePasserImpl.cpp @@ -149,7 +149,7 @@ void MessagePasserImpl::Query(QueryMessage* qry, void(* UNUSED(timeoutCallback) // // loop to avoid deadlocking the system (particularly when the game // // tries to show a dialog box); so timeoutCallback is called whenever we // // think it's necessary for that to happen. -// +// // #if OS_WIN // // On Win32, use MsgWaitForMultipleObjects, which waits on the semaphore // // but is also interrupted by incoming Windows-messages. diff --git a/source/tools/profiler2/Profiler2Report.js b/source/tools/profiler2/Profiler2Report.js index e829189876..9f46ae2a10 100644 --- a/source/tools/profiler2/Profiler2Report.js +++ b/source/tools/profiler2/Profiler2Report.js @@ -1,15 +1,15 @@ // Copyright (c) 2016 Wildfire Games -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -69,7 +69,7 @@ function refresh_jsonp(callback, source) function refresh_from_jsonp(callback, content) { var script = document.createElement('script'); - + window.profileDataCB = function(data) { script.parentNode.removeChild(script); @@ -121,7 +121,7 @@ function refresh_thread(callback, thread, callback_data) success: function (data) { data.events = concat_events(data); thread.data = data; - + if (++callback_data.completed == callback_data.threads.length) { g_raw_data = { 'threads': callback_data.threads }; @@ -145,7 +145,7 @@ function compute_data(range) if (!processed_data.intervals.length && !processed_data.events.length) continue; - g_data.threads[thread] = processed_data; + g_data.threads[thread] = processed_data; g_data.threads[thread].intervals_by_type_frame = {}; @@ -215,7 +215,7 @@ function process_raw_data(data, range) break; } } - + var framesfound = 0; for (var i = end - 1; i > 0; --i) { @@ -226,7 +226,7 @@ function process_raw_data(data, range) break; } } - + tmin = data[start][1]; tmax = data[end][1]; } @@ -243,7 +243,7 @@ function process_raw_data(data, range) } } tmin = tmax - range.seconds; - + for (var i = end; i > 0; --i) { var type = data[i][0]; @@ -293,7 +293,7 @@ function process_raw_data(data, range) } var num_colours = 0; - + var events = []; // Read events for the entire data period (not just start..end) @@ -319,16 +319,16 @@ function process_raw_data(data, range) lastWasEvent = false; } } - - + + var intervals = []; var intervals_by_type = {}; - + // Read intervals from the focused data period (start..end) stack = []; var lastT = 0; var lastWasEvent = false; - + for (var i = start; i <= end; ++i) { if (data[i][0] == ITEM_EVENT) @@ -356,7 +356,7 @@ function process_raw_data(data, range) lastT = data[i][1]; lastWasEvent = false; - + if (!stack.length) continue; @@ -364,9 +364,9 @@ function process_raw_data(data, range) if (!g_used_colours[interval.id]) g_used_colours[interval.id] = new_colour(num_colours++); - + interval.colour = g_used_colours[interval.id]; - + interval.t1 = data[i][1]; interval.duration = interval.t1 - interval.t0; interval.depth = stack.length; diff --git a/source/tools/profiler2/ReportDraw.js b/source/tools/profiler2/ReportDraw.js index 2239edc032..ad41c316b3 100644 --- a/source/tools/profiler2/ReportDraw.js +++ b/source/tools/profiler2/ReportDraw.js @@ -1,15 +1,15 @@ // Copyright (c) 2016 Wildfire Games -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -38,17 +38,17 @@ function rebuild_canvases(raw_data) g_canvas.canvas_zoom = $('').get(0); g_canvas.text_output = $('
').get(0);
-    
+
     $('#timelines').empty();
-        $('#timelines').append("

Main thread frames

"); + $('#timelines').append("

Main thread frames

"); $('#timelines').append(g_canvas.canvas_frames); for (var thread = 0; thread < raw_data.threads.length; thread++) { - $('#timelines').append("

" + raw_data.threads[thread].name + "

"); + $('#timelines').append("

" + raw_data.threads[thread].name + "

"); $('#timelines').append($(g_canvas.threads[thread])); } - $('#timelines').append("

Zoomed frames

"); + $('#timelines').append("

Zoomed frames

"); $('#timelines').append(g_canvas.canvas_zoom); $('#timelines').append(g_canvas.text_output); } @@ -114,13 +114,13 @@ function display_frames(data, canvas, range) var tmin = data.tmin; var tmax = data.tmax; var dx = width / (tmax-tmin); - + canvas._zoomData = { 'x_to_t': x => tmin + (x - xpadding) / dx, 't_to_x': t => (t - tmin) * dx + xpadding }; - - // log 100 scale, skip < 15 ms (60fps) + + // log 100 scale, skip < 15 ms (60fps) var scale = x => 1 - Math.max(0, Math.log(1 + (x-15)/10) / Math.log(100)); ctx.strokeStyle = 'rgb(0, 0, 0)'; @@ -128,17 +128,17 @@ function display_frames(data, canvas, range) for (var i = 0; i < data.frames.length; ++i) { var frame = data.frames[i]; - + var duration = frame.t1 - frame.t0; var x0 = xpadding + dx*(frame.t0 - tmin); var x1 = x0 + dx*duration; var y1 = canvas.height; var y0 = y1 * scale(duration*1000); - + ctx.beginPath(); ctx.rect(x0, y0, x1-x0, y1-y0); ctx.stroke(); - + canvas._tooltips.push({ 'x0': x0, 'x1': x1, 'y0': y0, 'y1': y1, @@ -178,7 +178,7 @@ function display_frames(data, canvas, range) ctx.rect(xpadding + dx*(range.tmin - tmin), 0, dx*(range.tmax - range.tmin), canvas.height); ctx.fill(); ctx.stroke(); - + ctx.restore(); } outInterface.display_frames = display_frames; @@ -187,26 +187,26 @@ function display_events(data, canvas) { var ctx = canvas.getContext('2d'); ctx.save(); - + var x_to_time = canvas._zoomData.x_to_t; var time_to_x = canvas._zoomData.t_to_x; - + for (var i = 0; i < data.events.length; ++i) { var event = data.events[i]; - + if (event.id == '__framestart') continue; - + if (event.id == 'gui event' && event.attrs && event.attrs[0] == 'type: mousemove') continue; - + var x = time_to_x(event.t); var y = 32; if (x < 2) continue; - + var x0 = x; var x1 = x; var y0 = y-4; @@ -232,7 +232,7 @@ function display_events(data, canvas) }} (event) }); } - + ctx.restore(); } outInterface.display_events = display_events; @@ -251,7 +251,7 @@ function display_hierarchy(main_data, data, canvas, range, zoom) var padding_top = 40; var width = canvas.width - xpadding*2; var height = canvas.height - padding_top - 4; - + var tmin, tmax, start, end; if (range.tmin) @@ -266,12 +266,12 @@ function display_hierarchy(main_data, data, canvas, range, zoom) } canvas._hierarchyData = { 'range': range, 'tmin': tmin, 'tmax': tmax }; - + function time_to_x(t) { return xpadding + (t - tmin) / (tmax - tmin) * width; } - + function x_to_time(x) { return tmin + (x - xpadding) * (tmax - tmin) / width; @@ -304,23 +304,23 @@ function display_hierarchy(main_data, data, canvas, range, zoom) ctx.restore(); var BAR_SPACING = 16; - + for (var i = 0; i < data.intervals.length; ++i) { var interval = data.intervals[i]; - + if (interval.tmax <= tmin || interval.tmin > tmax) continue; var x0 = Math.floor(time_to_x(interval.t0)); var x1 = Math.floor(time_to_x(interval.t1)); - + if (x1-x0 < 1) continue; - + var y0 = padding_top + interval.depth * BAR_SPACING; var y1 = y0 + BAR_SPACING; - + var label = interval.id; if (interval.attrs) { @@ -338,7 +338,7 @@ function display_hierarchy(main_data, data, canvas, range, zoom) ctx.stroke(); ctx.fillStyle = 'black'; ctx.fillText(label, x0+2, y0+BAR_SPACING-4, Math.max(1, x1-x0-4)); - + canvas._tooltips.push({ 'x0': x0, 'x1': x1, 'y0': y0, 'y1': y1, @@ -365,7 +365,7 @@ function display_hierarchy(main_data, data, canvas, range, zoom) continue; var x = Math.floor(time_to_x(frame.t0)); - + ctx.save(); ctx.lineWidth = 3; ctx.strokeStyle = 'rgba(0, 0, 255, 0.5)'; @@ -392,7 +392,7 @@ function display_hierarchy(main_data, data, canvas, range, zoom) ctx.fill(); ctx.stroke(); } - + ctx.restore(); } outInterface.display_hierarchy = display_hierarchy; @@ -405,7 +405,7 @@ function set_frames_zoom_handlers(report, canvas0) var relativeX = event.pageX - this.offsetLeft; var relativeY = event.pageY - this.offsetTop; - + var width = relativeY / canvas0.height; width = width*width; width *= zdata.x_to_t(canvas0.width)/10; @@ -433,18 +433,18 @@ function set_frames_zoom_handlers(report, canvas0) do_zoom.call(this, report, event); }); } - + function set_zoom_handlers(main_data, data, canvas0, canvas1) { function do_zoom(event) { var hdata = canvas0._hierarchyData; - + function x_to_time(x) { return hdata.tmin + x * (hdata.tmax - hdata.tmin) / canvas0.width; } - + var relativeX = event.pageX - this.offsetLeft; var relativeY = (event.pageY + this.offsetTop) / canvas0.height; relativeY = relativeY - 0.5; diff --git a/source/tools/profiler2/profiler2.js b/source/tools/profiler2/profiler2.js index 3fc473e4c1..6b264d7040 100644 --- a/source/tools/profiler2/profiler2.js +++ b/source/tools/profiler2/profiler2.js @@ -1,15 +1,15 @@ // Copyright (c) 2016 Wildfire Games -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -45,7 +45,7 @@ function save_as_file() function get_history_data(report, thread, type) { var ret = {"time_by_frame":[], "max" : 0, "log_scale" : null}; - + var report_data = g_reports[report].data().threads[thread]; var interval_data = report_data.intervals; @@ -275,7 +275,7 @@ function draw_history_graph() y = Math.log10(1 + smoothed_time/y_scale * 9); if (item_nb === 1) - { + { context.beginPath(); context.fillStyle = colour; context.fillRect(i/x_scale,canvas.height,1/x_scale,-y*canvas.height); @@ -399,7 +399,7 @@ function recompute_choices(report, thread) for (let i = 0; i < data.intervals.length; i++) types[data.intervals[i].id] = 0; - + var sorted_keys = Object.keys(types).sort(); for (let key in sorted_keys) @@ -433,7 +433,7 @@ function update_analysis() draw_history_graph(); draw_frequency_graph(); } - + function load_report_from_file(evt) { var file = evt.target.files[0]; @@ -499,5 +499,5 @@ window.onload = function() load_report(true, {"name":"live"}); // add new reports - document.getElementById('report_load_input').addEventListener('change', load_report_from_file, false); -} \ No newline at end of file + document.getElementById('report_load_input').addEventListener('change', load_report_from_file, false); +} diff --git a/source/tools/profiler2/utilities.js b/source/tools/profiler2/utilities.js index 12fb0185eb..74906e3415 100644 --- a/source/tools/profiler2/utilities.js +++ b/source/tools/profiler2/utilities.js @@ -1,15 +1,15 @@ // Copyright (c) 2016 Wildfire Games -// +// // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: -// +// // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. -// +// // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -77,7 +77,7 @@ function concat_events(data) function time_label(t, precision = 2) { if (t < 0) - return "-" + time_label(-t, precision); + return "-" + time_label(-t, precision); if (t > 1e-3) return (t * 1e3).toFixed(precision) + 'ms'; else @@ -152,7 +152,7 @@ function set_tooltip_handlers(canvas) var tooltips = canvas._tooltips; if (!tooltips) return; - + var relativeX = event.pageX - this.getBoundingClientRect().left - window.scrollX; var relativeY = event.pageY - this.getBoundingClientRect().top - window.scrollY;