mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15:38 +00:00
Fix Settings menu and associated components.
This commit is contained in:
parent
8bd87e162c
commit
28f7a9c6e1
|
@ -58,6 +58,8 @@ public:
|
|||
unsigned char getOpacity() const;
|
||||
void setOpacity(unsigned char opacity);
|
||||
|
||||
const Eigen::Affine3f getTransform();
|
||||
|
||||
protected:
|
||||
void renderChildren(const Eigen::Affine3f& transform) const;
|
||||
|
||||
|
@ -70,8 +72,6 @@ protected:
|
|||
Eigen::Vector3f mPosition;
|
||||
Eigen::Vector2f mSize;
|
||||
|
||||
const Eigen::Affine3f getTransform();
|
||||
|
||||
private:
|
||||
Eigen::Affine3f mTransform; //Don't access this directly! Use getTransform()!
|
||||
};
|
||||
|
|
|
@ -101,9 +101,11 @@ Eigen::Vector3f ComponentListComponent::getCellOffset(Eigen::Vector2i pos)
|
|||
for(int x = 0; x < pos.x(); x++)
|
||||
offset[0] += getColumnWidth(x);
|
||||
|
||||
//LOG(LogInfo) << "total offsets up to " << pos.x() << ", " << pos.y() << ": " << offset.x() << ", " << offset.y();
|
||||
|
||||
ComponentEntry* entry = getCell(pos.x(), pos.y());
|
||||
|
||||
Eigen::Vector2i gridSize;
|
||||
Eigen::Vector2i gridSize(0, 0);
|
||||
for(int x = pos.x(); x < pos.x() + entry->dim[0]; x++)
|
||||
gridSize[0] += getColumnWidth(x);
|
||||
for(int y = pos.y(); y < pos.y() + entry->dim[1]; y++)
|
||||
|
@ -273,6 +275,7 @@ void ComponentListComponent::update(int deltaTime)
|
|||
void ComponentListComponent::render(const Eigen::Affine3f& parentTrans)
|
||||
{
|
||||
Eigen::Affine3f trans = parentTrans * getTransform();
|
||||
Renderer::setMatrix(trans);
|
||||
|
||||
Renderer::drawRect(0, 0, (int)getSize().x(), (int)getSize().y(), 0xFFFFFFAA);
|
||||
|
||||
|
@ -281,30 +284,35 @@ void ComponentListComponent::render(const Eigen::Affine3f& parentTrans)
|
|||
iter->component->render(trans);
|
||||
}
|
||||
|
||||
|
||||
//draw cell outlines
|
||||
/*Vector2i pos;
|
||||
for(unsigned int x = 0; x < mGridSize.x; x++)
|
||||
/*Renderer::setMatrix(trans);
|
||||
Eigen::Vector2i pos(0, 0);
|
||||
for(int x = 0; x < mGridSize.x(); x++)
|
||||
{
|
||||
for(unsigned int y = 0; y < mGridSize.y; y++)
|
||||
for(int y = 0; y < mGridSize.y(); y++)
|
||||
{
|
||||
Renderer::drawRect(pos.x, pos.y, getColumnWidth(x), 2, 0x000000AA);
|
||||
Renderer::drawRect(pos.x, pos.y, 2, getRowHeight(y), 0x000000AA);
|
||||
Renderer::drawRect(pos.x + getColumnWidth(x), pos.y, 2, getRowHeight(y), 0x000000AA);
|
||||
Renderer::drawRect(pos.x, pos.y + getRowHeight(y) - 2, getColumnWidth(x), 2, 0x000000AA);
|
||||
Renderer::drawRect(pos.x(), pos.y(), getColumnWidth(x), 2, 0x000000AA);
|
||||
Renderer::drawRect(pos.x(), pos.y(), 2, getRowHeight(y), 0x000000AA);
|
||||
Renderer::drawRect(pos.x() + getColumnWidth(x), pos.y(), 2, getRowHeight(y), 0x000000AA);
|
||||
Renderer::drawRect(pos.x(), pos.y() + getRowHeight(y) - 2, getColumnWidth(x), 2, 0x000000AA);
|
||||
|
||||
pos.y += getRowHeight(y);
|
||||
pos[1] += getRowHeight(y);
|
||||
}
|
||||
|
||||
pos.y = 0;
|
||||
pos.x += getColumnWidth(x);
|
||||
pos[1] = 0;
|
||||
pos[0] += getColumnWidth(x);
|
||||
}*/
|
||||
|
||||
//draw cursor
|
||||
if(cursorValid())
|
||||
{
|
||||
ComponentEntry* entry = getCell(mCursor.x(), mCursor.y());
|
||||
Renderer::drawRect((int)entry->component->getPosition().x(), (int)entry->component->getPosition().y(), 4, 4, 0xFF0000FF);
|
||||
Renderer::drawRect((int)entry->component->getPosition().x(), (int)entry->component->getPosition().y(), (int)entry->component->getSize().x(), (int)entry->component->getSize().y(), 0x0000AA88);
|
||||
Eigen::Affine3f entryTrans = trans * entry->component->getTransform();
|
||||
Renderer::setMatrix(entryTrans);
|
||||
|
||||
Renderer::drawRect(0, 0, 4, 4, 0xFF0000FF);
|
||||
Renderer::drawRect(0, 0, (int)entry->component->getSize().x(), (int)entry->component->getSize().y(), 0x0000AA88);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -95,6 +95,7 @@ void GuiMenu::update(int deltaTime)
|
|||
void GuiMenu::render(const Eigen::Affine3f& parentTrans)
|
||||
{
|
||||
Eigen::Affine3f trans = parentTrans;
|
||||
Renderer::setMatrix(trans);
|
||||
|
||||
Renderer::drawRect(Renderer::getScreenWidth() / 4, 0, Renderer::getScreenWidth() / 2, Renderer::getScreenHeight(), 0x999999);
|
||||
mList->render(trans);
|
||||
|
|
|
@ -68,6 +68,7 @@ void SliderComponent::update(int deltaTime)
|
|||
void SliderComponent::render(const Eigen::Affine3f& parentTrans)
|
||||
{
|
||||
Eigen::Affine3f trans = parentTrans * getTransform();
|
||||
Renderer::setMatrix(trans);
|
||||
|
||||
//render line
|
||||
const int lineWidth = 2;
|
||||
|
|
Loading…
Reference in a new issue