Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ java {

tasks.withType(JavaCompile) { // compile-time options:
//options.compilerArgs << '-Xlint:deprecation' // to show deprecation warnings
options.compilerArgs << '-Xlint:unchecked'
options.compilerArgs.addAll(['-Xlint:unchecked', '-Xlint:-options', '-Werror'])
options.encoding = 'UTF-8'
options.release = 8
}
Expand Down Expand Up @@ -101,26 +101,26 @@ task javadocJar(type: Jar, dependsOn: javadoc, description: 'Creates a jar from
}

ext.pomConfig = {
name POM_NAME
description POM_DESCRIPTION
url POM_URL
inceptionYear POM_INCEPTION_YEAR
name = POM_NAME
description = POM_DESCRIPTION
url = POM_URL
inceptionYear = POM_INCEPTION_YEAR
scm {
url POM_SCM_URL
connection POM_SCM_CONNECTION
developerConnection POM_SCM_DEVELOPER_CONNECTION
url = POM_SCM_URL
connection = POM_SCM_CONNECTION
developerConnection = POM_SCM_DEVELOPER_CONNECTION
}
licenses {
license {
name POM_LICENSE_NAME
url POM_LICENSE_URL
distribution POM_LICENSE_DISTRIBUTION
name = POM_LICENSE_NAME
url = POM_LICENSE_URL
distribution = POM_LICENSE_DISTRIBUTION
}
}
developers {
developer {
name 'jMonkeyEngine Team'
id 'jMonkeyEngine'
name = 'jMonkeyEngine Team'
id = 'jMonkeyEngine'
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public void writeImageFile(OutputStream outStream, String format, ByteBuffer ima


@Override
@SuppressWarnings("deprecation")
public JmeContext newContext(AppSettings settings, Type contextType) {
if (settings.getAudioRenderer() == null) {
audioRendererType = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -711,8 +711,8 @@ public void requestDialog(
public void run() {
final FrameLayout layoutTextDialogInput = new FrameLayout(view.getContext());
final EditText editTextDialogInput = new EditText(view.getContext());
editTextDialogInput.setWidth(LayoutParams.FILL_PARENT);
editTextDialogInput.setHeight(LayoutParams.FILL_PARENT);
Comment thread
8Keep marked this conversation as resolved.
editTextDialogInput.setWidth(LayoutParams.MATCH_PARENT);
editTextDialogInput.setHeight(LayoutParams.MATCH_PARENT);
editTextDialogInput.setPadding(20, 20, 20, 20);
editTextDialogInput.setGravity(Gravity.FILL_HORIZONTAL);
//editTextDialogInput.setImeOptions(EditorInfo.IME_FLAG_NO_EXTRACT_UI);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ public ParticleEmitter clone(boolean cloneMaterial) {
* The old clone() method that did not use the new Cloner utility.
*/
@Override
@Deprecated
public ParticleEmitter oldClone(boolean cloneMaterial) {
Comment thread
8Keep marked this conversation as resolved.
ParticleEmitter clone = (ParticleEmitter) super.clone(cloneMaterial);
clone.shape = shape.deepClone();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ protected void initialize(Application app) {
viewports[i] = createOffViewPort("EnvView" + i, cameras[i]);
framebuffers[i] = createOffScreenFrameBuffer(size, viewports[i]);
textures[i] = new Texture2D(size, size, colorFormat);
framebuffers[i].setColorTexture(textures[i]);
framebuffers[i].addColorTarget(FrameBuffer.FrameBufferTarget.newTarget(textures[i]));
}
}

Expand Down Expand Up @@ -416,7 +416,7 @@ protected FrameBuffer createOffScreenFrameBuffer(int mapSize, ViewPort offView)
protected FrameBuffer createOffScreenFrameBuffer(int mapSize, ViewPort offView, Image.Format depthFormat) {
// create offscreen framebuffer
final FrameBuffer offBuffer = new FrameBuffer(mapSize, mapSize, 1);
offBuffer.setDepthBuffer(depthFormat);
offBuffer.setDepthTarget(FrameBuffer.FrameBufferTarget.newTarget(depthFormat));
offView.setOutputFrameBuffer(offBuffer);
return offBuffer;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ public static void untagGlobal(Spatial s) {
}

@Override
@Deprecated
public Control cloneForSpatial(Spatial spatial) {
throw new UnsupportedOperationException();
}
Expand Down
6 changes: 3 additions & 3 deletions jme3-core/src/main/java/com/jme3/renderer/Caps.java
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ public static boolean supports(Collection<Caps> caps, FrameBuffer fb) {
return false;
}

RenderBuffer depthBuf = fb.getDepthBuffer();
RenderBuffer depthBuf = fb.getDepthTarget();
if (depthBuf != null) {
Format depthFmt = depthBuf.getFormat();
if (!depthFmt.isDepthFormat()) {
Expand All @@ -675,8 +675,8 @@ public static boolean supports(Collection<Caps> caps, FrameBuffer fb) {
}
}
}
for (int i = 0; i < fb.getNumColorBuffers(); i++) {
if (!supportsColorBuffer(caps, fb.getColorBuffer(i))) {
for (int i = 0; i < fb.getNumColorTargets(); i++) {
if (!supportsColorBuffer(caps, fb.getColorTarget(i))) {
return false;
}
}
Expand Down
15 changes: 10 additions & 5 deletions jme3-core/src/main/java/com/jme3/renderer/RenderContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,21 @@
import com.jme3.math.ColorRGBA;
import com.jme3.scene.VertexBuffer;
import com.jme3.shader.Shader;
import com.jme3.shader.bufferobject.BufferObject;
import com.jme3.texture.FrameBuffer;
import com.jme3.texture.Image;
import java.lang.ref.WeakReference;
import com.jme3.shader.bufferobject.BufferObject;

/**
* Represents the current state of the graphics library. This class is used
* internally to reduce state changes. NOTE: This class is specific to OpenGL.
*/
public class RenderContext {
@SuppressWarnings("unchecked")
private static <T> WeakReference<T>[] newWeakReferenceArray(int size) {
return (WeakReference<T>[]) new WeakReference<?>[size];
}
Comment thread
8Keep marked this conversation as resolved.

/**
* Number of texture units that JME supports.
*/
Expand Down Expand Up @@ -264,8 +269,8 @@ public class RenderContext {
*
* @see Renderer#setTexture(int, com.jme3.texture.Texture)
*/
public final WeakReference<Image> boundTextures[]
= new WeakReference[maxTextureUnits];
public final WeakReference<Image>[] boundTextures
= newWeakReferenceArray(maxTextureUnits);


/**
Expand All @@ -274,7 +279,7 @@ public class RenderContext {
* @see Renderer#setUniformBufferObject(int, com.jme3.shader.BufferObject)
* @see Renderer#setShaderStorageBufferObject(int, com.jme3.shader.BufferObject)
*/
public final WeakReference<BufferObject>[] boundBO = new WeakReference[maxBufferObjectUnits];
public final WeakReference<BufferObject>[] boundBO = newWeakReferenceArray(maxBufferObjectUnits);

/**
* IDList for texture units.
Expand Down Expand Up @@ -331,7 +336,7 @@ public class RenderContext {
* Vertex attribs currently bound and enabled. If a slot is null, then
* it is disabled.
*/
public final WeakReference<VertexBuffer>[] boundAttribs = new WeakReference[16];
public final WeakReference<VertexBuffer>[] boundAttribs = newWeakReferenceArray(16);

/**
* IDList for vertex attributes.
Expand Down
55 changes: 29 additions & 26 deletions jme3-core/src/main/java/com/jme3/renderer/RenderManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,9 @@
*/
package com.jme3.renderer;

import com.jme3.renderer.pipeline.ForwardPipeline;
import com.jme3.renderer.pipeline.DefaultPipelineContext;
import com.jme3.renderer.pipeline.RenderPipeline;
import com.jme3.renderer.pipeline.PipelineContext;
import com.jme3.light.DefaultLightFilter;
import com.jme3.light.LightFilter;
import com.jme3.light.LightList;
import com.jme3.light.DefaultLightFilter;
import com.jme3.light.LightFilter;
import com.jme3.light.LightList;
import com.jme3.material.MatParamOverride;
import com.jme3.material.Material;
import com.jme3.material.MaterialDef;
Expand All @@ -46,11 +42,15 @@
import com.jme3.material.TechniqueDef;
import com.jme3.math.FastMath;
import com.jme3.math.Matrix4f;
import com.jme3.post.SceneProcessor;
import com.jme3.profile.AppProfiler;
import com.jme3.profile.AppStep;
import com.jme3.profile.VpStep;
import com.jme3.renderer.queue.GeometryList;
import com.jme3.post.SceneProcessor;
import com.jme3.profile.AppProfiler;
import com.jme3.profile.AppStep;
import com.jme3.profile.VpStep;
import com.jme3.renderer.pipeline.DefaultPipelineContext;
import com.jme3.renderer.pipeline.ForwardPipeline;
import com.jme3.renderer.pipeline.PipelineContext;
import com.jme3.renderer.pipeline.RenderPipeline;
import com.jme3.renderer.queue.GeometryList;
import com.jme3.renderer.queue.RenderQueue;
import com.jme3.renderer.queue.RenderQueue.Bucket;
import com.jme3.renderer.queue.RenderQueue.ShadowMode;
Expand Down Expand Up @@ -111,7 +111,7 @@ public class RenderManager {
private final HashMap<Class<? extends PipelineContext>, PipelineContext> contexts = new HashMap<>();
private final LinkedList<PipelineContext> usedContexts = new LinkedList<>();
private final LinkedList<RenderPipeline<? extends PipelineContext>> usedPipelines = new LinkedList<>();
private RenderPipeline<? extends PipelineContext> defaultPipeline = new ForwardPipeline();
private RenderPipeline<? extends PipelineContext> defaultPipeline = new ForwardPipeline();
private Camera prevCam = null;
private Material forcedMaterial = null;
private String forcedTechnique = null;
Expand Down Expand Up @@ -1382,19 +1382,22 @@ public void applyViewPort(ViewPort vp) {
* @param vp View port to render
* @param tpf Time per frame value
*/
public void renderViewPort(ViewPort vp, float tpf) {
if (!vp.isEnabled()) {
return;
}
RenderPipeline pipeline = vp.getPipeline();
if (pipeline == null) {
pipeline = defaultPipeline;
}

PipelineContext context = pipeline.fetchPipelineContext(this);
if (context == null) {
throw new NullPointerException("Failed to fetch pipeline context.");
}
public void renderViewPort(ViewPort vp, float tpf) {
if (!vp.isEnabled()) {
return;
}
RenderPipeline<? extends PipelineContext> pipeline = vp.getPipeline();
if (pipeline == null) {
pipeline = defaultPipeline;
}
renderViewPort(vp, tpf, pipeline);
}

private <T extends PipelineContext> void renderViewPort(ViewPort vp, float tpf, RenderPipeline<T> pipeline) {
T context = pipeline.fetchPipelineContext(this);
if (context == null) {
throw new NullPointerException("Failed to fetch pipeline context.");
}
if (!context.startViewPortRender(this, vp)) {
usedContexts.add(context);
}
Expand Down
9 changes: 5 additions & 4 deletions jme3-core/src/main/java/com/jme3/renderer/ViewPort.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,10 @@
*/
package com.jme3.renderer;

import com.jme3.renderer.pipeline.RenderPipeline;
import com.jme3.math.ColorRGBA;
import com.jme3.post.SceneProcessor;
import com.jme3.renderer.pipeline.PipelineContext;
import com.jme3.renderer.pipeline.RenderPipeline;
import com.jme3.renderer.queue.RenderQueue;
import com.jme3.scene.Geometry;
import com.jme3.scene.Spatial;
Expand Down Expand Up @@ -88,7 +89,7 @@ public class ViewPort {
/**
* Dedicated pipeline.
*/
protected RenderPipeline pipeline;
protected RenderPipeline<? extends PipelineContext> pipeline;
/**
* FrameBuffer for output.
*/
Expand Down Expand Up @@ -440,7 +441,7 @@ public boolean isEnabled() {
*
* @param pipeline pipeline, or null to use render manager's pipeline
*/
public void setPipeline(RenderPipeline pipeline) {
public void setPipeline(RenderPipeline<? extends PipelineContext> pipeline) {
this.pipeline = pipeline;
}

Expand All @@ -449,7 +450,7 @@ public void setPipeline(RenderPipeline pipeline) {
*
* @return
*/
public RenderPipeline getPipeline() {
public RenderPipeline<? extends PipelineContext> getPipeline() {
return pipeline;
}

Expand Down
Loading
Loading