From: terencehill Date: Sat, 17 Jun 2017 13:26:18 +0000 (+0200) Subject: Minor optimizations + minor fix X-Git-Tag: xonotic-v0.8.5~2732 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=06ef79f6cbdf7c5ff8378973ce32863f5325a4f8;p=xonotic%2Fxonotic-data.pk3dir.git Minor optimizations + minor fix --- diff --git a/qcsrc/common/vehicles/cl_vehicles.qc b/qcsrc/common/vehicles/cl_vehicles.qc index afb48c918..b2f87821e 100644 --- a/qcsrc/common/vehicles/cl_vehicles.qc +++ b/qcsrc/common/vehicles/cl_vehicles.qc @@ -33,13 +33,14 @@ void AuxiliaryXhair_Draw2D(entity this) if (scoreboard_active) return; - vector size = draw_getimagesize(this.axh_image) * autocvar_cl_vehicles_crosshair_size; - vector pos = project_3d_to_2d(this.origin) - 0.5 * size; + vector pos = project_3d_to_2d(this.origin); if (!(pos.z < 0 || pos.x < 0 || pos.y < 0 || pos.x > vid_conwidth || pos.y > vid_conheight)) { + vector size = draw_getimagesize(this.axh_image) * autocvar_cl_vehicles_crosshair_size; + pos.x -= 0.5 * size.x; + pos.y -= 0.5 * size.y; pos.z = 0; - size.z = 0; drawpic(pos, this.axh_image, size, this.colormod, autocvar_crosshair_alpha * this.alpha, this.axh_drawflag); } diff --git a/qcsrc/common/vehicles/vehicle/raptor.qc b/qcsrc/common/vehicles/vehicle/raptor.qc index 5424d1cdf..d2839faa8 100644 --- a/qcsrc/common/vehicles/vehicle/raptor.qc +++ b/qcsrc/common/vehicles/vehicle/raptor.qc @@ -794,10 +794,10 @@ METHOD(Raptor, vr_crosshair, void(Raptor thisveh, entity player)) where = project_3d_to_2d(trace_endpos); setorigin(dropmark, trace_endpos); - tmpSize = draw_getimagesize(vCROSS_DROP) * autocvar_cl_vehicles_crosshair_size; if (!(where.z < 0 || where.x < 0 || where.y < 0 || where.x > vid_conwidth || where.y > vid_conheight)) { + tmpSize = draw_getimagesize(vCROSS_DROP) * autocvar_cl_vehicles_crosshair_size; where.x -= tmpSize.x * 0.5; where.y -= tmpSize.y * 0.5; where.z = 0; @@ -811,10 +811,10 @@ METHOD(Raptor, vr_crosshair, void(Raptor thisveh, entity player)) if(dropmark.cnt > time) { where = project_3d_to_2d(dropmark.origin); - tmpSize = draw_getimagesize(vCROSS_DROP) * autocvar_cl_vehicles_crosshair_size * 1.25; if (!(where.z < 0 || where.x < 0 || where.y < 0 || where.x > vid_conwidth || where.y > vid_conheight)) { + tmpSize = draw_getimagesize(vCROSS_DROP) * autocvar_cl_vehicles_crosshair_size * 1.25; where.x -= tmpSize.x * 0.5; where.y -= tmpSize.y * 0.5; where.z = 0;