Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.97 KB | None | 0 0
  1. diff --git a/src/client/renderer/r_material.c b/src/client/renderer/r_material.c
  2. index a1af9d0..9a19b7d 100644
  3. --- a/src/client/renderer/r_material.c
  4. +++ b/src/client/renderer/r_material.c
  5. @@ -128,6 +128,7 @@ static void R_StageLighting (const mBspSurface_t *surf, const materialStage_t *s
  6. (stage->flags & (STAGE_LIGHTMAP | STAGE_LIGHTING))) {
  7. R_EnableTexture(&texunit_lightmap, qtrue);
  8. R_BindLightmapTexture(surf->lightmap_texnum);
  9. + R_BindDeluxemapTexture(surf->deluxemap_texnum);
  10.  
  11. /* hardware lighting */
  12. if ((stage->flags & STAGE_LIGHTING)) {
  13. diff --git a/src/client/renderer/r_surface.c b/src/client/renderer/r_surface.c
  14. index c0a0680..49369b2 100644
  15. --- a/src/client/renderer/r_surface.c
  16. +++ b/src/client/renderer/r_surface.c
  17. @@ -39,15 +39,12 @@ void R_SetSurfaceBumpMappingParameters (const mBspSurface_t *surf, const image_t
  18.  
  19. assert(surf);
  20.  
  21. - if (normalMap && (surf->flags & MSURF_LIGHTMAP)) {
  22. - const image_t *image = surf->texinfo->image;
  23. - R_BindDeluxemapTexture(surf->deluxemap_texnum);
  24. + if (normalMap)
  25. R_EnableBumpmap(normalMap, qtrue);
  26. - R_UseMaterial(&image->material);
  27. - } else {
  28. + else
  29. R_EnableBumpmap(NULL, qfalse);
  30. - R_UseMaterial(NULL);
  31. - }
  32. +
  33. + R_UseMaterial(&image->material);
  34. }
  35.  
  36. /**
  37. @@ -79,8 +76,10 @@ static void R_SetSurfaceState (const mBspSurface_t *surf)
  38. R_BindTexture(image->texnum); /* texture */
  39.  
  40. if (texunit_lightmap.enabled) { /* lightmap */
  41. - if (surf->flags & MSURF_LIGHTMAP)
  42. + if (surf->flags & MSURF_LIGHTMAP) {
  43. R_BindLightmapTexture(surf->lightmap_texnum);
  44. + R_BindDeluxemapTexture(surf->deluxemap_texnum);
  45. + }
  46. }
  47.  
  48. R_SetSurfaceBumpMappingParameters(surf, image->normalmap);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement