WinAPI? GRF Palette

Discuss, get help with, or post new graphics for TTDPatch and OpenTTD, using the NewGRF system, here. Graphics for plain TTD also acceptable here.

Moderator: Graphics Moderators

Post Reply
zypa
Transport Coordinator
Transport Coordinator
Posts: 329
Joined: 30 Mar 2006 12:05
Location: Germany
Contact:

WinAPI? GRF Palette

Post by zypa »

For which porpose is the winAPI color (the pink one) in the GRF palette?
The color is used in some GRFs (In particular newbridges)

See this image (stolen and hotlinked from the ttdpatch wiki - I hope that's OK)
Image
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Re: WinAPI? GRF Palette

Post by eis_os »

They should not be used for compatibility reasons as windows manage these... (The Windows graphic subsystem decides if the colors will be something usefully or some random garbage or these days simple black...) *

Please note there is a dos palette too... (with 255 colors)


* History channel:
Windows was made so it could run on 256color systems too, every time you switched to a different windows application the palette was changed to the application specific one, this would result however that the windows borders, captions, buttons would change as well, so the Windows devs decided that Applications should not use the first colors and use some of windows standard colors in it when the display runs in 256 colors mode. **

A reason why there is a 256 color web safe palette, so you can view a web page in 256 colors too without distorted images :)

Nitpickers corner:
You can safely use the color index 0 because TTD never draws this color, it's transparent by design and will never end up (except some small places) in the composited image that the windows will draw on screen...
** Actually Windows has a hardcoded system palette with 20 colors, 10 below and 10 in the upper range, the red marked ones included white but TTDWindows doesn't use them so you shouldn't do it as well... (except well white)
TTDPatch dev in retirement ... Search a grf, try Grf Crawler 0.9 - now with even faster details view and new features...
Image
zypa
Transport Coordinator
Transport Coordinator
Posts: 329
Joined: 30 Mar 2006 12:05
Location: Germany
Contact:

Re: WinAPI? GRF Palette

Post by zypa »

OK, thank very much!

Does anybody know why these colors are used in the newbridges GRF?
See attached image.
Attachments
newbridgesW.png
newbridgesW.png (24.75 KiB) Viewed 2343 times
User avatar
XeryusTC
Tycoon
Tycoon
Posts: 15415
Joined: 02 May 2005 11:05
Skype: XeryusTC
Location: localhost

Re: WinAPI? GRF Palette

Post by XeryusTC »

Maybe because you used the wrong palette?
Don't panic - My YouTube channel - Follow me on twitter (@XeryusTC) - Play Tribes: Ascend - Tired of Dropbox? Try SpiderOak (use this link and we both get 1GB extra space)
Image
OpenTTD: manual #openttdcoop: blog | wiki | public server | NewGRF pack | DevZone
Image Image Image Image Image Image Image
zypa
Transport Coordinator
Transport Coordinator
Posts: 329
Joined: 30 Mar 2006 12:05
Location: Germany
Contact:

Re: WinAPI? GRF Palette

Post by zypa »

Hmm,
I'm not really good at "graphic stuff".

I thought the palette is saved in the pcx file. I opened the pcx with irfan view.
Where did I use the wrong palette - or: How can I use the correct one?

I normally use paint.net. Unfortunately paint-net cannot open pcx files.
Shall I use the gimp instead?
User avatar
AndersI
Tycoon
Tycoon
Posts: 1732
Joined: 19 Apr 2004 20:09
Location: Sweden
Contact:

Re: WinAPI? GRF Palette

Post by AndersI »

zypa wrote:I normally use paint.net. Unfortunately paint-net cannot open pcx files.
It can, look here: http://paintdotnet.forumer.com/viewtopi ... &hilit=pcx
User avatar
Maedhros
OpenTTD Developer
OpenTTD Developer
Posts: 603
Joined: 30 Mar 2006 18:24
Location: Durham, UK

Re: WinAPI? GRF Palette

Post by Maedhros »

zypa wrote:I thought the palette is saved in the pcx file. I opened the pcx with irfan view.
Where did I use the wrong palette - or: How can I use the correct one?
It is, but it isn't saved in the grf file. If you didn't decode it with the right options, grfcodec will insert the wrong palette into the pcx file it creates, which will give you the wrong colours when you open it in an image editor. By the looks of you it you've decoded a Windows grf file, but grfcodec thinks it has a DOS palette (which I think is the default if you didn't give it any options). You need to specify the right palette with grfcodec's -p switch.
No-one's more important than the earthworm.
User avatar
athanasios
Tycoon
Tycoon
Posts: 3138
Joined: 23 Jun 2005 00:09
Contact:

Re: WinAPI? GRF Palette

Post by athanasios »

Use an old version of JASC Paint Shop Pro to get a correct palette. Please don't ask for links. :wink: Nevertheless Google can be your friend as well as some abandonware sites. Neopaint too, can prove usefull.
http://members.fortunecity.com/gamesart
"If no one is a fool I am also a fool." -The TTD maniac.


I prefer to be contacted through PMs. Thanks.
richk67
Tycoon
Tycoon
Posts: 2363
Joined: 05 Jun 2003 16:21
Location: Up North
Contact:

Re: WinAPI? GRF Palette

Post by richk67 »

LOL, good old PaintShop Pro 4.2. They forgot to put in the "disable at end of trial period" call, so it used to report nice things like "Day 1256 of 30" :)
OTTD NewGRF_ports. Add an airport design via newgrf.Superceded by Yexo's NewGrf Airports 2
Want to organise your trains? Try Routemarkers.
--- ==== --- === --- === ---
Firework Photography
User avatar
eis_os
TTDPatch Developer
TTDPatch Developer
Posts: 3603
Joined: 07 Mar 2003 13:10
Location: Germany
Contact:

Re: WinAPI? GRF Palette

Post by eis_os »

If you do a full screen screenshot and use the pcx as base, you will get the windows default colors, if you do it in window mode you will get black except the mentioned white. The best would be to teach TTDWindows to put a windows 9x palette in the first 9(10) colors, but simply currently you shouldn't use them... (This may result in incompatibilities with old windows installations or old / broken vga drivers to change how TTD uses the palette.)
zypa
Transport Coordinator
Transport Coordinator
Posts: 329
Joined: 30 Mar 2006 12:05
Location: Germany
Contact:

Re: WinAPI? GRF Palette

Post by zypa »

Thanks a lot for your replies!
I'll try to encode the grf with the correct options and I'll try some graphic tool you've suggested.
Thanks! :bow:
Post Reply

Return to “Graphics Development”

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot] and 18 guests