3
* Copyright (C) 2004-2009 The Mana World Development Team
4
* Copyright (C) 2009-2010 The Mana Developers
5
* Copyright (C) 2011-2013 The ManaPlus Developers
7
* This file is part of The ManaPlus Client.
9
* This program is free software; you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation; either version 2 of the License, or
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
19
* You should have received a copy of the GNU General Public License
20
* along with this program. If not, see <http://www.gnu.org/licenses/>.
27
#include "sdl2graphics.h"
33
#include "localconsts.h"
36
class ImageCollection;
43
* A central point of control for graphics.
45
class SDLGraphics : public Graphics
53
A_DELETE_COPY(SDLGraphics)
58
virtual ~SDLGraphics();
64
bool pushClipArea(gcn::Rectangle rect);
68
virtual bool drawRescaledImage(const Image *const image, int srcX,
69
int srcY, int dstX, int dstY,
70
const int width, const int height,
71
const int desiredWidth,
72
const int desiredHeight,
73
const bool useColor = false);
75
virtual void drawImagePattern(const Image *const image,
76
const int x, const int y,
77
const int w, const int h);
79
virtual void drawRescaledImagePattern(const Image *const image,
80
const int x, const int y,
81
const int w, const int h,
82
const int scaledWidth,
83
const int scaledHeight);
85
virtual void calcImagePattern(ImageVertexes *const vert,
86
const Image *const image,
87
const int x, const int y,
88
const int w, const int h) const;
90
virtual void calcImagePattern(ImageCollection *const vert,
91
const Image *const image,
92
const int x, const int y,
93
const int w, const int h) const;
95
virtual void calcTile(ImageVertexes *const vert,
96
const Image *const image, int x, int y) const;
98
virtual void calcTileSDL(ImageVertexes *const vert,
101
virtual void calcTile(ImageCollection *const vertCol,
102
const Image *const image,
105
virtual void drawTile(const ImageVertexes *const vert);
107
virtual void drawTile(const ImageCollection *const vertCol);
109
virtual void updateScreen();
111
virtual SDL_Surface *getScreenshot() A_WARN_UNUSED;
113
virtual bool drawNet(const int x1, const int y1,
114
const int x2, const int y2,
115
const int width, const int height);
117
virtual bool calcWindow(ImageCollection *const vertCol,
118
const int x, const int y,
119
const int w, const int h,
120
const ImageRect &imgRect);
122
void fillRectangle(const gcn::Rectangle &rect) override;
124
void drawRectangle(const gcn::Rectangle &rect) override;
126
void drawPoint(int x, int y) override;
128
void drawLine(int x1, int y1, int x2, int y2) override;
130
bool setVideoMode(const int w, const int h, const int bpp,
131
const bool fs, const bool hwaccel,
132
const bool resize, const bool noFrame);
135
virtual bool drawImage2(const Image *const image,
138
const int width, const int height,
139
const bool useColor);
141
int SDL_FakeUpperBlit(const SDL_Surface *const src,
142
SDL_Rect *const srcrect,
143
const SDL_Surface *const dst,
144
SDL_Rect *dstrect) const;
146
void drawHLine(int x1, int y, int x2);
148
void drawVLine(int x, int y1, int y2);
155
#endif // SDLGRAPHICS_H