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
Refactor remaining raw constants into sprites.h #16033
Comments
|
Hi, I am an undergraduate student looking to work on an open-source project for one of my classes. I would love the chance to take this issue on. |
|
All yours |
|
Sure, go ahead, and welcome :) |
|
Hey, it doesn't seem like this issue was ever resolved as far as I could tell. It's my first time trying out open source contributions, but does anyone mind if I give it a shot? I would love to use this as a learning experience in working with larger-scale projects. |
|
Sure go ahead. Try not to do all of this at once. Do a file at a time and pr that. I think most of the renames will be in paint code try follow the naming convention used by for example the junior coaster. |
|
Okay, I'll work on individual files at a time and pr each of those as I complete them. If it's all the same to you, I'll begin with the original example regarding VehiclePaint.cpp/sprites.h and use #16553 as a sort of guidelines to get a feel for this process first. I do want to ask also, from #16553, should this actually be added in the code somewhere // Animation of 8 frames for the 4 rotations
constexpr std::array<std::array<uint32_t, 8>, 4> SplashEffect1 = {
{ 29014, 29015, 29016, 29017, 29018, 29019, 29020, 29021 },
{ 29022, ...},
...
};or is it sufficient to put the entries into sprites.h as this? |
|
Start with just adding the entries into the sprites.h and replacing the magic number (i.e. the same as 16553). Then fill in the gaps in the sprites.h file (i.e. frames 1-7: 29015, ...). Then if you understand the code if you could add a constexpr array as per my comment and use that in the code of vehicle paint. That final part is because we don't want to add with an image id as that forces us to keep the image id order. |
Constants like
29046as seen here:OpenRCT2/src/openrct2/ride/VehiclePaint.cpp
Line 3049 in eba42a9
Should be named
SPR_SOME_NAMEand put into sprites.h, there might be arrays that hold those. It should be easy to find them by looking for calls to PaintAddImageAsChild or PaintAddImageAsParent.The text was updated successfully, but these errors were encountered: