Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUse ScreenCoordsXY on gfx_draw_string_right #11569
Comments
|
Hey! I'd like to take this issue on. It's my first time contributing to OpenRCT2, so I was wondering if there were any documents other than this one about contributing to this project. (I couldn't find any details about building the code and testing it, in particular). Awesome project btw |
|
There are some things about compiling in our main readme: There are also links on our wiki such as coding style and Commit messages |
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
|
@tupaschoal Thanks for the merge, and helping me out! What else needs to be done for this? I can't find any other calls to this function, |
|
Really? If none is calling the old function anymore, just delete it and submit a pr. It should fail to compile if there are users still |
|
Sorry, not sure what I did wrong earlier but you're right, there are definitely other calls to the function. As for fixing the other calls, the change should pretty much just include changing: Or is there more to it? |
|
That's pretty much all you need to change. In some places you might have a ScreencoordsXY already so you obviously wouldn't need to create one for that. |
|
Cool. The issue mentions that we shouldn't make all of the changes in one PR. I think there are around a dozen files which will need to be refactored, so how should we PR it? Create a PR for each file? |
|
That is just in case its one of the string functions that is used absolutely everywhere. If its just a dozen files then do a single PR. |
Create an overload of
gfx_draw_string_righton\src\openrct2\drawing\Text.cppwith the same name, but that takes aconst ScreenCoordsXY&object instead of anint32_t xand and anint32_t yand replace the calls to the{x ,y}pair by the one usingScreenCoordsXY.Don't try to do all calls at once, unless it doesn't occur a lot, as this might lead to a huge PR. When we stop using the old function, we can drop it entirely in favour of the
ScreenCoordsXYalternative.