Skip to content

Commit

Permalink
Cleanup|All Games|Plugins: Replacing use of Con_Message with App_Log
Browse files Browse the repository at this point in the history
Applying log entry metadata flags.
  • Loading branch information
skyjake committed Jan 12, 2014
1 parent 6cec9bb commit eaea5fd
Show file tree
Hide file tree
Showing 21 changed files with 82 additions and 137 deletions.
2 changes: 1 addition & 1 deletion doomsday/plugins/directsound/src/driver_directsound.cpp
Expand Up @@ -147,7 +147,7 @@ static IDirectSound3DBuffer8* get3DBuffer(IDirectSoundBuffer8* buf8)
if(FAILED(hr = buf8->QueryInterface(IID_IDirectSound3DBuffer8,
(LPVOID*) &buf3d)))
{
Con_Message("dsDirectSound::get3DBuffer: Failed to get 3D interface (0x%x).", hr);
App_Log(DE2_DEV_AUDIO_WARNING, "[DirectSound] get3DBuffer: Failed to get 3D interface (0x%x)", hr);
buf3d = NULL;
}

Expand Down
8 changes: 4 additions & 4 deletions doomsday/plugins/doom/src/d_main.c
Expand Up @@ -482,7 +482,7 @@ void D_PostInit(void)
if(p && p < myargc - 1 && deathmatch)
{
int time = atoi(CommandLine_At(p + 1));
Con_Message("Maps will end after %d %s", time, time == 1? "minute" : "minutes");
App_Log(DE2_LOG_NOTE, "Maps will end after %d %s", time, time == 1? "minute" : "minutes");
}

// Turbo option.
Expand All @@ -500,7 +500,7 @@ void D_PostInit(void)
if(scale > 400)
scale = 400;

Con_Message("turbo scale: %i%%", scale);
App_Log(DE2_MAP_NOTE, "Turbo scale: %i%%", scale);
turboMul = scale / 100.f;
}

Expand Down Expand Up @@ -551,9 +551,9 @@ void D_PostInit(void)
if(autoStart)
{
if(gameModeBits & (GM_ANY_DOOM2|GM_DOOM_CHEX))
Con_Message("Warp to Map %d, Skill %d", startMap+1, startSkill);
App_Log(DE2_LOG_NOTE, "Autostart in Map %d, Skill %d", startMap+1, startSkill);
else
Con_Message("Warp to Episode %d, Map %d, Skill %d", startEpisode+1, startMap+1, startSkill);
App_Log(DE2_LOG_NOTE, "Autostat in Episode %d, Map %d, Skill %d", startEpisode+1, startMap+1, startSkill);
}

// Validate episode and map.
Expand Down
10 changes: 3 additions & 7 deletions doomsday/plugins/doom/src/d_refresh.c
Expand Up @@ -174,7 +174,9 @@ dd_bool R_ViewFilterColor(float rgba[4], int filter)
}

if(filter)
Con_Message("R_ViewFilterColor: Real strange filter number: %d.", filter);
{
App_Log(DE2_GL_WARNING, "Invalid view filter number: %d", filter);
}

return false;
}
Expand All @@ -187,12 +189,7 @@ void R_UpdateViewFilter(int player)
int palette = 0;

if(player < 0 || player >= MAXPLAYERS)
{
#if _DEBUG
Con_Message("Warning: R_UpdateViewFilter: Invalid player #%i, ignoring.", player);
#endif
return;
}

