Commit Graph

40 Commits

Author SHA1 Message Date
abcdefg30
23b3c237b7 Update the year numbers in all license headers to 2020 2020-01-05 17:00:34 +00:00
abcdefg30
cadbd0d9ab Change the year number in all cs headers from 2018 to 2019 2019-01-26 23:15:21 +01:00
Paul Chote
9ff177359b Split IGraphicsContext from IPlatformWindow. 2018-06-13 18:45:21 +01:00
Paul Chote
ab14a86d39 Rename Renderer.Device to Renderer.Window. 2018-06-13 18:45:21 +01:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06:00
Paul Chote
e71225496b Clarify GPL version. 2016-02-21 16:30:48 +00:00
Paul Chote
b396965fd9 Update licence header year. 2016-02-21 16:27:31 +00:00
Paul Chote
7eae157ad8 Rework player palette loading. 2015-05-10 00:01:14 +01: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
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
RoosterDragon
8c2fdb9097 Add CopyToArray method for IPalette.
By allowing a palette to be copied to an array, a speedup can be gained in HardwarePalette since palettes can be block copied using native magic rather than having to copy them item by item. We transpose the buffer in HardwarePalette in order to allow a contiguous block copy into this buffer, transposing again in the shader to keep everything correct.
2014-12-07 20:46:46 +00: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
ScottNZ
dbffce81a6 Remove unused usings 2014-06-15 22:16:40 +12:00
Paul Chote
4935266945 Merge FileFormats dll into Game and reorganise namespaces. 2014-04-17 01:20:47 +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
Matthias Mailänder
6c6f5601d8 make PaletteTexture private and only use it for sprite renders 2013-04-06 08:44:32 +02:00
Paul Chote
db7887687b Remove hardcoded list of palette mod exclusions. 2013-02-22 15:04:41 +13:00
Chris Forbes
55036cd58c fix trailing whitespace everywhere 2011-09-26 08:40:39 +13:00
Paul Chote
b0425aff3b Renormalize line endings and fix copyright headers again. 2011-04-07 21:15:42 +12:00
Chris Forbes
f3dfc422ab fixed #635 2011-03-16 19:16:38 +13:00
Chris Forbes
c1ad99bb99 dont allocate a full new palette texture every frame in HardwarePalette.Update 2011-03-05 18:29:30 +13:00
Paul Chote
094907c1a9 Update copyright header. Normalize line endings to LF. 2011-02-13 10:38:57 +13:00
Paul Chote
6c14b78b7c Load the game into an intermediate state where RAInitDelegate can install packages, etc (an even bigger hack). 2011-01-27 20:50:00 +13:00
Paul Chote
6776d6f906 Load the main menu without loading mixes or creating a shellmap world. A giant hack. 2011-01-27 20:50:00 +13:00
Chris Forbes
db7a11e8a6 some random bits 2010-08-19 18:33:52 +12:00
Paul Chote
694fd84188 Clean up custom color palette 2010-08-15 00:18:06 +12:00
Paul Chote
d0da9d11bf Fix palettes and all palettemods. Remap palettes broken. 2010-08-14 23:29:01 +12:00
Paul Chote
0a2d39f15b More correct, still doesn't work. 2010-08-14 22:23:22 +12:00
Paul Chote
8118a17e3c foo 2010-08-14 21:53:24 +12:00
Paul Chote
0f6564f31a more or less fail 2010-08-14 21:36:13 +12:00
Paul Chote
dda6556e17 non-working palette fail 2010-08-14 21:07:19 +12:00
Chris Forbes
f162c5956e cleanup wtf 2010-08-10 21:51:06 +12:00
alzeih
2f9f539857 big pile of Render refactoring 2010-07-21 18:59:33 +12:00
alzeih
222b29cec6 Bye Bye Chrome! 2010-07-21 17:57:06 +12:00
Chris Forbes
d5f12dd8ee trim down license spam in all files 2010-07-18 16:48:21 +12:00
Paul Chote
c4442f07da Sliders change the preview palette and update client data; Need a better algorithm for picking color2 2010-07-16 23:34:42 +12:00
alzeih
7881deca30 Everything is now OpenRA, not OpenRa 2010-02-27 21:10:22 +13:00