src/gfxinit.cpp
author celestar
Tue, 19 Jun 2007 07:21:01 +0000
branchgamebalance
changeset 9913 e79cd19772dd
parent 9912 1ac8aac92385
permissions -rw-r--r--
(svn r10213) [gamebalance] -Sync: r10100:10200 from trunk
2186
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2163
diff changeset
     1
/* $Id$ */
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2163
diff changeset
     2
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
     3
/** @file gfxinit.cpp */
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
     4
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     5
#include "stdafx.h"
1891
92a3b0aa0946 (svn r2397) - CodeChange: rename all "ttd" files to "openttd" files.
Darkvater
parents: 1844
diff changeset
     6
#include "openttd.h"
1299
0a6510cc889b (svn r1803) Move debugging stuff into files of it's own
tron
parents: 1250
diff changeset
     7
#include "debug.h"
2163
637ec3c361f5 (svn r2673) Include functions.h directly, not globally via openttd.h
tron
parents: 2159
diff changeset
     8
#include "functions.h"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     9
#include "gfx.h"
2340
0a9f3eeccb96 (svn r2866) Move all functions and tables which aren't directly involved in managing the sprite heap to a new file gfxinit.c.
tron
parents: 2339
diff changeset
    10
#include "gfxinit.h"
1349
07514c2cc6d1 (svn r1853) Move spritecache function declarations into a header of their own and use SpriteID as parameter type where appropriate
tron
parents: 1348
diff changeset
    11
#include "spritecache.h"
1363
01d3de5d8039 (svn r1867) Include tables/sprites.h only in files which need it
tron
parents: 1361
diff changeset
    12
#include "table/sprites.h"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    13
#include "fileio.h"
4200
a45420ba0c23 (svn r5684) - Codechange: create an strtolower() function that uses tolower() on a whole string and apply it in the places this was used.
Darkvater
parents: 4059
diff changeset
    14
#include "string.h"
463
91bcad840bcd (svn r687) Export InitNewGRFFile() and DecodeSpecialSprite() properly.
pasky
parents: 452
diff changeset
    15
#include "newgrf.h"
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
    16
#include "md5.h"
2159
3b634157c3b2 (svn r2669) Shuffle some more stuff around to reduce dependencies
tron
parents: 2142
diff changeset
    17
#include "variables.h"
5156
5edaa8f9b295 (svn r7254) -Fix (r7250): move unicode glyph map initialisation to just before newgrf files are loaded, else newgrf glyphs will be cleared out too. (thanks Hadez)
peter1138
parents: 5151
diff changeset
    18
#include "fontcache.h"
4472
745f9ebe2216 (svn r6257) Use memcmp() to check the MD5 sum instead of using a home brewed loop
tron
parents: 4209
diff changeset
    19
#include <string.h>
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    20
9895
7bd07f43b0e3 (svn r9321) [gamebalance] -Sync: r9025:9314 from trunk
celestar
parents: 6505
diff changeset
    21
struct MD5File {
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
    22
	const char * filename;     ///< filename
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
    23
	md5_byte_t hash[16];       ///< md5 sum of the file
9895
7bd07f43b0e3 (svn r9321) [gamebalance] -Sync: r9025:9314 from trunk
celestar
parents: 6505
diff changeset
    24
};
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
    25
9895
7bd07f43b0e3 (svn r9321) [gamebalance] -Sync: r9025:9314 from trunk
celestar
parents: 6505
diff changeset
    26
struct FileList {
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
    27
	MD5File basic[4];          ///< grf files that always have to be loaded
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
    28
	MD5File landscape[3];      ///< landscape specific grf files
9895
7bd07f43b0e3 (svn r9321) [gamebalance] -Sync: r9025:9314 from trunk
celestar
parents: 6505
diff changeset
    29
};
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    30
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
    31
enum {
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
    32
	SKIP = 0xFFFE,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
    33
	END  = 0xFFFF
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
    34
};
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
    35
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
    36
#include "table/files.h"
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    37
#include "table/landscape_sprite.h"
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    38
2187
2a51f8925eeb (svn r2702) -Codechange: Cleaned up the sprite code and replaced many magic numbers
celestar
parents: 2186
diff changeset
    39
