Preview source 3.0v
Posted: 23 Jul 2022 02:26
Went to work on the roadvehicle code, trying to find my way through it all by the usual splitting of
large functions and refactoring until I found the parts where I could add timetable waiting.
The completely different way it's set up compared to the train code took more time to figure it out.
I noticed in the meantime that every time I split up a large function, the size of the executable would
decrease a little. GCC seems to be able to optimise smaller static functions better.
I also modified the generic data variables for the CommandContainer struct and begun cleaning
up the function using it. One of the effects has been to remove rail track helper functions and have building and
removing rail tracks done directly by the intended executing function.
While refactoring I tried out several more ways to format code for readability, and I think I now have a
general style to work with.
Moved roadveh* files into the vehicle subdirectory, and made a few more chages to several others, including
one that hopefully broke the circular class dependency between Vehicle and Order.
During all this it became obvious all is not well with header file inclusions. I even had to add system or
stdafx.h to files in the core directory.
Well, on to aircraft and ship refactoring. Planes keep circling the same airport now because of the changes
for road vehicles.
src directory to replace in 12.2 source code: .
large functions and refactoring until I found the parts where I could add timetable waiting.
The completely different way it's set up compared to the train code took more time to figure it out.
I noticed in the meantime that every time I split up a large function, the size of the executable would
decrease a little. GCC seems to be able to optimise smaller static functions better.
I also modified the generic data variables for the CommandContainer struct and begun cleaning
up the function using it. One of the effects has been to remove rail track helper functions and have building and
removing rail tracks done directly by the intended executing function.
While refactoring I tried out several more ways to format code for readability, and I think I now have a
general style to work with.
Moved roadveh* files into the vehicle subdirectory, and made a few more chages to several others, including
one that hopefully broke the circular class dependency between Vehicle and Order.
During all this it became obvious all is not well with header file inclusions. I even had to add system or
stdafx.h to files in the core directory.
Well, on to aircraft and ship refactoring. Planes keep circling the same airport now because of the changes
for road vehicles.
src directory to replace in 12.2 source code: .