Add enhanced animations support for outfits/Fix issue #642#736
Conversation
|
Fixed backwards compatibility (Protocols without enhanced animations had only Idle outfit position) in commit db24490 |
|
Good job. It would be nice though if you could replace tabs with spaces in your changes to keep it consistent with the rest of the files you've modified. Also I don't think the cast to LightView * is necessary, you can simply pass nullptr. |
|
@diath Done. |
|
Nice 👍 |
|
I did not review the code, but thanks for fixing that issue 👍 |
|
Small note to the function Creature::updateWalkAnimation. The thing is footDelay is, by default, set to getStepDuration(true) / 3, so basically animation speed is hardcoded for outfits with 3 animations - hence creatures walk in slow motion. I tried to fix it, but every way I tried I get visible "frameskips". If someone would be willing to fix this issue, it would be great. |
…tity" outfits aswell) and change braces style.
|
I couldn't resist ;> |
|
Does it break compatibility with other versions ? |
|
@conde2 No. In fact all other versions are still compatible with new ThingType loading scheme. Old scheme for new outfits was just skipping FrameGroupIdle and loading only FrameGroupMoving, so I adjusted ThingType class to contain a vector of (new) FrameGroup class' objects', containing all the textures and properties of certain framegroup - so if you load a Thing (outfit), that has only one FrameGroup, then loading functions creates only one object of FrameGroup class, therefore it can still load it properly. |
|
Don't change the code style of other unrelated code if you want it merged, makes hard to review and also diverges from the standard style. |
|
@edubart Since I made a little mess with commits in this pull request, maybe I should create another containing all of changes/additions in the code? |
|
Yes, and only with the actual changes that matters. |
|
It seems that this change breaks outfit image exportng. You can reproduce it by opening the client terminal (^T) and typing in the following: g_things.getThingType(128, ThingCategoryCreature):exportImage('test.png')Prior to applying this patch, this would export the outfit sprites into test.png, after applying the patch it does nothing. It seems that it does not pass this check in ThingType::exportImage function: if (m_frameGroups[i]->m_spritesIndex.size() == 0) {I think that you're also introducing a memory leak by not deleting the contents of m_frameGroups in ThingType's destructor, either iterate over the container and delete the contents in the destructor or use a smart pointer. |
|
i found a bug... if you are near of a creature that have animations when is idle (like wyvern), you get a crash. Debuging, i found the wrong line.
function getAnimationPhases() returns zero, and raise an error. |
|
I managed the problem changing code a little bit...
|
|
Belizario jr can pass me your creature.cpp ?? As he said above, Bat, Wyvern, Fire Elemental etc ... creatures that do not stop animation, makes the client crashing. |
|
thank you dude, more is creature.cpp xD not creatures.cpp in which you applied the fix if (isAnimateAlways () && animateIdle) {type = FrameGroupMoving; ticksPerFrame int = 1000 / getAnimationPhases (type); animationPhase = (g_clock.millis ()% (* ticksPerFrame getAnimationPhases (type))) / ticksPerFrame; for (int yPattern = 0; yPattern <getNumPatternY (type); yPattern ++) { |
|
ahhh.... sorry, my bad... |
|
Thanks man xD, |
|
Any news? |
|
@totolol123 Since I started uni this September (not related to programming) I pretty much don't have time to resolve issues in this PR or do any programming, so if any dev would be willing to fix these issues, feel free to do it, just give me credits if you'll start from my work. If no one takes this case, then most likely I will start to work on it on spring break. |
|
when you walk with spells like "utani hur" the speed of the animation its more faster than the needed to walk :/ |
…edubart#736) * fix: crash game_entergame if httpLoginBox is boolean ( edubart#647 ) * fix: game_entergame if host nil windows is hidden * temp fix: game_entergame windows is not centered the original bug is in I don't have how to test I don't use token EnterGame.toggleAuthenticatorToken EnterGame.toggleStayLoggedBox
* fix: [game_entergame] loadBox in old protocol The modification made to edubart#736 of loadBox was in the wrong place in the code. causes display loadBox in old protocols. * fix: If you try to login without assets. * fix: indentation Reviewer: luanluciano93
Finally managed to do a little. Enjoy, folks ;)