ManaPlus
|
#include <ambientlayer.h>
Public Member Functions | |
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) | |
~AmbientLayer () | |
void | update (const int timePassed, const float dx, const float dy) |
void | draw (Graphics *const graphics, const int x, const int y) const |
int | calcMemoryLocal () const |
std::string | getCounterName () const |
Public Member Functions inherited from MemoryCounter | |
MemoryCounter () | |
virtual | ~MemoryCounter () |
int | calcMemory (const int level) const |
virtual int | calcMemoryChilds (const int level) const |
Private Attributes | |
const std::string | mName |
Image * | mImage |
float | mParallaxX |
float | mParallaxY |
float | mPosX |
float | mPosY |
float | mSpeedX |
float | mSpeedY |
int | mMask |
bool | mKeepRatio |
Friends | |
class | Map |
Definition at line 34 of file ambientlayer.h.
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 | ||
) |
Constructor.
img | the image this overlay displays |
parallax | scroll factor based on camera position |
speedX | scrolling speed in x-direction |
speedY | scrolling speed in y-direction |
keepRatio | rescale the image to keep the same ratio than in 800x600 resolution mode. |
Definition at line 37 of file ambientlayer.cpp.
References CAST_S32, defaultScreenHeight, defaultScreenWidth, Loader::getRescaled(), imageHelper, mainGraphics, Graphics::mHeight, mImage, Graphics::mWidth, RENDER_SOFTWARE, and ImageHelper::useOpenGL().
Referenced by calcMemoryLocal().
AmbientLayer::~AmbientLayer | ( | ) |
|
virtual |
Reimplemented from MemoryCounter.
Definition at line 152 of file ambientlayer.cpp.
References AmbientLayer(), and mName.
void AmbientLayer::draw | ( | Graphics *const | graphics, |
const int | x, | ||
const int | y | ||
) | const |
Definition at line 127 of file ambientlayer.cpp.
References CAST_S32, defaultScreenHeight, defaultScreenWidth, Graphics::drawPattern(), Graphics::drawRescaledPattern(), imageHelper, Graphics::mHeight, mImage, mKeepRatio, mPosX, mPosY, Graphics::mWidth, RENDER_SOFTWARE, ImageHelper::useOpenGL(), x, and y.
|
inlinevirtual |
void AmbientLayer::update | ( | const int | timePassed, |
const float | dx, | ||
const float | dy | ||
) |
Definition at line 97 of file ambientlayer.cpp.
References mImage, mParallaxX, mParallaxY, mPosX, mPosY, mSpeedX, and mSpeedY.
Referenced by Map::updateAmbientLayers().
|
friend |
Definition at line 37 of file ambientlayer.h.
|
private |
Definition at line 79 of file ambientlayer.h.
Referenced by AmbientLayer(), draw(), update(), and ~AmbientLayer().
|
private |
Keep overlay ratio on every resolution
Definition at line 87 of file ambientlayer.h.
Referenced by draw().
|
private |
Definition at line 86 of file ambientlayer.h.
Referenced by Map::updateAmbientLayers().
|
private |
Definition at line 78 of file ambientlayer.h.
Referenced by calcMemoryLocal(), and getCounterName().
|
private |
Definition at line 80 of file ambientlayer.h.
Referenced by update().
|
private |
Definition at line 81 of file ambientlayer.h.
Referenced by update().
|
private |
Current layer X position.
Definition at line 82 of file ambientlayer.h.
|
private |
Current layer Y position.
Definition at line 83 of file ambientlayer.h.
|
private |
Scrolling speed in X direction.
Definition at line 84 of file ambientlayer.h.
Referenced by update().
|
private |
Scrolling speed in Y direction.
Definition at line 85 of file ambientlayer.h.
Referenced by update().