Update EffectUtil.cpp and LightUtil.cpp - #1968
Conversation
complete match
| // Instructionswap for some reason | ||
| void addEffectHitNormal(LiveActor* pActor, const char* pEffectName) { | ||
| addEffect(pActor, "HitMarkNormal"); | ||
| char* effectName = "HitMarkNormal"; |
There was a problem hiding this comment.
Should probably be typed to const char*.
| } else if (type == 0) { | ||
| MR::getSceneObj< LightDirector >(SceneObj_LightDirector)->loadLightPlayer(); | ||
| } else { | ||
| AreaLightInfo* lightInfo = reinterpret_cast< AreaLightInfo* >(MR::getSceneObj< LightDirector >(SceneObj_LightDirector)->_18); |
There was a problem hiding this comment.
Preferably edit the declaration of _18 to be typed properly than work around it with reinterpret_cast. It is assigned to in LightDirector::initData using the return value of LightDataHolder::findAreaLight, so you can use that as reference for what to type the member variable to.
| pStrList = &pStrList[1]; | ||
| ModelManager* pModelManager; | ||
| while (pStrList[0]) { | ||
| pModelManager = pActor->mModelManager; | ||
| Effect::addEffectSyncBck(::getEffectKeeper(pActor)->getEmitter(pEffectName), pModelManager, pStrList[0]); | ||
| pStrList = &pStrList[1]; | ||
| while (*pStrList != nullptr) { | ||
| ModelManager* pModelManager = pActor->mModelManager; | ||
| MultiEmitter* pEmitter = ::getEffectKeeper(pActor)->getEmitter(pEffectName); | ||
| Effect::addEffectSyncBck(pEmitter, pModelManager, *pStrList); | ||
| pStrList++; |
There was a problem hiding this comment.
Can this be converted to a for loop and still match?
There was a problem hiding this comment.
I took hours to find a 100% matching while loop...
There was a problem hiding this comment.
Yeah, but this kinda looks like a for loop. It happens :(
| const char* str; | ||
| while (str = tempStrList[0], tempStrList = &tempStrList[1], str) { | ||
| i++; | ||
| const char* const* current = pStrList; | ||
|
|
||
| int size = 0; | ||
| while (str = *current, current++, str) { | ||
| size++; | ||
| } |
There was a problem hiding this comment.
Can this be converted to a for loop and still match without looking ugly?
improved matching with original