18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 05:57:08 +01:00
Commit Graph

7 Commits

Author SHA1 Message Date
Hirek d0387753f8 refactor(physics): TMoverParameters becomes physics::Vehicle, the mover is gone
The physics of a vehicle loses the name it had from the Pascal of 2001. Done by
tools/rename/mover_to_physics.py, committed with it:

  physics/mover.h                  physics/vehicle.h
  TMoverParameters                 physics::Vehicle (in namespace physics)
  TDynamicObject::MoverParameters  physics
  mvOccupied, mvControlled         occupied, controlled (TTrain, TController)
  mvSecond, mvThird                secondUnit, thirdUnit
  mvPantographUnit                 pantographUnit
  mover, Mover, movers             physics, Physics, vehicles (locals, params)
  m_mover, othermover, currentMover, from_movers, renderMoverEventSounds
                                   m_physics, otherPhysics, currentPhysics,
                                   from_vehicles, renderPhysicsEventSounds

The code and the comments are renamed, the string literals are not: no text
the game shows, logs or looks up has changed (none had the names). The movers
of the editor, the tracks a slide moves, keep their name.

By hand: two member functions of TDynamicObject (gather_off_track_terrain,
begin_off_track) had a local mover aliasing their own MoverParameters, which
the rename made physics { *physics }; the alias is gone, they use physics->.
No other function has a renamed local meeting a renamed member (checked over
all the functions of the code before the rename).

For the branches made before it: run the script on the branch (python
tools/rename/mover_to_physics.py, from the root of the repository) before
merging it with this one, and the names don't conflict. It can be run again;
the second time it changes nothing.

The class is the same as it was; breaking it into its parts (braking,
electrics, controls, load) and making its data private are the next stages.

No change in behaviour: 1149/1149 tests, golden traces exact against staging
62f7a29b.
2026-11-28 23:56:46 +01:00
Hirek 19f884cdbb refactor(physics): the vehicle vocabulary in physics/vehicletypes.h; DynObj.h and Driver.h no longer include mover.h
DynObj.h included physics/mover.h, so nearly every file of the simulator
compiled the whole vehicle physics (TMoverParameters and the brakes) though
most of them only name a vehicle end, a coupling or a light.

- physics/vehicletypes.h: the enums, flags and small structures the rest of
  the simulator passes around (end, side, coupling, light, sound, activation,
  train_type, TEngineType, TBrakeSystem..., TLocation, TTrackShape,
  neighbour_data), moved from mover.h as they were. mover.h includes it.
- DynObj.h and Driver.h include vehicletypes.h; TMoverParameters is forward
  declared (utilities/Classes.h). Their inline accessors that read the mover
  (NextConnected(), GetVelocity(), is_emu(), DirectionalVel()...) are defined
  in DynObj.cpp and Driver.cpp.
- the files that use the mover include physics/mover.h themselves.

Now 140 of the 730 objects of the build depend on mover.h and brakes.h,
about 80 of them unit tests.

No change in behaviour: 1142/1142 tests, golden traces exact against staging
62f7a29b.
2026-11-27 18:53:06 +01:00
Hirek 8c6a47f42c Light the occupied cab with the light points of its model 2026-10-28 21:16:22 +01:00
Hirek 9904eddd0d Light the cab with cablight/dashboardlight light points of the cab model 2026-10-28 20:55:45 +01:00
Hirek c4e23932bf Add the optional Radius, ShadeSelf, CastShadows and SoftFalloff of FreeSpotLight and make FalloffAngle 360 a point light 2026-10-28 16:18:03 +01:00
Hirek 2a876befb0 Shade the sky and the sun by the scenery around the camera instead of the track environment flags 2026-10-27 16:02:36 +01:00
Hirek c48c58776a Vulkan: parity with GL (P1–P7), shared GPU culling records (N6c), threaded command recording and render thread (M1, M4) 2026-10-25 03:06:01 +01:00