Plananarama palettemode

Discuss about plugins that don't have a dedicated forum
Post Reply
amyren
Posts: 368
Joined: Thu May 02, 2019 11:53 am

Plananarama palettemode

Post by amyren »

I have this LCD game port of Caveman which works well on systems with graphics card, but I wanted test how it would perform on Amigas without gfx card.

First test was in default mode and I tested in Winuae with a plain OS3.2 setup, and also a OS3.1 setup. Both with 020 without fpu.
It runs, but very slow. I tried both with and without FBlit and BlazeWCP, but I cant say I noticed any major speed differences.

Then I want to try out in palettemode, and here is where I struggle to get it running.

First I have this code, which works

Code: Select all

@REQUIRE "plananarama", {Link = True, PaletteMode = True}
@DISPLAY {Width = 320, Height = 256, Title = "Caveman",ScaleMode = #SCALEMODE_AUTO, Sizeable = True, Borderless = True, PALETTE = #PALETTE_AGA}
SetPaletteMode(#PALETTEMODE_PEN)
Then I have made the graphics in three resolutions, in three different folders and I have some code here for the user to choose to run the game in high, medium or low resolution. After this it loads the main game screen by using a bgpic from choosen folder.

Code: Select all

LoadBGPic(1, GetDirectoryEntry(seldir, "bg_caveman.png"))
DisplayBGPic(1, {Palette = #PALETTE_AGA})
Now the DisplayBGPic function will give me the error "incompatible pixel color depth" and quit.
I also tried loading the palette from the LoadBGPic function, but then it will give the error that the choosen png image does not have a palette.

How can I resolve this issue?
plouf
Posts: 533
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Plananarama palettemode

Post by plouf »

this a trial ang guess , since i have not experiment with Plananarama a lt
but LoadBGPic() has a LoadPalette=True
can try LoadBGPic(1, GetDirectoryEntry(seldir, "bg_caveman.png"),{LoadPalette=True})

.. maybe !?
Christos
amyren
Posts: 368
Joined: Thu May 02, 2019 11:53 am

Re: Plananarama palettemode

Post by amyren »

plouf wrote: Thu Aug 22, 2024 5:43 pm this a trial ang guess , since i have not experiment with Plananarama a lt
but LoadBGPic() has a LoadPalette=True
can try LoadBGPic(1, GetDirectoryEntry(seldir, "bg_caveman.png"),{LoadPalette=True})

.. maybe !?
Thaks for your reply, but as I wrote at the bottom of my post,I have already tried that. It then gives me the error that the png image file does not have a palette.
I wonder if it might help if I convert the png into iff.
plouf
Posts: 533
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Plananarama palettemode

Post by plouf »

A pallete png is a 8bit png correct ?
Christos
amyren
Posts: 368
Joined: Thu May 02, 2019 11:53 am

Re: Plananarama palettemode

Post by amyren »

plouf wrote: Thu Aug 22, 2024 7:45 pm A pallete png is a 8bit png correct ?
I think you are into something. My png's was not 8 bit.

Got it working by converting the png's to 256 and 32 colour iff files, using PPaint. I was then able to make it run in both AGA and OCS mode.
Now I just need to figure out how to use SetPen() to get my black boxes to become black, and also change the font colour.
amyren
Posts: 368
Joined: Thu May 02, 2019 11:53 am

Re: Plananarama palettemode

Post by amyren »

Turned out SetDrawPen(0) was equal to black without any additional tuning. Perhaps it always is?

Anyway, palettemode is much faster here. The game was playable in winuae, but if I set winuea 4x speed to match A1200 speed it got very slow. Even at 16x speed (56mhz) it was to slow to be usable. I'm curious how it would perform on real hardware.
plouf
Posts: 533
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Plananarama palettemode

Post by plouf »

Lets see what a pallete image is
In pallete image every pixel has an index of a " array of color"
Which is why every pixel is 1 byte wide
(In contrarry 24 bit = 3 bytes = 1 byte red 1 byte blue 1 byte green so no "pallete needed" since every pixel has the exact color information in it)
So setting color of "pallete index" 0 to black is black because the image has this

Its a common practice to have index 0=black but its just common use


Its definitelly faster because AGA is pallete based . No conversion neede :-)
Christos
amyren
Posts: 368
Joined: Thu May 02, 2019 11:53 am

Re: Plananarama palettemode

Post by amyren »

plouf wrote: Fri Aug 23, 2024 11:09 am Lets see what a pallete image is
In pallete image every pixel has an index of a " array of color"
Which is why every pixel is 1 byte wide
(In contrarry 24 bit = 3 bytes = 1 byte red 1 byte blue 1 byte green so no "pallete needed" since every pixel has the exact color information in it)
So setting color of "pallete index" 0 to black is black because the image has this

Its a common practice to have index 0=black but its just common use


Its definitelly faster because AGA is pallete based . No conversion neede :-)
Thanks for the info.
Now this was initially just a test for me if I could get it to work on native screens.

As you say it is faster because no coversion needed. I did only convert the background images just to get the palette, but all the other images used for sprites are still full colour png images.
You think it would speed up things more if I convert all of these into iff's as well?
plouf
Posts: 533
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Plananarama palettemode

Post by plouf »

I guess. Never experiment with plananarama

I know that v2 support hardware sprites too . Which help, but
Have a lot of limitations-> https://www.hollywood-mal.com/docs/html ... port_.html
Christos
Post Reply