mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-11 08:30:55 +00:00
Made attempt not to touch the _collisions registers (which are instance variables) unless the local variables imply it's potentially necessary. So that's a broad phase on collisions, I guess.
This commit is contained in:
parent
40cb1cf60d
commit
410c09cb35
@ -124,18 +124,27 @@ void Machine::get_output_pixel(uint8_t *pixel, int offset)
|
||||
}
|
||||
|
||||
// accumulate collisions
|
||||
_collisions[0] |= ((missilePixels[0] & playerPixels[1]) << 7) | ((missilePixels[0] & playerPixels[0]) << 6);
|
||||
_collisions[1] |= ((missilePixels[1] & playerPixels[0]) << 7) | ((missilePixels[1] & playerPixels[1]) << 6);
|
||||
if(playerPixels[0] | playerPixels[1])
|
||||
{
|
||||
_collisions[0] |= ((missilePixels[0] & playerPixels[1]) << 7) | ((missilePixels[0] & playerPixels[0]) << 6);
|
||||
_collisions[1] |= ((missilePixels[1] & playerPixels[0]) << 7) | ((missilePixels[1] & playerPixels[1]) << 6);
|
||||
|
||||
_collisions[2] |= ((playfieldPixel & playerPixels[0]) << 7) | ((ballPixel & playerPixels[0]) << 6);
|
||||
_collisions[3] |= ((playfieldPixel & playerPixels[1]) << 7) | ((ballPixel & playerPixels[1]) << 6);
|
||||
_collisions[2] |= ((playfieldPixel & playerPixels[0]) << 7) | ((ballPixel & playerPixels[0]) << 6);
|
||||
_collisions[3] |= ((playfieldPixel & playerPixels[1]) << 7) | ((ballPixel & playerPixels[1]) << 6);
|
||||
|
||||
_collisions[4] |= ((playfieldPixel & missilePixels[0]) << 7) | ((ballPixel & missilePixels[0]) << 6);
|
||||
_collisions[5] |= ((playfieldPixel & missilePixels[1]) << 7) | ((ballPixel & missilePixels[1]) << 6);
|
||||
_collisions[7] |= ((playerPixels[0] & playerPixels[1]) << 7);
|
||||
}
|
||||
|
||||
_collisions[6] |= ((playfieldPixel & ballPixel) << 7);
|
||||
if(playfieldPixel | ballPixel)
|
||||
{
|
||||
_collisions[4] |= ((playfieldPixel & missilePixels[0]) << 7) | ((ballPixel & missilePixels[0]) << 6);
|
||||
_collisions[5] |= ((playfieldPixel & missilePixels[1]) << 7) | ((ballPixel & missilePixels[1]) << 6);
|
||||
|
||||
_collisions[7] |= ((playerPixels[0] & playerPixels[1]) << 7) | ((missilePixels[0] & missilePixels[1]) << 6);
|
||||
_collisions[6] |= ((playfieldPixel & ballPixel) << 7);
|
||||
}
|
||||
|
||||
if(missilePixels[0] & missilePixels[1])
|
||||
_collisions[7] |= (1 << 6);
|
||||
|
||||
// apply appropriate priority to pick a colour
|
||||
playfieldPixel |= ballPixel;
|
||||
|
Loading…
x
Reference in New Issue
Block a user