diff --git a/main.cpp b/main.cpp index 7f7af16..967141f 100644 --- a/main.cpp +++ b/main.cpp @@ -136,7 +136,7 @@ void createMap() current_sector = 0; { sector s; - s.floor_height = 0.0f; + s.floor_height = 32.0f; s.ceiling_height = 128.0f; s.verts.push_back({ 64.0f, 0.0f}); @@ -162,7 +162,7 @@ void createMap() { sector s; s.floor_height = 0.0f; - s.ceiling_height = 64.0f; + s.ceiling_height = 96.0f; s.verts.push_back({256.0f, 0.0f}); s.verts.push_back({ 64.0f, 0.0f}); @@ -266,10 +266,30 @@ void drawColumn(sector &s, int screen_column, int start, int end, float a_inc, v cpix += dpix; } wall_start += upper_wall_height; + wall_height -= upper_wall_height; } } - const int wall_end = SDL_min(wall_start+wall_height+1, 240); + float lower_height = sectors[w->portal].floor_height - s.floor_height; + float lower_wall_height = (lower_height*277)/dist; + int wall_end = wall_start+wall_height+1; + if (lower_wall_height>0.0f) wall_end -= lower_wall_height; + wall_end = SDL_min(wall_end, end); + drawColumn(sectors[w->portal], screen_column, wall_start, wall_end, a_inc, infi); + + if (lower_wall_height>0.0f) + { + cpix += (wall_height-lower_wall_height)*dpix; + // Pinta la pared + for (int i=0; i=end) break; + putp(screen_column, wall_end+i, gif[(int(v)%tex_height)+int(cpix)*tex_height]); + cpix += dpix; + } + //wall_start += upper_wall_height; + //wall_height -= upper_wall_height; + } + } // Pinta el piso