Skip to content

Commit

Permalink
Locate game resources in busy mode
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Jan 7, 2012
1 parent 40f96f9 commit 8e9b458
Showing 1 changed file with 28 additions and 7 deletions.
35 changes: 28 additions & 7 deletions doomsday/engine/portable/src/dd_main.c
Expand Up @@ -1354,6 +1354,24 @@ int DD_EarlyInit(void)
return true;
}

static int DD_LocateAllGameResourcesWorker(void* paramaters)
{
int i;
for(i = 0; i < gamesCount; ++i)
{
Game* game = games[i];

VERBOSE( Con_Printf("Locating resources for \"%s\"...\n", Str_Text(Game_Title(game))) )

locateGameResources(game);
Con_SetProgress((i+1) * 200/gamesCount -1);

VERBOSE( DD_PrintGame(game, PGF_LIST_STARTUP_RESOURCES|PGF_STATUS) )
}
Con_BusyWorkerEnd();
return 0;
}

/**
* Engine initialization. When complete, starts the "game loop".
*/
Expand Down Expand Up @@ -1458,8 +1476,7 @@ int DD_Main(void)
Con_Busy(BUSYF_STARTUP | BUSYF_PROGRESS_BAR | BUSYF_ACTIVITY | (verbose? BUSYF_CONSOLE_OUTPUT : 0),
"Buffering...", DD_DummyWorker, 0);

// Unless we reenter busy-mode due to automatic game selection, we won't be
// drawing anything further until DD_GameLoop; so lets clean up.
// Clean up.
if(!novideo)
{
glClear(GL_COLOR_BUFFER_BIT);
Expand Down Expand Up @@ -1496,12 +1513,16 @@ int DD_Main(void)
}}

// Try to locate all required data files for all registered games.
for(i = 0; i < gamesCount; ++i)
Con_InitProgress(200);
Con_Busy(BUSYF_STARTUP | BUSYF_PROGRESS_BAR | BUSYF_PROGRESS_BAR | (verbose? BUSYF_CONSOLE_OUTPUT : 0),
"Locating game resources...", DD_LocateAllGameResourcesWorker, 0);

// Unless we reenter busy-mode due to automatic game selection, we won't be
// drawing anything further until DD_GameLoop; so lets clean up.
if(!novideo)
{
Game* game = games[i];
VERBOSE( Con_Printf("Locating resources for \"%s\"...\n", Str_Text(Game_Title(game))) );
locateGameResources(game);
VERBOSE( DD_PrintGame(game, PGF_LIST_STARTUP_RESOURCES|PGF_STATUS) );
glClear(GL_COLOR_BUFFER_BIT);
GL_DoUpdate();
}

// Attempt automatic game selection.
Expand Down

0 comments on commit 8e9b458

Please sign in to comment.