return stringwidth(s, FALSE, theSize);
}
-#define CENTERPRINT_MAX_LINES 10
+#define CENTERPRINT_MAX_MSGS 10
float cpm_index;
-string centerprint_messages[CENTERPRINT_MAX_LINES];
-float centerprint_msgID[CENTERPRINT_MAX_LINES];
-float centerprint_width[CENTERPRINT_MAX_LINES];
-float centerprint_time[CENTERPRINT_MAX_LINES];
+string centerprint_messages[CENTERPRINT_MAX_MSGS];
+float centerprint_msgID[CENTERPRINT_MAX_MSGS];
+float centerprint_width[CENTERPRINT_MAX_MSGS];
+float centerprint_time[CENTERPRINT_MAX_MSGS];
float centerprint_expire;
float centerprint_num;
vector centerprint_fontsize;
float new_id = get_CPID(strMessage);
- for (i=0, j=cpm_index; i<CENTERPRINT_MAX_LINES; ++i, ++j)
+ for (i=0, j=cpm_index; i<CENTERPRINT_MAX_MSGS; ++i, ++j)
{
- if (j == CENTERPRINT_MAX_LINES)
+ if (j == CENTERPRINT_MAX_MSGS)
j = 0;
if (new_id && new_id == centerprint_msgID[j])
{
--cpm_index;
if (cpm_index == -1)
- cpm_index = CENTERPRINT_MAX_LINES - 1;
+ cpm_index = CENTERPRINT_MAX_MSGS - 1;
if(centerprint_messages[cpm_index])
strunzone(centerprint_messages[cpm_index]);
if (new_id)
else
hcount += 1;
- if(i >= CENTERPRINT_MAX_LINES)
+ if(i >= CENTERPRINT_MAX_MSGS)
break;
}
}
pos = centerprint_start;
fade = min(autocvar_scr_centertime/8, 0.25);
- for (i=0, j=cpm_index; i<CENTERPRINT_MAX_LINES; ++i, ++j)
+ for (i=0, j=cpm_index; i<CENTERPRINT_MAX_MSGS; ++i, ++j)
{
- if (j == CENTERPRINT_MAX_LINES)
+ if (j == CENTERPRINT_MAX_MSGS)
j = 0;
if (centerprint_time[j] + autocvar_scr_centertime < time)
continue;