|
|
|
@ -324,10 +324,54 @@ public class Image extends NativeObject implements Savable /*, Cloneable*/ { |
|
|
|
|
protected transient Object efficientData; |
|
|
|
|
protected int multiSamples = 1; |
|
|
|
|
// protected int mipOffset = 0;
|
|
|
|
|
|
|
|
|
|
// attributes relating to GL object
|
|
|
|
|
protected boolean mipsWereGenerated = false; |
|
|
|
|
protected boolean needGeneratedMips = false; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Internal use only. |
|
|
|
|
* The renderer marks which images have generated mipmaps in VRAM |
|
|
|
|
* and which do not, so it can generate them as needed. |
|
|
|
|
* |
|
|
|
|
* @param generated If mipmaps were generated or not. |
|
|
|
|
*/ |
|
|
|
|
public void setMipmapsGenerated(boolean generated) { |
|
|
|
|
this.mipsWereGenerated = generated; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Internal use only. |
|
|
|
|
* Check if the renderer has generated mipmaps for this image in VRAM |
|
|
|
|
* or not. |
|
|
|
|
* |
|
|
|
|
* @return If mipmaps were generated already. |
|
|
|
|
*/ |
|
|
|
|
public boolean isMipmapsGenerated() { |
|
|
|
|
return mipsWereGenerated; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* (Package private) Called by {@link Texture} when |
|
|
|
|
* {@link #isMipmapsGenerated() } is false in order to generate |
|
|
|
|
* mipmaps for this image. |
|
|
|
|
*/ |
|
|
|
|
void setNeedGeneratedMipmaps() { |
|
|
|
|
needGeneratedMips = true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @return True if the image needs to have mipmaps generated |
|
|
|
|
* for it (as requested by the texture). |
|
|
|
|
*/ |
|
|
|
|
public boolean isGeneratedMipmapsRequired() { |
|
|
|
|
return needGeneratedMips; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public void resetObject() { |
|
|
|
|
this.id = -1; |
|
|
|
|
this.mipsWereGenerated = false; |
|
|
|
|
setUpdateNeeded(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|