// Not currently present?
if(!plr->plr->inGame) return;
Expand Down Expand Up @@ -344,7 +341,6 @@ void Mobj_UpdateColorMap(mobj_t* mo)
if(mo->flags & MF_TRANSLATION)
{
mo->tmap = (mo->flags & MF_TRANSLATION) >> MF_TRANSSHIFT;
//Con_Message("Mobj %i color tmap:%i", mo->thinker.id, mo->tmap);
}
else
{
Expand Down
8 changes: 4 additions & 4 deletions doomsday/plugins/doom/src/m_cheat.c
Expand Up @@ -684,20 +684,20 @@ D_CMD(CheatWhere)
Uri_Delete(mapUri);

// Also print some information to the console.
Con_Message("%s", textBuffer);
App_Log(DE2_MAP_NOTE, "%s", textBuffer);

sector = Mobj_Sector(plr->plr->mo);
uri = Materials_ComposeUri(P_GetIntp(sector, DMU_FLOOR_MATERIAL));
path = Uri_ToString(uri);
Con_Message(" FloorZ:%g Material:%s", P_GetDoublep(sector, DMU_FLOOR_HEIGHT), Str_Text(path));
App_Log(DE2_MAP_MSG, "FloorZ:%g Material:%s", P_GetDoublep(sector, DMU_FLOOR_HEIGHT), Str_Text(path));
Uri_Delete(uri);

uri = Materials_ComposeUri(P_GetIntp(sector, DMU_CEILING_MATERIAL));
path = Uri_ToString(uri);
Con_Message(" CeilingZ:%g Material:%s", P_GetDoublep(sector, DMU_CEILING_HEIGHT), Str_Text(path));
App_Log(DE2_MAP_MSG, "CeilingZ:%g Material:%s", P_GetDoublep(sector, DMU_CEILING_HEIGHT), Str_Text(path));
Uri_Delete(uri);

Con_Message("Player height:%g Player radius:%g",
App_Log(DE2_MAP_MSG, "Player height:%g Player radius:%g",
plr->plr->mo->height, plr->plr->mo->radius);

return true;
Expand Down
4 changes: 2 additions & 2 deletions doomsday/plugins/doom/src/p_inter.c
Expand Up @@ -937,8 +937,8 @@ void P_TouchSpecialMobj(mobj_t* special, mobj_t* toucher)
}
else
{
Con_Message("P_TouchSpecialMobj: Unknown gettable thing %i.",
(int) special->type);
App_Log(DE2_MAP_WARNING, "P_TouchSpecialMobj: Unknown gettable thing %i",
(int) special->type);
}

if(special->flags & MF_COUNTITEM)
Expand Down
6 changes: 2 additions & 4 deletions doomsday/plugins/doom/src/p_pspr.c
Expand Up @@ -157,10 +157,8 @@ void P_BringUpWeapon(player_t* player)

wminfo = WEAPON_INFO(raiseWeapon, player->class_, 0);

#if _DEBUG
Con_Message("P_BringUpWeapon: Player %i, pending weapon was %i, weapon pspr to %i",
(int)(player - players), oldPendingWeapon, wminfo->states[WSN_UP]);
#endif
App_Log(DE2_MAP_XVERBOSE, "P_BringUpWeapon: Player %i, pending weapon was %i, weapon pspr to %i",
(int)(player - players), oldPendingWeapon, wminfo->states[WSN_UP]);

if(wminfo->raiseSound)
S_StartSoundEx(wminfo->raiseSound, player->plr->mo);
Expand Down
11 changes: 6 additions & 5 deletions doomsday/plugins/doom/src/p_spec.c
Expand Up @@ -181,7 +181,8 @@ static void loadAnimDefs(animdef_t* animDefs, dd_bool isCustom)
numFrames = endFrame - startFrame + 1;
if(numFrames < 2)
{
Con_Message("Warning: loadAnimDefs: Bad cycle from '%s' to '%s' in sequence #%i, ignoring.", animDefs[i].startname, animDefs[i].endname, i);
App_Log(DE2_RES_WARNING, "loadAnimDefs: Bad cycle from '%s' to '%s' in sequence #%i",
animDefs[i].startname, animDefs[i].endname, i);
continue;
}

Expand All @@ -196,11 +197,11 @@ static void loadAnimDefs(animdef_t* animDefs, dd_bool isCustom)
*/
ticsPerFrame = LONG(animDefs[i].speed);

if(verbose > (isCustom? 1 : 2))
{
AutoStr* from = Uri_ToString(startUri);
AutoStr* to = Uri_ToString(endUri);
Con_Message(" %d: From:\"%s\" To:\"%s\" Tics:%i", i, Str_Text(from), Str_Text(to), ticsPerFrame);
App_Log(isCustom? DE2_RES_VERBOSE : DE2_RES_XVERBOSE,
" %d: From:\"%s\" To:\"%s\" Tics:%i", i, Str_Text(from), Str_Text(to), ticsPerFrame);
}

// Find an animation group for this.
Expand Down Expand Up @@ -238,13 +239,13 @@ void P_InitPicAnims(void)
* Support for this extension should be considered depreciated.
* All new features should be added, accessed via DED.
*/
VERBOSE( Con_Message("Processing lump %s::ANIMATED...", F_PrettyPath(Str_Text(W_LumpSourceFile(lumpNum)))) )
App_Log(DE2_RES_VERBOSE, "Processing lump %s::ANIMATED", F_PrettyPath(Str_Text(W_LumpSourceFile(lumpNum))));
loadAnimDefs((animdef_t*)W_CacheLump(lumpNum), true);
W_UnlockLump(lumpNum);
return;
}}

