diff options
| author | oy <Tom_Adams@web.de> | 2011-01-06 22:18:19 +0100 |
|---|---|---|
| committer | oy <Tom_Adams@web.de> | 2011-01-06 22:18:19 +0100 |
| commit | f8b1edca646b14f5c7cbae71a2cd20d42c1fd705 (patch) | |
| tree | 2e23cd0a0a7e0adc820f7020d2897bacdf9e29b0 /src/game/client | |
| parent | 7487a22956680c601e57b9a0edd93eda1e33e287 (diff) | |
| download | zcatch-f8b1edca646b14f5c7cbae71a2cd20d42c1fd705.tar.gz zcatch-f8b1edca646b14f5c7cbae71a2cd20d42c1fd705.zip | |
show error message for all content that could not be loaded. Closes #257
Diffstat (limited to 'src/game/client')
| -rw-r--r-- | src/game/client/gameclient.cpp | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/game/client/gameclient.cpp b/src/game/client/gameclient.cpp index be791284..84ca77b1 100644 --- a/src/game/client/gameclient.cpp +++ b/src/game/client/gameclient.cpp @@ -222,8 +222,6 @@ void CGameClient::OnConsoleInit() void CGameClient::OnInit() { - //m_pServerBrowser = Kernel()->RequestInterface<IServerBrowser>(); - // set the language g_Localization.Load(g_Config.m_ClLanguagefile, Storage(), Console()); @@ -238,15 +236,17 @@ void CGameClient::OnInit() int64 Start = time_get(); // load default font - static CFont *pDefaultFont; - //default_font = gfx_font_load("data/fonts/sazanami-gothic.ttf"); - + static CFont *pDefaultFont = 0; char aFilename[512]; IOHANDLE File = Storage()->OpenFile("fonts/DejaVuSans.ttf", IOFLAG_READ, IStorage::TYPE_ALL, aFilename, sizeof(aFilename)); if(File) + { io_close(File); - pDefaultFont = TextRender()->LoadFont(aFilename); - TextRender()->SetDefaultFont(pDefaultFont); + pDefaultFont = TextRender()->LoadFont(aFilename); + TextRender()->SetDefaultFont(pDefaultFont); + } + if(!pDefaultFont) + Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "gameclient", "failed to load font. filename='fonts/DejaVuSans.ttf'"); g_Config.m_ClThreadsoundloading = 0; @@ -264,8 +264,10 @@ void CGameClient::OnInit() gs_LoadCurrent++; } + // load skins ::gs_Skins.Init(); - + if(!::gs_Skins.Num()) + Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "gameclient", "failed to load skins. folder='skins/'"); // TODO: Refactor: fix threaded loading of sounds again // load sounds @@ -277,8 +279,8 @@ void CGameClient::OnInit() g_GameClient.m_pMenus->RenderLoading(gs_LoadCurrent/(float)gs_LoadTotal); for(int i = 0; i < g_pData->m_aSounds[s].m_NumSounds; i++) { - int id = Sound()->LoadWV(g_pData->m_aSounds[s].m_aSounds[i].m_pFilename); - g_pData->m_aSounds[s].m_aSounds[i].m_Id = id; + int Id = Sound()->LoadWV(g_pData->m_aSounds[s].m_aSounds[i].m_pFilename); + g_pData->m_aSounds[s].m_aSounds[i].m_Id = Id; } if(DoRender) |