Commit Graph

927 Commits

Author SHA1 Message Date
RoosterDragon
b48b994f16 Remove half-baked thread-safety mechanisms from Sheet.
Sheet is now thread-unsafe, rather than attempting to expose a dodgy thread safety model.
2015-05-20 18:50:28 +01:00
RoosterDragon
d42c3a9740 Allow a sheet buffer to be released without error, even if unbuffered. 2015-05-20 18:35:24 +01:00
RoosterDragon
b9ebeaadca Improve performance of line rendering.
- Create an overload that renders a line in one color, as this allows most existing calls to be simplified. This also allows a slight performance improvement by only normalizing the components once.
- Introduce a DrawLineStrip method. This improves performance by allowing the color components to be normalized once for the whole strip, and only needing to calculate vertices once per point rather than twice since we can reuse the last result.
2015-05-19 21:41:50 +01:00
Paul Chote
038847cc4c Force the first template variant in TTPW. 2015-05-15 17:08:32 +01:00
abcdefg30
70e7b33fd7 Merge pull request #7979 from Mailaender/d2k-sand-blendmode
Fixed the Dune 2000 harvester sand out animation
2015-05-14 19:21:06 +02:00
abcdefg30
d62b01d294 Merge pull request #7538 from cjshmyr/teamhealth
Give ally players a yellow health bar (team health colors)
2015-05-12 18:01:27 +02:00
Curtis Shmyr
6ca51e47c1 Give ally players a yellow hp bar for team health colors 2015-05-10 11:12:10 -06:00
Paul Chote
889360d4c6 Regenerate cached texture indices when the palette size changes. 2015-05-10 00:59:15 +01:00
Paul Chote
7eae157ad8 Rework player palette loading. 2015-05-10 00:01:14 +01:00
Paul Chote
1d835edfca Split PaletteReference into its own file. 2015-05-09 22:36:28 +01:00
Matthias Mailänder
732001f3f3 Merge pull request #7696 from Robmaister/bleed
Updated SharpFont to 3.0.0, adjusted font rendering code for new fixed-point types
2015-05-01 11:41:20 +02:00
Oliver Brakmann
a6b8bdf978 Merge pull request #8027 from pchote/update-terrain-vertexbuffer
Update terrain layer when the terrain data changes.
2015-04-26 21:15:45 +02:00
Matthias Mailänder
63e4d40770 add alpha channel to every possible blend mode 2015-04-26 09:22:19 +02:00
Paul Chote
8f93d7b5d7 Simplify and fix animation glitches. 2015-04-25 22:52:14 +02:00
Paul Chote
7df12cb3e9 Update terrain layer when the terrain data changes. 2015-04-26 07:35:07 +12:00
Oliver Brakmann
a48a878a71 Merge pull request #7983 from pchote/radar-colors
Adjust IRadarSignature to support per-cell colors.
2015-04-25 16:38:28 +02:00
Robert Rouhani
4987a6b24c Updated SharpFont to 3.0.0, adjusted font rendering code for new fixed-point types. 2015-04-25 10:26:41 -04:00
Paul Chote
145f7b28f5 Adjust IRadarSignature to support per-cell colors. 2015-04-19 22:27:47 +12:00
Matthias Mailänder
868e404b22 add 2 new blend modes: Multiplicative, DoubleMultiplicative 2015-04-18 13:41:53 +02:00
RoosterDragon
9c93001c84 Convert to 32bbp internally in FastCopyIntoSprite.
This avoids the need for callers to ensure the pixel format is correct, but ensures that the copying succeeds when the format is different.
2015-04-17 18:50:49 +01:00
RoosterDragon
7883355481 Validate PixelFormat of source bitmap argument in FastCopyIntoSprite. 2015-04-10 19:54:03 +01:00
reaperrr
c0448fce3e Adds two new BlendModes. 2015-04-01 21:16:01 +02:00
Paul Chote
57a6fff6ce Don’t crash if the click location is outside the map. 2015-03-31 20:59:53 +01:00
Paul Chote
1e54b19bd3 Implement heightmap-aware view -> cell conversion. 2015-03-31 20:59:53 +01:00
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
b2458fc614 Remove GlobalFilesystem.OpenWithExts. Closes #5272. 2015-03-28 12:38:48 +00:00
Paul Chote
92452271fe Use per-tile color in minimap. 2015-03-23 20:33:23 +00:00
Paul Chote
a69145caf0 Add a utility command for checking sequences. 2015-03-22 12:48:51 +00:00
Paul Chote
e5c03413cc Move common widgets from Game to Mods.Common. 2015-03-21 11:53:53 +00:00
Matthias Mailänder
7be8c4461b Merge pull request #7405 from Rydra/upstream/int2immutable
Made int2 class immutable
2015-03-20 16:03:46 +01:00
David Jiménez
f15f1e41e8 Made int2 struct immutable 2015-03-20 13:54:01 +01:00
Matthias Mailänder
16ff6e2112 Merge pull request #7561 from RoosterDragon/fast-map-border-shroud
Speed up map border shroud & fix viewport visible cells
2015-03-18 06:36:45 +01:00
Paul Chote
f91ee3fb45 Fix sequence terminology. 2015-03-09 20:45:49 +00:00
Paul Chote
7292bd20b3 Move Sequence parsing into mod code. 2015-03-09 20:45:22 +00:00
Paul Chote
d3783f0244 Introduce ISpriteSequence interface. 2015-03-09 19:19:00 +00:00
Paul Chote
44159ecdd6 Add support for race-specific actor sequences. 2015-03-02 20:46:24 +00:00
RoosterDragon
d3b93345b4 Fix Viewport.VisibleCells.
Reworked the visible cells calculation to ensure the visible region is actually minimal, which should reduce the amount of rendering to be done by a small amount. Previously, the region would tend to overdraw by 2-3 cells in either direction. For isometric maps, there was also a bug where it would draw far too much vertically above the top of the map.
2015-02-28 13:36:58 +00:00
Matthias Mailänder
361c1bc010 Merge pull request #7483 from pchote/deadbuildingstate
Fix missing first animation frame and remove DeadBuildingState.
2015-02-21 14:00:23 +01:00
Pavel Penev
293bb78a3c Merge pull request #7457 from pchote/actorpreviews
Introduce ActorPreviewWidget (and other related changes).
2015-02-21 01:35:03 +02:00
RoosterDragon
4d5101a7c4 Vastly improve shroud rendering performance.
Changes in the shroud are now tracked. If a cell changes it will mark itself and its neighbors as dirty. During the render phase all dirty cells will have their vertices calculated and cached. If a cell is not dirty, the pre-calculated vertices are retrieved from cache. Then the sprite renderer is provided the sprite and the pre-calculated vertices to draw.

