Skip to content

Commit

Permalink
use static access on obj::dimension
Browse files Browse the repository at this point in the history
  • Loading branch information
emrsmsrli committed Jun 12, 2021
1 parent 4962ce2 commit 9e0ee6e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gba/src/ppu/ppu_render.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ void engine::render_obj() noexcept
const bool is_affine = render_mode == obj_attr0::rendering_mode::affine
|| render_mode == obj_attr0::rendering_mode::affine_double;

const dimension<u8> dimensions = obj.dimensions[shape_idx][obj.attr1.size_idx()];
const dimension<u8> dimensions = obj::dimensions[shape_idx][obj.attr1.size_idx()];
dimension<u8> half_dimensions{dimensions.h / 2_u8, dimensions.v / 2_u8};

i32 y = obj.attr0.y();
Expand Down Expand Up @@ -168,7 +168,7 @@ void engine::render_obj() noexcept
const bool is_transparent = dot == color::transparent();
obj_buffer_entry& obj_entry = obj_buffer_[make_unsigned(global_x)];
if(blend_mode == obj_attr0::blend_mode::obj_window) {
if(dispcnt_.win_obj_enabled && !is_transparent){
if(dispcnt_.win_obj_enabled && !is_transparent) {
win_buffer_[make_unsigned(global_x)] = &win_out_.obj;
}
} else if(const u32 priority = obj.attr2.priority(); priority < obj_entry.priority || obj_entry.dot == color::transparent()) {
Expand Down
2 changes: 1 addition & 1 deletion gba_debugger/src/ppu_debugger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ void ppu_debugger::draw_obj() noexcept
const u32 shape_idx = obj.attr0.shape_idx();
auto dimension = shape_idx == 3_u32
? ppu::dimension<u8>{}
: obj.dimensions[shape_idx][obj.attr1.size_idx()];
: ppu::obj::dimensions[shape_idx][obj.attr1.size_idx()];
const ppu::obj_attr0::blend_mode blend_mode = obj.attr0.blending();
const ppu::obj_attr0::rendering_mode rendering_mode = obj.attr0.render_mode();
const bool color_depth_8_bit = obj.attr0.color_depth_8bit();
Expand Down

0 comments on commit 9e0ee6e

Please sign in to comment.