1 var float(string text, float handleColors) stringwidth;
12 for(e = prev.sort_next; e; prev = e, e = e.sort_next)
14 if(prev != e.sort_prev)
15 error(strcat("sort list chain error\nplease submit the output of 'prvm_edicts client' to the developers"));
19 for(e = prev.sort_next; e; prev = e, e = e.sort_next)
21 if(prev != e.sort_prev)
22 error(strcat("sort list chain error\nplease submit the output of 'prvm_edicts client' to the developers"));
27 float RegisterPlayer(entity player)
31 for(pl = players.sort_next; pl; pl = pl.sort_next)
33 error("Player already registered!");
34 player.sort_next = players.sort_next;
35 player.sort_prev = players;
37 players.sort_next.sort_prev = player;
38 players.sort_next = player;
43 void RemovePlayer(entity player)
48 for(pl = players.sort_next; pl && pl != player; pl = pl.sort_next)
53 error("Trying to remove a player which is not in the playerlist!");
56 parent.sort_next = player.sort_next;
58 player.sort_next.sort_prev = parent;
62 void MoveToLast(entity e)
74 // warning: Local "team" defined with name of a global
75 // FU FTEQCC, .float team is a ENTVAR shitty piece of crap!!!
76 float RegisterTeam(entity Team)
80 for(tm = teams.sort_next; tm; tm = tm.sort_next)
82 error("Team already registered!");
83 Team.sort_next = teams.sort_next;
84 Team.sort_prev = teams;
86 teams.sort_next.sort_prev = Team;
87 teams.sort_next = Team;
92 void RemoveTeam(entity Team)
97 for(tm = teams.sort_next; tm && tm != Team; tm = tm.sort_next)
102 print("Trying to remove a team which is not in the teamlist!");
105 parent.sort_next = Team.sort_next;
107 Team.sort_next.sort_prev = parent;
111 entity GetTeam(float Team, float add)
115 num = (Team == COLOR_SPECTATOR) ? 16 : Team;
117 return teamslots[num];
127 float stringwidth_oldfont(string text, float handleColors)
129 float i, len, ch, width;
134 for(i = 0; i < len; ++i)
136 if(substring(text, i, 1) == "^")
138 ch = str2chr(text, i+1);
139 if(ch >= '0' && ch <= '9')
150 void CSQC_CheckEngine()
153 registercvar("csqc_flags", "0");
154 csqc_flags = cvar("csqc_flags");
159 if(checkextension("DP_SV_WRITEPICTURE"))
161 stringwidth = stringwidth_engine;
162 sbar_font = FONT_USER+1;
163 sbar_bigfont = FONT_USER+2;
164 csqc_flags |= CSQC_FLAG_READPICTURE;
166 stringwidth = stringwidth_oldfont;
167 sbar_font = FONT_DEFAULT;
168 sbar_bigfont = FONT_DEFAULT;
172 vector Sbar_GetFontsize()
174 if(csqc_flags & CSQC_FLAG_READPICTURE)
177 v = stov(cvar_string("sbar_fontsize"));
188 float Sbar_GetWidth(float teamcolumnwidth)
190 if(csqc_flags & CSQC_FLAG_READPICTURE)
193 f = stof(cvar_string("sbar_width"));
198 if(f > vid_conwidth - 2 * teamcolumnwidth)
199 f = vid_conwidth - 2 * teamcolumnwidth;
205 float PreviewExists(string name)
210 if(cvar("cl_readpicture_force"))
213 file = strcat(name, ".tga");
214 f = fopen(file, FILE_READ);
220 file = strcat(name, ".png");
221 f = fopen(file, FILE_READ);
227 file = strcat(name, ".jpg");
228 f = fopen(file, FILE_READ);
234 file = strcat(name, ".pcx");
235 f = fopen(file, FILE_READ);
244 float PI = 3.14159265359;
245 float DEG2RAD = 0.01745329252;
246 vector rotate(vector v, float a)
249 // FTEQCC SUCKS AGAIN
250 w_x = v_x * cos(a) + v_y * sin(a);
251 w_y = -1 * v_x * sin(a) + v_y * cos(a);