From: Rudolf Polzer Date: Sat, 26 Nov 2011 11:28:29 +0000 (+0100) Subject: fix lots of inconsistencies to EXT_CSQC naming X-Git-Tag: xonotic-v0.6.0~35^2~33^2~6 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=d89a89bdc84b1997402cfbd17aaa9d043af1778f;p=xonotic%2Fxonotic-data.pk3dir.git fix lots of inconsistencies to EXT_CSQC naming --- diff --git a/qcsrc/client/Main.qc b/qcsrc/client/Main.qc index 1639aa822..90f1fcb33 100644 --- a/qcsrc/client/Main.qc +++ b/qcsrc/client/Main.qc @@ -82,30 +82,30 @@ void CSQC_Init(void) break; maxclients = i; - registercmd("hud_configure"); - registercmd("hud_save"); - //registercmd("menu_action"); + registercommand("hud_configure"); + registercommand("hud_save"); + //registercommand("menu_action"); - registercmd("+showscores");registercmd("-showscores"); - registercmd("+showaccuracy");registercmd("-showaccuracy"); + registercommand("+showscores");registercommand("-showscores"); + registercommand("+showaccuracy");registercommand("-showaccuracy"); #ifndef CAMERATEST if(isdemo()) { #endif - registercmd("+forward");registercmd("-forward"); - registercmd("+back");registercmd("-back"); - registercmd("+moveup");registercmd("-moveup"); - registercmd("+movedown");registercmd("-movedown"); - registercmd("+moveright");registercmd("-moveright"); - registercmd("+moveleft");registercmd("-moveleft"); - registercmd("+roll_right");registercmd("-roll_right"); - registercmd("+roll_left");registercmd("-roll_left"); + registercommand("+forward");registercommand("-forward"); + registercommand("+back");registercommand("-back"); + registercommand("+moveup");registercommand("-moveup"); + registercommand("+movedown");registercommand("-movedown"); + registercommand("+moveright");registercommand("-moveright"); + registercommand("+moveleft");registercommand("-moveleft"); + registercommand("+roll_right");registercommand("-roll_right"); + registercommand("+roll_left");registercommand("-roll_left"); #ifndef CAMERATEST } #endif registercvar("hud_usecsqc", "1"); - registercvar("scoreboard_columns", "default", CVAR_SAVE); + registercvar("scoreboard_columns", "default"); gametype = 0; @@ -127,6 +127,7 @@ void CSQC_Init(void) WaypointSprite_Load(); // precaches + precache_model("null"); precache_sound("misc/hit.wav"); precache_sound("misc/typehit.wav"); Projectile_Precache(); @@ -337,7 +338,7 @@ void PostInit(void) postinit = true; } -// CSQC_ConsoleCommand : Used to parse commands in the console that have been registered with the "registercmd" function +// CSQC_ConsoleCommand : Used to parse commands in the console that have been registered with the "registercommand" function // Return value should be 1 if CSQC handled the command, otherwise return 0 to have the engine handle it. float button_zoom; void Cmd_HUD_SetFields(float); @@ -1435,7 +1436,7 @@ string getcommandkey(string text, string command) keys = db_get(binddb, command); if (!keys) { - n = tokenize(findkeysforcommand(command)); // uses '...' strings + n = tokenize(findkeysforcommand(command, 0)); // uses '...' strings for(j = 0; j < n; ++j) { k = stof(argv(j)); diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index ae1865bab..ca9841b53 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -327,6 +327,8 @@ void PostInit(void); void CSQC_Demo_Camera(); float HUD_WouldDrawScoreboard(); float camera_mode; +float CAMERA_FREE = 1; +float CAMERA_CHASE = 2; float reticle_type; string NextFrameCommand; void CSQC_SPIDER_HUD(); @@ -359,6 +361,8 @@ vector damage_blurpostprocess, content_blurpostprocess; float checkfail[16]; +#define BUTTON_3 4 +#define BUTTON_4 8 void CSQC_UpdateView(float w, float h) { entity e; @@ -370,7 +374,7 @@ void CSQC_UpdateView(float w, float h) hud = getstati(STAT_HUD); if(checkextension("DP_CSQC_MINFPS_QUALITY")) - view_quality = R_SetView(VF_MINFPS_QUALITY); + view_quality = getproperty(VF_MINFPS_QUALITY); else view_quality = 1; @@ -393,8 +397,8 @@ void CSQC_UpdateView(float w, float h) CHECKFAIL_ASSERT(5, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{115}\{104}\{97}\{100}\{111}\{119}\{118}\{111}\{108}\{117}\{109}\{101}\{115}", 0); CHECKFAIL_ASSERT(6, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{111}\{118}\{101}\{114}\{100}\{114}\{97}\{119}", 0); - vf_size = R_SetView3fv(VF_SIZE); - vf_min = R_SetView3fv(VF_MIN); + vf_size = getpropertyvec(VF_SIZE); + vf_min = getpropertyvec(VF_MIN); vid_width = vf_size_x; vid_height = vf_size_y; @@ -416,10 +420,10 @@ void CSQC_UpdateView(float w, float h) if(spectatee_status >= 0 && (autocvar_cl_eventchase_death && getstati(STAT_HEALTH) <= 0 && !intermission) || intermission) { // make special vector since we can't use view_origin (It is one frame old as of this code, it gets set later with the results this code makes.) - vector current_view_origin = R_SetView3fv(VF_ORIGIN); + vector current_view_origin = getpropertyvec(VF_ORIGIN); // We must enable chase_active to get a third person view (weapon viewmodel hidden and own player model showing). - // Ideally, there should be another way to enable third person cameras, such as through R_SetView() + // Ideally, there should be another way to enable third person cameras, such as through setproperty() if(!autocvar_chase_active) cvar_set("chase_active", "-1"); // -1 enables chase_active while marking it as set by this code, and not by the user (which would be 1) @@ -439,8 +443,8 @@ void CSQC_UpdateView(float w, float h) eventchase_target_origin = current_view_origin - v_forward * eventchase_current_distance * (trace_fraction - 0.1); WarpZone_TraceLine(current_view_origin, eventchase_target_origin, MOVE_WORLDONLY, self); - R_SetView(VF_ORIGIN, trace_endpos); - R_SetView(VF_ANGLES, WarpZone_TransformVAngles(WarpZone_trace_transform, view_angles)); + setproperty(VF_ORIGIN, trace_endpos); + setproperty(VF_ANGLES, WarpZone_TransformVAngles(WarpZone_trace_transform, view_angles)); } else if(autocvar_chase_active < 0) // time to disable chase_active if it was set by this code { @@ -452,21 +456,21 @@ void CSQC_UpdateView(float w, float h) // do lockview after event chase camera so that it still applies whenever necessary. if(autocvar_cl_lockview || (autocvar__hud_configure && spectatee_status <= 0) || intermission > 1) { - R_SetView(VF_ORIGIN, freeze_org); - R_SetView(VF_ANGLES, freeze_ang); + setproperty(VF_ORIGIN, freeze_org); + setproperty(VF_ANGLES, freeze_ang); } else { - freeze_org = R_SetView3fv(VF_ORIGIN); - freeze_ang = R_SetView3fv(VF_ANGLES); + freeze_org = getpropertyvec(VF_ORIGIN); + freeze_ang = getpropertyvec(VF_ANGLES); } WarpZone_FixView(); //WarpZone_FixPMove(); // Render the Scene - view_origin = R_SetView3fv(VF_ORIGIN); - view_angles = R_SetView3fv(VF_ANGLES); + view_origin = getpropertyvec(VF_ORIGIN); + view_angles = getpropertyvec(VF_ANGLES); makevectors(view_angles); view_forward = v_forward; view_right = v_right; @@ -568,31 +572,31 @@ void CSQC_UpdateView(float w, float h) } // ALWAYS Clear Current Scene First - R_ClearScene(); + clearscene(); #ifdef WORKAROUND_XON010 if(checkextension("DP_CSQC_ROTATEMOVES")) { #endif - R_SetView(VF_ORIGIN, view_origin); - R_SetView(VF_ANGLES, view_angles); + setproperty(VF_ORIGIN, view_origin); + setproperty(VF_ANGLES, view_angles); #ifdef WORKAROUND_XON010 } #endif // FIXME engine bug? VF_SIZE and VF_MIN are not restored to sensible values by this - R_SetView(VF_SIZE, vf_size); - R_SetView(VF_MIN, vf_min); + setproperty(VF_SIZE, vf_size); + setproperty(VF_MIN, vf_min); // Assign Standard Viewflags // Draw the World (and sky) - R_SetView(VF_DRAWWORLD, 1); + setproperty(VF_DRAWWORLD, 1); // Set the console size vars vid_conwidth = autocvar_vid_conwidth; vid_conheight = autocvar_vid_conheight; vid_pixelheight = autocvar_vid_pixelheight; - R_SetView(VF_FOV, GetCurrentFov(fov)); + setproperty(VF_FOV, GetCurrentFov(fov)); // Camera for demo playback if(camera_active) @@ -621,10 +625,10 @@ void CSQC_UpdateView(float w, float h) } // Draw the Crosshair - R_SetView(VF_DRAWCROSSHAIR, 0); //Make sure engine crosshairs are always hidden + setproperty(VF_DRAWCROSSHAIR, 0); //Make sure engine crosshairs are always hidden // Draw the Engine Status Bar (the default Quake HUD) - R_SetView(VF_DRAWENGINEHUD, 0); + setproperty(VF_DRAWENGINESBAR, 0); // Update the mouse position /* @@ -639,8 +643,8 @@ void CSQC_UpdateView(float w, float h) self.draw(); self = e; - R_AddEntities(MASK_NORMAL | MASK_ENGINE | MASK_ENGINEVIEWMODELS); - R_RenderScene(); + addentities(MASK_NORMAL | MASK_ENGINE | MASK_ENGINEVIEWMODELS); + renderscene(); // now switch to 2D drawing mode by calling a 2D drawing function // then polygon drawing will draw as 2D stuff, and NOT get queued until the @@ -651,7 +655,11 @@ void CSQC_UpdateView(float w, float h) if not(serverflags & SERVERFLAG_ALLOW_FULLBRIGHT) { // apply night vision effect - vector rgb, tc_00, tc_01, tc_10, tc_11; + vector tc_00, tc_01, tc_10, tc_11; + vector rgb; + rgb_x = 0; // fteqcc sucks + rgb_y = 0; // fteqcc sucks + rgb_z = 0; // fteqcc sucks if(!nightvision_noise) { @@ -1392,11 +1400,11 @@ void CSQC_UpdateView(float w, float h) string w0, h0; w0 = ftos(autocvar_vid_conwidth); h0 = ftos(autocvar_vid_conheight); - //R_SetView(VF_VIEWPORT, '0 0 0', '640 480 0'); - //R_SetView(VF_FOV, '90 90 0'); - R_SetView(VF_ORIGIN, '0 0 0'); - R_SetView(VF_ANGLES, '0 0 0'); - R_SetView(VF_PERSPECTIVE, 1); + //setproperty(VF_VIEWPORT, '0 0 0', '640 480 0'); + //setproperty(VF_FOV, '90 90 0'); + setproperty(VF_ORIGIN, '0 0 0'); + setproperty(VF_ANGLES, '0 0 0'); + setproperty(VF_PERSPECTIVE, 1); makevectors('0 0 0'); vector v1, v2; cvar_set("vid_conwidth", "800"); @@ -1428,8 +1436,8 @@ void CSQC_UpdateView(float w, float h) CSQC_BUMBLE_HUD(); } // let's reset the view back to normal for the end - R_SetView(VF_MIN, '0 0 0'); - R_SetView(VF_SIZE, '1 0 0' * w + '0 1 0' * h); + setproperty(VF_MIN, '0 0 0'); + setproperty(VF_SIZE, '1 0 0' * w + '0 1 0' * h); } @@ -1626,6 +1634,6 @@ void CSQC_Demo_Camera() current_position = current_origin + current_camera_offset; } - R_SetView(VF_ANGLES, current_angles); - R_SetView(VF_ORIGIN, current_position); + setproperty(VF_ANGLES, current_angles); + setproperty(VF_ORIGIN, current_position); } diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index acdfe6d51..b3b4fb567 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -152,17 +152,13 @@ float autocvar_g_waypointsprite_scale; float autocvar_g_waypointsprite_spam; float autocvar_g_waypointsprite_timealphaexponent; float autocvar_hud_colorflash_alpha; -float autocvar_hud_configure_bg_minalpha; float autocvar_hud_configure_checkcollisions; float autocvar_hud_configure_grid; float autocvar_hud_configure_grid_alpha; -float autocvar_hud_configure_grid_xsize; -float autocvar_hud_configure_grid_ysize; float autocvar_hud_configure_teamcolorforced; float autocvar_hud_contents; float autocvar_hud_contents_blur; float autocvar_hud_contents_blur_alpha; -float autocvar_hud_contents_factor; float autocvar_hud_contents_fadeintime; float autocvar_hud_contents_fadeouttime; float autocvar_hud_contents_lava_alpha; @@ -208,14 +204,6 @@ vector autocvar_hud_panel_bg_color; float autocvar_hud_panel_bg_color_team; float autocvar_hud_panel_bg_padding; float autocvar_hud_panel_centerprint; -string autocvar_hud_panel_centerprint_pos; -string autocvar_hud_panel_centerprint_size; -string autocvar_hud_panel_centerprint_bg; -string autocvar_hud_panel_centerprint_bg_color; -string autocvar_hud_panel_centerprint_bg_color_team; -string autocvar_hud_panel_centerprint_bg_alpha; -string autocvar_hud_panel_centerprint_bg_border = ""; -string autocvar_hud_panel_centerprint_bg_padding = ""; float autocvar_hud_panel_centerprint_align; var float autocvar_hud_panel_centerprint_fade_in = 0.2; var float autocvar_hud_panel_centerprint_fade_out = 0.5; diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 5b7928a10..1a98bca50 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -452,7 +452,7 @@ void HUD_Weapons(void) float fadetime = autocvar_hud_panel_weapons_complainbubble_fadetime; vector weapon_pos, weapon_size; - vector old_panel_size; + local noref vector old_panel_size; // fteqcc sucks vector color, ammo_color; // check to see if we want to continue @@ -931,7 +931,7 @@ void HUD_Ammo(void) ammo_size = eX * mySize_x*(1/columns) + eY * mySize_y*(1/rows); } - vector offset; + local noref vector offset; // fteqcc sucks float newSize; if(ammo_size_x/ammo_size_y > 3) { @@ -2770,7 +2770,7 @@ void HUD_Score(void) drawstring_aspect(pos + eX * 0.75 * mySize_x, distribution_str, eX * 0.25 * mySize_x + eY * (1/3) * mySize_y, distribution_color, panel_fg_alpha, DRAWFLAG_NORMAL); } else { // teamgames float scores_count, row, column, rows, columns; - vector offset; + local noref vector offset; // fteqcc sucks vector score_pos, score_size; //for scores other than myteam if (spectatee_status == -1 || autocvar_hud_panel_score_rankings) { diff --git a/qcsrc/client/hud.qh b/qcsrc/client/hud.qh index cc3058f9e..16ccd0c79 100644 --- a/qcsrc/client/hud.qh +++ b/qcsrc/client/hud.qh @@ -1,5 +1,3 @@ -float log(float f); - float panel_order[HUD_PANEL_NUM]; string hud_panelorder_prev; @@ -40,8 +38,8 @@ float teamnagger; float hud_configure_checkcollisions; float hud_configure_prev; -vector hud_configure_gridSize; -vector hud_configure_realGridSize; +noref vector hud_configure_gridSize; // fteqcc sucks +noref vector hud_configure_realGridSize; // fteqcc sucks float hudShiftState; const float S_SHIFT = 1; diff --git a/qcsrc/client/hud_config.qc b/qcsrc/client/hud_config.qc index cb27567c1..170224693 100644 --- a/qcsrc/client/hud_config.qc +++ b/qcsrc/client/hud_config.qc @@ -403,7 +403,7 @@ void HUD_Panel_SetPosSize(vector mySize) HUD_Panel_UpdatePosSizeForId(highlightedPanel); vector resizeorigin; resizeorigin = panel_click_resizeorigin; - vector myPos; + local noref vector myPos; // fteqcc sucks // minimum panel size cap mySize_x = max(0.025 * vid_conwidth, mySize_x); diff --git a/qcsrc/client/laser.qc b/qcsrc/client/laser.qc index 0880ddc4b..a91e13b01 100644 --- a/qcsrc/client/laser.qc +++ b/qcsrc/client/laser.qc @@ -62,7 +62,7 @@ void Draw_Laser() if(self.cnt >= 0) pointparticles(self.cnt, trace_endpos, trace_plane_normal, drawframetime * 1000); if(self.colormod != '0 0 0' && self.modelscale != 0) - R_AddDynamicLight(trace_endpos + trace_plane_normal * 1, self.modelscale, self.colormod * 5); + adddynamiclight(trace_endpos + trace_plane_normal * 1, self.modelscale, self.colormod * 5); } } diff --git a/qcsrc/client/projectile.qc b/qcsrc/client/projectile.qc index 37ad89da5..e17d7ba3d 100644 --- a/qcsrc/client/projectile.qc +++ b/qcsrc/client/projectile.qc @@ -150,7 +150,7 @@ void Projectile_Draw() { case PROJECTILE_BULLET_GLOWING: case PROJECTILE_BULLET_GLOWING_TRACER: - R_AddDynamicLight(self.origin, 50 * a, '1 1 0'); + adddynamiclight(self.origin, 50 * a, '1 1 0'); break; default: break; diff --git a/qcsrc/client/teamradar.qc b/qcsrc/client/teamradar.qc index beccbe994..f3ec99bfe 100644 --- a/qcsrc/client/teamradar.qc +++ b/qcsrc/client/teamradar.qc @@ -170,7 +170,7 @@ void draw_teamradar_link(vector start, vector end, float colors) float hud_panel_radar_scale; float hud_panel_radar_foreground_alpha; float hud_panel_radar_rotation; -vector hud_panel_radar_size; +noref vector hud_panel_radar_size; // fteqcc sucks float hud_panel_radar_zoommode; void teamradar_loadcvars() diff --git a/qcsrc/client/waypointsprites.qc b/qcsrc/client/waypointsprites.qc index 77eceab5e..ac85f8c65 100644 --- a/qcsrc/client/waypointsprites.qc +++ b/qcsrc/client/waypointsprites.qc @@ -542,7 +542,7 @@ void Draw_WaypointSprite() o_z = 0; float edgedistance_min, crosshairdistance; - edgedistance_min = min4((o_y - (vid_conheight * waypointsprite_edgeoffset_top)), + edgedistance_min = min((o_y - (vid_conheight * waypointsprite_edgeoffset_top)), (o_x - (vid_conwidth * waypointsprite_edgeoffset_left)), (vid_conwidth - (vid_conwidth * waypointsprite_edgeoffset_right)) - o_x, (vid_conheight - (vid_conheight * waypointsprite_edgeoffset_bottom)) - o_y); diff --git a/qcsrc/dpdefs/csprogsdefs.qc b/qcsrc/dpdefs/csprogsdefs.qc index bb7476cd2..8ac3c2803 100644 --- a/qcsrc/dpdefs/csprogsdefs.qc +++ b/qcsrc/dpdefs/csprogsdefs.qc @@ -1064,6 +1064,146 @@ float SOUNDFLAG_RELIABLE = 1; //- NOTE: to check for this, ALSO OR a check with DP_SND_SOUND7 to also support // the finished extension once done +//DP_MOVETYPEFLYWORLDONLY +//idea: Samual +//darkplaces implementation: Samual +//movetype definitions: +float MOVETYPE_FLY_WORLDONLY = 33; +//description: +//like MOVETYPE_FLY, but does all traces with MOVE_WORLDONLY, and is ignored by MOVETYPE_PUSH. Should only be combined with SOLID_NOT and SOLID_TRIGGER. + +//DP_QC_TRACE_MOVETYPE_WORLDONLY +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//constant definitions: +float MOVE_WORLDONLY = 3; +//description: +//allows traces to hit only world (ignoring all entities, unlike MOVE_NOMONSTERS which hits all bmodels), use as the nomonsters parameter to trace functions + +//DP_SND_GETSOUNDTIME +//idea: VorteX +//darkplaces implementation: VorteX +//constant definitions: +float(entity e, float channel) getsoundtime = #533; // get currently sound playing position on entity channel, -1 if not playing or error +float(string sample) soundlength = #534; // returns length of sound sample in seconds, -1 on error (sound not precached, sound system not initialized etc.) +//description: provides opportunity to query length of sound samples and realtime tracking of sound playing on entities (similar to DP_GETTIME_CDTRACK) +//note: beware dedicated server not running sound engine at all, so in dedicated mode this builtins will not work in server progs +//note also: menu progs not supporting getsoundtime() (will give a warning) since it has no sound playing on entities +//examples of use: +// - QC-driven looped sounds +// - QC events when sound playing is finished +// - toggleable ambientsounds +// - subtitles + +//DP_QC_NUM_FOR_EDICT +//idea: Blub\0 +//darkplaces implementation: Blub\0 +//Function to get the number of an entity - a clean way. +float(entity num) num_for_edict = #512; + +//DP_TRACE_HITCONTENTSMASK_SURFACEINFO +//idea: LordHavoc +//darkplaces implementation: LordHavoc +//globals: +.float dphitcontentsmask; // if non-zero on the entity passed to traceline/tracebox/tracetoss this will override the normal collidable contents rules and instead hit these contents values (for example AI can use tracelines that hit DONOTENTER if it wants to, by simply changing this field on the entity passed to traceline), this affects normal movement as well as trace calls +float trace_dpstartcontents; // DPCONTENTS_ value at start position of trace +float trace_dphitcontents; // DPCONTENTS_ value of impacted surface (not contents at impact point, just contents of the surface that was hit) +float trace_dphitq3surfaceflags; // Q3SURFACEFLAG_ value of impacted surface +string trace_dphittexturename; // texture name of impacted surface +//constants: +float DPCONTENTS_SOLID = 1; // hit a bmodel, not a bounding box +float DPCONTENTS_WATER = 2; +float DPCONTENTS_SLIME = 4; +float DPCONTENTS_LAVA = 8; +float DPCONTENTS_SKY = 16; +float DPCONTENTS_BODY = 32; // hit a bounding box, not a bmodel +float DPCONTENTS_CORPSE = 64; // hit a SOLID_CORPSE entity +float DPCONTENTS_NODROP = 128; // an area where backpacks should not spawn +float DPCONTENTS_PLAYERCLIP = 256; // blocks player movement +float DPCONTENTS_MONSTERCLIP = 512; // blocks monster movement +float DPCONTENTS_DONOTENTER = 1024; // AI hint brush +float DPCONTENTS_LIQUIDSMASK = 14; // WATER | SLIME | LAVA +float DPCONTENTS_BOTCLIP = 2048; // AI hint brush +float DPCONTENTS_OPAQUE = 4096; // only fully opaque brushes get this (may be useful for line of sight checks) +float Q3SURFACEFLAG_NODAMAGE = 1; +float Q3SURFACEFLAG_SLICK = 2; // low friction surface +float Q3SURFACEFLAG_SKY = 4; // sky surface (also has NOIMPACT and NOMARKS set) +float Q3SURFACEFLAG_LADDER = 8; // climbable surface +float Q3SURFACEFLAG_NOIMPACT = 16; // projectiles should remove themselves on impact (this is set on sky) +float Q3SURFACEFLAG_NOMARKS = 32; // projectiles should not leave marks, such as decals (this is set on sky) +float Q3SURFACEFLAG_FLESH = 64; // projectiles should do a fleshy effect (blood?) on impact +float Q3SURFACEFLAG_NODRAW = 128; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_HINT = 256; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_SKIP = 512; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_NOLIGHTMAP = 1024; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_POINTLIGHT = 2048; // compiler hint (not important to qc) +float Q3SURFACEFLAG_METALSTEPS = 4096; // walking on this surface should make metal step sounds +float Q3SURFACEFLAG_NOSTEPS = 8192; // walking on this surface should not make footstep sounds +float Q3SURFACEFLAG_NONSOLID = 16384; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_LIGHTFILTER = 32768; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_ALPHASHADOW = 65536; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_NODLIGHT = 131072; // compiler hint (not important to qc) +//float Q3SURFACEFLAG_DUST = 262144; // translucent 'light beam' effect (not important to qc) +//description: +//adds additional information after a traceline/tracebox/tracetoss call. +//also (very important) sets trace_* globals before calling .touch functions, +//this allows them to inspect the nature of the collision (for example +//determining if a projectile hit sky), clears trace_* variables for the other +//object in a touch event (that is to say, a projectile moving will see the +//trace results in its .touch function, but the player it hit will see very +//little information in the trace_ variables as it was not moving at the time) + +//DP_QC_CVAR_TYPE +//idea: divVerent +//DarkPlaces implementation: divVerent +//builtin definitions: +float(string name) cvar_type = #495; +float CVAR_TYPEFLAG_EXISTS = 1; +float CVAR_TYPEFLAG_SAVED = 2; +float CVAR_TYPEFLAG_PRIVATE = 4; +float CVAR_TYPEFLAG_ENGINE = 8; +float CVAR_TYPEFLAG_HASDESCRIPTION = 16; +float CVAR_TYPEFLAG_READONLY = 32; + +//DP_QC_CRC16 +//idea: divVerent +//darkplaces implementation: divVerent +//Some hash function to build hash tables with. This has to be be the CRC-16-CCITT that is also required for the QuakeWorld download protocol. +//When caseinsensitive is set, the CRC is calculated of the lower cased string. +float(float caseinsensitive, string s, ...) crc16 = #494; + +//DP_QC_URI_ESCAPE +//idea: divVerent +//darkplaces implementation: divVerent +//URI::Escape's functionality +string(string in) uri_escape = #510; +string(string in) uri_unescape = #511; + +//DP_QC_DIGEST +//idea: motorsep, Spike +//DarkPlaces implementation: divVerent +//builtin definitions: +string(string digest, string data, ...) digest_hex = #639; +//description: +//returns a given hex digest of given data +//the returned digest is always encoded in hexadecimal +//only the "MD4" digest is always supported! +//if the given digest is not supported, string_null is returned +//the digest string is matched case sensitively, use "MD4", not "md4"! + +//DP_QC_DIGEST_SHA256 +//idea: motorsep, Spike +//DarkPlaces implementation: divVerent +//description: +//"SHA256" is also an allowed digest type + +//DP_QC_LOG +//darkplaces implementation: divVerent +//builtin definitions: +float log(float f) = #532; +//description: +//logarithm + // assorted builtins const float STAT_MOVEVARS_TICRATE = 240; const float STAT_MOVEVARS_TIMESCALE = 241; @@ -1076,3 +1216,4 @@ float particles_alphamin, particles_alphamax; float PARTICLES_USECOLOR = 2; vector particles_colormin, particles_colormax; void(float effectindex, entity own, vector org_from, vector org_to, vector dir_from, vector dir_to, float countmultiplier, float flags) boxparticles = #502; +float trace_networkentity; diff --git a/qcsrc/warpzonelib/client.qc b/qcsrc/warpzonelib/client.qc index 5979c804d..a44b37974 100644 --- a/qcsrc/warpzonelib/client.qc +++ b/qcsrc/warpzonelib/client.qc @@ -3,7 +3,7 @@ void WarpZone_Fade_PreDraw() if(self.warpzone_fadestart) { vector org; - org = R_SetView3fv(VF_ORIGIN); + org = getpropertyvec(VF_ORIGIN); self.alpha = bound(0, (self.warpzone_fadeend - vlen(org - self.origin - 0.5 * (self.mins + self.maxs))) / (self.warpzone_fadeend - self.warpzone_fadestart), 1); } else @@ -156,7 +156,7 @@ void WarpZone_Teleported_Read(float isnew) if(!isnew) return; self.warpzone_transform = v; - R_SetView3fv(VF_CL_VIEWANGLES, WarpZone_TransformVAngles(self, R_SetView3fv(VF_CL_VIEWANGLES))); + setproperty(VF_CL_VIEWANGLES, WarpZone_TransformVAngles(self, getpropertyvec(VF_CL_VIEWANGLES))); if(checkextension("DP_CSQC_ROTATEMOVES")) CL_RotateMoves(v); //CL_RotateMoves('0 90 0'); @@ -194,12 +194,12 @@ vector WarpZone_FixNearClip(vector o, vector c0, vector c1, vector c2, vector c3 entity e; float pd; - mi_x = min5(o_x, c0_x, c1_x, c2_x, c3_x); - ma_x = max5(o_x, c0_x, c1_x, c2_x, c3_x); - mi_y = min5(o_y, c0_y, c1_y, c2_y, c3_y); - ma_y = max5(o_y, c0_y, c1_y, c2_y, c3_y); - mi_z = min5(o_z, c0_z, c1_z, c2_z, c3_z); - ma_z = max5(o_z, c0_z, c1_z, c2_z, c3_z); + mi_x = min(o_x, c0_x, c1_x, c2_x, c3_x); + ma_x = max(o_x, c0_x, c1_x, c2_x, c3_x); + mi_y = min(o_y, c0_y, c1_y, c2_y, c3_y); + ma_y = max(o_y, c0_y, c1_y, c2_y, c3_y); + mi_z = min(o_z, c0_z, c1_z, c2_z, c3_z); + ma_z = max(o_z, c0_z, c1_z, c2_z, c3_z); e = WarpZone_Find(mi, ma); if(e) @@ -207,7 +207,7 @@ vector WarpZone_FixNearClip(vector o, vector c0, vector c1, vector c2, vector c3 if(WarpZone_PlaneDist(e, o) < 0) return '0 0 0'; // can't really be, though, but if it is, this is not my warpzone, but a random different one in the same mins/maxs - pd = min4( + pd = min( WarpZone_PlaneDist(e, c0), WarpZone_PlaneDist(e, c1), WarpZone_PlaneDist(e, c2), @@ -240,8 +240,8 @@ void WarpZone_FixView() vector org, ang, nearclip, corner0, corner1, corner2, corner3, o; float f; - org = R_SetView3fv(VF_ORIGIN); - ang = R_SetView3fv(VF_ANGLES); + org = getpropertyvec(VF_ORIGIN); + ang = getpropertyvec(VF_ANGLES); #ifdef WORKAROUND_XON010 float dirty; dirty = checkextension("DP_CSQC_ROTATEMOVES"); @@ -267,9 +267,9 @@ void WarpZone_FixView() else f = 0; - rick = R_SetView(VF_CL_VIEWANGLES_Z); + rick = getproperty(VF_CL_VIEWANGLES_Z); rick *= f; - R_SetView(VF_CL_VIEWANGLES_Z, rick); + setproperty(VF_CL_VIEWANGLES_Z, rick); #ifdef WORKAROUND_XON010 if(ang_z > 1 || ang_z < -1) @@ -282,8 +282,8 @@ void WarpZone_FixView() if(dirty) { #endif - R_SetView(VF_ORIGIN, org); - R_SetView(VF_ANGLES, ang); + setproperty(VF_ORIGIN, org); + setproperty(VF_ANGLES, ang); #ifdef WORKAROUND_XON010 } #endif @@ -295,7 +295,7 @@ void WarpZone_FixView() corner3 = cs_unproject('1 0 0' * cvar("vid_conwidth") + '0 1 0' * cvar("vid_conheight") + nearclip); o = WarpZone_FixNearClip(org, corner0, corner1, corner2, corner3); if(o != '0 0 0') - R_SetView(VF_ORIGIN, org + o); + setproperty(VF_ORIGIN, org + o); } void WarpZone_Init()