gma: Expect cursor coordinates on framebuffer surface
To our API users, the cursor is on the framebuffer surface. We have
to translate this position in case of rotation.
Change-Id: I16b8e8d5bb3b561c66ffed3af6b2c155b5f88f47
Signed-off-by: Nico Huber <nico.huber@secunet.com>
Reviewed-on: https://review.sourcearcade.org/c/libgfxinit/+/540
Reviewed-by: Thomas Heijligen <src@posteo.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Arthur Heymans <arthur@aheymans.xyz>
Tested-by: Nico Huber <nico.h@gmx.de>
diff --git a/gfxtest/hw-gfx-gma-gfx_test.adb b/gfxtest/hw-gfx-gma-gfx_test.adb
index d4bd145..dddb2a8 100644
--- a/gfxtest/hw-gfx-gma-gfx_test.adb
+++ b/gfxtest/hw-gfx-gma-gfx_test.adb
@@ -417,8 +417,8 @@
declare
C : Cursor_Type renames Pipes (Pipe).Cursor;
FB : Framebuffer_Type renames Pipes (Pipe).Framebuffer;
- Width : constant Width_Type := Rotated_Width (FB);
- Height : constant Height_Type := Rotated_Height (FB);
+ Width : constant Width_Type := FB.Width;
+ Height : constant Height_Type := FB.Height;
CS : Cursor_Script_Entry renames Cursor_Script
(Natural (Cnt) mod (Cursor_Script'Last + 1));
begin
@@ -516,8 +516,8 @@
C : Cursor_Type renames Pipes (Pipe).Cursor;
CI : Cursor_Info renames Cursor_Infos (Pipe);
FB : Framebuffer_Type renames Pipes (Pipe).Framebuffer;
- Width : constant Width_Type := Rotated_Width (FB);
- Height : constant Height_Type := Rotated_Height (FB);
+ Width : constant Width_Type := FB.Width;
+ Height : constant Height_Type := FB.Height;
Update : Boolean := False;
begin
@@ -634,8 +634,8 @@
(64, Height - New_FB.Start_Y - Rand_Div (Height));
Cursor.Mode := No_Cursor;
- Cursor.Center_X := Rotated_Width (New_FB) / 2;
- Cursor.Center_Y := Rotated_Height (New_FB) / 2;
+ Cursor.Center_X := New_FB.Width / 2;
+ Cursor.Center_Y := New_FB.Height / 2;
CI.X_Velo := 6 * Cursor_Rand (Gen) / (Width / New_FB.Width);
CI.Y_Velo := 6 * Cursor_Rand (Gen) / (Height / New_FB.Height);
end;