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