This prevents constant recalculation of vertices for the shroud in the render phase, requiring instead only dirty cells in the visible area. The update phase is reduced to a practical noop, instead incurring the cost only of changed cells each frame, rather than checking the visible area.
2015-02-20 20:03:42 +00:00
Paul Chote
e9caf7f6e6 Initialise frame time when playing a new sequence.
Fixes #3706, #6389.
2015-02-20 16:54:04 +00:00
ScottNZ
582b6635ff Brace style fixes 2015-02-13 02:32:49 +13:00
Paul Chote
1af61c92c5 Split SpriteRenderable into its own file. 2015-02-10 17:47:49 +00:00
Paul Chote
268ca94dc1 Introduce ActorPreviewWidget. 2015-02-10 15:22:42 +00:00
Paul Chote
db1a27b071 Introduce IFinalizedRenderable.ScreenBounds. 2015-02-10 14:26:44 +00:00
Paul Chote
c55d723fb4 Remove Scale from IRenderable interface.
It is no longer used, and isn’t implemented for most renderables.
2015-02-09 23:26:06 +00:00
Paul Chote
a495a2f528 Split IFinalizedRenderable from Renderable to remove mutable structs. 2015-02-09 23:23:37 +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
RoosterDragon
c313c52e96 Avoid a globally shared SheetBuilder in SpriteFont.
A globally shared sheet builder leaks memory and resources between mod switches. Instead, we create and inject the sheet builder during mod startup to ensure we still share the builder across all fonts, but can reclaim it when the mod is unloaded.
2015-01-19 21:04:17 +00:00