Page 1 of 2
Custom Mouse Pointers (Amiga)
Posted: Fri Jun 14, 2024 3:53 am
by oceanarts
How exactly do custom mouse pointers work on the Amiga end?
Alpha channels seem to be accepted, but the colors are all wrong.
Re: Custom Mouse Pointers (Amiga)
Posted: Fri Jun 14, 2024 9:36 am
by plouf
mouse pointer in amigaos is pallete based in OS level
hollywood remaps to pallete which choose some collors
traditional if you have a 32bit brush and remap it to 256 or even 16 colors you loose traspancy because of dithering
an example or at least the "faulty" brush would help
but ideal in amigaOS you should use pallete brushes
Re: Custom Mouse Pointers (Amiga)
Posted: Fri Jun 14, 2024 5:05 pm
by oceanarts
I see.
Is this the case for all Amiga platforms, such as OS4.x, Aros etc too?
Not able to test on these currently.
Re: Custom Mouse Pointers (Amiga)
Posted: Sun Jun 16, 2024 10:46 pm
by oceanarts
Looks like I can't get acceptable colors even if I use indexed images.
Re: Custom Mouse Pointers (Amiga)
Posted: Sun Jun 16, 2024 10:52 pm
by plouf
provide example code and brush
so eveyrone can test/check/suggest
Re: Custom Mouse Pointers (Amiga)
Posted: Mon Jun 17, 2024 12:06 am
by oceanarts
Here's a video clip showing the issue:
https://ody.sh/SLP3H460bQ
The relevant code:
Code: Select all
@BRUSH 1, "mouse_idle.png", {LoadAlpha = True}
CreatePointer(1, #BRUSH, 1, 0, 0)
@BRUSH 2, "mouse_active.png", {LoadAlpha = True}
CreatePointer(2, #BRUSH, 2, 0, 0)
and
SetPointer(x)
as needed.
If it's indexed I set the LoadAlpha to False.
Re: Custom Mouse Pointers (Amiga)
Posted: Mon Jun 17, 2024 8:49 am
by jPV
From the
CreatePointer() documentation:
Please note that not all systems can handle true colour mouse pointers. If the system does not support true colour mouse pointers, Hollywood will reduce the colors. Also, your image data might get scaled because some systems impose limits on the maximum mouse pointer size.
On AmigaOS 3,
CreatePointer() also supports palette brushes and sprites. Pointers on classic Amiga hardware are always palette-based because they are implemented using hardware sprites so if you pass palette brushes or sprites to
CreatePointer() on AmigaOS 3 you have full control over the exact pens used by the pointer which is more convenient than using 32-bit graphics because those will first have to be mapped down to palette graphics on AmigaOS 3 and you won't have any control over the palette pens in the remapped brush or sprite.
It's a bit difficult situation, because in the optimal situation you should know what colors are set on which pens in the system you're running the program on, and create a palette image using those pens. First eight or so pens are pretty static on Amiga setups, but not always... first four are the safest bet. And then there might be a graphics card (RTG) setup on Amiga, and many older graphics chips from that age didn't support many colors on their hardware sprite. IIRC Virge/Voodoo/etc. did only support four colors sprite, where one color was transparency, one was inversed, and there were actually only two real colors. So, it could be a bit messy to touch the pointer at all

Re: Custom Mouse Pointers (Amiga)
Posted: Mon Jun 17, 2024 8:55 am
by jPV
oceanarts wrote: ↑Fri Jun 14, 2024 5:05 pm
I see.
Is this the case for all Amiga platforms, such as OS4.x, Aros etc too?
Not able to test on these currently.
I haven't tested either, but I'm pretty sure these systems do support true color pointers. At least on MorphOS pointer images are PNG images with alpha transparency in OS level. Although if you're using an old graphics card (like Voodoo3/4/5) then it's most likely limited... but majority of users have more modern graphics cards in the next generation systems.
Re: Custom Mouse Pointers (Amiga)
Posted: Mon Jun 17, 2024 11:00 am
by oceanarts
Hmm.,, Guess I will have to forego the custom pointer then. Unless there's a way to hide the pointer while still accepting input and replace it with a Hollywood brush. But I guess the size issue would still be a problem.
Re: Custom Mouse Pointers (Amiga)
Posted: Mon Jun 17, 2024 8:39 pm
by plouf
oceanarts wrote: ↑Mon Jun 17, 2024 11:00 am
.... Unless there's a way to hide the pointer while still accepting input and replace it with a
you can
HidePointer() does that...
ideal however in amiga side probably would be the
HidePointer() Entry in combination of FullScreen, .....