static const SpriteID * const _landscape_spriteindexes[] = {
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    40
	_landscape_spriteindexes_1,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    41
	_landscape_spriteindexes_2,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    42
	_landscape_spriteindexes_3,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    43
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    44
2187
2a51f8925eeb (svn r2702) -Codechange: Cleaned up the sprite code and replaced many magic numbers
celestar
parents: 2186
diff changeset
    45
static const SpriteID * const _slopes_spriteindexes[] = {
37
61bf1df68d82 (svn r38) Preliminary slopes graphics fix. Neighboring tile check not done yet
dominik
parents: 0
diff changeset
    46
	_slopes_spriteindexes_0,
61bf1df68d82 (svn r38) Preliminary slopes graphics fix. Neighboring tile check not done yet
dominik
parents: 0
diff changeset
    47
	_slopes_spriteindexes_1,
61bf1df68d82 (svn r38) Preliminary slopes graphics fix. Neighboring tile check not done yet
dominik
parents: 0
diff changeset
    48
	_slopes_spriteindexes_2,
61bf1df68d82 (svn r38) Preliminary slopes graphics fix. Neighboring tile check not done yet
dominik
parents: 0
diff changeset
    49
	_slopes_spriteindexes_3,
61bf1df68d82 (svn r38) Preliminary slopes graphics fix. Neighboring tile check not done yet
dominik
parents: 0
diff changeset
    50
};
61bf1df68d82 (svn r38) Preliminary slopes graphics fix. Neighboring tile check not done yet
dominik
parents: 0
diff changeset
    51
61bf1df68d82 (svn r38) Preliminary slopes graphics fix. Neighboring tile check not done yet
dominik
parents: 0
diff changeset
    52
2342
c19fb4f2df30 (svn r2868) Change the way NewGRFs are loaded: The loading process i no longer bolted onto the normal graphics loading.
tron
parents: 2340
diff changeset
    53
static uint LoadGrfFile(const char* filename, uint load_index, int file_index)
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    54
{
2342
c19fb4f2df30 (svn r2868) Change the way NewGRFs are loaded: The loading process i no longer bolted onto the normal graphics loading.
tron
parents: 2340
diff changeset
    55
	uint load_index_org = load_index;
9913
e79cd19772dd (svn r10213) [gamebalance] -Sync: r10100:10200 from trunk
celestar
parents: 9912
diff changeset
    56
	uint sprite_id = 0;
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    57
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    58
	FioOpenFile(file_index, filename);
365
5752af05ed75 (svn r553) -newgrf: Special routine for loading newgrf files. LoadNewGrfFile() introduced; will get more handy when loading stages will be introduced (octo and pasky).
darkvater
parents: 364
diff changeset
    59
5568
75f13d7bfaed (svn r7565) -Codechange: Rework DEBUG functionality. Look for appropiate debugging levels to
Darkvater
parents: 5296
diff changeset
    60
	DEBUG(sprite, 2, "Reading grf-file '%s'", filename);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    61
9913
e79cd19772dd (svn r10213) [gamebalance] -Sync: r10100:10200 from trunk
celestar
parents: 9912
diff changeset
    62
	while (LoadNextSprite(load_index, file_index, sprite_id)) {
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    63
		load_index++;
9913
e79cd19772dd (svn r10213) [gamebalance] -Sync: r10100:10200 from trunk
celestar
parents: 9912
diff changeset
    64
		sprite_id++;
2187
2a51f8925eeb (svn r2702) -Codechange: Cleaned up the sprite code and replaced many magic numbers
celestar
parents: 2186
diff changeset
    65
		if (load_index >= MAX_SPRITES) {
2a51f8925eeb (svn r2702) -Codechange: Cleaned up the sprite code and replaced many magic numbers
celestar
parents: 2186
diff changeset
    66
			error("Too many sprites. Recompile with higher MAX_SPRITES value or remove some custom GRF files.");
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    67
		}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    68
	}
5568
75f13d7bfaed (svn r7565) -Codechange: Rework DEBUG functionality. Look for appropiate debugging levels to
Darkvater
parents: 5296
diff changeset
    69
	DEBUG(sprite, 2, "Currently %i sprites are loaded", load_index);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    70
365
5752af05ed75 (svn r553) -newgrf: Special routine for loading newgrf files. LoadNewGrfFile() introduced; will get more handy when loading stages will be introduced (octo and pasky).
darkvater
parents: 364
diff changeset
    71
	return load_index - load_index_org;
5752af05ed75 (svn r553) -newgrf: Special routine for loading newgrf files. LoadNewGrfFile() introduced; will get more handy when loading stages will be introduced (octo and pasky).
darkvater
parents: 364
diff changeset
    72
}
5752af05ed75 (svn r553) -newgrf: Special routine for loading newgrf files. LoadNewGrfFile() introduced; will get more handy when loading stages will be introduced (octo and pasky).
darkvater
parents: 364
diff changeset
    73
2342
c19fb4f2df30 (svn r2868) Change the way NewGRFs are loaded: The loading process i no longer bolted onto the normal graphics loading.
tron
parents: 2340
diff changeset
    74
c19fb4f2df30 (svn r2868) Change the way NewGRFs are loaded: The loading process i no longer bolted onto the normal graphics loading.
tron
parents: 2340
diff changeset
    75
static void LoadGrfIndexed(const char* filename, const SpriteID* index_tbl, int file_index)
365
5752af05ed75 (svn r553) -newgrf: Special routine for loading newgrf files. LoadNewGrfFile() introduced; will get more handy when loading stages will be introduced (octo and pasky).
darkvater
parents: 364
diff changeset
    76
{
2342
c19fb4f2df30 (svn r2868) Change the way NewGRFs are loaded: The loading process i no longer bolted onto the normal graphics loading.
tron
parents: 2340
diff changeset
    77
	uint start;
9913
e79cd19772dd (svn r10213) [gamebalance] -Sync: r10100:10200 from trunk
celestar
parents: 9912
diff changeset
    78
	uint sprite_id = 0;
614
e016770cb781 (svn r1038) Feature: OpenTTD runs with the grf files of the DOS version
dominik
parents: 579
diff changeset
    79
365
5752af05ed75 (svn r553) -newgrf: Special routine for loading newgrf files. LoadNewGrfFile() introduced; will get more handy when loading stages will be introduced (octo and pasky).
darkvater
parents: 364
diff changeset
    80
	FioOpenFile(file_index, filename);
5752af05ed75 (svn r553) -newgrf: Special routine for loading newgrf files. LoadNewGrfFile() introduced; will get more handy when loading stages will be introduced (octo and pasky).
darkvater
parents: 364
diff changeset
    81
5568
75f13d7bfaed (svn r7565) -Codechange: Rework DEBUG functionality. Look for appropiate debugging levels to
Darkvater
parents: 5296
diff changeset
    82
	DEBUG(sprite, 2, "Reading indexed grf-file '%s'", filename);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    83
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
    84
	while ((start = *index_tbl++) != END) {
2342
c19fb4f2df30 (svn r2868) Change the way NewGRFs are loaded: The loading process i no longer bolted onto the normal graphics loading.
tron
parents: 2340
diff changeset
    85
		uint end = *index_tbl++;
c19fb4f2df30 (svn r2868) Change the way NewGRFs are loaded: The loading process i no longer bolted onto the normal graphics loading.
tron
parents: 2340
diff changeset
    86
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
    87
		if (start == SKIP) { // skip sprites (amount in second var)
37
61bf1df68d82 (svn r38) Preliminary slopes graphics fix. Neighboring tile check not done yet
dominik
parents: 0
diff changeset
    88
			SkipSprites(end);
9913
e79cd19772dd (svn r10213) [gamebalance] -Sync: r10100:10200 from trunk
celestar
parents: 9912
diff changeset
    89
			sprite_id += end;
37
61bf1df68d82 (svn r38) Preliminary slopes graphics fix. Neighboring tile check not done yet
dominik
parents: 0
diff changeset
    90
		} else { // load sprites and use indexes from start to end
61bf1df68d82 (svn r38) Preliminary slopes graphics fix. Neighboring tile check not done yet
dominik
parents: 0
diff changeset
    91
			do {
1844
372dae999453 (svn r2349) - Fix: remove warning from release build when assertions are no longer active
Darkvater
parents: 1725
diff changeset
    92
			#ifdef NDEBUG
9913
e79cd19772dd (svn r10213) [gamebalance] -Sync: r10100:10200 from trunk
celestar
parents: 9912
diff changeset
    93
				LoadNextSprite(start, file_index, sprite_id);
1844
372dae999453 (svn r2349) - Fix: remove warning from release build when assertions are no longer active
Darkvater
parents: 1725
diff changeset
    94
			#else
9913
e79cd19772dd (svn r10213) [gamebalance] -Sync: r10100:10200 from trunk
celestar
parents: 9912
diff changeset
    95
				bool b = LoadNextSprite(start, file_index, sprite_id);
37
61bf1df68d82 (svn r38) Preliminary slopes graphics fix. Neighboring tile check not done yet
dominik
parents: 0
diff changeset
    96
				assert(b);
1844
372dae999453 (svn r2349) - Fix: remove warning from release build when assertions are no longer active
Darkvater
parents: 1725
diff changeset
    97
			#endif
9913
e79cd19772dd (svn r10213) [gamebalance] -Sync: r10100:10200 from trunk
celestar
parents: 9912
diff changeset
    98
				sprite_id++;
37
61bf1df68d82 (svn r38) Preliminary slopes graphics fix. Neighboring tile check not done yet
dominik
parents: 0
diff changeset
    99
			} while (++start <= end);
61bf1df68d82 (svn r38) Preliminary slopes graphics fix. Neighboring tile check not done yet
dominik
parents: 0
diff changeset
   100
		}
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   101
	}
184
dbeaaaf8b2bb (svn r185) -Fix: [1016954] Cached_sprites does now work again
truelight
parents: 182
diff changeset
   102
}
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   103
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   104
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   105
/* Check that the supplied MD5 hash matches that stored for the supplied filename */
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   106
static bool CheckMD5Digest(const MD5File file, md5_byte_t *digest, bool warn)
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   107
{
4472
745f9ebe2216 (svn r6257) Use memcmp() to check the MD5 sum instead of using a home brewed loop
tron
parents: 4209
diff changeset
   108
	if (memcmp(file.hash, digest, sizeof(file.hash)) == 0) return true;
745f9ebe2216 (svn r6257) Use memcmp() to check the MD5 sum instead of using a home brewed loop
tron
parents: 4209
diff changeset
   109
	if (warn) fprintf(stderr, "MD5 of %s is ****INCORRECT**** - File Corrupt.\n", file.filename);
745f9ebe2216 (svn r6257) Use memcmp() to check the MD5 sum instead of using a home brewed loop
tron
parents: 4209
diff changeset
   110
	return false;
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   111
}
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   112
1019
6363b8a4273e (svn r1520) Trim 134 (!) lines with trailing whitespace ):
tron
parents: 966
diff changeset
   113
/* Calculate and check the MD5 hash of the supplied filename.
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   114
 * returns true if the checksum is correct */
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   115
static bool FileMD5(const MD5File file, bool warn)
614
e016770cb781 (svn r1038) Feature: OpenTTD runs with the grf files of the DOS version
dominik
parents: 579
diff changeset
   116
{
9913
e79cd19772dd (svn r10213) [gamebalance] -Sync: r10100:10200 from trunk
celestar
parents: 9912
diff changeset
   117
	FILE *f = FioFOpenFile(file.filename);
5733
8b3c5398687f (svn r7766) -Fix: [OSX] removed incorrect debug message about corrupted/missing grf files
bjarni
parents: 5726
diff changeset
   118
862
d7e52ef99f42 (svn r1343) -Fix: [Graphic] Autorail icon is now correct (Darkvater)
truelight
parents: 614
diff changeset
   119
	if (f != NULL) {
2028
d7686f53adf2 (svn r2537) Small changes, especially use fprintf to stderr for warnings and errors instead of plain printf
tron
parents: 2027
diff changeset
   120
		md5_state_t filemd5state;
d7686f53adf2 (svn r2537) Small changes, especially use fprintf to stderr for warnings and errors instead of plain printf
tron
parents: 2027
diff changeset
   121
		md5_byte_t buffer[1024];
d7686f53adf2 (svn r2537) Small changes, especially use fprintf to stderr for warnings and errors instead of plain printf
tron
parents: 2027
diff changeset
   122
		md5_byte_t digest[16];
d7686f53adf2 (svn r2537) Small changes, especially use fprintf to stderr for warnings and errors instead of plain printf
tron
parents: 2027
diff changeset
   123
		size_t len;
d7686f53adf2 (svn r2537) Small changes, especially use fprintf to stderr for warnings and errors instead of plain printf
tron
parents: 2027
diff changeset
   124
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   125
		md5_init(&filemd5state);
2028
d7686f53adf2 (svn r2537) Small changes, especially use fprintf to stderr for warnings and errors instead of plain printf
tron
parents: 2027
diff changeset
   126
		while ((len = fread(buffer, 1, sizeof(buffer), f)) != 0)
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   127
			md5_append(&filemd5state, buffer, len);
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   128
9913
e79cd19772dd (svn r10213) [gamebalance] -Sync: r10100:10200 from trunk
celestar
parents: 9912
diff changeset
   129
		if (ferror(f) && warn) ShowInfoF("Error Reading from %s \n", file.filename);
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   130
		fclose(f);
1019
6363b8a4273e (svn r1520) Trim 134 (!) lines with trailing whitespace ):
tron
parents: 966
diff changeset
   131
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   132
		md5_finish(&filemd5state, digest);
2639
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2588
diff changeset
   133
		return CheckMD5Digest(file, digest, warn);
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   134
	} else { // file not found
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   135
		return false;
1019
6363b8a4273e (svn r1520) Trim 134 (!) lines with trailing whitespace ):
tron
parents: 966
diff changeset
   136
	}
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   137
}
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   138
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   139
/* Checks, if either the Windows files exist (TRG1R.GRF) or the DOS files (TRG1.GRF)
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   140
 * by comparing the MD5 checksums of the files. _use_dos_palette is set accordingly.
1019
6363b8a4273e (svn r1520) Trim 134 (!) lines with trailing whitespace ):
tron
parents: 966
diff changeset
   141
 * If neither are found, Windows palette is assumed.
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   142
 *
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   143
 * (Note: Also checks sample.cat for corruption) */
