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

Visual effects for RVs and ships #4238

Closed
DorpsGek opened this issue Nov 17, 2010 · 3 comments
Closed

Visual effects for RVs and ships #4238

DorpsGek opened this issue Nov 17, 2010 · 3 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay

Comments

@DorpsGek
Copy link
Member

Hirundo opened the ticket and wrote:

Patched against r21228

The current visual effect code works for trains only. The attached series of patches makes the code work step-by-step for RVs and ships as well. Then, implementing CB 0x10 and optionally action0 properties is pretty trivial.

Patch 0 fixes a bug in the positioning of diesel / electric visual effects. The bug being documented in the NewGRF specs doesn't mean that it shouldn't be fixed.
Patches 1-7 generalize the code in a series of steps. I won't go into detail here, see the respective files.
Patch 8 implements callback 0x10 for RVs and ships. Implementation is the same as for trains except that bit 7 (wagon power) is ignored.
Patch 9 changes the default value for visual effect from 0 to 0xFF to prevent corner-case bugs when NewGRFs set the value of the visual effect action0 property to 0.
Patch 10 implements action0 properties for RVs and ships. This isn't a mandatory feature (the CB does everything you may need), but it could be convenient for grf authors.

Also attached is a total diff including all changes, a zip file containing all individual patches and a grf used for testing. This grf gives (intentionally) ill-positioned visual effects to the MPS Regal Bus and the MPS Oil Tanker.

Attachments

Reported version: trunk
Operating system: All


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

Hirundo wrote:

Improved formatting of some comments in patches 6 and 7, updated version is attached.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/4238#comment9110

@DorpsGek
Copy link
Member Author

Terkhen wrote:

A single setting for all vehicle types is IMO the best option, but I wonder if there will be complaints about not allowing to set different values for each vehicle type.

There is a missing default in 10_action0.diff:

D:/MinGW/msys/1.0/home/terkhen/effects/src/engine.cpp: In constructor 'Engine::Engine(VehicleType, EngineID)':
D:/MinGW/msys/1.0/home/terkhen/effects/src/engine.cpp:89:10: warning: enumeration value 'VEH_AIRCRAFT' not handled in switch
D:/MinGW/msys/1.0/home/terkhen/effects/src/engine.cpp:89:10: warning: enumeration value 'VEH_EFFECT' not handled in switch
D:/MinGW/msys/1.0/home/terkhen/effects/src/engine.cpp:89:10: warning: enumeration value 'VEH_DISASTER' not handled in switch
D:/MinGW/msys/1.0/home/terkhen/effects/src/engine.cpp:89:10: warning: enumeration value 'VEH_END' not handled in switch
D:/MinGW/msys/1.0/home/terkhen/effects/src/engine.cpp:89:10: warning: enumeration value 'VEH_INVALID' not handled in switch


This comment was imported from FlySpray: https://bugs.openttd.org/task/4238#comment9111

@DorpsGek
Copy link
Member Author

Rubidium closed the ticket.

Reason for closing: Implemented

Around r21240.


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

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) Vehicles patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) patch from FlySpray This issue is in fact a Patch, but imported from FlySrpay
Projects
None yet
Development

No branches or pull requests

1 participant