Replies: 2 comments 3 replies
-
Are there examples of said types? There should only be "Skeleton", "Background" and "Multi" afaik. |
Beta Was this translation helpful? Give feedback.
3 replies
-
I wrote down public modifier parts of current structure. It is about mdlx parsers. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
MDLX major refactor
Why
The current
Mdlx
implementation is fundamentally badly designed.A MDLX is a file extension that is internally stored as a BAR file. yet the
Kh2.Mdlx
parser does operate on a file within a MDLX file. It does not make much sense. TheKh2.Mdlx
really is a model parser.Kingdom Hearts II has different model types:
Each of them contains their own fields, flags and properties and they share very little in common. Yet our current
Kh2.Mdlx
tries to do everything. This lead the introduction ofKh2.Mdlx.IsEntity
andKh2.Mdlx.IsMap
to circumnavigate the bad design of the parser.How
Separate each model type into their own class (eg.
ModelLegacy
,ModelBackground
) and let them implement the abstracted classModel
.Model.Read
andModel.Write
will parse and write a model file as usual, but internally they will use the appropriate implementation based on the model type.Model
needs to have virtual methods such asGetDrawPolygonCount
andGetDrawChain
. The methodGetDrawChain
will be extremely important as it will completely abstract from the draw engine how models are supposed to be rendered. The draw engine will just get a draw chain from the model and render it, unaware of the underlying implementation.My suggestion is to slowly transition to the new format. Create
Model
and the underlying model types and wrap them into the existingMdlx
parser. OnceMdlx
becomes no more than an empty shell, delete it and exposeModel
directly.Beta Was this translation helpful? Give feedback.
All reactions