summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-08-10 10:25:40 +0000
committerrubidium <rubidium@openttd.org>2009-08-10 10:25:40 +0000
commit40a8bd556e7daa65c3e63059b871f85c8ffce072 (patch)
treeed0986a127b968c52f6e4aac1d1b8f796065a580
parent8e058c2d27961bdd1db883679b5743f418e8b854 (diff)
downloadopenttd-40a8bd556e7daa65c3e63059b871f85c8ffce072.tar.xz
(svn r17142) -Fix [FS#3103] (r17139): MSVC didn't like some template stuff
-rw-r--r--src/base_media_base.h2
-rw-r--r--src/gfxinit.cpp7
-rw-r--r--src/sound.cpp5
3 files changed, 10 insertions, 4 deletions
diff --git a/src/base_media_base.h b/src/base_media_base.h
index b25661fa8..a13b77d58 100644
--- a/src/base_media_base.h
+++ b/src/base_media_base.h
@@ -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
diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp
index 5ec306a4e..22b97efcb 100644
--- a/src/gfxinit.cpp
+++ b/src/gfxinit.cpp
@@ -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();
diff --git a/src/sound.cpp b/src/sound.cpp
index c1cb1c02e..e314c7ade 100644
--- a/src/sound.cpp
+++ b/src/sound.cpp
@@ -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()