Appends a given string as a new line to the console.
================
*/
-void ConBuffer_AddLine(conbuffer_t *buf, const char *line, int len, int mask)
+void ConBuffer_AddLine(conbuffer_t *buf, const char *line, int len, unsigned mask)
{
char *putpos;
con_lineinfo_t *p;
p->height = -1; // calculate when needed
}
-int ConBuffer_FindPrevLine(conbuffer_t *buf, int mask_must, int mask_mustnot, int start)
+int ConBuffer_FindPrevLine(conbuffer_t *buf, unsigned mask_must, unsigned mask_mustnot, int start)
{
int i;
if(start == -1)
{
static char copybuf[MAX_INPUTLINE]; // client only
con_lineinfo_t *l = &CONBUFFER_LINES(buf, i);
- size_t sz = l->len+1 > sizeof(copybuf) ? sizeof(copybuf) : l->len+1;
- dp_strlcpy(copybuf, l->start, sz);
+
+ dp_ustr2stp(copybuf, sizeof(copybuf), l->start, l->len);
return copybuf;
}
chat_mode = mode;
if(Cmd_Argc(cmd) > 1)
{
- dpsnprintf(chat_buffer, sizeof(chat_buffer), "%s ", Cmd_Args(cmd));
- chat_bufferpos = (unsigned int)strlen(chat_buffer);
+ chat_bufferpos = dpsnprintf(chat_buffer, sizeof(chat_buffer), "%s ", Cmd_Args(cmd));
+ if (chat_bufferpos < 0)
+ chat_bufferpos = 0;
}
}
*/
extern cvar_t timestamps;
extern cvar_t timeformat;
-void Con_MaskPrint(int additionalmask, const char *msg)
+void Con_MaskPrint(unsigned additionalmask, const char *msg)
{
- static int mask = 0;
- static int index = 0;
+ static unsigned mask = 0;
+ static unsigned index = 0;
static char line[MAX_INPUTLINE];
if (con_mutex)
*out++ = '[';
*out++ = 'm';
}
- *out++ = 0;
- Sys_Print(printline);
+ *out = '\0';
+ Sys_Print(printline, out - printline);
}
else if(sys_colortranslation.integer == 2) // Quake
{
- Sys_Print(line);
+ Sys_Print(line, index);
}
else // strip
{
break;
}
}
- *out++ = 0;
- Sys_Print(printline);
+ *out = '\0';
+ Sys_Print(printline, out - printline);
}
}
// empty the line buffer
Con_MaskPrintf
================
*/
-void Con_MaskPrintf(int mask, const char *fmt, ...)
+void Con_MaskPrintf(unsigned mask, const char *fmt, ...)
{
va_list argptr;
char msg[MAX_INPUTLINE];
return 1;
}
-static int Con_DrawNotifyRect(int mask_must, int mask_mustnot, float maxage, float x, float y, float width, float height, float fontsize, float alignment_x, float alignment_y, const char *continuationString)
+static int Con_DrawNotifyRect(unsigned mask_must, unsigned mask_mustnot, float maxage, float x, float y, float width, float height, float fontsize, float alignment_x, float alignment_y, const char *continuationString)
{
int i;
int lines = 0;
returned.
================
*/
-static int Con_DrawConsoleLine(int mask_must, int mask_mustnot, float y, int lineno, float ymin, float ymax)
+static int Con_DrawConsoleLine(unsigned mask_must, unsigned mask_mustnot, float y, int lineno, float ymin, float ymax)
{
float width = vid_conwidth.value;
con_text_info_t ti;
con_backscroll.
================
*/
-static void Con_LastVisibleLine(int mask_must, int mask_mustnot, int *last, int *limitlast)
+static void Con_LastVisibleLine(unsigned mask_must, unsigned mask_mustnot, int *last, int *limitlast)
{
int lines_seen = 0;
int i;
if (!memcmp(buf, "IBSP", 4))
{
p = LittleLong(((int *)buf)[1]);
- if (p == Q3BSPVERSION)
+ if (p == Q3BSPVERSION || p == Q3BSPVERSION_LIVE || p == Q3BSPVERSION_IG)
{
q3dheader_t *header = (q3dheader_t *)buf;
lumpofs = LittleLong(header->lumps[Q3LUMP_ENTITIES].fileofs);
space = strchr(line + 1, ' ');
if(space && pos == (space - line) + 1)
{
- dp_strlcpy(command, line + 1, min(sizeof(command), (unsigned int)(space - line)));
+ // adding 1 to line drops the leading ]
+ dp_ustr2stp(command, sizeof(command), line + 1, space - (line + 1));
patterns = Cvar_VariableString(cmd->cvars, va(vabuf, sizeof(vabuf), "con_completion_%s", command), CF_CLIENT | CF_SERVER); // TODO maybe use a better place for this?
if(patterns && !*patterns)