Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
hzqst committed Jan 21, 2024
1 parent b74c76b commit a8e98c4
Showing 1 changed file with 8 additions and 39 deletions.
47 changes: 8 additions & 39 deletions Plugins/Renderer/gl_rsurf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -325,31 +325,16 @@ void GL_BuildLightmaps(void)
for (int i = 0; i < mod->numsurfaces; i++)
{
//Allocate lightmap texture from empty slot
if (g_iEngineType == ENGINE_GOLDSRC_HL25)
{
auto surf = ((msurface_hl25_t*)mod->surfaces) + i;
auto surf = R_GetWorldSurfaceByIndex(i);

R_AllocateSurfaceLightmap(mod, surf);
//Allocate blocks
R_AllocateSurfaceLightmap(mod, surf);

//Build glpolys
if (!(surf->flags & SURF_DRAWTURB))
{
R_BuildSurfaceDisplayList(mod, mod->vertexes, surf);
}
}
else
//Build glpolys from blocks
if (!(surf->flags & SURF_DRAWTURB))
{
auto surf = mod->surfaces + i;

R_AllocateSurfaceLightmap(mod, surf);

//Build glpolys
if (!(surf->flags & SURF_DRAWTURB))
{
R_BuildSurfaceDisplayList(mod, mod->vertexes, surf);
}
R_BuildSurfaceDisplayList(mod, mod->vertexes, surf);
}

}
}
}
Expand Down Expand Up @@ -382,16 +367,7 @@ void GL_BuildLightmaps(void)
{
//Fill lightmap color bytes into lightmaps[]

msurface_t* surf;

if (g_iEngineType == ENGINE_GOLDSRC_HL25)
{
surf = (((msurface_hl25_t*)mod->surfaces) + i);
}
else
{
surf = mod->surfaces + i;
}
auto surf = R_GetWorldSurfaceByIndex(i);

R_BuildSurfaceLightmap(mod, surf, lightmap_idx);
}
Expand Down Expand Up @@ -467,14 +443,7 @@ colorVec RecursiveLightPoint(mbasenode_t *basenode, vec3_t start, vec3_t end)

for (i = 0; i < node->numsurfaces; i++)
{
if (g_iEngineType == ENGINE_GOLDSRC_HL25)
{
surf = (((msurface_hl25_t*)r_worldmodel->surfaces) + node->firstsurface + i);
}
else
{
surf = r_worldmodel->surfaces + node->firstsurface + i;
}
auto surf = R_GetWorldSurfaceByIndex(node->firstsurface + i);

if (surf->flags & SURF_DRAWTILED)
continue;
Expand Down

0 comments on commit a8e98c4

Please sign in to comment.