Fix coolGi's java-8 port
This commit is contained in:
@@ -7,22 +7,18 @@ public enum RendererType {
|
||||
;
|
||||
|
||||
public static RendererType next(RendererType type) {
|
||||
RendererType rendererType;
|
||||
switch (type) {
|
||||
case DEFAULT: rendererType = DEBUG;
|
||||
case DEBUG: rendererType = DISABLED;
|
||||
default: rendererType = DEFAULT;
|
||||
};
|
||||
return rendererType;
|
||||
case DEFAULT: return DEBUG;
|
||||
case DEBUG: return DISABLED;
|
||||
default: return DEFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
public static RendererType previous(RendererType type) {
|
||||
RendererType rendererType;
|
||||
switch (type) {
|
||||
case DEFAULT: rendererType = DISABLED;
|
||||
case DEBUG: rendererType = DEFAULT;
|
||||
default: rendererType = DEBUG;
|
||||
};
|
||||
return rendererType;
|
||||
case DEFAULT: return DISABLED;
|
||||
case DEBUG: return DEFAULT;
|
||||
default: return DEBUG;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,18 +118,18 @@ public class LodFogConfig
|
||||
str.append("// =======RUNTIME GENERATED DEFINE SECTION========\n#version 150 core\n");
|
||||
|
||||
if (farFogSetting == null) {
|
||||
str.append(""+
|
||||
"#define farFogStart 0.0"+
|
||||
"#define farFogLength 0.0"+
|
||||
"#define farFogMin 0.0"+
|
||||
"#define farFogRange 0.0"+
|
||||
"#define farFogDensity 0.0"+
|
||||
"#define heightFogStart 0.0"+
|
||||
"#define heightFogLength 0.0"+
|
||||
"#define heightFogMin 0.0"+
|
||||
"#define heightFogRange 0.0"+
|
||||
"#define heightFogDensity 0.0"+
|
||||
"");
|
||||
str.append("\n"+
|
||||
"#define farFogStart 0.0\n"+
|
||||
"#define farFogLength 0.0\n"+
|
||||
"#define farFogMin 0.0\n"+
|
||||
"#define farFogRange 0.0\n"+
|
||||
"#define farFogDensity 0.0\n"+
|
||||
"#define heightFogStart 0.0\n"+
|
||||
"#define heightFogLength 0.0\n"+
|
||||
"#define heightFogMin 0.0\n"+
|
||||
"#define heightFogRange 0.0\n"+
|
||||
"#define heightFogDensity 0.0\n"+
|
||||
"\n");
|
||||
} else {
|
||||
str.append("\n#define farFogStart ");
|
||||
str.append(farFogSetting.start);
|
||||
@@ -144,13 +144,13 @@ public class LodFogConfig
|
||||
str.append("\n");
|
||||
|
||||
if (heightFogSetting == null) {
|
||||
str.append(""+
|
||||
"#define heightFogStart 0.0"+
|
||||
"#define heightFogLength 0.0"+
|
||||
"#define heightFogMin 0.0"+
|
||||
"#define heightFogRange 0.0"+
|
||||
"#define heightFogDensity 0.0"+
|
||||
"");
|
||||
str.append("\n"+
|
||||
"#define heightFogStart 0.0\n"+
|
||||
"#define heightFogLength 0.0\n"+
|
||||
"#define heightFogMin 0.0\n"+
|
||||
"#define heightFogRange 0.0\n"+
|
||||
"#define heightFogDensity 0.0\n"+
|
||||
"\n");
|
||||
} else {
|
||||
str.append("\n#define heightFogStart ");
|
||||
str.append(heightFogSetting.start);
|
||||
@@ -239,43 +239,43 @@ public class LodFogConfig
|
||||
// Generate method: float getNearFogThickness(float dist);
|
||||
if (drawNearFog) {
|
||||
str.append(""+
|
||||
"float getNearFogThickness(float dist) {"+
|
||||
" return linearFog(dist, nearFogStart, nearFogLength, 1.0, -1.0);"+
|
||||
"}"+
|
||||
"");
|
||||
"float getNearFogThickness(float dist) {\n"+
|
||||
" return linearFog(dist, nearFogStart, nearFogLength, 1.0, -1.0);\n"+
|
||||
"}\n"+
|
||||
"\n");
|
||||
} else {
|
||||
str.append(""+
|
||||
"float getNearFogThickness(float dist) {return 0.0;}"+
|
||||
"");
|
||||
str.append("\n"+
|
||||
"float getNearFogThickness(float dist) {return 0.0;}\n"+
|
||||
"\n");
|
||||
}
|
||||
|
||||
if (farFogSetting == null) {
|
||||
str.append(""+
|
||||
"float getFarFogThickness(float dist) { return 0.0; }"+
|
||||
"float getHeightFogThickness(float dist) { return 0.0; }"+
|
||||
"float calculateFarFogDepth(float horizontal, float dist) { return 0.0; }"+
|
||||
"float calculateHeightFogDepth(float vertical, float realY) { return 0.0; }"+
|
||||
"float mixFogThickness(float near, float far, float height) { return near; }"+
|
||||
"");
|
||||
str.append("\n"+
|
||||
"float getFarFogThickness(float dist) { return 0.0; }\n"+
|
||||
"float getHeightFogThickness(float dist) { return 0.0; }\n"+
|
||||
"float calculateFarFogDepth(float horizontal, float dist) { return 0.0; }\n"+
|
||||
"float calculateHeightFogDepth(float vertical, float realY) { return 0.0; }\n"+
|
||||
"float mixFogThickness(float near, float far, float height) { return near; }\n"+
|
||||
"\n");
|
||||
} else {
|
||||
// Generate method: float getFarFogThickness(float dist);
|
||||
str.append("float getFarFogThickness(float dist) {\n");
|
||||
str.append(getFarFogMethod(farFogSetting.fogType));
|
||||
str.append("}\n");
|
||||
str.append("\n}\n");
|
||||
|
||||
// Generate method: float getHeightFogThickness(float dist);
|
||||
if (heightFogSetting == null) {
|
||||
str.append(""+
|
||||
"float getHeightFogThickness(float dist) { return 0.0; }"+
|
||||
"float calculateHeightFogDepth(float vertical, float realY) { return 0.0; }"+
|
||||
"");
|
||||
str.append("\n"+
|
||||
"float getHeightFogThickness(float dist) { return 0.0; }\n"+
|
||||
"float calculateHeightFogDepth(float vertical, float realY) { return 0.0; }\n"+
|
||||
"\n");
|
||||
} else {
|
||||
str.append("float getHeightFogThickness(float dist) {\n");
|
||||
str.append(getHeightFogMethod(heightFogSetting.fogType));
|
||||
str.append("}\n");
|
||||
str.append("\n}\n");
|
||||
str.append("float calculateHeightFogDepth(float vertical, float realY) {\n");
|
||||
str.append(getHeightDepthMethod(heightFogMode, heightFogHeight));
|
||||
str.append("}\n");
|
||||
str.append("\n}\n");
|
||||
}
|
||||
|
||||
// Generate method: calculateFarFogDepth(float horizontal, float vertical, float dist);
|
||||
|
||||
@@ -157,16 +157,14 @@ public class ColorUtil
|
||||
float q = v * ( 1f - s * f );
|
||||
float t = v * ( 1f - s * ( 1f - f ) );
|
||||
|
||||
int color;
|
||||
switch (i) {
|
||||
case 0: color = ColorUtil.rgbToInt(a, v, t, p);
|
||||
case 1: color = ColorUtil.rgbToInt(a, q, v, p);
|
||||
case 2: color = ColorUtil.rgbToInt(a, p, v, t);
|
||||
case 3: color = ColorUtil.rgbToInt(a, p, q, v);
|
||||
case 4: color = ColorUtil.rgbToInt(a, t, p, v);
|
||||
default: color = ColorUtil.rgbToInt(a, v, p, q); // case 5
|
||||
};
|
||||
return color;
|
||||
case 0: return ColorUtil.rgbToInt(a, v, t, p);
|
||||
case 1: return ColorUtil.rgbToInt(a, q, v, p);
|
||||
case 2: return ColorUtil.rgbToInt(a, p, v, t);
|
||||
case 3: return ColorUtil.rgbToInt(a, p, q, v);
|
||||
case 4: return ColorUtil.rgbToInt(a, t, p, v);
|
||||
default: return ColorUtil.rgbToInt(a, v, p, q); // case 5
|
||||
}
|
||||
}
|
||||
|
||||
public static String toString(int color)
|
||||
|
||||
+4
@@ -132,15 +132,19 @@ public interface IMinecraftRenderWrapper extends IBindable
|
||||
}
|
||||
|
||||
/** @returns null if there was a issue getting the lightmap */
|
||||
@Deprecated
|
||||
int[] getLightmapPixels();
|
||||
|
||||
ILightMapWrapper getLightmapWrapper();
|
||||
|
||||
/** @returns -1 if there was an issue getting the lightmap */
|
||||
@Deprecated
|
||||
int getLightmapTextureHeight();
|
||||
/** @returns -1 if there was an issue getting the lightmap */
|
||||
@Deprecated
|
||||
int getLightmapTextureWidth();
|
||||
/** @returns -1 if there was an issue getting the lightmap */
|
||||
@Deprecated
|
||||
int getLightmapGLFormat();
|
||||
|
||||
// Try and disable vanilla fog. Return true if successful, or false if not able to.
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.seibel.lod.core.handlers.dependencyInjection.IBindable;
|
||||
*/
|
||||
public interface ILightMapWrapper extends IBindable
|
||||
{
|
||||
@Deprecated
|
||||
int getLightValue(int skyLight, int blockLight);
|
||||
|
||||
// Returns the binded texture position
|
||||
|
||||
Reference in New Issue
Block a user