VERBOSE( Con_Message("Registering default texture animations...") );
App_Log(DE2_DEV_RES_VERBOSE, "Registering default texture animations...");
loadAnimDefs(animsShared, false);
}

Expand Down
5 changes: 2 additions & 3 deletions doomsday/plugins/doom/src/p_telept.c
Expand Up @@ -182,9 +182,8 @@ int EV_Teleport(Line* line, int side, mobj_t* mo, dd_bool spawnFog)

//mo->dPlayer->clAngle = mo->angle; /* $unifiedangles */
mo->dPlayer->flags |= DDPF_FIXANGLES | DDPF_FIXORIGIN | DDPF_FIXMOM;
#ifdef _DEBUG
Con_Message("EV_Teleport: Player %p set FIX flags.", mo->dPlayer);
#endif

App_Log(DE2_DEV_NET_VERBOSE, "EV_Teleport: Player %p set FIX flags", mo->dPlayer);
}

return 1;
Expand Down
27 changes: 8 additions & 19 deletions doomsday/plugins/doom/src/st_stuff.c
Expand Up @@ -524,17 +524,10 @@ void ST_HUDUnHide(int player, hueevent_t ev)
player_t* plr;

if(player < 0 || player >= MAXPLAYERS)
{
#if _DEBUG
Con_Message("Warning: ST_HUDUnHide: Invalid player #%i, ignoring.", player);
#endif
return;
}
if(ev < HUE_FORCE || ev > NUMHUDUNHIDEEVENTS)
{
#if _DEBUG
Con_Message("Warning: ST_HUDUnHide: Invalid event type %i, ignoring.", (int) ev);
#endif
DENG_ASSERT(!"ST_HUDUnHide: Invalid event type");
return;
}

Expand Down Expand Up @@ -2633,12 +2626,8 @@ void ST_Drawer(int player)
hudstate_t* hud;

if(player < 0 || player >= MAXPLAYERS)
{
#if _DEBUG
Con_Message("Warning: ST_Drawer: Invalid player #%i, ignoring.", player);
#endif
return;
}

if(!players[player].plr->inGame) return;

R_UpdateViewFilter(player);
Expand Down Expand Up @@ -3389,7 +3378,7 @@ D_CMD(ChatOpen)
destination = UIChat_ParseDestination(argv[1]);
if(destination < 0)
{
Con_Message("Invalid team number #%i, valid range: [0..%i).", destination, NUMTEAMS);
App_Log(DE2_SCR_ERROR, "Invalid team number #%i (valid range: 0...%i)", destination, NUMTEAMS);
return false;
}
}
Expand Down Expand Up @@ -3433,9 +3422,9 @@ D_CMD(ChatSendMacro)

