Commit Graph

248 Commits

Author SHA1 Message Date
Michael Lutz 02e8741457 Codechange: Allow for using a sprite encoder that is not the currently active blitter when loading a sprite. 2021-02-22 22:16:07 +01:00
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
Charles Pigott 860c270c73 Codechange: Replace assert_compile macro with static_assert 2020-12-27 10:55:42 +00:00
Charles Pigott 348c231e12 Codechange: Make codestyle for CMake files consistent for 'control' statements 2020-09-25 14:43:13 +01:00
Patric Stout 56d54cf60e Add: introduce CMake for project management
CMake works on all our supported platforms, like MSVC, Mingw, GCC,
Clang, and many more. It allows for a single way of doing things,
so no longer we need shell scripts and vbs scripts to work on all
our supported platforms.

Additionally, CMake allows to generate project files for like MSVC,
KDevelop, etc.

This heavily reduces the lines of code we need to support multiple
platforms from a project perspective.

Addtiionally, this heavily improves our detection of libraries, etc.
2020-06-05 19:36:05 +02:00
Michael Lutz 37bc2f8064 Codechange: Use std::string in the driver and blitter selection code. 2020-05-21 20:02:34 +02:00
Michael Lutz 9dd8b3d430 Remove: [OSX] Stuff that is pre-10.7 from the Cocoa/Quartz video driver. 2020-04-12 18:44:43 +02:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
JMcKiern 04f659e768 Fix: Some typos found using codespell 2019-09-29 21:27:32 +01:00
glx22 2ed88d6898
Fix: inconsistent description for 32bpp-sse4-anim blitter (#7740) 2019-09-14 16:52:35 +02:00
Henry Wilson 7c8e7c6b6e Codechange: Use null pointer literal instead of the NULL macro 2019-04-10 23:22:20 +02:00
Henry Wilson af7d9020a1 Codechange: Use override specifer for overriding member declarations
This is a C++11 feature that allows the compiler to check that a virtual
member declaration overrides a base-class member with the same signature.

Also src/blitter/32bpp_anim_sse4.hpp +38 is no longer erroneously marked
as virtual despite being a template.
2019-03-24 16:10:04 +01:00
Jonathan G Rennison 4b256fed36 Codechange: [Blitter] Adjust line-drawing algorithm to reduce wasted off-screen work
This clips the line segment to be within the screen area prior to pixel iteration.
2019-01-24 11:12:06 +00:00
Jonathan G Rennison 0240e90169 Fix: [Blitter] Avoid signed overflow when drawing long lines 2019-01-24 11:12:06 +00: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 f5b1115039 Doc: Lots and lots of doxymentation fixes 2018-10-31 12:35:54 +01: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
Michael Lutz 74b7f0a9aa Fix: [OSX] Remove some OSX compiler warnings on newer SDKs/compilers. 2018-04-10 23:30:01 +02:00
peter1138 86430757bf (svn r27837) -Fix (r26969): Black remap did nothing in 8bpp-simple blitter. 2017-03-30 21:33:40 +00: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 d5f82bf55b (svn r27774) -Fix [FS#5889]: Enabling palette animation for 32bpp blitters while paused skipped initialisation of the palette and resulted in black windows.
-Revert (r23978): No SDL-specific fix required anymore. The new fix applies to all backends.
2017-03-11 12:52:26 +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 d534c80e94 (svn r27020) -Cleanup: some coding style consistency improvements (mostly spaces) 2014-10-15 18:31:37 +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 9ed12b0f07 (svn r26509) -Codechange: replace strdup with stredup (the latter ensures the return is not NULL) 2014-04-25 15:40:32 +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
rubidium c8fffcd5ce (svn r26473) -Fix: make sure there is no uninitialised sprite data; the other blitters cleared the memory too 2014-04-20 14:55:28 +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
frosch cb7544ea39 (svn r26334) -Fix: 32bit compilation. 2014-02-11 21:17:43 +00:00
rubidium ef9108bd58 (svn r26260) -Codechange: add template parameters for (non) translucent and (non) animated sprites, so the least expensive variant can be chosen (MJP) 2014-01-13 18:20:23 +00:00
rubidium eb2c2ef877 (svn r26259) -Codechange: add and maintain some general flags about sprites to prevent unneeded execution of expensive code (MJP) 2014-01-13 18:17:17 +00:00
rubidium fdf55a1a48 (svn r26258) -Codechange: deduplicate Draw methods (MJP) 2014-01-13 18:12:33 +00:00
rubidium f5f4f8a4b3 (svn r26257) -Codechange: replace most of the SSE macros by functions 2014-01-13 18:09:21 +00:00
rubidium 3a44e22b1a (svn r26256) -Codechange: do not load some data when it is not (often) used later on (MJP) 2014-01-13 18:06:53 +00:00
rubidium 70901e04c5 (svn r26255) -Codechange: improve performance of brightness adjustment (MJP) 2014-01-13 18:05:47 +00:00
rubidium 2f7c4f6d12 (svn r26254) -Codechange: MOVD is better in some cases than PINSRD (MJP) 2014-01-13 18:04:28 +00:00
rubidium 5b3b533697 (svn r26253) -Codechange: remove margin limitation to preserve block type (MJP) 2014-01-13 18:03:35 +00:00
rubidium 7f6e837b3a (svn r26252) -Codechange: deduplicate code for margin case (MJP) 2014-01-13 18:02:20 +00:00
rubidium 9a90bed79b (svn r26251) -Codechange: prepare Draw code for code deduplication (MJP) 2014-01-13 18:00:18 +00:00
rubidium 6e34672c6c (svn r26250) -Codechange: deduplicate darkening (e.g. shadow) code (MJP) 2014-01-13 17:58:58 +00:00
rubidium 76661f2c56 (svn r26249) -Codechange: simplify/cleanup ALPHA_BLEND macro (MJP) 2014-01-13 17:57:30 +00:00
rubidium 31c6e33878 (svn r26248) -Fix (r26223): missed compiler warning (MJP) 2014-01-13 17:55:34 +00:00
rubidium a942619911 (svn r26247) -Fix [FS#5854, FS#5855]: Possible out of bounds reads with the sse blitters (MJP) 2014-01-13 17:54:24 +00:00
planetmaker 7b20da8a0a (svn r26223) -Codechange: Silence some compile warnings about unititialized variables in the SSE blitters (MJP) 2014-01-03 18:43:10 +00:00
rubidium 115c712f4e (svn r26222) -Codechange: use SSE instructions for transparent colour "remap" in the SSE2/SSSE3 blitters as well 2014-01-03 18:03:14 +00:00
rubidium 613fb9c6ef (svn r26221) -Codechange: normalize constant names in anim-sse4 with the others (MJP) 2014-01-03 17:55:40 +00:00
rubidium 1e1656110a (svn r26215) -Codechange: rework code so one can test if a blitter factory exists before attempting trying to instantiate an instance 2014-01-03 08:29:07 +00:00
rubidium 4c84d13454 (svn r26214) -Add: specialised animated SSE4 blitter (MJP)
With 32bpp base set about 15-20% faster in the Draw function (slower with 8bpp base set). Overall, with 32bpp base set, about 5% faster.
2014-01-02 23:52:13 +00:00
rubidium 78df732a7b (svn r26213) -Add: specialised non-animated SSE4 blitter (MJP)
With 32bpp base set about 40% faster than 32bpp-optimized, or about 10% for 8bpp base sets in the Draw function. Respectively about 8 and 1% of total run time
2014-01-02 23:21:07 +00:00
rubidium 71a81a8762 (svn r26212) -Add: specialised non-animated SSSE3 blitter (MJP)
With 32bpp base set about 35% faster than 32bpp-optimized, or about 10% for 8bpp base sets in the Draw function. Respectively about 6 and 1% of total run time
2014-01-02 23:17:01 +00:00
rubidium fb05674cb7 (svn r26211) -Add: specialised non-animated SS2 blitter (MJP)
With 32bpp base set about 30% faster than 32bpp-optimized, or about 10% for 8bpp base sets in the Draw function. Respectively about 5 and 1% of total run time
2014-01-02 23:12:32 +00:00
rubidium 899c0f9cd2 (svn r26210) -Codechange: add infrastructure for not registering a blitter 2014-01-02 22:48:32 +00:00
rubidium 2618d960e3 (svn r26209) -Codechange: remove some template magic and simplify some code 2014-01-02 22:41:58 +00:00
rubidium defda16eb6 (svn r26108) -Codechange: some coding style (whitespace) 2013-11-25 14:30:22 +00:00
rubidium f817b06c18 (svn r26103) -Fix: prevent odd overflows due to integer promotion 2013-11-25 13:06:33 +00:00
rubidium 14b8f6e594 (svn r25958) -Fix: overriding method of DrawLine was not updated when parameters were added making it non-functional 2013-11-09 06:48:15 +00:00
fonsinchen 89b7afbac8 (svn r25911) -Add: Support for drawing dashed lines. 2013-10-23 19:41:20 +00:00
frosch 640d39c001 (svn r25820) -Codechange: More const-ness. 2013-10-06 19:38:36 +00:00
planetmaker c24374f99c (svn r24900) -Fix [FS#5389]: Comments with typos (most fixes supplied by Eagle_rainbow) 2013-01-08 22:46:42 +00:00
frosch e4416d6a0c (svn r24610) -Change: [NewGRF] Set the reference brightness of 32bpp mask recolouring to 128. 2012-10-17 20:21:43 +00:00
rubidium 54e36c4ff8 (svn r24111) -Codechange: use Colour more instead of manually bitstuffing 2012-04-10 20:16:51 +00:00
frosch 058017e178 (svn r23989) -Fix-ish: Zero the offsets of disabled zoomlevels. 2012-02-25 17:39:34 +00:00
frosch dac51654fe (svn r23988) -Fix: Typo in comment. 2012-02-25 17:22:57 +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
michi_cc e85d5b5d31 (svn r23889) -Codechange: Centralise sprite resizing in one place. (peter1138) 2012-02-04 13:29:13 +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 2aa6086256 (svn r23729) -Fix (r23670) [FS#4941]: if you increase the buffer size, also increase the bytes per pixel 2012-01-03 10:50:06 +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
michi_cc 47171c7829 (svn r23674) -Fix (r23670): Don't read invalid memory in the 32bpp simple blitter. 2011-12-26 14:53:19 +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
smatz 33d283fdb1 (svn r23588) -Codechange: use the 'final' keyword so compiler can optimise out some indirect calls 2011-12-18 17:17:18 +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 2ccbd2a6f5 (svn r23446) -Codechange: move _cur_palette and it's related first/count dirty variables into a single structure 2011-12-08 18:13:29 +00:00
frosch f8478cecb3 (svn r23343) -Fix (r23332): Incorrect encoding of sprites with much transparency. 2011-11-27 14:53:05 +00:00
peter1138 cd6249dfc5 (svn r23332) -Fix (r23316): Length of transparent pixels could exceed a byte. (frosch) 2011-11-26 13:36:38 +00:00
peter1138 15d0a22aac (svn r23315) -Codechange: Only encode sprites for zoom levels that will be used. 2011-11-24 12:26:44 +00:00
truebrain ecbe29ecb7 (svn r23311) -Remove: removed the silly blitter called 8bpp-debug. You can find him at the same place as you can find CTRL+D. Sorry for those who liked to trip while playing OpenTTD; I truly am sorry :D 2011-11-23 19:36:11 +00:00
rubidium 7fd1e1df81 (svn r23198) -Codechange: introduce a free that takes const pointers so we don't need to cast to void/non-const before being able to free 2011-11-12 13:00:29 +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
michi_cc c575b5bbd7 (svn r23000) -Feature: Base graphics sets can now specify a preferred blitter which OpenTTD uses to decide which blitter to load. 2011-10-04 21:35:47 +00:00
frosch b7c6424104 (svn r22439) -Fix (r22291, r22426): Drawing lines of length zero failed. 2011-05-08 18:20:21 +00:00
frosch f976cddcba (svn r22426) -Fix (r22291): Drawing vertical and horizontal lines of width 1 missed drawing the first pixel. 2011-05-05 20:20:52 +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
frosch ecb3701210 (svn r22302) -Codechange: Replace a linear search with a binary search. 2011-04-09 11:32:11 +00:00
frosch b18211bb9d (svn r22291) -Add: a linewidth argument to GfxDrawLine() and Blitter::DrawLine(). 2011-04-02 16:39:30 +00:00
frosch 7659575cfa (svn r22290) -Codechange: Somewhat deduplicate one line of code. 2011-04-02 15:07:58 +00:00
frosch 004c93f9da (svn r22288) -Codechange: Deduplicate Blitter_8bppBase::DrawLine() and Blitter_32bppBase::DrawLine() into Blitter::DrawLine(). 2011-04-02 11:55:54 +00:00
rubidium 7eba2bf4d3 (svn r21890) -Cleanup: remove some unneeded includes 2011-01-22 14:52:20 +00:00
frosch 3d1008318b (svn r21782) -Codechange: Move declaration of AllocatorProc from Blitter:: to spritecache.h 2011-01-14 15:34:33 +00:00
rubidium e356cb9405 (svn r20281) -Codechange: unify case scope closure + break coding style 2010-08-01 18:53:30 +00:00
alberth 33a96b5ef3 (svn r19132) -Codechange: No need to end a line with ;;. 2010-02-14 16:31:35 +00:00
yexo 6406b75b8f (svn r19094) -Codechange: don't check for NULL values before calling StrEmpty 2010-02-11 14:58:51 +00:00
alberth b2f9b0ac43 (svn r18907) -Cleanup: Smallmap was the last user of SetPixelIfEmpty(). 2010-01-23 22:37:14 +00:00