Commit Graph

28 Commits

Author SHA1 Message Date
Peter Nelson 7b717fcccb Codechange: Replace AllocatorProc with SpriteAllocator class.
This allows for state to be passed to or maintained by the allocator.
2024-05-30 20:16:28 +01:00
Patric Stout a3cfd23cf9
Codechange: rename byte to uint8_t (#12308) 2024-03-16 23:59:32 +01: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
rubidium42 cb8612ba79 Remove: ZOOM_LVL_COUNT
This is the only enumeration with a COUNT and END. The logic of the COUNT
implied that BEGIN could be non-zero, but all but two uses of zoom level
assume that BEGIN is zero, making the separate count only confusing.
2023-11-29 21:12:28 -04: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
Patric Stout 199e41c762
Codechange: use default dtor instead of empty (#10826) 2023-05-14 23:31:03 +02:00
Jonathan G Rennison 5e413c9dcd
Fix #9804: Only apply sprite_zoom_min setting when sprites available (#9988)
Only discard sprite zoom levels when a suitable higher zoom level is
defined in the same colour mode

This is to avoid placeholder or empty sprites being used, causing
visual artefacts
2022-09-21 12:37:11 +02:00
Rubidium fdc11a9f94 Codechange: introduce SpriteFile to be used by the sprite loader instead of the global FIO slot functionality 2021-05-08 12:39:34 +02:00
Michael Lutz 70aa3b4011 Codechange: Give sprite encoders a hint which colour components of a sprite are filled with useful information. 2021-02-22 22:16:07 +01:00
Michael Lutz e7e5316340 Add: Allow sprite encoders (blitters) to specify an alignment for sprite width and height. 2021-02-22 22:16:07 +01:00
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
S. D. Cloudt 13cc8a0cee Cleanup: Removed SVN headers 2019-11-10 17:59:20 +00:00
michi_cc 2c3bca6ad9 (svn r23897) -Feature: [NewGRF] 32bpp sprites in GRFs. 2012-02-04 22:18:57 +00:00
michi_cc e85d5b5d31 (svn r23889) -Codechange: Centralise sprite resizing in one place. (peter1138) 2012-02-04 13:29:13 +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
rubidium 5a620d1c65 (svn r22406) -Document: some more "random-ish" tidbits 2011-05-01 19:51:52 +00:00
rubidium eb299736c1 (svn r21886) -Codechange: move documentation towards the code to make it more likely to be updated [n]. 2011-01-22 09:53:15 +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 3ba802e995 (svn r15556) -Change: don't temporary malloc+free when encoding sprites, just reuse the same piece of allocated memory for each encoding. 2009-02-23 17:54:02 +00:00
rubidium 0c1b8ea602 (svn r15555) -Codechange: remove the mallocs + frees for temporary data from loading sprites. 2009-02-23 10:50:25 +00:00
rubidium c8e8911ef6 (svn r14223) -Codechange: make GetSprite aware of the 4 different types of sprites: fonts, recolour, mapgen and normal sprites. 2008-09-02 15:20:38 +00:00
rubidium 5c5ee7eb57 (svn r13301) -Fix [FS#1997]: resolve more MSVC 9 x64 warnings. 2008-05-27 21:41:00 +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
peter1138 ffec79bbcf (svn r11940) -Codechange: Store short filename once per open file instead of once per sprite cache entry. Not all file types need this, but most of the time no sprite cache entry needed it either. 2008-01-22 07:27:06 +00:00
truelight 8cd9ab9b7e (svn r11095) -Codechange: don't abuse 'file_pos' by storing the file_slot in it too, but use a nice seperate variable for it
-Note: on a side-note, this allows files bigger than 16+ MiB, needed for tar-support
2007-09-13 18:22:34 +00:00
truelight b7443d800b (svn r10143) -Add: store the filename of the grfs opened and allow easy access to the name
-Codechange: store the SpriteID in the spritecache too
-Add: add a PNG loader for graphical files
-Documentation: added a document to explain the PNG format
2007-06-13 16:21:11 +00:00
truelight 6b101cc177 (svn r10092) -Codechange: code-seperated the spriteloader and blitter from the rest of the code
-Add: make it possible to pick your own blitter (-b <blitter>, -h for overview)
-Add: added a new optimized 8bpp blitter (default, caches sprites of all zoom-levels)
-Add: added a debug 8bpp blitter and a very slow normal 8bpp blitter
2007-06-11 11:50:49 +00:00