From 9f01009b392368dd42140f5304569893e81e5e57 Mon Sep 17 00:00:00 2001 From: rubidium Date: Sat, 16 Jun 2007 12:03:36 +0000 Subject: (svn r10170) -Codechange: remove some duplication of code. --- projects/openttd.vcproj | 6 +++--- projects/openttd_vs80.vcproj | 6 +++--- source.list | 2 +- 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"> + RelativePath=".\..\src\blitter\blitter.hpp"> + RelativePath=".\..\src\blitter\null.cpp"> + RelativePath=".\..\src\blitter\null.hpp"> 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); -- cgit v1.2.3-70-g09d2