if(argc < 2 || argc > 3)
{
Con_Message("Usage: %s (team) (macro number)", argv[0]);
Con_Message("Send a chat macro to other player(s).\n"
"If (team) is omitted, the message will be sent to all players.");
App_Log(DE2_SCR_NOTE, "Usage: %s (team) (macro number)", argv[0]);
App_Log(DE2_SCR_MSG, "Send a chat macro to other player(s). "
"If (team) is omitted, the message will be sent to all players.");
return true;
}

Expand All @@ -3447,15 +3436,15 @@ D_CMD(ChatSendMacro)
destination = UIChat_ParseDestination(argv[1]);
if(destination < 0)
{
Con_Message("Invalid team number #%i, valid range: [0..%i).", destination, NUMTEAMS);
App_Log(DE2_SCR_ERROR, "Invalid team number #%i (valid range: 0...%i)", destination, NUMTEAMS);
return false;
}
}

macroId = UIChat_ParseMacroId(argc == 3? argv[2] : argv[1]);
if(-1 == macroId)
{
Con_Message("Invalid macro id.");
App_Log(DE2_SCR_ERROR, "Invalid macro id");
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions doomsday/plugins/doom64/src/d_main.c
Expand Up @@ -445,8 +445,8 @@ void D_PostInit(void)
// Are we autostarting?
if(autoStart)
{
Con_Message("Warp to Episode %d, Map %d, Skill %d", startEpisode+1,
startMap+1, startSkill);
App_Log(DE2_LOG_NOTE, "Warp to Episode %d, Map %d, Skill %d", startEpisode+1,
startMap+1, startSkill);
}

// Validate episode and map.
Expand Down
9 changes: 3 additions & 6 deletions doomsday/plugins/doom64/src/d_refresh.c
Expand Up @@ -142,7 +142,9 @@ dd_bool R_ViewFilterColor(float rgba[4], int filter)
}

if(filter)
Con_Message("R_ViewFilterColor: Real strange filter number: %d.", filter);
{
App_Log(DE2_GL_WARNING, "Invalid view filter number: %d", filter);
}

return false;
}
Expand All @@ -155,12 +157,7 @@ void R_UpdateViewFilter(int player)
int palette = 0, cnt, bzc;

if(player < 0 || player >= MAXPLAYERS)
{
#if _DEBUG
Con_Message("Warning: R_UpdateViewFilter: Invalid player #%i, ignoring.", player);
#endif
return;
}

// Not currently present?
if(!plr->plr->inGame) return;
Expand Down
6 changes: 2 additions & 4 deletions doomsday/plugins/doom64/src/p_pspr.c
Expand Up @@ -166,10 +166,8 @@ void P_BringUpWeapon(player_t* player)

wminfo = WEAPON_INFO(raiseWeapon, player->class_, 0);

#if _DEBUG
Con_Message("P_BringUpWeapon: Player %i, pending weapon was %i, weapon pspr to %i",
(int)(player - players), oldPendingWeapon, wminfo->states[WSN_UP]);
#endif
App_Log(DE2_MAP_XVERBOSE, "P_BringUpWeapon: Player %i, pending weapon was %i, weapon pspr to %i",
(int)(player - players), oldPendingWeapon, wminfo->states[WSN_UP]);

if(wminfo->raiseSound)
S_StartSoundEx(wminfo->raiseSound, player->plr->mo);
Expand Down
16 changes: 5 additions & 11 deletions doomsday/plugins/heretic/src/p_inter.c
Expand Up @@ -929,8 +929,8 @@ void P_TouchSpecialMobj(mobj_t *special, mobj_t *toucher)
}
else
{
Con_Message("P_TouchSpecialMobj: Unknown gettable thing %i.",
(int) special->type);
App_Log(DE2_MAP_WARNING, "P_TouchSpecialMobj: Unknown gettable thing %i",
(int) special->type);
}

if(special->flags & MF_COUNTITEM)
Expand Down Expand Up @@ -1073,9 +1073,7 @@ dd_bool P_MorphPlayer(player_t *player)

