Repository navigation
Deprecate CursorLoader and delete it from Desktop.cfg file #2742
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
9dfb1a3
e78b01e
7b0ff9d
dd3335c
ba7e586
85de977
23ab1e7
b9e60e1
ba390ac
40ffe74
ee832ce
db22e58
14c41e7
596ea87
e002d5d
f8688be
0708ab1
be9f260
71fe4dd
b0543e1
b74a950
1aebf7b
c75f6da
82ad7d9
111851a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -79,16 +79,16 @@ public enum Format { | |||||||||
| Reserved2(0), | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * half-precision floating-point grayscale/luminance. | ||||||||||
| * | ||||||||||
| * Requires {@link Caps#HalfFloatTexture}. | ||||||||||
| * half-precision floating-point grayscale/luminance. | ||||||||||
| * | ||||||||||
| * Requires {@link Caps#HalfFloatTexture}. | ||||||||||
| */ | ||||||||||
| Luminance16F(16,true), | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * single-precision floating-point grayscale/luminance. | ||||||||||
| * | ||||||||||
| * Requires {@link Caps#FloatTexture}. | ||||||||||
| * Requires {@link Caps#FloatTexture}. | ||||||||||
| */ | ||||||||||
| Luminance32F(32,true), | ||||||||||
|
|
||||||||||
|
|
@@ -101,9 +101,9 @@ public enum Format { | |||||||||
| Reserved3(0), | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * half-precision floating-point grayscale/luminance and alpha. | ||||||||||
| * | ||||||||||
| * Requires {@link Caps#HalfFloatTexture}. | ||||||||||
| * half-precision floating-point grayscale/luminance and alpha. | ||||||||||
| * | ||||||||||
| * Requires {@link Caps#HalfFloatTexture}. | ||||||||||
| */ | ||||||||||
| Luminance16FAlpha16F(32,true), | ||||||||||
|
|
||||||||||
|
|
@@ -255,7 +255,7 @@ public enum Format { | |||||||||
| * but will be converted to {@link Format#RGB111110F} when sent | ||||||||||
| * to the video hardware. | ||||||||||
| * | ||||||||||
| * Requires {@link Caps#HalfFloatTexture} and {@link Caps#PackedFloatTexture}. | ||||||||||
| * Requires {@link Caps#HalfFloatTexture} and {@link Caps#PackedFloatTexture}. | ||||||||||
| */ | ||||||||||
| RGB16F_to_RGB111110F(48,true), | ||||||||||
|
|
||||||||||
|
|
@@ -271,7 +271,7 @@ public enum Format { | |||||||||
| * but will be converted to {@link Format#RGB9E5} when sent | ||||||||||
| * to the video hardware. | ||||||||||
| * | ||||||||||
| * Requires {@link Caps#HalfFloatTexture} and {@link Caps#SharedExponentTexture}. | ||||||||||
| * Requires {@link Caps#HalfFloatTexture} and {@link Caps#SharedExponentTexture}. | ||||||||||
| */ | ||||||||||
| RGB16F_to_RGB9E5(48,true), | ||||||||||
|
|
||||||||||
|
|
@@ -283,32 +283,32 @@ public enum Format { | |||||||||
| RGB9E5(32,true), | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * half-precision floating point red, green, and blue. | ||||||||||
| * | ||||||||||
| * Requires {@link Caps#HalfFloatTexture}. | ||||||||||
| * half-precision floating point red, green, and blue. | ||||||||||
| * | ||||||||||
| * Requires {@link Caps#HalfFloatTexture}. | ||||||||||
| * May be supported for renderbuffers, but the OpenGL specification does not require it. | ||||||||||
| */ | ||||||||||
| RGB16F(48,true), | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * half-precision floating point red, green, blue, and alpha. | ||||||||||
| * | ||||||||||
| * Requires {@link Caps#HalfFloatTexture}. | ||||||||||
| * Requires {@link Caps#HalfFloatTexture}. | ||||||||||
| */ | ||||||||||
| RGBA16F(64,true), | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * single-precision floating point red, green, and blue. | ||||||||||
| * | ||||||||||
| * Requires {@link Caps#FloatTexture}. | ||||||||||
| * single-precision floating point red, green, and blue. | ||||||||||
| * | ||||||||||
| * Requires {@link Caps#FloatTexture}. | ||||||||||
| * May be supported for renderbuffers, but the OpenGL specification does not require it. | ||||||||||
| */ | ||||||||||
| RGB32F(96,true), | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * single-precision floating point red, green, blue and alpha. | ||||||||||
| * | ||||||||||
| * Requires {@link Caps#FloatTexture}. | ||||||||||
| * single-precision floating point red, green, blue and alpha. | ||||||||||
| * | ||||||||||
| * Requires {@link Caps#FloatTexture}. | ||||||||||
| */ | ||||||||||
| RGBA32F(128,true), | ||||||||||
|
|
||||||||||
|
|
@@ -507,21 +507,21 @@ public enum Format { | |||||||||
| /** | ||||||||||
| * half-precision floating point red. | ||||||||||
| * | ||||||||||
| * Requires {@link Caps#HalfFloatTexture}. | ||||||||||
| * Requires {@link Caps#HalfFloatTexture}. | ||||||||||
| */ | ||||||||||
| R16F(16,true), | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * single-precision floating point red. | ||||||||||
| * | ||||||||||
| * Requires {@link Caps#FloatTexture}. | ||||||||||
| * single-precision floating point red. | ||||||||||
| * | ||||||||||
| * Requires {@link Caps#FloatTexture}. | ||||||||||
| */ | ||||||||||
| R32F(32,true), | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * half-precision floating point red and green. | ||||||||||
| * | ||||||||||
| * Requires {@link Caps#HalfFloatTexture}. | ||||||||||
| * Requires {@link Caps#HalfFloatTexture}. | ||||||||||
| */ | ||||||||||
| RG16F(32,true), | ||||||||||
|
|
||||||||||
|
|
@@ -719,7 +719,8 @@ public long getUniqueId() { | |||||||||
| } | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * @return A shallow clone of this image. The data is not cloned. | ||||||||||
| * @return a shallow clone of this image. The data is not cloned. | ||||||||||
| * @see #deepClone() Deep clone. | ||||||||||
| */ | ||||||||||
| @Override | ||||||||||
| public Image clone(){ | ||||||||||
|
|
@@ -731,6 +732,27 @@ public Image clone(){ | |||||||||
| return clone; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| /** | ||||||||||
| * @return a deep clone of this image. The data is cloned. | ||||||||||
| * @see #clone() Shallow clone. | ||||||||||
| */ | ||||||||||
| public Image deepClone() { | ||||||||||
| Image clone = (Image) super.clone(); | ||||||||||
| clone.mipMapSizes = mipMapSizes != null ? mipMapSizes.clone() : null; | ||||||||||
| clone.data = data != null ? dataDeepClone() : null; | ||||||||||
| clone.lastTextureState = new LastTextureState(); | ||||||||||
| clone.setUpdateNeeded(); | ||||||||||
| return clone; | ||||||||||
| } | ||||||||||
|
|
||||||||||
| private ArrayList<ByteBuffer> dataDeepClone() { | ||||||||||
| ArrayList<ByteBuffer> clone = new ArrayList<ByteBuffer>(data.size()); | ||||||||||
| for (ByteBuffer originalBuffer : data) { | ||||||||||
| clone.add(BufferUtils.clone(originalBuffer)); | ||||||||||
| } | ||||||||||
| return clone; | ||||||||||
| } | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is also a problem with the cloned buffer's state:
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Correction: I’m not confident in my previous note about the cloned buffer’s position without verifying the exact |
||||||||||
|
|
||||||||||
| /** | ||||||||||
| * Constructor instantiates a new <code>Image</code> object. All values | ||||||||||
| * are undefined. | ||||||||||
|
|
||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| INCLUDE com/jme3/asset/General.cfg | ||
|
|
||
| # Desktop-specific loaders | ||
|
mondogo24 marked this conversation as resolved.
Resolved
|
||
| LOADER com.jme3.cursors.plugins.CursorLoader : ani, cur, ico | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This deep-copy path uses
BufferUtils.clone(ByteBuffer), which callsrewind()on the supplied buffer and advances it to its limit while copying. BecauseoriginalBufferbelongs to the sourceImage, callingdeepClone()therefore changes the source image's buffer position as a side effect (including the cached asset images used by the converter). Please clone a duplicate so the source buffer's position and limit remain untouched.