New feature: Using the scroll bar to change the position of shops

45 views
Skip to first unread message

kepler br

unread,
Jul 19, 2014, 11:05:06 PM7/19/14
to freer...@googlegroups.com
http://pastebin.com/jRs9Gi4M

I tried to implement the same on the roller coaster, but could not. I was lost in relation to classes and inheritance, as the "build_direction" is private and want to "CoasterBuildWindow", while the control of the mouse on the map is of class "CoasterBuildMode".
If you can implement this, I'll be grateful, because I can study how to fix

kepler br

unread,
Jul 19, 2014, 11:06:33 PM7/19/14
to freer...@googlegroups.com
Forgot to say: I commented this line "this-> MarkWidgetDirty (RSEL_DISPLAY);" it did not seem necessary.

Lord Aro

unread,
Jul 21, 2014, 7:24:08 AM7/21/14
to freer...@googlegroups.com
Looks good! The mouse stuff for the coaster building is indeed a bit complex, we're looking to simplify it down a bit soon

A few comments though:
- Don't leave commented out code. Admittedly, the MarkWidgetDirty function does not do very much currently, but that's due to limitations in the rendering engine, rather than anything else, and leaving the MarkDirty-s in will save time in the future

- I wouldn't use #defines for the constants, especially when they're only used once. See if there's an existing constant somewhere, if not, just use the values, with a comment

- We use tabs for indentation

In the future, if you could post your patch at our official bug tracker: https://code.google.com/p/freerct/issues that'd be lovely :)

kepler br

unread,
Jul 21, 2014, 10:58:23 PM7/21/14
to freer...@googlegroups.com
Thanks for the response. I'm still learning C/C++ and use the SDL.

1) Ok
2) Personally, I like the naming "strange" numbers, so I used constants. But ok.
3) Strange... Apparently, Pastebin broke the formatting.

Reply all
Reply to author
Forward
0 new messages