Commit Graph

84 Commits

Author SHA1 Message Date
Darkvater
04628a1979 (svn r7565) -Codechange: Rework DEBUG functionality. Look for appropiate debugging levels to
use in debug.h. grfmsg() is now used as a specific debug-function for grf.
2006-12-26 17:36:18 +00:00
peter1138
752c74926b (svn r7242) -Fix: Don't load 1-byte pseudo sprites, as used in some NewGRF sets. If the sprite is ever drawn this will result in a "missing sprite" error instead of undefined misbehaviour leading to segmentation faults... 2006-11-23 21:19:43 +00:00
tron
608e9db825 (svn r6347) Undo 2006-09-02 20:34:33 +00:00
tron
e3d00af21e (svn r6346) -Codechange: Remove redundant assignment 2006-09-02 20:34:04 +00:00
rubidium
908d3bcfe6 (svn r6045) -Cleanup: align all table-like structures using spaces, i.e. whitespace fixes only except for a few comments to make them uniform for the whole enum/struct. 2006-08-22 14:38:37 +00:00
truelight
73cd71db04 (svn r5974) -Codechange: added casts all around the place to make Windows 64bit happy (michi_cc) 2006-08-20 12:09:32 +00:00
peter1138
b514575947 (svn r4481) - Fix: Validate the given sprite ID when loading a sprite. 2006-04-20 05:57:47 +00:00
peter1138
82f38f45d3 (svn r4446) - Add function to determine if a Sprite ID exists. 2006-04-16 11:26:23 +00:00
tron
0b936c3222 (svn r3077) static, const, bracing, indentation, 0 -> '\0'/NULL, typos in comments, excess empty lines, minor other changes
nothing spectacular, just some stuff, which piled up
2005-10-22 06:39:32 +00:00
tron
ab1990e5c0 (svn r2933) Implement the non-breaking space 2005-09-10 08:17:30 +00:00
tron
69f250796f (svn r2868) Change the way NewGRFs are loaded: The loading process i no longer bolted onto the normal graphics loading.
This has two major advantages:
- Removal of a maze of global variables and distinction of cases from the sprite loading routines, which weren't directly related to the loading process in the first place
- NewGRF actions no longer occupy sprite slots - for example when using DBSetXL this saves about 2000 slots! (you could regard this as a bug fix)
If i didn't make a major mistake this change should have no negative effect on NewGRF support, please test!
2005-08-15 11:39:13 +00:00
tron
a7d6b41c6a (svn r2866) Move all functions and tables which aren't directly involved in managing the sprite heap to a new file gfxinit.c.
This doesn't ease the global variable mess, but makes the distinction between sprite heap and gfx loading routines easier.
2005-08-14 18:10:18 +00:00
tron
45b79d7347 (svn r2865) Push the responsibility for allocating the sprite heap into GfxInitSpriteMem() 2005-08-13 21:40:22 +00:00
tron
14900d3e53 (svn r2855) Make ReadSpriteHeaderSkipData() responsible for detecting the end of a grf file instead of its callers - this simplifies the code a bit 2005-08-11 13:09:12 +00:00
tron
bf612cb9e6 (svn r2847) Don't remember the size of sprites during initialisation. Since the sprite loading was altered this is no longer necessary.
While here remove another write-only variable (_spritecache_size) and fix a comment (sprite replaces a lowercase letter instead of uppercase)
2005-08-09 12:58:22 +00:00
tron
eb2dc7ef91 (svn r2845) Remove sprite size caching, it was unused
This makes GetSpriteDimension() superflous, because now it's just a thin wrapper around GetSprite() returning only part of the information, therefore remove it too
2005-08-08 21:35:27 +00:00
tron
cb10eab5fc (svn r2839) Remove stuff missed in r2833, properly calculate the size of two arrays and simplify GetSpriteDimension() a bit 2005-08-08 09:49:47 +00:00
tron
689dc10b13 (svn r2833) Remove saving of sprite cache data:
the benefits are questionable, it's error prone, undocumented and hasn't been widely used for ages, if ever
2005-08-07 17:52:41 +00:00
tron
fd00d317cb (svn r2829) Remove sprite locking, it was never used anyway 2005-08-07 11:01:31 +00:00
bjarni
059ae19626 (svn r2764) -Feature: Clone vehicles
-This allows a player to clone an excisting vehicle of his own
  -[fix]: this uncovered an excisting bug in CmdBuildRailVehicle() where depots could build trains of the wrong track type. This is fixed
  -Thanks to Celestar for drawing the sprites and _luca_ for including them in openttd.grf
2005-07-31 13:08:08 +00:00
celestar
a3739aecdf (svn r2702) -Codechange: Cleaned up the sprite code and replaced many magic numbers
by enums. There remains work in gfx.c to move the "transparency" and
"recolor" bits around to make space for more sprites. However, 2800
additional sprites can now be loaded. There also remains cleanup and
Doxygen work on many of the header files.
2005-07-24 15:56:31 +00:00
tron
647cbd6bdd (svn r2701) Insert Id tags into all source files 2005-07-24 14:12:37 +00:00
tron
54cbd01825 (svn r2673) Include functions.h directly, not globally via openttd.h 2005-07-22 07:02:20 +00:00
tron
71140a5768 (svn r2669) Shuffle some more stuff around to reduce dependencies 2005-07-21 22:15:02 +00:00
Darkvater
b8f1bbbad1 (svn r2652) - CodeChange: show 'too many sprites' in hex value; Patch signed off by Tron 2005-07-20 15:38:11 +00:00
tron
87be1312d2 (svn r2633) Move spritecache related variable from variables.h to spritecache.[ch] 2005-07-19 06:54:13 +00:00
tron
d7c0bf20d2 (svn r2537) Small changes, especially use fprintf to stderr for warnings and errors instead of plain printf 2005-07-09 09:24:34 +00:00
Darkvater
93a3b7e0a1 (svn r2536) - Fix: [ 1215999 ] Segmentation fault in main menu - corrupted sample.cat. Flush the output buffer to print the error message before the game crashes. (mcmohr) 2005-07-09 00:14:40 +00:00
tron
1307f90b5e (svn r2535) Tabs 2005-07-08 22:25:24 +00:00
tron
718a41f517 (svn r2523) Readd a comment which got lost in r2522 2005-07-06 06:18:53 +00:00
tron
784420e706 (svn r2522) Reorganize sprite load and decompression in order to remove a special case from the sprite blitter, which decompressed certain sprites every time when blitting them 2005-07-05 19:54:35 +00:00
Darkvater
ba8c649fac (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files. 2005-06-02 19:30:21 +00:00
Darkvater
8f88693a0d (svn r2349) - Fix: remove warning from release build when assertions are no longer active 2005-05-18 12:53:37 +00:00
Darkvater
e9f8449d55 (svn r2229) - Fix: [ 1188777 ] Non-existing sprite #5125 (presignal). The DOS grf file trgi.grf has 6 less sprites than the windows one. This results in some segfaults for certain sprites. Fixed it by added a dummy grf file consisting ofr 6 sprites and loaded when using DOS gfx at the appropiate place. 2005-04-24 21:44:45 +00:00
pasky
92da198d9a (svn r1941) Report missing NewGRF file as a fatal error. 2005-03-06 13:57:19 +00:00
tron
f13bfccc37 (svn r1893) If -i was specified respect it 2005-02-20 09:05:28 +00:00
tron
4118a32cff (svn r1885) Fix typo in r1884 2005-02-18 08:32:25 +00:00
tron
9f14253baf (svn r1884) Change palette detection algorithm: Use the DOS palette if there are no Windows .grfs but at least one DOS .grf 2005-02-18 08:29:17 +00:00
tron
56a8302642 (svn r1882) Add a basic check if a non-existent sprite gets accessed.
Now ottd bails out with an error message instead of segfaulting.
This is far from perfect, some checks after loading a savegame should be added.
2005-02-17 15:53:47 +00:00
tron
830565514c (svn r1867) Include tables/sprites.h only in files which need it 2005-02-13 11:18:02 +00:00
tron
a011190723 (svn r1865) Fix some warnings 2005-02-13 08:12:03 +00:00
tron
9b0bad683d (svn r1861) Constify Get(Non)Sprite() 2005-02-11 17:12:11 +00:00
tron
832c3fa20d (svn r1859) Miscellaneous style changes 2005-02-11 14:33:43 +00:00
tron
d37f2cdc70 (svn r1858) Let ReadSprite() handle the subtleties of loading a sprite, not its caller 2005-02-11 13:46:25 +00:00
tron
51dd166de0 (svn r1857) Rewrite parts of the sprite heap. It's functionally equivalent but should be easier to read and maintain. 2005-02-11 13:35:27 +00:00
tron
12c7e128a9 (svn r1856) Make GfxInitSpriteMem() static, because it's only used withing spritecache.c 2005-02-10 22:26:28 +00:00
tron
dc54a3e627 (svn r1855) Handle endianness of sprite headers when loading a sprite, not everytime when accessing it 2005-02-10 12:26:41 +00:00
tron
d2703fd672 (svn r1854) Split GetSpritePtr() into GetSprite() for regular sprites (returning a Sprite*) and GetNonSprite() for "sprites" of type 0xFF (returning byte*) 2005-02-10 12:14:38 +00:00
tron
7cd19fe07a (svn r1853) Move spritecache function declarations into a header of their own and use SpriteID as parameter type where appropriate 2005-02-10 05:43:30 +00:00
tron
49a4d014b9 (svn r1852) Start cleaning up sprite handling:
- Complement the sprite header struct with a variable sized array for the sprite data and rename it to Sprite.
- Use the correct type Sprite* instead of casting all the time (this causes some "assignment from incompatible pointer type" warnings, nothing serious, will be resolved soon)
2005-02-08 22:22:42 +00:00