mirror of
https://github.com/TomHarte/CLK.git
synced 2024-11-03 08:05:40 +00:00
Disabled incorrect 'optimisations'.
This commit is contained in:
parent
e00339ef0a
commit
51bcaea60c
@ -654,8 +654,6 @@ void TIA::draw_player_visible(Player &player, CollisionType collision_identity,
|
|||||||
int adder = 4 >> player.size;
|
int adder = 4 >> player.size;
|
||||||
|
|
||||||
// perform a miniature event loop on (i) triggering draws; (ii) drawing; and (iii) motion
|
// perform a miniature event loop on (i) triggering draws; (ii) drawing; and (iii) motion
|
||||||
// if(is_moving_[position_identity] || player.graphic[player.graphic_index])
|
|
||||||
// {
|
|
||||||
int next_motion_time = motion_time_[position_identity] - first_pixel_cycle + 4;
|
int next_motion_time = motion_time_[position_identity] - first_pixel_cycle + 4;
|
||||||
while(start < end)
|
while(start < end)
|
||||||
{
|
{
|
||||||
@ -669,8 +667,6 @@ void TIA::draw_player_visible(Player &player, CollisionType collision_identity,
|
|||||||
|
|
||||||
// is the next event a graphics trigger?
|
// is the next event a graphics trigger?
|
||||||
int next_copy = 160;
|
int next_copy = 160;
|
||||||
if(player.graphic[player.graphic_index])
|
|
||||||
{
|
|
||||||
if(position < 16 && player.copy_flags&1)
|
if(position < 16 && player.copy_flags&1)
|
||||||
{
|
{
|
||||||
next_copy = 16;
|
next_copy = 16;
|
||||||
@ -684,7 +680,6 @@ void TIA::draw_player_visible(Player &player, CollisionType collision_identity,
|
|||||||
|
|
||||||
int next_copy_time = start + next_copy - position;
|
int next_copy_time = start + next_copy - position;
|
||||||
if(next_copy_time < next_event_time) next_event_time = next_copy_time;
|
if(next_copy_time < next_event_time) next_event_time = next_copy_time;
|
||||||
}
|
|
||||||
|
|
||||||
// the decision is to progress by length
|
// the decision is to progress by length
|
||||||
const int length = next_event_time - start;
|
const int length = next_event_time - start;
|
||||||
@ -692,6 +687,8 @@ void TIA::draw_player_visible(Player &player, CollisionType collision_identity,
|
|||||||
if(player.pixel_position < 32)
|
if(player.pixel_position < 32)
|
||||||
{
|
{
|
||||||
player.pixel_position &= ~(adder - 1);
|
player.pixel_position &= ~(adder - 1);
|
||||||
|
if(player.graphic[player.graphic_index])
|
||||||
|
{
|
||||||
int output_cursor = 0;
|
int output_cursor = 0;
|
||||||
while(player.pixel_position < 32 && output_cursor < length)
|
while(player.pixel_position < 32 && output_cursor < length)
|
||||||
{
|
{
|
||||||
@ -701,6 +698,11 @@ void TIA::draw_player_visible(Player &player, CollisionType collision_identity,
|
|||||||
player.pixel_position += adder;
|
player.pixel_position += adder;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
player.pixel_position = std::max(32, player.pixel_position + length * adder);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// the next interesting event is after next_event_time cycles, so progress
|
// the next interesting event is after next_event_time cycles, so progress
|
||||||
position = (position + length) % 160;
|
position = (position + length) % 160;
|
||||||
@ -714,19 +716,11 @@ void TIA::draw_player_visible(Player &player, CollisionType collision_identity,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if it's a draw trigger, trigger a draw
|
// if it's a draw trigger, trigger a draw
|
||||||
if(position == (next_copy % 160))
|
if(start == next_copy_time)
|
||||||
{
|
{
|
||||||
player.pixel_position = 0;
|
player.pixel_position = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// }
|
|
||||||
// else
|
|
||||||
// {
|
|
||||||
// // just advance the timer all in one jump
|
|
||||||
// const int length = end - start;
|
|
||||||
// position = (position + length) % 160;
|
|
||||||
// player.pixel_position = std::min(32, player.pixel_position + adder * length);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TIA::draw_player(Player &player, CollisionType collision_identity, const int position_identity, int start, int end)
|
void TIA::draw_player(Player &player, CollisionType collision_identity, const int position_identity, int start, int end)
|
||||||
|
Loading…
Reference in New Issue
Block a user