mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-02-18 04:45:39 +00:00
Fixed an issue where raster graphic images could get scaled incorrectly.
This commit is contained in:
parent
ea8aac03f0
commit
967b98008b
|
@ -65,8 +65,9 @@ public:
|
||||||
void setForceRasterization(bool setting) { mForceRasterization = setting; }
|
void setForceRasterization(bool setting) { mForceRasterization = setting; }
|
||||||
|
|
||||||
// Has the image been loaded but not yet been rasterized as the size was not known?
|
// Has the image been loaded but not yet been rasterized as the size was not known?
|
||||||
bool getPendingRasterization() { return mPendingRasterization; }
|
const bool getPendingRasterization() { return mPendingRasterization; }
|
||||||
|
|
||||||
|
const bool getScalable() { return mScalable; }
|
||||||
std::vector<unsigned char>& getRawRGBAData() { return mDataRGBA; }
|
std::vector<unsigned char>& getRawRGBAData() { return mDataRGBA; }
|
||||||
std::string getTextureFilePath() { return mPath; }
|
std::string getTextureFilePath() { return mPath; }
|
||||||
bool tiled() { return mTile; }
|
bool tiled() { return mTile; }
|
||||||
|
|
|
@ -200,6 +200,8 @@ void TextureResource::rasterizeAt(float width, float height)
|
||||||
data = mTextureData;
|
data = mTextureData;
|
||||||
else
|
else
|
||||||
data = sTextureDataManager.get(this);
|
data = sTextureDataManager.get(this);
|
||||||
|
|
||||||
|
if (mTextureData && mTextureData.get()->getScalable())
|
||||||
mSourceSize = glm::vec2 {static_cast<float>(width), static_cast<float>(height)};
|
mSourceSize = glm::vec2 {static_cast<float>(width), static_cast<float>(height)};
|
||||||
data->setSourceSize(static_cast<float>(width), static_cast<float>(height));
|
data->setSourceSize(static_cast<float>(width), static_cast<float>(height));
|
||||||
if (mForceLoad || mTextureData != nullptr)
|
if (mForceLoad || mTextureData != nullptr)
|
||||||
|
|
|
@ -41,11 +41,16 @@ public:
|
||||||
std::vector<unsigned char> getRawRGBAData();
|
std::vector<unsigned char> getRawRGBAData();
|
||||||
|
|
||||||
// Has the image been loaded but not yet been rasterized as the size was not known?
|
// Has the image been loaded but not yet been rasterized as the size was not known?
|
||||||
bool getPendingRasterization() const
|
const bool getPendingRasterization() const
|
||||||
{
|
{
|
||||||
return (mTextureData != nullptr ? mTextureData->getPendingRasterization() : false);
|
return (mTextureData != nullptr ? mTextureData->getPendingRasterization() : false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const bool getScalable() const
|
||||||
|
{
|
||||||
|
return (mTextureData != nullptr ? mTextureData->getScalable() : false);
|
||||||
|
}
|
||||||
|
|
||||||
void setLinearMagnify(bool setting) { mTextureData->setLinearMagnify(setting); }
|
void setLinearMagnify(bool setting) { mTextureData->setLinearMagnify(setting); }
|
||||||
|
|
||||||
std::string getTextureFilePath();
|
std::string getTextureFilePath();
|
||||||
|
|
Loading…
Reference in a new issue