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 float RegisterTeam(entity Team)
78 for(tm = teams.sort_next; tm; tm = tm.sort_next)
80 error("Team already registered!");
81 Team.sort_next = teams.sort_next;
82 Team.sort_prev = teams;
84 teams.sort_next.sort_prev = Team;
85 teams.sort_next = Team;
90 void RemoveTeam(entity Team)
95 for(tm = teams.sort_next; tm && tm != Team; tm = tm.sort_next)
100 print("Trying to remove a team which is not in the teamlist!");
103 parent.sort_next = Team.sort_next;
105 Team.sort_next.sort_prev = parent;
109 entity GetTeam(float Team, float add)
113 num = (Team == COLOR_SPECTATOR) ? 16 : Team;
115 return teamslots[num];
125 float stringwidth_oldfont(string text, float handleColors)
127 float i, len, ch, width;
132 for(i = 0; i < len; ++i)
134 if(substring(text, i, 1) == "^")
136 ch = str2chr(text, i+1);
137 if(ch >= '0' && ch <= '9')
148 void CSQC_CheckEngine()
151 registercvar("csqc_flags", "0");
152 csqc_flags = cvar("csqc_flags");
157 if(checkextension("DP_SV_WRITEPICTURE"))
159 stringwidth = stringwidth_engine;
160 sbar_font = FONT_USER+1;
161 sbar_bigfont = FONT_USER+2;
162 csqc_flags |= CSQC_FLAG_READPICTURE;
164 stringwidth = stringwidth_oldfont;
165 sbar_font = FONT_DEFAULT;
166 sbar_bigfont = FONT_DEFAULT;
170 vector Sbar_GetFontsize()
172 if(csqc_flags & CSQC_FLAG_READPICTURE)
175 v = stov(cvar_string("sbar_fontsize"));
186 float Sbar_GetWidth(float teamcolumnwidth)
188 if(csqc_flags & CSQC_FLAG_READPICTURE)
191 f = stof(cvar_string("sbar_width"));
196 if(f > vid_conwidth - 2 * teamcolumnwidth)
197 f = vid_conwidth - 2 * teamcolumnwidth;
203 float PreviewExists(string name)
208 if(cvar("cl_readpicture_force"))
211 file = strcat(name, ".tga");
212 f = fopen(file, FILE_READ);
218 file = strcat(name, ".png");
219 f = fopen(file, FILE_READ);
225 file = strcat(name, ".jpg");
226 f = fopen(file, FILE_READ);
232 file = strcat(name, ".pcx");
233 f = fopen(file, FILE_READ);
242 float PI = 3.14159265359;
243 float DEG2RAD = 0.01745329252;
244 vector rotate(vector v, float a)
247 // FTEQCC SUCKS AGAIN
248 w_x = v_x * cos(a) + v_y * sin(a);
249 w_y = -1 * v_x * sin(a) + v_y * cos(a);