]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - clvm_cmds.c
implemented .loc file support, including some editing (add command, and removenearest...
[xonotic/darkplaces.git] / clvm_cmds.c
index 43ca54ad9203899025b7d21636c881516d4d28bf..03f3fe911b626e10c727dcaecd21697307a501b1 100644 (file)
@@ -758,25 +758,13 @@ static void VM_CL_R_SetView (void)
        PRVM_G_FLOAT(OFS_RETURN) = 1;
 }
 
-extern void CL_UpdateNetworkEntity(entity_t *e, int recursionlimit);
 //#304 void() renderscene (EXT_CSQC)
 static void VM_CL_R_RenderScene (void)
 {
-       int i;
        VM_SAFEPARMCOUNT(0, VM_CL_R_RenderScene);
        // we need to update any RENDER_VIEWMODEL entities at this point because
        // csqc supplies its own view matrix
-       for (i = 1;i < cl.num_entities;i++)
-       {
-               if (cl.entities_active[i])
-               {
-                       entity_t *ent = cl.entities + i;
-                       if ((ent->render.flags & RENDER_VIEWMODEL) || ent->state_current.tagentity)
-                               CL_UpdateNetworkEntity(ent, 32);
-               }
-       }
-       // and of course the engine viewmodel needs updating as well
-       CL_UpdateNetworkEntity(&cl.viewent, 32);
+       CL_UpdateViewEntities();
        // now draw stuff!
        R_RenderView();
 }
@@ -1205,19 +1193,11 @@ static void VM_CL_makestatic (void)
                        Matrix4x4_CreateFromQuakeEntity(&staticent->render.matrix, ent->fields.client->origin[0], ent->fields.client->origin[1], ent->fields.client->origin[2], ent->fields.client->angles[0], ent->fields.client->angles[1], ent->fields.client->angles[2], staticent->render.scale);
                CL_UpdateRenderEntity(&staticent->render);
 
-               // transparent stuff can't be lit during the opaque stage
-               if (staticent->render.effects & (EF_ADDITIVE | EF_NODEPTHTEST) || staticent->render.alpha < 1)
-                       staticent->render.flags |= RENDER_TRANSPARENT;
-               // double sided rendering mode causes backfaces to be visible
-               // (mostly useful on transparent stuff)
-               if (staticent->render.effects & EF_DOUBLESIDED)
-                       staticent->render.flags |= RENDER_NOCULLFACE;
                // either fullbright or lit
                if (!(staticent->render.effects & EF_FULLBRIGHT) && !r_fullbright.integer)
                        staticent->render.flags |= RENDER_LIGHT;
                // turn off shadows from transparent objects
-               if (!(staticent->render.effects & EF_NOSHADOW)
-                && !(staticent->render.flags & RENDER_TRANSPARENT))
+               if (!(staticent->render.effects & (EF_NOSHADOW | EF_ADDITIVE | EF_NODEPTHTEST)) && (staticent->render.alpha >= 1))
                        staticent->render.flags |= RENDER_SHADOW;
        }
        else