~ubuntu-branches/ubuntu/trusty/manaplus/trusty-proposed

« back to all changes in this revision

Viewing changes to src/surfacegraphics.h

  • Committer: Package Import Robot
  • Author(s): Patrick Matthäi
  • Date: 2013-09-17 10:35:51 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20130917103551-az7p3nz9jgxwqjfn
Tags: 1.3.9.15-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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-2013  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 SURFACEGRAPHICS_H
24
 
#define SURFACEGRAPHICS_H
25
 
 
26
 
#include "graphics.h"
27
 
 
28
 
#include "localconsts.h"
29
 
 
30
 
class Image;
31
 
class ImageCollection;
32
 
class ImageVertexes;
33
 
class MapLayer;
34
 
 
35
 
struct SDL_Surface;
36
 
 
37
 
/**
38
 
 * A central point of control for graphics.
39
 
 */
40
 
class SurfaceGraphics : public Graphics
41
 
{
42
 
    public:
43
 
        enum BlitMode
44
 
        {
45
 
            BLIT_NORMAL = 0,
46
 
            BLIT_GFX
47
 
        };
48
 
 
49
 
        SurfaceGraphics();
50
 
 
51
 
        A_DELETE_COPY(SurfaceGraphics)
52
 
 
53
 
        virtual ~SurfaceGraphics();
54
 
 
55
 
        void setTarget(SDL_Surface *const target)
56
 
        { mTarget = target; }
57
 
 
58
 
        SDL_Surface *getTarget() const
59
 
        { return mTarget; }
60
 
 
61
 
        void _beginDraw()
62
 
        { }
63
 
 
64
 
        void _endDraw()
65
 
        { }
66
 
 
67
 
        bool pushClipArea(gcn::Rectangle rect A_UNUSED)
68
 
        { return true; }
69
 
 
70
 
        void popClipArea()
71
 
        { }
72
 
 
73
 
        bool drawRescaledImage(const Image *const image A_UNUSED,
74
 
                               int srcX A_UNUSED, int srcY A_UNUSED,
75
 
                               int dstX A_UNUSED, int dstY A_UNUSED,
76
 
                               const int width A_UNUSED,
77
 
                               const int height A_UNUSED,
78
 
                               const int desiredWidth A_UNUSED,
79
 
                               const int desiredHeight A_UNUSED,
80
 
                               const bool useColor A_UNUSED = false)
81
 
        { return false; }
82
 
 
83
 
        void drawImagePattern(const Image *const image A_UNUSED,
84
 
                              const int x A_UNUSED, const int y A_UNUSED,
85
 
                              const int w A_UNUSED, const int h A_UNUSED)
86
 
        { }
87
 
 
88
 
        void drawRescaledImagePattern(const Image *const image A_UNUSED,
89
 
                                      const int x A_UNUSED,
90
 
                                      const int y A_UNUSED,
91
 
                                      const int w A_UNUSED,
92
 
                                      const int h A_UNUSED,
93
 
                                      const int scaledWidth A_UNUSED,
94
 
                                      const int scaledHeight A_UNUSED)
95
 
        { }
96
 
 
97
 
        void calcImagePattern(ImageVertexes *const vert A_UNUSED,
98
 
                              const Image *const image A_UNUSED,
99
 
                              const int x A_UNUSED,
100
 
                              const int y A_UNUSED,
101
 
                              const int w A_UNUSED,
102
 
                              const int h A_UNUSED) const
103
 
        { }
104
 
 
105
 
        void calcImagePattern(ImageCollection *const vert A_UNUSED,
106
 
                              const Image *const image A_UNUSED,
107
 
                              const int x A_UNUSED, const int y A_UNUSED,
108
 
                              const int w A_UNUSED, const int h A_UNUSED) const
109
 
        { }
110
 
 
111
 
        void calcTile(ImageVertexes *const vert A_UNUSED,
112
 
                      const Image *const image A_UNUSED,
113
 
                      int x A_UNUSED, int y A_UNUSED) const
114
 
        { }
115
 
 
116
 
        void calcTileSDL(ImageVertexes *const vert A_UNUSED,
117
 
                         int x A_UNUSED, int y A_UNUSED) const
118
 
        { }
119
 
 
120
 
        void calcTile(ImageCollection *const vertCol A_UNUSED,
121
 
                      const Image *const image A_UNUSED,
122
 
                      int x A_UNUSED, int y A_UNUSED)
123
 
        { }
124
 
 
125
 
        void drawTile(const ImageVertexes *const vert A_UNUSED)
126
 
        { }
127
 
 
128
 
        void drawTile(const ImageCollection *const vertCol A_UNUSED)
129
 
        { }
130
 
 
131
 
        void updateScreen()
132
 
        { }
133
 
 
134
 
        SDL_Surface *getScreenshot() A_WARN_UNUSED
135
 
        { return nullptr; }
136
 
 
137
 
        bool drawNet(const int x1 A_UNUSED, const int y1 A_UNUSED,
138
 
                     const int x2 A_UNUSED, const int y2 A_UNUSED,
139
 
                     const int width A_UNUSED, const int height A_UNUSED)
140
 
        { return false; }
141
 
 
142
 
        bool calcWindow(ImageCollection *const vertCol A_UNUSED,
143
 
                        const int x A_UNUSED, const int y A_UNUSED,
144
 
                        const int w A_UNUSED, const int h A_UNUSED,
145
 
                        const ImageRect &imgRect A_UNUSED)
146
 
        { return false; }
147
 
 
148
 
        void setBlitMode(const BlitMode mode)
149
 
        { mBlitMode = mode; }
150
 
 
151
 
        BlitMode getBlitMode() const A_WARN_UNUSED
152
 
        { return mBlitMode; }
153
 
 
154
 
        void fillRectangle(const gcn::Rectangle &rect A_UNUSED) override
155
 
        { }
156
 
 
157
 
        void drawRectangle(const gcn::Rectangle &rect A_UNUSED) override
158
 
        { }
159
 
 
160
 
        void drawPoint(int x A_UNUSED, int y A_UNUSED) override
161
 
        { }
162
 
 
163
 
        void drawLine(int x1 A_UNUSED, int y1 A_UNUSED,
164
 
                      int x2 A_UNUSED, int y2 A_UNUSED) override
165
 
        { }
166
 
 
167
 
        bool setVideoMode(const int w A_UNUSED, const int h 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
 
        { return false; }
173
 
 
174
 
    protected:
175
 
        bool drawImage2(const Image *const image,
176
 
                        int srcX, int srcY,
177
 
                        int dstX, int dstY,
178
 
                        const int width, const int height,
179
 
                        const bool useColor);
180
 
 
181
 
        BlitMode mBlitMode;
182
 
        SDL_Surface *mTarget;
183
 
};
184
 
 
185
 
#endif  // SURFACEGRAPHICS_H