9895
7bd07f43b0e3 (svn r9321) [gamebalance] -Sync: r9025:9314 from trunk
celestar
parents: 6505
diff changeset
   144
void CheckExternalFiles()
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   145
{
1355
aa6c2b776727 (svn r1859) Miscellaneous style changes
tron
parents: 1354
diff changeset
   146
	uint i;
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   147
	/* count of files from this version */
1355
aa6c2b776727 (svn r1859) Miscellaneous style changes
tron
parents: 1354
diff changeset
   148
	uint dos = 0;
aa6c2b776727 (svn r1859) Miscellaneous style changes
tron
parents: 1354
diff changeset
   149
	uint win = 0;
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   150
2028
d7686f53adf2 (svn r2537) Small changes, especially use fprintf to stderr for warnings and errors instead of plain printf
tron
parents: 2027
diff changeset
   151
	for (i = 0; i < 2; i++) if (FileMD5(files_dos.basic[i], true)) dos++;
d7686f53adf2 (svn r2537) Small changes, especially use fprintf to stderr for warnings and errors instead of plain printf
tron
parents: 2027
diff changeset
   152
	for (i = 0; i < 3; i++) if (FileMD5(files_dos.landscape[i], true)) dos++;
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   153
2028
d7686f53adf2 (svn r2537) Small changes, especially use fprintf to stderr for warnings and errors instead of plain printf
tron
parents: 2027
diff changeset
   154
	for (i = 0; i < 2; i++) if (FileMD5(files_win.basic[i], true)) win++;
d7686f53adf2 (svn r2537) Small changes, especially use fprintf to stderr for warnings and errors instead of plain printf
tron
parents: 2027
diff changeset
   155
	for (i = 0; i < 3; i++) if (FileMD5(files_win.landscape[i], true)) win++;
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   156
1355
aa6c2b776727 (svn r1859) Miscellaneous style changes
tron
parents: 1354
diff changeset
   157
	if (!FileMD5(sample_cat_win, false) && !FileMD5(sample_cat_dos, false))
5827
20879afb77f6 (svn r8013) -Codechange (r6921, rUnknown): Show the error message of corrupt or missing (own) files
Darkvater
parents: 5733
diff changeset
   158
		ShowInfo("Your 'sample.cat' file is corrupted or missing!");
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   159
4934
5f937d83f3eb (svn r6921) - PEBKAC: Add an MD5 sum check of our own data files, and warn if they don't match.
peter1138
parents: 4795
diff changeset
   160
	for (i = 0; i < lengthof(files_openttd); i++) {
5f937d83f3eb (svn r6921) - PEBKAC: Add an MD5 sum check of our own data files, and warn if they don't match.
peter1138
parents: 4795
diff changeset
   161
		if (!FileMD5(files_openttd[i], false)) {
5827
20879afb77f6 (svn r8013) -Codechange (r6921, rUnknown): Show the error message of corrupt or missing (own) files
Darkvater
parents: 5733
diff changeset
   162
			ShowInfoF("Your '%s' file is corrupted or missing!", files_openttd[i].filename);
4934
5f937d83f3eb (svn r6921) - PEBKAC: Add an MD5 sum check of our own data files, and warn if they don't match.
peter1138
parents: 4795
diff changeset
   163
		}
5f937d83f3eb (svn r6921) - PEBKAC: Add an MD5 sum check of our own data files, and warn if they don't match.
peter1138
parents: 4795
diff changeset
   164
	}
5f937d83f3eb (svn r6921) - PEBKAC: Add an MD5 sum check of our own data files, and warn if they don't match.
peter1138
parents: 4795
diff changeset
   165
1380
7faf03f67dc3 (svn r1884) Change palette detection algorithm: Use the DOS palette if there are no Windows .grfs but at least one DOS .grf
tron
parents: 1378
diff changeset
   166
	/*
1389
238570e5c3d3 (svn r1893) If -i was specified respect it
tron
parents: 1381
diff changeset
   167
	 * forced DOS palette via command line -> leave it that way
1380
7faf03f67dc3 (svn r1884) Change palette detection algorithm: Use the DOS palette if there are no Windows .grfs but at least one DOS .grf
tron
parents: 1378
diff changeset
   168
	 * all Windows files present -> Windows palette
7faf03f67dc3 (svn r1884) Change palette detection algorithm: Use the DOS palette if there are no Windows .grfs but at least one DOS .grf
tron
parents: 1378
diff changeset
   169
	 * all DOS files present -> DOS palette
7faf03f67dc3 (svn r1884) Change palette detection algorithm: Use the DOS palette if there are no Windows .grfs but at least one DOS .grf
tron
parents: 1378
diff changeset
   170
	 * no Windows files present and any DOS file present -> DOS palette
7faf03f67dc3 (svn r1884) Change palette detection algorithm: Use the DOS palette if there are no Windows .grfs but at least one DOS .grf
tron
parents: 1378
diff changeset
   171
	 * otherwise -> Windows palette
7faf03f67dc3 (svn r1884) Change palette detection algorithm: Use the DOS palette if there are no Windows .grfs but at least one DOS .grf
tron
parents: 1378
diff changeset
   172
	 */
1389
238570e5c3d3 (svn r1893) If -i was specified respect it
tron
parents: 1381
diff changeset
   173
	if (_use_dos_palette) {
238570e5c3d3 (svn r1893) If -i was specified respect it
tron
parents: 1381
diff changeset
   174
		return;
238570e5c3d3 (svn r1893) If -i was specified respect it
tron
parents: 1381
diff changeset
   175
	} else if (win == 5) {
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   176
		_use_dos_palette = false;
1381
3837b6c64508 (svn r1885) Fix typo in r1884
tron
parents: 1380
diff changeset
   177
	} else if (dos == 5 || (win == 0 && dos > 0)) {
614
e016770cb781 (svn r1038) Feature: OpenTTD runs with the grf files of the DOS version
dominik
parents: 579
diff changeset
   178
		_use_dos_palette = true;
1380
7faf03f67dc3 (svn r1884) Change palette detection algorithm: Use the DOS palette if there are no Windows .grfs but at least one DOS .grf
tron
parents: 1378
diff changeset
   179
	} else {
961
26fdd7e62075 (svn r1453) Feature: MD5 hash check for TTD files
dominik
parents: 884
diff changeset
   180
		_use_dos_palette = false;
614
e016770cb781 (svn r1038) Feature: OpenTTD runs with the grf files of the DOS version
dominik
parents: 579
diff changeset
   181
	}
e016770cb781 (svn r1038) Feature: OpenTTD runs with the grf files of the DOS version
dominik
parents: 579
diff changeset
   182
}
e016770cb781 (svn r1038) Feature: OpenTTD runs with the grf files of the DOS version
dominik
parents: 579
diff changeset
   183
