mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-23 03:52:12 -04:00
clean interface for logging to console (#1191)
* initial implementation idea * next step * oversights * apply PRINTF_ATTR() directly to the function definition * hopefully fix format string error * simpler solution * fix linking error on windows * make default verbosity configurable * convert the first batch of printing calls * register -verbose parameter * remove ANSI color escape sequences on Windows * convert the next batch of print calls * fix omplicit declaration in i_sound.c * d_main.c * convert some more files, trailing space means no newline * some more conversions, some comments * more conversions * final conversions? * remove some more explicit newlines * fix typo/forgetto
This commit is contained in:
parent
445ab3e208
commit
c33014ff89
@ -40,6 +40,7 @@ set(WOOF_SOURCES
|
||||
i_oalsound.c i_oalsound.h
|
||||
i_oalstream.h
|
||||
i_oplmusic.c
|
||||
i_printf.c i_printf.h
|
||||
i_sndfile.c i_sndfile.h
|
||||
i_sound.c i_sound.h
|
||||
i_system.c i_system.h
|
||||
@ -214,6 +215,7 @@ target_compile_definitions(woof PRIVATE MINIZ_NO_TIME)
|
||||
set(SETUP_SOURCES
|
||||
d_iwad.c d_iwad.h
|
||||
i_main.c
|
||||
i_printf.c i_printf.h
|
||||
i_system.c i_system.h
|
||||
i_timer.c i_timer.h
|
||||
m_argv.c m_argv.h
|
||||
|
@ -24,6 +24,7 @@
|
||||
// killough 5/2/98: fixed headers, removed rendunant external declarations:
|
||||
#include "doomdef.h"
|
||||
#include "doomstat.h"
|
||||
#include "i_printf.h"
|
||||
#include "sounds.h"
|
||||
#include "info.h"
|
||||
#include "m_argv.h" // [FG] M_CheckParm()
|
||||
@ -1573,7 +1574,7 @@ void ProcessDehFile(const char *filename, char *outfilename, int lumpnum)
|
||||
else
|
||||
if (!(fileout=M_fopen(outfilename, firstfile ? "wt" : "at")))
|
||||
{
|
||||
printf("Could not open -dehout file %s\n... using stdout.\n",
|
||||
I_Printf(VB_WARNING, "Could not open -dehout file %s\n... using stdout.",
|
||||
outfilename);
|
||||
fileout = stdout;
|
||||
}
|
||||
@ -1588,7 +1589,7 @@ void ProcessDehFile(const char *filename, char *outfilename, int lumpnum)
|
||||
|
||||
if (!(infile.file = M_fopen(filename,"rt")))
|
||||
{
|
||||
printf("-deh file %s not found\n",filename);
|
||||
I_Printf(VB_WARNING, "-deh file %s not found",filename);
|
||||
return; // should be checked up front anyway
|
||||
}
|
||||
|
||||
@ -1607,7 +1608,7 @@ void ProcessDehFile(const char *filename, char *outfilename, int lumpnum)
|
||||
// [FG] skip empty DEHACKED lumps
|
||||
if (!buf)
|
||||
{
|
||||
printf("skipping empty DEHACKED lump from file %s\n", filename);
|
||||
I_Printf(VB_DEBUG, "skipping empty DEHACKED lump from file %s", filename);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1615,7 +1616,7 @@ void ProcessDehFile(const char *filename, char *outfilename, int lumpnum)
|
||||
infile.file = NULL;
|
||||
}
|
||||
|
||||
printf("Loading DEH %sfile %s\n", infile.lump ? "lump from " : "", filename);
|
||||
I_Printf(VB_INFO, "Loading DEH %sfile %s", infile.lump ? "lump from " : "", filename);
|
||||
if (fileout) fprintf(fileout,"\nLoading DEH file %s\n\n",filename);
|
||||
|
||||
// loop until end of file
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "d_loop.h"
|
||||
#include "d_ticcmd.h"
|
||||
|
||||
#include "i_printf.h"
|
||||
#include "i_system.h"
|
||||
#include "i_video.h"
|
||||
|
||||
@ -254,7 +255,7 @@ static void D_Disconnected(void)
|
||||
|
||||
// disconnected from server
|
||||
|
||||
printf("Disconnected from server.\n");
|
||||
I_Printf(VB_INFO, "Disconnected from server.");
|
||||
}
|
||||
|
||||
//
|
||||
@ -512,7 +513,7 @@ boolean D_InitNetGame(net_connect_data_t *connect_data)
|
||||
NET_AddrToString(addr), net_client_reject_reason);
|
||||
}
|
||||
|
||||
printf("D_InitNetGame: Connected to %s\n", NET_AddrToString(addr));
|
||||
I_Printf(VB_INFO, "D_InitNetGame: Connected to %s", NET_AddrToString(addr));
|
||||
NET_ReleaseAddress(addr);
|
||||
|
||||
// Wait for launch message received from server.
|
||||
@ -539,7 +540,7 @@ void D_CheckNetPlaybackSkip(void)
|
||||
|
||||
if (singletics || fastdemo || PLAYBACK_SKIP)
|
||||
{
|
||||
printf("Demo playback skipping is suppressed in network game.\n");
|
||||
I_Printf(VB_INFO, "Demo playback skipping is suppressed in network game.");
|
||||
singletics = false;
|
||||
fastdemo = false;
|
||||
timingdemo = false;
|
||||
|
103
src/d_main.c
103
src/d_main.c
@ -45,6 +45,7 @@
|
||||
#include "m_misc2.h" // [FG] M_StringDuplicate()
|
||||
#include "m_menu.h"
|
||||
#include "m_swap.h"
|
||||
#include "i_printf.h"
|
||||
#include "i_system.h"
|
||||
#include "i_sound.h"
|
||||
#include "i_video.h"
|
||||
@ -584,7 +585,7 @@ static boolean D_AddZipFile(const char *file)
|
||||
memset(&zip_archive, 0, sizeof(zip_archive));
|
||||
if (!mz_zip_reader_init_file(&zip_archive, file, MZ_ZIP_FLAG_DO_NOT_SORT_CENTRAL_DIRECTORY))
|
||||
{
|
||||
I_Error("D_AddZipFile: Failed to open %s\n", file);
|
||||
I_Error("D_AddZipFile: Failed to open %s", file);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -618,7 +619,7 @@ static boolean D_AddZipFile(const char *file)
|
||||
|
||||
if (!mz_zip_reader_extract_to_file(&zip_archive, i, dest, 0))
|
||||
{
|
||||
printf("D_AddZipFile: Failed to extract %s to %s\n",
|
||||
I_Printf(VB_WARNING, "D_AddZipFile: Failed to extract %s to %s",
|
||||
file_stat.m_filename, tempdir);
|
||||
}
|
||||
|
||||
@ -828,7 +829,7 @@ static void CheckIWAD(const char *iwadname)
|
||||
|
||||
if (strncmp(header.identification, "IWAD", 4))
|
||||
{
|
||||
printf("CheckIWAD: IWAD tag not present %s\n", iwadname);
|
||||
I_Printf(VB_WARNING, "CheckIWAD: IWAD tag not present %s", iwadname);
|
||||
}
|
||||
|
||||
// read IWAD directory
|
||||
@ -971,7 +972,7 @@ void IdentifyVersion (void)
|
||||
|
||||
if (iwad && *iwad)
|
||||
{
|
||||
printf("IWAD found: %s\n",iwad); //jff 4/20/98 print only if found
|
||||
I_Printf(VB_INFO, "IWAD found: %s",iwad); //jff 4/20/98 print only if found
|
||||
|
||||
if (gamemode == indetermined)
|
||||
CheckIWAD(iwad);
|
||||
@ -980,19 +981,19 @@ void IdentifyVersion (void)
|
||||
{
|
||||
case retail:
|
||||
if (gamemission == pack_chex)
|
||||
puts("Chex(R) Quest");
|
||||
I_Printf(VB_INFO, "Chex(R) Quest");
|
||||
else if (gamemission == pack_rekkr)
|
||||
puts("REKKR");
|
||||
I_Printf(VB_INFO, "REKKR");
|
||||
else
|
||||
puts("Ultimate DOOM version"); // killough 8/8/98
|
||||
I_Printf(VB_INFO, "Ultimate DOOM version"); // killough 8/8/98
|
||||
break;
|
||||
|
||||
case registered:
|
||||
puts("DOOM Registered version");
|
||||
I_Printf(VB_INFO, "DOOM Registered version");
|
||||
break;
|
||||
|
||||
case shareware:
|
||||
puts("DOOM Shareware version");
|
||||
I_Printf(VB_INFO, "DOOM Shareware version");
|
||||
break;
|
||||
|
||||
case commercial:
|
||||
@ -1001,15 +1002,15 @@ void IdentifyVersion (void)
|
||||
switch (gamemission)
|
||||
{
|
||||
case pack_hacx:
|
||||
puts ("HACX: Twitch n' Kill");
|
||||
I_Printf(VB_INFO, "HACX: Twitch n' Kill");
|
||||
break;
|
||||
|
||||
case pack_tnt:
|
||||
puts ("Final DOOM: TNT - Evilution version");
|
||||
I_Printf(VB_INFO, "Final DOOM: TNT - Evilution version");
|
||||
break;
|
||||
|
||||
case pack_plut:
|
||||
puts ("Final DOOM: The Plutonia Experiment version");
|
||||
I_Printf(VB_INFO, "Final DOOM: The Plutonia Experiment version");
|
||||
break;
|
||||
|
||||
case doom2:
|
||||
@ -1019,10 +1020,10 @@ void IdentifyVersion (void)
|
||||
if (i>=10 && !strncasecmp(iwad+i-10,"doom2f.wad",10))
|
||||
{
|
||||
language=french;
|
||||
puts("DOOM II version, French language"); // killough 8/8/98
|
||||
I_Printf(VB_INFO, "DOOM II version, French language"); // killough 8/8/98
|
||||
}
|
||||
else
|
||||
puts("DOOM II version");
|
||||
I_Printf(VB_INFO, "DOOM II version");
|
||||
break;
|
||||
}
|
||||
// joel 10/16/88 end Final DOOM fix
|
||||
@ -1032,13 +1033,13 @@ void IdentifyVersion (void)
|
||||
}
|
||||
|
||||
if (gamemode == indetermined)
|
||||
puts("Unknown Game Version, may not work"); // killough 8/8/98
|
||||
I_Printf(VB_WARNING, "Unknown Game Version, may not work"); // killough 8/8/98
|
||||
|
||||
D_AddFile(iwad);
|
||||
putchar('\n');
|
||||
I_PutChar(VB_ALWAYS, '\n');
|
||||
}
|
||||
else
|
||||
I_Error("IWAD not found\n");
|
||||
I_Error("IWAD not found");
|
||||
}
|
||||
|
||||
// [FG] emulate a specific version of Doom
|
||||
@ -1070,12 +1071,12 @@ static void InitGameVersion(void)
|
||||
|
||||
if (gameversions[i].description == NULL)
|
||||
{
|
||||
printf("Supported game versions:\n");
|
||||
I_Printf(VB_ERROR, "Supported game versions:");
|
||||
|
||||
for (i=0; gameversions[i].description != NULL; ++i)
|
||||
{
|
||||
printf("\t%s (%s)\n", gameversions[i].cmdline,
|
||||
gameversions[i].description);
|
||||
I_Printf(VB_ERROR, "\t%s (%s)", gameversions[i].cmdline,
|
||||
gameversions[i].description);
|
||||
}
|
||||
|
||||
I_Error("Unknown game version '%s'", myargv[p+1]);
|
||||
@ -1150,7 +1151,7 @@ void FindResponseFile (void)
|
||||
if (!handle)
|
||||
I_Error("No such response file!"); // killough 10/98
|
||||
|
||||
printf("Found response file %s!\n",filename);
|
||||
I_Printf(VB_INFO, "Found response file %s!",filename);
|
||||
free(filename);
|
||||
|
||||
fseek(handle,0,SEEK_END);
|
||||
@ -1195,9 +1196,9 @@ void FindResponseFile (void)
|
||||
myargc = indexinfile;
|
||||
|
||||
// DISPLAY ARGS
|
||||
printf("%d command-line args:\n",myargc-1); // killough 10/98
|
||||
I_Printf(VB_INFO, "%d command-line args:",myargc-1); // killough 10/98
|
||||
for (k=1;k<myargc;k++)
|
||||
printf("%s\n",myargv[k]);
|
||||
I_Printf(VB_INFO, "%s",myargv[k]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1929,7 +1930,7 @@ void D_DoomMain(void)
|
||||
|
||||
if (M_CheckParm("-dedicated") > 0)
|
||||
{
|
||||
printf("Dedicated server mode.\n");
|
||||
I_Printf(VB_INFO, "Dedicated server mode.");
|
||||
I_InitTimer();
|
||||
NET_DedicatedServer();
|
||||
|
||||
@ -2047,7 +2048,7 @@ void D_DoomMain(void)
|
||||
deathmatch = 3;
|
||||
|
||||
if (devparm)
|
||||
printf(D_DEVSTR);
|
||||
I_Printf(VB_INFO, "%s", D_DEVSTR);
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
@ -2062,7 +2063,7 @@ void D_DoomMain(void)
|
||||
|
||||
if (M_CheckParm("-cdrom"))
|
||||
{
|
||||
printf(D_CDROM);
|
||||
I_Printf(VB_INFO, "%s", D_CDROM);
|
||||
M_MakeDirectory("c:\\doomdata");
|
||||
|
||||
// killough 10/98:
|
||||
@ -2092,7 +2093,7 @@ void D_DoomMain(void)
|
||||
scale = 10;
|
||||
if (scale > 400)
|
||||
scale = 400;
|
||||
printf ("turbo scale: %i%%\n",scale);
|
||||
I_Printf(VB_INFO, "turbo scale: %i%%",scale);
|
||||
forwardmove[0] = forwardmove[0]*scale/100;
|
||||
forwardmove[1] = forwardmove[1]*scale/100;
|
||||
sidemove[0] = sidemove[0]*scale/100;
|
||||
@ -2193,7 +2194,7 @@ void D_DoomMain(void)
|
||||
strcpy(file,myargv[p+1]);
|
||||
AddDefaultExtension(file,".lmp"); // killough
|
||||
D_AddFile(file);
|
||||
printf("Playing demo %s\n",file);
|
||||
I_Printf(VB_INFO, "Playing demo %s",file);
|
||||
free(file);
|
||||
}
|
||||
|
||||
@ -2264,7 +2265,7 @@ void D_DoomMain(void)
|
||||
if ((p = M_CheckParm ("-timer")) && p < myargc-1 && deathmatch)
|
||||
{
|
||||
timelimit = M_ParmArgToInt(p);
|
||||
printf("Levels will end after %d minute%s.\n", timelimit, timelimit>1 ? "s" : "");
|
||||
I_Printf(VB_INFO, "Levels will end after %d minute%s.", timelimit, timelimit>1 ? "s" : "");
|
||||
}
|
||||
|
||||
//!
|
||||
@ -2277,7 +2278,7 @@ void D_DoomMain(void)
|
||||
if ((p = M_CheckParm ("-avg")) && p < myargc-1 && deathmatch)
|
||||
{
|
||||
timelimit = 20;
|
||||
puts("Austin Virtual Gaming: Levels will end after 20 minutes");
|
||||
I_Printf(VB_INFO, "Austin Virtual Gaming: Levels will end after 20 minutes.");
|
||||
}
|
||||
|
||||
//!
|
||||
@ -2377,18 +2378,19 @@ void D_DoomMain(void)
|
||||
if ((p = M_CheckParm("-dumplumps")) && p < myargc-1)
|
||||
WritePredefinedLumpWad(myargv[p+1]);
|
||||
|
||||
puts("M_LoadDefaults: Load system defaults.");
|
||||
I_Printf(VB_INFO, "M_LoadDefaults: Load system defaults.");
|
||||
M_LoadDefaults(); // load before initing other systems
|
||||
I_InitPrintf();
|
||||
|
||||
bodyquesize = default_bodyquesize; // killough 10/98
|
||||
|
||||
// 1/18/98 killough: Z_Init call moved to i_main.c
|
||||
|
||||
// init subsystems
|
||||
puts("V_Init: allocate screens."); // killough 11/98: moved down to here
|
||||
I_Printf(VB_INFO, "V_Init: allocate screens."); // killough 11/98: moved down to here
|
||||
V_Init();
|
||||
|
||||
puts("W_Init: Init WADfiles.");
|
||||
I_Printf(VB_INFO, "W_Init: Init WADfiles.");
|
||||
W_InitMultipleFiles(wadfiles);
|
||||
|
||||
// Check for wolf levels
|
||||
@ -2427,7 +2429,7 @@ void D_DoomMain(void)
|
||||
|
||||
D_ProcessInWads("BRGHTMPS", R_ParseBrightmaps, false);
|
||||
|
||||
putchar('\n'); // killough 3/6/98: add a newline, by popular demand :)
|
||||
I_PutChar(VB_INFO, '\n'); // killough 3/6/98: add a newline, by popular demand :)
|
||||
|
||||
// Moved after WAD initialization because we are checking the COMPLVL lump
|
||||
G_ReloadDefaults(false); // killough 3/4/98: set defaults just loaded.
|
||||
@ -2475,11 +2477,11 @@ void D_DoomMain(void)
|
||||
|
||||
// Ty 04/08/98 - Add 5 lines of misc. data, only if nonblank
|
||||
// The expectation is that these will be set in a .bex file
|
||||
if (*startup1) puts(startup1);
|
||||
if (*startup2) puts(startup2);
|
||||
if (*startup3) puts(startup3);
|
||||
if (*startup4) puts(startup4);
|
||||
if (*startup5) puts(startup5);
|
||||
if (*startup1) I_Printf(VB_INFO, "%s", startup1);
|
||||
if (*startup2) I_Printf(VB_INFO, "%s", startup2);
|
||||
if (*startup3) I_Printf(VB_INFO, "%s", startup3);
|
||||
if (*startup4) I_Printf(VB_INFO, "%s", startup4);
|
||||
if (*startup5) I_Printf(VB_INFO, "%s", startup5);
|
||||
// End new startup strings
|
||||
|
||||
//!
|
||||
@ -2501,10 +2503,10 @@ void D_DoomMain(void)
|
||||
startloadgame = -1;
|
||||
}
|
||||
|
||||
puts("M_Init: Init miscellaneous info.");
|
||||
I_Printf(VB_INFO, "M_Init: Init miscellaneous info.");
|
||||
M_Init();
|
||||
|
||||
printf("R_Init: Init DOOM refresh daemon - ");
|
||||
I_Printf(VB_INFO, "R_Init: Init DOOM refresh daemon - ");
|
||||
R_Init();
|
||||
|
||||
//!
|
||||
@ -2516,42 +2518,41 @@ void D_DoomMain(void)
|
||||
|
||||
if ((p = M_CheckParm("-dumptables")) && p < myargc-1)
|
||||
{
|
||||
puts("\n");
|
||||
WriteGeneratedLumpWad(myargv[p+1]);
|
||||
}
|
||||
|
||||
puts("\nP_Init: Init Playloop state.");
|
||||
I_Printf(VB_INFO, "P_Init: Init Playloop state.");
|
||||
P_Init();
|
||||
|
||||
puts("I_Init: Setting up machine state.");
|
||||
I_Printf(VB_INFO, "I_Init: Setting up machine state.");
|
||||
I_InitTimer();
|
||||
I_InitJoystick();
|
||||
I_InitSound();
|
||||
I_InitMusic();
|
||||
M_GetMidiDevices();
|
||||
|
||||
puts("NET_Init: Init network subsystem.");
|
||||
I_Printf(VB_INFO, "NET_Init: Init network subsystem.");
|
||||
NET_Init();
|
||||
|
||||
// Initial netgame startup. Connect to server etc.
|
||||
D_ConnectNetGame();
|
||||
|
||||
puts("D_CheckNetGame: Checking network game status.");
|
||||
I_Printf(VB_INFO, "D_CheckNetGame: Checking network game status.");
|
||||
D_CheckNetGame();
|
||||
|
||||
M_ResetTimeScale();
|
||||
|
||||
puts("S_Init: Setting up sound.");
|
||||
I_Printf(VB_INFO, "S_Init: Setting up sound.");
|
||||
S_Init(snd_SfxVolume /* *8 */, snd_MusicVolume /* *8*/ );
|
||||
|
||||
puts("HU_Init: Setting up heads up display.");
|
||||
I_Printf(VB_INFO, "HU_Init: Setting up heads up display.");
|
||||
HU_Init();
|
||||
M_SetMenuFontSpacing();
|
||||
|
||||
puts("ST_Init: Init status bar.");
|
||||
I_Printf(VB_INFO, "ST_Init: Init status bar.");
|
||||
ST_Init();
|
||||
|
||||
putchar('\n');
|
||||
I_PutChar(VB_INFO, '\n');
|
||||
|
||||
idmusnum = -1; //jff 3/17/98 insure idmus number is blank
|
||||
|
||||
@ -2560,7 +2561,7 @@ void D_DoomMain(void)
|
||||
if ((p = M_CheckParm ("-statdump")) && p<myargc-1)
|
||||
{
|
||||
I_AtExit(StatDump, true);
|
||||
puts("External statistics registered.");
|
||||
I_Printf(VB_INFO, "External statistics registered.");
|
||||
}
|
||||
|
||||
// [FG] check for SSG assets
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "i_printf.h"
|
||||
#include "d_main.h"
|
||||
#include "m_argv.h"
|
||||
#include "m_menu.h"
|
||||
@ -116,8 +117,8 @@ static void LoadGameSettings(net_gamesettings_t *settings)
|
||||
|
||||
if (lowres_turn)
|
||||
{
|
||||
printf("NOTE: Turning resolution is reduced; this is probably "
|
||||
"because there is a client recording a Vanilla demo.\n");
|
||||
I_Printf(VB_WARNING, "NOTE: Turning resolution is reduced; this is probably "
|
||||
"because there is a client recording a Vanilla demo.");
|
||||
}
|
||||
|
||||
for (i = 0; i < MAXPLAYERS; ++i)
|
||||
@ -287,10 +288,10 @@ void D_CheckNetGame (void)
|
||||
D_StartNetGame(&settings, NULL);
|
||||
LoadGameSettings(&settings);
|
||||
|
||||
printf(" startskill %i deathmatch: %i startmap: %i startepisode: %i\n",
|
||||
I_Printf(VB_INFO, " startskill %i deathmatch: %i startmap: %i startepisode: %i",
|
||||
startskill, deathmatch, startmap, startepisode);
|
||||
|
||||
printf(" player %i of %i (%i nodes)\n",
|
||||
I_Printf(VB_INFO, " player %i of %i (%i nodes)",
|
||||
consoleplayer+1, settings.num_players, settings.num_players);
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "SDL.h"
|
||||
|
||||
#include "doomstat.h"
|
||||
#include "i_printf.h"
|
||||
#include "i_system.h"
|
||||
#include "m_misc.h"
|
||||
#include "g_game.h"
|
||||
@ -66,8 +67,8 @@ void I_Quit(void)
|
||||
|
||||
if (M_remove(filename))
|
||||
{
|
||||
printf("Failed to delete temporary file: %s (%s)\n",
|
||||
filename, strerror(errno));
|
||||
I_Printf(VB_ERROR, "Failed to delete temporary file: %s (%s)",
|
||||
filename, strerror(errno));
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,8 +76,8 @@ void I_Quit(void)
|
||||
|
||||
if (M_rmdir(tempdirs[i]))
|
||||
{
|
||||
printf("Failed to delete temporary directory: %s (%s)\n",
|
||||
tempdirs[i], strerror(errno));
|
||||
I_Printf(VB_ERROR, "Failed to delete temporary directory: %s (%s)",
|
||||
tempdirs[i], strerror(errno));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
17
src/g_game.c
17
src/g_game.c
@ -23,6 +23,7 @@
|
||||
#include "m_io.h" // haleyjd
|
||||
|
||||
#include "doomstat.h"
|
||||
#include "i_printf.h"
|
||||
#include "doomkeys.h"
|
||||
#include "f_finale.h"
|
||||
#include "m_argv.h"
|
||||
@ -1253,7 +1254,7 @@ static void G_WriteLevelStat(void)
|
||||
|
||||
if (fstream == NULL)
|
||||
{
|
||||
fprintf(stderr, "G_WriteLevelStat: Unable to open levelstat.txt for writing!\n");
|
||||
I_Printf(VB_WARNING, "G_WriteLevelStat: Unable to open levelstat.txt for writing!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -1522,7 +1523,7 @@ static void G_DoWorldDone(void)
|
||||
#define INVALID_DEMO(a, b) \
|
||||
do \
|
||||
{ \
|
||||
fprintf(stderr, "G_DoPlayDemo: " a, b); \
|
||||
I_Printf(VB_WARNING, "G_DoPlayDemo: " a, b); \
|
||||
gameaction = ga_nothing; \
|
||||
demoplayback = true; \
|
||||
G_CheckDemoStatus(); \
|
||||
@ -1558,7 +1559,7 @@ static void G_DoPlayDemo(void)
|
||||
// [FG] ignore too short demo lumps
|
||||
if (lumplength < 0xd)
|
||||
{
|
||||
INVALID_DEMO("Short demo lump %s.\n", basename);
|
||||
INVALID_DEMO("Short demo lump %s.", basename);
|
||||
}
|
||||
|
||||
demover = *demo_p++;
|
||||
@ -1570,7 +1571,7 @@ static void G_DoPlayDemo(void)
|
||||
// Eternity Engine also uses 255 demover, with other signatures.
|
||||
if (strncmp((const char *)demo_p, "PR+UM", 5) != 0)
|
||||
{
|
||||
INVALID_DEMO("Extended demo format %d found, but \"PR+UM\" string not found.\n", demover);
|
||||
INVALID_DEMO("Extended demo format %d found, but \"PR+UM\" string not found.", demover);
|
||||
}
|
||||
|
||||
demo_p += 6;
|
||||
@ -1614,7 +1615,7 @@ static void G_DoPlayDemo(void)
|
||||
// [FG] PrBoom's own demo format starts with demo version 210
|
||||
if (demover >= 210 && !mbf21)
|
||||
{
|
||||
INVALID_DEMO("Unknown demo format %d.\n", demover);
|
||||
INVALID_DEMO("Unknown demo format %d.", demover);
|
||||
}
|
||||
|
||||
longtics = false;
|
||||
@ -1780,7 +1781,7 @@ static void G_DoPlayDemo(void)
|
||||
}
|
||||
|
||||
// [FG] report compatibility mode
|
||||
fprintf(stderr, "G_DoPlayDemo: Playing demo with %s (%d) compatibility.\n",
|
||||
I_Printf(VB_INFO, "G_DoPlayDemo: Playing demo with %s (%d) compatibility.",
|
||||
G_GetCurrentComplevelName(), demover);
|
||||
}
|
||||
|
||||
@ -2222,7 +2223,7 @@ static void G_DoLoadGame(void)
|
||||
char *maplump = MAPNAME(gameepisode, gamemap);
|
||||
int maplumpnum = W_CheckNumForName(maplump);
|
||||
|
||||
fprintf(stderr, "G_DoLoadGame: Slot %d, %.8s (%s)\n",
|
||||
I_Printf(VB_INFO, "G_DoLoadGame: Slot %d, %.8s (%s)",
|
||||
10*savepage+savegameslot, maplump, W_WadNameForLump(maplumpnum));
|
||||
}
|
||||
|
||||
@ -4036,7 +4037,7 @@ boolean G_CheckDemoStatus(void)
|
||||
|
||||
Z_Free(demobuffer);
|
||||
demobuffer = NULL; // killough
|
||||
fprintf(stderr, "Demo %s recorded\n", demoname);
|
||||
I_Printf(VB_INFO, "Demo %s recorded", demoname);
|
||||
// [crispy] if a new game is started during demo recording, start a new demo
|
||||
if (gameaction != ga_newgame && gameaction != ga_reloadlevel)
|
||||
{
|
||||
|
@ -20,6 +20,7 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "doomtype.h"
|
||||
#include "i_printf.h"
|
||||
#include "i_video.h"
|
||||
|
||||
#include "../textscreen/txt_main.h"
|
||||
@ -43,7 +44,7 @@ void I_Endoom(byte *endoom_data)
|
||||
|
||||
if (!TXT_Init())
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize libtextscreen\n");
|
||||
I_Printf(VB_ERROR, "Failed to initialize libtextscreen");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "i_oalmusic.h"
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "i_printf.h"
|
||||
#include "i_system.h"
|
||||
#include "i_sound.h"
|
||||
#include "m_misc2.h"
|
||||
@ -58,7 +59,7 @@ static uint32_t FL_Callback(uint8_t *buffer, uint32_t buffer_samples)
|
||||
|
||||
if (result != FLUID_OK)
|
||||
{
|
||||
fprintf(stderr, "FL_Callback: Error generating FluidSynth audio\n");
|
||||
I_Printf(VB_ERROR, "FL_Callback: Error generating FluidSynth audio");
|
||||
}
|
||||
|
||||
return buffer_samples;
|
||||
@ -224,8 +225,8 @@ static boolean I_FL_InitMusic(int device)
|
||||
|
||||
if (synth == NULL)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"I_FL_InitMusic: FluidSynth failed to initialize synth.\n");
|
||||
I_Printf(VB_ERROR,
|
||||
"I_FL_InitMusic: FluidSynth failed to initialize synth.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -289,7 +290,7 @@ static boolean I_FL_InitMusic(int device)
|
||||
return false;
|
||||
}
|
||||
|
||||
printf("FluidSynth Init: Using '%s'.\n",
|
||||
I_Printf(VB_INFO, "FluidSynth Init: Using '%s'.",
|
||||
lumpnum >= 0 ? "SNDFONT lump" : soundfont_path);
|
||||
|
||||
return true;
|
||||
@ -346,8 +347,8 @@ static void *I_FL_RegisterSong(void *data, int len)
|
||||
|
||||
if (player == NULL)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"I_FL_InitMusic: FluidSynth failed to initialize player.\n");
|
||||
I_Printf(VB_ERROR,
|
||||
"I_FL_InitMusic: FluidSynth failed to initialize player.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -380,7 +381,7 @@ static void *I_FL_RegisterSong(void *data, int len)
|
||||
{
|
||||
delete_fluid_player(player);
|
||||
player = NULL;
|
||||
fprintf(stderr, "I_FL_RegisterSong: Failed to load in-memory song.\n");
|
||||
I_Printf(VB_ERROR, "I_FL_RegisterSong: Failed to load in-memory song.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "doomkeys.h"
|
||||
#include "i_printf.h"
|
||||
#include "d_event.h"
|
||||
#include "d_main.h"
|
||||
#include "m_fixed.h"
|
||||
@ -183,14 +184,14 @@ void I_OpenController(int which)
|
||||
if (controller)
|
||||
{
|
||||
controller_index = which;
|
||||
printf("I_OpenController: Found a valid game controller, named: %s\n",
|
||||
I_Printf(VB_INFO, "I_OpenController: Found a valid game controller, named: %s",
|
||||
SDL_GameControllerName(controller));
|
||||
}
|
||||
}
|
||||
|
||||
if (controller == NULL)
|
||||
{
|
||||
printf("I_OpenController: Could not open game controller %i: %s\n",
|
||||
I_Printf(VB_WARNING, "I_OpenController: Could not open game controller %i: %s",
|
||||
which, SDL_GetError());
|
||||
}
|
||||
}
|
||||
|
@ -35,6 +35,7 @@ misrepresented as being the original software.
|
||||
*/
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "i_printf.h"
|
||||
#include "i_sound.h"
|
||||
#include "memio.h"
|
||||
#include "mus2mid.h"
|
||||
@ -86,19 +87,19 @@ static boolean I_MAC_InitMusic(int device)
|
||||
|
||||
if (AUGraphConnectNodeInput(graph, synth, 0, output, 0) != noErr)
|
||||
{
|
||||
fprintf(stderr, "I_MAC_InitMusic: AUGraphConnectNodeInput failed.\n");
|
||||
I_Printf(VB_ERROR, "I_MAC_InitMusic: AUGraphConnectNodeInput failed.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (AUGraphOpen(graph) != noErr)
|
||||
{
|
||||
fprintf(stderr, "I_MAC_InitMusic: AUGraphOpen failed.\n");
|
||||
I_Printf(VB_ERROR, "I_MAC_InitMusic: AUGraphOpen failed.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (AUGraphInitialize(graph) != noErr)
|
||||
{
|
||||
fprintf(stderr, "I_MAC_InitMusic: AUGraphInitialize failed.\n");
|
||||
I_Printf(VB_ERROR, "I_MAC_InitMusic: AUGraphInitialize failed.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -108,17 +109,17 @@ static boolean I_MAC_InitMusic(int device)
|
||||
if (AUGraphNodeInfo(graph, output, NULL, &unit) != noErr)
|
||||
#endif
|
||||
{
|
||||
fprintf(stderr, "I_MAC_InitMusic: AUGraphGetNodeInfo failed.\n");
|
||||
I_Printf(VB_ERROR, "I_MAC_InitMusic: AUGraphGetNodeInfo failed.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (NewMusicPlayer(&player) != noErr)
|
||||
{
|
||||
fprintf(stderr, "I_MAC_InitMusic: Music player creation failed using AudioToolbox.\n");
|
||||
I_Printf(VB_ERROR, "I_MAC_InitMusic: Music player creation failed using AudioToolbox.");
|
||||
return false;
|
||||
}
|
||||
|
||||
printf("I_MAC_InitMusic: Music playback enabled using AudioToolbox.\n");
|
||||
I_Printf(VB_INFO, "I_MAC_InitMusic: Music playback enabled using AudioToolbox.");
|
||||
music_initialized = true;
|
||||
|
||||
return true;
|
||||
@ -134,7 +135,7 @@ static void I_MAC_SetMusicVolume(int volume)
|
||||
kAudioUnitScope_Output,
|
||||
0, (float) volume / 15, 0) != noErr)
|
||||
{
|
||||
fprintf(stderr, "I_MAC_SetMusicVolume: AudioUnitSetParameter failed.\n");
|
||||
I_Printf(VB_ERROR, "I_MAC_SetMusicVolume: AudioUnitSetParameter failed.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -164,25 +165,25 @@ static void I_MAC_PlaySong(void *handle, boolean looping)
|
||||
|
||||
if (MusicSequenceSetAUGraph(sequence, graph) != noErr)
|
||||
{
|
||||
fprintf(stderr, "I_MAC_PlaySong: MusicSequenceSetAUGraph failed.\n");
|
||||
I_Printf(VB_ERROR, "I_MAC_PlaySong: MusicSequenceSetAUGraph failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (MusicPlayerSetSequence(player, sequence) != noErr)
|
||||
{
|
||||
fprintf(stderr, "I_MAC_PlaySong: MusicPlayerSetSequence failed.\n");
|
||||
I_Printf(VB_ERROR, "I_MAC_PlaySong: MusicPlayerSetSequence failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (MusicPlayerPreroll(player) != noErr)
|
||||
{
|
||||
fprintf(stderr, "I_MAC_PlaySong: MusicPlayerPreroll failed.\n");
|
||||
I_Printf(VB_ERROR, "I_MAC_PlaySong: MusicPlayerPreroll failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (MusicSequenceGetTrackCount(sequence, &ntracks) != noErr)
|
||||
{
|
||||
fprintf(stderr, "I_MAC_PlaySong: MusicSequenceGetTrackCount failed.\n");
|
||||
I_Printf(VB_ERROR, "I_MAC_PlaySong: MusicSequenceGetTrackCount failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -194,14 +195,14 @@ static void I_MAC_PlaySong(void *handle, boolean looping)
|
||||
|
||||
if (MusicSequenceGetIndTrack(sequence, i, &track) != noErr)
|
||||
{
|
||||
fprintf(stderr, "I_MAC_PlaySong: MusicSequenceGetIndTrack failed.\n");
|
||||
I_Printf(VB_ERROR, "I_MAC_PlaySong: MusicSequenceGetIndTrack failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (MusicTrackGetProperty(track, kSequenceTrackProperty_TrackLength,
|
||||
&time, &size) != noErr)
|
||||
{
|
||||
fprintf(stderr, "I_MAC_PlaySong: MusicTrackGetProperty failed.\n");
|
||||
I_Printf(VB_ERROR, "I_MAC_PlaySong: MusicTrackGetProperty failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -225,7 +226,7 @@ static void I_MAC_PlaySong(void *handle, boolean looping)
|
||||
|
||||
if (MusicSequenceGetIndTrack(sequence, i, &track) != noErr)
|
||||
{
|
||||
fprintf(stderr, "I_MAC_PlaySong: MusicSequenceGetIndTrack failed.\n");
|
||||
I_Printf(VB_ERROR, "I_MAC_PlaySong: MusicSequenceGetIndTrack failed.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -235,14 +236,14 @@ static void I_MAC_PlaySong(void *handle, boolean looping)
|
||||
if (MusicTrackSetProperty(track, kSequenceTrackProperty_LoopInfo,
|
||||
&info, sizeof(info)) != noErr)
|
||||
{
|
||||
fprintf(stderr, "I_MAC_PlaySong: MusicTrackSetProperty failed.\n");
|
||||
I_Printf(VB_ERROR, "I_MAC_PlaySong: MusicTrackSetProperty failed.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (MusicPlayerStart(player) != noErr)
|
||||
{
|
||||
fprintf(stderr, "I_MAC_PlaySong: MusicPlayerStart failed.\n");
|
||||
I_Printf(VB_ERROR, "I_MAC_PlaySong: MusicPlayerStart failed.");
|
||||
}
|
||||
}
|
||||
|
||||
@ -266,7 +267,7 @@ static void *I_MAC_RegisterSong(void *data, int len)
|
||||
|
||||
if (NewMusicSequence(&sequence) != noErr)
|
||||
{
|
||||
fprintf(stderr, "I_MAC_RegisterSong: Unable to create AudioUnit sequence.\n");
|
||||
I_Printf(VB_ERROR, "I_MAC_RegisterSong: Unable to create AudioUnit sequence.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -297,7 +298,7 @@ static void *I_MAC_RegisterSong(void *data, int len)
|
||||
|
||||
if (data_ref == NULL)
|
||||
{
|
||||
fprintf(stderr, "I_MAC_RegisterSong: Failed to load MID.\n");
|
||||
I_Printf(VB_ERROR, "I_MAC_RegisterSong: Failed to load MID.");
|
||||
DisposeMusicSequence(sequence);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "SDL.h" // haleyjd
|
||||
|
||||
#include "i_printf.h"
|
||||
#include "m_argv.h"
|
||||
#include "version.h"
|
||||
|
||||
@ -49,11 +50,11 @@ int main(int argc, char **argv)
|
||||
|
||||
if (M_ParmExists("-version") || M_ParmExists("--version"))
|
||||
{
|
||||
puts(PROJECT_STRING);
|
||||
I_Printf(VB_ALWAYS, "%s", PROJECT_STRING);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
printf("%s (built on %s)\n\n", PROJECT_STRING, version_date);
|
||||
I_Printf(VB_ALWAYS, "%s (built on %s)\n", PROJECT_STRING, version_date);
|
||||
|
||||
D_DoomMain();
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "alext.h"
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "i_printf.h"
|
||||
#include "i_sndfile.h"
|
||||
#include "i_sound.h"
|
||||
|
||||
@ -79,7 +80,7 @@ static boolean UpdatePlayer(void)
|
||||
alGetSourcei(player.source, AL_BUFFERS_PROCESSED, &processed);
|
||||
if (alGetError() != AL_NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "UpdatePlayer: Error checking source state\n");
|
||||
I_Printf(VB_ERROR, "UpdatePlayer: Error checking source state");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -112,7 +113,7 @@ static boolean UpdatePlayer(void)
|
||||
}
|
||||
if (alGetError() != AL_NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "UpdatePlayer: Error buffering data\n");
|
||||
I_Printf(VB_ERROR, "UpdatePlayer: Error buffering data");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -132,7 +133,7 @@ static boolean UpdatePlayer(void)
|
||||
alSourcePlay(player.source);
|
||||
if (alGetError() != AL_NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "UpdatePlayer: Error restarting playback\n");
|
||||
I_Printf(VB_ERROR, "UpdatePlayer: Error restarting playback");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -181,7 +182,7 @@ static boolean StartPlayer(void)
|
||||
}
|
||||
if (alGetError() != AL_NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "StartPlayer: Error buffering for playback.\n");
|
||||
I_Printf(VB_ERROR, "StartPlayer: Error buffering for playback.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -273,7 +274,7 @@ static void I_OAL_PlaySong(void *handle, boolean looping)
|
||||
alSourcePlay(player.source);
|
||||
if (alGetError() != AL_NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "I_OAL_PlaySong: Error starting playback.\n");
|
||||
I_Printf(VB_ERROR, "I_OAL_PlaySong: Error starting playback.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -324,7 +325,7 @@ static void I_OAL_ShutdownMusic(void)
|
||||
alDeleteBuffers(NUM_BUFFERS, player.buffers);
|
||||
if (alGetError() != AL_NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "I_OAL_ShutdownMusic: Failed to delete object IDs.\n");
|
||||
I_Printf(VB_ERROR, "I_OAL_ShutdownMusic: Failed to delete object IDs.");
|
||||
}
|
||||
|
||||
memset(&player, 0, sizeof(stream_player_t));
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "doomstat.h"
|
||||
#include "i_printf.h"
|
||||
#include "i_oalsound.h"
|
||||
#include "i_sndfile.h"
|
||||
#include "r_data.h"
|
||||
@ -173,7 +174,7 @@ static void SetResampler(ALuint *sources)
|
||||
|
||||
if (alIsExtensionPresent("AL_SOFT_source_resampler") != AL_TRUE)
|
||||
{
|
||||
printf(" Resampler info not available!\n");
|
||||
I_Printf(VB_WARNING, " Resampler info not available!");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -182,7 +183,7 @@ static void SetResampler(ALuint *sources)
|
||||
|
||||
if (!alGetStringiSOFT)
|
||||
{
|
||||
fprintf(stderr, " alGetStringiSOFT() is not available.\n");
|
||||
I_Printf(VB_ERROR, " alGetStringiSOFT() is not available.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -191,7 +192,7 @@ static void SetResampler(ALuint *sources)
|
||||
|
||||
if (!num_resamplers)
|
||||
{
|
||||
printf(" No resamplers found!\n");
|
||||
I_Printf(VB_WARNING, " No resamplers found!");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -205,7 +206,7 @@ static void SetResampler(ALuint *sources)
|
||||
}
|
||||
if (i == num_resamplers)
|
||||
{
|
||||
printf(" Failed to find resampler: '%s'.\n", resampler_name);
|
||||
I_Printf(VB_WARNING, " Failed to find resampler: '%s'.", resampler_name);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -214,7 +215,7 @@ static void SetResampler(ALuint *sources)
|
||||
alSourcei(sources[i], AL_SOURCE_RESAMPLER_SOFT, def_resampler);
|
||||
}
|
||||
/*
|
||||
printf(" Using '%s' resampler.\n",
|
||||
I_Printf(VB_INFO, " Using '%s' resampler.",
|
||||
alGetStringiSOFT(AL_RESAMPLER_NAME_SOFT, def_resampler));
|
||||
*/
|
||||
}
|
||||
@ -368,7 +369,7 @@ static boolean OpenDevice(ALCdevice **device)
|
||||
name = alcGetString(*device, ALC_DEVICE_SPECIFIER);
|
||||
|
||||
alcGetIntegerv(*device, ALC_FREQUENCY, 1, &srate);
|
||||
printf(" Using '%s' @ %d Hz.\n", name, srate);
|
||||
I_Printf(VB_INFO, " Using '%s' @ %d Hz.", name, srate);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -408,7 +409,7 @@ boolean I_OAL_InitSound(void)
|
||||
|
||||
if (!OpenDevice(&device))
|
||||
{
|
||||
fprintf(stderr, "I_OAL_InitSound: Failed to open device.\n");
|
||||
I_Printf(VB_ERROR, "I_OAL_InitSound: Failed to open device.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -419,7 +420,7 @@ boolean I_OAL_InitSound(void)
|
||||
oal->context = alcCreateContext(oal->device, attribs);
|
||||
if (!oal->context || !alcMakeContextCurrent(oal->context))
|
||||
{
|
||||
fprintf(stderr, "I_OAL_InitSound: Error creating context.\n");
|
||||
I_Printf(VB_ERROR, "I_OAL_InitSound: Error creating context.");
|
||||
I_OAL_ShutdownSound();
|
||||
return false;
|
||||
}
|
||||
@ -429,7 +430,7 @@ boolean I_OAL_InitSound(void)
|
||||
alGenSources(MAX_CHANNELS, oal->sources);
|
||||
if (!oal->sources || alGetError() != AL_NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "I_OAL_InitSound: Error creating sources.\n");
|
||||
I_Printf(VB_ERROR, "I_OAL_InitSound: Error creating sources.");
|
||||
I_OAL_ShutdownSound();
|
||||
return false;
|
||||
}
|
||||
@ -450,13 +451,13 @@ boolean I_OAL_ReinitSound(void)
|
||||
|
||||
if (!oal)
|
||||
{
|
||||
fprintf(stderr, "I_OAL_ReinitSound: OpenAL not initialized.\n");
|
||||
I_Printf(VB_ERROR, "I_OAL_ReinitSound: OpenAL not initialized.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (alcIsExtensionPresent(oal->device, "ALC_SOFT_HRTF") != ALC_TRUE)
|
||||
{
|
||||
fprintf(stderr, "I_OAL_ReinitSound: Extension not present.\n");
|
||||
I_Printf(VB_ERROR, "I_OAL_ReinitSound: Extension not present.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -465,7 +466,7 @@ boolean I_OAL_ReinitSound(void)
|
||||
|
||||
if (!alcResetDeviceSOFT)
|
||||
{
|
||||
fprintf(stderr, "I_OAL_ReinitSound: Function address not found.\n");
|
||||
I_Printf(VB_ERROR, "I_OAL_ReinitSound: Function address not found.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -473,7 +474,7 @@ boolean I_OAL_ReinitSound(void)
|
||||
|
||||
if (alcResetDeviceSOFT(oal->device, attribs) != ALC_TRUE)
|
||||
{
|
||||
fprintf(stderr, "I_OAL_ReinitSound: Error resetting device.\n");
|
||||
I_Printf(VB_ERROR, "I_OAL_ReinitSound: Error resetting device.");
|
||||
I_OAL_ShutdownSound();
|
||||
return false;
|
||||
}
|
||||
@ -599,13 +600,13 @@ boolean I_OAL_CacheSound(sfxinfo_t *sfx)
|
||||
alGenBuffers(1, &buffer);
|
||||
if (alGetError() != AL_NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "I_OAL_CacheSound: Error creating buffers.\n");
|
||||
I_Printf(VB_ERROR, "I_OAL_CacheSound: Error creating buffers.");
|
||||
break;
|
||||
}
|
||||
alBufferData(buffer, format, sampledata, size, freq);
|
||||
if (alGetError() != AL_NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "I_OAL_CacheSound: Error buffering data.\n");
|
||||
I_Printf(VB_ERROR, "I_OAL_CacheSound: Error buffering data.");
|
||||
break;
|
||||
}
|
||||
|
||||
@ -648,7 +649,7 @@ boolean I_OAL_StartSound(int channel, sfxinfo_t *sfx, int pitch)
|
||||
alSourcePlay(oal->sources[channel]);
|
||||
if (alGetError() != AL_NO_ERROR)
|
||||
{
|
||||
fprintf(stderr, "I_OAL_StartSound: Error playing source.\n");
|
||||
I_Printf(VB_ERROR, "I_OAL_StartSound: Error playing source.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include "memio.h"
|
||||
#include "doomtype.h"
|
||||
|
||||
#include "i_printf.h"
|
||||
#include "i_sound.h"
|
||||
#include "m_swap.h"
|
||||
#include "m_misc2.h"
|
||||
@ -1228,9 +1229,7 @@ static void ControllerEvent(opl_track_data_t *track, midi_event_t *event)
|
||||
break;
|
||||
|
||||
default:
|
||||
#ifdef OPL_MIDI_DEBUG
|
||||
fprintf(stderr, "Unknown MIDI controller type: %u\n", controller);
|
||||
#endif
|
||||
I_Printf(VB_DEBUG, "Unknown MIDI controller type: %u", controller);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1321,10 +1320,8 @@ static void MetaEvent(opl_track_data_t *track, midi_event_t *event)
|
||||
break;
|
||||
|
||||
default:
|
||||
#ifdef OPL_MIDI_DEBUG
|
||||
fprintf(stderr, "Unknown MIDI meta event type: %u\n",
|
||||
event->data.meta.type);
|
||||
#endif
|
||||
I_Printf(VB_DEBUG, "Unknown MIDI meta event type: %u",
|
||||
event->data.meta.type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1366,9 +1363,7 @@ static void ProcessEvent(opl_track_data_t *track, midi_event_t *event)
|
||||
break;
|
||||
|
||||
default:
|
||||
#ifdef OPL_MIDI_DEBUG
|
||||
fprintf(stderr, "Unknown MIDI event type %i\n", event->event_type);
|
||||
#endif
|
||||
I_Printf(VB_DEBUG, "Unknown MIDI event type %i", event->event_type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -1669,7 +1664,7 @@ static void *I_OPL_RegisterSong(void *data, int len)
|
||||
|
||||
if (result == NULL)
|
||||
{
|
||||
fprintf(stderr, "I_OPL_RegisterSong: Failed to load MID.\n");
|
||||
I_Printf(VB_ERROR, "I_OPL_RegisterSong: Failed to load MID.");
|
||||
}
|
||||
|
||||
return result;
|
||||
@ -1726,7 +1721,7 @@ static boolean OPL_InitMusic(void)
|
||||
chip_type = OPL_Init(opl_io_port);
|
||||
if (chip_type == OPL_INIT_NONE)
|
||||
{
|
||||
printf("Dude. The Adlib isn't responding.\n");
|
||||
I_Printf(VB_ERROR, "Dude. The Adlib isn't responding.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
133
src/i_printf.c
Normal file
133
src/i_printf.c
Normal file
@ -0,0 +1,133 @@
|
||||
//
|
||||
// Copyright (C) 2023 Fabian Greffrath
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION: clean interface for logging to console
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <io.h>
|
||||
#else
|
||||
#include <unistd.h> // [FG] isatty()
|
||||
#endif
|
||||
|
||||
#include "i_printf.h"
|
||||
#include "m_argv.h"
|
||||
|
||||
// [FG] returns true if stdout is a real console, false if it is a file
|
||||
|
||||
int I_ConsoleStdout(void)
|
||||
{
|
||||
static int ret = -1;
|
||||
|
||||
if (ret == -1)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
if (_isatty(_fileno(stdout)))
|
||||
#else
|
||||
if (isatty(fileno(stdout)) && isatty(fileno(stderr)))
|
||||
#endif
|
||||
ret = 1;
|
||||
else
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static verbosity_t verbosity = VB_INFO;
|
||||
verbosity_t cfg_verbosity;
|
||||
|
||||
void I_InitPrintf(void)
|
||||
{
|
||||
verbosity = cfg_verbosity;
|
||||
|
||||
//!
|
||||
//
|
||||
// Print debugging info with maximum verbosity.
|
||||
//
|
||||
|
||||
if (M_ParmExists("-verbose") || M_ParmExists("--verbose"))
|
||||
verbosity = VB_MAX;
|
||||
}
|
||||
|
||||
void I_Printf(verbosity_t prio, const char *msg, ...)
|
||||
{
|
||||
FILE *stream = stdout;
|
||||
const int msglen = strlen(msg);
|
||||
const char *color_prefix = NULL, *color_suffix = NULL;
|
||||
va_list args;
|
||||
|
||||
if (prio > verbosity)
|
||||
return;
|
||||
|
||||
switch (prio)
|
||||
{
|
||||
case VB_WARNING:
|
||||
case VB_ERROR:
|
||||
case VB_DEBUG:
|
||||
stream = stderr;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
#ifndef _WIN32
|
||||
if (I_ConsoleStdout())
|
||||
{
|
||||
switch (prio)
|
||||
{
|
||||
case VB_WARNING:
|
||||
color_prefix = "\033[33m"; // [FG] yellow
|
||||
break;
|
||||
case VB_ERROR:
|
||||
color_prefix = "\033[31m"; // [FG] red
|
||||
break;
|
||||
case VB_DEBUG:
|
||||
color_prefix = "\033[36m"; // [FG] cyan
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
if (color_prefix)
|
||||
color_suffix = "\033[0m"; // [FG] reset
|
||||
}
|
||||
#endif
|
||||
|
||||
if (color_prefix)
|
||||
fprintf(stream, "%s", color_prefix);
|
||||
|
||||
va_start(args, msg);
|
||||
vfprintf(stream, msg, args);
|
||||
va_end(args);
|
||||
|
||||
if (color_suffix)
|
||||
fprintf(stream, "%s", color_suffix);
|
||||
|
||||
// [FG] no newline if format string has trailing space
|
||||
if (msglen && msg[msglen - 1] != ' ')
|
||||
fprintf(stream, "%s", "\n");
|
||||
}
|
||||
|
||||
void I_PutChar(verbosity_t prio, int c)
|
||||
{
|
||||
if (prio <= verbosity)
|
||||
putchar(c);
|
||||
}
|
41
src/i_printf.h
Normal file
41
src/i_printf.h
Normal file
@ -0,0 +1,41 @@
|
||||
//
|
||||
// Copyright (C) 2023 Fabian Greffrath
|
||||
//
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU General Public License
|
||||
// as published by the Free Software Foundation; either version 2
|
||||
// of the License, or (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// DESCRIPTION: clean interface for logging to console
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#ifndef __I_PRINT__
|
||||
#define __I_PRINT__
|
||||
|
||||
#include "doomtype.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
VB_ALWAYS,
|
||||
VB_ERROR,
|
||||
VB_WARNING,
|
||||
VB_INFO,
|
||||
VB_DEBUG,
|
||||
VB_MAX
|
||||
} verbosity_t;
|
||||
|
||||
extern verbosity_t cfg_verbosity;
|
||||
|
||||
int I_ConsoleStdout(void);
|
||||
|
||||
void I_InitPrintf(void);
|
||||
void I_Printf(verbosity_t prio, const char *msg, ...) PRINTF_ATTR(2, 3);
|
||||
void I_PutChar(verbosity_t prio, int c);
|
||||
|
||||
#endif
|
@ -17,7 +17,7 @@
|
||||
// Load sound lumps with libsndfile.
|
||||
|
||||
#include "i_sndfile.h"
|
||||
|
||||
#include "i_printf.h"
|
||||
|
||||
#include "alext.h"
|
||||
#include <sndfile.h>
|
||||
@ -394,7 +394,7 @@ static boolean OpenFile(sndfile_t *file, void *data, sf_count_t size)
|
||||
|
||||
if (!file->sndfile)
|
||||
{
|
||||
printf("SndFile: %s\n", sf_strerror(file->sndfile));
|
||||
I_Printf(VB_ERROR, "SndFile: %s", sf_strerror(file->sndfile));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -472,7 +472,7 @@ static boolean OpenFile(sndfile_t *file, void *data, sf_count_t size)
|
||||
|
||||
if (format == AL_NONE)
|
||||
{
|
||||
fprintf(stderr, "SndFile: Unsupported channel count %d.\n", file->sfinfo.channels);
|
||||
I_Printf(VB_ERROR, "SndFile: Unsupported channel count %d.", file->sfinfo.channels);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -513,7 +513,7 @@ boolean I_SND_LoadFile(void *data, ALenum *format, byte **wavdata,
|
||||
|
||||
if (num_frames < file.sfinfo.frames)
|
||||
{
|
||||
fprintf(stderr, "sf_readf: %s\n", sf_strerror(file.sndfile));
|
||||
I_Printf(VB_ERROR, "sf_readf: %s", sf_strerror(file.sndfile));
|
||||
CloseFile(&file);
|
||||
free(local_wavdata);
|
||||
return false;
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "doomstat.h"
|
||||
#include "i_printf.h"
|
||||
#include "i_sound.h"
|
||||
#include "w_wad.h"
|
||||
|
||||
@ -274,7 +275,7 @@ int I_StartSound(sfxinfo_t *sfx, int vol, int sep, int pitch)
|
||||
|
||||
if (sound_module->StartSound(channel, sfx, pitch) == false)
|
||||
{
|
||||
fprintf(stderr, "I_StartSound: Error playing sfx.\n");
|
||||
I_Printf(VB_WARNING, "I_StartSound: Error playing sfx.");
|
||||
StopChannel(channel);
|
||||
return -1;
|
||||
}
|
||||
@ -386,13 +387,13 @@ void I_InitSound(void)
|
||||
return;
|
||||
}
|
||||
|
||||
printf("I_InitSound:\n");
|
||||
I_Printf(VB_INFO, "I_InitSound:");
|
||||
|
||||
sound_module = sound_modules[snd_module];
|
||||
|
||||
if (!sound_module->InitSound())
|
||||
{
|
||||
fprintf(stderr, "I_InitSound: Failed to initialize sound.\n");
|
||||
I_Printf(VB_WARNING, "I_InitSound: Failed to initialize sound.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -405,7 +406,7 @@ void I_InitSound(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
printf(" Precaching all sound effects... ");
|
||||
I_Printf(VB_INFO, " Precaching all sound effects... ");
|
||||
for (i = 1; i < num_sfx; i++)
|
||||
{
|
||||
// DEHEXTRA has turned S_sfx into a sparse array
|
||||
@ -414,7 +415,7 @@ void I_InitSound(void)
|
||||
|
||||
sound_module->CacheSound(&S_sfx[i]);
|
||||
}
|
||||
printf("done.\n");
|
||||
I_Printf(VB_INFO, "done.");
|
||||
|
||||
// [FG] add links for likely missing sounds
|
||||
for (i = 0; i < arrlen(sfx_subst); i++)
|
||||
@ -446,7 +447,7 @@ boolean I_AllowReinitSound(void)
|
||||
{
|
||||
if (!snd_init)
|
||||
{
|
||||
fprintf(stderr, "I_AllowReinitSound: Sound was never initialized.\n");
|
||||
I_Printf(VB_WARNING, "I_AllowReinitSound: Sound was never initialized.");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -459,13 +460,13 @@ void I_SetSoundModule(int device)
|
||||
|
||||
if (!snd_init)
|
||||
{
|
||||
fprintf(stderr, "I_SetSoundModule: Sound was never initialized.\n");
|
||||
I_Printf(VB_WARNING, "I_SetSoundModule: Sound was never initialized.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (device < 0 || device >= arrlen(sound_modules))
|
||||
{
|
||||
fprintf(stderr, "I_SetSoundModule: Invalid choice.\n");
|
||||
I_Printf(VB_WARNING, "I_SetSoundModule: Invalid choice.");
|
||||
return;
|
||||
}
|
||||
|
||||
@ -478,7 +479,7 @@ void I_SetSoundModule(int device)
|
||||
|
||||
if (!sound_module->ReinitSound())
|
||||
{
|
||||
fprintf(stderr, "I_SetSoundModule: Failed to reinitialize sound.\n");
|
||||
I_Printf(VB_WARNING, "I_SetSoundModule: Failed to reinitialize sound.");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -18,16 +18,9 @@
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef _WIN32
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <io.h>
|
||||
#else
|
||||
#include <unistd.h> // [FG] isatty()
|
||||
#endif
|
||||
|
||||
#include "SDL.h"
|
||||
|
||||
#include "i_printf.h"
|
||||
#include "i_system.h"
|
||||
#include "m_misc2.h"
|
||||
#include "m_argv.h"
|
||||
@ -47,29 +40,18 @@ void I_InitJoystick(void)
|
||||
{
|
||||
if (SDL_Init(SDL_INIT_GAMECONTROLLER) < 0)
|
||||
{
|
||||
fprintf(stderr, "I_InitJoystick: Failed to initialize game controller: %s\n",
|
||||
I_Printf(VB_WARNING, "I_InitJoystick: Failed to initialize game controller: %s",
|
||||
SDL_GetError());
|
||||
return;
|
||||
}
|
||||
|
||||
SDL_GameControllerEventState(SDL_ENABLE);
|
||||
|
||||
printf("I_InitJoystick: Initialize game controller.\n");
|
||||
I_Printf(VB_INFO, "I_InitJoystick: Initialize game controller.");
|
||||
|
||||
I_AtExit(I_ShutdownJoystick, true);
|
||||
}
|
||||
|
||||
// [FG] returns true if stdout is a real console, false if it is a file
|
||||
|
||||
static boolean I_ConsoleStdout(void)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
return _isatty(_fileno(stdout));
|
||||
#else
|
||||
return isatty(fileno(stdout));
|
||||
#endif
|
||||
}
|
||||
|
||||
//
|
||||
// I_Error
|
||||
//
|
||||
@ -85,10 +67,10 @@ void I_ErrorOrSuccess(int err_code, const char *error, ...) // killough 3/20/98:
|
||||
va_list argptr;
|
||||
va_start(argptr,error);
|
||||
M_vsnprintf(dest,len,error,argptr);
|
||||
strcat(dest,"\n");
|
||||
va_end(argptr);
|
||||
|
||||
fputs(dest, stderr);
|
||||
I_Printf(err_code == 0 ? VB_ALWAYS : VB_ERROR, "%s", dest);
|
||||
strcat(dest,"\n");
|
||||
|
||||
if (exit_code == 0 && err_code != 0)
|
||||
exit_code = err_code;
|
||||
@ -162,7 +144,7 @@ void I_SafeExit(int rc)
|
||||
|
||||
if (rc == 0 || entry->run_on_error)
|
||||
{
|
||||
// fprintf(stderr, "Exit Sequence[%d]: %s (%d)\n", exit_priority, entry->name, rc);
|
||||
I_Printf(VB_DEBUG, "Exit Sequence[%d]: %s (%d)", exit_priority, entry->name, rc);
|
||||
entry->func();
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include "../miniz/miniz.h"
|
||||
|
||||
#include "doomstat.h"
|
||||
#include "i_printf.h"
|
||||
#include "v_video.h"
|
||||
#include "d_main.h"
|
||||
#include "st_stuff.h"
|
||||
@ -789,7 +790,7 @@ boolean I_WritePNGfile(char *filename)
|
||||
if (fwrite(png, 1, size, file) == size)
|
||||
{
|
||||
ret = true;
|
||||
printf("I_WritePNGfile: %s\n", filename);
|
||||
I_Printf(VB_INFO, "I_WritePNGfile: %s", filename);
|
||||
}
|
||||
fclose(file);
|
||||
}
|
||||
@ -827,8 +828,8 @@ static void CenterWindow(int *x, int *y, int w, int h)
|
||||
|
||||
if (SDL_GetDisplayBounds(video_display, &bounds) < 0)
|
||||
{
|
||||
fprintf(stderr, "CenterWindow: Failed to read display bounds "
|
||||
"for display #%d!\n", video_display);
|
||||
I_Printf(VB_WARNING, "CenterWindow: Failed to read display bounds "
|
||||
"for display #%d!", video_display);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -849,10 +850,10 @@ static void I_ResetInvalidDisplayIndex(void)
|
||||
// and if it doesn't, reset it.
|
||||
if (video_display < 0 || video_display >= SDL_GetNumVideoDisplays())
|
||||
{
|
||||
fprintf(stderr,
|
||||
I_Printf(VB_WARNING,
|
||||
"I_ResetInvalidDisplayIndex: We were configured to run on "
|
||||
"display #%d, but it no longer exists (max %d). "
|
||||
"Moving to display 0.\n",
|
||||
"Moving to display 0.",
|
||||
video_display, SDL_GetNumVideoDisplays() - 1);
|
||||
video_display = 0;
|
||||
}
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <math.h>
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "i_printf.h"
|
||||
#include "i_sound.h"
|
||||
#include "i_system.h"
|
||||
#include "m_misc2.h"
|
||||
@ -173,12 +174,12 @@ static void MidiError(const char *prefix, DWORD dwError)
|
||||
if (mmr == MMSYSERR_NOERROR)
|
||||
{
|
||||
char *error = M_ConvertWideToUtf8(werror);
|
||||
fprintf(stderr, "%s: %s.\n", prefix, error);
|
||||
I_Printf(VB_ERROR, "%s: %s.", prefix, error);
|
||||
free(error);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "%s: Unknown midiStream error.\n", prefix);
|
||||
I_Printf(VB_ERROR, "%s: Unknown midiStream error.", prefix);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1468,7 +1469,7 @@ static boolean I_WIN_InitMusic(int device)
|
||||
|
||||
win_midi_state = STATE_STOPPED;
|
||||
|
||||
printf("Windows MIDI Init: Using '%s'.\n", winmm_device);
|
||||
I_Printf(VB_INFO, "Windows MIDI Init: Using '%s'.", winmm_device);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -1608,7 +1609,7 @@ static void *I_WIN_RegisterSong(void *data, int len)
|
||||
|
||||
if (song.file == NULL)
|
||||
{
|
||||
fprintf(stderr, "I_WIN_RegisterSong: Failed to load MID.\n");
|
||||
I_Printf(VB_ERROR, "I_WIN_RegisterSong: Failed to load MID.");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "i_printf.h"
|
||||
#include "i_oalstream.h"
|
||||
#include "i_sound.h"
|
||||
|
||||
@ -55,7 +56,7 @@ static void PrintError(int e)
|
||||
msg = "Unknown error.";
|
||||
break;
|
||||
}
|
||||
printf("XMP: %s\n", msg);
|
||||
I_Printf(VB_ERROR, "XMP: %s", msg);
|
||||
}
|
||||
|
||||
static boolean I_XMP_OpenStream(void *data, ALsizei size, ALenum *format,
|
||||
@ -66,7 +67,7 @@ static boolean I_XMP_OpenStream(void *data, ALsizei size, ALenum *format,
|
||||
context = xmp_create_context();
|
||||
if (!context)
|
||||
{
|
||||
printf("XMP: Failed to create context.\n");
|
||||
I_Printf(VB_ERROR, "XMP: Failed to create context.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include "doomtype.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "i_printf.h"
|
||||
#include "i_system.h"
|
||||
|
||||
int myargc;
|
||||
@ -230,7 +231,7 @@ void M_CheckCommandLine(void)
|
||||
|
||||
void M_PrintHelpString(void)
|
||||
{
|
||||
printf(HELP_STRING);
|
||||
I_Printf(VB_ALWAYS, "%s", HELP_STRING);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -32,6 +32,7 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "i_printf.h"
|
||||
#include "i_system.h"
|
||||
#include "m_misc2.h"
|
||||
|
||||
@ -46,7 +47,7 @@ static wchar_t *ConvertMultiByteToWide(const char *str, UINT code_page)
|
||||
if (!wlen)
|
||||
{
|
||||
errno = EINVAL;
|
||||
printf("Warning: Failed to convert path to wide encoding\n");
|
||||
I_Printf(VB_WARNING, "Warning: Failed to convert path to wide encoding");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -61,7 +62,7 @@ static wchar_t *ConvertMultiByteToWide(const char *str, UINT code_page)
|
||||
if (MultiByteToWideChar(code_page, 0, str, -1, wstr, wlen) == 0)
|
||||
{
|
||||
errno = EINVAL;
|
||||
printf("Warning: Failed to convert path to wide encoding\n");
|
||||
I_Printf(VB_WARNING, "Warning: Failed to convert path to wide encoding");
|
||||
free(wstr);
|
||||
return NULL;
|
||||
}
|
||||
@ -79,7 +80,7 @@ static char *ConvertWideToMultiByte(const wchar_t *wstr, UINT code_page)
|
||||
if (!len)
|
||||
{
|
||||
errno = EINVAL;
|
||||
printf("Warning: Failed to convert path to multi byte encoding\n");
|
||||
I_Printf(VB_WARNING, "Warning: Failed to convert path to multi byte encoding");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -94,7 +95,7 @@ static char *ConvertWideToMultiByte(const wchar_t *wstr, UINT code_page)
|
||||
if (WideCharToMultiByte(code_page, 0, wstr, -1, str, len, NULL, NULL) == 0)
|
||||
{
|
||||
errno = EINVAL;
|
||||
printf("Warning: Failed to convert path to multi byte encoding\n");
|
||||
I_Printf(VB_WARNING, "Warning: Failed to convert path to multi byte encoding");
|
||||
free(str);
|
||||
return NULL;
|
||||
}
|
||||
|
12
src/m_misc.c
12
src/m_misc.c
@ -28,6 +28,7 @@
|
||||
#include "m_menu.h"
|
||||
#include "am_map.h"
|
||||
#include "w_wad.h"
|
||||
#include "i_printf.h"
|
||||
#include "i_system.h"
|
||||
#include "i_sound.h"
|
||||
#include "i_video.h"
|
||||
@ -2524,6 +2525,13 @@ default_t defaults[] = {
|
||||
"Duration of normal Doom messages (ms)"
|
||||
},
|
||||
|
||||
{
|
||||
"default_verbosity",
|
||||
(config_t *) &cfg_verbosity, NULL,
|
||||
{VB_INFO}, {VB_ERROR, VB_MAX - 1}, number, ss_none, wad_no,
|
||||
"verbosity level (1 = errors only, 2 = warnings, 3 = info, 4 = debug)"
|
||||
},
|
||||
|
||||
//
|
||||
// HUD
|
||||
//
|
||||
@ -3214,14 +3222,14 @@ void M_LoadDefaults (void)
|
||||
}
|
||||
|
||||
NormalizeSlashes(defaultfile);
|
||||
printf(" default file: %s\n", defaultfile);
|
||||
I_Printf(VB_INFO, " default file: %s", defaultfile);
|
||||
|
||||
// read the file in, overriding any set defaults
|
||||
//
|
||||
// killough 9/21/98: Print warning if file missing, and use fgets for reading
|
||||
|
||||
if (!(f = M_fopen(defaultfile, "r")))
|
||||
printf("Warning: Cannot read %s -- using built-in defaults\n",defaultfile);
|
||||
I_Printf(VB_WARNING, "Warning: Cannot read %s -- using built-in defaults",defaultfile);
|
||||
else
|
||||
{
|
||||
char s[256];
|
||||
|
@ -17,6 +17,7 @@
|
||||
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "i_printf.h"
|
||||
#include <stdio.h>
|
||||
#include "midifile.h"
|
||||
#include "midifallback.h"
|
||||
@ -112,9 +113,9 @@ static boolean GetProgramFallback(byte idx, byte program,
|
||||
// selected this variation or if the variation is above 63.
|
||||
fallback->value = 0;
|
||||
|
||||
fprintf(stderr,
|
||||
I_Printf(VB_WARNING,
|
||||
"midifallback: warning: ch=%d [bank_msb=%d prog=%d] "
|
||||
"falling back to [bank_msb=%d prog=%d]\n",
|
||||
"falling back to [bank_msb=%d prog=%d]",
|
||||
idx, bank_msb[idx], program, fallback->value, program);
|
||||
return true;
|
||||
}
|
||||
@ -132,9 +133,9 @@ static boolean GetProgramFallback(byte idx, byte program,
|
||||
fallback->value -= 8;
|
||||
}
|
||||
|
||||
fprintf(stderr,
|
||||
I_Printf(VB_WARNING,
|
||||
"midifallback: warning: ch=%d [bank_msb=%d prog=%d] "
|
||||
"falling back to [bank_msb=%d prog=%d]\n",
|
||||
"falling back to [bank_msb=%d prog=%d]",
|
||||
idx, bank_msb[idx], program, fallback->value, program);
|
||||
return true;
|
||||
}
|
||||
@ -149,9 +150,9 @@ static boolean GetProgramFallback(byte idx, byte program,
|
||||
fallback->value = drums_table[program];
|
||||
selected[idx] = true;
|
||||
|
||||
fprintf(stderr,
|
||||
I_Printf(VB_WARNING,
|
||||
"midifallback: warning: ch=%d [prog=%d] "
|
||||
"falling back to [prog=%d] (drums)\n",
|
||||
"falling back to [prog=%d] (drums)",
|
||||
idx, program, fallback->value);
|
||||
return true;
|
||||
}
|
||||
@ -193,9 +194,9 @@ void MIDI_CheckFallback(const midi_event_t *event, midi_fallback_t *fallback,
|
||||
fallback->type = FALLBACK_BANK_LSB;
|
||||
fallback->value = 0;
|
||||
|
||||
fprintf(stderr,
|
||||
I_Printf(VB_WARNING,
|
||||
"midifallback: warning: ch=%d [bank_lsb=%d] "
|
||||
"replaced by [bank_lsb=%d]\n",
|
||||
"replaced by [bank_lsb=%d]",
|
||||
idx, event->data.channel.param2, fallback->value);
|
||||
return;
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <assert.h>
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "i_printf.h"
|
||||
#include "m_swap.h"
|
||||
#include "i_system.h"
|
||||
#include "memio.h"
|
||||
@ -98,8 +99,9 @@ static boolean CheckChunkHeader(chunk_header_t *chunk,
|
||||
|
||||
if (!result)
|
||||
{
|
||||
fprintf(stderr, "CheckChunkHeader: Expected '%s' chunk header, "
|
||||
"got '%c%c%c%c'\n",
|
||||
I_Printf(VB_WARNING,
|
||||
"CheckChunkHeader: Expected '%s' chunk header, "
|
||||
"got '%c%c%c%c'",
|
||||
expected_id,
|
||||
chunk->chunk_id[0], chunk->chunk_id[1],
|
||||
chunk->chunk_id[2], chunk->chunk_id[3]);
|
||||
@ -122,7 +124,7 @@ static boolean ReadByte(byte *result, MEMFILE *stream)
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "ReadByte: Unexpected end of file\n");
|
||||
I_Printf(VB_WARNING, "ReadByte: Unexpected end of file");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -140,8 +142,8 @@ static boolean ReadVariableLength(unsigned int *result, MEMFILE *stream)
|
||||
{
|
||||
if (!ReadByte(&b, stream))
|
||||
{
|
||||
fprintf(stderr, "ReadVariableLength: Error while reading "
|
||||
"variable-length value\n");
|
||||
I_Printf(VB_WARNING, "ReadVariableLength: Error while reading "
|
||||
"variable-length value");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -158,8 +160,8 @@ static boolean ReadVariableLength(unsigned int *result, MEMFILE *stream)
|
||||
}
|
||||
}
|
||||
|
||||
fprintf(stderr, "ReadVariableLength: Variable-length value too "
|
||||
"long: maximum of four bytes\n");
|
||||
I_Printf(VB_WARNING, "ReadVariableLength: Variable-length value too "
|
||||
"long: maximum of four bytes");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -177,7 +179,7 @@ static void *ReadByteSequence(unsigned int num_bytes, MEMFILE *stream)
|
||||
|
||||
if (result == NULL)
|
||||
{
|
||||
fprintf(stderr, "ReadByteSequence: Failed to allocate buffer\n");
|
||||
I_Printf(VB_WARNING, "ReadByteSequence: Failed to allocate buffer");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -187,8 +189,8 @@ static void *ReadByteSequence(unsigned int num_bytes, MEMFILE *stream)
|
||||
{
|
||||
if (!ReadByte(&result[i], stream))
|
||||
{
|
||||
fprintf(stderr, "ReadByteSequence: Error while reading byte %u\n",
|
||||
i);
|
||||
I_Printf(VB_WARNING, "ReadByteSequence: Error while reading byte %u",
|
||||
i);
|
||||
free(result);
|
||||
return NULL;
|
||||
}
|
||||
@ -216,8 +218,8 @@ static boolean ReadChannelEvent(midi_event_t *event,
|
||||
|
||||
if (!ReadByte(&b, stream))
|
||||
{
|
||||
fprintf(stderr, "ReadChannelEvent: Error while reading channel "
|
||||
"event parameters\n");
|
||||
I_Printf(VB_WARNING, "ReadChannelEvent: Error while reading channel "
|
||||
"event parameters");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -229,8 +231,8 @@ static boolean ReadChannelEvent(midi_event_t *event,
|
||||
{
|
||||
if (!ReadByte(&b, stream))
|
||||
{
|
||||
fprintf(stderr, "ReadChannelEvent: Error while reading channel "
|
||||
"event parameters\n");
|
||||
I_Printf(VB_WARNING, "ReadChannelEvent: Error while reading channel "
|
||||
"event parameters");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -249,8 +251,8 @@ static boolean ReadSysExEvent(midi_event_t *event, int event_type,
|
||||
|
||||
if (!ReadVariableLength(&event->data.sysex.length, stream))
|
||||
{
|
||||
fprintf(stderr, "ReadSysExEvent: Failed to read length of "
|
||||
"SysEx block\n");
|
||||
I_Printf(VB_WARNING, "ReadSysExEvent: Failed to read length of "
|
||||
"SysEx block");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -260,7 +262,7 @@ static boolean ReadSysExEvent(midi_event_t *event, int event_type,
|
||||
|
||||
if (event->data.sysex.data == NULL)
|
||||
{
|
||||
fprintf(stderr, "ReadSysExEvent: Failed while reading SysEx event\n");
|
||||
I_Printf(VB_WARNING, "ReadSysExEvent: Failed while reading SysEx event");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -279,7 +281,7 @@ static boolean ReadMetaEvent(midi_event_t *event, MEMFILE *stream)
|
||||
|
||||
if (!ReadByte(&b, stream))
|
||||
{
|
||||
fprintf(stderr, "ReadMetaEvent: Failed to read meta event type\n");
|
||||
I_Printf(VB_WARNING, "ReadMetaEvent: Failed to read meta event type");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -289,8 +291,8 @@ static boolean ReadMetaEvent(midi_event_t *event, MEMFILE *stream)
|
||||
|
||||
if (!ReadVariableLength(&event->data.meta.length, stream))
|
||||
{
|
||||
fprintf(stderr, "ReadSysExEvent: Failed to read length of "
|
||||
"SysEx block\n");
|
||||
I_Printf(VB_WARNING, "ReadSysExEvent: Failed to read length of "
|
||||
"SysEx block");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -300,7 +302,7 @@ static boolean ReadMetaEvent(midi_event_t *event, MEMFILE *stream)
|
||||
|
||||
if (event->data.meta.data == NULL)
|
||||
{
|
||||
fprintf(stderr, "ReadSysExEvent: Failed while reading SysEx event\n");
|
||||
I_Printf(VB_WARNING, "ReadSysExEvent: Failed while reading SysEx event");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -314,13 +316,13 @@ static boolean ReadEvent(midi_event_t *event, unsigned int *last_event_type,
|
||||
|
||||
if (!ReadVariableLength(&event->delta_time, stream))
|
||||
{
|
||||
fprintf(stderr, "ReadEvent: Failed to read event timestamp\n");
|
||||
I_Printf(VB_WARNING, "ReadEvent: Failed to read event timestamp");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ReadByte(&event_type, stream))
|
||||
{
|
||||
fprintf(stderr, "ReadEvent: Failed to read event type\n");
|
||||
I_Printf(VB_WARNING, "ReadEvent: Failed to read event type");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -335,7 +337,7 @@ static boolean ReadEvent(midi_event_t *event, unsigned int *last_event_type,
|
||||
|
||||
if (mem_fseek(stream, -1, MEM_SEEK_CUR) < 0)
|
||||
{
|
||||
fprintf(stderr, "ReadEvent: Unable to seek in stream\n");
|
||||
I_Printf(VB_WARNING, "ReadEvent: Unable to seek in stream");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -382,7 +384,7 @@ static boolean ReadEvent(midi_event_t *event, unsigned int *last_event_type,
|
||||
break;
|
||||
}
|
||||
|
||||
fprintf(stderr, "ReadEvent: Unknown MIDI event type: 0x%x\n", event_type);
|
||||
I_Printf(VB_WARNING, "ReadEvent: Unknown MIDI event type: 0x%x", event_type);
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -559,9 +561,9 @@ static boolean ReadFileHeader(midi_file_t *file, MEMFILE *stream)
|
||||
if (!CheckChunkHeader(&file->header.chunk_header, HEADER_CHUNK_ID)
|
||||
|| SDL_SwapBE32(file->header.chunk_header.chunk_size) != 6)
|
||||
{
|
||||
fprintf(stderr, "ReadFileHeader: Invalid MIDI chunk header! "
|
||||
"chunk_size=%i\n",
|
||||
SDL_SwapBE32(file->header.chunk_header.chunk_size));
|
||||
I_Printf(VB_WARNING, "ReadFileHeader: Invalid MIDI chunk header! "
|
||||
"chunk_size=%i",
|
||||
SDL_SwapBE32(file->header.chunk_header.chunk_size));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -571,8 +573,8 @@ static boolean ReadFileHeader(midi_file_t *file, MEMFILE *stream)
|
||||
if ((format_type != 0 && format_type != 1)
|
||||
|| file->num_tracks < 1)
|
||||
{
|
||||
fprintf(stderr, "ReadFileHeader: Only type 0/1 "
|
||||
"MIDI files supported!\n");
|
||||
I_Printf(VB_WARNING, "ReadFileHeader: Only type 0/1 "
|
||||
"MIDI files supported!");
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -619,7 +621,7 @@ midi_file_t *MIDI_LoadFile(void *buf, size_t buflen)
|
||||
|
||||
if (stream == NULL)
|
||||
{
|
||||
fprintf(stderr, "MIDI_LoadFile: Failed to open\n");
|
||||
I_Printf(VB_ERROR, "MIDI_LoadFile: Failed to open");
|
||||
MIDI_FreeFile(file);
|
||||
return NULL;
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
|
||||
#include "config.h"
|
||||
#include "doomtype.h"
|
||||
#include "i_printf.h"
|
||||
#include "i_system.h"
|
||||
#include "i_timer.h" // I_Sleep
|
||||
#include "m_argv.h"
|
||||
@ -455,9 +456,9 @@ static void NET_CL_ParseSYN(net_packet_t *packet)
|
||||
// fixes a compatibility issue, we may still have problems.
|
||||
if (strcmp(server_version, PROJECT_STRING) != 0)
|
||||
{
|
||||
fprintf(stderr, "NET_CL_ParseSYN: This is '%s', but the server is "
|
||||
I_Printf(VB_WARNING, "NET_CL_ParseSYN: This is '%s', but the server is "
|
||||
"'%s'. It is possible that this mismatch may cause the game "
|
||||
"to desync.\n", PROJECT_STRING, server_version);
|
||||
"to desync.", PROJECT_STRING, server_version);
|
||||
}
|
||||
}
|
||||
|
||||
@ -919,7 +920,7 @@ static void NET_CL_ParseConsoleMessage(net_packet_t *packet)
|
||||
return;
|
||||
}
|
||||
|
||||
printf("Message from server:\n%s\n", msg);
|
||||
I_Printf(VB_INFO, "Message from server:\n%s", msg);
|
||||
}
|
||||
|
||||
// parse a received packet
|
||||
@ -1186,8 +1187,8 @@ void NET_CL_Disconnect(void)
|
||||
NET_Log("client: no acknowledgement of disconnect received");
|
||||
client_state = CLIENT_STATE_WAITING_START;
|
||||
|
||||
fprintf(stderr, "NET_CL_Disconnect: Timeout while disconnecting "
|
||||
"from server\n");
|
||||
I_Printf(VB_WARNING, "NET_CL_Disconnect: Timeout while disconnecting "
|
||||
"from server");
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "i_printf.h"
|
||||
#include "i_system.h"
|
||||
#include "i_video.h"
|
||||
#include "m_argv.h"
|
||||
@ -278,7 +279,7 @@ void NET_WaitForLaunch(void)
|
||||
{
|
||||
if (!TXT_Init())
|
||||
{
|
||||
fprintf(stderr, "Failed to initialize GUI\n");
|
||||
I_Printf(VB_ERROR, "Failed to initialize GUI");
|
||||
I_SafeExit(-1);
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "i_printf.h"
|
||||
#include "i_system.h"
|
||||
#include "i_timer.h" // I_Sleep
|
||||
#include "m_misc2.h"
|
||||
@ -98,8 +99,8 @@ net_addr_t *NET_Query_ResolveMaster(net_context_t *context)
|
||||
|
||||
if (addr == NULL)
|
||||
{
|
||||
fprintf(stderr, "Warning: Failed to resolve address "
|
||||
"for master server: %s\n", MASTER_SERVER_ADDRESS);
|
||||
I_Printf(VB_WARNING, "Warning: Failed to resolve address "
|
||||
"for master server: %s", MASTER_SERVER_ADDRESS);
|
||||
}
|
||||
|
||||
return addr;
|
||||
@ -135,8 +136,8 @@ void NET_Query_AddResponse(net_packet_t *packet)
|
||||
|
||||
if (!registered_with_master)
|
||||
{
|
||||
printf("Registered with master server at %s\n",
|
||||
MASTER_SERVER_ADDRESS);
|
||||
I_Printf(VB_INFO, "Registered with master server at %s",
|
||||
MASTER_SERVER_ADDRESS);
|
||||
registered_with_master = true;
|
||||
}
|
||||
}
|
||||
@ -144,8 +145,8 @@ void NET_Query_AddResponse(net_packet_t *packet)
|
||||
{
|
||||
// Always show rejections.
|
||||
|
||||
printf("Failed to register with master server at %s\n",
|
||||
MASTER_SERVER_ADDRESS);
|
||||
I_Printf(VB_WARNING, "Failed to register with master server at %s",
|
||||
MASTER_SERVER_ADDRESS);
|
||||
}
|
||||
|
||||
got_master_response = true;
|
||||
@ -512,8 +513,8 @@ static void CheckTargetTimeouts(void)
|
||||
|
||||
if (targets[i].type == QUERY_TARGET_MASTER)
|
||||
{
|
||||
fprintf(stderr, "NET_MasterQuery: no response "
|
||||
"from master server.\n");
|
||||
I_Printf(VB_WARNING, "NET_MasterQuery: no response "
|
||||
"from master server.");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -788,11 +789,11 @@ void NET_LANQuery(void)
|
||||
{
|
||||
if (NET_StartLANQuery())
|
||||
{
|
||||
printf("\nSearching for servers on local LAN ...\n");
|
||||
I_Printf(VB_INFO, "\nSearching for servers on local LAN ...");
|
||||
|
||||
NET_Query_QueryLoop(NET_QueryPrintCallback, NULL);
|
||||
|
||||
printf("\n%i server(s) found.\n", GetNumResponses());
|
||||
I_Printf(VB_INFO, "\n%i server(s) found.", GetNumResponses());
|
||||
FreeTargets();
|
||||
}
|
||||
}
|
||||
@ -801,11 +802,11 @@ void NET_MasterQuery(void)
|
||||
{
|
||||
if (NET_StartMasterQuery())
|
||||
{
|
||||
printf("\nSearching for servers on Internet ...\n");
|
||||
I_Printf(VB_INFO, "\nSearching for servers on Internet ...");
|
||||
|
||||
NET_Query_QueryLoop(NET_QueryPrintCallback, NULL);
|
||||
|
||||
printf("\n%i server(s) found.\n", GetNumResponses());
|
||||
I_Printf(VB_INFO, "\n%i server(s) found.", GetNumResponses());
|
||||
FreeTargets();
|
||||
}
|
||||
}
|
||||
@ -828,7 +829,7 @@ void NET_QueryAddress(const char *addr_str)
|
||||
|
||||
target = GetTargetForAddr(addr, true);
|
||||
|
||||
printf("\nQuerying '%s'...\n", addr_str);
|
||||
I_Printf(VB_INFO, "\nQuerying '%s'...", addr_str);
|
||||
|
||||
// Run query loop.
|
||||
|
||||
|
@ -23,6 +23,7 @@
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "doomdef.h"
|
||||
#include "i_printf.h"
|
||||
#include "i_system.h"
|
||||
#include "i_video.h" // I_Sleep
|
||||
#include "m_argv.h"
|
||||
@ -222,7 +223,7 @@ static void NET_SV_BroadcastMessage(const char *s, ...)
|
||||
}
|
||||
}
|
||||
|
||||
printf("%s\n", buf);
|
||||
I_Printf(VB_INFO, "%s", buf);
|
||||
}
|
||||
|
||||
|
||||
@ -2007,7 +2008,7 @@ void NET_SV_Shutdown(void)
|
||||
return;
|
||||
}
|
||||
|
||||
fprintf(stderr, "SV: Shutting down server...\n");
|
||||
I_Printf(VB_WARNING, "SV: Shutting down server...");
|
||||
|
||||
// Disconnect all clients
|
||||
|
||||
@ -2043,7 +2044,7 @@ void NET_SV_Shutdown(void)
|
||||
if (I_GetTimeMS() - start_time > 5000)
|
||||
{
|
||||
running = false;
|
||||
fprintf(stderr, "SV: Timed out waiting for clients to disconnect.\n");
|
||||
I_Printf(VB_WARNING, "SV: Timed out waiting for clients to disconnect.");
|
||||
}
|
||||
|
||||
// Run the client code in case this is a loopback client.
|
||||
|
@ -20,6 +20,7 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "doomstat.h"
|
||||
#include "i_printf.h"
|
||||
#include "m_random.h"
|
||||
#include "r_main.h"
|
||||
#include "p_maputl.h"
|
||||
@ -1700,7 +1701,7 @@ static boolean P_HealCorpse(mobj_t* actor, int radius, statenum_t healstate, sfx
|
||||
&& corpsehit->radius == 0)
|
||||
{
|
||||
corpsehit->flags |= MF_TRANSLUCENT;
|
||||
fprintf(stderr, "A_VileChase: Resurrected ghost monster (%d) at (%d/%d)!\n",
|
||||
I_Printf(VB_WARNING, "A_VileChase: Resurrected ghost monster (%d) at (%d/%d)!",
|
||||
corpsehit->type, corpsehit->x>>FRACBITS, corpsehit->y>>FRACBITS);
|
||||
}
|
||||
|
||||
|
@ -18,6 +18,7 @@
|
||||
//
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "i_printf.h"
|
||||
#include "r_main.h"
|
||||
#include "w_wad.h"
|
||||
#include "m_argv.h"
|
||||
@ -443,9 +444,9 @@ static void P_LoadSegs_XGLN(byte *data)
|
||||
else
|
||||
{
|
||||
seg->frontsector = 0;
|
||||
fprintf(
|
||||
stderr,
|
||||
"P_LoadSegs_XGLN: front of seg %d, %d has no sidedef\n",
|
||||
I_Printf(
|
||||
VB_WARNING,
|
||||
"P_LoadSegs_XGLN: front of seg %d, %d has no sidedef",
|
||||
i, j);
|
||||
}
|
||||
|
||||
@ -535,7 +536,7 @@ void P_LoadNodes_XNOD(int lump, boolean compressed, boolean glnodes)
|
||||
if (err != Z_STREAM_END)
|
||||
I_Error("P_LoadNodes_XNOD: Error during ZNOD nodes decompression!");
|
||||
|
||||
fprintf(stderr, "P_LoadNodes_XNOD: ZNOD nodes compression ratio %.3f\n",
|
||||
I_Printf(VB_DEBUG, "P_LoadNodes_XNOD: ZNOD nodes compression ratio %.3f",
|
||||
(float) zstream->total_out / zstream->total_in);
|
||||
|
||||
data = output;
|
||||
|
@ -19,6 +19,7 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "doomstat.h"
|
||||
#include "i_printf.h"
|
||||
#include "r_main.h"
|
||||
#include "p_map.h"
|
||||
#include "p_spec.h"
|
||||
@ -988,8 +989,8 @@ int EV_DoDonut(line_t* line)
|
||||
// s3->floorpic is a short at 0000:0008
|
||||
// Trying to emulate
|
||||
|
||||
fprintf(stderr,
|
||||
"EV_DoDonut: Access violation at linedef %ld, sector %ld.\n",
|
||||
I_Printf(VB_WARNING,
|
||||
"EV_DoDonut: Access violation at linedef %ld, sector %ld.",
|
||||
(long) (line - lines), (long) (s1 - sectors));
|
||||
|
||||
if (!DonutOverrun(&s3_floorheight, &s3_floorpic))
|
||||
|
@ -19,6 +19,7 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "doomstat.h"
|
||||
#include "i_printf.h"
|
||||
#include "r_main.h"
|
||||
#include "p_mobj.h"
|
||||
#include "p_maputl.h"
|
||||
@ -455,7 +456,7 @@ static boolean PIT_CheckLine(line_t *ld) // killough 3/26/98: make static
|
||||
if (numspechit == MAXSPECIALCROSS_ORIGINAL + 1)
|
||||
{
|
||||
overflow[emu_spechits].triggered = true;
|
||||
fprintf(stderr, "PIT_CheckLine: Triggered SPECHITS overflow!\n");
|
||||
I_Printf(VB_WARNING, "PIT_CheckLine: Triggered SPECHITS overflow!");
|
||||
}
|
||||
SpechitOverrun(ld);
|
||||
}
|
||||
@ -2384,8 +2385,8 @@ static void SpechitOverrun(line_t *ld)
|
||||
nofit = addr;
|
||||
break;
|
||||
default:
|
||||
fprintf(stderr, "SpechitOverrun: Warning: unable to emulate"
|
||||
"an overrun where numspechit=%i\n",
|
||||
I_Printf(VB_DEBUG, "SpechitOverrun: Warning: unable to emulate"
|
||||
"an overrun where numspechit=%i",
|
||||
numspechit);
|
||||
break;
|
||||
}
|
||||
|
@ -21,6 +21,7 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "doomstat.h"
|
||||
#include "i_printf.h"
|
||||
#include "m_bbox.h"
|
||||
#include "r_main.h"
|
||||
#include "p_maputl.h"
|
||||
@ -802,7 +803,7 @@ static void InterceptsOverrun(int num_intercepts, intercept_t *intercept)
|
||||
{
|
||||
overflow[emu_intercepts].triggered = true;
|
||||
// [crispy] print a warning
|
||||
fprintf(stderr, "Triggered INTERCEPTS overflow!\n");
|
||||
I_Printf(VB_WARNING, "Triggered INTERCEPTS overflow!");
|
||||
}
|
||||
|
||||
location = (num_intercepts - MAXINTERCEPTS_ORIGINAL - 1) * 12;
|
||||
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "doomstat.h"
|
||||
#include "i_printf.h"
|
||||
#include "m_random.h"
|
||||
#include "r_main.h"
|
||||
#include "r_things.h"
|
||||
@ -1267,7 +1268,7 @@ void P_SpawnMapThing (mapthing_t* mthing)
|
||||
|
||||
if (i == num_mobj_types)
|
||||
{
|
||||
printf("P_SpawnMapThing: Unknown Thing type %i at (%i, %i)\n",
|
||||
I_Printf(VB_WARNING, "P_SpawnMapThing: Unknown Thing type %i at (%i, %i)",
|
||||
mthing->type, mthing->x, mthing->y);
|
||||
return;
|
||||
}
|
||||
|
@ -19,6 +19,7 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "doomstat.h"
|
||||
#include "i_printf.h"
|
||||
#include "m_bbox.h"
|
||||
#include "m_argv.h"
|
||||
#include "g_game.h"
|
||||
@ -1661,7 +1662,7 @@ void P_SetupLevel(int episode, int map, int playermask, skill_t skill)
|
||||
|
||||
// [FG] log level setup
|
||||
{
|
||||
fprintf(stderr, "P_SetupLevel: %.8s (%s), %s%s%s, %s complevel\n",
|
||||
I_Printf(VB_INFO, "P_SetupLevel: %.8s (%s), %s%s%s, %s complevel",
|
||||
lumpname, W_WadNameForLump(lumpnum),
|
||||
mapformat == MFMT_XNOD ? "XNOD nodes" :
|
||||
mapformat == MFMT_ZNOD ? "ZNOD nodes" :
|
||||
|
@ -18,6 +18,7 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "doomstat.h"
|
||||
#include "i_printf.h"
|
||||
#include "w_wad.h"
|
||||
#include "r_main.h"
|
||||
#include "p_spec.h"
|
||||
@ -81,13 +82,13 @@ void P_InitSwitchList(void)
|
||||
texture1 = R_CheckTextureNumForName(alphSwitchList[i].name1);
|
||||
|
||||
if (texture1 == -1)
|
||||
printf("P_InitSwitchList: unknown texture %s\n",
|
||||
I_Printf(VB_WARNING, "P_InitSwitchList: unknown texture %s",
|
||||
alphSwitchList[i].name1);
|
||||
|
||||
texture2 = R_CheckTextureNumForName(alphSwitchList[i].name2);
|
||||
|
||||
if (texture2 == -1)
|
||||
printf("P_InitSwitchList: unknown texture %s\n",
|
||||
I_Printf(VB_WARNING, "P_InitSwitchList: unknown texture %s",
|
||||
alphSwitchList[i].name2);
|
||||
|
||||
if (texture1 != -1 && texture2 != -1)
|
||||
|
@ -5,6 +5,7 @@ static const char *params[] = {
|
||||
"-nomusic",
|
||||
"-nosfx",
|
||||
"-nosound",
|
||||
"-verbose",
|
||||
"-version",
|
||||
"-beta",
|
||||
"-coop_spawns",
|
||||
|
39
src/r_data.c
39
src/r_data.c
@ -19,6 +19,7 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "doomstat.h"
|
||||
#include "i_printf.h"
|
||||
#include "p_tick.h"
|
||||
#include "w_wad.h"
|
||||
#include "r_main.h"
|
||||
@ -363,7 +364,7 @@ static void R_GenerateLookup(int texnum, int *const errors)
|
||||
{
|
||||
// killough 12/98: Warn about a common column construction bug
|
||||
unsigned limit = texture->height*3+3; // absolute column size limit
|
||||
int badcol = devparm; // warn only if -devparm used
|
||||
int badcol = 1;
|
||||
|
||||
for (i = texture->patchcount, patch = texture->patches; --i >= 0;)
|
||||
{
|
||||
@ -394,7 +395,7 @@ static void R_GenerateLookup(int texnum, int *const errors)
|
||||
if (badcol)
|
||||
{
|
||||
badcol = 0;
|
||||
printf("\nWarning: Texture %8.8s "
|
||||
I_Printf(VB_DEBUG, "\nWarning: Texture %8.8s "
|
||||
"(height %d) has bad column(s)"
|
||||
" starting at x = %d.",
|
||||
texture->name, texture->height, x);
|
||||
@ -422,10 +423,10 @@ static void R_GenerateLookup(int texnum, int *const errors)
|
||||
{
|
||||
if (!count[x].patches) // killough 4/9/98
|
||||
// [FG] treat missing patches as non-fatal
|
||||
if (devparm)
|
||||
// if (devparm)
|
||||
{
|
||||
// killough 8/8/98
|
||||
printf("\nR_GenerateLookup:"
|
||||
I_Printf(VB_DEBUG, "\nR_GenerateLookup:"
|
||||
" Column %d is without a patch in texture %.8s",
|
||||
x, texture->name);
|
||||
// ++*errors;
|
||||
@ -461,7 +462,7 @@ static void R_GenerateLookup(int texnum, int *const errors)
|
||||
|
||||
if (err) // killough 10/98: non-verbose output
|
||||
{
|
||||
printf("\nR_GenerateLookup: Column without a patch in texture %.8s",
|
||||
I_Printf(VB_WARNING, "\nR_GenerateLookup: Column without a patch in texture %.8s",
|
||||
texture->name);
|
||||
++*errors;
|
||||
}
|
||||
@ -552,13 +553,13 @@ void R_InitTextures (void)
|
||||
|
||||
patchlookup[i] = (W_CheckNumForName)(name, ns_sprites);
|
||||
|
||||
if (patchlookup[i] == -1 && devparm) // killough 8/8/98
|
||||
printf("\nWarning: patch %.8s, index %d does not exist",name,i);
|
||||
if (patchlookup[i] == -1)
|
||||
I_Printf(VB_DEBUG, "\nWarning: patch %.8s, index %d does not exist",name,i);
|
||||
}
|
||||
|
||||
if (patchlookup[i] != -1 && !R_IsPatchLump(patchlookup[i]))
|
||||
{
|
||||
fprintf(stderr, "\nR_InitTextures: patch %.8s, index %d is invalid", name, i);
|
||||
I_Printf(VB_WARNING, "\nR_InitTextures: patch %.8s, index %d is invalid", name, i);
|
||||
patchlookup[i] = (W_CheckNumForName)("TNT1A0", ns_sprites);
|
||||
}
|
||||
|
||||
@ -619,18 +620,18 @@ void R_InitTextures (void)
|
||||
// and make more accurate
|
||||
|
||||
int temp3 = 8+(temp2-temp1+255)/128 + (numtextures+255)/128; // killough
|
||||
putchar('[');
|
||||
I_PutChar(VB_INFO, '[');
|
||||
for (i = 0; i < temp3; i++)
|
||||
putchar(' ');
|
||||
putchar(']');
|
||||
I_PutChar(VB_INFO, ' ');
|
||||
I_PutChar(VB_INFO, ']');
|
||||
for (i = 0; i < temp3; i++)
|
||||
putchar('\x8');
|
||||
I_PutChar(VB_INFO, '\x8');
|
||||
}
|
||||
|
||||
for (i=0 ; i<numtextures ; i++, directory++)
|
||||
{
|
||||
if (!(i&127)) // killough
|
||||
putchar('.');
|
||||
I_PutChar(VB_INFO, '.');
|
||||
|
||||
if (i == numtextures1)
|
||||
{
|
||||
@ -680,7 +681,7 @@ void R_InitTextures (void)
|
||||
}
|
||||
if (patch->patch == -1)
|
||||
{ // killough 8/8/98
|
||||
printf("\nR_InitTextures: Missing patch %d in texture %.8s",
|
||||
I_Printf(VB_WARNING, "\nR_InitTextures: Missing patch %d in texture %.8s",
|
||||
SHORT(mpatch->patch), texture->name); // killough 4/17/98
|
||||
// [FG] treat missing patches as non-fatal, substitute dummy patch
|
||||
// ++errors;
|
||||
@ -796,7 +797,7 @@ void R_InitSpriteLumps(void)
|
||||
for (i=0 ; i< numspritelumps ; i++)
|
||||
{
|
||||
if (!(i&127)) // killough
|
||||
putchar ('.');
|
||||
I_PutChar(VB_INFO, '.');
|
||||
|
||||
patch = W_CacheLumpNum(firstspritelump+i, PU_CACHE);
|
||||
spritewidth[i] = SHORT(patch->width)<<FRACBITS;
|
||||
@ -932,7 +933,7 @@ void R_InitTranMap(int progress)
|
||||
long b1 = pal[2][i] * w2;
|
||||
|
||||
if (!(i & 31) && progress)
|
||||
putchar('.');
|
||||
I_PutChar(VB_INFO, '.');
|
||||
|
||||
if (!(~i & 15))
|
||||
{
|
||||
@ -969,7 +970,7 @@ void R_InitTranMap(int progress)
|
||||
}
|
||||
else
|
||||
if (progress)
|
||||
fputs("........",stdout);
|
||||
I_Printf(VB_INFO, "........");
|
||||
|
||||
if (cachefp) // killough 11/98: fix filehandle leak
|
||||
fclose(cachefp);
|
||||
@ -1013,7 +1014,7 @@ int R_FlatNumForName(const char *name) // killough -- const added
|
||||
if (i == -1)
|
||||
{
|
||||
// [FG] render missing flats as SKY
|
||||
fprintf(stderr, "R_FlatNumForName: %.8s not found\n", name);
|
||||
I_Printf(VB_WARNING, "R_FlatNumForName: %.8s not found", name);
|
||||
return skyflatnum;
|
||||
}
|
||||
return i - firstflat;
|
||||
@ -1055,7 +1056,7 @@ int R_TextureNumForName(const char *name) // const added -- killough
|
||||
if (i == -1)
|
||||
{
|
||||
// [FG] treat missing textures as non-fatal
|
||||
fprintf(stderr,"R_TextureNumForName: %.8s not found\n", name);
|
||||
I_Printf(VB_WARNING, "R_TextureNumForName: %.8s not found", name);
|
||||
return 0;
|
||||
}
|
||||
return i;
|
||||
|
@ -19,6 +19,7 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "doomstat.h"
|
||||
#include "i_printf.h"
|
||||
#include "i_video.h"
|
||||
#include "v_video.h"
|
||||
#include "w_wad.h"
|
||||
@ -237,8 +238,8 @@ void R_InitSpriteDefs(char **namelist)
|
||||
case -1:
|
||||
// no rotations were found for that frame at all
|
||||
// [FG] make non-fatal
|
||||
fprintf (stderr, "R_InitSprites: No patches found "
|
||||
"for %.8s frame %c\n", namelist[i], frame+'A');
|
||||
I_Printf (VB_WARNING, "R_InitSprites: No patches found "
|
||||
"for %.8s frame %c", namelist[i], frame+'A');
|
||||
break;
|
||||
|
||||
case 0:
|
||||
|
@ -20,6 +20,7 @@
|
||||
//
|
||||
|
||||
#include "doomtype.h"
|
||||
#include "i_printf.h"
|
||||
#include "g_game.h"
|
||||
#include "u_scanner.h"
|
||||
#include "s_sound.h"
|
||||
@ -82,12 +83,12 @@ void S_ParseMusInfo (const char *mapid)
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "S_ParseMusInfo: Unknown MUS lump %s\n", s->string);
|
||||
I_Printf(VB_WARNING, "S_ParseMusInfo: Unknown MUS lump %s", s->string);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "S_ParseMusInfo: Number not in range 1 to %d\n",
|
||||
I_Printf(VB_WARNING, "S_ParseMusInfo: Number not in range 1 to %d",
|
||||
MAX_MUS_ENTRIES - 1);
|
||||
}
|
||||
}
|
||||
|
@ -23,6 +23,7 @@
|
||||
#include <stdlib.h> // [FG] qsort()
|
||||
|
||||
#include "doomstat.h"
|
||||
#include "i_printf.h"
|
||||
#include "s_sound.h"
|
||||
#include "s_musinfo.h" // [crispy] struct musinfo
|
||||
#include "i_sound.h"
|
||||
@ -515,7 +516,7 @@ void S_ChangeMusic(int musicnum, int looping)
|
||||
I_PlaySong((void *)music->handle, looping);
|
||||
|
||||
// [crispy] log played music
|
||||
fprintf(stderr, "S_ChangeMusic: %.8s (%s)\n",
|
||||
I_Printf(VB_INFO, "S_ChangeMusic: %.8s (%s)",
|
||||
lumpinfo[music->lumpnum].name,
|
||||
W_WadNameForLump(music->lumpnum));
|
||||
|
||||
@ -564,7 +565,7 @@ void S_ChangeMusInfoMusic (int lumpnum, int looping)
|
||||
I_PlaySong((void *)music->handle, looping);
|
||||
|
||||
// [crispy] log played music
|
||||
fprintf(stderr, "S_ChangeMusInfoMusic: %.8s (%s)\n",
|
||||
I_Printf(VB_INFO, "S_ChangeMusInfoMusic: %.8s (%s)",
|
||||
lumpinfo[music->lumpnum].name,
|
||||
W_WadNameForLump(music->lumpnum));
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include <string.h>
|
||||
|
||||
#include "doomdef.h"
|
||||
#include "i_printf.h"
|
||||
#include "d_player.h"
|
||||
#include "m_argv.h"
|
||||
#include "m_io.h"
|
||||
@ -325,7 +326,7 @@ void StatDump(void)
|
||||
|
||||
if (i > 0 && i < myargc-1)
|
||||
{
|
||||
printf("Statistics captured for %i level(s)\n", num_captured_stats);
|
||||
I_Printf(VB_INFO, "Statistics captured for %i level(s)", num_captured_stats);
|
||||
|
||||
// We actually know what the real gamemission is, but this has
|
||||
// to match the output from statdump.exe.
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <fcntl.h>
|
||||
|
||||
#include "doomstat.h"
|
||||
#include "i_printf.h"
|
||||
#include "m_io.h"
|
||||
|
||||
#include "w_wad.h"
|
||||
@ -59,7 +60,7 @@ void ExtractFileBase(const char *path, char *dest)
|
||||
if (++length == 9)
|
||||
{
|
||||
// [FG] remove length check
|
||||
printf ("Filename base of %s >8 chars\n",path);
|
||||
I_Printf (VB_DEBUG, "Filename base of %s >8 chars",path);
|
||||
break;
|
||||
}
|
||||
else
|
||||
@ -115,7 +116,7 @@ static void W_AddFile(const char *name) // killough 1/31/98: static, const
|
||||
I_Error("Error: couldn't open %s\n",name); // killough
|
||||
}
|
||||
|
||||
printf(" adding %s\n",filename); // killough 8/8/98
|
||||
I_Printf(VB_INFO, " adding %s",filename); // killough 8/8/98
|
||||
startlump = numlumps;
|
||||
|
||||
// killough:
|
||||
@ -591,7 +592,7 @@ void W_DemoLumpNameCollision(char **name)
|
||||
|
||||
if (i >= 0)
|
||||
{
|
||||
fprintf(stderr, "Demo lump name collision detected with lump \'%.8s\' from %s.\n",
|
||||
I_Printf(VB_WARNING, "Demo lump name collision detected with lump \'%.8s\' from %s.",
|
||||
lumpinfo[i].name, W_WadNameForLump(i));
|
||||
|
||||
// [FG] the DEMO1 lump is almost certainly always a demo lump
|
||||
|
@ -19,6 +19,7 @@
|
||||
//-----------------------------------------------------------------------------
|
||||
|
||||
#include "doomstat.h"
|
||||
#include "i_printf.h"
|
||||
#include "m_random.h"
|
||||
#include "w_wad.h"
|
||||
#include "g_game.h"
|
||||
@ -569,7 +570,7 @@ WI_drawOnLnode // draw stuff at a location by episode/map#
|
||||
else
|
||||
{
|
||||
// DEBUG
|
||||
printf("Could not place patch on level %d", n+1);
|
||||
I_Printf(VB_DEBUG, "Could not place patch on level %d", n+1);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user