One work-around would be to pre-render the different variations of your sprite into frames, then show the appropriate frame for the given situation.
But if you're looking for a more physics-based approached that can really adapt to a variety of situations, who's unique combinations would be way too numerous to use pre-rendered frames, I would suggest using an open-source version of DarkGDK. It was written in C++ too, so there's no need for inline assembly unless you're just looking for speed. You can, running in debug mode, step into some of the sprite handing functions and find your way around the relevant source code. Then create and add whatever additional functions you need to your copy of DarkGDK itself.
You can download the source-code here (the second post):
https://forum.thegamecreators.com/thread/209827Judging what we see is the greatest blinder and self-limiter in the universe.
What we perceive is never reality. It is only a story we tell ourselves based on our current perspective, which has far more to do with our beliefs about ourselves than with anything else.