PDA

View Full Version : Horizontal flip



rzuf
12-07-2010, 12:25 PM
Is there any easy way to flip entity horizontally? :whistling:

Seth
12-07-2010, 01:25 PM
Is there any easy way to flip entity horizontally? :whistling:

Hmm, no there isn't. OverlayRenderComponent.cpp respects a "rotation" parm which would work if you didn't need it mirrored..

There is a way to make a Surface blit mirrored though:


//blit the logo with the Y mirrored (this snippet works from in RTBareBones's App::Draw)
rtRect texRect = rtRect(0, m_surf.GetHeight(), m_surf.GetWidth(), 0);
rtRect destRect = rtRect(0,0, m_surf.GetWidth(), m_surf.GetHeight());
m_surf.BlitEx(destRect, texRect);

Using that trick, it wouldn't be too hard to make OverlayRenderComponent.cpp respect a "flipx" and "flipy" parm. (I guess it should be a uint of 0 or 1 for speed..)

Well, actually it would be a problem since I don't think there is a BlitEx in SurfaceAnim (a subclass of Surface), which means it wouldn't work for anims unless SurfaceAnim added some stuff too.

rzuf
12-07-2010, 01:36 PM
Well, actually it would be a problem since I don't think there is a BlitEx in SurfaceAnim (a subclass of Surface), which means it wouldn't work for anims unless SurfaceAnim added some stuff too.
:(
Guess I'll just make some additional textures for now.
Thanks. :)