mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-25 23:55:38 +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; }
|
||||
|
||||
// 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::string getTextureFilePath() { return mPath; }
|
||||
bool tiled() { return mTile; }
|
||||
|
|
|
@ -200,6 +200,8 @@ void TextureResource::rasterizeAt(float width, float height)
|
|||
data = mTextureData;
|
||||
else
|
||||
data = sTextureDataManager.get(this);
|
||||
|
||||
if (mTextureData && mTextureData.get()->getScalable())
|
||||
mSourceSize = glm::vec2 {static_cast<float>(width), static_cast<float>(height)};
|
||||
data->setSourceSize(static_cast<float>(width), static_cast<float>(height));
|
||||
if (mForceLoad || mTextureData != nullptr)
|
||||
|
|
|
@ -41,11 +41,16 @@ public:
|
|||
std::vector<unsigned char> getRawRGBAData();
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
const bool getScalable() const
|
||||
{
|
||||
return (mTextureData != nullptr ? mTextureData->getScalable() : false);
|
||||
}
|
||||
|
||||
void setLinearMagnify(bool setting) { mTextureData->setLinearMagnify(setting); }
|
||||
|
||||
std::string getTextureFilePath();
|
||||
|
|
Loading…
Reference in a new issue