Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recolouring of cycle colours is incorrect when using WIN palette #4868

Closed
DorpsGek opened this issue Dec 4, 2011 · 2 comments
Closed

recolouring of cycle colours is incorrect when using WIN palette #4868

DorpsGek opened this issue Dec 4, 2011 · 2 comments
Labels
component: NewGRF This issue is related to NewGRFs flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

DorpsGek commented Dec 4, 2011

foobar opened the ticket and wrote:

OpenTTD r23401
Windows 7 32bit

I'm using fire cycle colours as a base for cargo specific recolouring using custom colour translation tables. This works fine when using the DOS palette for the NewGRF. However, when using the WIN palette (no other changes), the colour indices don't match. For example if I draw colour E9, I have remap colour EC in the colour translation table to actually have the E9-coloured pixels recoloured by the translation table ingame.
(With the DOS palette I can draw E9, map E9 and everything is well).
From a test it appeared that the fire cycle is shifted by 4 positions and the block cycle by 3 positions. The other cycles don't have this problem.

For this I assume that positions in the colour table for the fire cycle are the same in DOS and WIN. indices may indeed differ depending on what colours you want in the endresult. If this is a wrong assumption, there may be a bug in NML instead. To make things absolutely clear: the problem also occurs when using colours of which the and indices are exactly the same in DOS and WIN palette (fire cycle is in the same position, as well as for instance the light yellows for a grain colour translation).

Please find attached two test NewGRFs, one in DOS palette, one in WIN palette. Build a random train (available from around 1985) and attach a couple of Hoppers until the test pattern appears. The test pattern is fully visible from the vehicle properties window. With the DOS grf the upper and lower lines of the test pattern are identical. With the WIN grf, the patterns for the fire and block cycle are shifted. A comparison of what happens is provided in the attached image.

The NML colour translation table used is pasted below:

recolour_cycl = reserve_sprites(1);
replace(recolour_cycl) {
recolour_sprite {
//block
0xE3: 0x90;
0xE4: 0x91;
0xE5: 0x92;
0xE6: 0x93;
0xE7: 0x94;
//fire
0xE8: 0x90;
0xE9: 0x91;
0xEA: 0x92;
0xEB: 0x93;
0xEC: 0x94;
0xED: 0x95;
0xEE: 0x96;
//red
0xEF: 0x90;
0xF0: 0x91;
//yellow
0xF1: 0x90;
0xF2: 0x91;
0xF3: 0x92;
0xF4: 0x93;
//water
0xF5: 0x60;
0xF6: 0x61;
0xF7: 0x62;
0xF8: 0x63;
0xF9: 0x64;
0xFA: 0x65;
0xFB: 0x66;
0xFC: 0x67;
0xFD: 0xA2;
0xFE: 0xA3;
}
}

Attachments

Reported version: trunk
Operating system: Windows


This issue was imported from FlySpray: https://bugs.openttd.org/task/4868
@DorpsGek
Copy link
Member Author

DorpsGek commented Dec 4, 2011

Rubidium closed the ticket.

Reason for closing: Fixed

In r23433


This comment was imported from FlySpray: https://bugs.openttd.org/task/4868

@DorpsGek DorpsGek closed this as completed Dec 4, 2011
@DorpsGek
Copy link
Member Author

DorpsGek commented Dec 5, 2011

foobar wrote:

Now it works as expected, thanks very much!
(also thanks for fixing the sprite aligner)


This comment was imported from FlySpray: https://bugs.openttd.org/task/4868#comment10541

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) component: NewGRF This issue is related to NewGRFs bug labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: NewGRF This issue is related to NewGRFs flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant