show error message for all content that could not be loaded. Closes #257

This commit is contained in:
oy 2011-01-06 22:18:19 +01:00
parent 7487a22956
commit f8b1edca64
3 changed files with 14 additions and 12 deletions

View file

@ -389,7 +389,7 @@ int CGraphics_OpenGL::LoadPNG(CImageInfo *pImg, const char *pFilename, int Stora
io_close(File);
else
{
dbg_msg("game/png", "failed to open file. filename='%s'", aCompleteFilename);
dbg_msg("game/png", "failed to open file. filename='%s'", pFilename);
return 0;
}

View file

@ -329,7 +329,7 @@ int CSound::LoadWV(const char *pFilename)
ms_File = m_pStorage->OpenFile(pFilename, IOFLAG_READ, IStorage::TYPE_ALL);
if(!ms_File)
{
dbg_msg("sound/wv", "failed to open %s", pFilename);
dbg_msg("sound/wv", "failed to open file. filename='%s'", pFilename);
return -1;
}

View file

@ -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)