mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 07:12:16 +00:00
- fixed: The portal coverage builder initialized node_t::len differently than the polyobject splitter.
This was creating quite a mess when loading savegames with both portals and polyobjects.
This commit is contained in:
parent
01983cdee1
commit
95de1faa80
1 changed files with 4 additions and 3 deletions
|
@ -187,7 +187,7 @@ struct FCoverageBuilder
|
|||
|
||||
double PartitionDistance(FCoverageVertex *vt, node_t *node)
|
||||
{
|
||||
return fabs(double(-node->dy) * (vt->x - node->x) + double(node->dx) * (vt->y - node->y)) / node->len;
|
||||
return fabs(double(-node->dy) * (vt->x - node->x) + double(node->dx) * (vt->y - node->y)) / (node->len * 65536.);
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -379,8 +379,9 @@ void gl_InitPortals()
|
|||
for(int i=0;i<numnodes;i++)
|
||||
{
|
||||
node_t *no = &nodes[i];
|
||||
double fdx = (double)no->dx;
|
||||
double fdy = (double)no->dy;
|
||||
// Must be converted because the len value is also needed for polyobjects.
|
||||
double fdx = FIXED2DBL(no->dx);
|
||||
double fdy = FIXED2DBL(no->dy);
|
||||
no->len = (float)sqrt(fdx * fdx + fdy * fdy);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue