Commit Graph

148 Commits

Author SHA1 Message Date
frosch e428952110 (svn r24828) -Change: For dedicated servers without blitter ignore the spritecache size setting and always use the minimum. 2012-12-19 19:31:18 +00:00
frosch d351f3dae5 (svn r24252) -Fix [FS#5162]: Change the unit of the sprite-cache size setting from megabytes to megapixels, so it depends on the blitter being used. Also increase it from 64 to 128, and change the name in the cfg file, so everyone gets the new default. 2012-05-15 20:37:42 +00:00
frosch 3d381403a8 (svn r23986) -Fix (r23889): Invalid reads when scaling an odd-sized sprite smaller. 2012-02-25 17:18:17 +00:00
michi_cc 0aecd1fa7b (svn r23976) -Fix (r23889): Sprites of different zoom levels were not always padded correctly to a common size. 2012-02-23 12:13:30 +00:00
michi_cc 44abdccfd0 (svn r23898) -Remove: PNG sprite loader. 2012-02-04 22:19:02 +00:00
michi_cc 2c3bca6ad9 (svn r23897) -Feature: [NewGRF] 32bpp sprites in GRFs. 2012-02-04 22:18:57 +00:00
michi_cc bd3c507910 (svn r23896) -Fix (r23884): Don't free unallocated memory. 2012-02-04 22:14:21 +00:00
michi_cc e85d5b5d31 (svn r23889) -Codechange: Centralise sprite resizing in one place. (peter1138) 2012-02-04 13:29:13 +00:00
michi_cc 6db39410a1 (svn r23887) -Feature: [NewGRF] Support for container version 2. 2012-02-04 13:29:04 +00:00
michi_cc 02d07e68d8 (svn r23885) -Codechange: Use the GRF sprite loader for then mapgen sprites as well. 2012-02-04 13:28:56 +00:00
michi_cc 76cfbb257c (svn r23884) -Codechange: Store recolour sprites in memory directly during GRF loading. 2012-02-04 13:28:52 +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
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
frosch 93ae848b0a (svn r21788) -Codechange: Enable GetRawSprite() to also load sprites not using the spritecache but a custom allocator function. 2011-01-14 16:36:34 +00:00
frosch 6cb017456a (svn r21787) -Codechange: Pass the allocator function to use to ReadSprite(). 2011-01-14 16:28:23 +00:00
frosch d811238dd0 (svn r21785) -Codechange: Make ReadSprite() not operate on the sprite chache directly. 2011-01-14 16:16:33 +00:00
frosch ee67d10c80 (svn r21783) -Cleanup (r14997): Remove redundant assignment. 2011-01-14 16:09:51 +00:00
frosch 4bd32799f1 (svn r20286) -Codechange: Unify end of doxygen comments. 2010-08-01 19:44:49 +00:00
frosch ed4f806f1d (svn r20283) -Codechange: Unify start of doygen comments. 2010-08-01 19:22:34 +00:00
terkhen 88ca183191 (svn r20239) -Doc: Give a common name to all fall throughs (FALL THROUGH). 2010-07-29 14:26:28 +00:00
rubidium c72e2dde60 (svn r19723) -Add: a simple sprite alignment helper. It does not store the new offsets anywhere so as soon as the sprite is reloaded the offsets are gone (use a bigger sprite cache if this happens). Also anything that reloads NewGRFs (new games, loading games or (re)applying NewGRFs) clears the sprite cache and as such resets the offsets. 2010-04-25 16:27:30 +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 860b9b1cea (svn r18028) -Codechange: unglobalise some functions 2009-11-09 10:40:33 +00:00
rubidium d6cded5380 (svn r17693) -Cleanup: remove some unneeded includes 2009-10-04 17:16:41 +00:00
smatz 114d48e492 (svn r17596) -Codechange: constify some tables 2009-09-20 23:11:01 +00:00
rubidium ca91a97826 (svn r17579) -Fix: remove doxygen docs for removed parameters, or change @param to @tparam if necessary 2009-09-19 15:17:47 +00:00
rubidium e8ddf001c8 (svn r17570) -Fix: a number of Doxygen warnings about missing parameters, which were sometimes missing and sometimes just typos 2009-09-19 09:51:14 +00:00
rubidium 7fbc33dae1 (svn r17248) -Fix: add GPL license notice where appropriate 2009-08-21 20:21:05 +00:00
smatz c03ce4b1c7 (svn r16492) -Remove: support for gcc2. It hasn't been able to compile OTTD for months. All attempts to do another workaround failed. 2009-06-01 11:49:46 +00:00
rubidium 0d99b6c71c (svn r16421) -Codechange: do not unnecessarily remove constness or unnecessarily add it. 2009-05-24 20:29:04 +00:00
smatz b7d065ce99 (svn r16415) -Fix (r13008): some 64bit architectures require size_t to be aligned at 8-byte boundary, ensure it for MemBlock 2009-05-24 16:28:33 +00:00
smatz f5316c5cbd (svn r16269) -Codechange: use gcc's ability to check parameters sent to printf-like functions
-Fix: wrong number of parameters or wrong parameter types sent to printf-like functions at several places
2009-05-10 17:27:25 +00:00
rubidium 9fd7774235 (svn r15767) -Fix: infinite loop when skipping sprites when a GRF is invalid (or truncated). 2009-03-19 17:58:25 +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 c0a8d09ca7 (svn r15428) -Codechange: consistently use colour instead of having both color and colour. 2009-02-09 02:57:15 +00:00
rubidium bab7367a59 (svn r15391) -Fix (r14997): loading font sprites should not trigger a palette conversion. 2009-02-07 02:29:08 +00:00
smatz 0d3f5e6e74 (svn r15299) -Cleanup: remove many redundant includes 2009-01-31 20:16:06 +00:00
smatz 16dfe58e4d (svn r15031) -Fix (r15027): merge reverted r15026, so do it once again 2009-01-12 17:31:43 +00:00
truebrain a3dd7506d3 (svn r15027) -Merge: tomatos and bananas left to be, here is NoAI for all to see.
NoAI is an API (a framework) to build your own AIs in. See:
   http://wiki.openttd.org/wiki/index.php/AI:Main_Page
 With many thanks to:
  - glx and Rubidium for their syncing, feedback and hard work
  - Yexo for his feedback, patches, and AIs which tested the system very deep
  - Morloth for his feedback and patches
  - TJIP for hosting a challenge which kept NoAI on track
  - All AI authors for testing our AI API, and all other people who helped in one way or another
-Remove: all old AIs and their cheats/hacks
2009-01-12 17:11:45 +00:00
smatz 9294f96168 (svn r15026) -Codechange: use SpriteTypeByte instead of SpriteType in the SpriteCache struct in order to make it smaller 2009-01-12 16:53:11 +00:00
smatz 1287fddd8f (svn r14998) -Codechange: warn once about misuse of each sprite, not once about misuse of any sprite 2009-01-11 23:49:51 +00:00
smatz 720eedf7c5 (svn r14997) -Fix [FS#2524](r14223): when handling invalid sprites, entry in spritecache data could lose its parent 2009-01-11 22:28:30 +00:00
rubidium 11da45ee55 (svn r14949) -Cleanup: pointer coding style 2009-01-10 00:31:47 +00:00
rubidium 2277a1ff9c (svn r14610) -Fix [FS#2415]: possible stack corruption when reading corrupted sprites.
-Change: harden the sprite reading routine against corrupt sprites.
2008-11-23 13:42:05 +00:00
rubidium 272b2ef0e9 (svn r14464) -Codechange: replace (uint)-1 with UINT_MAX (PhilSophus) 2008-10-14 18:38:51 +00:00
rubidium fc216aeeb8 (svn r14229) -Feature: allow overriding the palette of the base GRFs. This way you can play with NewGRFs made for the Windows palette with the DOS palettes base GRFs (and vice versa). Note that for this to work correctly ALL NewGRFs must use the same palette; mix and match is not yet supported. 2008-09-02 18:45:15 +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 886c8ec79f (svn r14214) -Codechange: move another TTD graphics bug into the GRF; height problem of sprite #142. 2008-08-31 23:12:57 +00:00
rubidium ea1f180a55 (svn r14199) -Codechange: split fileio.h into fileio_type.h and fileio_func.h so not everything that includes saveload.h needs to include everything else too. 2008-08-31 10:50:05 +00:00
rubidium 0b88f0cf54 (svn r14193) -Fix (r14191): don't put an unsigned 0x80 in a signed int8 as that's not what you want. 2008-08-30 12:14:56 +00:00
rubidium d3d34d2aac (svn r14191) -Codechange: unify the code to skip sprite payload (i.e. not the header).
-Fix: sprite payload skipping wouldn't skip enough bytes in a very small subset of compressed sprites.
2008-08-30 09:46:52 +00:00
rubidium ef6e366c08 (svn r13869) -Fix [FS#2153] (r13674): in some cases the sprite cache could be filled with unremovable items. 2008-07-29 21:45:30 +00:00
rubidium 56379fff51 (svn r13692) -Fix (r13674): loading PNG sprites could very quickly fill the sprite cache. 2008-07-12 14:03:36 +00:00
rubidium 173f0f4cd5 (svn r13674) -Fix [FS#2127]: crash when drawing a non-real sprite. The drawing of the non-real sprite is caused when two NewGRFs replace the same sprite and the first replaces it with a real sprite (and thus assumes it remains a real sprite) and the second replaces it with a non-real sprite. OpenTTD already looked at whether the sprite to load should be seen as a real or non-real sprite, but it failed to replace non-real sprites with a substitute real sprite when getting the sprite from the cache. 2008-07-04 14:45:51 +00:00
glx ee256e770a (svn r13390) -Codechange: introduce usererror() for fatal but not openttd related errors. Now all error() will 'crash' openttd after showing the message in win32 releases (MSVC), creating a crash.log and crash.dmp (like the '!' hack used before). On the other hand, usererror() will just close the game. So use error() only when it can be helpful to debugging, else use usererror(). 2008-06-05 20:54:52 +00:00
rubidium 5c5ee7eb57 (svn r13301) -Fix [FS#1997]: resolve more MSVC 9 x64 warnings. 2008-05-27 21:41:00 +00:00
glx e48a351f8e (svn r13008) -Fix [FS#1997]: silence some MSVC x64 warnings 2008-05-08 13:20:54 +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 f9e7b70f91 (svn r12436) -Cleanup: minor coding style 2008-03-26 19:18:30 +00:00
belugas 739b118c6b (svn r12140) -Codechange: A bit of code style fixes(Geektoo). 2008-02-14 15:13:36 +00:00
rubidium c9a9103566 (svn r12005) -Fix [FS#1717]: possible reading from an invalid pointer. Patch by PhilSophus. 2008-01-29 00:29:28 +00:00
peter1138 1a9b741e43 (svn r12002) -Cleanup (r11981): Remove obsolete code to skip sprites from indexed GRFs. 2008-01-28 17:51:45 +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
rubidium 9444eb4484 (svn r11939) -Codechange: some type fixes and very initial steps into supporting NDS by default. Based on work by Dominik. 2008-01-21 23:55:57 +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 a3ccdcea36 (svn r11777) -Codechange: split the string header and make do not include it when it's not necessary. 2008-01-07 14:23:25 +00:00
rubidium 429521a7d1 (svn r11692) -Codechange: move some functions from 'functions.h' to a more logical place and remove about 50% of the includes of 'functions.h' 2007-12-25 11:26:07 +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 01e20c9140 (svn r11674) -Codechange: refactor some functions out of macros.h into more logical locations. 2007-12-21 19:21:21 +00:00
glx b47bce651e (svn r11600) -Cleanup: remove extra out-of-memory checks, since it's now done in *allocT functions. 2007-12-08 15:47:23 +00:00
rubidium f1e4914b5f (svn r11597) -Change: replace all remaining instances of (re|m|c)alloc with (Re|M|C)allocT and add a check for out-of-memory situations to the *allocT functions. 2007-12-08 14:50:41 +00:00
skidd13 58bb5c7525 (svn r11480) -Codechange: Rename the function ALIGN fitting to the naming style
This fixes also FS#1450
2007-11-19 20:40:14 +00:00
truelight d5171df2df (svn r11101) -Fix r11099: the check: file_pos == 0, no longer works; adjust the check with file_slot. This solves the ? sprites with autorail (nice catch Progman) 2007-09-13 22:48:11 +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
rubidium ffffde515f (svn r10356) -Fix (r10143): another memory leak eliminated. 2007-06-27 16:54:50 +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 144035bf5c (svn r10157) -Fix: use as indentified for PNGs, the place of the image as it was in the grf, not the internal SpriteID 2007-06-14 14:31:48 +00:00
truelight ab6883bc19 (svn r10150) -Fix r10148: show a message to users when using 32bpp blitter and no libpng available 2007-06-13 19:34:33 +00:00
truelight 79817428b1 (svn r10149) -Fix r10143: MSVC warnings... (tnx boekabart and glx) 2007-06-13 19:05:42 +00:00
truelight 4b51ea375b (svn r10148) -Fix r10143: make --without-png to compile again 2007-06-13 18:52:06 +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
rubidium be0539cb43 (svn r10109) -Fix [FS#838]: some NewGRFs use the same (unused in the "current" climate) sprite IDs. Normally this gives some artefacts, but when one NewGRF expects it to be a sprite and another NewGRF overwrites it with a non-sprite nasty things happen (drawing a non-sprite crashes OTTD). 2007-06-12 09:40:50 +00:00
truelight d0250f6108 (svn r10105) -Fix r10092: fix sprite 4845 till 4881 (inclusive), so they store the data as on the disk in the memory, as the old landscape generate assumes this. Talking about ugly hacks... 2007-06-11 18:49:55 +00:00
truelight be0f5cf877 (svn r10096) -Fix r10092: freetype bypassed the Blitter::Encode, making fonts look weird 2007-06-11 13:38: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
peter1138 4403d41934 (svn r10042) -Codechange: Replace hardcoded spritecache size with a configuration
option, sprite_cache_size. The default size is 2MB and the value can 
range from 1 to 64MB. If you experience slow-downs when scrolling the 
map, try increasing this setting.
2007-06-05 10:40:29 +00:00
peter1138 18b98ad6aa (svn r10038) -Fix (r8634): Sprite resulting from '?' substitution was reloaded into the cache entry for SPR_IMG_QUERY instead of the original sprite cache entry. This resulted in unaccounted missing sprite cache memory, and was exacerbated because the original missing sprite was not cached, so it did it again and again and again. Slowdowns and boom. Etc. 2007-06-04 20:42:49 +00:00
belugas 607a55f4ec (svn r9662) -Documentation: Doxygen corrections and @file omissions 2007-04-17 20:23:13 +00:00
belugas dfe5533db6 (svn r9556) -Documentation: doxygen and comment-style changes. 'R', 'S'.. The end of the preliminary work is near 2007-04-04 01:35:16 +00:00
rubidium 24c4d5b06d (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {}; 2007-03-07 12:11:48 +00:00
rubidium 36bb92ae24 (svn r9050) -Codechange: Foo(void) -> Foo() 2007-03-07 11:47:46 +00:00
rubidium ea55a04b69 (svn r8634) -Codechange: replace missing sprites with a red question mark. 2007-02-08 14:02:12 +00:00
Darkvater 653290c76a (svn r8218) -Codechange: Increase spritecache size to 2MB. This will vastly improve performance when using (lots of) grf files. You can change it yourself easily with the SPRITE_CACHE_SIZE compile flag. (peter1138). 2007-01-17 23:25:19 +00:00
peter1138 f19b87df08 (svn r8166) -Fix (r7797): Protect against out of bounds access to the sprite ptr
list.
2007-01-16 22:10:35 +00:00
KUDr 33be1ecfb1 (svn r8066) - Codechange: MallocT(), CallocT(), ReallocT() now return the pointer to allocated memory instead of modifying the pointer given as parameter 2007-01-11 17:29:39 +00:00
rubidium f35ed4bbc2 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b. 2007-01-10 18:56:51 +00:00
KUDr e373ea7096 (svn r8033) [cpp] - Prepare for merge from branches/cpp (all .c files renamed to .cpp) 2007-01-10 18:12:09 +00:00
Renamed from src/spritecache.c (Browse further)