Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Ryan Newell 2014-10-14 21:13:16 -05:00
commit 61871358c2
3 changed files with 13 additions and 3 deletions

View File

@ -35,6 +35,7 @@ local function singleplayer_refresh_gamebar()
for j=1,#gamemgr.games,1 do
if ("game_btnbar_" .. gamemgr.games[j].id == key) then
mm_texture.update("singleplayer", gamemgr.games[j])
core.set_topleft_text(gamemgr.games[j].name)
core.setting_set("menu_last_game",gamemgr.games[j].id)
menudata.worldlist:set_filtercriteria(gamemgr.games[j].id)
return true

View File

@ -32,7 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
Server build: servermain.cpp
*/
enum TimePrecision {
PRECISION_SECONDS,
PRECISION_SECONDS = 0,
PRECISION_MILLI,
PRECISION_MICRO,
PRECISION_NANO

View File

@ -44,8 +44,17 @@ u32 TimeTaker::stop(bool quiet)
}
else
{
if(quiet == false)
infostream<<m_name<<" took "<<dtime<<"ms"<<std::endl;
if (!quiet) {
static const char* const units[] = {
"s" /* PRECISION_SECONDS */,
"ms" /* PRECISION_MILLI */,
"us" /* PRECISION_MICRO */,
"ns" /* PRECISION_NANO */,
};
infostream << m_name << " took "
<< dtime << units[m_precision]
<< std::endl;
}
}
m_running = false;
return dtime;