ManaPlus
src
resources
ambientlayer.h
Go to the documentation of this file.
1
/*
2
* The ManaPlus Client
3
* Copyright (C) 2009-2010 The Mana Developers
4
* Copyright (C) 2011-2019 The ManaPlus Developers
5
* Copyright (C) 2019-2021 Andrei Karas
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 RESOURCES_AMBIENTLAYER_H
24
#define RESOURCES_AMBIENTLAYER_H
25
26
#include "
resources/memorycounter.h
"
27
28
#include "
localconsts.h
"
29
30
class
Graphics
;
31
class
Image
;
32
class
Map
;
33
34
class
AmbientLayer
final
:
public
MemoryCounter
35
{
36
public
:
37
friend
class
Map
;
38
49
AmbientLayer
(
const
std::string &name,
50
Image
*
const
img,
51
const
float
parallax,
52
const
float
parallaxY,
53
const
float
posX,
54
const
float
posY,
55
const
float
speedX,
56
const
float
speedY,
57
const
bool
keepRatio,
58
const
int
mask);
59
60
A_DELETE_COPY
(
AmbientLayer
)
61
62
~AmbientLayer
()
override
final
;
63
64
void
update
(const
int
timePassed,
65
const
float
dx,
66
const
float
dy);
67
68
void
draw
(
Graphics
*const graphics,
69
const
int
x
,
70
const
int
y
) const
A_NONNULL
(2);
71
72
int
calcMemoryLocal
() const
override
;
73
74
std
::
string
getCounterName
() const
override
final
75
{
return
mName
; }
76
77
private
:
78
const
std::string
mName
;
79
Image
*
mImage
;
80
float
mParallaxX
;
81
float
mParallaxY
;
82
float
mPosX
;
83
float
mPosY
;
84
float
mSpeedX
;
85
float
mSpeedY
;
86
int
mMask
;
87
bool
mKeepRatio
;
88
};
89
90
#endif
// RESOURCES_AMBIENTLAYER_H
AmbientLayer
Definition:
ambientlayer.h:35
AmbientLayer::mPosY
float mPosY
Definition:
ambientlayer.h:83
AmbientLayer::calcMemoryLocal
int calcMemoryLocal() const
Definition:
ambientlayer.cpp:152
AmbientLayer::mParallaxY
float mParallaxY
Definition:
ambientlayer.h:81
AmbientLayer::~AmbientLayer
~AmbientLayer()
Definition:
ambientlayer.cpp:88
AmbientLayer::draw
void draw(Graphics *const graphics, const int x, const int y) const
Definition:
ambientlayer.cpp:127
AmbientLayer::mPosX
float mPosX
Definition:
ambientlayer.h:82
AmbientLayer::mImage
Image * mImage
Definition:
ambientlayer.h:79
AmbientLayer::mSpeedX
float mSpeedX
Definition:
ambientlayer.h:84
AmbientLayer::mSpeedY
float mSpeedY
Definition:
ambientlayer.h:85
AmbientLayer::mKeepRatio
bool mKeepRatio
Definition:
ambientlayer.h:87
AmbientLayer::mParallaxX
float mParallaxX
Definition:
ambientlayer.h:80
AmbientLayer::mName
const std::string mName
Definition:
ambientlayer.h:78
AmbientLayer::AmbientLayer
AmbientLayer(const std::string &name, Image *const img, const float parallax, const float parallaxY, const float posX, const float posY, const float speedX, const float speedY, const bool keepRatio, const int mask)
Definition:
ambientlayer.cpp:37
AmbientLayer::getCounterName
std::string getCounterName() const
Definition:
ambientlayer.h:74
AmbientLayer::mMask
int mMask
Definition:
ambientlayer.h:86
AmbientLayer::update
void update(const int timePassed, const float dx, const float dy)
Definition:
ambientlayer.cpp:97
Graphics
Definition:
graphics.h:109
Image
Map
Definition:
map.h:75
MemoryCounter
Definition:
memorycounter.h:30
y
y
Definition:
graphics_calcImageRect.hpp:73
x
x
Definition:
graphics_calcImageRect.hpp:73
localconsts.h
override
#define override
Definition:
localconsts.h:47
A_NONNULL
#define A_NONNULL(...)
Definition:
localconsts.h:168
final
#define final
Definition:
localconsts.h:46
A_DELETE_COPY
#define A_DELETE_COPY(func)
Definition:
localconsts.h:53
memorycounter.h
std
Definition:
mseprimitives.h:398
Generated on Wed Mar 17 2021 19:19:09 for ManaPlus by
1.9.1