GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/render/imagegraphics.h Lines: 0 48 0.0 %
Date: 2021-03-17 Branches: 0 0 0.0 %

Line Branch Exec Source
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
37
/**
38
 * A central point of control for graphics.
39
 */
40
class ImegeGraphics final : public Graphics
41
{
42
    public:
43
        ImegeGraphics();
44
45
        A_DELETE_COPY(ImegeGraphics)
46
47
        ~ImegeGraphics() override final;
48
49
        void setTarget(Image *const target) restrict2 noexcept2
50
        { mTarget = target; }
51
52
        Image *getTarget() const restrict2 noexcept2
53
        { return mTarget; }
54
55
        void beginDraw() restrict2 override final
56
        { }
57
58
        void endDraw() restrict2 override final
59
        { }
60
61
        void pushClipArea(const Rect &restrict rect A_UNUSED)
62
                          restrict2 override final
63
        { }
64
65
        void popClipArea() restrict2 override final
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
92
        void calcPattern(ImageVertexes *restrict const vert A_UNUSED,
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
100
        void calcPattern(ImageCollection *restrict const vert A_UNUSED,
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
108
        void calcTileVertexes(ImageVertexes *restrict const vert A_UNUSED,
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
115
        void calcTileSDL(ImageVertexes *restrict const vert A_UNUSED,
116
                         int x A_UNUSED,
117
                         int y A_UNUSED) const restrict2 override final
118
        { }
119
120
        void calcTileCollection(ImageCollection *restrict const
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
135
        void updateScreen() override final
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
146
        void calcWindow(ImageCollection *restrict const vertCol A_UNUSED,
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
193
        void completeCache() restrict2 override final;
194
195
        /**
196
         * Draws a rectangle using images. 4 corner images, 4 side images and 1
197
         * image for the inside.
198
         */
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:
205
        Image *mTarget;
206
};
207
208
#endif  // USE_OPENGL
209
#endif  // RENDER_IMAGEGRAPHICS_H