mirror of
https://github.com/holub/mame
synced 2025-06-03 19:36:26 +03:00
model2.cpp: workaround hardlocks in fvipers and schamp (nw)
This commit is contained in:
parent
231aa2cfa9
commit
e2635c9e94
@ -91,6 +91,7 @@
|
||||
#include "video/segaic24.h"
|
||||
#include "includes/model2.h"
|
||||
|
||||
#include <cmath>
|
||||
|
||||
#define pz p[0]
|
||||
#define pu p[1]
|
||||
@ -213,7 +214,10 @@ static int32_t clip_polygon(poly_vertex *v, int32_t num_vertices, plane *cp, pol
|
||||
nextin = (nextdot >= cp->distance) ? 1 : 0;
|
||||
|
||||
/* Add a clipped vertex if one end of the current edge is inside the plane and the other is outside */
|
||||
if ( curin != nextin )
|
||||
// TODO: displaying Honey in Fighting Vipers and Bean in Sonic the Fighters somehow causes a NaN dot product here,
|
||||
// causing MAME to hardlock in the renderer routine. They are also causing lots of invalid polygon renders
|
||||
// which might be related.
|
||||
if ( curin != nextin && std::isnan(curdot) == false && std::isnan(nextdot) == false )
|
||||
{
|
||||
scale = (cp->distance - curdot) / (nextdot - curdot);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user