2342
c19fb4f2df30 (svn r2868) Change the way NewGRFs are loaded: The loading process i no longer bolted onto the normal graphics loading.
tron
parents: 2340
diff changeset
   184
2353
076e9b569f64 (svn r2879) Major step twoards ISO-8859-15
tron
parents: 2342
diff changeset
   185
static const SpriteID trg1idx[] = {
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   186
	   0,    1, ///< Mouse cursor, ZZZ
2353
076e9b569f64 (svn r2879) Major step twoards ISO-8859-15
tron
parents: 2342
diff changeset
   187
/* Medium font */
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   188
	   2,   92, ///< ' ' till 'z'
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   189
	SKIP,   36,
9912
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   190
	 160,  160, ///< Move Ÿ to the correct position
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   191
	  98,   98, ///< Up arrow
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   192
	 131,  133,
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   193
	SKIP,    1, ///< skip currency sign
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   194
	 135,  135,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   195
	SKIP,    1,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   196
	 137,  137,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   197
	SKIP,    1,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   198
	 139,  139,
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   199
	 140,  140, ///< @todo Down arrow
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   200
	 141,  141,
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   201
	 142,  142, ///< @todo Check mark
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   202
	 143,  143, ///< @todo Cross
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   203
	 144,  144,
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   204
	 145,  145, ///< @todo Right arrow
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   205
	 146,  149,
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   206
	 118,  122, ///< Transport markers
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   207
	SKIP,    2,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   208
	 157,  157,
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   209
	 114,  115, ///< Small up/down arrows
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   210
	SKIP,    1,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   211
	 161,  225,
2353
076e9b569f64 (svn r2879) Major step twoards ISO-8859-15
tron
parents: 2342
diff changeset
   212
/* Small font */
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   213
	 226,  316, ///< ' ' till 'z'
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   214
	SKIP,   36,
9912
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   215
	 384,  384, ///< Move Ÿ to the correct position
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   216
	 322,  322, ///< Up arrow
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   217
	 355,  357,
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   218
	SKIP,    1, ///< skip currency sign
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   219
	 359,  359,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   220
	SKIP,    1,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   221
	 361,  361,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   222
	SKIP,    1,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   223
	 363,  363,
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   224
	 364,  364, ////< @todo Down arrow
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   225
	 365,  366,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   226
	SKIP,    1,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   227
	 368,  368,
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   228
	 369,  369, ///< @todo Right arrow
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   229
	 370,  373,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   230
	SKIP,    7,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   231
	 381,  381,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   232
	SKIP,    3,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   233
	 385,  449,
2353
076e9b569f64 (svn r2879) Major step twoards ISO-8859-15
tron
parents: 2342
diff changeset
   234
/* Big font */
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   235
	 450,  540, ///< ' ' till 'z'
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   236
	SKIP,   36,
9912
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   237
	 608,  608, ///< Move Ÿ to the correct position
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   238
	SKIP,    1,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   239
	 579,  581,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   240
	SKIP,    1,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   241
	 583,  583,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   242
	SKIP,    5,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   243
	 589,  589,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   244
	SKIP,   15,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   245
	 605,  605,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   246
	SKIP,    3,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   247
	 609,  625,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   248
	SKIP,    1,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   249
	 627,  632,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   250
	SKIP,    1,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   251
	 634,  639,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   252
	SKIP,    1,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   253
	 641,  657,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   254
	SKIP,    1,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   255
	 659,  664,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   256
	SKIP,    2,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   257
	 667,  671,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   258
	SKIP,    1,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   259
	 673,  673,
2353
076e9b569f64 (svn r2879) Major step twoards ISO-8859-15
tron
parents: 2342
diff changeset
   260
/* Graphics */
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   261
	 674, 4792,
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   262
	END
2353
076e9b569f64 (svn r2879) Major step twoards ISO-8859-15
tron
parents: 2342
diff changeset
   263
};
076e9b569f64 (svn r2879) Major step twoards ISO-8859-15
tron
parents: 2342
diff changeset
   264
2565
19b3af477934 (svn r3102) - Fix (regression): Newly added sprite had problems when newgrf's where loaded. Thanks Tron for explaining what the problem was and how it should be solved.
Darkvater
parents: 2559
diff changeset
   265
/* NOTE: When adding a normal sprite, increase OPENTTD_SPRITES_COUNT with the
19b3af477934 (svn r3102) - Fix (regression): Newly added sprite had problems when newgrf's where loaded. Thanks Tron for explaining what the problem was and how it should be solved.
Darkvater
parents: 2559
diff changeset
   266
 * amount of sprites and add them to the end of the list, with the index of
19b3af477934 (svn r3102) - Fix (regression): Newly added sprite had problems when newgrf's where loaded. Thanks Tron for explaining what the problem was and how it should be solved.
Darkvater
parents: 2559
diff changeset
   267
 * the old sprite-count offset from SPR_OPENTTD_BASE. With this there is no
19b3af477934 (svn r3102) - Fix (regression): Newly added sprite had problems when newgrf's where loaded. Thanks Tron for explaining what the problem was and how it should be solved.
Darkvater
parents: 2559
diff changeset
   268
 * correspondence of any kind with the ID's in the grf file, but results in
19b3af477934 (svn r3102) - Fix (regression): Newly added sprite had problems when newgrf's where loaded. Thanks Tron for explaining what the problem was and how it should be solved.
Darkvater
parents: 2559
diff changeset
   269
 * a maximum use of sprite slots. */
