Skip to content

Commit

Permalink
Pushed AJBSP self-ref line fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dashodanger committed Oct 6, 2023
1 parent e334bbc commit 4649c94
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,5 @@ Bugs fixed
- Fixed assertion failure when referencing DSDehacked frames past the last frame explicitly defined in the [CODEPTR] section
- Fixed viewpoint modified by the r_fov CVAR not changing the vertical view slope appropriately
- Fixed region properties not working properly with a vertex sloped floor that rises above its sector's original floor height
- Fixed occasional sector glow thing link/unlink errors
- Fixed occasional sector glow thing link/unlink errors
- Fixed AJBSP using self-referencing linedefs that were perfectly vertical or horizontal for partitioning
8 changes: 7 additions & 1 deletion source_files/ajbsp/bsp_level.cc
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ void GetLinedefs()
s16_t tag = LE_S16(raw.tag);

line->two_sided = (flags & MLF_TwoSided) != 0;
line->is_precious = (tag >= 900 && tag < 1000);
line->is_precious = (tag >= 900 && tag < 1000); // Why is this the case? Need to investigate - Dasho

line->right = SafeLookupSidedef(LE_U16(raw.right));
line->left = SafeLookupSidedef(LE_U16(raw.left));
Expand All @@ -682,6 +682,8 @@ void GetLinedefs()

line->self_ref = (line->left && line->right &&
(line->left->sector == line->right->sector));

if (line->self_ref) line->is_precious = true;
}
}

Expand Down Expand Up @@ -744,6 +746,8 @@ void GetLinedefsHexen()

line->self_ref = (line->left && line->right &&
(line->left->sector == line->right->sector));

if (line->self_ref) line->is_precious = true;
}
}

Expand Down Expand Up @@ -930,6 +934,8 @@ void ParseUDMF_Block(epi::lexer_c& lex, int cur_type)

line->self_ref = (line->left && line->right &&
(line->left->sector == line->right->sector));

if (line->self_ref) line->is_precious = true;
}
}

Expand Down
4 changes: 4 additions & 0 deletions source_files/ajbsp/bsp_node.cc
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,10 @@ void EvaluateFastWorker(quadtree_c *tree,
if (part->linedef == NULL)
continue;

/* ignore self-ref and polyobj stuff as partition candidates */
if (part->linedef->is_precious)
continue;

if (AlmostEquals(part->pdy, 0.0))
{
// horizontal seg
Expand Down
12 changes: 11 additions & 1 deletion source_files/edge/l_ajbsp.cc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,17 @@ class ec_buildinfo_t : public buildinfo_t

void Debug(const char *fmt, ...)
{
(void) fmt;
va_list arg_ptr;

static char buffer[MSG_BUF_LEN];

va_start(arg_ptr, fmt);
vsnprintf(buffer, MSG_BUF_LEN-1, fmt, arg_ptr);
va_end(arg_ptr);

buffer[MSG_BUF_LEN-1] = 0;

I_Debugf("%s\n", buffer);
}

void ShowMap(const char *name)
Expand Down

0 comments on commit 4649c94

Please sign in to comment.