mirror of
https://github.com/love2d/love.git
synced 2026-08-19 04:06:17 +02:00
Image settings now survive setMode, fixes bug #10
This commit is contained in:
@@ -272,7 +272,7 @@ namespace opengl
|
|||||||
|
|
||||||
void Image::unload()
|
void Image::unload()
|
||||||
{
|
{
|
||||||
unloadVolatile();
|
return unloadVolatile();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Image::loadVolatile()
|
bool Image::loadVolatile()
|
||||||
@@ -295,11 +295,16 @@ namespace opengl
|
|||||||
GL_UNSIGNED_BYTE,
|
GL_UNSIGNED_BYTE,
|
||||||
data->getData());
|
data->getData());
|
||||||
|
|
||||||
|
setFilter(settings.filter);
|
||||||
|
setWrap(settings.wrap);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Image::unloadVolatile()
|
void Image::unloadVolatile()
|
||||||
{
|
{
|
||||||
|
settings.filter = getFilter();
|
||||||
|
settings.wrap = getWrap();
|
||||||
// Delete the hardware texture.
|
// Delete the hardware texture.
|
||||||
if(texture != 0)
|
if(texture != 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -62,6 +62,13 @@ namespace opengl
|
|||||||
// The source vertices of the image.
|
// The source vertices of the image.
|
||||||
vertex vertices[4];
|
vertex vertices[4];
|
||||||
|
|
||||||
|
// The settings we need to save when reloading.
|
||||||
|
struct
|
||||||
|
{
|
||||||
|
Image::Filter filter;
|
||||||
|
Image::Wrap wrap;
|
||||||
|
} settings;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user