- [NEW] Ja pinta pareds amb transparències, pero sense correcció de perspectiva.
This commit is contained in:
35
main.cpp
35
main.cpp
@@ -392,16 +392,16 @@ void drawColumn(sector &s, int screen_column, int start, int end, float a_inc, v
|
||||
float tex_height = (surf->h*FOV)/dist; // [64=altura sector]
|
||||
if (triggers::isEnabled("offsets")) cpix += tex_height * w->w1 * dpix;
|
||||
if (surf) {
|
||||
for (int i=0; i<wall_height; ++i) {
|
||||
if (wall_start+i>=end) break;
|
||||
float light_dist = 1.0f - (dist>light_zoom ? 1.0f : dist/light_zoom);
|
||||
float light = 1.0f - (light_dist*s.light);
|
||||
uint8_t pixcolor = surf->pixels[(int(v)%surf->w)+(int(cpix)%surf->h)*surf->w];
|
||||
pixcolor = colormap[pixcolor + int(light*31)*256];
|
||||
draw::putpd(screen_column, wall_start+i, pixcolor, stright_dist);
|
||||
cpix += dpix;
|
||||
for (int i=0; i<wall_height; ++i) {
|
||||
if (wall_start+i>=end) break;
|
||||
float light_dist = 1.0f - (dist>light_zoom ? 1.0f : dist/light_zoom);
|
||||
float light = 1.0f - (light_dist*s.light);
|
||||
uint8_t pixcolor = surf->pixels[(int(v)%surf->w)+(int(cpix)%surf->h)*surf->w];
|
||||
pixcolor = colormap[pixcolor + int(light*31)*256];
|
||||
draw::putpd(screen_column, wall_start+i, pixcolor, stright_dist);
|
||||
cpix += dpix;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if ((sectors[w->portal].ceiling_height < s.ceiling_height) && sectors[w->portal].ceil_surf)
|
||||
{
|
||||
@@ -443,6 +443,22 @@ void drawColumn(sector &s, int screen_column, int start, int end, float a_inc, v
|
||||
}
|
||||
drawColumn(sectors[w->portal], screen_column, wall_start, wall_end, a_inc, result, infi);
|
||||
|
||||
// Pinta la pared semitransparent
|
||||
draw::surface_t *surf = w->surf;
|
||||
if (surf) {
|
||||
float tex_height = (surf->h*FOV)/dist; // [64=altura sector]
|
||||
if (triggers::isEnabled("offsets")) cpix += tex_height * w->w1 * dpix;
|
||||
for (int i=0; i<wall_height; ++i) {
|
||||
if (wall_start+i>=end) break;
|
||||
float light_dist = 1.0f - (dist>light_zoom ? 1.0f : dist/light_zoom);
|
||||
float light = 1.0f - (light_dist*s.light);
|
||||
uint8_t pixcolor = surf->pixels[(int(v)%surf->w)+(int(cpix)%surf->h)*surf->w];
|
||||
pixcolor = colormap[pixcolor + int(light*31)*256];
|
||||
draw::putps(screen_column, wall_start+i, pixcolor, stright_dist);
|
||||
cpix += dpix;
|
||||
}
|
||||
}
|
||||
|
||||
if (lower_wall_height>0.0f)
|
||||
{
|
||||
cpix += (wall_height-lower_wall_height)*dpix;
|
||||
@@ -461,6 +477,7 @@ void drawColumn(sector &s, int screen_column, int start, int end, float a_inc, v
|
||||
//wall_height -= upper_wall_height;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Pinta el piso
|
||||
|
||||
Reference in New Issue
Block a user