mirror of
https://github.com/nzp-team/glquake.git
synced 2025-02-15 16:40:49 +00:00
Merge branch 'main' of https://github.com/nzp-team/glquake into main
This commit is contained in:
commit
f2aaf8d712
2 changed files with 90 additions and 25 deletions
|
@ -574,6 +574,7 @@ float color_shift_end[3];
|
|||
float color_shift_steps[3];
|
||||
int color_shift_init;
|
||||
int blinking;
|
||||
float endroundchange;
|
||||
int textstate;
|
||||
int value, value2;
|
||||
|
||||
|
@ -754,8 +755,16 @@ void HUD_Rounds (void)
|
|||
}
|
||||
else if (cl.stats[STAT_ROUNDCHANGE] == 4)//blink white
|
||||
{
|
||||
blinking = ((int)(realtime*1000)&510) - 255;
|
||||
if (endroundchange > cl.time) {
|
||||
blinking = (((int)(realtime*475)&510) - 255);
|
||||
blinking = abs(blinking);
|
||||
} else {
|
||||
if (blinking)
|
||||
blinking = blinking - 1;
|
||||
else
|
||||
blinking = 0;
|
||||
}
|
||||
|
||||
if (cl.stats[STAT_ROUNDS] > 0 && cl.stats[STAT_ROUNDS] < 11)
|
||||
{
|
||||
for (i = 0; i < cl.stats[STAT_ROUNDS]; i++)
|
||||
|
@ -805,6 +814,11 @@ void HUD_Rounds (void)
|
|||
Draw_ColorPic (2 + x_offset, vid.height - sb_round_num[num[0]]->height - 4, sb_round_num[num[0]], 255, 255, 255, blinking);
|
||||
x_offset = x_offset + sb_round_num[num[0]]->width - 8;
|
||||
}
|
||||
|
||||
if (endroundchange == 0) {
|
||||
endroundchange = cl.time + 7.5;
|
||||
blinking = 0;
|
||||
}
|
||||
}
|
||||
else if (cl.stats[STAT_ROUNDCHANGE] == 5)//blink white
|
||||
{
|
||||
|
@ -864,9 +878,16 @@ void HUD_Rounds (void)
|
|||
}
|
||||
else if (cl.stats[STAT_ROUNDCHANGE] == 6)//blink white while fading back
|
||||
{
|
||||
if (endroundchange) {
|
||||
endroundchange = 0;
|
||||
blinking = 0;
|
||||
}
|
||||
|
||||
color_shift_init = 0;
|
||||
blinking = ((int)(realtime*1000)&510) - 255;
|
||||
blinking = abs(blinking);
|
||||
|
||||
blinking += (int)(host_frametime*475);
|
||||
if (blinking > 255) blinking = 255;
|
||||
|
||||
if (cl.stats[STAT_ROUNDS] > 0 && cl.stats[STAT_ROUNDS] < 11)
|
||||
{
|
||||
for (i = 0; i < cl.stats[STAT_ROUNDS]; i++)
|
||||
|
|
|
@ -1231,26 +1231,40 @@ string strtrim (string)
|
|||
*/
|
||||
void PF_strtrim (void)
|
||||
{
|
||||
char *m;
|
||||
m = G_STRING(OFS_PARM0);
|
||||
int offset, length;
|
||||
int maxoffset; // 2001-10-25 Enhanced temp string handling by Maddes
|
||||
char *str;
|
||||
char *end;
|
||||
|
||||
char *c;
|
||||
c = m;
|
||||
str = G_STRING(OFS_PARM0);
|
||||
|
||||
while (c != '\0' && *c == ' ')
|
||||
c++;
|
||||
m = c;
|
||||
|
||||
c = m + strlen (m) - 1;
|
||||
while (c >= m)
|
||||
{
|
||||
if (*c == ' ')
|
||||
*c = '\0';
|
||||
else
|
||||
break;
|
||||
c--;
|
||||
// figure out the new start
|
||||
while (*str == ' ' || *str == '\t' || *str == '\n' || *str == '\r') {
|
||||
offset++;
|
||||
str++;
|
||||
}
|
||||
G_INT(OFS_RETURN) = m - pr_strings;
|
||||
|
||||
// figure out the new end.
|
||||
end = str + strlen (str);
|
||||
while (end > str && (end[-1] == ' ' || end[-1] == '\t' || end[-1] == '\n' || end[-1] == '\r'))
|
||||
end--;
|
||||
|
||||
length = end - str;
|
||||
|
||||
if (offset < 0)
|
||||
offset = 0;
|
||||
// 2001-10-25 Enhanced temp string handling by Maddes start
|
||||
if (length >= PR_MAX_TEMPSTRING)
|
||||
length = PR_MAX_TEMPSTRING-1;
|
||||
// 2001-10-25 Enhanced temp string handling by Maddes end
|
||||
if (length < 0)
|
||||
length = 0;
|
||||
|
||||
//str += offset;
|
||||
strncpy(pr_string_temp, str, length);
|
||||
pr_string_temp[length] = 0;
|
||||
|
||||
G_INT(OFS_RETURN) = pr_string_temp - pr_strings;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -1312,6 +1326,36 @@ void PF_strcat (void)
|
|||
G_INT(OFS_RETURN) = pr_string_temp - pr_strings;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
PF_strtolower
|
||||
|
||||
string strtolower (string)
|
||||
=================
|
||||
*/
|
||||
void PF_strtolower(void)
|
||||
{
|
||||
char *s;
|
||||
|
||||
s = G_STRING(OFS_PARM0);
|
||||
|
||||
pr_string_temp[0] = 0;
|
||||
if (strlen(s) < PR_MAX_TEMPSTRING)
|
||||
{
|
||||
strcpy(pr_string_temp, s);
|
||||
}
|
||||
else
|
||||
{
|
||||
strncpy(pr_string_temp, s, PR_MAX_TEMPSTRING);
|
||||
pr_string_temp[PR_MAX_TEMPSTRING-1] = 0;
|
||||
}
|
||||
|
||||
for(int i = 0; i < strlen(s); i++)
|
||||
pr_string_temp[i] = tolower(pr_string_temp[i]);
|
||||
|
||||
G_INT(OFS_RETURN) = pr_string_temp - pr_strings;
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
PF_substring
|
||||
|
@ -3849,7 +3893,7 @@ PF_Fixme,
|
|||
PF_Fixme,
|
||||
PF_Fixme,
|
||||
PF_Fixme,
|
||||
PF_Fixme,
|
||||
PF_strtolower, // #480
|
||||
PF_Fixme,
|
||||
PF_Fixme,
|
||||
PF_Fixme,
|
||||
|
|
Loading…
Reference in a new issue