Gamestudio Links
Zorro Links
Newest Posts
loading historical data 1st time
by AndrewAMD. 04/14/23 12:54
Trade at bar open
by juanex. 04/13/23 19:43
Bug in Highpass2 filter
by rki. 04/13/23 09:54
Adding Limit Orders For IB
by scatters. 04/11/23 16:16
FisherN
by rki. 04/11/23 08:38
AUM Magazine
Latest Screens
SHADOW (2014)
DEAD TASTE
Tactics of World War I
Hecknex World
Who's Online Now
2 registered members (Grant, AndrewAMD), 911 guests, and 9 spiders.
Key: Admin, Global Mod, Mod
Newest Members
rki, FranzIII, indonesiae, The_Judge, storrealba
18919 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Palettes #345798
10/29/10 20:13
10/29/10 20:13
Joined: Sep 2003
Posts: 9,859
F
FBL Offline OP
Senior Expert
FBL  Offline OP
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
Is there any way to load a palette for 8 Bit pictures at runtime?

Who needs 8 Bit pictures you may ask? Nobody I answer... except the case you have a pile of palettized BMPs and PCXs and do not want to write a converter script.

I can easily fix this by loading one of the images as palette in the map properties of WED, but this requires
a) a level
b) a compilation process

I can live with a), but b) destroys the fun.
So I thought of
c) patch the palette of the WMB file via script, load the wmb at startup and see the 8 bit pictures in correct colors.

This should do, but that's REALLY ugly... I'd prefer a simple palette_load() so I can work without having a level at all.

Is this possible in some way or did I miss something?

The idea is to not have a step in this process where user input is required.

Thanks for help.

Re: Palettes [Re: FBL] #346116
11/01/10 13:29
11/01/10 13:29
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
There is no function to load a palette, but you don't need WED either. When the engine finds a file "palette.raw" or "palette.pcx" in the work folder, it is used for the palette at runtime.

Re: Palettes [Re: jcl] #346153
11/01/10 20:25
11/01/10 20:25
Joined: Sep 2003
Posts: 9,859
F
FBL Offline OP
Senior Expert
FBL  Offline OP
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
That's great news! Thanks.

Re: Palettes [Re: FBL] #346168
11/01/10 23:11
11/01/10 23:11
Joined: Sep 2003
Posts: 9,859
F
FBL Offline OP
Senior Expert
FBL  Offline OP
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
I've done a quick test.

It works for palette.raw, but unfortunately not for palette.pcx frown
The palette file can only reside in the root directory, a directory defined with PRAGMA_PATH is not possible?

Re: Palettes [Re: FBL] #346260
11/03/10 14:23
11/03/10 14:23
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
No, because the palette is loaded at the beginning before the scripts are compiled.

You're right with the palette.raw, but you can easily generate one, either with WED, or by script. It's just 768 bytes with the individual R,G,B values for the 256 palette entries.

Re: Palettes [Re: jcl] #348301
11/24/10 20:55
11/24/10 20:55
Joined: Sep 2003
Posts: 9,859
F
FBL Offline OP
Senior Expert
FBL  Offline OP
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
How am I supposed to generate a palette by script when it is loaded before the scripts are compiled? laugh

The problem is, I generate palettes from several file formats without a problem, but they are created too late for the engine...

If I start the engine a 2nd time right away everything is ok.
No way around this? It kills the fun a bit...

Re: Palettes [Re: FBL] #348360
11/25/10 13:37
11/25/10 13:37
Joined: Jul 2000
Posts: 27,935
Frankfurt
jcl Offline

Chief Engineer
jcl  Offline

Chief Engineer

Joined: Jul 2000
Posts: 27,935
Frankfurt
I meant a script function that allocates a 768 bytes array, fills it with the desired palette colors, and saves it as "palette.raw". This file is then read when you start the project the next time.

Re: Palettes [Re: jcl] #348381
11/25/10 19:10
11/25/10 19:10
Joined: Sep 2003
Posts: 9,859
F
FBL Offline OP
Senior Expert
FBL  Offline OP
Senior Expert
F

Joined: Sep 2003
Posts: 9,859
That's what I doing, unfortunately the problem is "next time".

Guess I'll have to live with that for now. I'll have to split the whole thing into two separate parts later anyway.


Moderated by  old_bill, Tobias 

Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1