DENG_ASSERT(player != 0);

#ifdef _DEBUG
Con_Message("P_MorphPlayer: Player %i.", (int)(player - players));
#endif
App_Log(DE2_DEV_MAP_MSG, "P_MorphPlayer: Player %i", (int)(player - players));

if(player->morphTics)
{
Expand Down Expand Up @@ -1279,15 +1277,11 @@ int P_DamageMobj2(mobj_t *target, mobj_t *inflictor, mobj_t *source,
return 0;
}

#ifdef _DEBUG
Con_Message("P_DamageMobj2: Damaging %i with %i points.", target->thinker.id, damage);
#endif
App_Log(DE2_DEV_MAP_VERBOSE, "Damaging mobj %i with %i points", target->thinker.id, damage);

if(!(target->flags & MF_SHOOTABLE))
{
#ifdef _DEBUG
Con_Message("P_DamageMobj2: Target %i is not shootable!", target->thinker.id);
#endif
App_Log(DE2_DEV_MAP_WARNING, "P_DamageMobj2: Target %i is not shootable!", target->thinker.id);
return 0; // Shouldn't happen...
}

Expand Down
23 changes: 9 additions & 14 deletions doomsday/plugins/heretic/src/p_mobj.c
Expand Up @@ -454,10 +454,11 @@ void P_MobjMoveZ(mobj_t *mo)
{
if(!P_CheckPosition(mo, mo->origin))
{
#ifdef _DEBUG
Con_Message("Floating thing %i has gotten stuck! onmobj=%i z=%f flz=%f tmfz=%f",
mo->thinker.id, mo->onMobj? mo->onMobj->thinker.id : 0, mo->origin[VZ], mo->floorZ, tmFloorZ);
#endif
App_Log(DE2_DEV_MAP_WARNING, "Floating thing %i has gotten stuck!");
App_Log(DE2_DEV_MAP_MSG, " onmobj=%i z=%f flz=%f tmfz=%f", mo->thinker.id,
mo->onMobj? mo->onMobj->thinker.id : 0, mo->origin[VZ],
mo->floorZ, tmFloorZ);

if(mo->origin[VZ] < tmFloorZ)
{
mo->origin[VZ] = mo->floorZ = tmFloorZ;
Expand Down Expand Up @@ -1076,16 +1077,12 @@ void P_RepositionMace(mobj_t *mo)
Sector *sector;

DENG_ASSERT(mo && mo->type == MT_WMACE);
#if _DEBUG
Con_Message("P_RepositionMace: Repositioning mobj [%p], thinkerId:%i.", mo, mo->thinker.id);
#endif
App_Log(DE2_DEV_MAP_MSG, "P_RepositionMace: Repositioning mobj [%p], thinkerId:%i", mo, mo->thinker.id);

mapSpot = P_ChooseRandomMaceSpot();
if(!mapSpot)
{
#if _DEBUG
Con_Message("P_RepositionMace: Failed to choose a map spot, aborting...");
#endif
App_Log(DE2_DEV_MAP_WARNING, "P_RepositionMace: Failed to choose a map spot, aborting...");
return;
}

Expand All @@ -1102,10 +1099,8 @@ void P_RepositionMace(mobj_t *mo)
}
P_MobjLink(mo);

#if _DEBUG
Con_Message("P_RepositionMace: Mobj [%p], thinkerId:%i - now at (%.2f, %.2f, %.2f).",
mo, mo->thinker.id, mo->origin[VX], mo->origin[VY], mo->origin[VZ]);
#endif
App_Log(DE2_DEV_MAP_MSG, "P_RepositionMace: Mobj [%p], thinkerId:%i - now at (%.2f, %.2f, %.2f)",
mo, mo->thinker.id, mo->origin[VX], mo->origin[VY], mo->origin[VZ]);
}

void P_SpawnBloodSplatter(coord_t x, coord_t y, coord_t z, mobj_t* originator)
Expand Down

0 comments on commit eaea5fd

Please sign in to comment.