es-core/src/resources/TextureResource.cpp
// For scalable source images in textures we want to set the resolution to rasterize at
For scalable source images in textures we want to set the resolution to rasterize at
For scalable source images in textures we want to set the resolution to rasterize at
void TextureResource::rasterizeAt(size_t width, size_t height)
{
	if (width < 0) width = -width;
	if (height < 0) height = -height;
	std::shared_ptr<TextureData> data;
	if (mTextureData != nullptr)
		data = mTextureData;
	else
		data = sTextureDataManager.get(this);
	mSourceSize = Vector2f((float)width, (float)height);
	data->setSourceSize((float)width, (float)height);
	if (mForceLoad || (mTextureData != nullptr))
		if (!data->isLoaded())
			data->load();
}
void TextureResource :: rasterizeAt ( size_t width , size_t height ) { if ( width < 0 ) width = - width ; if ( height < 0 ) height = - height ; std :: shared_ptr < TextureData > data ; if ( mTextureData != nullptr ) data = mTextureData ; else data = sTextureDataManager . get ( this ) ; mSourceSize = Vector2f ( ( float ) width , ( float ) height ) ; data -> setSourceSize ( ( float ) width , ( float ) height ) ; if ( mForceLoad || ( mTextureData != nullptr ) ) if ( ! data -> isLoaded ( ) ) data -> load ( ) ; }
For scalable source images in textures we want to set the resolution to rasterize at
For scalable source images in textures we want to set the resolution to rasterize at
// Avoids crashing if a theme (in grids) defines negative sizes