Remove unused/useless code from console code
parent
439bee7ae3
commit
e779457906
|
@ -119,9 +119,6 @@ static UDWORD consoleVisibleLines;
|
|||
/** Whether new messages are allowed to be added */
|
||||
static int allowNewMessages;
|
||||
|
||||
/** What's the default justification? */
|
||||
static CONSOLE_TEXT_JUSTIFICATION defJustification;
|
||||
|
||||
static UDWORD messageId; // unique ID
|
||||
|
||||
/// Global string for new console messages.
|
||||
|
@ -178,9 +175,6 @@ void initConsoleMessages( void )
|
|||
/* Turn on the console display */
|
||||
enableConsoleDisplay(true);
|
||||
|
||||
/* Set left justification as default */
|
||||
setDefaultConsoleJust(LEFT_JUSTIFY);
|
||||
|
||||
/* Set up the console size and postion
|
||||
x,y,width */
|
||||
setConsoleSizePos(16, 16, pie_GetVideoBufferWidth()-32);
|
||||
|
@ -245,13 +239,6 @@ bool addConsoleMessage(const char *Text, CONSOLE_TEXT_JUSTIFICATION jusType, SDW
|
|||
|
||||
ASSERT( textLength < MAX_CONSOLE_STRING_LENGTH, "Attempt to add a message to the console that exceeds MAX_CONSOLE_STRING_LENGTH" );
|
||||
|
||||
/* Are we using a defualt justification? */
|
||||
if(jusType == DEFAULT_JUSTIFY)
|
||||
{
|
||||
/* Then set it */
|
||||
jusType = defJustification;
|
||||
}
|
||||
|
||||
debug(LOG_CONSOLE, "(to player %d): %s", (int)player, messageText);
|
||||
|
||||
consoleStorage[messageIndex].player = player;
|
||||
|
@ -519,8 +506,7 @@ static int displayOldMessages(void)
|
|||
/* there are messages - just no old ones yet */
|
||||
return(0);
|
||||
}
|
||||
|
||||
if(count)
|
||||
else
|
||||
{
|
||||
/* Get the line pitch */
|
||||
linePitch = iV_GetTextLineSize();
|
||||
|
@ -530,17 +516,6 @@ static int displayOldMessages(void)
|
|||
iV_TransBoxFill(mainConsole.topX - CON_BORDER_WIDTH,mainConsole.topY-mainConsole.textDepth-CON_BORDER_HEIGHT,
|
||||
mainConsole.topX+mainConsole.width ,mainConsole.topY+((count)*linePitch)+CON_BORDER_HEIGHT-linePitch);
|
||||
}
|
||||
/*
|
||||
if(count)
|
||||
{
|
||||
sprintf(buildData,"%s,%s",__TIME__,__DATE__);
|
||||
|
||||
buildWidth = iV_GetTextWidth(buildData);
|
||||
|
||||
iV_DrawText(buildData,((mainConsole.topX+mainConsole.width) - buildWidth - 16),
|
||||
mainConsole.topY);
|
||||
}
|
||||
*/
|
||||
MesY = mainConsole.topY;
|
||||
/* Render what we found */
|
||||
for(i=count-1; i>0; i--)
|
||||
|
@ -567,14 +542,7 @@ static int displayOldMessages(void)
|
|||
consoleStorage[history[0]].JustifyType);
|
||||
|
||||
/* Return how much to drop the existing console by... Fix this for lines>screenWIDTH */
|
||||
if(count)
|
||||
{
|
||||
return((count)*linePitch);
|
||||
}
|
||||
else
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
|
||||
|
@ -687,23 +655,6 @@ void enableConsoleDisplay(bool state)
|
|||
bConsoleDisplayEnabled = state;
|
||||
}
|
||||
|
||||
/** Sets the default justification for text */
|
||||
void setDefaultConsoleJust(CONSOLE_TEXT_JUSTIFICATION defJ)
|
||||
{
|
||||
switch(defJ)
|
||||
{
|
||||
case LEFT_JUSTIFY:
|
||||
case RIGHT_JUSTIFY:
|
||||
case CENTRE_JUSTIFY:
|
||||
defJustification = defJ;
|
||||
break;
|
||||
default:
|
||||
debug( LOG_FATAL, "Weird default text justification for console" );
|
||||
abort();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/** Allows positioning of the console on screen */
|
||||
void setConsoleSizePos(UDWORD x, UDWORD y, UDWORD width)
|
||||
{
|
||||
|
@ -793,4 +744,4 @@ void console(const char *pFormat, ...)
|
|||
|
||||
/* Output it */
|
||||
addConsoleMessage(aBuffer,DEFAULT_JUSTIFY,SYSTEM_MESSAGE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,9 +28,9 @@
|
|||
enum CONSOLE_TEXT_JUSTIFICATION
|
||||
{
|
||||
LEFT_JUSTIFY,
|
||||
DEFAULT_JUSTIFY = LEFT_JUSTIFY,
|
||||
RIGHT_JUSTIFY,
|
||||
CENTRE_JUSTIFY,
|
||||
DEFAULT_JUSTIFY
|
||||
CENTRE_JUSTIFY
|
||||
};
|
||||
|
||||
/* ID to use for addConsoleMessage() in case of a system message */
|
||||
|
@ -48,7 +48,6 @@ void flushConsoleMessages(void);
|
|||
void setConsoleBackdropStatus(bool state);
|
||||
void enableConsoleDisplay(bool state);
|
||||
bool getConsoleDisplayStatus(void);
|
||||
void setDefaultConsoleJust(CONSOLE_TEXT_JUSTIFICATION defJ);
|
||||
void setConsoleSizePos(UDWORD x, UDWORD y, UDWORD width);
|
||||
void setConsolePermanence(bool state, bool bClearOld);
|
||||
bool mouseOverConsoleBox(void);
|
||||
|
|
|
@ -2561,7 +2561,6 @@ static void addChatBox(void)
|
|||
initConsoleMessages();
|
||||
enableConsoleDisplay(true);
|
||||
setConsoleBackdropStatus(false);
|
||||
setDefaultConsoleJust(LEFT_JUSTIFY);
|
||||
setConsoleSizePos(MULTIOP_CHATBOXX+4+D_W, MULTIOP_CHATBOXY+14+D_H, MULTIOP_CHATBOXW-4);
|
||||
setConsolePermanence(true,true);
|
||||
setConsoleLineInfo(5); // use x lines on chat window
|
||||
|
@ -2615,7 +2614,6 @@ static void addConsoleBox(void)
|
|||
initConsoleMessages();
|
||||
enableConsoleDisplay(true);
|
||||
setConsoleBackdropStatus(false);
|
||||
setDefaultConsoleJust(LEFT_JUSTIFY);
|
||||
setConsoleSizePos(MULTIOP_CONSOLEBOXX + 4 + D_W, MULTIOP_CONSOLEBOXY + 14 + D_H, MULTIOP_CONSOLEBOXW - 4);
|
||||
setConsolePermanence(true, true);
|
||||
setConsoleLineInfo(3); // use x lines on chat window
|
||||
|
|
Loading…
Reference in New Issue