Skip to content
Snippets Groups Projects
Verified Commit 40a9edbb authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

fix: issue related to max sprites per line

parent 33198767
No related branches found
No related tags found
No related merge requests found
Pipeline #1645 passed
......@@ -17,7 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed
*
* PPU issue related to the maximum number of objects/sprite per line being 10
## [0.5.4] - 2022-11-15
......
......@@ -802,7 +802,15 @@ impl Ppu {
}
fn render_objects(&mut self) {
let mut draw_count = 0u8;
for index in 0..OBJ_COUNT {
// in case the limit on number of object to be draw per
// line has been reached breaks the loop avoiding more draws
if draw_count == 10 {
break;
}
// obtains the meta data of the object that is currently
// under iteration to be checked for drawing
let obj = self.obj_data[index];
......@@ -899,6 +907,10 @@ impl Ppu {
// size of an RGB pixel (which is 3 bytes)
frame_offset += RGB_SIZE as i32;
}
// increments the counter so that we're able to keep
// track on the number of object drawn
draw_count += 1;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment