ManaPlus
imagegraphics.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-2018 The ManaPlus Developers
6  *
7  * This file is part of The ManaPlus Client.
8  *
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
12  * any later version.
13  *
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.
18  *
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/>.
21  */
22 
23 #ifndef RENDER_IMAGEGRAPHICS_H
24 #define RENDER_IMAGEGRAPHICS_H
25 
26 #ifdef USE_OPENGL
27 
28 #include "render/graphics.h"
29 
30 #include "localconsts.h"
31 
32 class Image;
33 class ImageCollection;
34 class ImageVertexes;
35 
40 {
41  public:
42  ImegeGraphics();
43 
45 
46  ~ImegeGraphics() override final;
47 
48  void setTarget(Image *const target) restrict2 noexcept2
49  { mTarget = target; }
50 
52  { return mTarget; }
53 
55  { }
56 
58  { }
59 
60  void pushClipArea(const Rect &restrict rect A_UNUSED)
61  restrict2 override final
62  { }
63 
65  { }
66 
67  void drawRescaledImage(const Image *restrict const image A_UNUSED,
68  int dstX A_UNUSED, int dstY A_UNUSED,
69  const int desiredWidth A_UNUSED,
70  const int desiredHeight A_UNUSED)
71  restrict2 override final
72  { }
73 
74  void drawPattern(const Image *restrict const image A_UNUSED,
75  const int x A_UNUSED,
76  const int y A_UNUSED,
77  const int w A_UNUSED,
78  const int h A_UNUSED) restrict2 override final
79  { }
80 
81  void drawRescaledPattern(const Image *const image A_UNUSED,
82  const int x A_UNUSED,
83  const int y A_UNUSED,
84  const int w A_UNUSED,
85  const int h A_UNUSED,
86  const int scaledWidth A_UNUSED,
87  const int scaledHeight A_UNUSED)
88  override final
89  { }
90 
92  const Image *restrict const image A_UNUSED,
93  const int x A_UNUSED,
94  const int y A_UNUSED,
95  const int w A_UNUSED,
96  const int h A_UNUSED) const restrict2 override final
97  { }
98 
100  const Image *restrict const image A_UNUSED,
101  const int x A_UNUSED,
102  const int y A_UNUSED,
103  const int w A_UNUSED,
104  const int h A_UNUSED) const restrict2 override final
105  { }
106 
108  const Image *restrict const image A_UNUSED,
109  int x A_UNUSED,
110  int y A_UNUSED) const restrict2 override final
111  A_NONNULL(2, 3)
112  { }
113 
115  int x A_UNUSED,
116  int y A_UNUSED) const restrict2 override final
117  { }
118 
120  vertCol A_UNUSED,
121  const Image *restrict const image A_UNUSED,
122  int x A_UNUSED,
123  int y A_UNUSED) restrict2 override final
124  { }
125 
126  void drawTileVertexes(const ImageVertexes *const
127  vert A_UNUSED) override final
128  { }
129 
130  void drawTileCollection(const ImageCollection *const vertCol A_UNUSED)
131  override final A_NONNULL(2)
132  { }
133 
135  { }
136 
137  void drawNet(const int x1 A_UNUSED,
138  const int y1 A_UNUSED,
139  const int x2 A_UNUSED,
140  const int y2 A_UNUSED,
141  const int width A_UNUSED,
142  const int height A_UNUSED) override final
143  { }
144 
146  const int x A_UNUSED, const int y A_UNUSED,
147  const int w A_UNUSED, const int h A_UNUSED,
148  const ImageRect &restrict imgRect A_UNUSED)
149  restrict2 override final A_NONNULL(2)
150  { }
151 
152  void fillRectangle(const Rect &rect A_UNUSED) override final
153  { }
154 
155  void drawRectangle(const Rect &rect A_UNUSED) restrict2 override final
156  { }
157 
158  void drawPoint(int x A_UNUSED, int y A_UNUSED) override final
159  { }
160 
161  void drawLine(int x1 A_UNUSED, int y1 A_UNUSED,
162  int x2 A_UNUSED, int y2 A_UNUSED)
163  restrict2 override final
164  { }
165 
166  bool setVideoMode(const int w A_UNUSED, const int h A_UNUSED,
167  const int scale 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,
172  const bool allowHighDPI A_UNUSED)
173  restrict2 override final
174  { return false; }
175 
176  void drawImage(const Image *const image,
177  int dstX, int dstY) override final;
178 
179  void copyImage(const Image *const image,
180  int dstX, int dstY) restrict2 override final;
181 
182  void drawImageCached(const Image *const image,
183  int x, int y) override final;
184 
185  void drawPatternCached(const Image *restrict const image A_UNUSED,
186  const int x A_UNUSED,
187  const int y A_UNUSED,
188  const int w A_UNUSED,
189  const int h A_UNUSED) restrict2 override final
190  { }
191 
192  void completeCache() restrict2 override final;
193 
198  void drawImageRect(const int x A_UNUSED, const int y A_UNUSED,
199  const int w A_UNUSED, const int h A_UNUSED,
200  const ImageRect &imgRect A_UNUSED) override final
201  { }
202 
203  protected:
205 };
206 
207 #endif // USE_OPENGL
208 #endif // RENDER_IMAGEGRAPHICS_H
#define A_DELETE_COPY(func)
Definition: localconsts.h:52
void calcTileSDL(ImageVertexes *const vert, int x, int y) const
Image * getTarget() const
Definition: imagegraphics.h:51
void drawTileVertexes(const ImageVertexes *const vert)
void fillRectangle(const Rect &rect)
void calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect)
void updateScreen()
Definition: rect.h:72
void completeCache()
#define final
Definition: localconsts.h:45
void calcPattern(ImageCollection *const vert, const Image *const image, const int x, const int y, const int w, const int h) const
Definition: imagegraphics.h:99
void drawPattern(const Image *const image, const int x, const int y, const int w, const int h)
Definition: imagegraphics.h:74
void drawRectangle(const Rect &rect)
#define A_NONNULL(...)
Definition: localconsts.h:179
void drawImage(const Image *const image, int dstX, int dstY)
void calcTileVertexes(ImageVertexes *const vert, const Image *const image, int x, int y) const
void drawNet(const int x1, const int y1, const int x2, const int y2, const int width, const int height)
void setTarget(Image *const target)
Definition: imagegraphics.h:48
void drawRescaledImage(const Image *const image, int dstX, int dstY, const int desiredWidth, const int desiredHeight)
Definition: imagegraphics.h:67
void calcTileCollection(ImageCollection *const vertCol, const Image *const image, int x, int y)
void drawRescaledPattern(const Image *const image, const int x, const int y, const int w, const int h, const int scaledWidth, const int scaledHeight)
Definition: imagegraphics.h:81
void pushClipArea(const Rect &rect)
Definition: imagegraphics.h:60
void drawPatternCached(const Image *const image, const int x, const int y, const int w, const int h)
void beginDraw()
Definition: imagegraphics.h:54
void calcPattern(ImageVertexes *const vert, const Image *const image, const int x, const int y, const int w, const int h) const
Definition: imagegraphics.h:91
#define A_UNUSED
Definition: localconsts.h:171
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)
Definition: image.h:61
void drawTileCollection(const ImageCollection *const vertCol)
void popClipArea()
Definition: imagegraphics.h:64
#define restrict
Definition: localconsts.h:176
#define override
Definition: localconsts.h:46
void drawImageCached(const Image *const image, int x, int y)
void copyImage(const Image *const image, int dstX, int dstY)
void drawImageRect(const int x, const int y, const int w, const int h, const ImageRect &imgRect)
#define noexcept2
Definition: localconsts.h:49
#define restrict2
Definition: localconsts.h:177
void drawLine(int x1, int y1, int x2, int y2)
void drawPoint(int x, int y)