]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/command/radarmap.qc
Merge branch 'master' into Mario/qc_physics_prehax
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / command / radarmap.qc
index 9706996a4142fc196d1461fbaa8eb6dc35fb0ff8..53cab574729d7f524639222433f4fb6c1f4c3529 100644 (file)
@@ -1,3 +1,13 @@
+#include "../../common/command/command.qh"
+#include "radarmap.qh"
+#include "../_all.qh"
+
+#include "../g_world.qh"
+
+#include "../../common/util.qh"
+
+#include "../../csqcmodellib/sv_model.qh"
+
 // ===============================================
 //     Generates radar map images for use in the HUD
 // ===============================================
@@ -28,7 +38,7 @@ float FullTraceFraction(vector a, vector mi, vector ma, vector b)
                        c = trace_endpos;
                }
 
-               n += tracebox_inverted(c, mi, ma, b, MOVE_WORLDONLY, world, FALSE, world);
+               n += tracebox_inverted(c, mi, ma, b, MOVE_WORLDONLY, world, false, world);
 
                white += vlen(trace_endpos - c);
                c = trace_endpos;
@@ -142,9 +152,9 @@ float RadarMapAtPoint_Sample(float x, float y, float w, float h, float zmin, flo
        for(i = 0; i < q; ++i)
        {
                vector v;
-               v_x = a.x + random() * b.x;
-               v_y = a.y + random() * b.y;
-               v_z = a.z + random() * b.z;
+               v.x = a.x + random() * b.x;
+               v.y = a.y + random() * b.y;
+               v.z = a.z + random() * b.z;
                traceline(v, v, MOVE_WORLDONLY, world);
                if(trace_startsolid)
                        ++c;
@@ -152,11 +162,11 @@ float RadarMapAtPoint_Sample(float x, float y, float w, float h, float zmin, flo
 
        return c / q;
 }
-void sharpen_set(float x, float v)
+void sharpen_set(int x, float v)
 {
        sharpen_buffer[x + 2 * RADAR_WIDTH_MAX] = v;
 }
-float sharpen_getpixel(float x, float y)
+float sharpen_getpixel(int x, int y)
 {
        if(x < 0)
                return 0;
@@ -170,8 +180,7 @@ float sharpen_getpixel(float x, float y)
 }
 float sharpen_get(float x, float a)
 {
-       float sum;
-       sum = sharpen_getpixel(x, 1);
+       float sum = sharpen_getpixel(x, 1);
        if(a == 0)
                return sum;
        sum *= (8 + 1/a);
@@ -185,20 +194,18 @@ float sharpen_get(float x, float a)
        sum -= sharpen_getpixel(x, 2);
        return bound(0, sum * a, 1);
 }
-void sharpen_shift(float w)
+void sharpen_shift(int w)
 {
-       float i;
-       for(i = 0; i < w; ++i)
+       for(int i = 0; i < w; ++i)
        {
                sharpen_buffer[i] = sharpen_buffer[i + RADAR_WIDTH_MAX];
                sharpen_buffer[i + RADAR_WIDTH_MAX] = sharpen_buffer[i + 2 * RADAR_WIDTH_MAX];
                sharpen_buffer[i + 2 * RADAR_WIDTH_MAX] = 0;
        }
 }
-void sharpen_init(float w)
+void sharpen_init(int w)
 {
-       float i;
-       for(i = 0; i < w; ++i)
+       for(int i = 0; i < w; ++i)
        {
                sharpen_buffer[i] = 0;
                sharpen_buffer[i + RADAR_WIDTH_MAX] = 0;
@@ -419,9 +426,9 @@ float RadarMap_Make(float argc)
                if(radarmapper) // after doing the arguments, see if we successfully went forward.
                {
                        print("Radarmap entity spawned.\n");
-                       return TRUE; // if so, don't print usage.
+                       return true; // if so, don't print usage.
                }
        }
 
-       return FALSE;
+       return false;
 }