GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/render/imagegraphics.h Lines: 0 48 0.0 %
Date: 2017-11-29 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-2017  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
36
/**
37
 * A central point of control for graphics.
38
 */
39
class ImegeGraphics final : public Graphics
40
{
41
    public:
42
        ImegeGraphics();
43
44
        A_DELETE_COPY(ImegeGraphics)
45
46
        ~ImegeGraphics();
47
48
        void setTarget(Image *const target) restrict2 noexcept2
49
        { mTarget = target; }
50
51
        Image *getTarget() const restrict2 noexcept2
52
        { return mTarget; }
53
54
        void beginDraw() restrict2 override final
55
        { }
56
57
        void endDraw() restrict2 override final
58
        { }
59
60
        void pushClipArea(const Rect &restrict rect A_UNUSED)
61
                          restrict2 override final
62
        { }
63
64
        void popClipArea() restrict2 override final
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
91
        void calcPattern(ImageVertexes *restrict const vert A_UNUSED,
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
99
        void calcPattern(ImageCollection *restrict const vert A_UNUSED,
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
107
        void calcTileVertexes(ImageVertexes *restrict const vert A_UNUSED,
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
114
        void calcTileSDL(ImageVertexes *restrict const vert A_UNUSED,
115
                         int x A_UNUSED,
116
                         int y A_UNUSED) const restrict2 override final
117
        { }
118
119
        void calcTileCollection(ImageCollection *restrict const
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
134
        void updateScreen() override final
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
145
        void calcWindow(ImageCollection *restrict const vertCol A_UNUSED,
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
194
        /**
195
         * Draws a rectangle using images. 4 corner images, 4 side images and 1
196
         * image for the inside.
197
         */
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:
204
        Image *mTarget;
205
};
206
207
#endif  // USE_OPENGL
208
#endif  // RENDER_IMAGEGRAPHICS_H