|
1 | 1 | /* |
2 | | - * Copyright (c) 2009-2024 jMonkeyEngine |
| 2 | + * Copyright (c) 2009-2025 jMonkeyEngine |
3 | 3 | * All rights reserved. |
4 | 4 | * |
5 | 5 | * Redistribution and use in source and binary forms, with or without |
|
38 | 38 | import com.jme3.texture.FrameBuffer; |
39 | 39 | import com.jme3.texture.Image; |
40 | 40 | import java.lang.ref.WeakReference; |
| 41 | +import java.util.Arrays; |
| 42 | + |
41 | 43 | import com.jme3.shader.bufferobject.BufferObject; |
42 | 44 |
|
43 | 45 | /** |
@@ -222,7 +224,6 @@ public class RenderContext { |
222 | 224 | */ |
223 | 225 | public int boundRB; |
224 | 226 |
|
225 | | - |
226 | 227 | /** |
227 | 228 | * Currently bound element array vertex buffer. |
228 | 229 | * |
@@ -259,15 +260,13 @@ public class RenderContext { |
259 | 260 | * |
260 | 261 | * @see Renderer#setTexture(int, com.jme3.texture.Texture) |
261 | 262 | */ |
262 | | - public final WeakReference<Image> boundTextures[] |
263 | | - = new WeakReference[maxTextureUnits]; |
264 | | - |
| 263 | + public final WeakReference<Image>[] boundTextures = new WeakReference[maxTextureUnits]; |
265 | 264 |
|
266 | 265 | /** |
267 | 266 | * Current bound buffer object IDs for each buffer object unit. |
268 | 267 | * |
269 | | - * @see Renderer#setUniformBufferObject(int, com.jme3.shader.BufferObject) |
270 | | - * @see Renderer#setShaderStorageBufferObject(int, com.jme3.shader.BufferObject) |
| 268 | + * @see Renderer#setUniformBufferObject(int, com.jme3.shader.bufferobject.BufferObject) |
| 269 | + * @see Renderer#setShaderStorageBufferObject(int, com.jme3.shader.bufferobject.BufferObject) |
271 | 270 | */ |
272 | 271 | public final WeakReference<BufferObject>[] boundBO = new WeakReference[maxBufferObjectUnits]; |
273 | 272 |
|
@@ -364,9 +363,7 @@ public RenderContext() { |
364 | 363 | init(); |
365 | 364 | } |
366 | 365 |
|
367 | | - |
368 | 366 | private void init() { |
369 | | - cullMode = RenderState.FaceCullMode.Off; |
370 | 367 | depthTestEnabled = false; |
371 | 368 | depthWriteEnabled = true; |
372 | 369 | colorWriteEnabled = true; |
@@ -421,16 +418,10 @@ private void init() { |
421 | 418 | public void reset() { |
422 | 419 | init(); |
423 | 420 |
|
424 | | - for (int i = 0; i < boundTextures.length; i++) { |
425 | | - boundTextures[i] = null; |
426 | | - } |
427 | | - |
| 421 | + Arrays.fill(boundTextures, null); |
428 | 422 | textureIndexList.reset(); |
429 | 423 |
|
430 | | - for (int i = 0; i < boundAttribs.length; i++) { |
431 | | - boundAttribs[i] = null; |
432 | | - } |
433 | | - |
| 424 | + Arrays.fill(boundAttribs, null); |
434 | 425 | attribIndexList.reset(); |
435 | 426 | } |
436 | 427 | } |
0 commit comments