1 var float(string text, float handleColors, vector fontSize) stringwidth;
8 // check for pending announcement, play it and remove it
11 sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/", announce_snd, ".wav"), VOL_BASEVOICE, ATTN_NONE);
12 strunzone(announce_snd);
17 void restartAnnouncer_Think() {
18 float countdown_rounded, countdown;
19 countdown = getstatf(STAT_GAMESTARTTIME) - time;
20 countdown_rounded = floor(0.5 + countdown);
22 if (!spectatee_status) //do cprint only for players
23 centerprint(_("^1Begin!"));
25 sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/begin.wav"), VOL_BASEVOICE, ATTN_NONE);
26 //reset maptime announcers now as well
27 announcer_5min = announcer_1min = FALSE;
33 if (!spectatee_status) //do cprint only for players
34 centerprint(sprintf(_("^1Game starts in %d seconds"), countdown_rounded));
36 if(countdown_rounded <= 3 && countdown_rounded >= 1) {
37 sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/", ftos(countdown_rounded), ".wav"), VOL_BASEVOICE, ATTN_NONE);
40 self.nextthink = getstatf(STAT_GAMESTARTTIME) - (countdown - 1);
45 * Plays the 1minute or 5 minutes (of maptime) remaining sound, if client wants it
47 void maptimeAnnouncer() {
49 timelimit = getstatf(STAT_TIMELIMIT);
51 timeleft = max(0, timelimit * 60 + getstatf(STAT_GAMESTARTTIME) - time);
56 warmuplimit = autocvar_g_warmup_limit;
58 warmuptimeleft = max(0, warmuplimit + getstatf(STAT_GAMESTARTTIME) - time);
63 if (autocvar_cl_sound_maptime_warning >= 2) {
64 //make sure that after connect (and e.g. 4 minutes left) we will not get a wrong sound
67 if(((!warmup_stage || warmuplimit == 0) && timeleft > 300) || (warmup_stage && warmuplimit > 0 && warmuptimeleft > 300))
68 announcer_5min = FALSE;
70 else if (((!warmup_stage || warmuplimit == 0) && timelimit > 0 && timeleft < 300 && timeleft > 299) || (warmup_stage && warmuplimit > 0 && warmuptimeleft < 300 && warmuptimeleft > 299))
71 //if we're in warmup mode, check whether there's a warmup timelimit
72 if not (warmuplimit == -1 && warmup_stage) {
73 announcer_5min = TRUE;
74 sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/5minutesremain.wav"), VOL_BASEVOICE, ATTN_NONE);
79 if (autocvar_cl_sound_maptime_warning == 1 || autocvar_cl_sound_maptime_warning == 3) {
82 if(((!warmup_stage || warmuplimit == 0) && timeleft > 60) || (warmup_stage && warmuplimit > 0 && warmuptimeleft > 60))
83 announcer_1min = FALSE;
85 else if (((!warmup_stage || warmuplimit == 0) && timelimit > 0 && timeleft < 60) || (warmup_stage && warmuplimit > 0 && warmuptimeleft < 60))
86 //if we're in warmup mode, check whether there's a warmup timelimit
87 if not (warmuplimit == -1 && warmup_stage) {
88 announcer_1min = TRUE;
89 sound(world, CHAN_AUTO, strcat("announcer/", autocvar_cl_announcer, "/1minuteremains.wav"), VOL_BASEVOICE, ATTN_NONE);
95 * Announce carried items (e.g. flags in CTF).
99 void carrierAnnouncer() {
100 float stat_items, redflag, blueflag;
104 if not(autocvar_cl_notify_carried_items)
107 stat_items = getstati(STAT_ITEMS);
109 redflag = (stat_items/IT_RED_FLAG_TAKEN) & 3;
110 blueflag = (stat_items/IT_BLUE_FLAG_TAKEN) & 3;
112 if (redflag == 3 && redflag != redflag_prev) {
113 item = _("^1RED^7 flag");
114 pickup = (redflag_prev == 2);
117 if (blueflag == 3 && blueflag != blueflag_prev) {
118 item = _("^4BLUE^7 flag");
119 pickup = (blueflag_prev == 2);
125 if (autocvar_cl_notify_carried_items & 2)
126 centerprint(sprintf(_("You picked up the %s!"), item));
129 if (autocvar_cl_notify_carried_items & 1)
130 centerprint(sprintf(_("You got the %s!"), item));
134 blueflag_prev = blueflag;
135 redflag_prev = redflag;
139 * Add all future announcer sounds precaches here.
140 * TODO: announcer queues
142 void Announcer_Precache () {
143 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/1minuteremains.wav"));
144 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/5minutesremain.wav"));
146 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/electrobitch.wav"));
147 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/airshot.wav"));
148 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/03kills.wav"));
149 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/05kills.wav"));
150 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/10kills.wav"));
151 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/15kills.wav"));
152 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/20kills.wav"));
153 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/25kills.wav"));
154 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/30kills.wav"));
155 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/botlike.wav"));
156 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/yoda.wav"));
157 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/amazing.wav"));
158 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/awesome.wav"));
159 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/headshot.wav"));
160 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/impressive.wav"));
162 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/prepareforbattle.wav"));
163 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/begin.wav"));
164 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/timeoutcalled.wav"));
165 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/1fragleft.wav"));
166 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/2fragsleft.wav"));
167 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/3fragsleft.wav"));
168 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/terminated.wav"));
170 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/1.wav"));
171 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/2.wav"));
172 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/3.wav"));
173 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/4.wav"));
174 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/5.wav"));
175 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/6.wav"));
176 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/7.wav"));
177 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/8.wav"));
178 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/9.wav"));
179 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/10.wav"));
181 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/lastsecond.wav"));
182 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/narrowly.wav"));
184 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/voteaccept.wav"));
185 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/votecall.wav"));
186 precache_sound (strcat("announcer/", autocvar_cl_announcer, "/votefail.wav"));
195 for(e = prev.sort_next; e; prev = e, e = e.sort_next)
197 if(prev != e.sort_prev)
198 error(strcat("sort list chain error\nplease submit the output of 'prvm_edicts client' to the developers"));
202 for(e = prev.sort_next; e; prev = e, e = e.sort_next)
204 if(prev != e.sort_prev)
205 error(strcat("sort list chain error\nplease submit the output of 'prvm_edicts client' to the developers"));
210 float RegisterPlayer(entity player)
214 for(pl = players.sort_next; pl; pl = pl.sort_next)
216 error("Player already registered!");
217 player.sort_next = players.sort_next;
218 player.sort_prev = players;
219 if(players.sort_next)
220 players.sort_next.sort_prev = player;
221 players.sort_next = player;
226 void RemovePlayer(entity player)
231 for(pl = players.sort_next; pl && pl != player; pl = pl.sort_next)
236 error("Trying to remove a player which is not in the playerlist!");
239 parent.sort_next = player.sort_next;
241 player.sort_next.sort_prev = parent;
245 void MoveToLast(entity e)
257 float RegisterTeam(entity Team)
261 for(tm = teams.sort_next; tm; tm = tm.sort_next)
263 error("Team already registered!");
264 Team.sort_next = teams.sort_next;
265 Team.sort_prev = teams;
267 teams.sort_next.sort_prev = Team;
268 teams.sort_next = Team;
273 void RemoveTeam(entity Team)
278 for(tm = teams.sort_next; tm && tm != Team; tm = tm.sort_next)
283 print(_("Trying to remove a team which is not in the teamlist!"));
286 parent.sort_next = Team.sort_next;
288 Team.sort_next.sort_prev = parent;
292 entity GetTeam(float Team, float add)
296 num = (Team == COLOR_SPECTATOR) ? 16 : Team;
298 return teamslots[num];
308 vector HUD_GetFontsize(string cvarname)
311 v = stov(cvar_string(cvarname));
320 float PreviewExists(string name)
325 if(autocvar_cl_readpicture_force)
328 if (fexists(strcat(name, ".tga"))) return true;
329 if (fexists(strcat(name, ".png"))) return true;
330 if (fexists(strcat(name, ".jpg"))) return true;
331 if (fexists(strcat(name, ".pcx"))) return true;
336 vector rotate(vector v, float a)
339 // FTEQCC SUCKS AGAIN
340 w_x = v_x * cos(a) + v_y * sin(a);
341 w_y = -1 * v_x * sin(a) + v_y * cos(a);
345 float ColorTranslateMode;
347 string ColorTranslateRGB(string s)
349 if(ColorTranslateMode & 1)
350 return strdecolorize(s);
355 string Team_ColorCode(float teamid)
357 if (teamid == COLOR_TEAM1)
359 else if (teamid == COLOR_TEAM2)
361 else if (teamid == COLOR_TEAM3)
363 else if (teamid == COLOR_TEAM4)
369 // decolorizes and team colors the player name when needed
370 string playername(string thename, float teamid)
375 t = Team_ColorCode(teamid);
376 return strcat(t, strdecolorize(thename));
379 return strdecolorize(thename);
382 float cvar_or(string cv, float v)
392 vector project_3d_to_2d(vector vec)
394 vec = cs_project(vec);
395 if(cs_project_is_b0rked > 0)
397 vec_x *= vid_conwidth / vid_width;
398 vec_y *= vid_conheight / vid_height;
403 void dummyfunction(float a1, float a2, float a3, float a4, float a5, float a6, float a7, float a8)
407 float expandingbox_sizefactor_from_fadelerp(float fadelerp)
409 return 1.2 / (1.2 - fadelerp);
412 vector expandingbox_resize_centered_box_offset(float sz, vector boxsize, float boxxsizefactor)
414 boxsize_x *= boxxsizefactor; // easier interface for text
415 return boxsize * (0.5 * (1 - sz));
418 void drawborderlines(float thickness, vector pos, vector dim, vector color, float alpha, float drawflag)
422 // left and right lines
424 line_dim_x = thickness;
426 drawfill(pos, line_dim, color, alpha, drawflag);
427 drawfill(pos + (dim_x + thickness) * '1 0 0', line_dim, color, alpha, drawflag);
429 // upper and lower lines
431 line_dim_x = dim_x + thickness * 2; // make upper and lower lines longer
432 line_dim_y = thickness;
433 drawfill(pos, line_dim, color, alpha, drawflag);
434 drawfill(pos + (dim_y + thickness) * '0 1 0', line_dim, color, alpha, drawflag);
437 void drawpic_tiled(vector pos, string pic, vector sz, vector area, vector color, float alpha, float drawflag)
439 vector current_pos, end_pos, new_size, ratio;
440 end_pos = pos + area;
442 current_pos_y = pos_y;
443 while (current_pos_y < end_pos_y)
445 current_pos_x = pos_x;
446 while (current_pos_x < end_pos_x)
448 new_size_x = min(sz_x, end_pos_x - current_pos_x);
449 new_size_y = min(sz_y, end_pos_y - current_pos_y);
450 ratio_x = new_size_x / sz_x;
451 ratio_y = new_size_y / sz_y;
452 drawsubpic(current_pos, new_size, pic, '0 0 0', ratio, color, alpha, drawflag);
453 current_pos_x += sz_x;
455 current_pos_y += sz_y;
459 // drawpic wrapper to draw an image as large as possible with preserved aspect ratio into a box
460 var float _drawpic_imgaspect;
461 var vector _drawpic_imgsize;
462 var vector _drawpic_sz;
463 var float _drawpic_oldsz;
464 var string _drawpic_picpath;
465 #define drawpic_aspect(pos,pic,mySize,color,alpha,drawflag)\
467 _drawpic_imgsize = drawgetimagesize(pic);\
468 _drawpic_imgaspect = _drawpic_imgsize_x/_drawpic_imgsize_y;\
469 _drawpic_sz = mySize;\
470 if(_drawpic_sz_x/_drawpic_sz_y > _drawpic_imgaspect) {\
471 _drawpic_oldsz = _drawpic_sz_x;\
472 _drawpic_sz_x = _drawpic_sz_y * _drawpic_imgaspect;\
473 drawpic(pos + eX * (_drawpic_oldsz - _drawpic_sz_x) * 0.5, pic, _drawpic_sz, color, alpha, drawflag);\
475 _drawpic_oldsz = _drawpic_sz_y;\
476 _drawpic_sz_y = _drawpic_sz_x / _drawpic_imgaspect;\
477 drawpic(pos + eY * (_drawpic_oldsz - _drawpic_sz_y) * 0.5, pic, _drawpic_sz, color, alpha, drawflag);\
481 // draw HUD element with image from gfx/hud/hud_skin/foo.tga if it exists, otherwise gfx/hud/default/foo.tga
482 #define drawpic_aspect_skin(pos,pic,sz,color,alpha,drawflag)\
484 _drawpic_picpath = strcat(hud_skin_path, "/", pic);\
485 if(precache_pic(_drawpic_picpath) == "") {\
486 _drawpic_picpath = strcat("gfx/hud/default/", pic);\
488 drawpic_aspect(pos, _drawpic_picpath, sz, color, alpha, drawflag);\
489 _drawpic_picpath = string_null;\
492 // draw HUD element with image from gfx/hud/hud_skin/foo.tga if it exists, otherwise gfx/hud/default/foo.tga
493 #define drawpic_skin(pos,pic,sz,color,alpha,drawflag)\
495 _drawpic_picpath = strcat(hud_skin_path, "/", pic);\
496 if(precache_pic(_drawpic_picpath) == "") {\
497 _drawpic_picpath = strcat("gfx/hud/default/", pic);\
499 drawpic(pos, _drawpic_picpath, sz, color, alpha, drawflag);\
500 _drawpic_picpath = string_null;\
503 void drawpic_aspect_skin_expanding(vector position, string pic, vector scale, vector rgb, float alpha, float flag, float fadelerp)
506 sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
508 drawpic_aspect_skin(position + expandingbox_resize_centered_box_offset(sz, scale, 1), pic, scale * sz, rgb, alpha * (1 - fadelerp), flag);
511 void drawpic_aspect_skin_expanding_two(vector position, string pic, vector scale, vector rgb, float alpha, float flag, float fadelerp)
513 drawpic_aspect_skin_expanding(position, pic, scale, rgb, alpha, flag, fadelerp);
514 drawpic_skin(position, pic, scale, rgb, alpha * fadelerp, flag);
516 #define SET_POS_AND_SZ_Y_ASPECT(allow_colors)\
517 float textaspect, oldsz;\
518 textaspect = stringwidth(text, allow_colors, '1 1 1' * sz_y) / sz_y;\
519 if(sz_x/sz_y > textaspect) {\
521 sz_x = sz_y * textaspect;\
522 pos_x += (oldsz - sz_x) * 0.5;\
525 sz_y = sz_x / textaspect; \
526 pos_y += (oldsz - sz_y) * 0.5;\
529 // drawstring wrapper to draw a string as large as possible with preserved aspect ratio into a box
530 void drawstring_aspect(vector pos, string text, vector sz, vector color, float alpha, float drawflag) {
531 SET_POS_AND_SZ_Y_ASPECT(FALSE)
532 drawstring(pos, text, '1 1 0' * sz_y, color, alpha, drawflag);
535 // drawstring wrapper to draw a colorcodedstring as large as possible with preserved aspect ratio into a box
536 void drawcolorcodedstring_aspect(vector pos, string text, vector sz, float alpha, float drawflag) {
537 SET_POS_AND_SZ_Y_ASPECT(TRUE)
538 drawcolorcodedstring(pos, text, '1 1 0' * sz_y, alpha, drawflag);
541 vector drawfontscale;
542 void drawstring_expanding(vector position, string text, vector scale, vector rgb, float alpha, float flag, float fadelerp)
545 sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
547 drawfontscale = sz * '1 1 0';
548 dummyfunction(0, 0, 0, 0, 0, 0, 0, 0);
549 drawstring(position + expandingbox_resize_centered_box_offset(sz, scale, stringwidth(text, FALSE, scale * (sz / drawfontscale_x)) / (scale_x * sz)), text, scale * (sz / drawfontscale_x), rgb, alpha * (1 - fadelerp), flag);
551 // (scale_x * sz / drawfontscale_x) * drawfontscale_x * SIZE1 / (scale_x * sz)
553 drawfontscale = '1 1 0';
556 // drawstring wrapper to draw a string as large as possible with preserved aspect ratio into a box
557 void drawstring_aspect_expanding(vector pos, string text, vector sz, vector color, float alpha, float drawflag, float fadelerp) {
558 SET_POS_AND_SZ_Y_ASPECT(FALSE)
559 drawstring_expanding(pos, text, '1 1 0' * sz_y, color, alpha, drawflag, fadelerp);
562 void drawcolorcodedstring_expanding(vector position, string text, vector scale, float alpha, float flag, float fadelerp)
565 sz = expandingbox_sizefactor_from_fadelerp(fadelerp);
567 drawfontscale = sz * '1 1 0';
568 dummyfunction(0, 0, 0, 0, 0, 0, 0, 0);
569 drawcolorcodedstring(position + expandingbox_resize_centered_box_offset(sz, scale, stringwidth(text, TRUE, scale * (sz / drawfontscale_x)) / (scale_x * sz)), text, scale * (sz / drawfontscale_x), alpha * (1 - fadelerp), flag);
570 drawfontscale = '1 1 0';
573 void drawcolorcodedstring_aspect_expanding(vector pos, string text, vector sz, float alpha, float drawflag, float fadelerp) {
574 SET_POS_AND_SZ_Y_ASPECT(TRUE)
575 drawcolorcodedstring_expanding(pos, text, '1 1 0' * sz_y, alpha, drawflag, fadelerp);
578 // this draws the triangles of a model DIRECTLY. Don't expect high performance, really...
579 float PolyDrawModelSurface(entity e, float i_s)
585 tex = getsurfacetexture(e, i_s);
587 return 0; // this is beyond the last one
588 n_t = getsurfacenumtriangles(e, i_s);
589 for(i_t = 0; i_t < n_t; ++i_t)
591 tri = getsurfacetriangle(e, i_s, i_t);
592 R_BeginPolygon(tex, 0);
593 R_PolygonVertex(getsurfacepoint(e, i_s, tri_x), getsurfacepointattribute(e, i_s, tri_x, SPA_TEXCOORDS0), '1 1 1', 1);
594 R_PolygonVertex(getsurfacepoint(e, i_s, tri_y), getsurfacepointattribute(e, i_s, tri_y, SPA_TEXCOORDS0), '1 1 1', 1);
595 R_PolygonVertex(getsurfacepoint(e, i_s, tri_z), getsurfacepointattribute(e, i_s, tri_z, SPA_TEXCOORDS0), '1 1 1', 1);
600 void PolyDrawModel(entity e)
603 for(i_s = 0; ; ++i_s)
604 if(!PolyDrawModelSurface(e, i_s))
608 void DrawCircleClippedPic(vector centre, float radius, string pic, float f, vector rgb, float a, float drawflag)
611 vector ringsize, v, t;
612 ringsize = radius * '1 1 0';
614 x = cos(f * 2 * M_PI);
615 y = sin(f * 2 * M_PI);
616 q = fabs(x) + fabs(y);
622 // draw full rectangle
623 R_BeginPolygon(pic, drawflag);
624 v = centre; t = '0.5 0.5 0';
625 v_x += 0.5 * ringsize_x; t += '0.5 0.5 0';
626 R_PolygonVertex(v, t, rgb, a);
628 v = centre; t = '0.5 0.5 0';
629 v_y += 0.5 * ringsize_y; t += '0.5 -0.5 0';
630 R_PolygonVertex(v, t, rgb, a);
632 v = centre; t = '0.5 0.5 0';
633 v_x -= 0.5 * ringsize_x; t -= '0.5 0.5 0';
634 R_PolygonVertex(v, t, rgb, a);
636 v = centre; t = '0.5 0.5 0';
637 v_y -= 0.5 * ringsize_y; t -= '0.5 -0.5 0';
638 R_PolygonVertex(v, t, rgb, a);
644 R_BeginPolygon(pic, drawflag);
645 v = centre; t = '0.5 0.5 0';
646 R_PolygonVertex(v, t, rgb, a);
648 v = centre; t = '0.5 0.5 0';
649 v_x += 0.5 * ringsize_x; t += '0.5 0.5 0';
650 R_PolygonVertex(v, t, rgb, a);
655 // draw upper and first triangle
656 R_BeginPolygon(pic, drawflag);
657 v = centre; t = '0.5 0.5 0';
658 v_x += 0.5 * ringsize_x; t += '0.5 0.5 0';
659 R_PolygonVertex(v, t, rgb, a);
661 v = centre; t = '0.5 0.5 0';
662 v_y += 0.5 * ringsize_y; t += '0.5 -0.5 0';
663 R_PolygonVertex(v, t, rgb, a);
665 v = centre; t = '0.5 0.5 0';
666 v_x -= 0.5 * ringsize_x; t -= '0.5 0.5 0';
667 R_PolygonVertex(v, t, rgb, a);
669 R_BeginPolygon(pic, drawflag);
670 v = centre; t = '0.5 0.5 0';
671 R_PolygonVertex(v, t, rgb, a);
673 v = centre; t = '0.5 0.5 0';
674 v_x -= 0.5 * ringsize_x; t -= '0.5 0.5 0';
675 R_PolygonVertex(v, t, rgb, a);
677 v = centre; t = '0.5 0.5 0';
678 v_y -= 0.5 * ringsize_y; t -= '0.5 -0.5 0';
679 R_PolygonVertex(v, t, rgb, a);
687 // draw upper triangle
688 R_BeginPolygon(pic, drawflag);
689 v = centre; t = '0.5 0.5 0';
690 v_x += 0.5 * ringsize_x; t += '0.5 0.5 0';
691 R_PolygonVertex(v, t, rgb, a);
693 v = centre; t = '0.5 0.5 0';
694 v_y += 0.5 * ringsize_y; t += '0.5 -0.5 0';
695 R_PolygonVertex(v, t, rgb, a);
697 v = centre; t = '0.5 0.5 0';
698 v_x -= 0.5 * ringsize_x; t -= '0.5 0.5 0';
699 R_PolygonVertex(v, t, rgb, a);
705 R_BeginPolygon(pic, drawflag);
706 v = centre; t = '0.5 0.5 0';
707 R_PolygonVertex(v, t, rgb, a);
709 v = centre; t = '0.5 0.5 0';
710 v_x -= 0.5 * ringsize_x; t -= '0.5 0.5 0';
711 R_PolygonVertex(v, t, rgb, a);
716 // draw first triangle
717 R_BeginPolygon(pic, drawflag);
718 v = centre; t = '0.5 0.5 0';
719 R_PolygonVertex(v, t, rgb, a);
721 v = centre; t = '0.5 0.5 0';
722 v_x += 0.5 * ringsize_x; t += '0.5 0.5 0';
723 R_PolygonVertex(v, t, rgb, a);
725 v = centre; t = '0.5 0.5 0';
726 v_y += 0.5 * ringsize_y; t += '0.5 -0.5 0';
727 R_PolygonVertex(v, t, rgb, a);
738 R_BeginPolygon(pic, drawflag);
739 v = centre; t = '0.5 0.5 0';
740 R_PolygonVertex(v, t, rgb, a);
742 v = centre; t = '0.5 0.5 0';
743 v_x += 0.5 * ringsize_x; t += '0.5 0.5 0';
744 R_PolygonVertex(v, t, rgb, a);
750 v = centre; t = '0.5 0.5 0';
751 v_x += x * 0.5 * ringsize_x; t += x * '0.5 0.5 0';
752 v_y += y * 0.5 * ringsize_y; t += y * '0.5 -0.5 0';
753 R_PolygonVertex(v, t, rgb, a);
758 const vector GETPLAYERORIGIN_ERROR = '1123581321 2357111317 3141592653'; // way out of bounds for anything on the map
759 vector getplayerorigin(float pl)
764 s = getplayerkey(pl, "TEMPHACK_origin");
768 e = entcs_receiver[pl];
772 return GETPLAYERORIGIN_ERROR;