Skip to content

Commit

Permalink
Don't print double brackets on Linux (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
JNechaevsky authored Apr 15, 2023
1 parent 459c076 commit 8142764
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 43 deletions.
24 changes: 0 additions & 24 deletions src/doom/r_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -478,11 +478,6 @@ void R_InitTextures (void)

int* directory;

int temp1;
int temp2;
int temp3;


// Load the patch names from pnames.lmp.
name[8] = 0;
names = W_CacheLumpName (DEH_String("PNAMES"), PU_STATIC);
Expand Down Expand Up @@ -527,25 +522,6 @@ void R_InitTextures (void)
texturewidthmask = Z_Malloc (numtextures * sizeof(*texturewidthmask), PU_STATIC, 0);
textureheight = Z_Malloc (numtextures * sizeof(*textureheight), PU_STATIC, 0);

// Really complex printing shit...
temp1 = W_GetNumForName (DEH_String("S_START")); // P_???????
temp2 = W_GetNumForName (DEH_String("S_END")) - 1;
temp3 = ((temp2-temp1+63)/64) + ((numtextures+63)/64);

// If stdout is a real console, use the classic vanilla "filling
// up the box" effect, which uses backspace to "step back" inside
// the box. If stdout is a file, don't draw the box.

if (I_ConsoleStdout())
{
printf("[");
for (i = 0; i < temp3 + 9; i++)
printf(" ");
printf("]");
for (i = 0; i < temp3 + 10; i++)
printf("\b");
}

for (i=0 ; i<numtextures ; i++, directory++)
{
if (!(i&63))
Expand Down
18 changes: 1 addition & 17 deletions src/i_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -191,22 +191,6 @@ void I_PrintStartupBanner(char *gamedescription)
I_PrintDivider();
}

//
// I_ConsoleStdout
//
// Returns true if stdout is a real console, false if it is a file
//

boolean I_ConsoleStdout(void)
{
#ifdef _WIN32
// SDL "helpfully" always redirects stdout to a file.
return false;
#else
return isatty(fileno(stdout));
#endif
}

//
// I_Init
//
Expand Down Expand Up @@ -306,7 +290,7 @@ void I_Error (char *error, ...)
// Pop up a GUI dialog box to show the error message, if the
// game was not run from the console (and the user will
// therefore be unable to otherwise see the message).
if (exit_gui_popup && !I_ConsoleStdout())
if (exit_gui_popup)
{
#ifdef _WIN32
// [JN] UTF-8 retranslations of error message and window title.
Expand Down
2 changes: 0 additions & 2 deletions src/i_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ void I_Init (void);
// for the zone management.
byte* I_ZoneBase (int *size);

boolean I_ConsoleStdout(void);


// Asynchronous interrupt functions should maintain private queues
// that are read by the synchronous functions
Expand Down

0 comments on commit 8142764

Please sign in to comment.