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/>.
23
#ifndef SDL2GRAPHICS_H
24
#define SDL2GRAPHICS_H
30
#include "localconsts.h"
33
class ImageCollection;
40
* A central point of control for graphics.
42
class SDLGraphics : public Graphics
50
A_DELETE_COPY(SDLGraphics)
55
virtual ~SDLGraphics();
61
bool pushClipArea(gcn::Rectangle rect);
65
virtual bool drawRescaledImage(const Image *const image, int srcX,
66
int srcY, int dstX, int dstY,
67
const int width, const int height,
68
const int desiredWidth,
69
const int desiredHeight,
70
const bool useColor = false);
72
virtual void drawImagePattern(const Image *const image,
73
const int x, const int y,
74
const int w, const int h);
76
virtual void drawRescaledImagePattern(const Image *const image,
77
const int x, const int y,
78
const int w, const int h,
79
const int scaledWidth,
80
const int scaledHeight);
82
virtual void calcImagePattern(ImageVertexes *const vert,
83
const Image *const image,
84
const int x, const int y,
85
const int w, const int h) const;
87
virtual void calcImagePattern(ImageCollection *const vert,
88
const Image *const image,
89
const int x, const int y,
90
const int w, const int h) const;
92
virtual void calcTile(ImageVertexes *const vert,
93
const Image *const image, int x, int y) const;
95
virtual void calcTileSDL(ImageVertexes *const vert,
98
virtual void calcTile(ImageCollection *const vertCol,
99
const Image *const image,
102
virtual void drawTile(const ImageVertexes *const vert);
104
virtual void drawTile(const ImageCollection *const vertCol);
106
virtual void updateScreen();
108
virtual SDL_Surface *getScreenshot() A_WARN_UNUSED;
110
virtual bool drawNet(const int x1, const int y1,
111
const int x2, const int y2,
112
const int width, const int height);
114
virtual bool calcWindow(ImageCollection *const vertCol,
115
const int x, const int y,
116
const int w, const int h,
117
const ImageRect &imgRect);
119
void fillRectangle(const gcn::Rectangle &rect) override;
121
void drawRectangle(const gcn::Rectangle &rect) override;
123
void drawPoint(int x, int y) override;
125
void drawLine(int x1, int y1, int x2, int y2) override;
127
bool setVideoMode(const int w, const int h, const int bpp,
128
const bool fs, const bool hwaccel,
129
const bool resize, const bool noFrame);
132
virtual bool drawImage2(const Image *const image,
135
const int width, const int height,
136
const bool useColor);
143
#endif // SDL2GRAPHICS_H