ManaPlus
surfacegraphics.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2004-2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2019 The ManaPlus Developers
6  * Copyright (C) 2019-2021 Andrei Karas
7  *
8  * This file is part of The ManaPlus Client.
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef RENDER_SURFACEGRAPHICS_H
25 #define RENDER_SURFACEGRAPHICS_H
26 
27 #include "enums/render/blitmode.h"
28 
29 #include "render/graphics.h"
30 
31 #include "localconsts.h"
32 
33 class Image;
34 class ImageCollection;
35 class ImageVertexes;
36 
41 {
42  public:
44 
46 
47  ~SurfaceGraphics() override final;
48 
49  void setTarget(SDL_Surface *restrict const target) restrict2 noexcept2
50  { mTarget = target; }
51 
52  SDL_Surface *getTarget() const restrict2 noexcept2
53  { return mTarget; }
54 
56  { }
57 
59  { }
60 
61  void pushClipArea(const Rect &restrict rect A_UNUSED)
62  restrict2 override final
63  { }
64 
66  { }
67 
68  void drawRescaledImage(const Image *restrict const image A_UNUSED,
69  int dstX A_UNUSED, int dstY A_UNUSED,
70  const int desiredWidth A_UNUSED,
71  const int desiredHeight A_UNUSED)
72  restrict2 override final
73  { }
74 
75  void drawPattern(const Image *restrict const image A_UNUSED,
76  const int x A_UNUSED,
77  const int y A_UNUSED,
78  const int w A_UNUSED,
79  const int h A_UNUSED) restrict2 override final
80  { }
81 
82  void drawRescaledPattern(const Image *const image A_UNUSED,
83  const int x A_UNUSED,
84  const int y A_UNUSED,
85  const int w A_UNUSED,
86  const int h A_UNUSED,
87  const int scaledWidth A_UNUSED,
88  const int scaledHeight A_UNUSED)
89  override final
90  { }
91 
93  const Image *restrict const image A_UNUSED,
94  const int x A_UNUSED,
95  const int y A_UNUSED,
96  const int w A_UNUSED,
97  const int h A_UNUSED) const restrict2 override final
98  { }
99 
101  const Image *restrict const image A_UNUSED,
102  const int x A_UNUSED,
103  const int y A_UNUSED,
104  const int w A_UNUSED,
105  const int h A_UNUSED) const restrict2 override final
106  { }
107 
109  const Image *restrict const image A_UNUSED,
110  int x A_UNUSED,
111  int y A_UNUSED) const restrict2 override final
112  A_NONNULL(2, 3)
113  { }
114 
116  int x A_UNUSED,
117  int y A_UNUSED) const restrict2 override final
118  { }
119 
121  vertCol A_UNUSED,
122  const Image *restrict const image A_UNUSED,
123  int x A_UNUSED,
124  int y A_UNUSED) restrict2 override final
125  { }
126 
128  vert A_UNUSED) restrict2 override final
129  { }
130 
132  vertCol A_UNUSED)
133  restrict2 override final A_NONNULL(2)
134  { }
135 
137  { }
138 
139  void drawNet(const int x1 A_UNUSED,
140  const int y1 A_UNUSED,
141  const int x2 A_UNUSED,
142  const int y2 A_UNUSED,
143  const int width A_UNUSED,
144  const int height A_UNUSED) restrict2 override final
145  { }
146 
148  const int x A_UNUSED, const int y A_UNUSED,
149  const int w A_UNUSED, const int h A_UNUSED,
150  const ImageRect &restrict imgRect A_UNUSED)
151  restrict2 override final A_NONNULL(2)
152  { }
153 
155  { mBlitMode = mode; }
156 
158  { return mBlitMode; }
159 
161  restrict2 override final
162  { }
163 
165  restrict2 override final
166  { }
167 
168  void drawPoint(int x A_UNUSED, int y A_UNUSED) restrict2 override final
169  { }
170 
171  void drawLine(int x1 A_UNUSED, int y1 A_UNUSED,
172  int x2 A_UNUSED, int y2 A_UNUSED)
173  restrict2 override final
174  { }
175 
176  bool setVideoMode(const int w A_UNUSED, const int h A_UNUSED,
177  const int scale A_UNUSED,
178  const int bpp A_UNUSED,
179  const bool fs A_UNUSED, const bool hwaccel A_UNUSED,
180  const bool resize A_UNUSED,
181  const bool noFrame A_UNUSED,
182  const bool allowHighDPI A_UNUSED)
183  restrict2 override final
184  { return false; }
185 
186  void drawImage(const Image *restrict const image,
187  int dstX, int dstY) restrict2 override final;
188 
189  void copyImage(const Image *restrict const image,
190  int dstX, int dstY) restrict2 override final;
191 
192  void drawImageCached(const Image *restrict const image,
193  int x, int y) restrict2 override final;
194 
195  void drawPatternCached(const Image *restrict const image A_UNUSED,
196  const int x A_UNUSED,
197  const int y A_UNUSED,
198  const int w A_UNUSED,
199  const int h A_UNUSED) restrict2 override final
200  { }
201 
203 
208  void drawImageRect(const int x A_UNUSED, const int y A_UNUSED,
209  const int w A_UNUSED, const int h A_UNUSED,
210  const ImageRect &restrict imgRect A_UNUSED)
212  { }
213 
214  protected:
216  SDL_Surface *mTarget;
217 };
218 
219 #endif // RENDER_SURFACEGRAPHICS_H
BlitMode ::T BlitModeT
Definition: blitmode.h:34
Definition: rect.h:74
BlitModeT getBlitMode() const
void copyImage(const Image *const image, int dstX, int dstY)
void drawTileCollection(const ImageCollection *const vertCol)
void pushClipArea(const Rect &rect)
void drawRescaledImage(const Image *const image, int dstX, int dstY, const int desiredWidth, const int desiredHeight)
void drawRescaledPattern(const Image *const image, const int x, const int y, const int w, const int h, const int scaledWidth, const int scaledHeight)
void drawImageCached(const Image *const image, int x, int y)
SDL_Surface * getTarget() const
void drawLine(int x1, int y1, int x2, int y2)
void drawTileVertexes(const ImageVertexes *const vert)
void drawImage(const Image *const image, int dstX, int dstY)
void fillRectangle(const Rect &rect)
void calcTileCollection(ImageCollection *const vertCol, const Image *const image, int x, int y)
void setTarget(SDL_Surface *const target)
void drawImageRect(const int x, const int y, const int w, const int h, const ImageRect &imgRect)
void calcTileVertexes(ImageVertexes *const vert, const Image *const image, int x, int y) const
SDL_Surface * mTarget
void drawPatternCached(const Image *const image, const int x, const int y, const int w, const int h)
void calcTileSDL(ImageVertexes *const vert, int x, int y) const
bool setVideoMode(const int w, const int h, const int scale, const int bpp, const bool fs, const bool hwaccel, const bool resize, const bool noFrame, const bool allowHighDPI)
void setBlitMode(const BlitModeT mode)
void drawPoint(int x, int y)
void drawNet(const int x1, const int y1, const int x2, const int y2, const int width, const int height)
void drawRectangle(const Rect &rect)
void calcPattern(ImageVertexes *const vert, const Image *const image, const int x, const int y, const int w, const int h) const
void drawPattern(const Image *const image, const int x, const int y, const int w, const int h)
void calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect)
void calcPattern(ImageCollection *const vert, const Image *const image, const int x, const int y, const int w, const int h) const
#define restrict
Definition: localconsts.h:165
#define restrict2
Definition: localconsts.h:166
#define override
Definition: localconsts.h:47
#define A_WARN_UNUSED
Definition: localconsts.h:161
#define A_NONNULL(...)
Definition: localconsts.h:168
#define noexcept2
Definition: localconsts.h:50
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53
#define A_UNUSED
Definition: localconsts.h:160