utility: Implement ParemeterBase::createByTypeName#23
utility: Implement ParemeterBase::createByTypeName#23german77 wants to merge 7 commits intoopen-ead:masterfrom
ParemeterBase::createByTypeName#23Conversation
include/utility/aglParameter.h
Outdated
| return; | ||
| this->mValue = data; | ||
| // TODO: Check this cast | ||
| this->mValue = const_cast<T*>(reinterpret_cast<const T*>(data)); |
There was a problem hiding this comment.
The inner cast can just be a static_cast, but yeah the const_cast looks a bit dodgy. Is it possible that mValue is const qualified?
There was a problem hiding this comment.
AL has almost a copy paste implementation of ParameterBase. So far mValue is only const for cstrings types.
https://github.com/MonsterDruide1/OdysseyDecomp/blob/master/lib/al/Library/Yaml/ParameterBase.h#L191
|
are you sure the hpp doesn't exist? I could be misremembering but I think it might have been done this way because of some asserts in Labo. though I guess it doesn't really matter |
|
I don't have any file info. All I can see are inlined calls and it looked really weird to have the cpp directly included in the header |
9a0f4e3 to
eda9251
Compare
|
I reverted the ParameterCurve changes. It makes no difference for this function, if an assert says the file is this way I have no problem with that. |
|
yeah so I've just checked Labo and it looks like the asserts for ParameterCurve are in a file called aglParameterCurve.hpp. note that it's .hpp, not .cpp, and we know Nintendo does this kind of thing as seadSafeString.h/hpp/cpp is a thing too |
1a3777b to
08d1ee6
Compare
|
The function has been matched! Please run the workflow. |
MonsterDruide1
left a comment
There was a problem hiding this comment.
@MonsterDruide1 reviewed 4 files and all commit messages, made 1 comment, resolved 1 discussion, and dismissed @leoetlino from a discussion.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on german77).
src/utility/aglParameter.cpp line 419 at r8 (raw file):
ParameterBase* ParameterBase::createByTypeName(const sead::SafeString& name, const sead::SafeString& value) {
adjust in header accordingly
Suggestion:
const sead::SafeString& bufferSize107c8f2 to
5818eb3
Compare
german77
left a comment
There was a problem hiding this comment.
@german77 made 1 comment.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on MonsterDruide1).
src/utility/aglParameter.cpp line 419 at r8 (raw file):
Previously, MonsterDruide1 wrote…
adjust in header accordingly
Done.
5818eb3 to
132d064
Compare
Supersedes #22 by implementing the actual function. This has the same effect as previous PR but keeps all the previous matches intact and adds 77 new matches.
This also removes a hack with ParameterCurve that for some reason was added to the header.The function itself is not matching but really close. Most differences are inFixed!ParameterCurveandParameterBufferinitialization. The inlining here is a killer, ghidra doesn't want to assign the correct types, the branching is chaos and reading asm is not fun in a function with this size.I will keep working on it but I don't expect any significant improvements in a few weeks.
https://decomp.me/scratch/N8MEk
This change is