forked from mirrors/0ad
Fix eslint rule 'spaced-comment'
Manual fixes needed for: eslint --no-config-lookup --rule '"spaced-comment": ["warn", "always"]' Ref: #7812 Signed-off-by: Ralph Sennhauser <ralph.sennhauser@gmail.com>
This commit is contained in:
@@ -344,11 +344,11 @@ global.RunHardwareDetection = function(settings)
|
||||
if (settings.renderer_backend.name != 'gl' && settings.renderer_backend.name != 'glarb')
|
||||
return;
|
||||
|
||||
//print(JSON.stringify(settings, null, 1)+"\n");
|
||||
// print(JSON.stringify(settings, null, 1)+"\n");
|
||||
|
||||
var output = RunDetection(settings);
|
||||
|
||||
//print(JSON.stringify(output, null, 1)+"\n");
|
||||
// print(JSON.stringify(output, null, 1)+"\n");
|
||||
|
||||
for (var i = 0; i < output.warnings.length; ++i)
|
||||
warn(output.warnings[i]);
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Vector2D
|
||||
//
|
||||
// Class for representing and manipulating 2D vectors
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
// TODO: Type errors if v not instanceof Vector classes
|
||||
// TODO: Possibly implement in C++
|
||||
|
||||
/**
|
||||
* @class Vector2D
|
||||
* @brief Class for representing and manipulating 2D vectors
|
||||
*
|
||||
* @param {number} x First coordinate value, defaults to 0.
|
||||
* @param {number} y Second coordinate value, defaults to 0.
|
||||
*/
|
||||
function Vector2D(x = 0, y = 0)
|
||||
{
|
||||
this.set(x, y);
|
||||
@@ -252,13 +252,14 @@ Vector2D.dot = function(v1, v2)
|
||||
return v1.x * v2.x + v1.y * v2.y;
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Vector3D
|
||||
//
|
||||
// Class for representing and manipulating 3D vectors
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* @class Vector3D
|
||||
* @brief Class for representing and manipulating 3D vectors
|
||||
*
|
||||
* @param {number} x First coordinate value, defaults to 0.
|
||||
* @param {number} y Second coordinate value, defaults to 0.
|
||||
* @param {number} z Third coordinate value, defaults to 0.
|
||||
*/
|
||||
function Vector3D(x = 0, y = 0, z = 0)
|
||||
{
|
||||
this.set(x, y, z);
|
||||
|
||||
@@ -510,8 +510,9 @@ function getPlayerIDs()
|
||||
return Array.from(Array(getNumPlayers()), (_, index) => index + 1);
|
||||
}
|
||||
|
||||
/*** Sorts an array of player IDs by team index. Players without teams come first.
|
||||
* Randomize order for players of the same team.
|
||||
/**
|
||||
* Sorts an array of player IDs by team index.
|
||||
* Players without teams come first. Randomize order for players of the same team.
|
||||
*/
|
||||
function sortPlayers(playerIDs)
|
||||
{
|
||||
|
||||
@@ -14,13 +14,13 @@ function modPos(num, m)
|
||||
return p;
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Noise2D
|
||||
//
|
||||
// Class representing 2D noise with a given base frequency
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* @class Noise2D
|
||||
* @brief Class representing 2D noise with a given base frequency
|
||||
*
|
||||
* @param {number} freq - The base frequency (grid resolution) of the noise.
|
||||
* Determines the number of gradient vectors along each axis.
|
||||
*/
|
||||
function Noise2D(freq)
|
||||
{
|
||||
freq = Math.floor(freq);
|
||||
@@ -64,13 +64,14 @@ Noise2D.prototype.get = function(x, y)
|
||||
return (a + ey*(b-a)) * 0.5 + 0.5;
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
// Noise3D
|
||||
//
|
||||
// Class representing 3D noise with given base frequencies
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* @class Noise3D
|
||||
* @brief Class representing 3D noise with given base frequencies
|
||||
*
|
||||
* @param {number} freq - The base frequency (grid resolution) of the noise.
|
||||
* Determines the number of gradient vectors along the first to axis.
|
||||
* @param {number} vfreq - The base frequency for the third dimension.
|
||||
*/
|
||||
function Noise3D(freq, vfreq)
|
||||
{
|
||||
freq = Math.floor(freq);
|
||||
|
||||
@@ -42,9 +42,9 @@ var g_Camera = {
|
||||
"Declination": 0.523599
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Sun, Sky and Terrain
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
function setSkySet(set)
|
||||
{
|
||||
@@ -71,9 +71,9 @@ function setAmbientColor(r, g, b)
|
||||
g_Environment.AmbientColor = { "r": r, "g": g, "b": b, "a": 0 };
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Water
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
function setWaterColor(r, g, b)
|
||||
{
|
||||
@@ -110,9 +110,9 @@ function setWindAngle(m)
|
||||
g_Environment.Water.WaterBody.WindAngle = m;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Fog (numerical arguments between 0 and 1)
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
function setFogFactor(s)
|
||||
{
|
||||
@@ -129,9 +129,9 @@ function setFogColor(r, g, b)
|
||||
g_Environment.Fog.FogColor = { "r": r, "g": g, "b": b, "a": 0 };
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Post Processing (numerical arguments between 0 and 1)
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
|
||||
function setPPBrightness(s)
|
||||
{
|
||||
|
||||
@@ -270,7 +270,7 @@ function createObjectGroup(group, player, constraints)
|
||||
/**
|
||||
* Create an avoid constraint for the given classes by the given distances
|
||||
*/
|
||||
function avoidClasses(/*class1, dist1, class2, dist2, etc*/)
|
||||
function avoidClasses(/* class1, dist1, class2, dist2, etc */)
|
||||
{
|
||||
const ar = [];
|
||||
for (let i = 0; i < arguments.length/2; ++i)
|
||||
@@ -286,7 +286,7 @@ function avoidClasses(/*class1, dist1, class2, dist2, etc*/)
|
||||
/**
|
||||
* Create a stay constraint for the given classes by the given distances
|
||||
*/
|
||||
function stayClasses(/*class1, dist1, class2, dist2, etc*/)
|
||||
function stayClasses(/* class1, dist1, class2, dist2, etc */)
|
||||
{
|
||||
const ar = [];
|
||||
for (let i = 0; i < arguments.length/2; ++i)
|
||||
@@ -302,7 +302,7 @@ function stayClasses(/*class1, dist1, class2, dist2, etc*/)
|
||||
/**
|
||||
* Create a border constraint for the given classes by the given distances
|
||||
*/
|
||||
function borderClasses(/*class1, idist1, odist1, class2, idist2, odist2, etc*/)
|
||||
function borderClasses(/* class1, idist1, odist1, class2, idist2, odist2, etc */)
|
||||
{
|
||||
const ar = [];
|
||||
for (let i = 0; i < arguments.length/3; ++i)
|
||||
|
||||
@@ -43,9 +43,9 @@ ClumpPlacer.prototype.place = function(constraint)
|
||||
if (ctrlPts > radius * 2 * Math.PI)
|
||||
ctrlPts = Math.floor(radius * 2 * Math.PI) + 1;
|
||||
|
||||
const noise = new Float32Array(intPerim); //float32
|
||||
const ctrlCoords = new Float32Array(ctrlPts+1); //float32
|
||||
const ctrlVals = new Float32Array(ctrlPts+1); //float32
|
||||
const noise = new Float32Array(intPerim); // float32
|
||||
const ctrlCoords = new Float32Array(ctrlPts+1); // float32
|
||||
const ctrlVals = new Float32Array(ctrlPts+1); // float32
|
||||
|
||||
// Generate some interpolated noise
|
||||
for (let i=0; i < ctrlPts; i++)
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
warn("loading the triggers file");
|
||||
|
||||
///////////////////////
|
||||
// Trigger listeners //
|
||||
///////////////////////
|
||||
//
|
||||
// Trigger listeners
|
||||
//
|
||||
|
||||
// every function just logs when it gets fired, and shows the data
|
||||
Trigger.prototype.StructureBuiltAction = function(data)
|
||||
|
||||
@@ -371,7 +371,6 @@ Trigger.prototype.Setup = function()
|
||||
{
|
||||
const start = Engine.QueryInterface(SYSTEM_ENTITY, IID_Timer).GetTime();
|
||||
|
||||
// /*
|
||||
let gx = 100;
|
||||
let gy = 100;
|
||||
for (const key in experiments)
|
||||
@@ -384,8 +383,7 @@ Trigger.prototype.Setup = function()
|
||||
gy += 150;
|
||||
}
|
||||
}
|
||||
/**/
|
||||
//perf_experiments.LotsaLocalCollisions.spawn();
|
||||
// perf_experiments.LotsaLocalCollisions.spawn();
|
||||
/*
|
||||
let time = 0;
|
||||
for (let key in perf_experiments)
|
||||
|
||||
@@ -1341,7 +1341,7 @@ function TryConstructWall(player, cmpPlayer, controlAllUnits, cmd)
|
||||
}
|
||||
|
||||
lastTowerControlGroup = cmpSnappedStartObstruction.GetControlGroup();
|
||||
//warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|
||||
// warn("setting lastTowerControlGroup to control group of start snapped entity " + cmd.startSnappedEntity + ": " + lastTowerControlGroup);
|
||||
}
|
||||
|
||||
var i = 0;
|
||||
@@ -1405,7 +1405,7 @@ function TryConstructWall(player, cmpPlayer, controlAllUnits, cmd)
|
||||
|
||||
if (i > 0)
|
||||
{
|
||||
//warn(" updating previous wall piece's secondary control group to " + newTowerControlGroup);
|
||||
// warn(" updating previous wall piece's secondary control group to " + newTowerControlGroup);
|
||||
var cmpPreviousObstruction = Engine.QueryInterface(pieces[i-1].ent, IID_Obstruction);
|
||||
// TODO: ensure that cmpPreviousObstruction exists
|
||||
// TODO: ensure that the previous obstruction does not yet have a secondary control group set
|
||||
|
||||
@@ -191,7 +191,7 @@ function GetWallSegmentsRec(d, candidateSegments, minOverlap, maxOverlap, t, dis
|
||||
if (r < rLowerBound)
|
||||
{
|
||||
// we've allocated too much wall length, pop the last segment and try the next
|
||||
//warn("Distance so far exceeds target, trying next level");
|
||||
// warn("Distance so far exceeds target, trying next level");
|
||||
segments.pop();
|
||||
continue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user