GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/resources/sprite/imagesprite.h Lines: 0 20 0.0 %
Date: 2017-11-29 Branches: 0 4 0.0 %

Line Branch Exec Source
1
/*
2
 *  The ManaPlus Client
3
 *  Copyright (C) 2010  The Mana Developers
4
 *  Copyright (C) 2011-2017  The ManaPlus Developers
5
 *
6
 *  This file is part of The ManaPlus Client.
7
 *
8
 *  This program is free software; you can redistribute it and/or modify
9
 *  it under the terms of the GNU General Public License as published by
10
 *  the Free Software Foundation; either version 2 of the License, or
11
 *  any later version.
12
 *
13
 *  This program is distributed in the hope that it will be useful,
14
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16
 *  GNU General Public License for more details.
17
 *
18
 *  You should have received a copy of the GNU General Public License
19
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
 */
21
22
#ifndef RESOURCES_SPRITE_IMAGESPRITE_H
23
#define RESOURCES_SPRITE_IMAGESPRITE_H
24
25
#include "resources/sprite/sprite.h"
26
27
#include "resources/image/image.h"
28
29
class Graphics;
30
31
class ImageSprite final : public Sprite
32
{
33
    public:
34
        explicit ImageSprite(Image *const image);
35
36
        A_DELETE_COPY(ImageSprite)
37
38
        ~ImageSprite();
39
40
        bool reset() override final
41
        { return false; }
42
43
        bool play(const std::string &action A_UNUSED) override final
44
        { return false; }
45
46
        bool update(const int time A_UNUSED) override final
47
        { return false; }
48
49
        void draw(Graphics *const graphics,
50
                  const int posX, const int posY)
51
                  const override final A_NONNULL(2);
52
53
        int getWidth() const override final A_WARN_UNUSED
54
        { return mImage != nullptr ? mImage->getWidth() : 0; }
55
56
        int getHeight() const override final A_WARN_UNUSED
57
        { return mImage != nullptr ? mImage->getHeight() : 0; }
58
59
        const Image* getImage() const override final A_WARN_UNUSED
60
        { return mImage; }
61
62
        bool setSpriteDirection(const SpriteDirection::Type
63
                                direction A_UNUSED) override final
64
        { return false; }
65
66
        int getNumberOfLayers() const A_WARN_UNUSED
67
        { return 1; }
68
69
        unsigned int getCurrentFrame() const override final A_WARN_UNUSED
70
        { return 0; }
71
72
        unsigned int getFrameCount() const override final A_WARN_UNUSED
73
        { return 1; }
74
75
        bool updateNumber(const unsigned num A_UNUSED) override final
76
        { return false; }
77
78
    private:
79
        Image *mImage;
80
};
81
82
#endif  // RESOURCES_SPRITE_IMAGESPRITE_H