mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2024-11-22 14:15: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,7 +200,9 @@ void TextureResource::rasterizeAt(float width, float height)
|
|||
data = mTextureData;
|
||||
else
|
||||
data = sTextureDataManager.get(this);
|
||||
mSourceSize = glm::vec2 {static_cast<float>(width), static_cast<float>(height)};
|
||||
|
||||
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)
|
||||
data->load();
|
||||
|
|
|
@ -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