Commit Graph

34 Commits

Author SHA1 Message Date
Peter Nelson a28ab8cac2
Codechange: Replace C-style casts to size_t with static_cast. (#12455)
* Codechange: Replace C-style casts to size_t with static_cast.

This touches only simple value-type casts.

* Codechange: Replace static_cast<size_t>(-1) with SIZE_MAX

Co-authored-by: Rubidium <rubidium@openttd.org>
2024-04-19 20:34:36 +01:00
Peter Nelson 3c94e81665 Codechange: Use ZOOM_LVL_MIN to refer to first zoom level.
Many uses of ZOOM_LVL_NORMAL actually just want the first zoom level slot, so use ZOOM_LVL_MIN to make this clearer.
2024-04-04 22:27:03 +01:00
Peter Nelson 9ce1626bb4 Change: Support custom transparency remaps with 32bpp blitters.
This closes a 15 year old TODO...
2023-12-25 11:22:52 +00:00
Peter Nelson b85ecf9ac2
Codechange: Replace pointer to Sprite array with reference to SpriteCollection. (#11580)
Add `SpriteLoader::SpriteCollection` type which is an array of `SpriteLoad::Sprite`.

This removes the ambiguity of what `SpriteLoader::Sprite *` is pointing to,
and cleans up mismatches using both dereference -> and array access [] for the
same object.
2023-12-20 20:38:21 +00:00
Rubidium eaae0bb5e7 Codechange: automatic adding of _t to (u)int types, and WChar to char32_t
for i in `find src -type f|grep -v 3rdparty/fmt|grep -v 3rdparty/catch2|grep -v 3rdparty/opengl|grep -v stdafx.h`; do sed 's/uint16& /uint16 \&/g;s/int8\([ >*),;[]\)/int8_t\1/g;s/int16\([ >*),;[]\)/int16_t\1/g;s/int32\([ >*),;[]\)/int32_t\1/g;s/int64\([ >*),;[]\)/int64_t\1/g;s/ uint32(/ uint32_t(/g;s/_uint8_t/_uint8/;s/Uint8_t/Uint8/;s/ft_int64_t/ft_int64/g;s/uint64$/uint64_t/;s/WChar/char32_t/g;s/char32_t char32_t/char32_t WChar/' -i $i; done
2023-07-19 19:30:14 +02:00
rubidium42 55a11710a6 Codechange: convert printf DEBUG statements to fmt Debug statements 2021-06-13 12:45:45 +02:00
Charles Pigott 9b800a96ed
Codechange: Remove min/max functions in favour of STL variants (#8502) 2021-01-08 11:16:18 +01:00
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +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 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 f817b06c18 (svn r26103) -Fix: prevent odd overflows due to integer promotion 2013-11-25 13:06:33 +00:00
frosch 640d39c001 (svn r25820) -Codechange: More const-ness. 2013-10-06 19:38:36 +00:00
rubidium 54e36c4ff8 (svn r24111) -Codechange: use Colour more instead of manually bitstuffing 2012-04-10 20:16:51 +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
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 3d1008318b (svn r21782) -Codechange: Move declaration of AllocatorProc from Blitter:: to spritecache.h 2011-01-14 15:34:33 +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 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 2009-08-21 20:21:05 +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 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
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 89bdfaacd9 (svn r11076) -Fix: MakeTransparent of 32bpp blitter used 0..100; using 0..255 makes it much faster (frosch)
-Fix: ComposeColourXXX could work a tiny bit faster when using 256, not 255 as value to divide with; downside is that it can give alpha errors (frosch)
2007-09-09 21:56:52 +00:00
truelight 2a6b7e4e02 (svn r10225) -Codechange: move common Colour routines for 32bpp to the base class (and nick it colour, not color) 2007-06-19 17:32:01 +00:00
truelight 9ad02c11c6 (svn r10215) -Fix r10214: forgot 2 cases of the same mistake 2007-06-19 12:19:31 +00:00
truelight 003375d375 (svn r10190) -Codechange: merged renderer and blitter to one single class API: blitter
-Codechange: introduced a hierachy of blitters to avoid a lot of code duplication
 Note: this allows much easier adding other types of video-drivers, like OpenGL
2007-06-17 20:30:28 +00:00
truelight 4185c4afcd (svn r10142) -Fix r10132: do something useful with the alpha channel instead of ignoring it 2007-06-13 16:04:35 +00:00
truelight e7221d1fa9 (svn r10132) -Codechange: split out the last direct video-buffer read access to the blitter-layer
-Add: added a new renderer and blitter to make room for some optimized bpp
-Fix: fill the alpha channel in the grf-spriteloader
2007-06-13 10:31:40 +00:00