Commit Graph

183 Commits

Author SHA1 Message Date
Paul Chote
84e85d8a5d Rename Image -> Images. 2015-03-30 20:20:36 +01:00
Paul Chote
4be5334a0e Add support for TS-style random tile variants. 2015-03-30 19:44:53 +01:00
Paul Chote
a2b423e4f9 Add a(nother) workaround for the legacy editor. 2015-03-26 22:41:46 +00:00
RoosterDragon
1515ac54f6 Enforce a line length limit. 2015-03-19 17:20:34 +00:00
Paul Chote
00a2146299 Adjust GetImage plumbing in preparation for race-specific sequences. 2015-03-02 20:46:24 +00:00
RoosterDragon
82bea961ba Checked LINQ queries and collections for inefficiencies.
- Made Array.IndexOf available via extension method.
- Made ToHashSet extension method.
- Change collections queried often via Contains into sets.
- Avoid Count() extension if Count or Length property exist.
- Made Count() > 0 checks and variations calls to Any() instead.
- Don't call ToList/ToArray if there is no benefit to materializing the sequence.
- If the sequence does benefit from materialization, follow this general pattern:
  - Collection queried often via Contains use ToHashSet to speed up lookups.
  - Short lived variables use ToList. This is because ToArray requires an extra copy to output the final size.
  - Collections persisted into fields or for a long time use ToArray to minimize memory overhead.
