SDLPP: add texture flipping/rotation
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#include "sdlpp_vector.hpp"
|
||||
#include "sdlpp_visitor.hpp"
|
||||
|
||||
#include <SDL2/SDL_render.h>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
@@ -111,6 +112,11 @@ public:
|
||||
void animate( int ticks );
|
||||
void visit( Visitor &visitor );
|
||||
void setAlignment( ObjectAlignment horizontal, ObjectAlignment vertical );
|
||||
void flipHorizontally();
|
||||
void flipVertically();
|
||||
void setRotationCenter( const Vec2D< double > ¢er );
|
||||
void rotateClockwise( int angle );
|
||||
void rotateCounterClockwise( int angle );
|
||||
|
||||
protected:
|
||||
virtual void copyTo( std::shared_ptr< RenderObject > other );
|
||||
@@ -140,6 +146,10 @@ protected:
|
||||
int animation_next_frame_base = 0;
|
||||
std::vector< SDL_Rect > animation{};
|
||||
bool animating = true;
|
||||
SDL_RendererFlip flip = SDL_FLIP_NONE;
|
||||
Vec2D< double > rotation_center = { -1, -1 };
|
||||
SDL_Point rotation_center_point;
|
||||
int rotation_angle = 0;
|
||||
|
||||
private:
|
||||
friend Scene;
|
||||
|
||||
Reference in New Issue
Block a user