diff options
author | rubidium <rubidium@openttd.org> | 2007-06-16 12:03:36 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-06-16 12:03:36 +0000 |
commit | e355b1e55a9e03858d8d7f5ba062fb0aa9727195 (patch) | |
tree | 66456e9597d9e95716f6f41b7c2dddfbd8b83358 | |
parent | 6c87da4fec9b128e9f462ccfb117a4061bf45bab (diff) | |
download | openttd-e355b1e55a9e03858d8d7f5ba062fb0aa9727195.tar.xz |
(svn r10170) -Codechange: remove some duplication of code.
-rw-r--r-- | projects/openttd.vcproj | 6 | ||||
-rw-r--r-- | projects/openttd_vs80.vcproj | 6 | ||||
-rw-r--r-- | source.list | 2 | ||||
-rw-r--r-- | src/gfxinit.cpp | 30 |
4 files changed, 9 insertions, 35 deletions
diff --git a/projects/openttd.vcproj b/projects/openttd.vcproj index faa3cab7b..7116b9a63 100644 --- a/projects/openttd.vcproj +++ b/projects/openttd.vcproj @@ -989,13 +989,13 @@ RelativePath=".\..\src\blitter\8bpp_simple.hpp"> </File> <File - RelativePath=".\..\src\blitter\null.cpp"> + RelativePath=".\..\src\blitter\blitter.hpp"> </File> <File - RelativePath=".\..\src\blitter\null.hpp"> + RelativePath=".\..\src\blitter\null.cpp"> </File> <File - RelativePath=".\..\src\blitter\blitter.hpp"> + RelativePath=".\..\src\blitter\null.hpp"> </File> </Filter> <Filter diff --git a/projects/openttd_vs80.vcproj b/projects/openttd_vs80.vcproj index c2f775285..e4f2cc487 100644 --- a/projects/openttd_vs80.vcproj +++ b/projects/openttd_vs80.vcproj @@ -1540,15 +1540,15 @@ > </File> <File - RelativePath=".\..\src\blitter\null.cpp" + RelativePath=".\..\src\blitter\blitter.hpp" > </File> <File - RelativePath=".\..\src\blitter\null.hpp" + RelativePath=".\..\src\blitter\null.cpp" > </File> <File - RelativePath=".\..\src\blitter\blitter.hpp" + RelativePath=".\..\src\blitter\null.hpp" > </File> </Filter> diff --git a/source.list b/source.list index 2a0182c49..d25bedac3 100644 --- a/source.list +++ b/source.list @@ -300,9 +300,9 @@ blitter/8bpp_optimized.cpp blitter/8bpp_optimized.hpp blitter/8bpp_simple.cpp blitter/8bpp_simple.hpp +blitter/blitter.hpp blitter/null.cpp blitter/null.hpp -blitter/blitter.hpp # Sprite loaders spriteloader/grf.cpp diff --git a/src/gfxinit.cpp b/src/gfxinit.cpp index 6212badfd..408b5f623 100644 --- a/src/gfxinit.cpp +++ b/src/gfxinit.cpp @@ -114,33 +114,7 @@ static bool CheckMD5Digest(const MD5File file, md5_byte_t *digest, bool warn) * returns true if the checksum is correct */ static bool FileMD5(const MD5File file, bool warn) { - FILE *f; - char buf[MAX_PATH]; - - /* open file */ - snprintf(buf, lengthof(buf), "%s%s", _paths.data_dir, file.filename); - f = fopen(buf, "rb"); - -#if !defined(WIN32) - if (f == NULL) { - strtolower(buf + strlen(_paths.data_dir) - 1); - f = fopen(buf, "rb"); - } -#endif - -#if defined SECOND_DATA_DIR - /* If we failed to find the file in the first data directory, we will try the other one */ - - if (f == NULL) { - snprintf(buf, lengthof(buf), "%s%s", _paths.second_data_dir, file.filename); - f = fopen(buf, "rb"); - - if (f == NULL) { - strtolower(buf + strlen(_paths.second_data_dir) - 1); - f = fopen(buf, "rb"); - } - } -#endif + FILE *f = FioFOpenFile(file.filename); if (f != NULL) { md5_state_t filemd5state; @@ -152,7 +126,7 @@ static bool FileMD5(const MD5File file, bool warn) while ((len = fread(buffer, 1, sizeof(buffer), f)) != 0) md5_append(&filemd5state, buffer, len); - if (ferror(f) && warn) ShowInfoF("Error Reading from %s \n", buf); + if (ferror(f) && warn) ShowInfoF("Error Reading from %s \n", file.filename); fclose(f); md5_finish(&filemd5state, digest); |