Commit Graph

73 Commits

Author SHA1 Message Date
RoosterDragon
9f728b287b Remove event handlers to CellEntryChanged when done.
Several classes would attach event handlers to the Map which would live longer then they did. Detaching them when no longer needed allows the GC to reclaim them.
2015-11-04 23:09:32 +00:00
Paul Chote
c44afc0722 Remove viewport editor-mode assumptions. 2015-06-16 08:16:49 +01:00
Paul Chote
2156a234db Render shroud outside map bounds.
Fixes a regression from #8337.
2015-06-15 18:06:43 +01:00
Paul Chote
bf4722fb9f Distinguish between all map cells and cells inside map bounds. 2015-06-02 21:53:25 +01:00
Paul Chote
629f877032 Extract terrain vertex buffer into a reusable class. 2015-05-29 19:06:11 +01:00
Paul Chote
889360d4c6 Regenerate cached texture indices when the palette size changes. 2015-05-10 00:59:15 +01:00
Paul Chote
7df12cb3e9 Update terrain layer when the terrain data changes. 2015-04-26 07:35:07 +12:00
Paul Chote
3ea70e891d Merge pull request #7291 from RoosterDragon/dynamic-palette-sizing
Implement dynamic hardware palette sizing.
2015-01-13 17:41:15 +13:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +01:00
RoosterDragon
53f06ba093 Implement dynamic hardware palette sizing.
The HardwarePalette will now grow its palette buffer and texture in power-of-2 increments. This avoids it having to allocate memory for a full 256x256 texture up front. In practice the default mods use 22 or 23 palettes so a 32x256 texture is used. This means both the buffer and texture save neatly on memory. Additionally, HardwarePalette.ApplyModifiers sees a nice speedup as it has to transfer a much smaller amount of memory from the buffer to the texture.

To facilitate this change, the MaxPalettes constant is no more. Instead the PaletteReference deals with the calculation of the index and this is passed into the appropriate methods.
2015-01-07 22:41:51 +00:00
RoosterDragon
7cfece6dc0 Introduce a new type for representing map coordinates.
To resolve the ambiguity introduced when the introduction of isometric maps meant that cell and map coordinates were no longer equivalent, a new type has been introduced so they can each be represented separately.
2015-01-07 17:30:34 +00:00
Matthias Mailänder
bc3acfeee7 StyleCop clean OpenRA.Game 2015-01-04 15:38:54 +01:00
RoosterDragon
9cbac2d5e1 Clean up style of files affected by the last commit. 2014-12-22 17:34:02 +00:00
RoosterDragon
f0f02dff5c Dispose of graphics resources deterministically.
Textures, FrameBuffers and VertexBuffers allocated by the Sdl2 Renderer were only being released via finalizers. This could lead to OpenGL out of memory errors since resources may not be cleaned up in a timely manner. To avoid this, IDisposable has been implemented and transitively applied to classes that use these resources.

As a side-effect some static state is no longer static, particularly in Renderer, in order to facilitate this change and just for nicer design in general.

