.float cnt;
.float alpha;
- .float state;
+ .int state;
#elif defined(MENUQC)
#elif defined(SVQC)
#endif
return 0;
}
-float GetPlayerColorForce(float i)
+float GetPlayerColorForce(int i)
{
if(!teamplay)
return 0;
return stof(getplayerkeyvalue(i, "colors")) & 15;
}
-float GetPlayerColor(float i)
+float GetPlayerColor(int i)
{
if(!playerslots[i].gotscores) // unconnected
return NUM_SPECTATOR;
return GetPlayerColorForce(i);
}
-string GetPlayerName(float i)
+string GetPlayerName(int i)
{
return ColorTranslateRGB(getplayerkeyvalue(i, "name"));
}
float current_player;
-float GetPlayerColorForce(float i);
+float GetPlayerColorForce(int i);
#define HUD_PANELS(HUD_PANEL) \
} else { \
panel_bg_padding = stof(panel_bg_padding_str); \
} \
- panel_bg_padding = min(min(panel_size_x, panel_size_y)/2 - 5, panel_bg_padding); \
+ panel_bg_padding = min(min(panel_size.x, panel_size.y)/2 - 5, panel_bg_padding); \
} while(0)
// return smoothly faded pos and size of given panel when a dialog is active
vector menu_enable_size = '0 0 0'; \
float menu_enable_maxsize_x = 0.3 * vid_conwidth; \
float menu_enable_maxsize_y = 0.18 * vid_conheight; \
- if (panel_size_x > panel_size_y) { \
- if (panel_size_y > menu_enable_maxsize_y) { \
- menu_enable_size_y = menu_enable_maxsize_y; \
- menu_enable_size_x = panel_size_x * (menu_enable_maxsize_y/panel_size_y); \
+ if (panel_size.x > panel_size.y) { \
+ if (panel_size.y > menu_enable_maxsize_y) { \
+ menu_enable_size.y = menu_enable_maxsize_y; \
+ menu_enable_size.x = panel_size.x * (menu_enable_maxsize_y/panel_size.y); \
panel_size = (1 - autocvar__menu_alpha) * panel_size + (autocvar__menu_alpha) * menu_enable_size; \
} \
- menu_enable_pos = eX * 0.5 * vid_conwidth - eX * 0.5 * panel_size_x + eY * (vid_conheight - menu_enable_maxsize_y);\
+ menu_enable_pos = eX * 0.5 * vid_conwidth - eX * 0.5 * panel_size.x + eY * (vid_conheight - menu_enable_maxsize_y);\
} else { \
- if (panel_size_x > menu_enable_maxsize_x) { \
- menu_enable_size_x = menu_enable_maxsize_x; \
- menu_enable_size_y = panel_size_y * (menu_enable_maxsize_x/panel_size_x); \
+ if (panel_size.x > menu_enable_maxsize_x) { \
+ menu_enable_size.x = menu_enable_maxsize_x; \
+ menu_enable_size.y = panel_size.y * (menu_enable_maxsize_x/panel_size.x); \
panel_size = (1 - autocvar__menu_alpha) * panel_size + (autocvar__menu_alpha) * menu_enable_size; \
} \
- menu_enable_pos = eY * 0.5 * vid_conheight - eY * 0.5 * panel_size_y + eX * (vid_conwidth - menu_enable_maxsize_x);\
+ menu_enable_pos = eY * 0.5 * vid_conheight - eY * 0.5 * panel_size.y + eX * (vid_conwidth - menu_enable_maxsize_x);\
} \
panel_pos = (1 - autocvar__menu_alpha) * panel_pos + (autocvar__menu_alpha) * menu_enable_pos; \
} while(0)
// Scale the pos and size vectors to absolute coordinates
#define HUD_Panel_ScalePosSize() do { \
- panel_pos_x *= vid_conwidth; panel_pos_y *= vid_conheight; \
- panel_size_x *= vid_conwidth; panel_size_y *= vid_conheight; \
+ panel_pos.x *= vid_conwidth; panel_pos.y *= vid_conheight; \
+ panel_size.x *= vid_conwidth; panel_size.y *= vid_conheight; \
} while(0)
// NOTE: in hud_configure mode cvars must be reloaded every frame
} while(0)
const int NOTIFY_MAX_ENTRIES = 10;
-const int NOTIFY_ICON_MARGIN = 0.02;
+const float NOTIFY_ICON_MARGIN = 0.02;
int notify_index;
int notify_count;
HUD_Write("\n");
// common cvars for all panels
- float i;
+ int i;
for (i = 0; i < HUD_PANEL_NUM; ++i)
{
panel = hud_panel[i];
// check if resize will result in panel being moved into another panel. If so, return snapped vector, otherwise return the given vector
vector HUD_Panel_CheckResize(vector mySize, vector resizeorigin) {
- float i;
-
vector targEndPos;
-
vector dist;
- float ratio;
- ratio = mySize.x/mySize.y;
-
+ float ratio = mySize.x/mySize.y;
+ int i;
for (i = 0; i < HUD_PANEL_NUM; ++i) {
panel = hud_panel[i];
if(panel == highlightedPanel) continue;
con_keys = findkeysforcommand("toggleconsole", 0);
keys = tokenize(con_keys); // findkeysforcommand returns data for this
- float hit_con_bind = 0, i;
+ bool hit_con_bind = false;
+ int i;
for (i = 0; i < keys; ++i)
{
if(nPrimary == stof(argv(i)))
- hit_con_bind = 1;
+ hit_con_bind = true;
}
if(bInputType == 0) {
float HUD_Panel_Check_Mouse_Pos(float allow_move)
{
- float i, j = 0, border;
-
+ int i, j = 0;
while(j < HUD_PANEL_NUM)
{
i = panel_order[j];
panel = hud_panel[i];
HUD_Panel_UpdatePosSize();
- border = max(8, panel_bg_border); // FORCED border so a small border size doesn't mean you can't resize
+ float border = max(8, panel_bg_border); // FORCED border so a small border size doesn't mean you can't resize
// move
if(allow_move && mousepos.x > panel_pos.x && mousepos.y > panel_pos.y && mousepos.x < panel_pos.x + panel_size.x && mousepos.y < panel_pos.y + panel_size.y)
void HUD_Panel_Highlight(float allow_move)
{
- float i, j = 0, border;
+ int i, j = 0;
while(j < HUD_PANEL_NUM)
{
panel = hud_panel[i];
HUD_Panel_UpdatePosSize();
- border = max(8, panel_bg_border); // FORCED border so a small border size doesn't mean you can't resize
+ float border = max(8, panel_bg_border); // FORCED border so a small border size doesn't mean you can't resize
// move
if(allow_move && mousepos.x > panel_pos.x && mousepos.y > panel_pos.y && mousepos.x < panel_pos.x + panel_size.x && mousepos.y < panel_pos.y + panel_size.y)
float _menu_alpha_prev;
void HUD_Configure_Frame()
{
- float i;
+ int i;
if(autocvar__hud_configure)
{
if(isdemo() || intermission == 2)
void Ent_RemovePlayerScore()
{
- float i;
-
- if(self.owner)
- {
+ if(self.owner) {
SetTeam(self.owner, -1);
self.owner.gotscores = 0;
- for(i = 0; i < MAX_SCORE; ++i)
+ for(int i = 0; i < MAX_SCORE; ++i) {
self.owner.(scores[i]) = 0; // clear all scores
+ }
}
}
return strcat(pre, map, post);
}
-string GameTypeVote_DescriptionByID(float id)
+string GameTypeVote_DescriptionByID(int id)
{
return MapInfo_Type_Description(MapInfo_Type_FromString(mv_maps[id]));
}
void Cmd_MapVote_MapDownload(float argc)
{
- float id;
entity pak;
if(argc != 2 || !mv_pk3list)
return;
}
- id = stof(argv(1));
+ int id = stof(argv(1));
for(pak = mv_pk3list; pak; pak = pak.chain)
if(pak.sv_entnum == id)
break;
string MapVote_FormatMapItem(int id, string map, float count, float maxwidth, vector fontsize);
-string GameTypeVote_DescriptionByID(float id);
+string GameTypeVote_DescriptionByID(int id);
vector MapVote_RGB(int id);
float _Movetype_CheckWater(entity ent) // SV_CheckWater
{
- int supercontents;
- float nativecontents;
- vector point;
+ vector point = ent.move_origin;
+ point.z += (ent.mins.z + 1);
- point = ent.move_origin;
- point_z += (ent.mins.z + 1);
-
- nativecontents = pointcontents(point);
+ int nativecontents = pointcontents(point);
if(ent.move_watertype)
if(ent.move_watertype != nativecontents)
ent.move_waterlevel = 0;
ent.move_watertype = CONTENT_EMPTY;
- supercontents = Mod_Q1BSP_SuperContentsFromNativeContents(nativecontents);
+ int supercontents = Mod_Q1BSP_SuperContentsFromNativeContents(nativecontents);
if(supercontents & DPCONTENTS_LIQUIDSMASK)
{
ent.move_watertype = nativecontents;
.vector move_velocity;
.vector move_avelocity;
.int move_flags;
-.float move_watertype;
-.float move_waterlevel;
+.int move_watertype;
+.int move_waterlevel;
.void(void) move_touch;
.void(float, float) contentstransition;
.float move_bounce_factor;
void draw_teamradar_icon(vector coord, float icon, entity pingdata, vector rgb, float a)
{
- float dt;
- vector v;
- float i;
-
coord = teamradar_texcoord_to_2dcoord(teamradar_3dcoord_to_texcoord(coord));
drawpic(coord - '4 4 0', strcat("gfx/teamradar_icon_", ftos(icon)), '8 8 0', rgb, a, 0);
if(pingdata)
{
- for(i = 0; i < MAX_TEAMRADAR_TIMES; ++i)
+ for(int i = 0; i < MAX_TEAMRADAR_TIMES; ++i)
{
- dt = pingdata.(teamradar_times[i]);
+ float dt = pingdata.(teamradar_times[i]);
if(dt == 0)
continue;
dt = time - dt;
if(dt >= 1 || dt <= 0)
continue;
- v = '2 2 0' * teamradar_size * dt;
+ vector v = '2 2 0' * teamradar_size * dt;
drawpic(coord - 0.5 * v, "gfx/teamradar_ping", v, '1 1 1', (1 - dt) * a, DRAWFLAG_ADDITIVE);
}
}
// Last updated: December 28th, 2011
// =========================================================
-const float MAX_RPN_STACK = 16;
+const int MAX_RPN_STACK = 16;
int rpn_db;
int rpn_error;
int rpn_sp;
CSQCMODEL_PROPERTY(2, int, ReadInt24_t, WriteInt24_t, effects) \
CSQCMODEL_PROPERTY(4, int, ReadByte, WriteByte, modelflags) \
CSQCMODEL_PROPERTY_SCALED(8, float, ReadByte, WriteByte, alpha, 254, -1, 254) \
- CSQCMODEL_PROPERTY(16, float, ReadByte, WriteByte, skin) \
+ CSQCMODEL_PROPERTY(16, int, ReadByte, WriteByte, skin) \
CSQCMODEL_PROPERTY(32, float, ReadApproxPastTime, WriteApproxPastTime, death_time) \
CSQCMODEL_PROPERTY(64, float, ReadByte, WriteByte, solid) \
CSQCMODEL_IF(!isplayer) \
CSQCMODEL_PROPERTY_SCALED(256, float, ReadByte, WriteByte, colormod_z, 255, 0, 255) \
CSQCMODEL_ENDIF \
CSQCMODEL_IF(isplayer) \
- CSQCMODEL_PROPERTY(128, float, ReadByte, WriteByte, anim_state) \
+ CSQCMODEL_PROPERTY(128, int, ReadByte, WriteByte, anim_state) \
CSQCMODEL_PROPERTY(128, float, ReadApproxPastTime, WriteApproxPastTime, anim_time) \
CSQCMODEL_IF(!islocalplayer) \
CSQCMODEL_PROPERTY(256, float, ReadChar, WriteChar, anim_lower_action) \
string input, string durcnt,
int cpid, float f1, float f2)
{
- string selected;
- float sel_num;
arg_slot[0] = ""; arg_slot[1] = "";
- for(sel_num = 0;(durcnt != "");)
+ for(int sel_num = 0;(durcnt != "");)
{
- selected = car(durcnt); durcnt = cdr(durcnt);
+ string selected = car(durcnt); durcnt = cdr(durcnt);
NOTIF_HIT_MAX(NOTIF_MAX_DURCNT, "Local_Notification_centerprint_generic");
switch(strtolower(selected))
{
// WOVA = Without Variable Arguments
void Local_Notification_WOVA(
- float net_type, float net_name,
+ int net_type, float net_name,
float stringcount, float floatcount,
string s1, string s2, string s3, string s4,
float f1, float f2, float f3, float f4)
#ifdef CSQC
void Read_Notification(float is_new)
{
- float net_type = ReadByte();
- float net_name = ReadShort();
+ int net_type = ReadByte();
+ int net_name = ReadShort();
entity notif;
float get_model_parameters(string m, float sk)
{
- string fn, s, c;
- float fh, i;
-
get_model_parameters_modelname = string_null;
get_model_parameters_modelskin = -1;
get_model_parameters_name = string_null;
get_model_parameters_desc = string_null;
get_model_parameters_bone_upperbody = string_null;
get_model_parameters_bone_weapon = string_null;
- for(i = 0; i < MAX_AIM_BONES; ++i)
+ for(int i = 0; i < MAX_AIM_BONES; ++i)
{
get_model_parameters_bone_aim[i] = string_null;
get_model_parameters_bone_aimweight[i] = 0;
m = substring(m, 0, -7);
}
- fn = get_model_datafilename(m, sk, "txt");
- fh = fopen(fn, FILE_READ);
+ string fn = get_model_datafilename(m, sk, "txt");
+ int fh = fopen(fn, FILE_READ);
if(fh < 0)
{
sk = 0;
get_model_parameters_modelname = m;
get_model_parameters_modelskin = sk;
+ string s, c;
while((s = fgets(fh)))
{
if(s == "")
get_model_parameters_bone_upperbody = s;
if(c == "bone_weapon")
get_model_parameters_bone_weapon = s;
- for(i = 0; i < MAX_AIM_BONES; ++i)
+ for(int i = 0; i < MAX_AIM_BONES; ++i)
if(c == strcat("bone_aim", ftos(i)))
{
get_model_parameters_bone_aimweight[i] = stof(car(s));
.vector beam_start;
.vector beam_dir;
.vector beam_wantdir;
-.float beam_type;
-
-const float ARC_BT_MISS = 0x00;
-const float ARC_BT_WALL = 0x01;
-const float ARC_BT_HEAL = 0x02;
-const float ARC_BT_HIT = 0x03;
-const float ARC_BT_BURST_MISS = 0x10;
-const float ARC_BT_BURST_WALL = 0x11;
-const float ARC_BT_BURST_HEAL = 0x12;
-const float ARC_BT_BURST_HIT = 0x13;
-const float ARC_BT_BURSTMASK = 0x10;
-
-const float ARC_SF_SETTINGS = 1;
-const float ARC_SF_START = 2;
-const float ARC_SF_WANTDIR = 4;
-const float ARC_SF_BEAMDIR = 8;
-const float ARC_SF_BEAMTYPE = 16;
-const float ARC_SF_LOCALMASK = 14;
+.int beam_type;
+
+const int ARC_BT_MISS = 0x00;
+const int ARC_BT_WALL = 0x01;
+const int ARC_BT_HEAL = 0x02;
+const int ARC_BT_HIT = 0x03;
+const int ARC_BT_BURST_MISS = 0x10;
+const int ARC_BT_BURST_WALL = 0x11;
+const int ARC_BT_BURST_HEAL = 0x12;
+const int ARC_BT_BURST_HIT = 0x13;
+const int ARC_BT_BURSTMASK = 0x10;
+
+const int ARC_SF_SETTINGS = 1;
+const int ARC_SF_START = 2;
+const int ARC_SF_WANTDIR = 4;
+const int ARC_SF_BEAMDIR = 8;
+const int ARC_SF_BEAMTYPE = 16;
+const int ARC_SF_LOCALMASK = 14;
#endif
#ifdef SVQC
ARC_SETTINGS(WEP_ADD_CVAR, WEP_ADD_PROP)
dummy_weapon_info.w_crosshair_size = 1;
dummy_weapon_info.model2 = "";
- float i;
+ int i;
weaponorder_byid = "";
for(i = WEP_MAXCOUNT; i >= 1; --i)
if(weapon_info[i-1])
.vector glowmod;
.vector view_ofs;
-.float frame;
+.int frame;
.float frame1time;
-.float frame2;
+.int frame2;
.float frame2time;
.float lerpfrac;
const int CSQCMODEL_PROPERTY_SIZE = 32768;
#define ALLPROPERTIES_COMMON \
- CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_FRAME, float, ReadByte, WriteByte, frame) \
- CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_MODELINDEX, float, ReadShort, WriteShort, modelindex) \
+ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_FRAME, int, ReadByte, WriteByte, frame) \
+ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_MODELINDEX, int, ReadShort, WriteShort, modelindex) \
CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_ORIGIN, float, ReadCoord, WriteCoord, origin_x) \
CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_ORIGIN, float, ReadCoord, WriteCoord, origin_y) \
CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_ORIGIN, float, ReadCoord, WriteCoord, origin_z) \
.float frame4time;
.float lerpfrac4;
#define ALLPROPERTIES ALLPROPERTIES_COMMON \
- CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_FRAME2, float, ReadByte, WriteByte, frame2) \
+ CSQCMODEL_PROPERTY(CSQCMODEL_PROPERTY_FRAME2, int, ReadByte, WriteByte, frame2) \
CSQCMODEL_PROPERTY_SCALED(CSQCMODEL_PROPERTY_LERPFRAC, float, ReadByte, WriteByte, lerpfrac, 255, 0, 255)
#else
#define ALLPROPERTIES ALLPROPERTIES_COMMON
float(float modlindex, string framename) frameforname = #276; // finds number of a specified frame in the animation, returns -1 if no match found
float(float modlindex, float framenum) frameduration = #277; // returns the intended play time (in seconds) of the specified framegroup, if it does not exist the result is 0, if it is a single frame it may be a small value around 0.1 or 0.
//fields:
-.float skeletonindex; // active skeleton overriding standard animation on model
-.float frame; // primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
-.float frame2; // secondary framegroup animation (strength = lerpfrac)
+.int skeletonindex; // active skeleton overriding standard animation on model
+.int frame; // primary framegroup animation (strength = 1 - lerpfrac - lerpfrac3 - lerpfrac4)
+.int frame2; // secondary framegroup animation (strength = lerpfrac)
.float frame3; // tertiary framegroup animation (strength = lerpfrac3)
.float frame4; // quaternary framegroup animation (strength = lerpfrac4)
.float lerpfrac; // strength of framegroup blend
//
// system fields (*** = do not set in prog code, maintained by C code)
//
-.float modelindex; // *** model index in the precached list
+.int modelindex; // *** model index in the precached list
.vector absmin, absmax; // *** origin + mins / maxs
.float ltime; // local time for entity
.string classname; // spawn function
.string model;
-.float frame;
+.int frame;
.int skin;
.int effects;