MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / RenderSubmodelLightmapFace

Function RenderSubmodelLightmapFace

model/newstyle.cpp:476–508  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

474}
475
476inline void RenderSubmodelLightmapFace(poly_model *pm, bsp_info *sm, int facenum) {
477 g3Point *pointlist[100];
478
479 polyface *fp = &sm->faces[facenum];
480 int modelnum = sm - pm->submodel;
481 int t;
482
483 int lm_handle = LightmapInfo[Polylighting_lightmap_object->lightmap_faces[modelnum][facenum].lmi_handle].lm_handle;
484 float xscalar = (float)GameLightmaps[lm_handle].width / (float)GameLightmaps[lm_handle].square_res;
485 float yscalar = (float)GameLightmaps[lm_handle].height / (float)GameLightmaps[lm_handle].square_res;
486
487 ASSERT(fp->nverts < 100);
488
489 // Setup the points for this face
490 for (t = 0; t < fp->nverts; t++) {
491 g3Point *p = &Robot_points[fp->vertnums[t]];
492 pointlist[t] = p;
493
494 p->p3_uvl.u = Polylighting_lightmap_object->lightmap_faces[modelnum][facenum].u2[t] * xscalar;
495 p->p3_uvl.v = Polylighting_lightmap_object->lightmap_faces[modelnum][facenum].v2[t] * yscalar;
496 p->p3_uvl.l = 1.0;
497
498 p->p3_flags |= PF_UV2 + PF_RGBA + PF_L;
499 }
500
501 if (triangulated_faces[facenum])
502 g3_SetTriangulationTest(1);
503
504 g3_DrawPoly(fp->nverts, pointlist, lm_handle, MAP_TYPE_LIGHTMAP);
505
506 if (triangulated_faces[facenum])
507 g3_SetTriangulationTest(0);
508}
509
510inline void RenderSubmodelFaceFogged(poly_model *pm, bsp_info *sm, int facenum) {
511 g3Point *pointlist[100];

Callers 1

Calls 2

g3_SetTriangulationTestFunction · 0.85
g3_DrawPolyFunction · 0.85

Tested by

no test coverage detected