From 8f834a6c1f0310ac8c49c18ccc1bbe7d66cad68e Mon Sep 17 00:00:00 2001 From: Raimon Zamora Date: Sun, 28 Sep 2025 14:52:24 +0200 Subject: [PATCH] =?UTF-8?q?-=20Ja=20funciona=20tamb=C3=A9=20que=20cada=20s?= =?UTF-8?q?ector=20tinga=20una=20altura=20de=20piso=20diferent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) 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