GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/render/sdl2softwaregraphics.h Lines: 0 2 0.0 %
Date: 2019-10-12 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
 *
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_SDL2SOFTWAREGRAPHICS_H
24
#define RENDER_SDL2SOFTWAREGRAPHICS_H
25
26
#ifdef USE_SDL2
27
28
#include "render/graphics.h"
29
30
#include "localconsts.h"
31
32
class Image;
33
class ImageCollection;
34
class ImageVertexes;
35
class MapLayer;
36
37
struct SDL_Surface;
38
39
/**
40
 * A central point of control for graphics.
41
 */
42
class SDL2SoftwareGraphics final : public Graphics
43
{
44
    public:
45
        friend class Sdl2SoftwareScreenshotHelper;
46
47
        /**
48
         * Constructor.
49
         */
50
        SDL2SoftwareGraphics();
51
52
        A_DELETE_COPY(SDL2SoftwareGraphics)
53
54
        /**
55
         * Destructor.
56
         */
57
        ~SDL2SoftwareGraphics() override final;
58
59
        void setRendererFlags(const uint32_t flags)
60
                              restrict2 noexcept2 override final
61
        { mRendererFlags = flags; }
62
63
        #include "render/graphicsdef.hpp"
64
        RENDER_GRAPHICSDEF_HPP
65
66
        #include "render/softwaregraphicsdef.hpp"
67
        RENDER_SOFTWAREGRAPHICSDEF_HPP
68
69
        bool resizeScreen(const int width,
70
                          const int height) restrict2 override final;
71
72
    protected:
73
        int SDL_FakeUpperBlit(const SDL_Surface *restrict const src,
74
                              SDL_Rect *restrict const srcrect,
75
                              const SDL_Surface *restrict const dst,
76
                              SDL_Rect *restrict dstrect) const restrict2;
77
78
        void drawHLine(int x1, int y, int x2) restrict2;
79
80
        void drawVLine(int x, int y1, int y2) restrict2;
81
82
        uint32_t mRendererFlags;
83
        SDL_Surface *mSurface;
84
        uint32_t mOldPixel;
85
        unsigned int mOldAlpha;
86
};
87
88
#endif  // USE_SDL2
89
#endif  // RENDER_SDL2SOFTWAREGRAPHICS_H