2353
076e9b569f64 (svn r2879) Major step twoards ISO-8859-15
tron
parents: 2342
diff changeset
   270
static const SpriteID _openttd_grf_indexes[] = {
2571
ab7413dfe35a (svn r3108) Confine the use of SPR_OPENTTD_BASE to table/sprites.h by adding/using some sprite enums
tron
parents: 2565
diff changeset
   271
	SPR_IMG_AUTORAIL, SPR_CURSOR_WAYPOINT, // icons etc
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   272
	134, 134,  ///< euro symbol medium size
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   273
	582, 582,  ///<  euro symbol large size
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   274
	358, 358,  ///<  euro symbol tiny
2571
ab7413dfe35a (svn r3108) Confine the use of SPR_OPENTTD_BASE to table/sprites.h by adding/using some sprite enums
tron
parents: 2565
diff changeset
   275
	SPR_CURSOR_CANAL, SPR_IMG_FASTFORWARD, // more icons
9912
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   276
	648, 648, ///<  nordic char: æ
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   277
	616, 616, ///<  nordic char: Æ
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   278
	666, 666, ///<  nordic char: ø
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   279
	634, 634, ///<  nordic char: Ø
4935
aa0721b7ae79 (svn r6922) -Feature: Add proper cloning sprites and cursors, different for each vehicle. Big thanks
Darkvater
parents: 4934
diff changeset
   280
	SPR_PIN_UP, SPR_CURSOR_CLONE_TRAIN, // more icons
9912
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   281
	382, 383, ///<  Œ œ tiny
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   282
	158, 159, ///<  Œ œ medium
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   283
	606, 607, ///<  Œ œ large
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   284
	360, 360, ///<  Š tiny
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   285
	362, 362, ///<  š tiny
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   286
	136, 136, ///<  Š medium
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   287
	138, 138, ///<  š medium
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   288
	584, 584, ///<  Š large
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   289
	586, 586, ///<  š large
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   290
	626, 626, ///<  Ð large
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   291
	658, 658, ///<  ð large
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   292
	374, 374, ///<  Ž tiny
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   293
	378, 378, ///<  ž tiny
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   294
	150, 150, ///<  Ž medium
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   295
	154, 154, ///<  ž medium
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   296
	598, 598, ///<  Ž large
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   297
	602, 602, ///<  ž large
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   298
	640, 640, ///<  Þ large
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   299
	672, 672, ///<  þ large
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   300
	380, 380, ///<  º tiny
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   301
	156, 156, ///<  º medium
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   302
	604, 604, ///<  º large
6505
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   303
	317, 320, ///<  { | } ~ tiny
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   304
	 93,  96, ///<  { | } ~ medium
abcb0580d976 (svn r8950) -Cleanup: doxygen changes. Mostly @files missing tags and a few comments style.
belugas
parents: 6429
diff changeset
   305
	541, 544, ///<  { | } ~ large
2571
ab7413dfe35a (svn r3108) Confine the use of SPR_OPENTTD_BASE to table/sprites.h by adding/using some sprite enums
tron
parents: 2565
diff changeset
   306
	SPR_HOUSE_ICON, SPR_HOUSE_ICON,
9912
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   307
	585, 585, ///<  § large
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   308
	587, 587, ///<  © large
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   309
	592, 592, ///<  ® large
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   310
	594, 597, ///<  ° ± ² ³ large
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   311
	633, 633, ///<  × large
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   312
	665, 665, ///<  ÷ large
4935
aa0721b7ae79 (svn r6922) -Feature: Add proper cloning sprites and cursors, different for each vehicle. Big thanks
Darkvater
parents: 4934
diff changeset
   313
	SPR_SELL_TRAIN, SPR_SHARED_ORDERS_ICON,
9912
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   314
	377, 377, ///<  · small
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   315
	153, 153, ///<  · medium
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   316
	601, 601, ///<  · large
6429
02c062eb2c74 (svn r8838) -Feature: Show newgrf error messages loaded in Action B in the newgrf gui
maedhros
parents: 6338
diff changeset
   317
	SPR_WARNING_SIGN, SPR_WARNING_SIGN,
2588
40d7dba79fc7 (svn r3125) Symbolic names for skiping sprites and the end of the sprite list
tron
parents: 2577
diff changeset
   318
	END
2353
076e9b569f64 (svn r2879) Major step twoards ISO-8859-15
tron
parents: 2342
diff changeset
   319
};
076e9b569f64 (svn r2879) Major step twoards ISO-8859-15
tron
parents: 2342
diff changeset
   320
2342
c19fb4f2df30 (svn r2868) Change the way NewGRFs are loaded: The loading process i no longer bolted onto the normal graphics loading.
tron
parents: 2340
diff changeset
   321
9895
7bd07f43b0e3 (svn r9321) [gamebalance] -Sync: r9025:9314 from trunk
celestar
parents: 6505
diff changeset
   322
