Simplify draw_tmap interpolation
Prior changes removed most of what made the switch branches distinct. Capitalize on that to combine identical code paths.
This commit is contained in:
parent
c786e34ec7
commit
8633b85ee4
|
@ -847,47 +847,19 @@ void draw_tmap(grs_canvas &canvas, const grs_bitmap &rbp, uint_fast32_t nverts,
|
||||||
Lighting_enabled = Lighting_on;
|
Lighting_enabled = Lighting_on;
|
||||||
|
|
||||||
// Now, call my texture mapper.
|
// Now, call my texture mapper.
|
||||||
if (Lighting_on) {
|
|
||||||
switch (Interpolation_method) { // 0 = choose, 1 = linear, 2 = /8 perspective, 3 = full perspective
|
switch (Interpolation_method) { // 0 = choose, 1 = linear, 2 = /8 perspective, 3 = full perspective
|
||||||
case 0: // choose best interpolation
|
case 0: // choose best interpolation
|
||||||
if (Current_seg_depth > Max_perspective_depth)
|
if (Current_seg_depth > Max_perspective_depth)
|
||||||
|
case 1: // linear interpolation
|
||||||
ntexture_map_lighted_linear(*bp, Tmap1);
|
ntexture_map_lighted_linear(*bp, Tmap1);
|
||||||
else
|
else
|
||||||
|
case 2: // perspective every 8th pixel interpolation
|
||||||
|
case 3: // perspective every pixel interpolation
|
||||||
ntexture_map_lighted(*bp, Tmap1);
|
ntexture_map_lighted(*bp, Tmap1);
|
||||||
break;
|
break;
|
||||||
case 1: // linear interpolation
|
|
||||||
ntexture_map_lighted_linear(*bp, Tmap1);
|
|
||||||
break;
|
|
||||||
case 2: // perspective every 8th pixel interpolation
|
|
||||||
ntexture_map_lighted(*bp, Tmap1);
|
|
||||||
break;
|
|
||||||
case 3: // perspective every pixel interpolation
|
|
||||||
ntexture_map_lighted(*bp, Tmap1);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
Assert(0); // Illegal value for Interpolation_method, must be 0,1,2,3
|
Assert(0); // Illegal value for Interpolation_method, must be 0,1,2,3
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
switch (Interpolation_method) { // 0 = choose, 1 = linear, 2 = /8 perspective, 3 = full perspective
|
|
||||||
case 0: // choose best interpolation
|
|
||||||
if (Current_seg_depth > Max_perspective_depth)
|
|
||||||
ntexture_map_lighted_linear(*bp, Tmap1);
|
|
||||||
else
|
|
||||||
ntexture_map_lighted(*bp, Tmap1);
|
|
||||||
break;
|
|
||||||
case 1: // linear interpolation
|
|
||||||
ntexture_map_lighted_linear(*bp, Tmap1);
|
|
||||||
break;
|
|
||||||
case 2: // perspective every 8th pixel interpolation
|
|
||||||
ntexture_map_lighted(*bp, Tmap1);
|
|
||||||
break;
|
|
||||||
case 3: // perspective every pixel interpolation
|
|
||||||
ntexture_map_lighted(*bp, Tmap1);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
Assert(0); // Illegal value for Interpolation_method, must be 0,1,2,3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Lighting_on = lighting_on_save;
|
Lighting_on = lighting_on_save;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue