diff options
author | rubidium <rubidium@openttd.org> | 2009-08-09 16:54:03 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-08-09 16:54:03 +0000 |
commit | f1189326439122811d9db35674d7f356575d2863 (patch) | |
tree | c7d33d19bdcdd2ce5fd05d86f63d51fdbca4de61 /src/openttd.cpp | |
parent | b7e746f72cf41992d86417f7f44917a5d380bcdd (diff) | |
download | openttd-f1189326439122811d9db35674d7f356575d2863.tar.xz |
(svn r17133) -Codechange: generalise the code that searches for base graphics
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r-- | src/openttd.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp index 046717db5..e77a781a1 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -21,6 +21,7 @@ #include "sound_func.h" #include "window_func.h" +#include "base_media_base.h" #include "saveload/saveload.h" #include "landscape.h" #include "company_func.h" @@ -183,7 +184,7 @@ static void ShowHelp() ); /* List the graphics packs */ - p = GetGraphicsSetsList(p, lastof(buf)); + p = BaseGraphics::GetSetsList(p, lastof(buf)); /* List the drivers */ p = VideoDriverFactoryBase::GetDriversInfo(p, lastof(buf)); @@ -524,7 +525,7 @@ int ttd_main(int argc, char *argv[]) * We can't do them earlier because then we can't show it on * the debug console as that hasn't been configured yet. */ DeterminePaths(argv[0]); - FindGraphicsSets(); + BaseGraphics::FindSets(); ShowHelp(); return 0; } @@ -536,7 +537,7 @@ int ttd_main(int argc, char *argv[]) #endif DeterminePaths(argv[0]); - FindGraphicsSets(); + BaseGraphics::FindSets(); #if defined(UNIX) && !defined(__MORPHOS__) /* We must fork here, or we'll end up without some resources we need (like sockets) */ @@ -593,8 +594,8 @@ int ttd_main(int argc, char *argv[]) /* This must be done early, since functions use the InvalidateWindow* calls */ InitWindowSystem(); - if (graphics_set == NULL && _ini_graphics_set != NULL) graphics_set = strdup(_ini_graphics_set); - if (!SetGraphicsSet(graphics_set)) { + if (graphics_set == NULL && BaseGraphics::ini_set != NULL) graphics_set = strdup(BaseGraphics::ini_set); + if (!BaseGraphics::SetSet(graphics_set)) { StrEmpty(graphics_set) ? usererror("Failed to find a graphics set. Please acquire a graphics set for OpenTTD.") : usererror("Failed to select requested graphics set '%s'", graphics_set); @@ -727,7 +728,7 @@ int ttd_main(int argc, char *argv[]) /* Reset windowing system, stop drivers, free used memory, ... */ ShutdownGame(); - free(_ini_graphics_set); + free(const_cast<char *>(BaseGraphics::ini_set)); free(_ini_musicdriver); free(_ini_sounddriver); free(_ini_videodriver); |