Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/bleed' into bleed
Browse files Browse the repository at this point in the history
  • Loading branch information
Porenutak committed Jun 17, 2024
2 parents a9f1ab2 + ccb1bd7 commit 5b444eb
Show file tree
Hide file tree
Showing 53 changed files with 340 additions and 245 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
; Top-most http://editorconfig.org/ file
; Top-most https://editorconfig.org/ file
root = true
charset=utf-8

Expand Down
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
patreon: orahosting
2 changes: 1 addition & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ Using Linguini by the Space Station 14 team
licensed under Apache and MIT terms.

This site or product includes IP2Location LITE data
available from http://www.ip2location.com.
available from https://www.ip2location.com.

Finally, special thanks goes to the original teams
at Westwood Studios and EA for creating the classic
Expand Down
6 changes: 3 additions & 3 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ members of the project's leadership.
## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
available at [https://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
[homepage]: https://contributor-covenant.org
[version]: https://contributor-covenant.org/version/1/4/
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Help us keep OpenRA open and inclusive. Please read and follow our [Code of Cond

* [Coding standard](https://github.com/OpenRA/OpenRA/wiki/Coding-Standard)
* [Branches and Releases](https://github.com/OpenRA/OpenRA/wiki/Branches-and-Releases)
* [Licensing](http://www.gnu.org/licenses/quick-guide-gplv3.html)
* [Licensing](https://www.gnu.org/licenses/quick-guide-gplv3.html)

Please `git rebase` to the latest revision of the bleed branch.

Expand Down
8 changes: 4 additions & 4 deletions COPYING
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007

Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.

Expand Down Expand Up @@ -645,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
along with this program. If not, see <https://www.gnu.org/licenses/>.

Also add information on how to contact you by electronic and paper mail.

Expand All @@ -664,11 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
<https://www.gnu.org/licenses/>.

The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
<https://www.gnu.org/philosophy/why-not-lgpl.html>.
4 changes: 2 additions & 2 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Windows
=======

Compiling OpenRA requires the following dependencies:
* [Windows PowerShell >= 4.0](http://microsoft.com/powershell) (included by default in recent Windows 10 versions)
* [Windows PowerShell >= 4.0](https://microsoft.com/powershell) (included by default in recent Windows 10 versions)
* [.NET 6 SDK](https://dotnet.microsoft.com/download/dotnet/6.0) (or via Visual Studio)

To compile OpenRA, open the `OpenRA.sln` solution in the main folder, build it from the command-line with `dotnet` or use the Makefile analogue command `make all` scripted in PowerShell syntax.
Expand All @@ -25,7 +25,7 @@ To compile OpenRA, run `make` from the command line (or `make RUNTIME=mono` if u

The default behaviour on the x86_64 architecture is to download several pre-compiled native libraries using the Nuget packaging manager. If you prefer to use system libraries, compile instead using `make TARGETPLATFORM=unix-generic`.

If you choose to use system libraries, or your system is not x86_64, you will need to install [SDL 2](https://www.libsdl.org/download-2.0.php), [FreeType](http://gnuwin32.sourceforge.net/packages/freetype.htm), [OpenAL](https://openal-soft.org/), and [liblua 5.1](http://luabinaries.sourceforge.net/download.html) before compiling OpenRA.
If you choose to use system libraries, or your system is not x86_64, you will need to install [SDL 2](https://www.libsdl.org/download-2.0.php), [FreeType](https://gnuwin32.sourceforge.net/packages/freetype.htm), [OpenAL](https://openal-soft.org/), and [liblua 5.1](https://luabinaries.sourceforge.net/download.html) before compiling OpenRA.

These can be installed using your package manager on various distros:

Expand Down
5 changes: 5 additions & 0 deletions OpenRA.Game/Map/CellCoordsRegion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,11 @@ public CellCoordsRegion(CPos topLeft, CPos bottomRight)
BottomRight = bottomRight;
}

public bool Contains(CPos cell)
{
return cell.X >= TopLeft.X && cell.X <= BottomRight.X && cell.Y >= TopLeft.Y && cell.Y <= BottomRight.Y;
}

public override string ToString()
{
return $"{TopLeft}->{BottomRight}";
Expand Down
4 changes: 2 additions & 2 deletions OpenRA.Game/Primitives/Color.cs
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ public static Color FromArgb(uint argb)

static float SrgbToLinear(float c)
{
// Standard gamma conversion equation: see e.g. http://entropymine.com/imageworsener/srgbformula/
// Standard gamma conversion equation: see e.g. https://entropymine.com/imageworsener/srgbformula/
return c <= 0.04045f ? c / 12.92f : (float)Math.Pow((c + 0.055f) / 1.055f, 2.4f);
}

static float LinearToSrgb(float c)
{
// Standard gamma conversion equation: see e.g. http://entropymine.com/imageworsener/srgbformula/
// Standard gamma conversion equation: see e.g. https://entropymine.com/imageworsener/srgbformula/
return c <= 0.0031308f ? c * 12.92f : 1.055f * (float)Math.Pow(c, 1.0f / 2.4f) - 0.055f;
}

Expand Down
4 changes: 2 additions & 2 deletions OpenRA.Mods.Cnc/FileFormats/LZOCompression.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#region Additional Copyright & License Information
/*
* C# port of the crude minilzo source version 2.06 by Frank Razenberg
* The full LZO package can be found at http://www.oberhumer.com/opensource/lzo/
* The full LZO package can be found at https://www.oberhumer.com/opensource/lzo/
*
* Beware, you should never want to see C# code like this. You were warned.
* I simply ran the MSVC preprocessor on the original source, changed the datatypes
Expand Down Expand Up @@ -61,7 +61,7 @@
*
* Markus F.X.J. Oberhumer
* <[email protected]>
* http://www.oberhumer.com/opensource/lzo/
* https://www.oberhumer.com/opensource/lzo/
*/
#endregion

Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Cnc/Traits/World/TSEditorResourceLayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ bool IsValidVeinNeighbour(CPos cell, CPos neighbour)
return false;

// Cell is automatically valid if it contains a veinhole actor
if (actorLayer.PreviewsAt(neighbour).Any(a => info.VeinholeActors.Contains(a.Info.Name)))
if (actorLayer.PreviewsAtCell(neighbour).Any(a => info.VeinholeActors.Contains(a.Info.Name)))
return true;

// Neighbour must be flat or a cardinal slope, unless the resource cell itself is a slope
Expand Down
6 changes: 3 additions & 3 deletions OpenRA.Mods.Cnc/Traits/World/TSVeinsRenderer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -370,10 +370,10 @@ string IResourceRenderer.GetRenderedResourceType(CPos cell)

string IResourceRenderer.GetRenderedResourceTooltip(CPos cell)
{
if (renderIndices[cell] != null)
return info.Name;
if (renderIndices[cell] != null || borders[cell] != Adjacency.None)
return TranslationProvider.GetString(info.Name);

return borders[cell] != Adjacency.None ? info.Name : null;
return null;
}

IEnumerable<IRenderable> IResourceRenderer.RenderUIPreview(WorldRenderer wr, string resourceType, int2 origin, float scale)
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Cnc/Traits/World/VoxelNormalsPalette.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void LoadPalettes(WorldRenderer wr)
wr.AddPalette(info.Name, new ImmutablePalette(data));
}

// Normal vector tables from http://www.sleipnirstuff.com/forum/viewtopic.php?t=8048
// Normal vector tables from https://web.archive.org/web/20041022134721/https://www.sleipnirstuff.com/forum/viewtopic.php?t=8048
static readonly float[] TSNormals =
{
0.671214f, 0.198492f, -0.714194f,
Expand Down
10 changes: 7 additions & 3 deletions OpenRA.Mods.Common/Activities/Air/FlyAttack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,14 @@ public override bool Tick(Actor self)
if (useLastVisibleTarget && !lastVisibleTarget.IsValidFor(self))
return true;

// If all valid weapons have depleted their ammo and Rearmable trait exists, return to RearmActor to reload
// and resume the activity after reloading if AbortOnResupply is set to 'false'
if (rearmable != null && !useLastVisibleTarget && attackAircraft.Armaments.All(x => x.IsTraitPaused || !x.Weapon.IsValidAgainst(target, self.World, self)))
// If all weapons are invalid against the target
if (!useLastVisibleTarget && attackAircraft.Armaments.All(x => x.IsTraitPaused || !x.Weapon.IsValidAgainst(target, self.World, self)))
{
// If Rearmable trait exists, return to RearmActor to reload and resume the activity after
// reloading if AbortOnResupply is set to 'false'.
if (rearmable == null)
return true;

// Attack moves never resupply
if (source == AttackSource.AttackMove)
return true;
Expand Down
28 changes: 17 additions & 11 deletions OpenRA.Mods.Common/EditorBrushes/EditorCopyPasteBrush.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ EditorClipboard CopySelectionContents()
tiles.Add(cell, new ClipboardTile(mapTiles[cell], mapResources[cell], resourceLayerContents, mapHeight[cell]));

if (copyFilters.HasFlag(MapCopyFilters.Actors))
foreach (var preview in selection.SelectMany(editorActorLayer.PreviewsAt).Distinct())
foreach (var preview in editorActorLayer.PreviewsInCellRegion(selection.CellCoords))
previews.TryAdd(preview.ID, preview);
}

Expand All @@ -182,6 +182,15 @@ public void Do()
var sourcePos = clipboard.CellRegion.TopLeft;
var pasteVec = new CVec(pastePosition.X - sourcePos.X, pastePosition.Y - sourcePos.Y);

if (copyFilters.HasFlag(MapCopyFilters.Actors))
{
// Clear any existing actors in the paste cells.
var selectionSize = clipboard.CellRegion.BottomRight - clipboard.CellRegion.TopLeft;
var pasteRegion = new CellRegion(map.Grid.Type, pastePosition, pastePosition + selectionSize);
foreach (var regionActor in editorActorLayer.PreviewsInCellRegion(pasteRegion.CellCoords).ToList())
editorActorLayer.Remove(regionActor);
}

foreach (var tileKeyValuePair in clipboard.Tiles)
{
var position = tileKeyValuePair.Key + pasteVec;
Expand Down Expand Up @@ -209,12 +218,6 @@ public void Do()

if (copyFilters.HasFlag(MapCopyFilters.Actors))
{
// Clear any existing actors in the paste cells.
var selectionSize = clipboard.CellRegion.BottomRight - clipboard.CellRegion.TopLeft;
var pasteRegion = new CellRegion(map.Grid.Type, pastePosition, pastePosition + selectionSize);
foreach (var regionActor in pasteRegion.SelectMany(editorActorLayer.PreviewsAt).ToHashSet())
editorActorLayer.Remove(regionActor);

// Now place actors.
foreach (var actorKeyValuePair in clipboard.Actors)
{
Expand All @@ -238,6 +241,13 @@ public void Do()

public void Undo()
{
if (copyFilters.HasFlag(MapCopyFilters.Actors))
{
// Clear existing actors.
foreach (var regionActor in editorActorLayer.PreviewsInCellRegion(undoClipboard.CellRegion.CellCoords).ToList())
editorActorLayer.Remove(regionActor);
}

foreach (var tileKeyValuePair in undoClipboard.Tiles)
{
var position = tileKeyValuePair.Key;
Expand All @@ -262,10 +272,6 @@ public void Undo()

if (copyFilters.HasFlag(MapCopyFilters.Actors))
{
// Clear existing actors.
foreach (var regionActor in undoClipboard.CellRegion.SelectMany(editorActorLayer.PreviewsAt).Distinct().ToList())
editorActorLayer.Remove(regionActor);

// Place actors back again.
foreach (var actor in undoClipboard.Actors.Values)
editorActorLayer.Add(actor);
Expand Down
2 changes: 1 addition & 1 deletion OpenRA.Mods.Common/EditorBrushes/EditorDefaultBrush.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public bool HandleMouseInput(MouseInput mi)
worldPixel = worldRenderer.Viewport.ViewToWorldPx(mi.Location);
var cell = worldRenderer.Viewport.ViewToWorld(mi.Location);

var underCursor = editorLayer.PreviewsAt(worldPixel).MinByOrDefault(CalculateActorSelectionPriority);
var underCursor = editorLayer.PreviewsAtWorldPixel(worldPixel).MinByOrDefault(CalculateActorSelectionPriority);
var resourceUnderCursor = resourceLayer?.GetResource(cell).Type;

if (underCursor != null)
Expand Down
4 changes: 2 additions & 2 deletions OpenRA.Mods.Common/Pathfinder/PathSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public static PathSearch ToTargetCellOverGraph(

/// <summary>
/// Default: Diagonal distance heuristic. More information:
/// http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html
/// https://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html
/// Layers are ignored and incur no additional cost.
/// </summary>
/// <param name="locomotor">Locomotor used to provide terrain costs.</param>
Expand All @@ -137,7 +137,7 @@ public static Func<CPos, bool, int> DefaultCostEstimator(Locomotor locomotor, CP

/// <summary>
/// Default: Diagonal distance heuristic. More information:
/// http://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html
/// https://theory.stanford.edu/~amitp/GameProgramming/Heuristics.html
/// Layers are ignored and incur no additional cost.
/// </summary>
/// <param name="locomotor">Locomotor used to provide terrain costs.</param>
Expand Down
4 changes: 3 additions & 1 deletion OpenRA.Mods.Common/Traits/AutoTarget.cs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,9 @@ public Target ScanForTarget(Actor self, bool allowMove, bool allowTurn, bool ign
if (attackStances != PlayerRelationship.None)
{
var range = Info.ScanRadius > 0 ? WDist.FromCells(Info.ScanRadius) : ab.GetMaximumRange();
return ChooseTarget(self, ab, attackStances, range, allowMove, allowTurn);
var target = ChooseTarget(self, ab, attackStances, range, allowMove, allowTurn);
if (target.Type != TargetType.Invalid)
return target;
}
}
}
Expand Down
Loading

0 comments on commit 5b444eb

Please sign in to comment.