MCPcopy Create free account
hub / github.com/demoth/jake2 / R_DrawWorld

Method R_DrawWorld

client/src/main/java/jake2/client/render/fast/Surf.java:868–926  ·  view source on GitHub ↗

R_DrawWorld

()

Source from the content-addressed store, hash-verified

866 * R_DrawWorld
867 */
868 void R_DrawWorld()
869 {
870 if (r_drawworld.value == 0)
871 return;
872
873 if ( (r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) != 0 )
874 return;
875
876 currentmodel = r_worldmodel;
877
878 Math3D.VectorCopy(r_newrefdef.vieworg, modelorg);
879
880 entity_t ent = worldEntity;
881 // auto cycle the world frame for texture animation
882 ent.clear();
883 ent.frame = (int)(r_newrefdef.time*2);
884 currententity = ent;
885
886 gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1;
887
888 gl.glColor3f (1,1,1);
889 // memset (gl_lms.lightmap_surfaces, 0, sizeof(gl_lms.lightmap_surfaces));
890 // TODO wird bei multitexture nicht gebraucht
891 //gl_lms.clearLightmapSurfaces();
892
893 R_ClearSkyBox();
894
895 GL_EnableMultitexture( true );
896
897 GL_SelectTexture(TEXTURE0);
898 GL_TexEnv( GL_REPLACE );
899 gl.glInterleavedArrays(GL_T2F_V3F, glpoly_t.BYTE_STRIDE, globalPolygonInterleavedBuf);
900 GL_SelectTexture(TEXTURE1);
901 gl.glTexCoordPointer(2, glpoly_t.BYTE_STRIDE, globalPolygonTexCoord1Buf);
902 gl.glEnableClientState(GL_TEXTURE_COORD_ARRAY);
903
904 if ( gl_lightmap.value != 0)
905 GL_TexEnv( GL_REPLACE );
906 else
907 GL_TexEnv( GL_MODULATE );
908
909 R_RecursiveWorldNode(r_worldmodel.nodes[0]); // root node
910
911 gl.glClientActiveTextureARB(TEXTURE1);
912 gl.glDisableClientState(GL_TEXTURE_COORD_ARRAY);
913
914 GL_EnableMultitexture( false );
915
916 DrawTextureChains();
917 R_DrawSkyBox();
918 R_DrawTriangleOutlines();
919
920 // delete triangles
921 if (gl_showtrisnum.value != 0 && gl_showtris.value != 0)
922 {
923 Com.DPrintf("num triangles: " + polys.size() + "\n");
924 }
925 polys = new Vector();

Callers

nothing calls this directly

Calls 15

VectorCopyMethod · 0.95
clearMethod · 0.95
R_ClearSkyBoxMethod · 0.95
R_RecursiveWorldNodeMethod · 0.95
DrawTextureChainsMethod · 0.95
R_DrawSkyBoxMethod · 0.95
DPrintfMethod · 0.95
GL_EnableMultitextureMethod · 0.80
GL_SelectTextureMethod · 0.80
sizeMethod · 0.80
glColor3fMethod · 0.65

Tested by

no test coverage detected