Commit Graph

60 Commits

Author SHA1 Message Date
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Jonathan G Rennison db924a4681 Codechange: [Blitter] Change DrawLine to be templated
This is remove per-pixel overheads due to use of the SetPixel virtual
method.
These overheads included:
* expensive virtual method call which prevents inlining
* palette lookup for every pixel
* branch on whether palette animation is enabled on every pixel

Regenerate project files.
2019-01-24 11:12:06 +00:00
Charles Pigott 5f86e1a390 Codechange: Silence -Wclass-memaccess warnings with GCC8 2018-06-27 22:54:46 +02:00
Jonathan G Rennison 17257b9620 Add: 32bpp SSE2 blitter palette animator (#6795)
Create a new blitter mode: 32bpp-sse2-anim, which is 32bpp-anim + this.
32bpp-sse2-anim is now used by default where 32bpp-anim would have been.
Also use this with the 32bpp-sse4-anim blitter.

See issue #6469.
2018-05-23 09:55:04 +01:00
frosch 19188818ea (svn r27796) -Fix [FS#6545]: 32bpp-anim blitters assumed that pitch and width of the screen were equal. 2017-03-18 17:14:53 +00:00
frosch 914d4616ca (svn r27575) -Fix [FS#6404]: Memory leak when disabling palette animation. (JGR) 2016-05-22 10:28:57 +00:00
rubidium 8c7f376ae1 (svn r26970) -Fix (r26969): non-sse animated blitter crashed occasionally 2014-10-06 19:15:00 +00:00
rubidium 9c31ffd893 (svn r26969) -Fix (r26869): black palette didn't work very well with unmasked 32bpp sprites 2014-10-06 18:45:51 +00:00
rubidium b476086c39 (svn r26538) -Codechange: remove double accounting of the drivers 2014-04-28 21:06:51 +00:00
rubidium 0463dbdc9e (svn r26482) -Codechange: add an include that allows us to undefine/redefine "unsafe" functions to prevent them from being used, and thus having to care about certain aspects of their return values 2014-04-23 20:13:33 +00:00
peter1138 209d3e2e9e (svn r26463) -Fix (r10190ish): Add special handling for PALETTE_CRASH to work for non-8bpp-mapped sprites. 2014-04-13 19:22:23 +00:00
rubidium 54e36c4ff8 (svn r24111) -Codechange: use Colour more instead of manually bitstuffing 2012-04-10 20:16:51 +00:00
rubidium 0e925c9e5e (svn r23927) -Fix [FS#5056]: 32bpp animated blitter was optimised a bit too far regarding not needing to update the colour mapping when (re)initialising the palette 2012-02-11 20:08:31 +00:00
rubidium 6d6be50ae0 (svn r23740) -Codechange: remove some 300 unneeded includes from the .cpp files 2012-01-03 21:32:51 +00:00
truebrain 8dbb654e39 (svn r23727) -Codechange: speedup the 32bpp palette animation by reducing the amount of compares. This is possible because the function is called with only 2 possible conditions: from 0 to 255 (full palette update, 8bpp only) or from PALETTE_ANIM_START to 255 2012-01-03 09:46:37 +00:00
peter1138 4da7f2b723 (svn r23726) -Fix (r23670): Remove debugging code added accidentally 2012-01-03 02:38:35 +00:00
peter1138 3ef77e55c5 (svn r23670) -Feature: Add ability to adjust brightness of colour after remapping for 32bpp sprites 2011-12-24 23:33:45 +00:00
rubidium 61625e53c9 (svn r23448) -Fix: keep a local copy of the palette in the 32bpp animated blitter so changes of the palette data during the game don't influence drawing (with SDL) 2011-12-08 19:37:33 +00:00
rubidium 4f87d2e88c (svn r23194) -Codechange: don't cast away const needlessly 2011-11-12 08:26:30 +00:00
peter1138 719f6618d7 (svn r23016) -Change: Disable palette animation for pixels with alpha, as the alpha and previous colour information will be lost when the palette is animated. 2011-10-11 07:13:36 +00:00
frosch bbcd2bab5d (svn r22419) -Change: Always use the DOS palette for drawing.
-Remove: the '-i' option for palette selection.
2011-05-04 17:12:37 +00:00
rubidium 485c7cd99e (svn r22397) -Document: some tidbits of the blitter code 2011-05-01 10:15:33 +00:00
frosch 1ffd720f81 (svn r22383) -Codechange: Rename PALETTE_TO_STRUCT_GREY to PALETTE_NEWSPAPER as it does not belong to the other PALETTE_TO_STRUCT_xxx recolourings. 2011-04-29 20:47:36 +00:00
alberth b2f9b0ac43 (svn r18907) -Cleanup: Smallmap was the last user of SetPixelIfEmpty(). 2010-01-23 22:37:14 +00:00
rubidium db33e32b4d (svn r18873) -Codechange: use PaletteID also in the blitter 2010-01-21 01:44:51 +00:00
rubidium 82fc28f77f (svn r18809) -Codechange/Cleanup: remove unneeded headers from some files, if a header require a header make it include that header 2010-01-15 16:41:15 +00:00
rubidium 70aad27dcb (svn r18791) -Fix [FS#3504]: when copying an 'image' back into the buffer the 32bpp anim blitter triggered palette check of the whole window instead of only the part the got copied back 2010-01-12 16:38:48 +00:00
peter1138 abb147d974 (svn r18709) -Fix (r10227,FS#3464): Animation buffer for 32bpp-anim blitter was only validated during sprite blitting, other drawing operations didn't check it. Initial startup and window resize could therefore lead to crash. 2010-01-04 02:32:36 +00:00
rubidium d6cded5380 (svn r17693) -Cleanup: remove some unneeded includes 2009-10-04 17:16:41 +00:00
rubidium 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 2009-08-21 20:21:05 +00:00
rubidium 7fb95e2c2b (svn r17228) -Codechange: some coding style fixes 2009-08-20 10:23:39 +00:00
smatz d703f0c3b5 (svn r16628) -Codechange: remove one gcc2 hack 2009-06-22 23:15:27 +00:00
rubidium c0a8d09ca7 (svn r15428) -Codechange: consistently use colour instead of having both color and colour. 2009-02-09 02:57:15 +00:00
smatz 0d3f5e6e74 (svn r15299) -Cleanup: remove many redundant includes 2009-01-31 20:16:06 +00:00
rubidium 200f405706 (svn r14146) -Codechange: allow palette override in both ways and remove some unneeded '(x == 0) ? 0 : 1' constructs. 2008-08-23 20:16:54 +00:00
belugas a2f590aeec (svn r14016) -Codechange: Remove some magical numbers 2008-08-08 02:28:28 +00:00
smatz 1834a2f670 (svn r13640) -Codechange: make colours behind not fully solid objects less darker for BM_TRANSPARENT (for 32bpp blitters) 2008-06-26 16:47:29 +00:00
smatz 114c820c56 (svn r13639) -Codechange: rewrite 32bpp-anim and 32bpp-optimized drawing and encoding so it uses similiar scheme as 8bpp-optimized
All zoom levels are stored and a kind of RLE is used. Together with further changes and reducing number of variables, drawing is ~50% faster in average.
2008-06-26 15:46:19 +00:00
smatz bc12e5453c (svn r13568) -Fix (r13564): Windows build asserts where I wouldn't expect it to 2008-06-18 20:20:12 +00:00
smatz cc2f9187cc (svn r13564) -Codechange: do not use SetPixel in PaletteAnimate, access destination directly instead. Makes palette animation ~40% faster. 2008-06-18 13:11:02 +00:00
rubidium d03994098b (svn r12971) -Documentation: add @file in files that missed them and add something more than whitespace as description of files that don't have a description. 2008-05-06 15:11:33 +00:00
rubidium d4e6a6bf57 (svn r11828) -Codechange: include table/* as the last includes and remove an unneeded include from openttd.h. 2008-01-13 01:21:35 +00:00
frosch cbe7e5d668 (svn r11813) -Fix [FS#1602]: Switch _screen to the output buffer and disable usage of 32bpp-anim animation buffer during giant screenshots. 2008-01-11 17:12:41 +00:00
rubidium bf98e25e43 (svn r11691) -Codechange: move+rename helpers.hpp and only include it when it is really needed. 2007-12-25 09:48:53 +00:00
rubidium a773d45885 (svn r11684) -Codechange: split gfx.h in a type and functional header. 2007-12-23 10:56:02 +00:00
smatz 93c3e0d6ad (svn r11652) -Codechange: add the svn $ header for several files 2007-12-17 01:35:45 +00:00
truelight 1de38b4119 (svn r11083) -Fix r11078: don't clear the anim buffer when alpha = 0 (tnx to frosch) 2007-09-10 14:55:46 +00:00
truelight 8de52c089d (svn r11082) -Fix r11081: save before commit (yeah, whitelines are important too!) 2007-09-10 00:05:27 +00:00
truelight fc80e722cf (svn r11081) -Fix r11080: now solved the problem in a pretty way: don't do animation if we are not drawing to the screen-pointer 2007-09-10 00:03:47 +00:00
truelight ab880fdf07 (svn r11080) -Fix r11079: fix it, still dirty, correctly, as the last commit was ... wrong ;) 2007-09-09 23:57:47 +00:00