mirror of
https://github.com/holub/mame
synced 2025-05-06 22:35:43 +03:00
fixed zsort
This commit is contained in:
parent
c0d907ee42
commit
36b8d751c4
@ -9,12 +9,7 @@
|
|||||||
* - tokyowar tanks are not shootable, same for timecris helicopter,
|
* - tokyowar tanks are not shootable, same for timecris helicopter,
|
||||||
* there's still a very small hitbox but almost impossible to hit
|
* there's still a very small hitbox but almost impossible to hit
|
||||||
* (is this related to video board? or cpu?)
|
* (is this related to video board? or cpu?)
|
||||||
* - sort for polys/sprites with same z value, things to look out for:
|
* - window clipping (acedrvrw, victlapw)
|
||||||
* + ridgerac race start countdown currently bad
|
|
||||||
* + ridgerac selection screen currently almost ok
|
|
||||||
* + propcycl scoreboard poly <-> poly currently ok
|
|
||||||
* + propcycl scoreboard poly <-> sprite currently ok
|
|
||||||
* + timecris sprites (eg. photos in attract mode) currently ok
|
|
||||||
* - spot
|
* - spot
|
||||||
*
|
*
|
||||||
* - spritelayer:
|
* - spritelayer:
|
||||||
@ -850,10 +845,11 @@ static struct SceneNode *
|
|||||||
NewSceneNode( running_machine &machine, UINT32 zsortvalue24, SceneNodeType type )
|
NewSceneNode( running_machine &machine, UINT32 zsortvalue24, SceneNodeType type )
|
||||||
{
|
{
|
||||||
struct SceneNode *node = &mSceneRoot;
|
struct SceneNode *node = &mSceneRoot;
|
||||||
int i;
|
struct SceneNode *prev = NULL;
|
||||||
|
int i, hash = 0;
|
||||||
for( i=0; i<24; i+=RADIX_BITS )
|
for( i=0; i<24; i+=RADIX_BITS )
|
||||||
{
|
{
|
||||||
int hash = (zsortvalue24>>20)&RADIX_MASK;
|
hash = (zsortvalue24>>20)&RADIX_MASK;
|
||||||
struct SceneNode *next = node->data.nonleaf.next[hash];
|
struct SceneNode *next = node->data.nonleaf.next[hash];
|
||||||
if( !next )
|
if( !next )
|
||||||
{ /* lazily allocate tree node for this radix */
|
{ /* lazily allocate tree node for this radix */
|
||||||
@ -861,6 +857,7 @@ NewSceneNode( running_machine &machine, UINT32 zsortvalue24, SceneNodeType type
|
|||||||
next->type = eSCENENODE_NONLEAF;
|
next->type = eSCENENODE_NONLEAF;
|
||||||
node->data.nonleaf.next[hash] = next;
|
node->data.nonleaf.next[hash] = next;
|
||||||
}
|
}
|
||||||
|
prev = node;
|
||||||
node = next;
|
node = next;
|
||||||
zsortvalue24 <<= RADIX_BITS;
|
zsortvalue24 <<= RADIX_BITS;
|
||||||
}
|
}
|
||||||
@ -874,16 +871,8 @@ NewSceneNode( running_machine &machine, UINT32 zsortvalue24, SceneNodeType type
|
|||||||
{
|
{
|
||||||
struct SceneNode *leaf = MallocSceneNode(machine);
|
struct SceneNode *leaf = MallocSceneNode(machine);
|
||||||
leaf->type = type;
|
leaf->type = type;
|
||||||
|
leaf->nextInBucket = node;
|
||||||
// give sprites priority over polys (eg. propcycl scoreboard)
|
prev->data.nonleaf.next[hash] = leaf;
|
||||||
if (type == eSCENENODE_SPRITE)
|
|
||||||
{
|
|
||||||
while (node->nextInBucket && node->type != eSCENENODE_SPRITE)
|
|
||||||
node = node->nextInBucket;
|
|
||||||
}
|
|
||||||
leaf->nextInBucket = node->nextInBucket;
|
|
||||||
node->nextInBucket = leaf;
|
|
||||||
|
|
||||||
return leaf;
|
return leaf;
|
||||||
}
|
}
|
||||||
} /* NewSceneNode */
|
} /* NewSceneNode */
|
||||||
@ -2443,8 +2432,8 @@ SCREEN_UPDATE( namcos22s )
|
|||||||
// layers
|
// layers
|
||||||
UINT8 layer = nthbyte(state->m_gamma,0x1f);
|
UINT8 layer = nthbyte(state->m_gamma,0x1f);
|
||||||
if (layer&4) DrawCharacterLayer(screen->machine(), bitmap, cliprect);
|
if (layer&4) DrawCharacterLayer(screen->machine(), bitmap, cliprect);
|
||||||
if (layer&1) DrawPolygons(screen->machine(), bitmap);
|
|
||||||
if (layer&2) DrawSprites(screen->machine(), bitmap, cliprect);
|
if (layer&2) DrawSprites(screen->machine(), bitmap, cliprect);
|
||||||
|
if (layer&1) DrawPolygons(screen->machine(), bitmap);
|
||||||
RenderScene(screen->machine(), bitmap );
|
RenderScene(screen->machine(), bitmap );
|
||||||
if (layer&4) namcos22s_mix_textlayer(screen->machine(), bitmap, cliprect, 6);
|
if (layer&4) namcos22s_mix_textlayer(screen->machine(), bitmap, cliprect, 6);
|
||||||
ApplyGamma(screen->machine(), bitmap);
|
ApplyGamma(screen->machine(), bitmap);
|
||||||
|
Loading…
Reference in New Issue
Block a user