2015-01-29 19:20:11 +00:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +01:00
Matthias Mailänder
bc3acfeee7 StyleCop clean OpenRA.Game 2015-01-04 15:38:54 +01:00
Hellhake
beefe18ca5 Fix StyleCop warnings in OpenRA.Editor 2015-01-02 16:07:52 +01:00
Paul Chote
2ed594fd86 Introduce map Visibility field.
This replaces the Selectable, UseAsShellmap, and special-cased Type = "Mission" fields.
2014-12-23 09:08:00 +13:00
RoosterDragon
b28d999131 Made SheetBuilder rely on global settings rather than global renderer.
Additionally exposed an InitializeSettings method on game to initialize the global settings so that other classes can set up all the secret dependencies on the global settings required.
2014-12-22 17:39:19 +00:00
Chris Forbes
f61b52ccae editor: Fix a benign loop-variable-inside-closure issue
The getter is accessed exactly once, at call time.
The setter is stored, and invoked later on losing focus, but we pass a
bogus one anyway, so there is no issue.
2014-10-07 18:12:41 +13:00
Paul Chote
6b1cecc6b4 Add a workaround for the legacy map editor. 2014-07-23 11:40:30 +12:00
RoosterDragon
7030d8b2b6 Changed HardwarePalette.ApplyModifiers to be more efficient.
- Add separate ImmutablePalette and MutablePalette classes since the distinction is extremely important to HardwarePalette.
- Keep a cache of palettes in HardwarePalette to avoid reallocation them every time ApplyModifiers is called.
- Palettes that are not allowed to be modified are copied to the buffer once when added, rather than every time ApplyModifiers is called.
- The AdjustPalette method now takes a read-only dictionary to prevent the dictionary being messed with.
- Added a constant for the palette size to remove its usage as a magic number in several areas.
- The ColorPreviewManagerWidget is annoying in that it needs to actually permanently update a palette after it has been added. To allow this, HardwarePalette now allows a palette to be replaced after initialization. The WorldRenderer therefore now also updates the PaletteReference it created earlier with the new palette to prevent stale data being used elsewhere.
2014-06-28 01:11:48 +01:00
Paul Chote
5560f276ca Map: Rename IsInMap -> Contains. 2014-06-27 22:07:03 +12:00
Paul Chote
ad730a44c3 Use CellLayer for resources. 2014-06-27 22:07:02 +12:00
ScottNZ
90894aa03e Use var everywhere 2014-06-15 22:17:34 +12:00
RoosterDragon
2e992a7310 Changed MiniYaml.NodesDict property into a method.
Method is now called ToDictionary.
- Cached a few invocations into locals which should prevent some redundant evaluation.
- Added ToDictionary overloads that take projection functions for the keys and elements, since several callsites were doing a subsequent Linq.ToDictionary call to get this.
2014-06-09 17:06:42 +01:00
Paul Chote
d8e5177a36 Merge pull request #5405 from RoosterDragon/min-max
Added MinBy, MaxBy, etc.
2014-06-09 17:42:01 +12:00
Matthias Mailänder
5b86a8a6a8 open-ra.org → openra.net
closes #5500
2014-05-31 17:14:33 +02:00
RoosterDragon
b733465f33 General uncontroversial cleanup:
- Made private methods static where possible (runtime can elide checking the object for null).
- Declared attribute classes as sealed (allows reflection on attributes to complete faster).
- Moved some static cctor's into field initializers (static cctor's are slower than static field initializers).
- Made classes static if they contained only static methods (can't create instances of useless objects).
- Use inferable Exts.Lazy and not new Lazy<T>().
- Added required STAThread attribute to CrashDialog.
- Removed unused parameters in private methods.
- Added Serializable attribute to exceptions.
- Added parameter name in calls to ArgumentNullException.
- Use of as operator instead of is + cast.
- Changed (x as Foo).Bar anti-pattern into ((Foo)x).Bar. Results in sensible cast exceptions on error rather than null dereferences.
- Removed unused method in NullShader.
2014-05-23 15:50:54 +01:00
RoosterDragon
0ea3509ee4 Added MinBy, MaxBy, MinByOrDefault and MaxByOrDefault methods and replaced calls of the style OrderBy[Descending]().First[OrDefault]() which is not as performant. 2014-05-23 08:23:42 +01:00
Pavlos Touboulidis
df6159f12b Do not use the map's rules when rendering the minimap in the map chooser
Using the mod's rules is *a lot* faster because we don't have to load
each map's rules.
2014-05-17 14:33:17 +03:00
Pavlos Touboulidis
10b8093d5a Rename ModInformation to ModMetadata 2014-05-17 14:33:16 +03:00
Pavlos Touboulidis
63ec6d60e7 Refactoring to remove static Rules & SequenceProvider 2014-05-17 14:32:03 +03:00
Paul Chote
4935266945 Merge FileFormats dll into Game and reorganise namespaces. 2014-04-17 01:20:47 +12:00
Matthias Mailänder
c6d9574d52 automatically fix open areas
and don't hard-code the tiles no more
2014-01-03 16:46:38 +01:00
Matthias Mailänder
50bc073791 move legacy map import into the command line utility
closes #4368
2014-01-03 16:45:40 +01:00
Paul Chote
0143e8bfb8 Support rectangular tiles. 2013-12-29 14:16:20 +13:00
Matthias Mailänder
c86d7b85a4 updated the Bountysource link 2013-12-20 14:55:35 +01:00
Paul Chote
f5f6f1e7aa Allow maps to be saved during initialisation. 2013-12-08 10:38:35 +13:00
Igor Popov
1434d4ae8f fix 4236; Editor has to add RequiresMod to map.yaml 2013-12-07 01:37:48 +04:00
Paul Chote
6d6d1e230b Remove runtime mod merging. Closes #3421. 2013-11-15 09:54:42 +13:00
ScottNZ
7c5f3cc0f1 Replace some Where-FirstOrDefault chains with a single call to FirstOrDefault 2013-11-12 17:21:31 +13:00
Matthias Mailänder
ba13c1d982 StyleCop clean Map/*.cs files 2013-08-25 14:30:00 +02:00
Paul Chote
f6d0ea4b0f Remove TileSet rendering code. 2013-08-14 23:08:25 +12:00
Paul Chote
18759e01cf Use TileSetRenderer in the editor. 2013-08-14 23:08:25 +12:00
Matthias Mailänder
2dbc4f4786 Stylecop clean Editor 2013-08-08 14:31:36 +02:00
Paul Chote
656476991f Replace ColorRamp with HSLColor everywhere.
Fixes:
* Nuclear-purple color exploit.
* #3247.
* Removes a bunch of unnecessary color conversions every frame.

Caveats:
* The ramp range is now defined on the palette, so ramps can no longer be set per-player (may impact maps which define custom colors).
* It's no longer possible to perfectly recreate the original WW color ramps (I doubt we care).
* The old ColorRamp setting isn't migrated, so players will lose their color settings.
2013-05-10 19:23:30 +12:00
Matthias Mailänder
7a143d94f9 added an eraser toolbar button
to erase with left-click as in image editing programs
2013-04-02 11:54:41 +02:00
Matthias Mailänder
a55a902ba5 added switchable ruler markings to editor 2013-04-02 11:16:02 +02:00
Matthias Mailänder
e82dd025f6 added toolbar buttons for pan and zoom 2013-04-02 08:37:51 +02:00
Matthias Mailänder
918f27575d added total cash count to editor status bar 2013-03-29 23:20:52 +01:00
Matthias Mailänder
0a82bfe552 format TODO: uniformly to auto-generate task list in MonoDevelop 2013-03-27 09:45:17 +01:00
Matthias Mailänder
a0bd6f0d46 Map Editor beautification
- show full name + version of the loaded mod in titlebar
- added a help menu with useful links
- added icons to to the menu with tooltips
- added a toolbar to the editor, closes #2825
2013-03-26 15:42:44 +01:00
Scott_NZ
bb5212d2bb Fix classic SP maps failing to import into the editor 2013-01-08 22:44:03 +13:00
Curtis Shmyr
ac301b22e2 Editor - Template categories are now ordered by whats specified in the tileset yaml 2013-01-08 20:11:22 +13:00
Matthias Mailänder
aad0b3d2d8 fixed wrong palette remapping for neutral buildings in editor
for TEMPERAT (fields) and DESERT (buildings, trees, rocks)
2012-11-26 12:21:50 +01:00
Matthias Mailänder
0690041347 fix most of the palette issues with RA desert in OpenRA.Editor
TODO: use the palette as defined in YAML;
defaults are wrong for DESERT rocks, trees, walls and ore mine
2012-11-19 14:53:25 +01:00
Matthias Mailänder
c75c72b525 made palette shadowindex configurable 2012-07-01 19:37:57 +12:00