Also dispose some bitmaps.
2014-12-22 17:34:01 +00:00
Paul Chote
aab9ad5ac0 Load tmp(ts) ExtraData for cliffs etc. 2014-11-05 09:39:55 +13:00
Alexander Fast
070d00c678 Fixes year numbers in license text in file headers. 2014-08-21 11:27:52 +02:00
Paul Chote
a30c8b53a7 Add support for diamond cell grids. 2014-06-30 23:44:23 +12:00
Paul Chote
7b52fa52b6 Replace CPos.CenterPosition -> Map.CenterOfCell. 2014-06-27 23:30:40 +12:00
Paul Chote
997216aef0 Use CellLayer for terrain. 2014-06-27 22:07:02 +12:00
Paul Chote
386b71de82 Integrate CellRegion with Map, Viewport. 2014-06-27 19:20:46 +12:00
ScottNZ
90894aa03e Use var everywhere 2014-06-15 22:17:34 +12:00
Paul Chote
4935266945 Merge FileFormats dll into Game and reorganise namespaces. 2014-04-17 01:20:47 +12:00
Paul Chote
c42a6f8386 Convert terrain rendering to world coords. 2013-12-26 17:23:13 +13:00
ScottNZ
00ec1ca87a Remove unused usings 2013-11-12 19:39:33 +13:00
Paul Chote
919181e04d Clean up viewport internals. 2013-10-05 21:01:22 +13:00
Paul Chote
b7123cda7d Route screen size queries via Game.Renderer. 2013-10-05 21:01:21 +13: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
0e1c12131a Generalize SheetBuilder overflow behavior. 2013-06-15 19:16:07 +12:00
Paul Chote
f5d59fab22 Fix #2106.
The current tilesets only use only ~3% of the
available sheet space, so a future patch may want
to look into decreasing the terrain sheet size to
save some GPU memory.
2013-05-15 20:36:30 +12:00
Paul Chote
891158ca44 Allow SheetBuilder to throw an exception on sheet overflow.
This removes unnecessary checks from TerrainRenderer
and will be used in the voxel renderer.
2013-05-15 20:18:41 +12:00
Paul Chote
ccbfacec62 Tidy TerrainRenderer formatting (no code changes). 2013-05-15 19:24:18 +12:00
Scott_NZ
2c4c7aa4c0 Fixes TerrainRenderer.Draw() causing a crash because of negative firstRow value 2013-04-19 19:09:29 +12:00
Paul Chote
c428cad70c Refactor per-player shrouds & fix shellmap shroud. 2013-04-10 19:36:03 +12:00
Matthias Mailänder
c731a7960e embed the previously manually edited outdated documentation
from https://github.com/OpenRA/OpenRA/wiki/Trait-Documentation
2013-03-20 21:20:27 +01:00
Paul Chote
8a53819f50 Redirect IShader calls via respective *Renderers. 2013-03-08 18:21:35 +13:00
Paul Chote
786c3b1f1a Rename uniform setters to avoid future ambiguity. 2013-03-04 19:06:42 +13:00
Paul Chote
82426e0e45 Move Palette from ModData to WorldRenderer. 2013-02-26 09:35:41 +13:00
Kenny
f41fb32d60 Introducing per-player shrouds.
- Each player has their own shroud and their visibility does not extend outside of the shroud. 
- Units and buildings can no longer target other units outside of their visibility. Buildings can still be targetted if they have been explored.
- GPS will provide visibility in the fog-of-war.
- Spies that infiltrate radar domes will gain their victim's exploration and reset it on all clients (if the victim does not have GPS)
2012-12-13 15:16:56 -08:00
Chris Forbes
55036cd58c fix trailing whitespace everywhere 2011-09-26 08:40:39 +13:00
Paul Chote
fc783ddf80 Support custom zoom levels 2011-07-25 22:23:17 +12:00
Paul Chote
926b396605 Fix bogus naming of Shaders/Renderers. Split LineRenderer into world and chrome variants. 2011-07-25 22:23:16 +12:00
Chris Forbes
cd6f77ca7c move terrain palette constant lookup outside terrain setup inner loop 2011-05-22 20:39:01 +12:00
Chris Forbes
4d6b2c7954 IBOless rendering with quads; considerably reduces renderer complexity 2011-05-18 20:42:10 +12:00
Chris Forbes
16cb275a5f fix rendering of very large maps 2011-03-08 19:24:15 +13:00
Paul Chote
094907c1a9 Update copyright header. Normalize line endings to LF. 2011-02-13 10:38:57 +13:00
Paul Chote
73020a9419 Make binary info loading lazy 2011-02-11 21:50:11 +13:00
Paul Chote
2c0a928b48 Fix terrain being drawn using the cursor palette. 2011-01-27 20:50:02 +13:00
Paul Chote
7c5c989eb2 Introduce World.LocalShroud. Breaks targeting stealth tanks. Probably breaks FrozenUnderFog. 2010-11-27 11:20:04 +13:00
Paul Chote
fc5830a687 Added int2.Clamp(Rectangle). All queries for map geometry use map.Bounds. 2010-11-24 12:24:48 +13:00
Paul Chote
de8603832f Use Map.Bounds instead. 2010-11-24 11:12:37 +13:00