mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-18 07:05:39 +00:00
Made many improvements to GUI sizing and positioning when running in vertical screen resolutions.
This commit is contained in:
parent
cf8ce151dd
commit
33bca1b0d3
|
@ -103,10 +103,11 @@ void GuiLaunchScreen::displayLaunchScreen(FileData* game)
|
||||||
float aspectValue {1.778f / Renderer::getScreenAspectRatio()};
|
float aspectValue {1.778f / Renderer::getScreenAspectRatio()};
|
||||||
|
|
||||||
float maxWidthModifier {glm::clamp(0.78f * aspectValue, 0.78f, 0.90f)};
|
float maxWidthModifier {glm::clamp(0.78f * aspectValue, 0.78f, 0.90f)};
|
||||||
float minWidthModifier {glm::clamp(0.50f * aspectValue, 0.50f, 0.65f)};
|
float minWidthModifier {glm::clamp(0.50f * aspectValue, 0.50f,
|
||||||
|
(mRenderer->getIsVerticalOrientation() ? 0.80f : 0.65f))};
|
||||||
|
|
||||||
float maxWidth {Renderer::getScreenWidth() * maxWidthModifier};
|
float maxWidth {mRenderer->getScreenWidth() * maxWidthModifier};
|
||||||
float minWidth {Renderer::getScreenWidth() * minWidthModifier};
|
float minWidth {mRenderer->getScreenWidth() * minWidthModifier};
|
||||||
|
|
||||||
float fontWidth {Font::get(gameNameFontSize *
|
float fontWidth {Font::get(gameNameFontSize *
|
||||||
std::min(Renderer::getScreenHeight(), Renderer::getScreenWidth()))
|
std::min(Renderer::getScreenHeight(), Renderer::getScreenWidth()))
|
||||||
|
@ -118,10 +119,18 @@ void GuiLaunchScreen::displayLaunchScreen(FileData* game)
|
||||||
|
|
||||||
float width {glm::clamp(fontWidth, minWidth, maxWidth)};
|
float width {glm::clamp(fontWidth, minWidth, maxWidth)};
|
||||||
|
|
||||||
if (mImagePath != "")
|
if (mImagePath != "") {
|
||||||
setSize(width, Renderer::getScreenHeight() * 0.60f);
|
if (mRenderer->getIsVerticalOrientation())
|
||||||
|
setSize(width, mRenderer->getScreenWidth() * 0.60f);
|
||||||
else
|
else
|
||||||
setSize(width, Renderer::getScreenHeight() * 0.38f);
|
setSize(width, mRenderer->getScreenHeight() * 0.60f);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (mRenderer->getIsVerticalOrientation())
|
||||||
|
setSize(width, mRenderer->getScreenWidth() * 0.38f);
|
||||||
|
else
|
||||||
|
setSize(width, mRenderer->getScreenHeight() * 0.38f);
|
||||||
|
}
|
||||||
|
|
||||||
// Set row heights.
|
// Set row heights.
|
||||||
if (mImagePath != "")
|
if (mImagePath != "")
|
||||||
|
@ -160,10 +169,12 @@ void GuiLaunchScreen::displayLaunchScreen(FileData* game)
|
||||||
// width so that the sizes look somewhat consistent regardless of the aspect ratio
|
// width so that the sizes look somewhat consistent regardless of the aspect ratio
|
||||||
// of the images.
|
// of the images.
|
||||||
if (mImagePath != "") {
|
if (mImagePath != "") {
|
||||||
|
const float multiplier {mRenderer->getIsVerticalOrientation() ? 0.20f : 0.25f};
|
||||||
mMarquee->setLinearInterpolation(true);
|
mMarquee->setLinearInterpolation(true);
|
||||||
mMarquee->setImage(game->getMarqueePath(), false);
|
mMarquee->setImage(game->getMarqueePath(), false);
|
||||||
mMarquee->cropTransparentPadding(Renderer::getScreenWidth() *
|
mMarquee->cropTransparentPadding(
|
||||||
(0.25f * (1.778f / Renderer::getScreenAspectRatio())),
|
mRenderer->getScreenWidth() *
|
||||||
|
(multiplier * (1.778f / mRenderer->getScreenAspectRatio())),
|
||||||
mGrid->getRowHeight(3));
|
mGrid->getRowHeight(3));
|
||||||
|
|
||||||
mMarquee->setOrigin(0.5f, 0.5f);
|
mMarquee->setOrigin(0.5f, 0.5f);
|
||||||
|
|
|
@ -31,7 +31,10 @@
|
||||||
#include "resources/Font.h"
|
#include "resources/Font.h"
|
||||||
#include "utils/StringUtil.h"
|
#include "utils/StringUtil.h"
|
||||||
|
|
||||||
#define TITLE_HEIGHT (mTitle->getFont()->getLetterHeight() + Renderer::getScreenHeight() * 0.060f)
|
#define TITLE_HEIGHT \
|
||||||
|
(mTitle->getFont()->getLetterHeight() + (Renderer::getIsVerticalOrientation() ? \
|
||||||
|
Renderer::getScreenWidth() * 0.060f : \
|
||||||
|
Renderer::getScreenHeight() * 0.060f))
|
||||||
|
|
||||||
GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
GuiMetaDataEd::GuiMetaDataEd(MetaDataList* md,
|
||||||
const std::vector<MetaDataDecl>& mdd,
|
const std::vector<MetaDataDecl>& mdd,
|
||||||
|
|
|
@ -25,7 +25,8 @@
|
||||||
|
|
||||||
GuiScraperMulti::GuiScraperMulti(const std::queue<ScraperSearchParams>& searches,
|
GuiScraperMulti::GuiScraperMulti(const std::queue<ScraperSearchParams>& searches,
|
||||||
bool approveResults)
|
bool approveResults)
|
||||||
: mBackground {":/graphics/frame.svg"}
|
: mRenderer {Renderer::getInstance()}
|
||||||
|
, mBackground {":/graphics/frame.svg"}
|
||||||
, mGrid {glm::ivec2 {2, 6}}
|
, mGrid {glm::ivec2 {2, 6}}
|
||||||
, mSearchQueue {searches}
|
, mSearchQueue {searches}
|
||||||
, mApproveResults {approveResults}
|
, mApproveResults {approveResults}
|
||||||
|
@ -147,20 +148,24 @@ GuiScraperMulti::GuiScraperMulti(const std::queue<ScraperSearchParams>& searches
|
||||||
|
|
||||||
// Limit the width of the GUI on ultrawide monitors. The 1.778 aspect ratio value is
|
// Limit the width of the GUI on ultrawide monitors. The 1.778 aspect ratio value is
|
||||||
// the 16:9 reference.
|
// the 16:9 reference.
|
||||||
float aspectValue {1.778f / Renderer::getScreenAspectRatio()};
|
float aspectValue {1.778f / mRenderer->getScreenAspectRatio()};
|
||||||
float width {glm::clamp(0.95f * aspectValue, 0.70f, 0.95f) * Renderer::getScreenWidth()};
|
float width {glm::clamp(0.95f * aspectValue, 0.70f, 0.95f) * mRenderer->getScreenWidth()};
|
||||||
|
|
||||||
float height {(mTitle->getFont()->getLetterHeight() + Renderer::getScreenHeight() * 0.0637f) +
|
const float titleHeight {mRenderer->getIsVerticalOrientation() ?
|
||||||
|
mRenderer->getScreenWidth() * 0.0637f :
|
||||||
|
mRenderer->getScreenHeight() * 0.0637f};
|
||||||
|
|
||||||
|
float height {(mTitle->getFont()->getLetterHeight() + titleHeight) +
|
||||||
mSystem->getFont()->getLetterHeight() +
|
mSystem->getFont()->getLetterHeight() +
|
||||||
mSubtitle->getFont()->getHeight() * 1.75f + mButtonGrid->getSize().y +
|
mSubtitle->getFont()->getHeight() * 1.75f + mButtonGrid->getSize().y +
|
||||||
Font::get(FONT_SIZE_MEDIUM)->getHeight() * 7.0f};
|
Font::get(FONT_SIZE_MEDIUM)->getHeight() * 7.0f};
|
||||||
|
|
||||||
// TODO: Temporary hack, see below.
|
// TODO: Temporary hack, see below.
|
||||||
height -= 7.0f * Renderer::getScreenHeightModifier();
|
height -= 7.0f * mRenderer->getScreenResolutionModifier();
|
||||||
|
|
||||||
setSize(width, height);
|
setSize(width, height);
|
||||||
setPosition((Renderer::getScreenWidth() - mSize.x) / 2.0f,
|
setPosition((mRenderer->getScreenWidth() - mSize.x) / 2.0f,
|
||||||
(Renderer::getScreenHeight() - mSize.y) / 2.0f);
|
(mRenderer->getScreenHeight() - mSize.y) / 2.0f);
|
||||||
|
|
||||||
doNextSearch();
|
doNextSearch();
|
||||||
}
|
}
|
||||||
|
@ -178,11 +183,11 @@ GuiScraperMulti::~GuiScraperMulti()
|
||||||
|
|
||||||
void GuiScraperMulti::onSizeChanged()
|
void GuiScraperMulti::onSizeChanged()
|
||||||
{
|
{
|
||||||
mGrid.setRowHeightPerc(
|
const float screenSize {mRenderer->getIsVerticalOrientation() ? mRenderer->getScreenWidth() :
|
||||||
0, (mTitle->getFont()->getLetterHeight() + Renderer::getScreenHeight() * 0.0637f) /
|
mRenderer->getScreenHeight()};
|
||||||
|
mGrid.setRowHeightPerc(0, (mTitle->getFont()->getLetterHeight() + screenSize * 0.0637f) /
|
||||||
mSize.y / 2.0f);
|
mSize.y / 2.0f);
|
||||||
mGrid.setRowHeightPerc(
|
mGrid.setRowHeightPerc(1, (mTitle->getFont()->getLetterHeight() + screenSize * 0.0637f) /
|
||||||
1, (mTitle->getFont()->getLetterHeight() + Renderer::getScreenHeight() * 0.0637f) /
|
|
||||||
mSize.y / 2.0f);
|
mSize.y / 2.0f);
|
||||||
mGrid.setRowHeightPerc(2, (mSystem->getFont()->getLetterHeight()) / mSize.y, false);
|
mGrid.setRowHeightPerc(2, (mSystem->getFont()->getLetterHeight()) / mSize.y, false);
|
||||||
mGrid.setRowHeightPerc(3, mSubtitle->getFont()->getHeight() * 1.75f / mSize.y, false);
|
mGrid.setRowHeightPerc(3, mSubtitle->getFont()->getHeight() * 1.75f / mSize.y, false);
|
||||||
|
@ -191,8 +196,8 @@ void GuiScraperMulti::onSizeChanged()
|
||||||
// TODO: Replace this temporary hack with a proper solution. There is some kind of rounding
|
// TODO: Replace this temporary hack with a proper solution. There is some kind of rounding
|
||||||
// issue somewhere that causes a small alignment error. This code partly compensates for this
|
// issue somewhere that causes a small alignment error. This code partly compensates for this
|
||||||
// at higher resolutions than 1920x1080.
|
// at higher resolutions than 1920x1080.
|
||||||
if (Renderer::getScreenHeightModifier() > 1.0f)
|
if (mRenderer->getScreenResolutionModifier() > 1.0f)
|
||||||
mSize.y -= 3.0f * Renderer::getScreenHeightModifier();
|
mSize.y -= 3.0f * mRenderer->getScreenResolutionModifier();
|
||||||
|
|
||||||
mGrid.setColWidthPerc(1, 0.04f);
|
mGrid.setColWidthPerc(1, 0.04f);
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,7 @@ private:
|
||||||
void doNextSearch();
|
void doNextSearch();
|
||||||
void finish();
|
void finish();
|
||||||
|
|
||||||
|
Renderer* mRenderer;
|
||||||
NinePatchComponent mBackground;
|
NinePatchComponent mBackground;
|
||||||
ComponentGrid mGrid;
|
ComponentGrid mGrid;
|
||||||
|
|
||||||
|
|
|
@ -192,7 +192,7 @@ void GuiScraperSearch::onSizeChanged()
|
||||||
if (mSearchType == ALWAYS_ACCEPT_FIRST_RESULT)
|
if (mSearchType == ALWAYS_ACCEPT_FIRST_RESULT)
|
||||||
mGrid.setColWidthPerc(2, 0.33f);
|
mGrid.setColWidthPerc(2, 0.33f);
|
||||||
else
|
else
|
||||||
mGrid.setColWidthPerc(2, 0.30f);
|
mGrid.setColWidthPerc(2, (mRenderer->getIsVerticalOrientation() ? 0.34f : 0.30f));
|
||||||
|
|
||||||
// Row heights.
|
// Row heights.
|
||||||
if (mSearchType == ALWAYS_ACCEPT_FIRST_RESULT) // Show name.
|
if (mSearchType == ALWAYS_ACCEPT_FIRST_RESULT) // Show name.
|
||||||
|
@ -250,12 +250,18 @@ void GuiScraperSearch::resizeMetadata()
|
||||||
it->first->setFont(fontLbl);
|
it->first->setFont(fontLbl);
|
||||||
it->first->setSize(0, 0);
|
it->first->setSize(0, 0);
|
||||||
if (it->first->getSize().x > maxLblWidth)
|
if (it->first->getSize().x > maxLblWidth)
|
||||||
maxLblWidth = it->first->getSize().x + (16.0f * Renderer::getScreenWidthModifier());
|
maxLblWidth =
|
||||||
|
it->first->getSize().x + (16.0f * (mRenderer->getIsVerticalOrientation() ?
|
||||||
|
mRenderer->getScreenHeightModifier() :
|
||||||
|
mRenderer->getScreenWidthModifier()));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (unsigned int i = 0; i < mMD_Pairs.size(); ++i)
|
for (unsigned int i = 0; i < mMD_Pairs.size(); ++i)
|
||||||
mMD_Grid->setRowHeightPerc(
|
mMD_Grid->setRowHeightPerc(
|
||||||
i * 2, (fontLbl->getLetterHeight() + (2.0f * Renderer::getScreenHeightModifier())) /
|
i * 2,
|
||||||
|
(fontLbl->getLetterHeight() + (2.0f * (mRenderer->getIsVerticalOrientation() ?
|
||||||
|
mRenderer->getScreenWidthModifier() :
|
||||||
|
mRenderer->getScreenHeightModifier()))) /
|
||||||
mMD_Grid->getSize().y);
|
mMD_Grid->getSize().y);
|
||||||
|
|
||||||
// Update component fonts.
|
// Update component fonts.
|
||||||
|
|
|
@ -21,8 +21,9 @@ GuiScraperSingle::GuiScraperSingle(ScraperSearchParams& params,
|
||||||
std::function<void(const ScraperSearchResult&)> doneFunc,
|
std::function<void(const ScraperSearchResult&)> doneFunc,
|
||||||
bool& savedMediaAndAborted)
|
bool& savedMediaAndAborted)
|
||||||
: mClose {false}
|
: mClose {false}
|
||||||
, mGrid {glm::ivec2 {2, 6}}
|
, mRenderer {Renderer::getInstance()}
|
||||||
, mBackground {":/graphics/frame.svg"}
|
, mBackground {":/graphics/frame.svg"}
|
||||||
|
, mGrid {glm::ivec2 {2, 6}}
|
||||||
, mSearchParams {params}
|
, mSearchParams {params}
|
||||||
, mSavedMediaAndAborted {savedMediaAndAborted}
|
, mSavedMediaAndAborted {savedMediaAndAborted}
|
||||||
{
|
{
|
||||||
|
@ -119,17 +120,18 @@ GuiScraperSingle::GuiScraperSingle(ScraperSearchParams& params,
|
||||||
|
|
||||||
// Limit the width of the GUI on ultrawide monitors. The 1.778 aspect ratio value is
|
// Limit the width of the GUI on ultrawide monitors. The 1.778 aspect ratio value is
|
||||||
// the 16:9 reference.
|
// the 16:9 reference.
|
||||||
float aspectValue {1.778f / Renderer::getScreenAspectRatio()};
|
const float aspectValue {1.778f / Renderer::getScreenAspectRatio()};
|
||||||
float width {glm::clamp(0.95f * aspectValue, 0.70f, 0.95f) * Renderer::getScreenWidth()};
|
const float width {glm::clamp(0.95f * aspectValue, 0.70f, 0.95f) * mRenderer->getScreenWidth()};
|
||||||
|
const float screenSize {mRenderer->getIsVerticalOrientation() ? mRenderer->getScreenWidth() :
|
||||||
|
mRenderer->getScreenHeight()};
|
||||||
|
|
||||||
float height {
|
const float height {(mGameName->getFont()->getLetterHeight() + screenSize * 0.0637f) +
|
||||||
(mGameName->getFont()->getLetterHeight() + Renderer::getScreenHeight() * 0.0637f) +
|
mSystemName->getFont()->getLetterHeight() + screenSize * 0.04f +
|
||||||
mSystemName->getFont()->getLetterHeight() + Renderer::getScreenHeight() * 0.04f +
|
|
||||||
mButtonGrid->getSize().y + Font::get(FONT_SIZE_MEDIUM)->getHeight() * 8.0f};
|
mButtonGrid->getSize().y + Font::get(FONT_SIZE_MEDIUM)->getHeight() * 8.0f};
|
||||||
|
|
||||||
setSize(width, height);
|
setSize(width, height);
|
||||||
setPosition((Renderer::getScreenWidth() - mSize.x) / 2.0f,
|
setPosition((mRenderer->getScreenWidth() - mSize.x) / 2.0f,
|
||||||
(Renderer::getScreenHeight() - mSize.y) / 2.0f);
|
(mRenderer->getScreenHeight() - mSize.y) / 2.0f);
|
||||||
|
|
||||||
mGrid.resetCursor();
|
mGrid.resetCursor();
|
||||||
mSearch->search(params); // Start the search.
|
mSearch->search(params); // Start the search.
|
||||||
|
@ -137,16 +139,21 @@ GuiScraperSingle::GuiScraperSingle(ScraperSearchParams& params,
|
||||||
|
|
||||||
void GuiScraperSingle::onSizeChanged()
|
void GuiScraperSingle::onSizeChanged()
|
||||||
{
|
{
|
||||||
mGrid.setRowHeightPerc(
|
const float gameNameHeight {mRenderer->getIsVerticalOrientation() ?
|
||||||
0, (mGameName->getFont()->getLetterHeight() + Renderer::getScreenHeight() * 0.0637f) /
|
mRenderer->getScreenWidth() * 0.0637f :
|
||||||
mSize.y / 2.0f);
|
mRenderer->getScreenHeight() * 0.0637f};
|
||||||
mGrid.setRowHeightPerc(
|
|
||||||
1, (mGameName->getFont()->getLetterHeight() + Renderer::getScreenHeight() * 0.0637f) /
|
mGrid.setRowHeightPerc(0, (mGameName->getFont()->getLetterHeight() + gameNameHeight) / mSize.y /
|
||||||
mSize.y / 2.0f);
|
2.0f);
|
||||||
|
mGrid.setRowHeightPerc(1, (mGameName->getFont()->getLetterHeight() + gameNameHeight) / mSize.y /
|
||||||
|
2.0f);
|
||||||
mGrid.setRowHeightPerc(2, mSystemName->getFont()->getLetterHeight() / mSize.y, false);
|
mGrid.setRowHeightPerc(2, mSystemName->getFont()->getLetterHeight() / mSize.y, false);
|
||||||
mGrid.setRowHeightPerc(3, 0.04f, false);
|
mGrid.setRowHeightPerc(3, 0.04f, false);
|
||||||
mGrid.setRowHeightPerc(4, (Font::get(FONT_SIZE_MEDIUM)->getHeight() * 8.0f) / mSize.y, false);
|
mGrid.setRowHeightPerc(4, (Font::get(FONT_SIZE_MEDIUM)->getHeight() * 8.0f) / mSize.y, false);
|
||||||
|
|
||||||
|
if (mRenderer->getIsVerticalOrientation())
|
||||||
|
mGrid.setColWidthPerc(1, 0.05f);
|
||||||
|
else
|
||||||
mGrid.setColWidthPerc(1, 0.04f);
|
mGrid.setColWidthPerc(1, 0.04f);
|
||||||
|
|
||||||
mGrid.setSize(glm::round(mSize));
|
mGrid.setSize(glm::round(mSize));
|
||||||
|
|
|
@ -36,8 +36,9 @@ private:
|
||||||
bool mClose;
|
bool mClose;
|
||||||
void close();
|
void close();
|
||||||
|
|
||||||
ComponentGrid mGrid;
|
Renderer* mRenderer;
|
||||||
NinePatchComponent mBackground;
|
NinePatchComponent mBackground;
|
||||||
|
ComponentGrid mGrid;
|
||||||
|
|
||||||
std::shared_ptr<TextComponent> mGameName;
|
std::shared_ptr<TextComponent> mGameName;
|
||||||
std::shared_ptr<ImageComponent> mScrollUp;
|
std::shared_ptr<ImageComponent> mScrollUp;
|
||||||
|
|
|
@ -123,11 +123,11 @@ bool Window::init()
|
||||||
mDefaultFonts.push_back(Font::get(FONT_SIZE_LARGE));
|
mDefaultFonts.push_back(Font::get(FONT_SIZE_LARGE));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mRenderer->getScreenWidth() > mRenderer->getScreenHeight())
|
if (mRenderer->getIsVerticalOrientation())
|
||||||
|
mSplash->setResize(mRenderer->getScreenWidth() * 0.8f, 0.0f);
|
||||||
|
else
|
||||||
mSplash->setResize(0.0f, glm::clamp(mRenderer->getScreenHeight() * 0.62f, 0.0f,
|
mSplash->setResize(0.0f, glm::clamp(mRenderer->getScreenHeight() * 0.62f, 0.0f,
|
||||||
mRenderer->getScreenWidth() * 0.42f));
|
mRenderer->getScreenWidth() * 0.42f));
|
||||||
else
|
|
||||||
mSplash->setResize(mRenderer->getScreenWidth() * 0.8f, 0.0f);
|
|
||||||
|
|
||||||
mSplash->setImage(":/graphics/splash.svg");
|
mSplash->setImage(":/graphics/splash.svg");
|
||||||
mSplash->setPosition((mRenderer->getScreenWidth() - mSplash->getSize().x) / 2.0f,
|
mSplash->setPosition((mRenderer->getScreenWidth() - mSplash->getSize().x) / 2.0f,
|
||||||
|
@ -146,13 +146,15 @@ bool Window::init()
|
||||||
(mRenderer->getScreenWidth() - mSplashTextPopulating->metrics.size.x) / 2.0f;
|
(mRenderer->getScreenWidth() - mSplashTextPopulating->metrics.size.x) / 2.0f;
|
||||||
mSplashTextPositions.w =
|
mSplashTextPositions.w =
|
||||||
(mRenderer->getScreenWidth() - mSplashTextReloading->metrics.size.x) / 2.0f;
|
(mRenderer->getScreenWidth() - mSplashTextReloading->metrics.size.x) / 2.0f;
|
||||||
mSplashTextPositions.y = mRenderer->getScreenHeight() * 0.745f;
|
mSplashTextPositions.y =
|
||||||
|
mRenderer->getScreenHeight() * (mRenderer->getIsVerticalOrientation() ? 0.620f : 0.745f);
|
||||||
|
|
||||||
ProgressBarRectangle progressBarRect;
|
ProgressBarRectangle progressBarRect;
|
||||||
if (mRenderer->getScreenWidth() > mRenderer->getScreenHeight())
|
if (mRenderer->getIsVerticalOrientation())
|
||||||
progressBarRect.barWidth = mRenderer->getScreenHeight() * 0.53f;
|
|
||||||
else
|
|
||||||
progressBarRect.barWidth = mRenderer->getScreenWidth() * 0.53f;
|
progressBarRect.barWidth = mRenderer->getScreenWidth() * 0.53f;
|
||||||
|
else
|
||||||
|
progressBarRect.barWidth = mRenderer->getScreenHeight() * 0.53f;
|
||||||
|
|
||||||
progressBarRect.barHeight = mDefaultFonts.at(1)->getLetterHeight() * 1.1f;
|
progressBarRect.barHeight = mDefaultFonts.at(1)->getLetterHeight() * 1.1f;
|
||||||
progressBarRect.barPosX =
|
progressBarRect.barPosX =
|
||||||
(mRenderer->getScreenWidth() / 2.0f) - (progressBarRect.barWidth / 2.0f);
|
(mRenderer->getScreenWidth() / 2.0f) - (progressBarRect.barWidth / 2.0f);
|
||||||
|
|
|
@ -56,10 +56,10 @@ void BusyComponent::onSizeChanged()
|
||||||
|
|
||||||
mGrid.setRowHeightPerc(1, textHeight / std::round(mSize.y));
|
mGrid.setRowHeightPerc(1, textHeight / std::round(mSize.y));
|
||||||
|
|
||||||
mBackground.setCornerSize(
|
mBackground.setCornerSize({16.0f * Renderer::getScreenResolutionModifier(),
|
||||||
{16.0f * Renderer::getScreenWidthModifier(), 16.0f * Renderer::getScreenHeightModifier()});
|
16.0f * Renderer::getScreenResolutionModifier()});
|
||||||
mBackground.fitTo(glm::vec2 {mGrid.getColWidth(1) + mGrid.getColWidth(2) + mGrid.getColWidth(3),
|
mBackground.fitTo(glm::vec2 {mGrid.getColWidth(1) + mGrid.getColWidth(2) + mGrid.getColWidth(3),
|
||||||
textHeight + (2.0f * Renderer::getScreenHeightModifier())},
|
textHeight + (2.0f * Renderer::getScreenResolutionModifier())},
|
||||||
mAnimation->getPosition(), glm::vec2 {});
|
mAnimation->getPosition(), glm::vec2 {});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -72,8 +72,10 @@ void ButtonComponent::setText(const std::string& text, const std::string& helpTe
|
||||||
mTextCache =
|
mTextCache =
|
||||||
std::unique_ptr<TextCache>(mFont->buildTextCache(mText, 0.0f, 0.0f, getCurTextColor()));
|
std::unique_ptr<TextCache>(mFont->buildTextCache(mText, 0.0f, 0.0f, getCurTextColor()));
|
||||||
|
|
||||||
float minWidth = mFont->sizeText("DELETE").x + (12.0f * Renderer::getScreenWidthModifier());
|
const float minWidth {mFont->sizeText("DELETE").x +
|
||||||
setSize(std::max(mTextCache->metrics.size.x + (12.0f * Renderer::getScreenWidthModifier()),
|
(12.0f * mRenderer->getScreenResolutionModifier())};
|
||||||
|
setSize(
|
||||||
|
std::max(mTextCache->metrics.size.x + (12.0f * mRenderer->getScreenResolutionModifier()),
|
||||||
minWidth),
|
minWidth),
|
||||||
mTextCache->metrics.size.y);
|
mTextCache->metrics.size.y);
|
||||||
|
|
||||||
|
|
|
@ -30,9 +30,12 @@ ComponentList::ComponentList()
|
||||||
{
|
{
|
||||||
// Adjust the padding relative to the aspect ratio and screen resolution to make it look
|
// Adjust the padding relative to the aspect ratio and screen resolution to make it look
|
||||||
// coherent regardless of screen type. The 1.778 aspect ratio value is the 16:9 reference.
|
// coherent regardless of screen type. The 1.778 aspect ratio value is the 16:9 reference.
|
||||||
float aspectValue {1.778f / Renderer::getScreenAspectRatio()};
|
float aspectValue {1.778f / mRenderer->getScreenAspectRatio()};
|
||||||
mHorizontalPadding =
|
mHorizontalPadding =
|
||||||
TOTAL_HORIZONTAL_PADDING_PX * aspectValue * Renderer::getScreenWidthModifier();
|
TOTAL_HORIZONTAL_PADDING_PX * aspectValue * mRenderer->getScreenWidthModifier();
|
||||||
|
|
||||||
|
if (mRenderer->getIsVerticalOrientation())
|
||||||
|
mHorizontalPadding *= 0.7f;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComponentList::addRow(const ComponentListRow& row, bool setCursorHere)
|
void ComponentList::addRow(const ComponentListRow& row, bool setCursorHere)
|
||||||
|
@ -403,12 +406,12 @@ void ComponentList::render(const glm::mat4& parentTrans)
|
||||||
// Draw separators.
|
// Draw separators.
|
||||||
float y {0.0f};
|
float y {0.0f};
|
||||||
for (unsigned int i = 0; i < mEntries.size(); ++i) {
|
for (unsigned int i = 0; i < mEntries.size(); ++i) {
|
||||||
mRenderer->drawRect(0.0f, y, mSize.x, 1.0f * Renderer::getScreenHeightModifier(),
|
mRenderer->drawRect(0.0f, y, mSize.x, 1.0f * mRenderer->getScreenHeightModifier(),
|
||||||
0xC6C7C6FF, 0xC6C7C6FF, false, mOpacity, mDimming);
|
0xC6C7C6FF, 0xC6C7C6FF, false, mOpacity, mDimming);
|
||||||
y += getRowHeight(mEntries.at(i).data);
|
y += getRowHeight(mEntries.at(i).data);
|
||||||
}
|
}
|
||||||
|
|
||||||
mRenderer->drawRect(0.0f, y, mSize.x, 1.0f * Renderer::getScreenHeightModifier(), 0xC6C7C6FF,
|
mRenderer->drawRect(0.0f, y, mSize.x, 1.0f * mRenderer->getScreenHeightModifier(), 0xC6C7C6FF,
|
||||||
0xC6C7C6FF, false, mOpacity, mDimming);
|
0xC6C7C6FF, false, mOpacity, mDimming);
|
||||||
mRenderer->popClipRect();
|
mRenderer->popClipRect();
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,10 +14,14 @@
|
||||||
#define BUTTON_GRID_VERT_PADDING Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 0.915f
|
#define BUTTON_GRID_VERT_PADDING Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 0.915f
|
||||||
#define BUTTON_GRID_HORIZ_PADDING Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 0.283f
|
#define BUTTON_GRID_HORIZ_PADDING Font::get(FONT_SIZE_MEDIUM)->getLetterHeight() * 0.283f
|
||||||
|
|
||||||
#define TITLE_HEIGHT (mTitle->getFont()->getLetterHeight() + Renderer::getScreenHeight() * 0.0637f)
|
#define TITLE_HEIGHT \
|
||||||
|
(mTitle->getFont()->getLetterHeight() + (Renderer::getIsVerticalOrientation() ? \
|
||||||
|
Renderer::getScreenWidth() * 0.0637f : \
|
||||||
|
Renderer::getScreenHeight() * 0.0637f))
|
||||||
|
|
||||||
MenuComponent::MenuComponent(std::string title, const std::shared_ptr<Font>& titleFont)
|
MenuComponent::MenuComponent(std::string title, const std::shared_ptr<Font>& titleFont)
|
||||||
: mGrid {glm::ivec2 {2, 4}}
|
: mRenderer {Renderer::getInstance()}
|
||||||
|
, mGrid {glm::ivec2 {2, 4}}
|
||||||
, mNeedsSaving {false}
|
, mNeedsSaving {false}
|
||||||
{
|
{
|
||||||
addChild(&mBackground);
|
addChild(&mBackground);
|
||||||
|
@ -90,15 +94,16 @@ float MenuComponent::getButtonGridHeight() const
|
||||||
|
|
||||||
void MenuComponent::updateSize()
|
void MenuComponent::updateSize()
|
||||||
{
|
{
|
||||||
const float maxHeight {Renderer::getScreenHeight() * 0.80f};
|
const float maxHeight {mRenderer->getScreenHeight() *
|
||||||
|
(mRenderer->getIsVerticalOrientation() ? 0.70f : 0.80f)};
|
||||||
float height {TITLE_HEIGHT + mList->getTotalRowHeight() + getButtonGridHeight() +
|
float height {TITLE_HEIGHT + mList->getTotalRowHeight() + getButtonGridHeight() +
|
||||||
(2.0f * Renderer::getScreenHeightModifier())};
|
(2.0f * mRenderer->getScreenResolutionModifier())};
|
||||||
if (height > maxHeight) {
|
if (height > maxHeight) {
|
||||||
height = TITLE_HEIGHT + getButtonGridHeight();
|
height = TITLE_HEIGHT + getButtonGridHeight();
|
||||||
int i {0};
|
int i {0};
|
||||||
while (i < mList->size()) {
|
while (i < mList->size()) {
|
||||||
// Add the separator height to the row height so that it also gets properly rendered.
|
// Add the separator height to the row height so that it also gets properly rendered.
|
||||||
float rowHeight {mList->getRowHeight(i) + (1.0f * Renderer::getScreenHeightModifier())};
|
float rowHeight {mList->getRowHeight(i) + mRenderer->getScreenResolutionModifier()};
|
||||||
if (height + rowHeight < maxHeight)
|
if (height + rowHeight < maxHeight)
|
||||||
height += rowHeight;
|
height += rowHeight;
|
||||||
else
|
else
|
||||||
|
@ -107,7 +112,8 @@ void MenuComponent::updateSize()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float width {std::min(Renderer::getScreenHeight() * 1.05f, Renderer::getScreenWidth() * 0.90f)};
|
float width {
|
||||||
|
std::min(mRenderer->getScreenHeight() * 1.05f, mRenderer->getScreenWidth() * 0.90f)};
|
||||||
setSize(width, height);
|
setSize(width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,6 +81,7 @@ private:
|
||||||
void updateGrid();
|
void updateGrid();
|
||||||
float getButtonGridHeight() const;
|
float getButtonGridHeight() const;
|
||||||
|
|
||||||
|
Renderer* mRenderer;
|
||||||
NinePatchComponent mBackground;
|
NinePatchComponent mBackground;
|
||||||
ComponentGrid mGrid;
|
ComponentGrid mGrid;
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ ScrollableContainer::ScrollableContainer()
|
||||||
, mUpdatedSize {false}
|
, mUpdatedSize {false}
|
||||||
{
|
{
|
||||||
// Set the modifier to get equivalent scrolling speed regardless of screen resolution.
|
// Set the modifier to get equivalent scrolling speed regardless of screen resolution.
|
||||||
mResolutionModifier = Renderer::getScreenHeightModifier();
|
mResolutionModifier = mRenderer->getScreenResolutionModifier();
|
||||||
|
|
||||||
mAutoScrollResetDelayConstant = AUTO_SCROLL_RESET_DELAY;
|
mAutoScrollResetDelayConstant = AUTO_SCROLL_RESET_DELAY;
|
||||||
mAutoScrollDelayConstant = AUTO_SCROLL_DELAY;
|
mAutoScrollDelayConstant = AUTO_SCROLL_DELAY;
|
||||||
|
|
|
@ -34,7 +34,7 @@ TextEditComponent::TextEditComponent()
|
||||||
mBox.setSharpCorners(true);
|
mBox.setSharpCorners(true);
|
||||||
addChild(&mBox);
|
addChild(&mBox);
|
||||||
onFocusLost();
|
onFocusLost();
|
||||||
setSize(4096, mFont->getHeight() + (TEXT_PADDING_VERT * Renderer::getScreenHeightModifier()));
|
setSize(4096, mFont->getHeight() + (TEXT_PADDING_VERT * mRenderer->getScreenHeightModifier()));
|
||||||
}
|
}
|
||||||
|
|
||||||
void TextEditComponent::onFocusGained()
|
void TextEditComponent::onFocusGained()
|
||||||
|
@ -57,7 +57,7 @@ void TextEditComponent::onSizeChanged()
|
||||||
|
|
||||||
mBox.fitTo(
|
mBox.fitTo(
|
||||||
mSize, glm::vec3 {},
|
mSize, glm::vec3 {},
|
||||||
glm::vec2 {-34.0f, -32.0f - (TEXT_PADDING_VERT * Renderer::getScreenHeightModifier())});
|
glm::vec2 {-34.0f, -32.0f - (TEXT_PADDING_VERT * mRenderer->getScreenHeightModifier())});
|
||||||
onTextChanged(); // Wrap point probably changed.
|
onTextChanged(); // Wrap point probably changed.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -311,7 +311,7 @@ void TextEditComponent::render(const glm::mat4& parentTrans)
|
||||||
|
|
||||||
glm::ivec2 clipPos {static_cast<int>(trans[3].x), static_cast<int>(trans[3].y)};
|
glm::ivec2 clipPos {static_cast<int>(trans[3].x), static_cast<int>(trans[3].y)};
|
||||||
// Use "text area" size for clipping.
|
// Use "text area" size for clipping.
|
||||||
glm::vec3 dimScaled {};
|
glm::vec3 dimScaled {0.0f, 0.0f, 0.0f};
|
||||||
dimScaled.x = std::fabs(trans[3].x + getTextAreaSize().x);
|
dimScaled.x = std::fabs(trans[3].x + getTextAreaSize().x);
|
||||||
dimScaled.y = std::fabs(trans[3].y + getTextAreaSize().y);
|
dimScaled.y = std::fabs(trans[3].y + getTextAreaSize().y);
|
||||||
|
|
||||||
|
@ -329,31 +329,31 @@ void TextEditComponent::render(const glm::mat4& parentTrans)
|
||||||
mRenderer->popClipRect();
|
mRenderer->popClipRect();
|
||||||
|
|
||||||
// Draw cursor.
|
// Draw cursor.
|
||||||
float cursorHeight {mFont->getHeight() * 0.8f};
|
const float cursorHeight {mFont->getHeight() * 0.8f};
|
||||||
|
|
||||||
if (!mEditing) {
|
if (!mEditing) {
|
||||||
mRenderer->drawRect(mCursorPos.x, mCursorPos.y + (mFont->getHeight() - cursorHeight) / 2.0f,
|
mRenderer->drawRect(mCursorPos.x, mCursorPos.y + (mFont->getHeight() - cursorHeight) / 2.0f,
|
||||||
2.0f * Renderer::getScreenWidthModifier(), cursorHeight, 0xC7C7C7FF,
|
2.0f * mRenderer->getScreenResolutionModifier(), cursorHeight,
|
||||||
0xC7C7C7FF);
|
0xC7C7C7FF, 0xC7C7C7FF);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mEditing && mBlinkTime < BLINKTIME / 2) {
|
if (mEditing && mBlinkTime < BLINKTIME / 2) {
|
||||||
mRenderer->drawRect(mCursorPos.x, mCursorPos.y + (mFont->getHeight() - cursorHeight) / 2.0f,
|
mRenderer->drawRect(mCursorPos.x, mCursorPos.y + (mFont->getHeight() - cursorHeight) / 2.0f,
|
||||||
2.0f * Renderer::getScreenWidthModifier(), cursorHeight, 0x777777FF,
|
2.0f * mRenderer->getScreenResolutionModifier(), cursorHeight,
|
||||||
0x777777FF);
|
0x777777FF, 0x777777FF);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec2 TextEditComponent::getTextAreaPos() const
|
glm::vec2 TextEditComponent::getTextAreaPos() const
|
||||||
{
|
{
|
||||||
return glm::vec2 {(TEXT_PADDING_HORIZ * Renderer::getScreenWidthModifier()) / 2.0f,
|
return glm::vec2 {(TEXT_PADDING_HORIZ * mRenderer->getScreenResolutionModifier()) / 2.0f,
|
||||||
(TEXT_PADDING_VERT * Renderer::getScreenHeightModifier()) / 2.0f};
|
(TEXT_PADDING_VERT * mRenderer->getScreenResolutionModifier()) / 2.0f};
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec2 TextEditComponent::getTextAreaSize() const
|
glm::vec2 TextEditComponent::getTextAreaSize() const
|
||||||
{
|
{
|
||||||
return glm::vec2 {mSize.x - (TEXT_PADDING_HORIZ * Renderer::getScreenWidthModifier()),
|
return glm::vec2 {mSize.x - (TEXT_PADDING_HORIZ * mRenderer->getScreenResolutionModifier()),
|
||||||
mSize.y - (TEXT_PADDING_VERT * Renderer::getScreenHeightModifier())};
|
mSize.y - (TEXT_PADDING_VERT * mRenderer->getScreenResolutionModifier())};
|
||||||
}
|
}
|
||||||
|
|
||||||
std::vector<HelpPrompt> TextEditComponent::getHelpPrompts()
|
std::vector<HelpPrompt> TextEditComponent::getHelpPrompts()
|
||||||
|
|
|
@ -7,12 +7,14 @@
|
||||||
// Has a default mode and a complex mode, both with various options passed as arguments.
|
// Has a default mode and a complex mode, both with various options passed as arguments.
|
||||||
//
|
//
|
||||||
|
|
||||||
#define KEYBOARD_HEIGHT Renderer::getScreenHeight() * 0.60f
|
#define KEYBOARD_HEIGHT \
|
||||||
|
(Renderer::getIsVerticalOrientation() ? Renderer::getScreenWidth() * 0.60f : \
|
||||||
|
Renderer::getScreenHeight() * 0.60f)
|
||||||
|
|
||||||
#define KEYBOARD_PADDINGX (Renderer::getScreenWidth() * 0.02f)
|
#define KEYBOARD_PADDINGX (Renderer::getScreenWidth() * 0.02f)
|
||||||
#define KEYBOARD_PADDINGY (Renderer::getScreenWidth() * 0.01f)
|
#define KEYBOARD_PADDINGY (Renderer::getScreenWidth() * 0.01f)
|
||||||
|
|
||||||
#define BUTTON_GRID_HORIZ_PADDING (10.0f * Renderer::getScreenHeightModifier())
|
#define BUTTON_GRID_HORIZ_PADDING (10.0f * Renderer::getScreenResolutionModifier())
|
||||||
|
|
||||||
#define NAVIGATION_REPEAT_START_DELAY 400
|
#define NAVIGATION_REPEAT_START_DELAY 400
|
||||||
#define NAVIGATION_REPEAT_SPEED 70 // Lower is faster.
|
#define NAVIGATION_REPEAT_SPEED 70 // Lower is faster.
|
||||||
|
@ -86,7 +88,8 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup(
|
||||||
const std::string& loadBtnHelpText,
|
const std::string& loadBtnHelpText,
|
||||||
const std::string& clearBtnHelpText,
|
const std::string& clearBtnHelpText,
|
||||||
const std::string& cancelBtnHelpText)
|
const std::string& cancelBtnHelpText)
|
||||||
: mBackground {":/graphics/frame.svg"}
|
: mRenderer {Renderer::getInstance()}
|
||||||
|
, mBackground {":/graphics/frame.svg"}
|
||||||
, mGrid {glm::ivec2 {1, (infoString != "" && defaultValue != "" ? 8 : 6)}}
|
, mGrid {glm::ivec2 {1, (infoString != "" && defaultValue != "" ? 8 : 6)}}
|
||||||
, mHelpStyle {helpstyle}
|
, mHelpStyle {helpstyle}
|
||||||
, mInitValue {initValue}
|
, mInitValue {initValue}
|
||||||
|
@ -241,7 +244,7 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup(
|
||||||
// If the multiLine option has been set, then include three lines of text on screen.
|
// If the multiLine option has been set, then include three lines of text on screen.
|
||||||
if (multiLine) {
|
if (multiLine) {
|
||||||
textHeight *= 3.0f;
|
textHeight *= 3.0f;
|
||||||
textHeight += 2.0f * Renderer::getScreenHeightModifier();
|
textHeight += 2.0f * mRenderer->getScreenResolutionModifier();
|
||||||
}
|
}
|
||||||
|
|
||||||
mText->setSize(0.0f, textHeight);
|
mText->setSize(0.0f, textHeight);
|
||||||
|
@ -264,16 +267,16 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup(
|
||||||
});
|
});
|
||||||
|
|
||||||
// Adapt width to the geometry of the display. The 1.778 aspect ratio is the 16:9 reference.
|
// Adapt width to the geometry of the display. The 1.778 aspect ratio is the 16:9 reference.
|
||||||
float aspectValue = 1.778f / Renderer::getScreenAspectRatio();
|
float aspectValue {1.778f / mRenderer->getScreenAspectRatio()};
|
||||||
float width = glm::clamp(0.78f * aspectValue, 0.35f, 0.90f) * Renderer::getScreenWidth();
|
float width {glm::clamp(0.78f * aspectValue, 0.35f, 0.90f) * mRenderer->getScreenWidth()};
|
||||||
|
|
||||||
// The combination of multiLine and complex mode is not supported as there is currently
|
// The combination of multiLine and complex mode is not supported as there is currently
|
||||||
// no need for that.
|
// no need for that.
|
||||||
if (mMultiLine) {
|
if (mMultiLine) {
|
||||||
setSize(width, KEYBOARD_HEIGHT + textHeight - mText->getFont()->getHeight());
|
setSize(width, KEYBOARD_HEIGHT + textHeight - mText->getFont()->getHeight());
|
||||||
|
|
||||||
setPosition((Renderer::getScreenWidth() - mSize.x) / 2.0f,
|
setPosition((mRenderer->getScreenWidth() - mSize.x) / 2.0f,
|
||||||
(Renderer::getScreenHeight() - mSize.y) / 2.0f);
|
(mRenderer->getScreenHeight() - mSize.y) / 2.0f);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (mComplexMode)
|
if (mComplexMode)
|
||||||
|
@ -281,8 +284,8 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup(
|
||||||
else
|
else
|
||||||
setSize(width, KEYBOARD_HEIGHT);
|
setSize(width, KEYBOARD_HEIGHT);
|
||||||
|
|
||||||
setPosition((Renderer::getScreenWidth() - mSize.x) / 2.0f,
|
setPosition((mRenderer->getScreenWidth() - mSize.x) / 2.0f,
|
||||||
(Renderer::getScreenHeight() - mSize.y) / 2.0f);
|
(mRenderer->getScreenHeight() - mSize.y) / 2.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!multiLine)
|
if (!multiLine)
|
||||||
|
@ -313,7 +316,8 @@ void GuiTextEditKeyboardPopup::onSizeChanged()
|
||||||
|
|
||||||
// Add a small margin between buttons.
|
// Add a small margin between buttons.
|
||||||
mKeyboardGrid->setSize(mSize.x - KEYBOARD_PADDINGX - KEYBOARD_PADDINGX,
|
mKeyboardGrid->setSize(mSize.x - KEYBOARD_PADDINGX - KEYBOARD_PADDINGX,
|
||||||
sz.y - KEYBOARD_PADDINGY + 70.0f * Renderer::getScreenHeightModifier());
|
sz.y - KEYBOARD_PADDINGY +
|
||||||
|
70.0f * mRenderer->getScreenResolutionModifier());
|
||||||
mKeyboardGrid->setPosition(KEYBOARD_PADDINGX, pos.y);
|
mKeyboardGrid->setPosition(KEYBOARD_PADDINGX, pos.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,6 +75,7 @@ private:
|
||||||
std::shared_ptr<ButtonComponent> mShiftButton;
|
std::shared_ptr<ButtonComponent> mShiftButton;
|
||||||
std::shared_ptr<ButtonComponent> mAltButton;
|
std::shared_ptr<ButtonComponent> mAltButton;
|
||||||
|
|
||||||
|
Renderer* mRenderer;
|
||||||
NinePatchComponent mBackground;
|
NinePatchComponent mBackground;
|
||||||
ComponentGrid mGrid;
|
ComponentGrid mGrid;
|
||||||
HelpStyle mHelpStyle;
|
HelpStyle mHelpStyle;
|
||||||
|
|
|
@ -160,9 +160,9 @@ public:
|
||||||
const glm::mat4& getProjectionMatrixNormal() { return mProjectionMatrixNormal; }
|
const glm::mat4& getProjectionMatrixNormal() { return mProjectionMatrixNormal; }
|
||||||
SDL_Window* getSDLWindow() { return mSDLWindow; }
|
SDL_Window* getSDLWindow() { return mSDLWindow; }
|
||||||
const int getScreenRotation() { return mScreenRotation; }
|
const int getScreenRotation() { return mScreenRotation; }
|
||||||
const bool getIsVerticalOrientation() { return sIsVerticalOrientation; }
|
|
||||||
const float getWindowWidth() { return static_cast<float>(mWindowWidth); }
|
const float getWindowWidth() { return static_cast<float>(mWindowWidth); }
|
||||||
const float getWindowHeight() { return static_cast<float>(mWindowHeight); }
|
const float getWindowHeight() { return static_cast<float>(mWindowHeight); }
|
||||||
|
static const bool getIsVerticalOrientation() { return sIsVerticalOrientation; }
|
||||||
static const float getScreenWidth() { return static_cast<float>(sScreenWidth); }
|
static const float getScreenWidth() { return static_cast<float>(sScreenWidth); }
|
||||||
static const float getScreenHeight() { return static_cast<float>(sScreenHeight); }
|
static const float getScreenHeight() { return static_cast<float>(sScreenHeight); }
|
||||||
static const float getScreenWidthModifier() { return sScreenWidthModifier; }
|
static const float getScreenWidthModifier() { return sScreenWidthModifier; }
|
||||||
|
|
Loading…
Reference in a new issue