static void LoadSpriteTables()
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   323
{
2639
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2588
diff changeset
   324
	const FileList* files = _use_dos_palette ? &files_dos : &files_win;
8a7342eb3a78 (svn r3181) -Bracing
tron
parents: 2588
diff changeset
   325
	uint load_index;
1355
aa6c2b776727 (svn r1859) Miscellaneous style changes
tron
parents: 1354
diff changeset
   326
	uint i;
614
e016770cb781 (svn r1038) Feature: OpenTTD runs with the grf files of the DOS version
dominik
parents: 579
diff changeset
   327
2353
076e9b569f64 (svn r2879) Major step twoards ISO-8859-15
tron
parents: 2342
diff changeset
   328
	LoadGrfIndexed(files->basic[0].filename, trg1idx, 0);
2407
983f1d8a0614 (svn r2933) Implement the non-breaking space
tron
parents: 2353
diff changeset
   329
	DupSprite(  2, 130); // non-breaking space medium
983f1d8a0614 (svn r2933) Implement the non-breaking space
tron
parents: 2353
diff changeset
   330
	DupSprite(226, 354); // non-breaking space tiny
983f1d8a0614 (svn r2933) Implement the non-breaking space
tron
parents: 2353
diff changeset
   331
	DupSprite(450, 578); // non-breaking space large
2353
076e9b569f64 (svn r2879) Major step twoards ISO-8859-15
tron
parents: 2342
diff changeset
   332
	load_index = 4793;
076e9b569f64 (svn r2879) Major step twoards ISO-8859-15
tron
parents: 2342
diff changeset
   333
076e9b569f64 (svn r2879) Major step twoards ISO-8859-15
tron
parents: 2342
diff changeset
   334
	for (i = 1; files->basic[i].filename != NULL; i++) {
2309
34824a8b336f (svn r2833) Remove saving of sprite cache data:
tron
parents: 2305
diff changeset
   335
		load_index += LoadGrfFile(files->basic[i].filename, load_index, i);
34824a8b336f (svn r2833) Remove saving of sprite cache data:
tron
parents: 2305
diff changeset
   336
	}
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   337
5151
0f939d1c0896 (svn r7246) -Codechange: Always reload sprite and NewGRF data when loading or starting a game, instead of only when the climate type is different.
peter1138
parents: 5000
diff changeset
   338
	/* Load additional sprites for climates other than temperate */
9906
6f41b8713b65 (svn r9674) [gamebalance] -Sync: r9322:9420 from trunk
celestar
parents: 9895
diff changeset
   339
	if (_opt.landscape != LT_TEMPERATE) {
2309
34824a8b336f (svn r2833) Remove saving of sprite cache data:
tron
parents: 2305
diff changeset
   340
		LoadGrfIndexed(
5151
0f939d1c0896 (svn r7246) -Codechange: Always reload sprite and NewGRF data when loading or starting a game, instead of only when the climate type is different.
peter1138
parents: 5000
diff changeset
   341
			files->landscape[_opt.landscape - 1].filename,
0f939d1c0896 (svn r7246) -Codechange: Always reload sprite and NewGRF data when loading or starting a game, instead of only when the climate type is different.
peter1138
parents: 5000
diff changeset
   342
			_landscape_spriteindexes[_opt.landscape - 1],
2309
34824a8b336f (svn r2833) Remove saving of sprite cache data:
tron
parents: 2305
diff changeset
   343
			i++
34824a8b336f (svn r2833) Remove saving of sprite cache data:
tron
parents: 2305
diff changeset
   344
		);
34824a8b336f (svn r2833) Remove saving of sprite cache data:
tron
parents: 2305
diff changeset
   345
	}
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   346
4936
b51659a526ad (svn r6923) -Codechange: Load nsignalsw.grf in the same way as other mandatory additional grfs
Darkvater
parents: 4935
diff changeset
   347
	assert(load_index == SPR_SIGNALS_BASE);
b51659a526ad (svn r6923) -Codechange: Load nsignalsw.grf in the same way as other mandatory additional grfs
Darkvater
parents: 4935
diff changeset
   348
	load_index += LoadGrfFile("nsignalsw.grf", load_index, i++);
b51659a526ad (svn r6923) -Codechange: Load nsignalsw.grf in the same way as other mandatory additional grfs
Darkvater
parents: 4935
diff changeset
   349
2512
fa66ff5ebf88 (svn r3038) Reorder the loading of standard graphics files to reflect a bit where in the sprite array the sprites end up and assert, that the indices are equal to the corresponding sprite base enums, to guard against typos.
tron
parents: 2411
diff changeset
   350
	assert(load_index == SPR_CANALS_BASE);
fa66ff5ebf88 (svn r3038) Reorder the loading of standard graphics files to reflect a bit where in the sprite array the sprites end up and assert, that the indices are equal to the corresponding sprite base enums, to guard against typos.
tron
parents: 2411
diff changeset
   351
	load_index += LoadGrfFile("canalsw.grf", load_index, i++);
fa66ff5ebf88 (svn r3038) Reorder the loading of standard graphics files to reflect a bit where in the sprite array the sprites end up and assert, that the indices are equal to the corresponding sprite base enums, to guard against typos.
tron
parents: 2411
diff changeset
   352
fa66ff5ebf88 (svn r3038) Reorder the loading of standard graphics files to reflect a bit where in the sprite array the sprites end up and assert, that the indices are equal to the corresponding sprite base enums, to guard against typos.
tron
parents: 2411
diff changeset
   353
	assert(load_index == SPR_SLOPES_BASE);
2309
34824a8b336f (svn r2833) Remove saving of sprite cache data:
tron
parents: 2305
diff changeset
   354
	LoadGrfIndexed("trkfoundw.grf", _slopes_spriteindexes[_opt.landscape], i++);
1070
bef634a62323 (svn r1571) Feature: Visually enhanced autorail placing
dominik
parents: 1019
diff changeset
   355
2309
34824a8b336f (svn r2833) Remove saving of sprite cache data:
tron
parents: 2305
diff changeset
   356
	load_index = SPR_AUTORAIL_BASE;
34824a8b336f (svn r2833) Remove saving of sprite cache data:
tron
parents: 2305
diff changeset
   357
	load_index += LoadGrfFile("autorail.grf", load_index, i++);
142
0c2bd172af05 (svn r143) Fix: newgrfs are working again
dominik
parents: 74
diff changeset
   358
3355
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents: 3252
diff changeset
   359
	assert(load_index == SPR_ELRAIL_BASE);
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents: 3252
diff changeset
   360
	load_index += LoadGrfFile("elrailsw.grf", load_index, i++);
a653b8e47f27 (svn r4150) -Feature: Merged elrails into trunk. Thanks to Tron for lots of code and proofreading, thanks to peter1138 for another lot of code and ideas.
celestar
parents: 3252
diff changeset
   361
3113
c0f312f22238 (svn r3717) - [2cc] Add 2cc colour maps and use for newgrf engines requiring them. Currently the second colour is fixed to be the player's colour.
peter1138
parents: 2639
diff changeset
   362
	assert(load_index == SPR_2CCMAP_BASE);
c0f312f22238 (svn r3717) - [2cc] Add 2cc colour maps and use for newgrf engines requiring them. Currently the second colour is fixed to be the player's colour.
peter1138
parents: 2639
diff changeset
   363
	load_index += LoadGrfFile("2ccmap.grf", load_index, i++);
c0f312f22238 (svn r3717) - [2cc] Add 2cc colour maps and use for newgrf engines requiring them. Currently the second colour is fixed to be the player's colour.
peter1138
parents: 2639
diff changeset
   364
2512
fa66ff5ebf88 (svn r3038) Reorder the loading of standard graphics files to reflect a bit where in the sprite array the sprites end up and assert, that the indices are equal to the corresponding sprite base enums, to guard against typos.
tron
parents: 2411
diff changeset
   365
	assert(load_index == SPR_OPENTTD_BASE);
fa66ff5ebf88 (svn r3038) Reorder the loading of standard graphics files to reflect a bit where in the sprite array the sprites end up and assert, that the indices are equal to the corresponding sprite base enums, to guard against typos.
tron
parents: 2411
diff changeset
   366
	LoadGrfIndexed("openttd.grf", _openttd_grf_indexes, i++);
2577
a122c0daa430 (svn r3114) Close two gaps in the sprite array when loading openttd.grf. That's seven more free sprite slots, yay!
tron
parents: 2571
diff changeset
   367
	load_index = SPR_OPENTTD_BASE + OPENTTD_SPRITES_COUNT;
142
0c2bd172af05 (svn r143) Fix: newgrfs are working again
dominik
parents: 74
diff changeset
   368
4059
f1442dfe1c8a (svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
richk
parents: 3355
diff changeset
   369
	assert(load_index == SPR_AIRPORTX_BASE);
f1442dfe1c8a (svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
richk
parents: 3355
diff changeset
   370
	load_index += LoadGrfFile("airports.grf", load_index, i++);
f1442dfe1c8a (svn r5346) - Feature: Add 4 new airports. 2 for aircraft, 2 for helicopters.
richk
parents: 3355
diff changeset
   371
6338
0fb4f452873c (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 6015
diff changeset
   372
	assert(load_index == SPR_ROADSTOP_BASE);
0fb4f452873c (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 6015
diff changeset
   373
	load_index += LoadGrfFile("roadstops.grf", load_index, i++);
0fb4f452873c (svn r8735) -Feature: drive-through road stops made possible by the hard work of mart3p.
rubidium
parents: 6015
diff changeset
   374
9911
0b8b245a2391 (svn r10135) [gamebalance] -Sync: r9700:9900 from trunk
celestar
parents: 9906
diff changeset
   375
	assert(load_index == SPR_GROUP_BASE);
0b8b245a2391 (svn r10135) [gamebalance] -Sync: r9700:9900 from trunk
celestar
parents: 9906
diff changeset
   376
	load_index += LoadGrfFile("group.grf", load_index, i++);
0b8b245a2391 (svn r10135) [gamebalance] -Sync: r9700:9900 from trunk
celestar
parents: 9906
diff changeset
   377
9912
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   378
	assert(load_index == SPR_TRAMWAY_BASE);
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   379
	load_index += LoadGrfFile("tramtrkw.grf", load_index, i++);
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   380
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   381
	assert(load_index == SPR_ONEWAY_BASE);
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   382
	load_index += LoadGrfFile("oneway.grf", load_index, i++);
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   383
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   384
	assert(load_index == SPR_FLAGS_BASE);
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   385
	load_index += LoadGrfFile("flags.grf", load_index, i++);
1ac8aac92385 (svn r10136) [gamebalance] -Sync: r9900:10100 from trunk
celestar
parents: 9911
diff changeset
   386
5156
5edaa8f9b295 (svn r7254) -Fix (r7250): move unicode glyph map initialisation to just before newgrf files are loaded, else newgrf glyphs will be cleared out too. (thanks Hadez)
peter1138
parents: 5151
diff changeset
   387
	/* Initialize the unicode to sprite mapping table */
5edaa8f9b295 (svn r7254) -Fix (r7250): move unicode glyph map initialisation to just before newgrf files are loaded, else newgrf glyphs will be cleared out too. (thanks Hadez)
peter1138
parents: 5151
diff changeset
   388
	InitializeUnicodeGlyphMap();
5edaa8f9b295 (svn r7254) -Fix (r7250): move unicode glyph map initialisation to just before newgrf files are loaded, else newgrf glyphs will be cleared out too. (thanks Hadez)
peter1138
parents: 5151
diff changeset
   389
2342
c19fb4f2df30 (svn r2868) Change the way NewGRFs are loaded: The loading process i no longer bolted onto the normal graphics loading.
tron
parents: 2340
diff changeset
   390
	LoadNewGRF(load_index, i);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   391
}
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   392
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   393
9895
7bd07f43b0e3 (svn r9321) [gamebalance] -Sync: r9025:9314 from trunk
celestar
parents: 6505
diff changeset
   394
void GfxLoadSprites()
1093
e8d26c7dc42f (svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents: 1070
diff changeset
   395
{
5568
75f13d7bfaed (svn r7565) -Codechange: Rework DEBUG functionality. Look for appropiate debugging levels to
Darkvater
parents: 5296
diff changeset
   396
	DEBUG(sprite, 2, "Loading sprite set %d", _opt.landscape);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   397
5151
0f939d1c0896 (svn r7246) -Codechange: Always reload sprite and NewGRF data when loading or starting a game, instead of only when the climate type is different.
peter1138
parents: 5000
diff changeset
   398
	GfxInitSpriteMem();
0f939d1c0896 (svn r7246) -Codechange: Always reload sprite and NewGRF data when loading or starting a game, instead of only when the climate type is different.
peter1138
parents: 5000
diff changeset
   399
	LoadSpriteTables();
0f939d1c0896 (svn r7246) -Codechange: Always reload sprite and NewGRF data when loading or starting a game, instead of only when the climate type is different.
peter1138
parents: 5000
diff changeset
   400
	GfxInitPalettes();
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
   401
}