void LocalCommand_blurtest(int request)
{
- TC(int, request);
+ TC(int, request);
// Simple command to work with postprocessing temporarily... possibly completely pointless, the glsl shader is used for a real feature now...
// Anyway, to enable it, just compile the client with -DBLURTEST and then you can use the command.
void LocalCommand_boxparticles(int request, int argc)
{
- TC(int, request); TC(int, argc);
+ TC(int, request); TC(int, argc);
switch (request)
{
case CMD_REQUEST_COMMAND:
void LocalCommand_create_scrshot_ent(int request)
{
- TC(int, request);
+ TC(int, request);
switch (request)
{
case CMD_REQUEST_COMMAND:
void LocalCommand_debugmodel(int request, int argc)
{
- TC(int, request); TC(int, argc);
+ TC(int, request); TC(int, argc);
switch (request)
{
case CMD_REQUEST_COMMAND:
void LocalCommand_handlevote(int request, int argc)
{
- TC(int, request); TC(int, argc);
+ TC(int, request); TC(int, argc);
switch (request)
{
case CMD_REQUEST_COMMAND:
void LocalCommand_hud(int request, int argc)
{
- TC(int, request); TC(int, argc);
+ TC(int, request); TC(int, argc);
switch (request)
{
case CMD_REQUEST_COMMAND:
void LocalCommand_localprint(int request, int argc)
{
- TC(int, request); TC(int, argc);
+ TC(int, request); TC(int, argc);
switch (request)
{
case CMD_REQUEST_COMMAND:
void LocalCommand_mv_download(int request, int argc)
{
- TC(int, request); TC(int, argc);
+ TC(int, request); TC(int, argc);
switch (request)
{
case CMD_REQUEST_COMMAND:
void LocalCommand_sendcvar(int request, int argc)
{
- TC(int, request); TC(int, argc);
+ TC(int, request); TC(int, argc);
switch (request)
{
case CMD_REQUEST_COMMAND:
}
int CSQCPlayer_FallbackFrame(entity this, int f)
{
- TC(int, f);
+ TC(int, f);
if(frameduration(this.modelindex, f) > 0)
return f; // goooooood
if(frameduration(this.modelindex, 1) <= 0)
float HUD_GetRowCount(int item_count, vector size, float item_aspect)
{
- TC(int, item_count);
+ TC(int, item_count);
float aspect = size_y / size_x;
return bound(1, floor((sqrt(4 * item_aspect * aspect * item_count + aspect * aspect) + aspect + 0.5) / 2), item_count);
}
vector HUD_GetTableSize_BestItemAR(int item_count, vector psize, float item_aspect)
{
- TC(int, item_count);
+ TC(int, item_count);
float columns, rows;
float ratio, best_ratio = 0;
float best_columns = 1, best_rows = 1;
//basically the same code of draw_ButtonPicture and draw_VertButtonPicture for the menu
void HUD_Panel_DrawProgressBar(vector theOrigin, vector theSize, string pic, float length_ratio, bool vertical, float baralign, vector theColor, float theAlpha, int drawflag)
{
- TC(bool, vertical); TC(int, drawflag);
+ TC(bool, vertical); TC(int, drawflag);
if(!length_ratio || !theAlpha)
return;
if(length_ratio > 1)
void HUD_Panel_DrawHighlight(vector pos, vector mySize, vector color, float theAlpha, int drawflag)
{
- TC(int, drawflag);
+ TC(int, drawflag);
if(!theAlpha)
return;
void DrawNumIcon_expanding(vector myPos, vector mySize, float theTime, string icon, bool vertical, int icon_right_align, vector color, float theAlpha, float fadelerp)
{
- TC(bool, vertical); TC(int, icon_right_align);
+ TC(bool, vertical); TC(int, icon_right_align);
vector newPos = '0 0 0', newSize = '0 0 0';
vector picpos, numpos;
void DrawNumIcon(vector myPos, vector mySize, float theTime, string icon, bool vertical, int icon_right_align, vector color, float theAlpha)
{
- TC(bool, vertical); TC(int, icon_right_align);
+ TC(bool, vertical); TC(int, icon_right_align);
DrawNumIcon_expanding(myPos, mySize, theTime, icon, vertical, icon_right_align, color, theAlpha, 0);
}
void DrawAmmoItem(vector myPos, vector mySize, int ammoType, bool isCurrent, bool isInfinite)
{
- TC(bool, isCurrent); TC(bool, isInfinite);
+ TC(bool, isCurrent); TC(bool, isInfinite);
if(ammoType == RESOURCE_NONE)
return;
void centerprint_generic(int new_id, string strMessage, float duration, int countdown_num)
{
- TC(int, new_id); TC(int, countdown_num);
+ TC(int, new_id); TC(int, countdown_num);
//printf("centerprint_generic(%d, '%s^7', %d, %d);\n", new_id, strMessage, duration, countdown_num);
int i, j;
void centerprint_kill(int id)
{
- TC(int, id);
+ TC(int, id);
centerprint_generic(id, "", 0, 0);
}
void DrawCAItem(vector myPos, vector mySize, float aspect_ratio, int layout, int i)
{
- TC(int, layout); TC(int, i);
+ TC(int, layout); TC(int, i);
int stat = -1;
string pic = "";
vector color = '0 0 0';
void DrawDomItem(vector myPos, vector mySize, float aspect_ratio, int layout, int i)
{
- TC(int, layout); TC(int, i);
+ TC(int, layout); TC(int, i);
float stat = -1;
string pic = "";
vector color = '0 0 0';
int getPowerupItemAlign(int align, int column, int row, int columns, int rows, bool isVertical)
{
- TC(int, align); TC(int, column); TC(int, row); TC(int, columns); TC(int, rows); TC(bool, isVertical);
+ TC(int, align); TC(int, column); TC(int, row); TC(int, columns); TC(int, rows); TC(bool, isVertical);
if(align < 2)
return align;
// if s1 is not empty s will be displayed as command otherwise as submenu
void QuickMenu_Page_LoadEntry(int i, string s, string s1)
{
- TC(int, i);
+ TC(int, i);
//LOG_INFOF("^xc80 entry %d: %s, %s\n", i, s, s1);
strcpy(QuickMenu_Page_Description[i], s);
strcpy(QuickMenu_Page_Command[i], s1);
void QuickMenu_Page_ClearEntry(int i)
{
- TC(int, i);
+ TC(int, i);
strfree(QuickMenu_Page_Description[i]);
strfree(QuickMenu_Page_Command[i]);
QuickMenu_Page_Command_Type[i] = 0;
bool HUD_Quickmenu_PlayerListEntries_Create(string cmd, int teamplayers, bool without_me)
{
- TC(int, teamplayers); TC(bool, without_me);
+ TC(int, teamplayers); TC(bool, without_me);
int i;
for(i = 0; i < QUICKMENU_MAXLINES; ++i)
QuickMenu_Page_ClearEntry(i);
int QuickMenu_Buffer_Index_Prev;
bool QuickMenu_Page_Load(string target_submenu, bool new_page)
{
- TC(bool, new_page);
+ TC(bool, new_page);
string s = string_null, cmd = string_null, z_submenu;
if (new_page == 0)
bool QuickMenu_ActionForNumber(int num)
{
- TC(int, num);
+ TC(int, num);
if (!QuickMenu_IsLastPage)
{
if (num < 0 || num >= QUICKMENU_MAXLINES)
void QuickMenu_Page_ActiveEntry(int entry_num)
{
- TC(int, entry_num);
+ TC(int, entry_num);
QuickMenu_Page_ActivatedEntry = entry_num;
QuickMenu_Page_ActivatedEntry_Time = time + 0.1;
if(QuickMenu_Page_Command[QuickMenu_Page_ActivatedEntry])
bool QuickMenu_InputEvent(int bInputType, float nPrimary, float nSecondary)
{
- TC(int, bInputType);
+ TC(int, bInputType);
// we only care for keyboard events
if(bInputType == 2)
return false;
void HUD_Quickmenu_PlayerListEntries(string cmd, int teamplayers, bool without_me)
{
- TC(int, teamplayers); TC(bool, without_me);
+ TC(int, teamplayers); TC(bool, without_me);
entity pl;
if(teamplayers && !team_count)
return;
void HUD_Radar_Show_Maximized(bool doshow, bool clickable)
{
- TC(bool, doshow);
+ TC(bool, doshow);
hud_panel_radar_maximized = doshow;
hud_panel_radar_temp_hidden = 0;
float HUD_Radar_InputEvent(int bInputType, float nPrimary, float nSecondary)
{
- TC(int, bInputType);
+ TC(int, bInputType);
if(!hud_panel_radar_maximized || !hud_panel_radar_mouse ||
autocvar__hud_configure || mv_active)
return false;
int Scoreboard_CompareScore(int vl, int vr, int f)
{
- TC(int, vl); TC(int, vr); TC(int, f);
+ TC(int, vl); TC(int, vr); TC(int, f);
if(f & SFL_ZERO_IS_WORST)
{
if(vl == 0 && vr != 0)
void Cmd_Scoreboard_SetFields(int argc)
{
- TC(int, argc);
+ TC(int, argc);
int i, slash;
string str, pattern;
bool have_name = false, have_primary = false, have_secondary = false, have_separator = false;
string Scoreboard_FixColumnWidth(int i, string str)
{
- TC(int, i);
+ TC(int, i);
float f;
vector sz;
void Scoreboard_DrawItem(vector item_pos, vector rgb, entity pl, bool is_self, int pl_number)
{
- TC(bool, is_self); TC(int, pl_number);
+ TC(bool, is_self); TC(int, pl_number);
string str;
bool is_spec = (entcs_GetTeam(pl.sv_entnum) == NUM_SPECTATOR);
entity weaponorder[Weapons_MAX];
void weaponorder_swap(int i, int j, entity pass)
{
- TC(int, i); TC(int, j);
+ TC(int, i); TC(int, j);
entity h = weaponorder[i];
weaponorder[i] = weaponorder[j];
weaponorder[j] = h;
string weaponorder_cmp_str;
int weaponorder_cmp(int i, int j, entity pass)
{
- TC(int, i); TC(int, j);
+ TC(int, i); TC(int, j);
int ai = strstrofs(weaponorder_cmp_str, sprintf(" %d ", weaponorder[i].m_id), 0);
int aj = strstrofs(weaponorder_cmp_str, sprintf(" %d ", weaponorder[j].m_id), 0);
return aj - ai; // the string is in REVERSE order (higher prio at the right is what we want, but higher prio first is the string)
.float has_team;
float SetTeam(entity o, int Team)
{
- TC(int, Team);
+ TC(int, Team);
devassert_once(Team);
entity tm;
if(teamplay)
string MapVote_FormatMapItem(int id, string map, float _count, float maxwidth, vector fontsize)
{
- TC(int, id);
+ TC(int, id);
string pre, post;
pre = sprintf("%d. ", id+1);
if(mv_detail)
vector MapVote_RGB(int id)
{
- TC(int, id);
+ TC(int, id);
if(!(mv_flags[id] & GTV_AVAILABLE))
return '1 1 1';
if(id == mv_ownvote)
void GameTypeVote_DrawGameTypeItem(vector pos, float maxh, float tsize, string gtype, string pic, float _count, int id)
{
- TC(int, id);
+ TC(int, id);
// Find the correct alpha
float alpha;
if(!(mv_flags_start[id] & GTV_AVAILABLE))
void MapVote_DrawMapItem(vector pos, float isize, float tsize, string map, string pic, float _count, int id)
{
- TC(int, id);
+ TC(int, id);
vector img_size = '0 0 0';
string label;
float text_size;
void MapVote_DrawAbstain(vector pos, float isize, float tsize, float _count, int id)
{
- TC(int, id);
+ TC(int, id);
vector rgb;
float text_size;
string label;
vector MapVote_GridVec(vector gridspec, int i, int m)
{
- TC(int, i); TC(int, m);
+ TC(int, i); TC(int, m);
int r = i % m;
return
'1 0 0' * (gridspec.x * r)
void Cmd_MapVote_MapDownload(int argc)
{
- TC(int, argc);
+ TC(int, argc);
entity pak;
if(argc != 2 || !mv_pk3list)
void MapVote_CheckPK3(string pic, string pk3, int id)
{
- TC(int, id);
+ TC(int, id);
entity pak;
pak = spawn();
pak.netname = pk3;
void MapVote_CheckPic(string pic, string pk3, int id)
{
- TC(int, id);
+ TC(int, id);
// never try to retrieve a pic for the "don't care" 'map'
if(mv_abstain && id == mv_num_maps - 1)
return;
void MapVote_ReadOption(int i)
{
- TC(int, i);
+ TC(int, i);
string map = strzone(ReadString());
string pk3 = strzone(ReadString());
int j = bound(0, ReadByte(), n_ssdirs - 1);
void GameTypeVote_ReadOption(int i)
{
- TC(int, i);
+ TC(int, i);
string gt = strzone(ReadString());
mv_maps[i] = gt;
void MapVote_SendChoice(int index)
{
- TC(int, index);
+ TC(int, index);
localcmd(strcat("\nimpulse ", ftos(index+1), "\n"));
}
int MapVote_MoveLeft(int pos)
{
- TC(int, pos);
+ TC(int, pos);
int imp;
if ( pos < 0 )
imp = mv_num_maps - 1;
}
int MapVote_MoveRight(int pos)
{
- TC(int, pos);
+ TC(int, pos);
int imp;
if ( pos < 0 )
imp = 0;
}
int MapVote_MoveUp(int pos)
{
- TC(int, pos);
+ TC(int, pos);
int imp;
if ( pos < 0 )
imp = mv_num_maps - 1;
}
int MapVote_MoveDown(int pos)
{
- TC(int, pos);
+ TC(int, pos);
int imp;
if ( pos < 0 )
imp = 0;
float MapVote_InputEvent(int bInputType, float nPrimary, float nSecondary)
{
- TC(int, bInputType);
+ TC(int, bInputType);
float imp;
if (!mv_active)
entity GetTeam(int Team, bool add)
{
- TC(int, Team); TC(bool, add);
+ TC(int, Team); TC(bool, add);
int num = (Team == NUM_SPECTATOR) ? 16 : Team;
if(teamslots[num])
return teamslots[num];
/** engine callback */
void URI_Get_Callback(int id, int status, string data)
{
- TC(int, id); TC(int, status);
+ TC(int, id); TC(int, status);
if(url_URI_Get_Callback(id, status, data))
{
// handled
void skel_set_boneabs(float s, int bone, vector absorg)
{
- TC(int, bone);
+ TC(int, bone);
vector absang = fixedvectoangles2(v_forward, v_up);
vector parentorg = skel_get_boneabs(s, skel_get_boneparent(s, bone));
void skeleton_from_frames(entity e, bool is_dead)
{
- TC(bool, is_dead);
+ TC(bool, is_dead);
float m = e.modelindex;
if(!e.skeletonindex)
{
void draw_teamradar_link(vector start, vector end, int colors)
{
- TC(int, colors);
+ TC(int, colors);
vector c0, c1, norm;
start = teamradar_texcoord_to_2dcoord(teamradar_3dcoord_to_texcoord(start));
float vh_notice_time;
void CSQC_UpdateView(entity this, float w, float h)
{
- TC(int, w); TC(int, h);
+ TC(int, w); TC(int, h);
entity e;
float fov;
float f;
void loopsound(entity e, int ch, Sound samp, float vol, float attn)
{
- TC(int, ch);
+ TC(int, ch);
if (e.silent)
return;
ATTRIB(Command, m_description, string);
METHOD(Command, m_invokecmd, void(Command this, int request, entity caller, int arguments, string command))
{
- TC(Command, this);
+ TC(Command, this);
}
ENDCLASS(Command)
}
// code from here on is just to support maps that don't have control point and team entities
-void dom_spawnteam (string teamname, float teamcolor, string pointmodel, float pointskin, Sound capsound, string capnarration, string capmessage)
+void dom_spawnteam(string teamname, float teamcolor, string pointmodel, float pointskin, Sound capsound, string capnarration, string capmessage)
{
- TC(Sound, capsound);
- entity e = new_pure(dom_team);
+ TC(Sound, capsound);
+ entity e = new_pure(dom_team);
e.netname = strzone(teamname);
e.cnt = teamcolor;
e.model = pointmodel;
// spawn some default teams if the map is not set up for domination
void dom_spawnteams(int teams)
{
- TC(int, teams);
+ TC(int, teams);
dom_spawnteam(Team_ColoredFullName(NUM_TEAM_1), NUM_TEAM_1-1, "models/domination/dom_red.md3", 0, SND_DOM_CLAIM, "", "Red team has captured a control point");
dom_spawnteam(Team_ColoredFullName(NUM_TEAM_2), NUM_TEAM_2-1, "models/domination/dom_blue.md3", 0, SND_DOM_CLAIM, "", "Blue team has captured a control point");
if(teams >= 3)
}
METHOD(Sound, sound_precache, void(Sound this))
{
- TC(Sound, this);
+ TC(Sound, this);
string s = _Sound_fixpath(this.sound_str());
if (!s) return;
profile(sprintf("precache_sound(\"%s\")", s));
entity turret_projectile(entity actor, Sound _snd, float _size, float _health, float _death, float _proj_type, float _cull, float _cli_anim)
{
- TC(Sound, _snd);
+ TC(Sound, _snd);
entity proj;
sound (actor, CH_WEAPON_A, _snd, VOL_BASE, ATTEN_NORM);
void vehicle_alarm(entity e, int ch, Sound s0und)
{
- TC(Sound, s0und);
+ TC(Sound, s0und);
if(!autocvar_cl_vehicles_alarm)
return;
int _deahtype, float _projtype, float _health,
bool _cull, bool _clianim, entity _owner)
{
- TC(Sound, _mzlsound);
+ TC(Sound, _mzlsound);
entity proj;
proj = spawn();
string CTX(string s)
{
#if CTX_CACHE
- string c = HM_gets(CTX_cache, s);
- if (c != "") return c;
+ string c = HM_gets(CTX_cache, s);
+ if (c != "") return c;
#endif
int p = strstrofs(s, "^", 0);
string ret = (p < 0) ? s : substring(s, p + 1, -1);
#if CTX_CACHE
- LOG_DEBUGF("CTX(\"%s\")", s);
- HM_sets(CTX_cache, s, ret);
+ LOG_DEBUGF("CTX(\"%s\")", s);
+ HM_sets(CTX_cache, s, ret);
#endif
return ret;
}
#define remove(this) delete(this)
METHOD(Object, describe, string(Object this))
{
- TC(Object, this);
+ TC(Object, this);
string s = _("No description");
if (cvar("developer"))
{
}
METHOD(Object, display, void(Object this, void(string name, string icon) returns))
{
- TC(Object, this);
+ TC(Object, this);
returns(sprintf("entity %i", this), "nopreview_map");
}
ENDCLASS(Object)
void play_countdown(entity this, float finished, Sound samp)
{
- TC(Sound, samp);
+ TC(Sound, samp);
if(IS_REAL_CLIENT(this))
if(floor(finished - time - frametime) != floor(finished - time))
if(finished - time < 6)
void SpectateCopy(entity this, entity spectatee)
{
- TC(Client, this); TC(Client, spectatee);
+ TC(Client, this); TC(Client, spectatee);
MUTATOR_CALLHOOK(SpectateCopy, spectatee, this);
PS(this) = PS(spectatee);
void W_SwitchWeapon_Force(Player this, Weapon wep, .entity weaponentity)
{
- TC(Weapon, wep);
+ TC(Weapon, wep);
this.(weaponentity).cnt = this.(weaponentity).m_switchweapon.m_id;
this.(weaponentity).m_switchweapon = wep;
this.(weaponentity).selectweapon = wep.m_id;
void W_WeaponFrame(Player actor, .entity weaponentity)
{
- TC(Player, actor);
- TC(PlayerState, PS(actor));
+ TC(Player, actor);
+ TC(PlayerState, PS(actor));
entity this = actor.(weaponentity);
if (frametime) this.weapon_frametime = frametime;
if (!block_weapon)
{
- Weapon e = this.m_weapon;
- TC(Weapon, e);
+ Weapon e = this.m_weapon;
+ TC(Weapon, e);
if (w != WEP_Null)
{
e.wr_think(e, actor, weaponentity, button_atck | (button_atck2 << 1));
void W_Reload(entity actor, .entity weaponentity, float sent_ammo_min, Sound sent_sound)
{
- TC(Sound, sent_sound);
+ TC(Sound, sent_sound);
// set global values to work with
entity this = actor.(weaponentity);
Weapon e = this.m_weapon;