mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-03-06 14:27:43 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
acc22739b0
|
@ -169,3 +169,14 @@ GuiComponent* GuiComponent::getParent()
|
||||||
{
|
{
|
||||||
return mParent;
|
return mParent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
unsigned char GuiComponent::getOpacity()
|
||||||
|
{
|
||||||
|
return mOpacity;
|
||||||
|
}
|
||||||
|
|
||||||
|
void GuiComponent::setOpacity(unsigned char opacity)
|
||||||
|
{
|
||||||
|
mOpacity = opacity;
|
||||||
|
}
|
||||||
|
|
|
@ -48,11 +48,14 @@ public:
|
||||||
void clearChildren();
|
void clearChildren();
|
||||||
unsigned int getChildCount();
|
unsigned int getChildCount();
|
||||||
GuiComponent* getChild(unsigned int i);
|
GuiComponent* getChild(unsigned int i);
|
||||||
|
unsigned char getOpacity();
|
||||||
|
void setOpacity(unsigned char opacity);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
//Default implementation just renders children - you should probably always call GuiComponent::onRender at some point in your custom onRender.
|
//Default implementation just renders children - you should probably always call GuiComponent::onRender at some point in your custom onRender.
|
||||||
virtual void onRender();
|
virtual void onRender();
|
||||||
|
|
||||||
|
unsigned char mOpacity;
|
||||||
Window* mWindow;
|
Window* mWindow;
|
||||||
GuiComponent* mParent;
|
GuiComponent* mParent;
|
||||||
Vector2i mOffset;
|
Vector2i mOffset;
|
||||||
|
|
|
@ -76,7 +76,7 @@ void AnimationComponent::update(int deltaTime)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimationComponent::addChild(ImageComponent* gui)
|
void AnimationComponent::addChild(GuiComponent* gui)
|
||||||
{
|
{
|
||||||
mChildren.push_back(gui);
|
mChildren.push_back(gui);
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ void AnimationComponent::moveChildren(int offsetx, int offsety)
|
||||||
Vector2i move(offsetx, offsety);
|
Vector2i move(offsetx, offsety);
|
||||||
for(unsigned int i = 0; i < mChildren.size(); i++)
|
for(unsigned int i = 0; i < mChildren.size(); i++)
|
||||||
{
|
{
|
||||||
ImageComponent* comp = mChildren.at(i);
|
GuiComponent* comp = mChildren.at(i);
|
||||||
comp->setOffset(comp->getOffset() + move);
|
comp->setOffset(comp->getOffset() + move);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
#define _ANIMATIONCOMPONENT_H_
|
#define _ANIMATIONCOMPONENT_H_
|
||||||
|
|
||||||
#include "../GuiComponent.h"
|
#include "../GuiComponent.h"
|
||||||
#include "ImageComponent.h"
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#define ANIMATION_TICK_SPEED 16
|
#define ANIMATION_TICK_SPEED 16
|
||||||
|
@ -18,12 +17,12 @@ public:
|
||||||
|
|
||||||
void update(int deltaTime);
|
void update(int deltaTime);
|
||||||
|
|
||||||
void addChild(ImageComponent* gui);
|
void addChild(GuiComponent* gui);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
unsigned char mOpacity;
|
unsigned char mOpacity;
|
||||||
|
|
||||||
std::vector<ImageComponent*> mChildren;
|
std::vector<GuiComponent*> mChildren;
|
||||||
|
|
||||||
void moveChildren(int offsetx, int offsety);
|
void moveChildren(int offsetx, int offsety);
|
||||||
void setChildrenOpacity(unsigned char opacity);
|
void setChildrenOpacity(unsigned char opacity);
|
||||||
|
|
|
@ -352,8 +352,6 @@ bool ImageComponent::hasImage()
|
||||||
return !mPath.empty();
|
return !mPath.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char ImageComponent::getOpacity() { return mOpacity; }
|
|
||||||
void ImageComponent::setOpacity(unsigned char opacity) { mOpacity = opacity; }
|
|
||||||
|
|
||||||
void ImageComponent::copyScreen()
|
void ImageComponent::copyScreen()
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,9 +38,6 @@ public:
|
||||||
void init();
|
void init();
|
||||||
void deinit();
|
void deinit();
|
||||||
|
|
||||||
unsigned char getOpacity();
|
|
||||||
void setOpacity(unsigned char opacity);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void onRender();
|
void onRender();
|
||||||
|
|
||||||
|
@ -51,8 +48,6 @@ private:
|
||||||
|
|
||||||
bool mAllowUpscale, mTiled, mFlipX, mFlipY;
|
bool mAllowUpscale, mTiled, mFlipX, mFlipY;
|
||||||
|
|
||||||
unsigned char mOpacity;
|
|
||||||
|
|
||||||
void loadImage(std::string path);
|
void loadImage(std::string path);
|
||||||
void resize();
|
void resize();
|
||||||
void buildImageArray(int x, int y, GLfloat* points, GLfloat* texs, float percentageX = 1, float percentageY = 1); //writes 12 GLfloat points and 12 GLfloat texture coordinates to a given array at a given position
|
void buildImageArray(int x, int y, GLfloat* points, GLfloat* texs, float percentageX = 1, float percentageY = 1); //writes 12 GLfloat points and 12 GLfloat texture coordinates to a given array at a given position
|
||||||
|
|
|
@ -74,7 +74,7 @@ void TextComponent::onRender()
|
||||||
|
|
||||||
Renderer::pushClipRect(getGlobalOffset(), getSize());
|
Renderer::pushClipRect(getGlobalOffset(), getSize());
|
||||||
|
|
||||||
Renderer::drawWrappedText(mText, (int)-mScrollPos.x, (int)-mScrollPos.y, mSize.x, mColor, font);
|
Renderer::drawWrappedText(mText, (int)-mScrollPos.x, (int)-mScrollPos.y, mSize.x, mColor >> 8 << 8 | getOpacity(), font);
|
||||||
|
|
||||||
Renderer::popClipRect();
|
Renderer::popClipRect();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue