Commit Graph

5629 Commits

Author SHA1 Message Date
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
RoosterDragon
b1e2ee9b79 ScreenMap should TickRender, rather than just Tick.
This is as FrozenUnderFog.TickRender queues an update to the screen map. If this is not processed in the same tick, this results in screen bounds for the frozen actor being 1 tick behind. By making ScreenMap TickRender, it ensures changes from both Tick and TickRender traits are processed, rather than just Tick traits.
2018-01-06 15:16:59 +01:00
RoosterDragon
c60ca83751 Revert "Fix actors disappearing for a tick when swapping to the frozen actor."
This reverts commit 2eb090f153.

This fixes flicker for the actor->frozen transition, but then introduces the same flicker for the frozen->actor transition instead.
2018-01-06 15:16:59 +01:00
Paul Chote
36c3e07535 Remove CRLF from GameServer.cs. 2018-01-01 21:12:58 +01:00
Paul Chote
58547fda89 Guess mod titles based on other versions, if they exist. 2018-01-01 21:12:58 +01:00
Paul Chote
2eb090f153 Fix actors disappearing for a tick when swapping to the frozen actor. 2018-01-01 16:01:44 +01:00
Paul Chote
f8abd5d319 Serialize the correct player in FrozenActor-targeting orders. 2018-01-01 16:01:44 +01:00
Paul Chote
b3cde077fc Don't break the order stream if a frozen actor refers to a bogus player. 2018-01-01 16:01:44 +01:00
Andrii Yukhymchak
11db40a2b3 Fixed issue with unit ready when capturing 2018-01-01 12:52:47 +00:00
Paul Chote
3effa5cec4 Add a setting to disable version checks. 2017-12-29 02:56:50 +01:00
Paul Chote
3ba610b535 Implement new master server ping protocol. 2017-12-26 20:05:38 +01:00
Paul Chote
205c45198c Remove secondary AllowPortForward setting.
The global setting is fine, and this simplifies
both the code and the UI.
2017-12-24 01:47:44 +01:00
RoosterDragon
e42e766bb6 Prevent incorrect usage of ModelRenderer.
Force BeginFrame/EndFrame to be called correctly, and prevent calls to RenderAsync when outside of a frame.
2017-12-23 22:58:17 +01:00
Paul Chote
4c64a37e1d Reject invalid orders from unvalidated clients. 2017-12-23 21:48:59 +01:00
reaperrr
fbc18dfb18 Use HashSet instead of IEnumerable to pass actors to renderable lists 2017-12-23 17:56:11 +00:00
reaperrr
04fb0f209d Spatially partition some actor overlays 2017-12-23 17:56:11 +00:00
reaperrr
6ef95405bf Split overlay renderable generation to separate list
To make the code a bit more readable and consistent with normal renderables.
2017-12-23 17:56:11 +00:00
Paul Chote
9dc330b300 Update FrozenActor TargetTypes alongside other variable state. 2017-12-22 02:33:25 +01:00
Paul Chote
b9e03ac009 Add FrozenActorLayer.FrozenActorsInRegion. 2017-12-22 02:33:25 +01:00
Paul Chote
b221787350 Allow CellRegions to be created with MPos. 2017-12-22 02:33:25 +01:00
Paul Chote
ec4cf0646f Rewrite Serialize to improve clarity. 2017-12-21 20:01:14 +01:00
Paul Chote
5b51261dd3 Serialize the correct target type. 2017-12-21 20:01:14 +01:00
Paul Chote
9c88fc154f Remove redundant switch from order serialization. 2017-12-21 20:01:14 +01:00
RoosterDragon
987d0b77ac When dumping syncable traits, use a struct for the synced values.
Since most traits have few syncable members, this allows us to avoid allocating an array whose lifetime is only a few ticks long. For traits with more members, we fall back to allocating the array.
2017-12-19 22:01:08 +02:00
RoosterDragon
ca01a1f186 Presize MemoryStream when possible.
Also use GetBuffer when we know we have presized the stream to the exact required size to prevent a needless copy.
2017-12-19 00:59:11 +01:00
RoosterDragon
5d8c9a560a Release audio resource for video when StopVideo is called. 2017-12-19 00:57:58 +01:00
Paul Chote
e35e93557c Remove obsolete NearestCellTo helper. 2017-12-18 07:47:15 +00:00
reaperrr
01a88862b3 Remove IDisable for good 2017-12-17 21:18:44 +00:00
RoosterDragon
be761de768 Compute map UIDs without copying all data to a MemoryStream.
We can use MergedStream to create a single combined stream with all the input and pass this to the hash function. This saves copying all the data into a MemoryStream to achieve the same goal, which requires more memory and allocations.
2017-12-17 19:20:12 +01:00
Paul Chote
1a405b17ba Register the current mod even if LaunchPath is bogus. 2017-12-17 04:21:17 +01:00
RoosterDragon
a9d1d374b8 Remove draw line 2D helper method.
Callers can provide 3D points easily, and this avoids the need to allocate and slow down enumeration via the points.Select(p => new float3(p, 0)) wrapper.
2017-12-17 01:51:51 +01:00
RoosterDragon
de38313579 Cache VariableExpressions on load.
Compiling these expressions is sadly expensive, and we needed new ones for every trait on every actor each time one was generated. The expressions thankfully can be shared as they are pure functions, which removes this overhead.
2017-12-17 01:42:21 +01:00
RoosterDragon
dd2ae9fe5e Avoid LINQ in some Tick methods.
As Tick is called often, avoiding allocation overhead in these methods is useful.
2017-12-17 01:28:25 +01:00
RoosterDragon
5b51f2a0fa Avoid format strings in some places.
Where it is possible to directly concat strings, prefer this in some often-called methods.
2017-12-16 17:26:29 +01:00
RoosterDragon
c8c7629bce Convert some stray spaces to tabs. 2017-12-16 15:53:03 +00:00
Paul Chote
502c3e2bf5 Remove global chat integration. 2017-12-13 21:04:16 +01:00
Paul Chote
3f67feab0e Rename boolean LobbyOption fields. 2017-12-12 22:43:11 +01:00
Paul Chote
36fccbc453 Add Checkbox/Dropdown to lobby options yaml fields. 2017-12-12 22:43:11 +01:00
Paul Chote
ea32c758eb Expose default UI labels and tooltips to yaml. 2017-12-12 22:43:11 +01:00
Paul Chote
2c17780b94 Make ShroudInfo fields readonly. 2017-12-12 22:43:11 +01:00
Paul Chote
97cdce7448 Add additional metadata to lobby options. 2017-12-12 22:43:11 +01:00
RoosterDragon
7760c41bd9 Avoid array resizing in OpenAlAsyncLoadSound.
- Where it is accessible, use the length of the stream to presize the MemoryStream to the correct size.
- Instead of copying out the result via ToArray, grab the underlying buffer via GetBuffer and use that to create the sound source.

