New OS4 WritePixelColor, ReadPixelColor, RectFillColor on 8bit screens

8 posts / 0 new
Last post
flash
flash's picture
Offline
Last seen: 4 months 1 week ago
Joined: 2018-02-24 17:25
New OS4 WritePixelColor, ReadPixelColor, RectFillColor on 8bit screens

Hi Amiga coders!
I'm further cleaning all pre os4 functions from FlashMandelOS4 program and I'd like to subst the WritePixel, ReadPixel, RectFill with new OS4 specific ones like WritePixelColor, ReadPixelColor, RectFillColor.
In this way I should gain some overhead due the SetAPen calls discard.

I noticed, at least on 8bit screens, every time I use these new functions I got a system crash.
So maybe these new functions aren't compatible with 8bit screens (!?) ..In autodocs there aren't warnings about this..

YesCop
YesCop's picture
Offline
Last seen: 3 years 7 months ago
Joined: 2011-05-17 15:07
Re: New OS4 WritePixelColor, ReadPixelColor, RectFillColor on...

Hi,
Which version of sdk and os4 do you use?
From final update, if i am not wrong, the sdk changed for some functions.
For example, composite function has been put in graphics library.
May be the same occurs for your functions.
If you use os4.1 final update, use the last sdk.
Keep in mind that you should use some tests in your code if you want that your programs work on all os4 machines whatever their system version.

Ps:
You could post the calls you made for your functions in case tbere are errors in the parameters.

broadblues
broadblues's picture
Offline
Last seen: 4 years 1 month ago
Joined: 2012-05-02 21:48
Re: New OS4 WritePixelColor, ReadPixelColor, RectFillColor on...

Hi Amiga coders!
I'm further cleaning all pre os4 functions from FlashMandelOS4 program and I'd like to subst the WritePixel, ReadPixel, RectFill with new OS4 specific ones like WritePixelColor, ReadPixelColor, RectFillColor.

All those functions work on OS4.

In this way I should gain some overhead due the SetAPen calls discard.

Hardly. This is trivial function.

I noticed, at least on 8bit screens, every time I use these new functions I got a system crash.
So maybe these new functions aren't compatible with 8bit screens (!?) ..In autodocs there aren't warnings about this..

These functions along with the SetRPAttrs() colour related functions will certainly not work with 8bit screens (though they didn't ought to crash) as 8bit (and less) screens are palettemapped, and pixels can not have colours independent of the palette.

Aldo note they are only available from graphics.library version 54 They will crash on earlier versions.

broadblues
broadblues's picture
Offline
Last seen: 4 years 1 month ago
Joined: 2012-05-02 21:48
Re: New OS4 WritePixelColor, ReadPixelColor, RectFillColor on...

For example, composite function has been put in graphics library.

CompositeTagList() has been arround since version 53! Ie any version of 4.1

He must clearly be using the most recent SDK to add those quoted functions in any as they would not compile with earlier SDK versions.

flash
flash's picture
Offline
Last seen: 4 months 1 week ago
Joined: 2018-02-24 17:25
Re: New OS4 WritePixelColor, ReadPixelColor, RectFillColor on...

Yeah, so as I supposed these new functions aren't compatible with 8bit screens.
It would be nice to add a note about this in autodocs and, also better, support 8 bit screens avoiding double calls setapen/writepixel pair functions.

Tnx for answers!

broadblues
broadblues's picture
Offline
Last seen: 4 years 1 month ago
Joined: 2012-05-02 21:48
Re: New OS4 WritePixelColor, ReadPixelColor, RectFillColor on...

There *is* a note in the SetRPAttrs autodoc.

RPTAG_APenColor Primary rendering color (overrides APen)
RPTAG_BPenColor Secondary rendering color (overrides BPen)
RPTAG_OPenColor Area outline color (overrides OutlinePen)
RPTAG_OutlinePenColor Alias for RPTAG_OPenColor

The color format used by the three tags above is 0xAARRGGBB.
Please note that these tags won't have any effect when
rp->BitMap does not point to a directmapped bitmap. The alpha
part is currently ignored and should be set to 0xFF.

This is good of example of how you shouldn't take autodocs in isolation but study them as a whole to understand what is going on....

IMHO you should avoid 8bit screens on OS4 for new software, they are slower and have less features, there really is no advantage to them except for legacy support.

flash
flash's picture
Offline
Last seen: 4 months 1 week ago
Joined: 2018-02-24 17:25
Re: New OS4 WritePixelColor, ReadPixelColor, RectFillColor on...

When I look for a specific OS function I expect all things related that are just there.
In autodocs a link note to SetRPAttrs function and a warning about 8bit or lower screens could be a good idea.
I badly assumed new functions did all dirty work in a transparent way ad could manage all kind of screen's depth.
All in all it was a my fault.

flash
flash's picture
Offline
Last seen: 4 months 1 week ago
Joined: 2018-02-24 17:25
Re: New OS4 WritePixelColor, ReadPixelColor, RectFillColor on...

I want advise you all these functions works ok on 8bit screens too.
It was only my fault, sorry :-)

Log in or register to post comments