-
Notifications
You must be signed in to change notification settings - Fork 182
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
Truckparser2021 prep (code cleanup only) #2829
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
f6ae57d
to
6d0dbc4
Compare
9b7de88
to
10408ea
Compare
e2ed996
to
238c4b3
Compare
Parser: added *_set flags for all optional args Spawner: respect *_set flags for all optional args Serializer: don't write out un*_set flags
Actor.h/cpp: `CalcAnimators()` - Deleted outdated comments, useless params and dead code. ActorForcesEuler.cpp: `CalcHydros()` - Removed dummy variable `flagstate`. RigDef_File.h/RigDef_Parser.cpp/ActorSpawner.cpp: changed aeroengine number from 1-based to 0-based.
RigDef_File.h - corrected some Keyword names, added some missing RigDef_Regexes.h - fixed alphabetical order of axles/authors, added missing keywords (not in use yet, but soon). RigDef_File.cpp - added missing bits (many!) to KeywordToString() parser/spawner - just find&replaced enum names.
'submesh', 'forset' are now directives. 'texcoords', 'cab' are now sections. removed enum `Subsection`.
keywords "comment/end_comment" and "description/end_description" are now tracked by `m_current_block`, bools were removed.
function ActorSpawner::Setup() absorbed into ActorSpawner::SpawnActor(), which was then renamed to ProcessNewActor() to differentiate from GameContext::SpawnActor(). Also creating Renderdash moved at the start of ProcessNewActor()
CreateGfxActor() absorbed into ProcessNewActor()
GfxActor.h/cpp: factored out InitializeSimBuffers() from constructor.
Removed temporary storage `m_gfx_nodes` in ActorSpawner. GfxActor: created functions AddNode(), SetNodeHot().
ActorSpawner.h: Removed useless queuing mechanism ActorSpawner.cpp: CreateBeamVisuals() now does full setup - absorbed code from GfxActor::AddRod() GfxActor: simplified, just maintains an array of BeamGfx
ActorSpawner.h: eliminated "joke" Ticket/Queue system for wheel visuals. Added function CreateFlexBodyWheelVisuals() ActorSpawner.cpp: wheel visuals code from FinalizeGfxSetup moved directly to [Build/Create]*Wheel*Visuals() functions, including the new one above. GfxActor: consistency++ :)
GfxActor: func InitializeSimBuffers() absorbed into UpdateSimDataBuffer() ActorSpawner: removed calls to InitializeSimBuffers()
motivation: I abandoned the notion of "attribute (xa_) vs. state (simbuf_)" elements. SimBuffers.h: xa_ elements renamed to simbuf_ and distributed to their groups GfxActor.h: removed func GetAttributes(). added members helpmat, helptex extracted from simbuffer. GfxActor.cpp: major tidy-up of UpdateSimDataBuffer(), order matched to that of `struct ActorSB`. ActorSpawner.cpp: assign new GfxActor members helpmat, helptex. GUI_VehicleDescription.cpp: use helptex. OverlayWrapper.cpp: use helpmat. other sources: find&replace
Code migrated from functions `AddModule()`.
Deleted excess /** */ comments with minimal value. Added doxygen groups.
While at it, I extracted the cab setup code to new function CreateCabVisual().
Removed temporary storage in ActorSpawner
function GfxActor::RegisterAirbrakes() absorbed by ActorSpawner::ProcessAirbrake().
GfxActor::AddMaterialFlare() -> ActorSpawner::CreateMaterialFlare() motivation = consistency.
e839459
to
2502ac9
Compare
tritonas00
approved these changes
May 28, 2022
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is only code cleanup - no feature changes.
I removed the remaining useless cruft I introduced back in 2013 when reworking the parser for the 1st time. A lot of it disappeared throughout the years but not all.
I also corrected all irregularities which appeared throughout the years in between.
The motivation for this is preparation for upcoming fixes: