Commit Graph

204 Commits

Author SHA1 Message Date
ScottNZ
dbffce81a6 Remove unused usings 2014-06-15 22:16:40 +12: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
Paul Chote
fdd4437c52 Re-enable shellmaps. 2014-05-02 22:08:41 +12:00
Paul Chote
4935266945 Merge FileFormats dll into Game and reorganise namespaces. 2014-04-17 01:20:47 +12:00
Paul Chote
1b2a90c00c Migrate to System.Lazy. 2014-04-09 20:20:41 +12:00
Matthias Mailänder
67cd0645a4 update to .NET 4.0 2014-04-09 20:20:26 +12:00
Oliver Brakmann
4d71e37ab0 Disable shellmaps temporarily 2014-04-03 17:24:01 +02:00
Paul Chote
4f7f0b7a55 Don't draw combat debug for actors outside the world. 2014-03-21 10:03:54 +13:00
Paul Chote
0143e8bfb8 Support rectangular tiles. 2013-12-29 14:16:20 +13:00
Paul Chote
1a31368953 Convert range circle rendering to world coords. 2013-12-26 17:23:12 +13:00
Paul Chote
4e814a8c2e Move ShroudRenderer into a trait. 2013-12-11 19:22:55 +13:00
Curtis Shmyr
d30f60809b Added 2 settings for unit health bars: always show unit health, and team health bar colors 2013-11-24 12:12:52 -07:00
Paul Chote
94554d7678 Support nested scissor rectangles. 2013-10-25 08:31:34 +13:00
Paul Chote
84bb78060f Don't zoom UI lines when pixel doubling. 2013-10-15 11:19:16 +13:00
Paul Chote
44dd801f16 Extract shared constants in Draw*Bar and DrawSelectionBox. 2013-10-15 10:45:51 +13:00
Paul Chote
483120ea20 Extract DrawTargetMarker to WorldRenderer. 2013-10-15 10:45:51 +13:00
Paul Chote
839419635d Improve contrasted range circle rendering. 2013-10-15 10:45:51 +13:00
Paul Chote
919181e04d Clean up viewport internals. 2013-10-05 21:01:22 +13:00
Paul Chote
936bf98496 Move Viewport inside WorldRenderer. 2013-10-05 21:01:22 +13:00
Paul Chote
0b560bfc6e Move more viewport lookups to WorldRenderer. 2013-10-05 21:01:21 +13:00
Paul Chote
f575c20d38 Route viewport centering via WorldRenderer. 2013-10-05 21:01:21 +13:00
Paul Chote
5f0bb4b6c2 Fix some style nits in WorldRenderer. 2013-09-29 21:15:46 +13:00
Paul Chote
2e0e4b0bc5 Add WorldRenderer.Position for screen -> world conversion. 2013-09-27 15:41:32 +12:00
Paul Chote
4df9fc1acc Render minefield targeting using PBOG-style overlay. 2013-09-27 15:41:32 +12:00
Paul Chote
0dc50c65f5 Remove unnecessary int2 -> PPos -> int2 conversions. 2013-09-27 15:41:32 +12:00
Paul Chote
ad44610e5a Replace dynamic Actor.Bounds with the (unchanging) relative rect. 2013-09-27 15:39:57 +12:00
Paul Chote
dfd51c0caa Introduce ScreenMap trait for caching screen-coord queries. 2013-09-27 15:36:25 +12:00
Paul Chote
b6a033eef5 Remove obsolete IRenderAsTerrain.
This removes the technical limitation preventing
FrozenUnderFog on bridges.
2013-08-15 18:12:49 +12:00
Paul Chote
387ac04d9f Split tileset artwork loading out of TileSet.
This simplifies terrain loading and allows for
non-square tiles in game.

The editor still relies on the old code for now.
2013-08-14 23:08:17 +12:00
Paul Chote
0a9d920eb6 Allow world and (render-) player actors to render. 2013-08-11 22:23:52 +12:00
Paul Chote
4754cbb768 Replace IOrderGenerator.RenderBeforeWorld with world-sorted .Render.
Range circles have been moved to RenderAfterWorld for now.
2013-08-11 00:25:54 +12:00
Paul Chote
cdef41adb4 Specify sprite positions as center pos + offset. Fixes #3611. 2013-08-01 22:23:21 +12:00
Paul Chote
27f04c1b78 Rename FindUnits -> FindActorsInBox. 2013-07-20 15:34:28 +12:00
Paul Chote
37c02fea79 Remove PPos overload of FindUnits. 2013-07-20 15:34:27 +12:00
Paul Chote
c5337cdcf3 Reimplement voxel rendering with a FBO. 2013-06-15 19:31:52 +12:00
Paul Chote
7a71f87d9f Introduce Renderable.BeforeRender().
WorldRenderer.Draw() has been slightly reorganized
to ensure that BeforeRender is called before any
drawing render state (e.g. scissor) has been set.
2013-06-15 19:16:08 +12:00
Paul Chote
9b576d3fdd Add a visualization layer for renderable geometry. 2013-06-15 19:16:08 +12:00
Paul Chote
25dd8d9fa7 Fix aircraft shadow render order. 2013-05-23 21:25:11 +12:00
Paul Chote
e382dc9b71 Remove obsolete functions from WorldRenderer. 2013-05-17 18:12:28 +12:00
Paul Chote
e1290dca47 Round PxPosition to the nearest pixel. 2013-05-17 18:12:28 +12:00
Paul Chote
fb17654ea0 Convert Renderable to World Coordinates internally. 2013-05-17 18:12:26 +12:00
Paul Chote
d103a187f6 Make the guts of Renderable private. 2013-05-17 18:12:26 +12:00
Paul Chote
7719ad1f2d Move Renderable into its own file. 2013-05-17 18:12:26 +12:00
Paul Chote
248e815d99 More shroud refactoring.
This introduces a hash on Shroud which ShroudRenderer
can observe, removing the need to explicitly twiddle
a dirty flag between objects.

Shroud disabling is now done via RenderPlayer, so
enabling the cheat or winning/losing will now give
vis equivalent to an observer.
2013-04-10 21:08:22 +12:00
Paul Chote
c428cad70c Refactor per-player shrouds & fix shellmap shroud. 2013-04-10 19:36:03 +12:00
Matthias Mailänder
acc8cd1e5e fixes #2885 forgot to enable the cursor palette before drawing
split HardwarePalette.Update into two functions, closes #2847
2013-04-06 08:44:32 +02:00
Paul Chote
34a9675744 Remove unnecessary PPos.FromWPosHackZ() usage. 2013-03-31 21:35:30 +13:00
Paul Chote
9e4bab07e5 Add conversions and helpers for world coordinates. 2013-03-29 20:39:27 +13:00
Matthias Mailänder
851512a84e eliminate public CursorProvider.Palettes
don't hand over the cursor palette to the world renderer at all
still update worldrender palette (set and apply modifiers)
2013-03-25 06:30:39 +01:00
Matthias Mailänder
ba12aafd78 refactor cursor rendering
create a new cursor palette only once and not in WorldRenderer
move cusrsor sequence lookup and drawing to CursorProvider
2013-03-24 21:21:30 +01:00