]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - pr_edict.c
changed protocol back to using float coordinates, unless the mod specifies EF_LOWPREC...
[xonotic/darkplaces.git] / pr_edict.c
index dc4166ad8647e50406ff86cb71a499a1c6186532..78fd1176347a3bae46999121973ba48ee566896b 100644 (file)
@@ -116,6 +116,7 @@ int eval_ping;
 int eval_movement;
 int eval_pmodel;
 int eval_punchvector;
+int eval_viewzoom;
 
 dfunction_t *SV_PlayerPhysicsQC;
 dfunction_t *EndFrameQC;
@@ -164,6 +165,7 @@ void FindEdictFieldOffsets(void)
        eval_movement = FindFieldOffset("movement");
        eval_pmodel = FindFieldOffset("pmodel");
        eval_punchvector = FindFieldOffset("punchvector");
+       eval_viewzoom = FindFieldOffset("viewzoom");
 
        // LordHavoc: allowing QuakeC to override the player movement code
        SV_PlayerPhysicsQC = ED_FindFunction ("SV_PlayerPhysics");
@@ -577,7 +579,7 @@ void ED_Print (edict_t *ed)
                name = pr_strings + d->s_name;
                if (name[strlen(name)-2] == '_')
                        continue;       // skip _x, _y, _z vars
-                       
+
                v = (int *)((char *)&ed->v + d->ofs*4);
 
        // if the value is still all 0, skip the field
@@ -683,7 +685,7 @@ For debugging, prints all the entities in the current server
 void ED_PrintEdicts (void)
 {
        int             i;
-       
+
        Con_Printf ("%i entities\n", sv.num_edicts);
        for (i=0 ; i<sv.num_edicts ; i++)
                ED_PrintNum (i);
@@ -699,7 +701,7 @@ For debugging, prints a single edicy
 void ED_PrintEdict_f (void)
 {
        int             i;
-       
+
        i = atoi (Cmd_Argv(1));
        if (i >= sv.num_edicts)
        {
@@ -1202,7 +1204,7 @@ void PR_LoadProgs (void)
 
        Con_DPrintf ("Programs occupy %iK.\n", com_filesize/1024);
 
-       pr_crc = CRC_Block((byte *)progs, com_filesize);
+       pr_crc = CRC_Block((qbyte *)progs, com_filesize);
 
 // byte swap the header
        for (i=0 ; i<sizeof(*progs)/4 ; i++)
@@ -1213,20 +1215,20 @@ void PR_LoadProgs (void)
        if (progs->crc != PROGHEADER_CRC)
                Host_Error ("progs.dat system vars have been modified, progdefs.h is out of date");
 
-       pr_functions = (dfunction_t *)((byte *)progs + progs->ofs_functions);
+       pr_functions = (dfunction_t *)((qbyte *)progs + progs->ofs_functions);
        pr_strings = (char *)progs + progs->ofs_strings;
-       pr_globaldefs = (ddef_t *)((byte *)progs + progs->ofs_globaldefs);
+       pr_globaldefs = (ddef_t *)((qbyte *)progs + progs->ofs_globaldefs);
 
        // we need to expand the fielddefs list to include all the engine fields,
        // so allocate a new place for it
-       infielddefs = (ddef_t *)((byte *)progs + progs->ofs_fielddefs);
+       infielddefs = (ddef_t *)((qbyte *)progs + progs->ofs_fielddefs);
        pr_fielddefs = Mem_Alloc(progs_mempool, (progs->numfielddefs + DPFIELDS) * sizeof(ddef_t));
 
-       pr_statements = (dstatement_t *)((byte *)progs + progs->ofs_statements);
+       pr_statements = (dstatement_t *)((qbyte *)progs + progs->ofs_statements);
 
        // moved edict_size calculation down below field adding code
 
-       pr_global_struct = (globalvars_t *)((byte *)progs + progs->ofs_globals);
+       pr_global_struct = (globalvars_t *)((qbyte *)progs + progs->ofs_globals);
        pr_globals = (float *)pr_global_struct;
 
 // byte swap the lumps
@@ -1475,7 +1477,7 @@ edict_t *EDICT_NUM(int n)
 {
        if (n < 0 || n >= sv.max_edicts)
                Sys_Error ("EDICT_NUM: bad number %i", n);
-       return (edict_t *)((byte *)sv.edicts+ (n)*pr_edict_size);
+       return (edict_t *)((qbyte *)sv.edicts+ (n)*pr_edict_size);
 }
 */
 
@@ -1483,7 +1485,7 @@ int NUM_FOR_EDICT(edict_t *e)
 {
        int             b;
 
-       b = (byte *)e - (byte *)sv.edicts;
+       b = (qbyte *)e - (qbyte *)sv.edicts;
        b = b / pr_edict_size;
 
        if (b < 0 || b >= sv.num_edicts)
@@ -1495,7 +1497,7 @@ int NoCrash_NUM_FOR_EDICT(edict_t *e)
 {
        int             b;
 
-       b = (byte *)e - (byte *)sv.edicts;
+       b = (qbyte *)e - (qbyte *)sv.edicts;
        b = b / pr_edict_size;
        return b;
 }