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

Map array accessor patch #19

Closed
DorpsGek opened this issue Dec 5, 2005 · 16 comments
Closed

Map array accessor patch #19

DorpsGek opened this issue Dec 5, 2005 · 16 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

DorpsGek commented Dec 5, 2005

LordOfThePigs opened the ticket and wrote:

[EDIT by TrueLight]
All this work is now done in a branch in the OpenTTD.GPMI Repos. You can find it here:
svn://svn.libgpmi.org/openttd/branch/tfc_newmap
They will communicate via this task. If you want to see their progress, make a diff between regular OpenTTD Repos and this branch. They will try to keep the branch as up to date as possible.
[/EDIT]

This patch replaces all access to m1 of the current map array by accessor functions. The functions are designed to abstract the code from the underlying data structure, making it easy to change the data structure without breaking the code. Ultimately (ie: once all the fields of the old map array have been rewritten) this will allow switching to a better structure without breaking any code.

Attachments

Reported version: trunk
Operating system: All


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

DorpsGek commented Dec 6, 2005

glx wrote:

I've done a similar work for signals. Maybe I should put the diff here too (for now it's on sourceforge). Just let me know.


This comment was imported from FlySpray: https://bugs.openttd.org/task/19#comment20

@DorpsGek
Copy link
Member Author

DorpsGek commented Dec 6, 2005

LordOfThePigs wrote:

I think it would be a good idea to update your signals patch to the lastest SVN revision and post it here too. This way, we'll have all the things at the same place.


This comment was imported from FlySpray: https://bugs.openttd.org/task/19#comment22

@DorpsGek
Copy link
Member Author

DorpsGek commented Dec 6, 2005

glx wrote:

Here it is.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/19#comment23

@DorpsGek
Copy link
Member Author

DorpsGek commented Dec 9, 2005

LordOfThePigs wrote:

Here's an updated versions.

- Reverted changed into oldloader.c as suggested by Bjarni
- Removed the millions of asserts as suggested by Darkvater
- Removed duplicate functions and added comments
- Updated landscape.html to show the accessor function names besides the bits description (I suggest glx to do the same, it will make it easier to not code some functions twice later on)

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/19#comment25

@DorpsGek
Copy link
Member Author

DorpsGek commented Dec 9, 2005

glx wrote:

I'm currently adding wrappers for rail building/removing.

I'll update landscape.html after, then I'll attach the full diff.


This comment was imported from FlySpray: https://bugs.openttd.org/task/19#comment26

@DorpsGek
Copy link
Member Author

glx wrote:

Here's my updated version
- only 8 direct map access left in rail_cmd.c (2 should be replaced by LordOfThePigs' functions, the others needs road map accessors)
- added accessors for tunnel/bridge, and use them where appropriate (there still files where it's unapplied, and missing accessors)
- Updated landscape.html as suggested by LordOfThePigs.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/19#comment31

@DorpsGek
Copy link
Member Author

glx wrote:

Updated to svn r3305 (there was a conflict ;))

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/19#comment34

@DorpsGek
Copy link
Member Author

Belugas wrote:

Here is my contribution. Far from being finished.
Mainly, i'm wrapping every house's accesses.
A lot of the code is quite strange, it takes time to get it through
WIll be upgraded as work continues.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/19#comment50

@DorpsGek
Copy link
Member Author

Belugas wrote:

Here is an update, to svn r3348.
I have included town.h as well as town_gui.c
While looking at the map branch files, I found out that Trueligh has left a real good job in commenting and simplifying processes.
It would be a pity to left it out. So, along with my modifications, I included some of his work.
The main work have been done in town_cmd.c. There are some parts left to be changed, but they are getting fewer

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/19#comment67

@DorpsGek
Copy link
Member Author

DorpsGek commented Jan 4, 2006

glx wrote:

Just an update to r3360.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/19#comment69

@DorpsGek
Copy link
Member Author

DorpsGek commented Jan 6, 2006

egladil wrote:

This replaces the use of signals_table* in rail_cmd.c with calls to already existing (r3368) accessor functions.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/19#comment70

@DorpsGek
Copy link
Member Author

DorpsGek commented Jan 6, 2006

glx wrote:

I'm sorry to say that egladil, but it's already included in map_accessors.r3360.diff.


This comment was imported from FlySpray: https://bugs.openttd.org/task/19#comment71

@DorpsGek
Copy link
Member Author

DorpsGek commented Jan 6, 2006

egladil wrote:

Ok. Didn't know that. I wrote this since I needed the same rewrite for my yellow signals, and then I thought I should put it somewhere so it would come to more use. So it ended up here. But then blathijs went ahead and committed it...


This comment was imported from FlySpray: https://bugs.openttd.org/task/19#comment72

@DorpsGek
Copy link
Member Author

DorpsGek commented Jan 6, 2006

egladil wrote:

Also, now that i've actually read map_accessors.r3360.diff, I think you should take a look at this for a cleaner (at least I think so) way of doing ChangeSignalStates.

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/19#comment73

@DorpsGek
Copy link
Member Author

DorpsGek commented Feb 3, 2006

LordOfThePigs wrote:

You are making great progress guys. I'm sorry I haven't been able to help much since my first patch. But I have more work than I can manage... So I'm afraid I won't be able to find some free time before a week or two.


This comment was imported from FlySpray: https://bugs.openttd.org/task/19#comment99

@DorpsGek
Copy link
Member Author

peter1138 closed the ticket.

Reason for closing: Implemented

Kind of... :-)


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

@DorpsGek DorpsGek added Core 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 labels Apr 6, 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