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 SURFACEGRAPHICS_H
24
#define SURFACEGRAPHICS_H
28
#include "localconsts.h"
31
class ImageCollection;
38
* A central point of control for graphics.
40
class SurfaceGraphics : public Graphics
51
A_DELETE_COPY(SurfaceGraphics)
53
virtual ~SurfaceGraphics();
55
void setTarget(SDL_Surface *const target)
58
SDL_Surface *getTarget() const
67
bool pushClipArea(gcn::Rectangle rect A_UNUSED)
73
bool drawRescaledImage(const Image *const image A_UNUSED,
74
int srcX A_UNUSED, int srcY A_UNUSED,
75
int dstX A_UNUSED, int dstY A_UNUSED,
76
const int width A_UNUSED,
77
const int height A_UNUSED,
78
const int desiredWidth A_UNUSED,
79
const int desiredHeight A_UNUSED,
80
const bool useColor A_UNUSED = false)
83
void drawImagePattern(const Image *const image A_UNUSED,
84
const int x A_UNUSED, const int y A_UNUSED,
85
const int w A_UNUSED, const int h A_UNUSED)
88
void drawRescaledImagePattern(const Image *const image A_UNUSED,
93
const int scaledWidth A_UNUSED,
94
const int scaledHeight A_UNUSED)
97
void calcImagePattern(ImageVertexes *const vert A_UNUSED,
98
const Image *const image A_UNUSED,
100
const int y A_UNUSED,
101
const int w A_UNUSED,
102
const int h A_UNUSED) const
105
void calcImagePattern(ImageCollection *const vert A_UNUSED,
106
const Image *const image A_UNUSED,
107
const int x A_UNUSED, const int y A_UNUSED,
108
const int w A_UNUSED, const int h A_UNUSED) const
111
void calcTile(ImageVertexes *const vert A_UNUSED,
112
const Image *const image A_UNUSED,
113
int x A_UNUSED, int y A_UNUSED) const
116
void calcTileSDL(ImageVertexes *const vert A_UNUSED,
117
int x A_UNUSED, int y A_UNUSED) const
120
void calcTile(ImageCollection *const vertCol A_UNUSED,
121
const Image *const image A_UNUSED,
122
int x A_UNUSED, int y A_UNUSED)
125
void drawTile(const ImageVertexes *const vert A_UNUSED)
128
void drawTile(const ImageCollection *const vertCol A_UNUSED)
134
SDL_Surface *getScreenshot() A_WARN_UNUSED
137
bool drawNet(const int x1 A_UNUSED, const int y1 A_UNUSED,
138
const int x2 A_UNUSED, const int y2 A_UNUSED,
139
const int width A_UNUSED, const int height A_UNUSED)
142
bool calcWindow(ImageCollection *const vertCol A_UNUSED,
143
const int x A_UNUSED, const int y A_UNUSED,
144
const int w A_UNUSED, const int h A_UNUSED,
145
const ImageRect &imgRect A_UNUSED)
148
void setBlitMode(const BlitMode mode)
149
{ mBlitMode = mode; }
151
BlitMode getBlitMode() const A_WARN_UNUSED
152
{ return mBlitMode; }
154
void fillRectangle(const gcn::Rectangle &rect A_UNUSED) override
157
void drawRectangle(const gcn::Rectangle &rect A_UNUSED) override
160
void drawPoint(int x A_UNUSED, int y A_UNUSED) override
163
void drawLine(int x1 A_UNUSED, int y1 A_UNUSED,
164
int x2 A_UNUSED, int y2 A_UNUSED) override
167
bool setVideoMode(const int w A_UNUSED, const int h A_UNUSED,
168
const int bpp A_UNUSED,
169
const bool fs A_UNUSED, const bool hwaccel A_UNUSED,
170
const bool resize A_UNUSED,
171
const bool noFrame A_UNUSED)
175
bool drawImage2(const Image *const image,
178
const int width, const int height,
179
const bool useColor);
182
SDL_Surface *mTarget;
185
#endif // SURFACEGRAPHICS_H