This avoids extraneous copying of the array containing the audio.
2017-12-12 00:01:04 +01:00
Paul Chote
c87409ed1a Remove legacy bounds code. 2017-12-11 19:45:07 +01:00
Paul Chote
ff5b4b15b3 Introduce IDecorationBounds to replace Actor.SelectionOverlayBounds. 2017-12-11 19:45:07 +01:00
Paul Chote
6f5d035e79 Introduce IMouseBounds and split/rework mouse rectangles.
The render bounds for an actor now include the area covered
by bibs, shadows, and any other widgets. In many cases this
area is much larger than we really want to consider for
tooltips and mouse selection.

An optional Margin is added to Selectable to support cases
like infantry, where we want the mouse area of the actor
to be larger than the drawn selection box.
2017-12-11 19:45:07 +01:00
Paul Chote
8fcc80b05a Use IRender.ScreenBounds in ScreenMap.
Traits are now required to trigger a ScreenMap update whenever they
believe that their ScreenBounds have changed.
2017-12-11 19:45:07 +01:00
Paul Chote
fa65fef4d1 Add IRenderModifier.ModifyScreenBounds to support WithShadow. 2017-12-11 19:45:07 +01:00
Paul Chote
86bfe28ade Add ScreenBounds method to IRender interface.
This method is expected to return Rectangles that cover
the region where Renderables returned by Render may exist.
2017-12-11 19:45:07 +01:00
Paul Chote
46f6263061 Update ScreenMap state in a single pass at the end of the tick. 2017-12-11 19:45:07 +01:00
Paul Chote
9e18ec7314 Simplify ScreenMap bounds checking. 2017-12-11 19:45:07 +01:00