ManaPlus
src
resources
image
subimage.h
Go to the documentation of this file.
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 RESOURCES_SUBIMAGE_H
25
#define RESOURCES_SUBIMAGE_H
26
27
#include "
localconsts.h
"
28
29
#include "
resources/image/image.h
"
30
34
class
SubImage
final
:
public
Image
35
{
36
public
:
40
#ifdef USE_SDL2
41
SubImage
(
Image
*
const
parent, SDL_Texture *
const
image,
42
const
int
x
,
const
int
y
,
const
int
width,
const
int
height);
43
#endif
// USE_SDL2
44
45
SubImage
(
Image
*
const
parent, SDL_Surface *
const
image,
46
const
int
x
,
const
int
y
,
const
int
width,
const
int
height);
47
#ifdef USE_OPENGL
48
SubImage
(
Image
*
const
parent,
const
GLuint image,
49
const
int
x
,
const
int
y
,
const
int
width,
const
int
height,
50
const
int
texWidth,
const
int
textHeight);
51
#endif
// USE_OPENGL
52
53
A_DELETE_COPY
(
SubImage
)
54
55
58
~SubImage
()
override
final
;
59
66
Image
*
getSubImage
(
const
int
x
,
const
int
y
,
67
const
int
width,
68
const
int
height)
override
final
A_WARN_UNUSED
;
69
70
ImageTypeT
getType
() const
noexcept2
override
final
71
{
return
ImageType::SubImage
; }
72
73
int
calcMemoryLocal
()
const override
;
74
75
#ifdef USE_OPENGL
76
void
decRef
()
override
final
;
77
#endif
// USE_OPENGL
78
79
SDL_Rect
mInternalBounds
;
80
81
private
:
82
Image
*
mParent
;
83
};
84
85
#endif
// RESOURCES_SUBIMAGE_H
Image
SubImage
Definition:
subimage.h:35
SubImage::getType
ImageTypeT getType() const
Definition:
subimage.h:70
SubImage::mParent
Image * mParent
Definition:
subimage.h:82
SubImage::calcMemoryLocal
int calcMemoryLocal() const
Definition:
subimage.cpp:231
SubImage::mInternalBounds
SDL_Rect mInternalBounds
Definition:
subimage.h:79
SubImage::SubImage
SubImage(Image *const parent, SDL_Surface *const image, const int x, const int y, const int width, const int height)
Definition:
subimage.cpp:90
SubImage::~SubImage
~SubImage()
Definition:
subimage.cpp:187
SubImage::getSubImage
Image * getSubImage(const int x, const int y, const int width, const int height)
Definition:
subimage.cpp:216
SubImage::decRef
void decRef()
Definition:
subimage.cpp:225
y
y
Definition:
graphics_calcImageRect.hpp:73
x
x
Definition:
graphics_calcImageRect.hpp:73
image.h
ImageTypeT
ImageType ::T ImageTypeT
Definition:
imagetype.h:32
localconsts.h
override
#define override
Definition:
localconsts.h:47
A_WARN_UNUSED
#define A_WARN_UNUSED
Definition:
localconsts.h:161
noexcept2
#define noexcept2
Definition:
localconsts.h:50
final
#define final
Definition:
localconsts.h:46
A_DELETE_COPY
#define A_DELETE_COPY(func)
Definition:
localconsts.h:53
ImageType::SubImage
@ SubImage
Definition:
imagetype.h:30
Generated on Wed Mar 17 2021 19:19:09 for ManaPlus by
1.9.1