(svn r17142) -Fix [FS#3103] (r17139): MSVC didn't like some template stuff

This commit is contained in:
rubidium 2009-08-10 10:25:40 +00:00
parent 8e058c2d27
commit 40a8bd556e
3 changed files with 10 additions and 4 deletions

View File

@ -31,7 +31,7 @@ struct BaseSet {
static const size_t NUM_FILES = Tnum_files;
/** Internal names of the files in this set. */
static const char *file_names[Tnum_files];
static const char **file_names;
const char *name; ///< The name of the base set
const char *description; ///< Description of the base set

View File

@ -106,7 +106,7 @@ void CheckExternalFiles()
char *add_pos = error_msg;
const char *last = lastof(error_msg);
for (uint i = 0; i < lengthof(used_set->files); i++) {
for (uint i = 0; i < MAX_GFT; i++) {
if (!used_set->files[i].CheckMD5()) {
add_pos += seprintf(add_pos, last, "Your '%s' file is corrupted or missing! %s\n", used_set->files[i].filename, used_set->files[i].missing_warning);
}
@ -231,8 +231,11 @@ bool MD5File::CheckMD5() const
}
/** Names corresponding to the GraphicsFileType */
const char *_graphics_file_names[] = { "base", "logos", "arctic", "tropical", "toyland", "extra" };
/** Implementation */
template <class T, size_t Tnum_files>
/* static */ const char *BaseSet<T, Tnum_files>::file_names[Tnum_files] = { "base", "logos", "arctic", "tropical", "toyland", "extra" };
/* static */ const char **BaseSet<T, Tnum_files>::file_names = _graphics_file_names;
extern void UpdateNewGRFConfigPalette();

View File

@ -260,8 +260,11 @@ void SndPlayFx(SoundID sound)
INSTANTIATE_BASE_MEDIA_METHODS(BaseMedia<SoundsSet>, SoundsSet)
/** Names corresponding to the sound set's files */
const char *_sound_file_names[] = { "samples" };
template <class T, size_t Tnum_files>
/* static */ const char *BaseSet<T, Tnum_files>::file_names[Tnum_files] = { "samples" };
/* static */ const char **BaseSet<T, Tnum_files>::file_names = _sound_file_names;
template <class Tbase_set>
/* static */ const char *BaseMedia<Tbase_set>::GetExtension()