28 #include "swe_object.h" 29 #include "swe_colors.h" 39 enum { FlipNone = 0, FlipHorizontal = 0x01, FlipVertical = 0x02 };
41 enum { FlipNone = SDL_FLIP_NONE, FlipHorizontal = SDL_FLIP_HORIZONTAL, FlipVertical = SDL_FLIP_VERTICAL };
43 enum { Rotate90Degrees = 0x04, Rotate180Degrees = 0x08, Rotate270Degrees = 0x10, FlipRotate = Rotate90Degrees | Rotate180Degrees | Rotate270Degrees };
46 typedef SDL_Surface SDL_Texture;
49 enum { None, Blend, Add, Mod };
54 enum { None = SDL_BLENDMODE_NONE, Blend = SDL_BLENDMODE_BLEND, Add = SDL_BLENDMODE_ADD, Mod = SDL_BLENDMODE_MOD };
60 u32 pixel1(
const Point &)
const;
61 u32 pixel2(
const Point &)
const;
62 u32 pixel3(
const Point &)
const;
63 u32 pixel4(
const Point &)
const;
65 void draw1(
const Point &, u32 pixel);
66 void draw2(
const Point &, u32 pixel);
67 void draw3(
const Point &, u32 pixel);
68 void draw4(
const Point &, u32 pixel);
88 bool isValid(
void)
const;
89 SDL_Surface* toSDLSurface(
void)
const;
91 bool operator== (
const Surface & sf)
const;
92 bool operator!= (
const Surface & sf)
const;
94 void setSurface(
const Surface &);
98 void convertToDisplayFormat(
void);
101 int width(
void)
const;
102 int height(
void)
const;
103 Size size(
void)
const;
104 Rect rect(
void)
const;
105 int alphaMod(
void)
const;
106 u32 amask(
void)
const;
107 int flags(
void)
const;
108 Color colorKey(
void)
const;
109 u32 pixel(
const Point &)
const;
111 u32 mapRGB(
const Color &)
const;
112 Color RGBmap(u32)
const;
116 void clear(
const Color & col);
118 void drawPixel(
const Point &, u32);
119 bool save(
const std::string &)
const;
122 void setColorKey(
const Color &);
123 void setAlphaMod(
int);
125 void resetFlags(
int);
130 std::string toString(
void)
const;
131 const char*
className(
void)
const override {
return "SWE::Surface"; }
133 JsonObject toJson(
void)
const override;
142 if(sf) sf->refcount++;
147 const char* blendModeString(
int);
157 std::shared_ptr<SDL_Texture> ptr;
177 bool operator== (
const Texture &)
const;
178 bool operator!= (
const Texture &)
const;
180 void setTexture(
const Texture &);
181 void setAlphaMod(
int);
182 void setColorMod(
const Color &);
183 void setBlendMode(
int);
185 bool isValid(
void)
const;
186 SDL_Texture* toSDLTexture(
void)
const;
188 int width(
void)
const;
189 int height(
void)
const;
190 int alphaMod(
void)
const;
191 Color colorMod(
void)
const;
192 int blendMode(
void)
const;
193 Size size(
void)
const;
194 Rect rect(
void)
const;
198 bool save(
const std::string &)
const;
203 std::string toString(
void)
const;
204 const char*
className(
void)
const override {
return "SWE::Texture"; }
206 JsonObject toJson(
void)
const override;
221 void setPosition(
const Point & pt);
222 void setPosition(
int posx,
int posy);
224 const Point & position(
void)
const;
225 const Texture & texture(
void)
const;
226 Rect area(
void)
const;
230 const char*
className(
void)
const override {
return "SWE::TexturePos"; }
232 JsonObject toJson(
void)
const override;
Definition: swe_surface.h:154
Definition: swe_surface.h:137
пространство SWE.
Definition: swe_binarybuf.cpp:30
класс прямоугольника
Definition: swe_rect.h:144
класс точки с двумя координатами
Definition: swe_rect.h:72
const char * className(void) const override
идентификацинная метка класса
Definition: swe_surface.h:204
класс цвета
Definition: swe_colors.h:65
Definition: swe_surface.h:210
класс бинарного массива
Definition: swe_binarybuf.h:35
класс двухмерной размерности
Definition: swe_rect.h:36
Definition: swe_surface.h:58
const char * className(void) const override
идентификацинная метка класса
Definition: swe_surface.h:131
родительский класс объектов сцены DisplayScene.
Definition: swe_object.h:38
const char * className(void) const override
идентификацинная метка класса
Definition: swe_surface.h:230