diff --git a/rpcs3/Emu/RSX/Overlays/overlay_controls.h b/rpcs3/Emu/RSX/Overlays/overlay_controls.h index daeaf02ad6..fe01d67c1a 100644 --- a/rpcs3/Emu/RSX/Overlays/overlay_controls.h +++ b/rpcs3/Emu/RSX/Overlays/overlay_controls.h @@ -55,6 +55,11 @@ namespace rsx vec4(x, y, z, w); } + vertex(int x, int y, int z, int w) + { + vec4((f32)x, (f32)y, (f32)z, (f32)w); + } + float& operator[](int index) { return values[index]; @@ -675,13 +680,13 @@ namespace rsx compiled_resource compiled_resources; bool is_compiled = false; - f32 padding_left = 0.f; - f32 padding_right = 0.f; - f32 padding_top = 0.f; - f32 padding_bottom = 0.f; + u16 padding_left = 0; + u16 padding_right = 0; + u16 padding_top = 0; + u16 padding_bottom = 0; - f32 margin_left = 0.f; - f32 margin_top = 0.f; + u16 margin_left = 0; + u16 margin_top = 0; overlay_element() {} overlay_element(u16 _w, u16 _h) : w(_w), h(_h) {} @@ -731,7 +736,7 @@ namespace rsx is_compiled = false; } - virtual void set_padding(f32 left, f32 right, f32 top, f32 bottom) + virtual void set_padding(u16 left, u16 right, u16 top, u16 bottom) { padding_left = left; padding_right = right; @@ -741,14 +746,14 @@ namespace rsx is_compiled = false; } - virtual void set_padding(f32 padding) + virtual void set_padding(u16 padding) { padding_left = padding_right = padding_top = padding_bottom = padding; is_compiled = false; } // NOTE: Functions as a simple position offset. Top left corner is the anchor. - virtual void set_margin(f32 left, f32 top) + virtual void set_margin(u16 left, u16 top) { margin_left = left; margin_top = top; @@ -756,7 +761,7 @@ namespace rsx is_compiled = false; } - virtual void set_margin(f32 margin) + virtual void set_margin(u16 margin) { margin_left = margin_top = margin; is_compiled = false; @@ -885,9 +890,9 @@ namespace rsx verts.resize(4); verts[0].vec4(x, y, 0.f, 0.f); - verts[1].vec4(x + w, y, 1.f, 0.f); - verts[2].vec4(x, y + h, 0.f, 1.f); - verts[3].vec4(x + w, y + h, 1.f, 1.f); + verts[1].vec4(f32(x + w), y, 1.f, 0.f); + verts[2].vec4(x, f32(y + h), 0.f, 1.f); + verts[3].vec4(f32(x + w), f32(y + h), 1.f, 1.f); compiled_resources.add(std::move(compiled_resources_temp), margin_left, margin_top); diff --git a/rpcs3/Emu/RSX/Overlays/overlays.h b/rpcs3/Emu/RSX/Overlays/overlays.h index 867a184d1c..a8903f1d9f 100644 --- a/rpcs3/Emu/RSX/Overlays/overlays.h +++ b/rpcs3/Emu/RSX/Overlays/overlays.h @@ -446,7 +446,7 @@ namespace rsx void reset_titles(); void reset_text(); - u32 get_text_opacity() const + f32 get_text_opacity() const { return std::clamp(m_opacity + 0.3f, 0.3f, 1.0f); } @@ -486,7 +486,7 @@ namespace rsx { std::unique_ptr image = std::make_unique(); image->set_size(160, 110); - image->set_padding(36.f, 36.f, 11.f, 11.f); //Square image, 88x88 + image->set_padding(36, 36, 11, 11); //Square image, 88x88 if (resource_id != image_resource_id::raw_image) { @@ -494,7 +494,7 @@ namespace rsx } else if (icon_buf.size()) { - image->set_padding(0.f, 0.f, 11.f, 11.f); //Half sized icon, 320x176->160x88 + image->set_padding(0, 0, 11, 11); //Half sized icon, 320x176->160x88 icon_data = std::make_unique(icon_buf); static_cast(image.get())->set_raw_image(icon_data.get()); } @@ -954,7 +954,7 @@ namespace rsx progress_2.inc(value); if (index == taskbar_index || taskbar_index == -1) - Emu.GetCallbacks().handle_taskbar_progress(1, value); + Emu.GetCallbacks().handle_taskbar_progress(1, (s32)value); return CELL_OK; } @@ -1021,7 +1021,7 @@ namespace rsx image.back_color.a = 0.f; text_view.set_pos(85, 0); - text_view.set_padding(0.f, 0.f, 24.f, 0.f); + text_view.set_padding(0, 0, 24, 0); text_view.set_font("Arial", 8); text_view.align_text(overlay_element::text_align::center); text_view.back_color.a = 0.f; diff --git a/rpcs3/Emu/RSX/rsx_utils.h b/rpcs3/Emu/RSX/rsx_utils.h index 498e4a1e0b..447a4226c7 100644 --- a/rpcs3/Emu/RSX/rsx_utils.h +++ b/rpcs3/Emu/RSX/rsx_utils.h @@ -741,7 +741,7 @@ namespace rsx { if (block[i]) { - values[n] |= (1 << bit); + values[n] |= (1ull << bit); } } }