mirror of
https://github.com/holub/mame
synced 2025-06-02 02:49:44 +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);
|
||||
|
||||
@ -1946,7 +1950,7 @@ static uint32_t * geo_object_data( geo_state *geo, uint32_t opcode, uint32_t *in
|
||||
// Virtual On & Gunblade NY
|
||||
if(obc == 0)
|
||||
obc = 0xfffff;
|
||||
|
||||
|
||||
switch( geo->mode & 3 )
|
||||
{
|
||||
/* Normals present, No Specular */
|
||||
|
Loading…
Reference in New Issue
Block a user