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-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_IMAGEGRAPHICS_H
25 #define RENDER_IMAGEGRAPHICS_H
26 
27 #ifdef USE_OPENGL
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:
43  ImegeGraphics();
44 
46 
47  ~ImegeGraphics() override final;
48 
49  void setTarget(Image *const target) restrict2 noexcept2
50  { mTarget = target; }
51 
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 
127  void drawTileVertexes(const ImageVertexes *const
128  vert A_UNUSED) override final
129  { }
130 
131  void drawTileCollection(const ImageCollection *const vertCol A_UNUSED)
132  override final A_NONNULL(2)
133  { }
134 
136  { }
137 
138  void drawNet(const int x1 A_UNUSED,
139  const int y1 A_UNUSED,
140  const int x2 A_UNUSED,
141  const int y2 A_UNUSED,
142  const int width A_UNUSED,
143  const int height A_UNUSED) override final
144  { }
145 
147  const int x A_UNUSED, const int y A_UNUSED,
148  const int w A_UNUSED, const int h A_UNUSED,
149  const ImageRect &restrict imgRect A_UNUSED)
150  restrict2 override final A_NONNULL(2)
151  { }
152 
153  void fillRectangle(const Rect &rect A_UNUSED) override final
154  { }
155 
156  void drawRectangle(const Rect &rect A_UNUSED) restrict2 override final
157  { }
158 
159  void drawPoint(int x A_UNUSED, int y A_UNUSED) override final
160  { }
161 
162  void drawLine(int x1 A_UNUSED, int y1 A_UNUSED,
163  int x2 A_UNUSED, int y2 A_UNUSED)
164  restrict2 override final
165  { }
166 
167  bool setVideoMode(const int w A_UNUSED, const int h A_UNUSED,
168  const int scale A_UNUSED,
169  const int bpp A_UNUSED,
170  const bool fs A_UNUSED, const bool hwaccel A_UNUSED,
171  const bool resize A_UNUSED,
172  const bool noFrame A_UNUSED,
173  const bool allowHighDPI A_UNUSED)
174  restrict2 override final
175  { return false; }
176 
177  void drawImage(const Image *const image,
178  int dstX, int dstY) override final;
179 
180  void copyImage(const Image *const image,
181  int dstX, int dstY) restrict2 override final;
182 
183  void drawImageCached(const Image *const image,
184  int x, int y) override final;
185 
186  void drawPatternCached(const Image *restrict const image A_UNUSED,
187  const int x A_UNUSED,
188  const int y A_UNUSED,
189  const int w A_UNUSED,
190  const int h A_UNUSED) restrict2 override final
191  { }
192 
194 
199  void drawImageRect(const int x A_UNUSED, const int y A_UNUSED,
200  const int w A_UNUSED, const int h A_UNUSED,
201  const ImageRect &imgRect A_UNUSED) override final
202  { }
203 
204  protected:
206 };
207 
208 #endif // USE_OPENGL
209 #endif // RENDER_IMAGEGRAPHICS_H
void copyImage(const Image *const image, int dstX, int dstY)
void drawRectangle(const Rect &rect)
void pushClipArea(const Rect &rect)
Definition: imagegraphics.h:61
void drawImage(const Image *const image, int dstX, int dstY)
void beginDraw()
Definition: imagegraphics.h:55
void fillRectangle(const Rect &rect)
void popClipArea()
Definition: imagegraphics.h:65
void drawRescaledImage(const Image *const image, int dstX, int dstY, const int desiredWidth, const int desiredHeight)
Definition: imagegraphics.h:68
void drawNet(const int x1, const int y1, const int x2, const int y2, const int width, const int height)
void completeCache()
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:92
void calcWindow(ImageCollection *const vertCol, const int x, const int y, const int w, const int h, const ImageRect &imgRect)
void drawImageCached(const Image *const image, int x, int y)
void calcPattern(ImageCollection *const vert, const Image *const image, const int x, const int y, const int w, const int h) 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 drawTileCollection(const ImageCollection *const vertCol)
void drawPattern(const Image *const image, const int x, const int y, const int w, const int h)
Definition: imagegraphics.h:75
void drawTileVertexes(const ImageVertexes *const vert)
void calcTileSDL(ImageVertexes *const vert, int x, int y) const
void setTarget(Image *const target)
Definition: imagegraphics.h:49
void drawPatternCached(const Image *const image, const int x, const int y, const int w, const int h)
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:82
void calcTileCollection(ImageCollection *const vertCol, const Image *const image, int x, int y)
void updateScreen()
void drawPoint(int x, int y)
void drawLine(int x1, int y1, int x2, int y2)
Image * getTarget() const
Definition: imagegraphics.h:52
void calcTileVertexes(ImageVertexes *const vert, const Image *const image, int x, int y) const
void drawImageRect(const int x, const int y, const int w, const int h, const ImageRect &imgRect)
Definition: rect.h:74
#define restrict
Definition: localconsts.h:165
#define restrict2
Definition: localconsts.h:166
#define override
Definition: localconsts.h:47
#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