Mercurial > hg > openttd
changeset 6917:ed203cd13e42 draft
(svn r10170) -Codechange: remove some duplication of code.
author | rubidium <rubidium@openttd.org> |
---|---|
date | Sat, 16 Jun 2007 12:03:36 +0000 |
parents | 13ee0ece1295 |
children | 369b70243666 |
files | projects/openttd.vcproj projects/openttd_vs80.vcproj source.list src/gfxinit.cpp |
diffstat | 4 files changed, 10 insertions(+), 36 deletions(-) [+] |
line wrap: on
line diff
--- a/projects/openttd.vcproj +++ b/projects/openttd.vcproj @@ -989,14 +989,14 @@ RelativePath=".\..\src\blitter\8bpp_simple.hpp"> </File> <File + RelativePath=".\..\src\blitter\blitter.hpp"> + </File> + <File RelativePath=".\..\src\blitter\null.cpp"> </File> <File RelativePath=".\..\src\blitter\null.hpp"> </File> - <File - RelativePath=".\..\src\blitter\blitter.hpp"> - </File> </Filter> <Filter Name="Sprite loaders"
--- a/projects/openttd_vs80.vcproj +++ b/projects/openttd_vs80.vcproj @@ -1540,6 +1540,10 @@ > </File> <File + RelativePath=".\..\src\blitter\blitter.hpp" + > + </File> + <File RelativePath=".\..\src\blitter\null.cpp" > </File> @@ -1547,10 +1551,6 @@ RelativePath=".\..\src\blitter\null.hpp" > </File> - <File - RelativePath=".\..\src\blitter\blitter.hpp" - > - </File> </Filter> <Filter Name="Sprite loaders"
--- a/source.list +++ b/source.list @@ -300,9 +300,9 @@ 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
--- a/src/gfxinit.cpp +++ b/src/gfxinit.cpp @@ -114,33 +114,7 @@ * 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 @@ 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);