]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
moved ixtable definition and initialization code to mathlib (and added Mathlib_Init...
authorlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 29 Oct 2001 06:30:27 +0000 (06:30 +0000)
committerlordhavoc <lordhavoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 29 Oct 2001 06:30:27 +0000 (06:30 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@967 d7cf8633-e32d-0410-b094-e92efae38249

common.c
gl_rmain.c
mathlib.c

index 22f2885bd1d7d8facc943f45af6cb9e1973615b8..4258945e5145fd9fe095b4cda379dd6354dc9b2a 100644 (file)
--- a/common.c
+++ b/common.c
@@ -1181,6 +1181,8 @@ void COM_Memstats_f(void)
 }
 
 
 }
 
 
+extern void Mathlib_Init(void);
+
 /*
 ================
 COM_Init
 /*
 ================
 COM_Init
@@ -1217,6 +1219,8 @@ void COM_Init (char *basedir)
        Cmd_AddCommand ("path", COM_Path_f);
        Cmd_AddCommand ("memstats", COM_Memstats_f);
 
        Cmd_AddCommand ("path", COM_Path_f);
        Cmd_AddCommand ("memstats", COM_Memstats_f);
 
+       Mathlib_Init();
+
        COM_InitFilesystem ();
        COM_CheckRegistered ();
 }
        COM_InitFilesystem ();
        COM_CheckRegistered ();
 }
index 2de875f70040072a23383c0b3a19a06093a12e17..f11072eb68f8b08172ad354c7dd510e7c50c0c52 100644 (file)
@@ -58,8 +58,6 @@ mleaf_t               *r_viewleaf, *r_oldviewleaf;
 
 unsigned short d_lightstylevalue[256]; // 8.8 fraction of base light value
 
 
 unsigned short d_lightstylevalue[256]; // 8.8 fraction of base light value
 
-float ixtable[4096];
-
 void R_MarkLeaves (void);
 
 //cvar_t       r_norefresh = {0, "r_norefresh","0"};
 void R_MarkLeaves (void);
 
 //cvar_t       r_norefresh = {0, "r_norefresh","0"};
@@ -267,12 +265,7 @@ void gl_main_newmap(void)
 
 void GL_Main_Init(void)
 {
 
 void GL_Main_Init(void)
 {
-       int a;
        FOG_registercvars();
        FOG_registercvars();
-       // LordHavoc: setup 1.0f / N table for quick recipricols of integers
-       ixtable[0] = 0;
-       for (a = 1;a < 4096;a++)
-               ixtable[a] = 1.0f / a;
        Cvar_RegisterVariable (&r_drawentities);
        Cvar_RegisterVariable (&r_drawviewmodel);
        Cvar_RegisterVariable (&r_speeds);
        Cvar_RegisterVariable (&r_drawentities);
        Cvar_RegisterVariable (&r_drawviewmodel);
        Cvar_RegisterVariable (&r_speeds);
index 371bfa8605b54f54671000bb3c453541a8a08268..7fdda6b3a5f22f93441f48b1a25071e71e4a2f97 100644 (file)
--- a/mathlib.c
+++ b/mathlib.c
@@ -26,6 +26,7 @@ void Sys_Error (char *error, ...);
 
 vec3_t vec3_origin = {0,0,0};
 int nanmask = 255<<23;
 
 vec3_t vec3_origin = {0,0,0};
 int nanmask = 255<<23;
+float ixtable[4096];
 
 /*-----------------------------------------------------------------*/
 
 
 /*-----------------------------------------------------------------*/
 
@@ -888,3 +889,14 @@ int GreatestCommonDivisor (int i1, int i2)
                return GreatestCommonDivisor (i1, i2 % i1);
        }
 }
                return GreatestCommonDivisor (i1, i2 % i1);
        }
 }
+
+
+void Mathlib_Init(void)
+{
+       int a;
+
+       // LordHavoc: setup 1.0f / N table for quick recipricols of integers
+       ixtable[0] = 0;
+       for (a = 1;a < 4096;a++)
+               ixtable[a] = 1.0f / a;
+}
\ No newline at end of file