This commit is contained in:
eaglercraft 2025-02-22 21:03:21 -08:00
parent 14cf205516
commit 6276a0e37c
810 changed files with 11603 additions and 10195 deletions

View File

@ -1,306 +0,0 @@
# Eaglercraft Code Standards
**These are some basic rules to follow if you would like to write code that is consistent with the Eaglercraft 1.8 codebase. If you are already familiar with Eaglercraft 1.5 or b1.3, please abandon whatever you think is the best practice as a result of reading that code, those clients should be considered as obsolete prototypes.**
## Part A. Coding Style
### 1. Tabs, not spaces
Tabs not spaces, it makes indentation easier to manage and reduces file size. Other popular projects that are also known to use tabs instead of spaces include the linux kernel. We prefer to set tab width to 4 spaces on our editors.
Format code like the eclipse formatter on factory settings
### 2. Avoid redundant hash map lookups
Don't retrieve the same value from a hash map more than once, that includes checking if an entry exists first before retrieving its value. If you do this, you are a horrible person!
**Incorrect:**
```java
if(hashMap.containsKey("eagler")) {
Object val = hashMap.get("eagler");
// do something with val
}
```
**Correct:**
```java
Object val = hashMap.get("eagler");
if(val != null) {
// do something with val
}
```
### 3. Cache the return value of a function if you plan to use it multiple times
This is somewhat an extension of rule #2, don't repeatedly call the same function multiple times if there's no reason to, even if its a relatively fast function. Everything is slower and less efficient in a browser.
**Incorrect:**
```java
while(itr.hasNext()) {
if(!Minecraft.getMinecraft().getRenderManager().getEntityClassRenderObject(SomeEntity.class).shouldRender(itr.next())) {
itr.remove();
}
}
```
**Correct:**
```java
Render<SomeEntity> render = Minecraft.getMinecraft().getRenderManager().getEntityClassRenderObject(SomeEntity.class);
while(itr.hasNext()) {
if(!render.shouldRender(itr.next())) {
itr.remove();
}
}
```
### 4. Iterators aren't that great
Avoid using iterators when possible, this includes a `for(Item item : list)` type loop, since this may compile into bytecode that uses an iterator. If the list is a linked list or some other type of data structure that cant perform random access efficiently, then it is recommended to use an iterator, but if the collection is guaranteed to be something similar to an ArrayList then implement it via a traditional for loop instead.
**Recommended way to iterate an ArrayList:**
```java
for(int i = 0, l = list.size(); i < l; ++i) {
Item item = list.get(i);
// do something
}
```
### 5. Don't shit on the heap
Avoid creating temporary single-use objects in performance critical code, since the overhead of doing so is larger in a browser where theres no type safety to predefine object structures. This includes using lambdas or using most of the stuff in the google guava package. Also this is partially why I prefer not using iterators whenever possible.
**Incorrect, creates 5 temporary objects:**
```java
List<String> list1 = Arrays.asList("eagler", "eagler", "deevis");
List<String> list2 = Lists.newArrayList(
Collections2.transform(
Collections2.filter(
list1,
(e) -> !e.equals("deevis")
),
(e) -> (e + "!")
)
);
```
**Correct, creates no temporary objects:**
```java
List<String> list1 = Arrays.asList("eagler", "eagler", "deevis");
List<String> list2 = Lists.newArrayList();
for(int i = 0, l = list1.size(); i < l; ++i) {
String s = list1.get(i);
if(!s.equals("deevis")) {
list2.add(s + "!");
}
}
```
(note: we are ignoring the StringBuilder instances that the compiler generates from ` + "!"`)
### 6. Don't base game/render logic off of the system time
Use `EagRuntime.steadyTimeMillis()` instead to access a monotonic clock, as in a clock that is guaranteed to only run forwards, and is not affected by changes in the system time. `System.currentTimeMillis()` should only be used in situations where you want to know the actual wall time or are measuring elapsed time across multiple page refreshes.
### 7. Prefer multiplication over division
If you're always gonna divide a number by some constant, it is better to multiply it by one-over-the-constant instead.
**Incorrect**
```java
float b = a / 50.0f;
```
**Correct**
```java
float b = a * 0.02f;
```
### 8. Shaders should take advantage of compiler intrinsics
Although you may think these two pieces of code are identical, its more than likely that the "Correct" example will compile to a more efficient shader on almost any hardware. The functions in GLSL are not a library, they are compiler intrinsics that usually compile to inline assembly that can take advantage of different acceleration instructions in the GPU's instruction set. Vector math should be done in ways that promotes the use of SIMD instructions when the code is compiled to a shader.
**Incorrect:**
```glsl
float dx = pos1.x - pos2.x;
float dy = pos1.y - pos2.y;
float dz = pos1.z - pos2.z;
float distance = sqrt(dx * dx + dy * dy + dz * dz);
float fogDensity = pow(2.718, -density * distance);
```
**Correct:**
```glsl
float fogDensity = exp(-density * length(pos1.xyz - pos2.xyz));
```
### 9. Flatten the control flow of shaders
Modern GPUs are able to execute multiple instances of a shader on a single core, but if one of those shaders encounters a branch (if statement, or related) that causes it to begin executing different code from the other instances of the shader running on that core, that instance of the shader can no longer be executed at the same time as the other instances, and suddenly you've significantly increased the amount of time this core will now be busy executing shader instructions to account for all of the branches the different shader instances have taken.
**Incorrect:**
```glsl
float lightValue = dot(lightDirection, normal);
if(lightValue > 0.0) {
color += lightValue * lightColor * diffuseColor;
}
```
**Correct:**
```glsl
float lightValue = max(dot(lightDirection, normal), 0.0);
color += lightValue * lightColor * diffuseColor;
```
### 10. Use textureLod unless mipmapping is necessary
This will prevent the shader from wasting time trying to determine what mipmap levels to read from when the texture is sampled.
**Incorrect:**
```glsl
float depthValue = texture(depthBuffer, pos).r;
```
**Correct:**
```glsl
float depthValue = textureLod(depthBuffer, pos, 0.0).r;
```
### 11. Divide complex and branch-intensive shaders into multiple draw calls
You can use a variety of different blending modes to mathematically combine the results of shaders. This is done for the same reason as flattening the control flow, to try and keep instruction pointers in sync by periodically resetting their positions, and also to allow for the driver to multitask better on GPUs with insane numbers of cores. It also allows the shaders execution to be distributed across multiple frames in the case of something that doesnt need to update often (like clouds).
### 12. Don't abuse `@JSBody` in TeaVM code
TeaVM provides lots of ways of interacting with JavaScript, using `@JSBody` is not the only way, consider using an overlay type.
**Incorrect**
```java
@JSObject(params = { "obj" }, script = "return obj.valueA;")
public static native JSObject getValueA(JSObject obj);
@JSObject(params = { "obj" }, script = "return obj.valueB;")
public static native JSObject getValueB(JSObject obj);
@JSObject(params = { "obj" }, script = "return obj.valueC;")
public static native JSObject getValueC(JSObject obj);
@JSObject(params = { "obj" }, script = "obj.dumbFunction();")
public static native void callDumbFunction(JSObject obj);
```
**Correct**
```java
public interface MyObject extends JSObject {
@JSProperty
JSObject getValueA();
@JSProperty
JSObject getValueB();
@JSProperty
JSObject getValueC();
void dumbFunction();
}
```
### 13. Don't fall for TeaVM's threads
It is impossible to have multithreading in JavaScript, only worker objects can be used to execute code concurrently, which can't share javascript variables. Therefore, when you create a thread in TeaVM, you're creating a virtual thread that isn't capable of running at the same time as any other virtual thread in the TeaVM context. This means it's impossible to speed a TeaVM program up through the use of multiple Java threads, instead it is more than likely that it will just slow the program down more to implement multithreading through TeaVM's threads due to the additional time required for synchronization and context switches. Its more efficient to just program the entire application to be single threaded to begin with, just put everything in the main loop and realize that if it was in a different thread it would just periodically interrupt the main loop.
### 14. Always use try-with-resources
For any code that deals with streams to be considered safe, it should either use a try-with-resources or try/finally in order to release resources when complete, since otherwise the stream might not close if an IO error causes the function to return early. This is especially important for plugin code since its supposed to be able to run on a large server for weeks at a time without the underlying JVM being restarted. If hackers discover a bug in the code to cause a function to return early like this without closing a stream, they might exploit it to fatally crash the server by spamming whatever corrupt packet causes the function to leak the stream, so all code must be written so it can fail at any time without leaking resources.
**Incorrect**
```java
InputStream is = new FileInputStream(new File("phile.txt"));
is.write(someArray);
is.close();
```
**Correct**
```java
try(InputStream is = new FileInputStream(new File("phile.txt"))) {
is.write(someArray);
}
```
Notice that the `.close()` can be omitted completely when using a try-with-resources
### 15. Always close compression/decompression streams
In the desktop runtime, the default oracle JDK uses native code to implement the compression/decompression streams (InflaterInputStream, GZIPInputStream, etc) and therefore if you forget to close the compression/decompression stream it will cause a memory leak when the code isn't running in a browser. This is a common issue when using byte array input/output streams since you might believe when decompressing data from a byte array that there's no reason to close the stream when you're done since its not a file, but that will still cause a memory leak due to the decompression stream not being cleaned up.
## Part B. Project Structure
### 1. Code decompiled from Minecraft goes in `src/game/java`
Don't add any new classes to `src/game/java`, and ideally any significant additions to the game's source (functions, etc) should be done through creating new classes in `src/main/java` instead of adding it directly to the decompiled classes.
### 2. Do not put platform-dependent code in `src/main/java` or `src/game/java`
One of the objectives of Eaglercraft is to make Minecraft Java edition truly cross platform, why stop at just a desktop and JavaScript runtime? There are plans to create an Android runtime and several WebAssembly runtimes, all of which will be compatible with any pre-existing eaglercraft clients that only depend on the EaglercraftX runtime library and don't directly depend on components of TeaVM or LWJGL. Ideally, all core features of the client should be implemented in the `src/main/java` and `src/game/java` and any platform-dependent features should be stubbed out in some abstract platform-independent way in classes in the `src/teavm/java` and `src/lwjgl/java` and any other future runtime you want your client to support. Ideally, every source folder of platform-dependent code should expose an identical API for access to the platform-independent code as all the other platform-dependant code folders currently expose.
### 3. Don't mix JavaScript with Java
Dont implement features in the JavaScript runtime by requiring additional JavaScript files be included on index.html, if you must access browser APIs then use the TeaVM JSO to write your code in Java instead so its baked directly into classes.js. Certain browser APIs may be missing from the default TeaVM JSO-APIs library but it is not difficult to create the overlay types for them manually. Clients that violate this rule may also not possible to automatically import into the EaglercraftX boot menu depending on how fucked up they are. There aren't any limitations to the TeaVM JSO that give you a good enough excuse not to follow this rule.
### 4. Don't access the classes named "Platform\*" directly from your platform-independent code
Much like the Java runtime environment itself, Eaglercraft's runtime library consists of two layers, the internal classes full of platform-dependent code that expose an intermediate API not meant to be used by programmers directly, and the platform-independent API classes that provide a platform-independent wrapper for the platform dependent classes and also provide all the miscellaneous utility functions that don't require platform dependent code to be implemented. Chances are if you are directly using a function on a class that has a name that starts with "Platform\*", that there is a different class in `src/main/java` that you are meant to use in order to access that feature, that may perform additional checks or adjust the values you are passing to the function before calling the function in the Platform class.
## Part C. Compatibility Standards
### 1. Target minimum JDK version is Java 8
Its difficult to find a platform where its not possible to run Java 8 in some capacity, therefore the desktop runtime of EaglercraftX and the BungeeCord plugin should target Java 8. The Velocity plugin is an exception since Velocity itself doesn't support Java 8 either.
### 2. Target minimum supported browser is Google Chrome 38
Released on October 7, 2014, we think its a good target for the JavaScript versions of EaglercraftX. This is the last version of Chrome that supports hardware accelerated WebGL 1.0 on Windows XP. All base features of the underlying Minecraft 1.8 client must be functional, however things such as EaglercraftX's shaders or dynamic lighting are not required to work. The client cannot crash as a result of any missing features on an old browser, you must either implement fallbacks or safely disable the unsupported features.
### 3. Target minimum supported graphics API is OpenGL ES 2.0 (WebGL 1.0)
The most widely supported graphics API in the world is currently OpenGL ES 2.0, so ideally that should be the target for EaglercraftX 1.8. We can guarantee the client will be on an OpenGL ES 3.0 context 99% of the time, however its not that hard to also maintain support for GLES 2.0 (WebGL 1.0) as well with slightly reduced functionality so we might as well make it a feature in case of the 1% of the time that functionality is not available. The client cannot depend on any GL extensions in order to run in GLES 2.0 mode, however its reasonable to assume there will be VAO support via extensions in most GLES 2.0 contexts so the client includes an abstraction layer (via EaglercraftGPU.java) to seamlessly emulate VAO functionality even when the client is running in GLES 2.0 mode with no VAO extensions. The only core feature of Minecraft 1.8 that is completely unavailable in GLES 2.0 mode is mip-mapping for the blocks/items texture atlas due to being unable to limit the max mipmap level.
### 4. Use preprocessor directives to make portable shaders that can be compiled for both OpenGL ES 2.0 and 3.0 contexts
Most of the shaders in the base "glsl" directory of the resources EPK file use a file called "gles2_compat.glsl" to polyfill certain GLSL features (such as input/output declarations) via preprocessor directives to allow them to be compiled on both OpenGL ES 3.0 and 2.0 contexts. This is the preferred way to implement backwards compatibility over creating seprate versions of the same shaders, since future developers don't need to waste time maintaining multiple versions of the same code if they don't really care about backwards compatibility in the first place.
### 5. Target minimum version of the JavaScript syntax is ES5 strict mode
A shim is included to provide certain ES6 functions, however you should always program with syntax compatible with ES5, so the script doesn't crash immediately due to syntax errors even if the functions that use unsupported syntax aren't actually being called. `build.gradle` currently patches out all the ES5 strict mode incompatible syntax in the output of TeaVM 0.9.2, but this will probably break if you try to update TeaVM. Don't worry though because future WASM versions of EaglercraftX will use the latest versions of TeaVM. **Some common incompatible syntax to avoid includes `const`, `let`, `async`, `( ) => `, and using named functions! You can't do any of these things in your JSBody annotations.**
### 6. You cannot depend on any deprecated browser features
The same way we want EaglercraftX to work on browsers from over 10 years ago, we want it to still work in browsers 10 years from today, therefore the client cannot depend on any deprecated browser features in order for all the base Minecraft 1.8 game's features to work properly. However it is okay to use deprecated features as fallback if any modern non-deprecated feature (such as keyboard event handling) that the game needs if the game is running in an old browser.
### 7. Always use addEventListener to register event handlers
Always use addEventListener to register event handlers for browser APIs, never through the use of assigning the legacy "on\*" (onclick, onkeydown, onmessage, etc) variables, the TeaVMUtils class has a universal helper function for accessing addEventListener on any JSO objects that dont already implement the function.
### 8. JavaScript should be executed in strict mode
Always make sure your JavaScript files start with `"use strict";`, be careful when adding this to your code retroactively because it will probably break hastily written code unless you havent made a single typo thats not forbidden in strict mode. Be aware that in Chrome 38 this means you can't use stuff such as `const` and `let` or named functions in any of your JSBody annotations!

View File

@ -42,6 +42,7 @@ def folder = "javascript"
def name = "classes.js"
teavm.js {
compileJava.options.encoding = "UTF-8"
obfuscated = true
sourceMap = true
targetFileName = "../" + name

View File

@ -1 +1 @@
u49
u50

View File

@ -83,6 +83,7 @@ uniform sampler2D u_metalsLUT;
#define LIB_INCLUDE_PBR_LIGHTING_FUNCTION
#define LIB_INCLUDE_PBR_LIGHTING_PREFETCH
#EAGLER INCLUDE (3) "eagler:glsl/deferred/lib/pbr_lighting.glsl"
#EAGLER INCLUDE (4) "eagler:glsl/deferred/lib/branchless_comparison.glsl"
uniform sampler2D u_irradianceMap;
@ -139,14 +140,14 @@ void main() {
float skyLight = max(lightmapCoords2f.g * 2.0 - 1.0, 0.0);
float shadowSample = 1.0;
vec4 shadowWorldPos4f = worldPosition4f;
shadowWorldPos4f.xyz += normalVector3f * 0.05;
shadowWorldPos4f.xyz += normalVector3f * 0.1;
vec4 shadowTexPos4f;
vec2 tmpVec2;
for(;;) {
shadowTexPos4f = u_sunShadowMatrixLOD04f * shadowWorldPos4f;
if(shadowTexPos4f.xyz == clamp(shadowTexPos4f.xyz, vec3(0.005), vec3(0.995))) {
shadowSample = textureLod(u_sunShadowDepthTexture, vec3(shadowTexPos4f.xy * vec2(1.0, SUN_SHADOW_MAP_FRAC), shadowTexPos4f.z), 0.0);
shadowSample = textureLod(u_sunShadowDepthTexture, vec3(shadowTexPos4f.xy * vec2(1.0, SUN_SHADOW_MAP_FRAC), shadowTexPos4f.z + 0.0001), 0.0);
break;
}
@ -175,7 +176,7 @@ void main() {
#ifdef DO_COMPILE_SUN_SHADOWS
lightColor3f *= shadowSample * skyLight;
#endif
vec3 normalWrap3f = normalVector3f * (dot(-worldDirection4f.xyz, normalVector3f) < 0.0 ? -1.0 : 1.0);
vec3 normalWrap3f = normalVector3f * COMPARE_LT_C_C(dot(-worldDirection4f.xyz, normalVector3f), 0.0, -1.0, 1.0);
lightColor3f = eaglercraftLighting(diffuseColor4f.rgb, lightColor3f, -worldDirection4f.xyz, u_sunDirection4f.xyz, normalWrap3f, materialData3f, metalN, metalK) * u_blockSkySunDynamicLightFac4f.z;
}
@ -194,8 +195,8 @@ void main() {
vec4 sample2 = textureLod(u_irradianceMap, irradianceMapSamplePos2f.xz * vec2(0.5, -0.25) + vec2(0.5, 0.75), 0.0);
skyLight += mix(sample1.rgb, sample2.rgb, smoothstep(0.0, 1.0, irradianceMapSamplePos2f.y * -12.5 + 0.5)).rgb;
}else {
irradianceMapSamplePos2f.xz *= vec2(0.5, irradianceMapSamplePos2f.y > 0.0 ? 0.25 : -0.25);
irradianceMapSamplePos2f.xz += vec2(0.5, irradianceMapSamplePos2f.y > 0.0 ? 0.25 : 0.75);
irradianceMapSamplePos2f.xz *= vec2(0.5, COMPARE_GT_C_C(irradianceMapSamplePos2f.y, 0.0, 0.25, -0.25));
irradianceMapSamplePos2f.xz += vec2(0.5, COMPARE_GT_C_C(irradianceMapSamplePos2f.y, 0.0, 0.25, 0.75));
skyLight += textureLod(u_irradianceMap, irradianceMapSamplePos2f.xz, 0.0).rgb;
}
skyLight *= lightmapCoords2f.g * u_sunColor3f_sky1f.w;
@ -210,7 +211,7 @@ void main() {
for(int i = 0; i < safeLightCount; ++i) {
dlightDist3f = worldPosition4f.xyz - u_dynamicLightArray[i].u_lightPosition4f.xyz;
dlightDir3f = normalize(dlightDist3f);
dlightDir3f = dlightDir3f * (dot(dlightDir3f, normalVector3f) < 0.0 ? 1.0 : -1.0);
dlightDir3f = dlightDir3f * COMPARE_LT_C_C(dot(dlightDir3f, normalVector3f), 0.0, 1.0, -1.0);
dlightDir3f = materialData3f.b == 1.0 ? normalVector3f : -dlightDir3f;
if(dot(dlightDir3f, normalVector3f) <= 0.0) {
continue;

View File

@ -40,5 +40,6 @@ void main() {
}
gbufferColor4f = vec4(diffuseRGBA.rgb, v_lightmap2f.r);
gbufferNormal4f = vec4(0.5, 0.5, 1.0, v_lightmap2f.g);
gbufferMaterial4f = vec4(texture(u_samplerNormalMaterial, vec2(v_texCoord2f.x, v_texCoord2f.y * u_textureYScale2f.x + u_textureYScale2f.y)).rgb, 1.0);
gbufferMaterial4f = texture(u_samplerNormalMaterial, vec2(v_texCoord2f.x, v_texCoord2f.y * u_textureYScale2f.x + u_textureYScale2f.y));
gbufferMaterial4f.a = 0.502 - gbufferMaterial4f.a * 0.502;
}

View File

@ -60,6 +60,7 @@ uniform float u_skyLightFactor1f;
#endif
#EAGLER INCLUDE (3) "eagler:glsl/deferred/lib/pbr_env_map.glsl"
#EAGLER INCLUDE (4) "eagler:glsl/deferred/lib/branchless_comparison.glsl"
void main() {
vec3 diffuseColor3f;
@ -86,7 +87,7 @@ void main() {
#ifdef COMPILE_GLOBAL_AMBIENT_OCCLUSION
vec4 ao = textureLod(u_ssaoTexture, min(v_position2f * u_halfResolutionPixelAlignment2f, 1.0), 0.0);
ao.g = ao.b > 0.0 ? ao.g : 1.0;
ao.g = mix(COMPARE_GT_0_1(0.0, ao.b), 1.0, ao.g);
shadow = mix(shadow, shadow * ao.g, 0.9);
#endif
@ -102,8 +103,8 @@ void main() {
vec4 sample2 = textureLod(u_irradianceMap, irradianceMapSamplePos2f.xz * vec2(0.5, -0.25) + vec2(0.5, 0.75), 0.0);
skyLight += mix(sample1.rgb, sample2.rgb, smoothstep(0.0, 1.0, irradianceMapSamplePos2f.y * -12.5 + 0.5)).rgb;
}else {
irradianceMapSamplePos2f.xz *= vec2(0.5, irradianceMapSamplePos2f.y > 0.0 ? 0.25 : -0.25);
irradianceMapSamplePos2f.xz += vec2(0.5, irradianceMapSamplePos2f.y > 0.0 ? 0.25 : 0.75);
irradianceMapSamplePos2f.xz *= vec2(0.5, COMPARE_GT_C_C(irradianceMapSamplePos2f.y, 0.0, 0.25, -0.25));
irradianceMapSamplePos2f.xz += vec2(0.5, COMPARE_GT_C_C(irradianceMapSamplePos2f.y, 0.0, 0.25, 0.75));
skyLight += textureLod(u_irradianceMap, irradianceMapSamplePos2f.xz, 0.0).rgb;
}
@ -114,8 +115,8 @@ void main() {
vec3 specular = vec3(0.0);
#ifdef COMPILE_ENV_MAP_REFLECTIONS
float f = materialData4f.g < 0.06 ? 1.0 : 0.0;
f += materialData4f.r < 0.5 ? 1.0 : 0.0;
float f = COMPARE_LT_0_ANY(materialData4f.g, 0.06);
f += COMPARE_LT_0_ANY(materialData4f.r, 0.5);
while((materialData4f.a >= 0.5 ? f : -1.0) == 0.0) {
vec4 worldPosition4f = vec4(v_position2f, depth, 1.0) * 2.0 - 1.0;
worldPosition4f = u_inverseProjMatrix4f * worldPosition4f;
@ -137,8 +138,8 @@ void main() {
vec4 sample2 = textureLod(u_environmentMap, reflectDir.xz * vec2(0.5, -0.25) + vec2(0.5, 0.75), 0.0);
envMapSample4f = vec4(mix(sample1.rgb, sample2.rgb, smoothstep(0.0, 1.0, reflectDir.y * -12.5 + 0.5)).rgb, min(sample1.a, sample2.a));
}else {
reflectDir.xz = reflectDir.xz * vec2(0.5, reflectDir.y > 0.0 ? 0.25 : -0.25);
reflectDir.xz += vec2(0.5, reflectDir.y > 0.0 ? 0.25 : 0.75);
reflectDir.xz = reflectDir.xz * vec2(0.5, COMPARE_GT_C_C(reflectDir.y, 0.0, 0.25, -0.25));
reflectDir.xz += vec2(0.5, COMPARE_GT_C_C(reflectDir.y, 0.0, 0.25, 0.75));
envMapSample4f = textureLod(u_environmentMap, reflectDir.xz, 0.0);
}
envMapSample4f.a += min(lightmapCoords2f.g * 2.0, 1.0) * (1.0 - envMapSample4f.a);
@ -152,8 +153,8 @@ void main() {
#ifdef COMPILE_SCREEN_SPACE_REFLECTIONS
#ifndef COMPILE_ENV_MAP_REFLECTIONS
float f = materialData4f.g < 0.06 ? 1.0 : 0.0;
f += materialData4f.r < 0.5 ? 1.0 : 0.0;
float f = COMPARE_LT_0_ANY(materialData4f.g, 0.06);
f += COMPARE_LT_0_ANY(materialData4f.r, 0.5);
if(f == 0.0) {
#else
if((materialData4f.a < 0.5 ? f : -1.0) == 0.0) {

View File

@ -73,8 +73,12 @@ in vec3 v_viewdir3f;
uniform vec2 u_textureCoords01;
#endif
#else
#ifdef COMPILE_SUBSURFACE_SCATTERING
uniform vec4 u_materialConstants4f;
#else
uniform vec3 u_materialConstants3f;
#endif
#endif
#ifdef COMPILE_NORMAL_MATERIAL_TEXTURE
mat3 cotangent_frame(in vec3 N, in vec3 p, in vec2 uv) {
@ -155,14 +159,21 @@ void main() {
normal = cf * vec3(normal2, sqrt(1.0 - dot(normal2, normal2)));
}
uv2.y += 0.5;
vec3 material = texture(u_samplerNormalMaterial, uv2).rgb;
vec4 material = texture(u_samplerNormalMaterial, uv2);
#else
vec3 material = u_materialConstants3f;
#ifdef COMPILE_SUBSURFACE_SCATTERING
vec4 material = u_materialConstants4f;
#else
vec4 material = vec4(u_materialConstants3f, 1.0);
#endif
#endif
material.a = 1.0 - material.a + u_useEnvMap1f;
material.a *= 0.502;
gbufferColor4f.rgb = color.rgb;
gbufferColor4f.a = lightmap.r;
gbufferNormal4f.rgb = normal * 0.5 + 0.5;
gbufferNormal4f.a = lightmap.g;
gbufferMaterial4f = vec4(material.rgb, u_useEnvMap1f);
gbufferMaterial4f = material;
}

View File

@ -24,7 +24,6 @@ layout(location = 0) out vec4 output4f;
in vec2 v_position2f;
uniform sampler2D u_gbufferDepthTexture;
uniform sampler2D u_gbufferNormalTexture;
uniform sampler2D u_fogDepthTexture;
@ -34,6 +33,7 @@ uniform sampler2D u_lightShaftsTexture;
#ifdef COMPILE_FOG_ATMOSPHERE
uniform sampler2D u_environmentMap;
uniform sampler2D u_skyTexture;
uniform vec3 u_sunColorAdd3f;
#endif
@ -57,11 +57,6 @@ void main() {
}
#endif
float solidDepth = textureLod(u_gbufferDepthTexture, v_position2f, 0.0).r;
if(solidDepth != fragPos4f.z) {
discard;
}
fragPos4f.xyz *= 2.0;
fragPos4f.xyz -= 1.0;
@ -85,18 +80,26 @@ void main() {
fragPos4f.xz *= 0.75;
vec3 envMapSample3f;
vec3 skyboxSample3f;
fragPos4f.xz *= vec2(-0.5, -0.25);
fragPos4f.xz += vec2(0.5, 0.25);
envMapSample3f = textureLod(u_environmentMap, fragPos4f.xz, 0.0).rgb + u_sunColorAdd3f;
skyboxSample3f = textureLod(u_skyTexture, v_position2f, 0.0).rgb;
#ifdef COMPILE_FOG_LIGHT_SHAFTS
f2 = textureLod(u_lightShaftsTexture, v_position2f, 0.0).r;
envMapSample3f *= pow(f2, 2.25);
f = (f * 0.85 + 0.2) * f2 + f * (1.0 - f2);
f2 = textureLod(u_lightShaftsTexture, v_position2f, 0.0).r * 0.95 + 0.05;
envMapSample3f *= (f2 * 0.8 + 0.2);
skyboxSample3f *= f2 * f2 * f2;
f = min(f + 0.15, 1.0);
f2 = 0.5 + f * 0.5;
#else
f = max(f * 1.0375 - 0.0375, 0.0);
f2 = 0.3 + f * 0.7;
#endif
output4f = vec4(envMapSample3f * fogColor4f.rgb, f);
output4f = vec4(mix(envMapSample3f, skyboxSample3f, f2) * fogColor4f.rgb, f);
#else
output4f = vec4(fogColor4f.rgb, f);
#endif

View File

@ -129,8 +129,12 @@ layout(std140) uniform u_worldLightingData {
#ifdef COMPILE_NORMAL_MATERIAL_TEXTURE
uniform sampler2D u_samplerNormalMaterial;
#else
#ifdef COMPILE_SUBSURFACE_SCATTERING
uniform vec4 u_materialConstants4f;
#else
uniform vec3 u_materialConstants3f;
#endif
#endif
uniform sampler2D u_metalsLUT;
@ -158,6 +162,7 @@ uniform sampler2D u_lightShaftsTexture;
#endif
#EAGLER INCLUDE (4) "eagler:glsl/deferred/lib/pbr_env_map.glsl"
#EAGLER INCLUDE (4) "eagler:glsl/deferred/lib/branchless_comparison.glsl"
#ifdef DO_COMPILE_SUN_SHADOWS
uniform sampler2DShadow u_sunShadowDepthTexture;
@ -167,14 +172,14 @@ vec2(-0.077, 0.995), vec2(0.998, 0.015),
vec2(-0.116, -0.987), vec2(-0.916, 0.359),
vec2(-0.697, -0.511), vec2(0.740, -0.612),
vec2(0.675, 0.682));
#define SMOOTH_SHADOW_SAMPLES 1.0 / 8.0
#define SMOOTH_SHADOW_RADIUS 0.00075
#define SMOOTH_SHADOW_SAMPLES (1.0 / 8.0)
#define SMOOTH_SHADOW_RADIUS 0.000488
#define SMOOTH_SHADOW_POISSON_SAMPLE(idx, tex, lod, vec3Pos, accum, tmpVec2)\
tmpVec2 = vec3Pos.xy + POISSON_DISK[idx] * SMOOTH_SHADOW_RADIUS;\
tmpVec2 = clamp(tmpVec2, vec2(0.001), vec2(0.999));\
tmpVec2.y += lod;\
tmpVec2.y *= SUN_SHADOW_MAP_FRAC;\
accum += textureLod(tex, vec3(tmpVec2, vec3Pos.z), 0.0) * SMOOTH_SHADOW_SAMPLES;
accum += textureLod(tex, vec3(tmpVec2, vec3Pos.z + 0.0001), 0.0);
#endif
#endif
@ -184,7 +189,7 @@ void main() {
vec4 diffuseColor4f;
vec3 normalVector3f;
vec2 lightmapCoords2f;
vec3 materialData3f;
vec4 materialData4f;
float block1f;
// =========== RESOLVE CONSTANTS ============ //
@ -270,13 +275,17 @@ void main() {
#ifdef COMPILE_NORMAL_MATERIAL_TEXTURE
vec2 uv2 = vec2(1.0, 0.5) * texCoords2f;
uv2.y += 0.5;
materialData3f = texture(u_samplerNormalMaterial, uv2).rgb;
materialData4f = texture(u_samplerNormalMaterial, uv2);
#else
materialData3f = u_materialConstants3f;
#ifdef COMPILE_SUBSURFACE_SCATTERING
materialData4f = u_materialConstants4f;
#else
materialData4f = vec4(u_materialConstants3f, 1.0);
#endif
#endif
vec3 metalN, metalK;
PREFETCH_METALS(diffuseColor4f.rgb, materialData3f.g, metalN, metalK)
PREFETCH_METALS(diffuseColor4f.rgb, materialData4f.g, metalN, metalK)
// ============ SUN LIGHTING ============== //
@ -292,7 +301,7 @@ void main() {
float skyLight = max(lightmapCoords2f.g * 2.0 - 1.0, 0.0);
float shadowSample = 1.0;
vec4 shadowWorldPos4f = worldPosition4f;
shadowWorldPos4f.xyz += normalVector3f * 0.05;
shadowWorldPos4f.xyz += normalVector3f * 0.1;
vec4 shadowTexPos4f;
vec2 tmpVec2;
@ -301,7 +310,6 @@ void main() {
if(shadowTexPos4f.xyz == clamp(shadowTexPos4f.xyz, vec3(0.005), vec3(0.995))) {
shadowSample = textureLod(u_sunShadowDepthTexture, vec3(shadowTexPos4f.xy * vec2(1.0, SUN_SHADOW_MAP_FRAC), shadowTexPos4f.z), 0.0);
#ifdef COMPILE_SUN_SHADOW_SMOOTH
shadowSample *= SMOOTH_SHADOW_SAMPLES;
SMOOTH_SHADOW_POISSON_SAMPLE(0, u_sunShadowDepthTexture, 0.0, shadowTexPos4f.xyz, shadowSample, tmpVec2)
SMOOTH_SHADOW_POISSON_SAMPLE(1, u_sunShadowDepthTexture, 0.0, shadowTexPos4f.xyz, shadowSample, tmpVec2)
SMOOTH_SHADOW_POISSON_SAMPLE(2, u_sunShadowDepthTexture, 0.0, shadowTexPos4f.xyz, shadowSample, tmpVec2)
@ -309,7 +317,7 @@ void main() {
SMOOTH_SHADOW_POISSON_SAMPLE(4, u_sunShadowDepthTexture, 0.0, shadowTexPos4f.xyz, shadowSample, tmpVec2)
SMOOTH_SHADOW_POISSON_SAMPLE(5, u_sunShadowDepthTexture, 0.0, shadowTexPos4f.xyz, shadowSample, tmpVec2)
SMOOTH_SHADOW_POISSON_SAMPLE(6, u_sunShadowDepthTexture, 0.0, shadowTexPos4f.xyz, shadowSample, tmpVec2)
shadowSample = max(shadowSample * 2.0 - 1.0, 0.0);
shadowSample *= SMOOTH_SHADOW_SAMPLES;
#endif
break;
}
@ -339,16 +347,16 @@ void main() {
#ifdef DO_COMPILE_SUN_SHADOWS
lightColor3f *= shadowSample * skyLight;
#endif
lightColor3f = eaglercraftLighting(diffuseColor4f.rgb, lightColor3f, -worldDirection4f.xyz, u_sunDirection4f.xyz, normalVector3f, materialData3f, metalN, metalK) * u_blockSkySunDynamicLightFac4f.z;
lightColor3f = eaglercraftLighting(diffuseColor4f.rgb, lightColor3f, -worldDirection4f.xyz, u_sunDirection4f.xyz, normalVector3f, materialData4f.rgb, metalN, metalK) * u_blockSkySunDynamicLightFac4f.z;
}
float f;
#ifdef COMPILE_PARABOLOID_ENV_MAP
#if defined(COMPILE_PARABOLOID_ENV_MAP) && !defined(COMPILE_ENABLE_TEX_GEN)
// =========== ENVIRONMENT MAP =========== //
f = materialData3f.g < 0.06 ? 1.0 : 0.0;
f += materialData3f.r < 0.5 ? 1.0 : 0.0;
f = COMPARE_LT_0_ANY(materialData4f.g, 0.06);
f += COMPARE_LT_0_ANY(materialData4f.r, 0.5);
while(f == 0.0) {
float dst2 = dot(worldPosition4f.xyz, worldPosition4f.xyz);
if(dst2 > 25.0) {
@ -365,13 +373,13 @@ void main() {
vec4 sample2 = textureLod(u_environmentMap, reflectDir.xz * vec2(0.5, -0.25) + vec2(0.5, 0.75), 0.0);
envMapSample4f = vec4(mix(sample1.rgb, sample2.rgb, smoothstep(0.0, 1.0, reflectDir.y * -12.5 + 0.5)).rgb, min(sample1.a, sample2.a));
}else {
reflectDir.xz = reflectDir.xz * vec2(0.5, reflectDir.y > 0.0 ? 0.25 : -0.25);
reflectDir.xz += vec2(0.5, reflectDir.y > 0.0 ? 0.25 : 0.75);
reflectDir.xz = reflectDir.xz * vec2(0.5, COMPARE_GT_C_C(reflectDir.y, 0.0, 0.25, -0.25));
reflectDir.xz += vec2(0.5, COMPARE_GT_C_C(reflectDir.y, 0.0, 0.25, 0.75));
envMapSample4f = textureLod(u_environmentMap, reflectDir.xz, 0.0);
}
envMapSample4f.a += min(lightmapCoords2f.g * 2.0, 1.0) * (1.0 - envMapSample4f.a);
if(envMapSample4f.a == 1.0) {
lightColor3f += eaglercraftIBL_Specular(diffuseColor4f.rgb, envMapSample4f.rgb * envMapSample4f.a, worldDirection4f.xyz, normalVector3f, materialData3f, metalN, metalK) * (1.0 - sqrt(dst2) * 0.2);
lightColor3f += eaglercraftIBL_Specular(diffuseColor4f.rgb, envMapSample4f.rgb * envMapSample4f.a, worldDirection4f.xyz, normalVector3f, materialData4f.rgb, metalN, metalK) * (1.0 - sqrt(dst2) * 0.2);
}
break;
}
@ -393,8 +401,8 @@ void main() {
vec4 sample2 = textureLod(u_irradianceMap, irradianceMapSamplePos2f.xz * vec2(0.5, -0.25) + vec2(0.5, 0.75), 0.0);
skyLight += mix(sample1.rgb, sample2.rgb, smoothstep(0.0, 1.0, irradianceMapSamplePos2f.y * -12.5 + 0.5)).rgb;
}else {
irradianceMapSamplePos2f.xz *= vec2(0.5, irradianceMapSamplePos2f.y > 0.0 ? 0.25 : -0.25);
irradianceMapSamplePos2f.xz += vec2(0.5, irradianceMapSamplePos2f.y > 0.0 ? 0.25 : 0.75);
irradianceMapSamplePos2f.xz *= vec2(0.5, COMPARE_GT_C_C(irradianceMapSamplePos2f.y, 0.0, 0.25, -0.25));
irradianceMapSamplePos2f.xz += vec2(0.5, COMPARE_GT_C_C(irradianceMapSamplePos2f.y, 0.0, 0.25, 0.75));
skyLight += textureLod(u_irradianceMap, irradianceMapSamplePos2f.xz, 0.0).rgb;
}
skyLight *= lightmapCoords2f.g * u_sunColor3f_sky1f.w;
@ -409,7 +417,7 @@ void main() {
for(int i = 0; i < safeLightCount; ++i) {
dlightDist3f = worldPosition4f.xyz - u_dynamicLightArray[i].u_lightPosition4f.xyz;
dlightDir3f = normalize(dlightDist3f);
dlightDir3f = materialData3f.b == 1.0 ? normalVector3f : -dlightDir3f;
dlightDir3f = materialData4f.b == 1.0 ? normalVector3f : -dlightDir3f;
if(dot(dlightDir3f, normalVector3f) <= 0.0) {
continue;
}
@ -419,7 +427,7 @@ void main() {
continue;
}
dlightColor3f *= ((cm - 0.025) / cm);
lightColor3f += eaglercraftLighting(diffuseColor4f.rgb, dlightColor3f, -worldDirection4f.xyz, dlightDir3f, normalVector3f, materialData3f, metalN, metalK) * u_blockSkySunDynamicLightFac4f.w;
lightColor3f += eaglercraftLighting(diffuseColor4f.rgb, dlightColor3f, -worldDirection4f.xyz, dlightDir3f, normalVector3f, materialData4f.rgb, metalN, metalK) * u_blockSkySunDynamicLightFac4f.w;
}
#endif
@ -429,7 +437,7 @@ void main() {
vec4 fogBlend4f = vec4(0.0);
#ifndef COMPILE_ENABLE_TEX_GEN
while(u_fogParameters4f.x > 0.0) {
float atmos = u_fogParameters4f.x >= 4.0 ? 4.0 : 0.0;
float atmos = COMPARE_LT_C_C(u_fogParameters4f.x, 4.0, 0.0, 4.0);
float type = u_fogParameters4f.x - atmos;
fogBlend4f = mix(u_fogColorLight4f, u_fogColorDark4f, lightmapCoords2f.g);
@ -454,8 +462,10 @@ void main() {
fogBlend4f.rgb *= textureLod(u_irradianceMap, atmosSamplePos.xz, 0.0).rgb;
#ifdef COMPILE_FOG_LIGHT_SHAFTS
fogBlend4f.rgb *= pow(textureLod(u_lightShaftsTexture, (v_positionClip3f.xy / v_positionClip3f.z) * 0.5 + 0.5, 0.0).r * 0.9 + 0.1, 2.25);
fogBlend4f.a = fogBlend4f.a * 0.85 + 0.2;
fogBlend4f.rgb *= textureLod(u_lightShaftsTexture, (v_positionClip3f.xy / v_positionClip3f.z) * 0.5 + 0.5, 0.0).r * 0.76 + 0.24;
fogBlend4f.a = min(fogBlend4f.a * 0.8 + 0.35, 1.0);
#else
fogBlend4f.a = max(fogBlend4f.a * 0.83 + 0.17, 0.0);
#endif
break;
}
@ -465,7 +475,7 @@ void main() {
vec3 blockLight = lightmapCoords2f.r * vec3(1.0, 0.5809, 0.2433) * 2.0 * u_blockSkySunDynamicLightFac4f.x;
skyLight *= u_blockSkySunDynamicLightFac4f.y;
float emissive = materialData3f.b == 1.0 ? 0.0 : materialData3f.b;
float emissive = materialData4f.b == 1.0 ? 0.0 : materialData4f.b;
diffuseColor4f.rgb *= max(skyLight + blockLight, vec3(emissive * emissive * 20.0 + 0.075)) * 0.075;
diffuseColor4f.rgb += lightColor3f;

View File

@ -85,6 +85,8 @@ layout(std140) uniform u_worldLightingData {
uniform sampler2D u_environmentMap;
uniform sampler2D u_brdfLUT;
#EAGLER INCLUDE (4) "eagler:glsl/deferred/lib/branchless_comparison.glsl"
#define GLASS_ROUGHNESS 0.15
#define GLASS_F0 0.4
@ -126,14 +128,14 @@ vec2(-0.077, 0.995), vec2(0.998, 0.015),
vec2(-0.116, -0.987), vec2(-0.916, 0.359),
vec2(-0.697, -0.511), vec2(0.740, -0.612),
vec2(0.675, 0.682));
#define SMOOTH_SHADOW_SAMPLES 1.0 / 8.0
#define SMOOTH_SHADOW_RADIUS 0.00075
#define SMOOTH_SHADOW_SAMPLES (1.0 / 8.0)
#define SMOOTH_SHADOW_RADIUS 0.000488
#define SMOOTH_SHADOW_POISSON_SAMPLE(idx, tex, lod, vec3Pos, accum, tmpVec2)\
tmpVec2 = vec3Pos.xy + POISSON_DISK[idx] * SMOOTH_SHADOW_RADIUS;\
tmpVec2 = clamp(tmpVec2, vec2(0.001), vec2(0.999));\
tmpVec2.y += lod;\
tmpVec2.y *= SUN_SHADOW_MAP_FRAC;\
accum += textureLod(tex, vec3(tmpVec2, vec3Pos.z), 0.0) * SMOOTH_SHADOW_SAMPLES;
accum += textureLod(tex, vec3(tmpVec2, vec3Pos.z + 0.0001), 0.0);
#endif
#endif
@ -184,16 +186,15 @@ void main() {
float skyLight = max(lightmapCoords2f.g * 2.0 - 1.0, 0.0);
float shadowSample = 1.0;
vec4 shadowWorldPos4f = worldPosition4f;
shadowWorldPos4f.xyz += normalVector3f * 0.05;
shadowWorldPos4f.xyz += normalVector3f * 0.1;
vec4 shadowTexPos4f;
vec2 tmpVec2;
for(;;) {
shadowTexPos4f = u_sunShadowMatrixLOD04f * shadowWorldPos4f;
if(shadowTexPos4f.xyz == clamp(shadowTexPos4f.xyz, vec3(0.005), vec3(0.995))) {
shadowSample = textureLod(u_sunShadowDepthTexture, vec3(shadowTexPos4f.xy * vec2(1.0, SUN_SHADOW_MAP_FRAC), shadowTexPos4f.z), 0.0);
shadowSample = textureLod(u_sunShadowDepthTexture, vec3(shadowTexPos4f.xy * vec2(1.0, SUN_SHADOW_MAP_FRAC), shadowTexPos4f.z + 0.0001), 0.0);
#ifdef COMPILE_SUN_SHADOW_SMOOTH
shadowSample *= SMOOTH_SHADOW_SAMPLES;
SMOOTH_SHADOW_POISSON_SAMPLE(0, u_sunShadowDepthTexture, 0.0, shadowTexPos4f.xyz, shadowSample, tmpVec2)
SMOOTH_SHADOW_POISSON_SAMPLE(1, u_sunShadowDepthTexture, 0.0, shadowTexPos4f.xyz, shadowSample, tmpVec2)
SMOOTH_SHADOW_POISSON_SAMPLE(2, u_sunShadowDepthTexture, 0.0, shadowTexPos4f.xyz, shadowSample, tmpVec2)
@ -201,7 +202,7 @@ void main() {
SMOOTH_SHADOW_POISSON_SAMPLE(4, u_sunShadowDepthTexture, 0.0, shadowTexPos4f.xyz, shadowSample, tmpVec2)
SMOOTH_SHADOW_POISSON_SAMPLE(5, u_sunShadowDepthTexture, 0.0, shadowTexPos4f.xyz, shadowSample, tmpVec2)
SMOOTH_SHADOW_POISSON_SAMPLE(6, u_sunShadowDepthTexture, 0.0, shadowTexPos4f.xyz, shadowSample, tmpVec2)
shadowSample = max(shadowSample * 2.0 - 1.0, 0.0);
shadowSample *= SMOOTH_SHADOW_SAMPLES;
#endif
break;
}
@ -252,8 +253,8 @@ void main() {
vec4 sample2 = textureLod(u_environmentMap, reflectDir.xz * vec2(0.5, -0.25) + vec2(0.5, 0.75), 0.0);
envMapSample4f = vec4(mix(sample1.rgb, sample2.rgb, smoothstep(0.0, 1.0, reflectDir.y * -12.5 + 0.5)).rgb, min(sample1.a, sample2.a));
}else {
reflectDir.xz = reflectDir.xz * vec2(0.5, reflectDir.y > 0.0 ? 0.25 : -0.25);
reflectDir.xz += vec2(0.5, reflectDir.y > 0.0 ? 0.25 : 0.75);
reflectDir.xz = reflectDir.xz * vec2(0.5, COMPARE_GT_C_C(reflectDir.y, 0.0, 0.25, -0.25));
reflectDir.xz += vec2(0.5, COMPARE_GT_C_C(reflectDir.y, 0.0 , 0.25, 0.75));
envMapSample4f = textureLod(u_environmentMap, reflectDir.xz, 0.0);
}
envMapSample4f.a += min(lightmapCoords2f.g * 2.0, 1.0) * (1.0 - envMapSample4f.a);
@ -291,7 +292,7 @@ void main() {
float fogFade = 0.0;
if(u_fogParameters4f.x > 0.0) {
float atmos = u_fogParameters4f.x >= 4.0 ? 4.0 : 0.0;
float atmos = COMPARE_LT_C_C(u_fogParameters4f.x, 4.0, 0.0, 4.0);
float type = u_fogParameters4f.x - atmos;
fogFade = mix(u_fogColorDark4f.a, u_fogColorLight4f.a, lightmapCoords2f.g);

View File

@ -53,7 +53,7 @@ void main() {
#endif
#ifdef DEBUG_VIEW_3
vec4 color4f = textureLod(u_texture0, v_position2f, 0.0);
output4f = vec4(color4f.b > 0.99 ? 1.0 : 0.0, color4f.a, 0.0, 1.0);
output4f = vec4((color4f.a - (color4f.a > 0.5 ? 0.5 : 0.0)) * 2.0, color4f.a > 0.5 ? 1.0 : 0.0, color4f.b > 0.99 ? 1.0 : 0.0, 1.0);
#endif
#ifdef DEBUG_VIEW_4
output4f = vec4(vec3(clamp((textureLod(u_texture0, v_position2f, 0.0).r - u_depthSliceStartEnd2f.x) * u_depthSliceStartEnd2f.y, 0.0, 1.0)), 1.0);

View File

@ -0,0 +1,35 @@
/*
* Copyright (c) 2025 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
// Assuming modern GPUs probably implement clamp, max, and ciel without branches
// value1 > value2 ? 1.0 : 0.0
#define COMPARE_GT_0_1(value1, value2) clamp(ceil(value1 - value2), 0.0, 1.0)
// value1 > value2 ? N : 0.0
#define COMPARE_GT_0_ANY(value1, value2) max(ceil(value1 - value2), 0.0)
// value1 < value2 ? 1.0 : 0.0
#define COMPARE_LT_0_1(value1, value2) clamp(ceil(value2 - value1), 0.0, 1.0)
// value1 < value2 ? N : 0.0
#define COMPARE_LT_0_ANY(value1, value2) max(ceil(value2 - value1), 0.0)
// value1 > value2 ? ifGT : ifLT
#define COMPARE_GT_C_C(value1, value2, ifGT, ifLT) (COMPARE_GT_0_1(value1, value2) * (ifGT - ifLT) + ifLT)
// value1 < value2 ? ifLT : ifGT
#define COMPARE_LT_C_C(value1, value2, ifLT, ifGT) (COMPARE_LT_0_1(value1, value2) * (ifLT - ifGT) + ifGT)

View File

@ -37,6 +37,9 @@ uniform mat4 u_inverseProjectionMatrix4f;
#ifdef COMPILE_SUN_SHADOW
uniform sampler2D u_sunShadowTexture;
#endif
#ifdef COMPILE_SUBSURFACE_SCATTERING
uniform sampler2D u_subsurfaceScatteringTexture;
#endif
uniform vec3 u_sunDirection3f;
uniform vec3 u_sunColor3f;
@ -49,30 +52,64 @@ void main() {
vec3 normalVector3f;
vec2 lightmapCoords2f;
vec3 materialData3f;
vec4 sampleVar4f;
#ifdef COMPILE_SUBSURFACE_SCATTERING
float depth = textureLod(u_gbufferDepthTexture, v_position2f, 0.0).r;
if(depth == 0.0) {
discard;
}
sampleVar4f = textureLod(u_gbufferColorTexture, v_position2f, 0.0);
diffuseColor3f.rgb = sampleVar4f.rgb;
diffuseColor3f *= diffuseColor3f;
lightmapCoords2f.x = sampleVar4f.a;
#endif
#ifdef COMPILE_SUBSURFACE_SCATTERING
float subsurfValue = textureLod(u_subsurfaceScatteringTexture, v_position2f, 0.0).r;
subsurfValue *= subsurfValue;
output4f = vec4(subsurfValue * u_sunColor3f * diffuseColor3f * 0.125, 0.0);
#endif
#ifdef COMPILE_SUN_SHADOW
#ifdef COMPILE_COLORED_SHADOW
vec4 shadow = textureLod(u_sunShadowTexture, v_position2f, 0.0);
if(shadow.a < 0.05) {
#ifndef COMPILE_SUBSURFACE_SCATTERING
discard;
#else
return;
#endif
}
#else
vec3 shadow = vec3(textureLod(u_sunShadowTexture, v_position2f, 0.0).r);
#ifndef COMPILE_SUBSURFACE_SCATTERING
if(shadow.r < 0.05) {
#ifndef COMPILE_SUBSURFACE_SCATTERING
discard;
#else
return;
#endif
}
#endif
#endif
#endif
#ifndef COMPILE_SUBSURFACE_SCATTERING
float depth = textureLod(u_gbufferDepthTexture, v_position2f, 0.0).r;
#endif
#ifndef COMPILE_SUN_SHADOW
if(depth == 0.0) {
#ifndef COMPILE_SUBSURFACE_SCATTERING
discard;
#else
return;
#endif
}
#endif
vec4 sampleVar4f = textureLod(u_gbufferNormalTexture, v_position2f, 0.0);
sampleVar4f = textureLod(u_gbufferNormalTexture, v_position2f, 0.0);
#ifndef COMPILE_SUN_SHADOW
vec3 shadow = vec3(sampleVar4f.a, 0.0, 0.0);
@ -85,9 +122,12 @@ void main() {
normalVector3f.xyz = sampleVar4f.rgb * 2.0 - 1.0;
lightmapCoords2f.y = sampleVar4f.a;
#ifndef COMPILE_SUBSURFACE_SCATTERING
sampleVar4f = textureLod(u_gbufferColorTexture, v_position2f, 0.0);
diffuseColor3f.rgb = sampleVar4f.rgb;
diffuseColor3f *= diffuseColor3f;
lightmapCoords2f.x = sampleVar4f.a;
#endif
materialData3f = textureLod(u_gbufferMaterialTexture, v_position2f, 0.0).rgb;
vec3 worldSpaceNormal = normalize(mat3(u_inverseViewMatrix4f) * normalVector3f);
@ -97,6 +137,15 @@ void main() {
worldSpacePosition = u_inverseProjectionMatrix4f * worldSpacePosition;
worldSpacePosition = u_inverseViewMatrix4f * vec4(worldSpacePosition.xyz / worldSpacePosition.w, 0.0);
diffuseColor3f *= diffuseColor3f;
output4f = vec4(eaglercraftLighting(diffuseColor3f, u_sunColor3f * shadow.rgb, normalize(-worldSpacePosition.xyz), u_sunDirection3f, worldSpaceNormal, materialData3f), 0.0);
}
#ifdef COMPILE_SUBSURFACE_SCATTERING
output4f.rgb +=
#else
output4f = vec4(
#endif
eaglercraftLighting(diffuseColor3f, u_sunColor3f * shadow.rgb, normalize(-worldSpacePosition.xyz), u_sunDirection3f, worldSpaceNormal, materialData3f)
#ifdef COMPILE_SUBSURFACE_SCATTERING
* (1.0 - subsurfValue * 0.0625);
#else
, 0.0);
#endif
}

View File

@ -1,7 +1,7 @@
#line 2
/*
* Copyright (c) 2023 lax1dude. All Rights Reserved.
* Copyright (c) 2023-2025 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
@ -31,21 +31,40 @@ uniform vec3 u_lightDir3f;
uniform sampler2D u_moonTextures;
uniform sampler2D u_cloudsTexture;
#define MOON_SURFACE 0.9
#define MOON_MARGIN 0.0125
void main() {
gl_FragDepth = 0.0;
vec4 color4f = texture(u_moonTextures, v_position2f);
if(color4f.a < 0.99) {
discard;
vec2 coord2f = v_position2f * 2.0 - 1.0;
vec2 texUV = (coord2f * (1.0 / (MOON_SURFACE + MOON_MARGIN))) * 0.5 + 0.5;
vec4 color4f = vec4(0.0);
if(texUV == clamp(texUV, vec2(0.0), vec2(1.0))) {
color4f = texture(u_moonTextures, texUV);
}
vec3 moonNormal3f;
moonNormal3f.xy = color4f.rg * 2.0 - 1.0;
moonNormal3f.z = sqrt(1.0 - dot(moonNormal3f.xy, moonNormal3f.xy));
float NdotV = dot(moonNormal3f, u_lightDir3f);
output4f = vec4(u_moonColor3f * (color4f.b * color4f.b * mix(max(NdotV, 0.0), max(NdotV + 0.45, 0.0) * 0.5f, max(u_lightDir3f.z * u_lightDir3f.z * -u_lightDir3f.z, 0.0))), 0.0);
float NdotV = max(dot(moonNormal3f, u_lightDir3f), 0.0);
vec3 viewDir = normalize(v_position3f);
vec2 surfaceCoord2f = coord2f * (1.0 / MOON_SURFACE);
vec3 moonAtmosNormalInner3f = vec3(surfaceCoord2f, sqrt(1.0 - dot(surfaceCoord2f, surfaceCoord2f)));
vec3 moonAtmosNormalOuter3f = vec3(surfaceCoord2f, sqrt(-1.0 + dot(surfaceCoord2f, surfaceCoord2f)));
float NdotVInner = max(dot(moonAtmosNormalInner3f, u_lightDir3f), 0.0);
float NdotVOuter = max(dot(moonAtmosNormalOuter3f, u_lightDir3f) + 0.65, 0.0);
float atmosInner = max((MOON_SURFACE * 0.2) / moonAtmosNormalInner3f.z - 0.2, 0.0);
float atmosOuter = max((MOON_SURFACE * 0.2) / moonAtmosNormalOuter3f.z - 0.4, 0.0);
output4f = vec4(u_moonColor3f * (color4f.b * color4f.b * NdotV + (NdotVInner * atmosInner + NdotVOuter * atmosOuter * vec3(0.8, 0.825, 0.9)) * (0.5 - max(u_lightDir3f.z, 0.0) * 0.25)), 0.0);
if(viewDir.y < 0.01) {
return;
}
vec2 cloudSampleCoord2f = (viewDir.xz / (viewDir.y + 1.0)) * 0.975 * 0.5 + 0.5;
vec4 cloudSample = textureLod(u_cloudsTexture, cloudSampleCoord2f, 0.0);
output4f.rgb = mix(output4f.rgb, output4f.rgb * max(cloudSample.a * 1.25 - 0.25, 0.0), smoothstep(0.0, 1.0, min(viewDir.y * 8.0, 1.0)));

View File

@ -19,7 +19,6 @@
precision highp sampler2DShadow;
in vec4 v_position4f;
in vec3 v_positionClip3f;
#ifdef COMPILE_TEXTURE_ATTRIB
in vec2 v_texture2f;
@ -102,14 +101,14 @@ vec2(-0.077, 0.995), vec2(0.998, 0.015),
vec2(-0.116, -0.987), vec2(-0.916, 0.359),
vec2(-0.697, -0.511), vec2(0.740, -0.612),
vec2(0.675, 0.682));
#define SMOOTH_SHADOW_SAMPLES 1.0 / 8.0
#define SMOOTH_SHADOW_RADIUS 0.00075
#define SMOOTH_SHADOW_SAMPLES (1.0 / 8.0)
#define SMOOTH_SHADOW_RADIUS 0.000488
#define SMOOTH_SHADOW_POISSON_SAMPLE(idx, tex, lod, vec3Pos, accum, tmpVec2)\
tmpVec2 = vec3Pos.xy + POISSON_DISK[idx] * SMOOTH_SHADOW_RADIUS;\
tmpVec2 = clamp(tmpVec2, vec2(0.001), vec2(0.999));\
tmpVec2.y += lod;\
tmpVec2.y *= SUN_SHADOW_MAP_FRAC;\
accum += textureLod(tex, vec3(tmpVec2, vec3Pos.z), 0.0) * SMOOTH_SHADOW_SAMPLES;
accum += textureLod(tex, vec3(tmpVec2, vec3Pos.z + 0.0001), 0.0);
#endif
#endif
@ -120,13 +119,11 @@ uniform sampler2D u_refractionMap;
uniform sampler2D u_brdfLUT;
uniform sampler2D u_normalMap;
#ifdef COMPILE_FOG_LIGHT_SHAFTS
uniform sampler2D u_lightShaftsTexture;
#endif
uniform vec4 u_waterWindOffset4f;
uniform vec3 u_wavingBlockOffset3f;
#EAGLER INCLUDE (4) "eagler:glsl/deferred/lib/branchless_comparison.glsl"
#define WATER_ROUGHNESS 0.05
#define WATER_F0 0.5
@ -301,16 +298,15 @@ void main() {
float skyLight = max(lightmapCoords2f.g * 2.0 - 1.0, 0.0);
float shadowSample = 1.0;
vec4 shadowWorldPos4f = worldPosition4f;
shadowWorldPos4f.xyz += normalVector3f * 0.05;
shadowWorldPos4f.xyz += normalVector3f * 0.1;
vec4 shadowTexPos4f;
vec2 tmpVec2;
for(;;) {
shadowTexPos4f = u_sunShadowMatrixLOD04f * shadowWorldPos4f;
if(shadowTexPos4f.xyz == clamp(shadowTexPos4f.xyz, vec3(0.005), vec3(0.995))) {
shadowSample = textureLod(u_sunShadowDepthTexture, vec3(shadowTexPos4f.xy * vec2(1.0, SUN_SHADOW_MAP_FRAC), shadowTexPos4f.z), 0.0);
shadowSample = textureLod(u_sunShadowDepthTexture, vec3(shadowTexPos4f.xy * vec2(1.0, SUN_SHADOW_MAP_FRAC), shadowTexPos4f.z + 0.0001), 0.0);
#ifdef COMPILE_SUN_SHADOW_SMOOTH
shadowSample *= SMOOTH_SHADOW_SAMPLES;
SMOOTH_SHADOW_POISSON_SAMPLE(0, u_sunShadowDepthTexture, 0.0, shadowTexPos4f.xyz, shadowSample, tmpVec2)
SMOOTH_SHADOW_POISSON_SAMPLE(1, u_sunShadowDepthTexture, 0.0, shadowTexPos4f.xyz, shadowSample, tmpVec2)
SMOOTH_SHADOW_POISSON_SAMPLE(2, u_sunShadowDepthTexture, 0.0, shadowTexPos4f.xyz, shadowSample, tmpVec2)
@ -318,7 +314,7 @@ void main() {
SMOOTH_SHADOW_POISSON_SAMPLE(4, u_sunShadowDepthTexture, 0.0, shadowTexPos4f.xyz, shadowSample, tmpVec2)
SMOOTH_SHADOW_POISSON_SAMPLE(5, u_sunShadowDepthTexture, 0.0, shadowTexPos4f.xyz, shadowSample, tmpVec2)
SMOOTH_SHADOW_POISSON_SAMPLE(6, u_sunShadowDepthTexture, 0.0, shadowTexPos4f.xyz, shadowSample, tmpVec2)
shadowSample = max(shadowSample * 2.0 - 1.0, 0.0);
shadowSample *= SMOOTH_SHADOW_SAMPLES;
#endif
break;
}
@ -356,8 +352,8 @@ void main() {
lightmapCoords2f *= lightmapCoords2f;
float e = 0.0;
e += envMapSample4f.g <= 0.0 ? 0.0 : 1.0;
e += lightmapCoords2f.y > 0.5 ? 0.0 : 1.0;
e += COMPARE_GT_0_ANY(envMapSample4f.g, 0.0);
e += COMPARE_LT_0_ANY(lightmapCoords2f.y, 0.5);
//e += abs(normalVector3f.y) > 0.1 ? 0.0 : 1.0;
if(e == 0.0) {
vec3 reflectDir = reflect(worldDirection4f.xyz, normalVector3f);
@ -370,8 +366,8 @@ void main() {
vec4 sample2 = textureLod(u_environmentMap, reflectDir.xz * vec2(0.5, -0.25) + vec2(0.5, 0.75), 0.0);
envMapSample4f = vec4(mix(sample1.rgb, sample2.rgb, smoothstep(0.0, 1.0, reflectDir.y * -12.5 + 0.5)).rgb, min(sample1.a, sample2.a));
}else {
reflectDir.xz *= vec2(0.5, reflectDir.y > 0.0 ? 0.25 : -0.25);
reflectDir.xz += vec2(0.5, reflectDir.y > 0.0 ? 0.25 : 0.75);
reflectDir.xz *= vec2(0.5, COMPARE_GT_C_C(reflectDir.y, 0.0, 0.25, -0.25));
reflectDir.xz += vec2(0.5, COMPARE_GT_C_C(reflectDir.y, 0.0, 0.25, 0.75));
envMapSample4f = textureLod(u_environmentMap, reflectDir.xz, 0.0);
}
envMapSample4f.rgb *= (lightmapCoords2f.y * 2.0 - 1.0);
@ -405,47 +401,11 @@ void main() {
#endif
// ============ CACLULATE FOG ============= //
vec4 fogBlend4f = vec4(0.0);
while(u_fogParameters4f.x > 0.0) {
float atmos = u_fogParameters4f.x >= 4.0 ? 4.0 : 0.0;
float type = u_fogParameters4f.x - atmos;
fogBlend4f = mix(u_fogColorLight4f, u_fogColorDark4f, lightmapCoords2f.g);
float f, l = length(v_position4f.xyz);
if(type == 1.0) {
f = (l - u_fogParameters4f.z) / (u_fogParameters4f.w - u_fogParameters4f.z);
}else {
f = 1.0 - exp(-u_fogParameters4f.y * l);
}
fogBlend4f.a *= clamp(f, 0.0, 1.0);
if(atmos == 0.0) {
break;
}
vec3 atmosSamplePos = v_position4f.xyz / -l;
atmosSamplePos.xz /= abs(atmosSamplePos.y) + 1.0;
atmosSamplePos.xz *= vec2(-0.5, -0.25) * 0.75;
atmosSamplePos.xz += vec2(0.5, 0.25);
fogBlend4f.rgb *= textureLod(u_irradianceMap, atmosSamplePos.xz, 0.0).rgb + u_fogColorAddSun4f.rgb;
#ifdef COMPILE_FOG_LIGHT_SHAFTS
fogBlend4f.rgb *= pow(textureLod(u_lightShaftsTexture, (v_positionClip3f.xy / v_positionClip3f.z) * 0.5 + 0.5, 0.0).r * 0.9 + 0.1, 2.25);
fogBlend4f.a = fogBlend4f.a * 0.85 + 0.2;
#endif
break;
}
// ============ OUTPUT COLOR ============== //
vec3 blockLight = lightmapCoords2f.r * vec3(1.0, 0.5809, 0.2433) * 2.0 * u_blockSkySunDynamicLightFac4f.x;
vec3 skyLight = (lightmapCoords2f.g + 0.05) * vec3(0.9102, 0.9, 1.0) * u_blockSkySunDynamicLightFac4f.y;
diffuseColor4f.rgb *= (skyLight + blockLight) * 0.075;
diffuseColor4f.rgb += lightColor3f;
diffuseColor4f.rgb = mix(diffuseColor4f.rgb + refractionSample.rgb, fogBlend4f.rgb, fogBlend4f.a);
diffuseColor4f.rgb += lightColor3f + refractionSample.rgb;
output4f = vec4(diffuseColor4f.rgb, 1.0);
}

View File

@ -20,10 +20,6 @@ in vec3 a_position3f;
out vec4 v_position4f;
#ifdef COMPILE_FOG_LIGHT_SHAFTS
out vec3 v_positionClip3f;
#endif
#ifdef COMPILE_TEXTURE_ATTRIB
in vec2 a_texture2f;
out vec2 v_texture2f;
@ -75,8 +71,4 @@ void main() {
#endif
gl_Position = u_projectionMat4f * v_position4f;
#ifdef COMPILE_FOG_LIGHT_SHAFTS
v_positionClip3f = gl_Position.xyw;
#endif
}

View File

@ -84,6 +84,8 @@ uniform vec4 u_nearFarPlane4f;
uniform vec4 u_pixelAlignment4f;
#EAGLER INCLUDE (4) "eagler:glsl/deferred/lib/branchless_comparison.glsl"
#define reprojDepthLimit 0.25
#define GET_LINEAR_DEPTH_FROM_VALUE(depthSample) (u_nearFarPlane4f.z / (u_nearFarPlane4f.y + u_nearFarPlane4f.x + (depthSample * 2.0 - 1.0) * u_nearFarPlane4f.w))
@ -135,9 +137,9 @@ void main() {
#ifdef COMPILE_REPROJECT_SSR
vec4 materials = textureLod(u_gbufferMaterialTexture, v_position2f2, 0.0);
float f = materials.g < 0.06 ? 1.0 : 0.0;
f += materials.r < 0.5 ? 1.0 : 0.0;
f += materials.a > 0.5 ? 1.0 : 0.0;
float f = COMPARE_LT_0_ANY(materials.g, 0.06);
f += COMPARE_LT_0_ANY(materials.r, 0.5);
f += COMPARE_GT_0_ANY(materials.a, 0.5);
if(f > 0.0) {
return;
}

View File

@ -1,7 +1,7 @@
{
"name": "§eHigh Performance PBR",
"desc": "Pack made from scratch specifically for this client, designed to give what I call the best balance between quality and performance possible in a browser but obviously that's just my opinion",
"vers": "1.3.1",
"vers": "1.4.0",
"author": "lax1dude",
"api_vers": 1,
"features": [
@ -19,6 +19,7 @@
"POST_LENS_DISTORION",
"POST_LENS_FLARES",
"POST_BLOOM",
"POST_FXAA"
"POST_FXAA",
"SUBSURFACE_SCATTERING"
]
}

View File

@ -60,14 +60,14 @@ vec2(-0.077, 0.995), vec2(0.998, 0.015),
vec2(-0.116, -0.987), vec2(-0.916, 0.359),
vec2(-0.697, -0.511), vec2(0.740, -0.612),
vec2(0.675, 0.682));
#define SMOOTH_SHADOW_SAMPLES 1.0 / 8.0
#define SMOOTH_SHADOW_RADIUS 0.00075
#define SMOOTH_SHADOW_SAMPLES (1.0 / 8.0)
#define SMOOTH_SHADOW_RADIUS 0.000488
#define SMOOTH_SHADOW_POISSON_SAMPLE(idx, tex, lod, vec3Pos, accum, tmpVec2)\
tmpVec2 = vec3Pos.xy + POISSON_DISK[idx] * SMOOTH_SHADOW_RADIUS;\
tmpVec2 = clamp(tmpVec2, vec2(0.001), vec2(0.999));\
tmpVec2.y += lod;\
tmpVec2.y *= SUN_SHADOW_MAP_FRAC;\
accum += textureLod(tex, vec3(tmpVec2, vec3Pos.z), 0.0) * SMOOTH_SHADOW_SAMPLES;
accum += textureLod(tex, vec3(tmpVec2, vec3Pos.z + 0.0001), 0.0);
#endif
uniform vec3 u_sunDirection3f;
@ -97,7 +97,7 @@ void main() {
worldSpacePosition.xyz -= 1.0;
worldSpacePosition = u_inverseViewProjMatrix4f * worldSpacePosition;
worldSpacePosition.xyz /= worldSpacePosition.w;
worldSpacePosition.xyz += worldSpaceNormal * 0.05;
worldSpacePosition.xyz += worldSpaceNormal * 0.1;
worldSpacePosition.w = 1.0;
float skyLight = max(normalVector4f.a * 2.0 - 1.0, 0.0);
float shadowSample;
@ -106,9 +106,8 @@ void main() {
for(;;) {
shadowSpacePosition = u_sunShadowMatrixLOD04f * worldSpacePosition;
if(shadowSpacePosition.xyz == clamp(shadowSpacePosition.xyz, vec3(0.005), vec3(0.995))) {
shadowSample = textureLod(u_sunShadowDepthTexture, vec3(shadowSpacePosition.xy * vec2(1.0, SUN_SHADOW_MAP_FRAC), shadowSpacePosition.z), 0.0);
shadowSample = textureLod(u_sunShadowDepthTexture, vec3(shadowSpacePosition.xy * vec2(1.0, SUN_SHADOW_MAP_FRAC), shadowSpacePosition.z + 0.0001), 0.0);
#ifdef COMPILE_SUN_SHADOW_SMOOTH
shadowSample *= SMOOTH_SHADOW_SAMPLES;
SMOOTH_SHADOW_POISSON_SAMPLE(0, u_sunShadowDepthTexture, 0.0, shadowSpacePosition.xyz, shadowSample, tmpVec2)
SMOOTH_SHADOW_POISSON_SAMPLE(1, u_sunShadowDepthTexture, 0.0, shadowSpacePosition.xyz, shadowSample, tmpVec2)
SMOOTH_SHADOW_POISSON_SAMPLE(2, u_sunShadowDepthTexture, 0.0, shadowSpacePosition.xyz, shadowSample, tmpVec2)
@ -116,7 +115,7 @@ void main() {
SMOOTH_SHADOW_POISSON_SAMPLE(4, u_sunShadowDepthTexture, 0.0, shadowSpacePosition.xyz, shadowSample, tmpVec2)
SMOOTH_SHADOW_POISSON_SAMPLE(5, u_sunShadowDepthTexture, 0.0, shadowSpacePosition.xyz, shadowSample, tmpVec2)
SMOOTH_SHADOW_POISSON_SAMPLE(6, u_sunShadowDepthTexture, 0.0, shadowSpacePosition.xyz, shadowSample, tmpVec2)
shadowSample = max(shadowSample * 2.0 - 1.0, 0.0);
shadowSample *= SMOOTH_SHADOW_SAMPLES;
#endif
#ifdef COMPILE_COLORED_SHADOW
shadowSpacePosition.y *= SUN_SHADOW_MAP_FRAC;

View File

@ -23,6 +23,10 @@ precision highp sampler2D;
in vec3 v_position3f;
in vec3 v_color3f;
#ifndef COMPILE_PARABOLOID_SKY
in vec3 v_positionClip3f;
#endif
layout(location = 0) out vec4 output4f;
uniform vec3 u_sunDirection3f;
@ -33,10 +37,15 @@ uniform vec4 u_lightningColor4f;
uniform sampler2D u_cloudsTexture;
#endif
#ifndef COMPILE_PARABOLOID_SKY
uniform sampler2D u_sunOcclusion;
uniform sampler2D u_gbufferDepthTexture;
#endif
#define SKY_BRIGHTNESS 5.0
#EAGLER INCLUDE (4) "eagler:glsl/deferred/lib/branchless_comparison.glsl"
void main() {
gl_FragDepth = 0.0;
vec3 viewDir = normalize(v_position3f);
@ -46,6 +55,7 @@ void main() {
float f = max(dot(viewDir, u_sunDirection3f) - 0.995, 0.0) * 100.0;
float intensity = min(f * 2.0, 1.0);
intensity *= intensity * intensity * intensity * textureLod(u_sunOcclusion, vec2(0.5, 0.5), 0.0).r * 2.0;
intensity *= 1.0 - COMPARE_GT_0_1(textureLod(u_gbufferDepthTexture, (v_positionClip3f.xy / v_positionClip3f.z) * 0.5 + 0.5, 0.0).r, 0.0);
output4f = vec4(v_color3f * SKY_BRIGHTNESS + intensity * u_sunColor3f, 0.0);
#endif
#ifdef COMPILE_CLOUDS

View File

@ -26,6 +26,10 @@ layout(location = 1) in vec2 a_colorIndex2f;
out vec3 v_position3f;
out vec3 v_color3f;
#ifndef COMPILE_PARABOLOID_SKY
out vec3 v_positionClip3f;
#endif
uniform mat4 u_viewMatrix4f;
#ifdef COMPILE_PARABOLOID_SKY
uniform float u_farPlane1f;
@ -47,5 +51,6 @@ void main() {
gl_Position = vec4(pos.xyz, 1.0);
#else
gl_Position = u_projMatrix4f * vec4(pos.xyz, 1.0);
v_positionClip3f = gl_Position.xyw;
#endif
}

View File

@ -33,6 +33,8 @@ uniform mat4 u_inverseProjectionMatrix4f;
uniform mat2 u_randomizerDataMatrix2f;
#EAGLER INCLUDE (4) "eagler:glsl/deferred/lib/branchless_comparison.glsl"
const vec3 ssaoKernel[8] = vec3[](
vec3(0.599,0.721,0.350),vec3(0.114,0.791,0.601),
vec3(0.067,0.995,0.069),vec3(0.511,-0.510,0.692),
@ -48,8 +50,8 @@ vec3(0.716,-0.439,0.543),vec3(-0.400,0.733,0.550));
tmpVec4_2.zw = matProjInv2f * vec4(tmpVec4_2.xy, textureLod(u_gbufferDepthTexture, tmpVec4_2.xy * 0.5 + 0.5, 0.0).r * 2.0 - 1.0, 1.0);\
tmpVec4_2.z /= tmpVec4_2.w;\
tmpVec4_2.x = smoothstep(0.0, 1.0, radius * 0.5 / abs(pos.z - tmpVec4_2.z));\
divisor += tmpVec4_2.x > 0.0 ? 1.0 : 0.0;\
occlusion += (tmpVec4_2.z >= tmpVec4_1.z ? 1.0 : 0.0) * tmpVec4_2.x;
divisor += COMPARE_GT_0_1(tmpVec4_2.x, 0.0);\
occlusion += COMPARE_GT_0_1(tmpVec4_2.z, tmpVec4_1.z) * tmpVec4_2.x;
void main() {
vec3 originalClipSpacePos = vec3(v_position2f, textureLod(u_gbufferDepthTexture, v_position2f, 0.0).r);

View File

@ -0,0 +1,158 @@
#line 2
/*
* Copyright (c) 2025 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
precision lowp int;
precision highp float;
precision highp sampler2D;
in vec2 v_position2f;
layout(location = 0) out float output1f;
uniform mat4 u_inverseViewMatrix4f;
uniform mat4 u_inverseViewProjMatrix4f;
uniform sampler2D u_gbufferNormalTexture;
uniform sampler2D u_gbufferDepthTexture;
uniform sampler2D u_gbufferMaterialTexture;
uniform sampler2D u_sunShadowDepthTexture;
#ifdef COMPILE_SUN_SHADOW_LOD0
uniform mat4 u_sunShadowMatrixLOD04f;
#define SUN_SHADOW_MAP_FRAC 1.0
#endif
#ifdef COMPILE_SUN_SHADOW_LOD1
uniform mat4 u_sunShadowMatrixLOD04f;
uniform mat4 u_sunShadowMatrixLOD14f;
#define SUN_SHADOW_MAP_FRAC 0.5
#endif
#ifdef COMPILE_SUN_SHADOW_LOD2
uniform mat4 u_sunShadowMatrixLOD04f;
uniform mat4 u_sunShadowMatrixLOD14f;
uniform mat4 u_sunShadowMatrixLOD24f;
#define SUN_SHADOW_MAP_FRAC 0.3333333
#endif
#EAGLER INCLUDE (4) "eagler:glsl/deferred/lib/branchless_comparison.glsl"
const vec2 POISSON_DISK[4] = vec2[](
vec2(0.998, -0.0438),
vec2(-0.345, -0.933),
vec2(-0.996, 0.046),
vec2(0.230, 0.960));
#define SMOOTH_SHADOW_SAMPLES (1.0 / 5.0)
#define SMOOTH_SHADOW_RADIUS 0.000488
#define SCATTER_POISSON_SAMPLE(idx, tex, lod, vec3Pos, accum, tmpVec2)\
tmpVec2 = vec3Pos.xy + POISSON_DISK[idx] * SMOOTH_SHADOW_RADIUS;\
tmpVec2 = clamp(tmpVec2, vec2(0.001), vec2(0.999));\
tmpVec2.y += lod;\
tmpVec2.y *= SUN_SHADOW_MAP_FRAC;\
accum += scatterSampleInterpolated(tex, vec3(tmpVec2, vec3Pos.z));
#define SUN_SHADOW_DEPTH_SIZE_2F vec2(SUN_SHADOW_DEPTH_SIZE_2F_X, SUN_SHADOW_DEPTH_SIZE_2F_Y)
#define SUN_SHADOW_DEPTH_SIZE_2F_INV vec2((1.0 / SUN_SHADOW_DEPTH_SIZE_2F_X), (1.0 / SUN_SHADOW_DEPTH_SIZE_2F_Y))
uniform vec3 u_sunDirection3f;
#define SCATTER_SAMPLE(tex, vec2Pos, comp) max(textureLod(tex, (vec2Pos), 0.0).r - comp, 0.0)
float scatterSampleInterpolated(in sampler2D texIn, in vec3 vec3Pos) {
vec2 icoord2f = vec3Pos.xy * SUN_SHADOW_DEPTH_SIZE_2F;
vec2 floor2fTmp = floor(icoord2f);
vec2 ceil2fTmp = ceil(icoord2f);
vec2 ret1 = vec2( // top two samples
SCATTER_SAMPLE(texIn, (floor2fTmp + 0.5) * SUN_SHADOW_DEPTH_SIZE_2F_INV, vec3Pos.z),
SCATTER_SAMPLE(texIn, (vec2(ceil2fTmp.x, floor2fTmp.y) + 0.5) * SUN_SHADOW_DEPTH_SIZE_2F_INV, vec3Pos.z)
);
vec2 ret2 = vec2( // bottom two samples
SCATTER_SAMPLE(texIn, (vec2(floor2fTmp.x, ceil2fTmp.y) + 0.5) * SUN_SHADOW_DEPTH_SIZE_2F_INV, vec3Pos.z),
SCATTER_SAMPLE(texIn, (ceil2fTmp + 0.5) * SUN_SHADOW_DEPTH_SIZE_2F_INV, vec3Pos.z)
);
vec2 factors = icoord2f - floor2fTmp;
vec2 cunt = vec2(1.0 - factors.x, factors.x);
ret1 = ret1 * cunt * (1.0 - factors.y) + ret2 * cunt * factors.y;
return (ret1.x + ret1.y) * 0.25;
}
void main() {
output1f = 0.0;
float depth = textureLod(u_gbufferDepthTexture, v_position2f, 0.0).r;
if(depth == 0.0) {
return;
}
float material1f = textureLod(u_gbufferMaterialTexture, v_position2f, 0.0).a;
material1f = 2.0 * material1f - COMPARE_GT_0_1(material1f, 0.5);
if(material1f < 0.05) {
return;
}
vec4 normalVector4f = textureLod(u_gbufferNormalTexture, v_position2f, 0.0);
if(normalVector4f.a < 0.5) {
return;
}
normalVector4f.xyz *= 2.0;
normalVector4f.xyz -= 1.0;
vec3 worldSpaceNormal = normalize(mat3(u_inverseViewMatrix4f) * normalVector4f.xyz);
vec4 worldSpacePosition = vec4(v_position2f, depth, 1.0);
worldSpacePosition.xyz *= 2.0;
worldSpacePosition.xyz -= 1.0;
worldSpacePosition = u_inverseViewProjMatrix4f * worldSpacePosition;
worldSpacePosition.xyz /= worldSpacePosition.w;
worldSpacePosition.xyz += worldSpaceNormal * 0.05;
worldSpacePosition.w = 1.0;
float shadowSample;
vec2 tmpVec2;
vec4 shadowSpacePosition;
for(;;) {
shadowSpacePosition = u_sunShadowMatrixLOD04f * worldSpacePosition;
if(shadowSpacePosition.xyz == clamp(shadowSpacePosition.xyz, vec3(0.005), vec3(0.995))) {
shadowSample = scatterSampleInterpolated(u_sunShadowDepthTexture, vec3(shadowSpacePosition.xy * vec2(1.0, SUN_SHADOW_MAP_FRAC), shadowSpacePosition.z));
SCATTER_POISSON_SAMPLE(0, u_sunShadowDepthTexture, 0.0, shadowSpacePosition.xyz, shadowSample, tmpVec2)
SCATTER_POISSON_SAMPLE(1, u_sunShadowDepthTexture, 0.0, shadowSpacePosition.xyz, shadowSample, tmpVec2)
SCATTER_POISSON_SAMPLE(2, u_sunShadowDepthTexture, 0.0, shadowSpacePosition.xyz, shadowSample, tmpVec2)
SCATTER_POISSON_SAMPLE(3, u_sunShadowDepthTexture, 0.0, shadowSpacePosition.xyz, shadowSample, tmpVec2)
shadowSample *= SMOOTH_SHADOW_SAMPLES;
break;
}
#if defined(COMPILE_SUN_SHADOW_LOD1) || defined(COMPILE_SUN_SHADOW_LOD2)
shadowSpacePosition = u_sunShadowMatrixLOD14f * worldSpacePosition;
if(shadowSpacePosition.xyz == clamp(shadowSpacePosition.xyz, vec3(0.005), vec3(0.995))) {
shadowSpacePosition.y += 1.0;
shadowSpacePosition.y *= SUN_SHADOW_MAP_FRAC;
shadowSample = scatterSampleInterpolated(u_sunShadowDepthTexture, vec3(shadowSpacePosition.xy, shadowSpacePosition.z + 0.00015));
break;
}
#endif
#ifdef COMPILE_SUN_SHADOW_LOD2
shadowSpacePosition = u_sunShadowMatrixLOD24f * worldSpacePosition;
if(shadowSpacePosition.xyz == clamp(shadowSpacePosition.xyz, vec3(0.005), vec3(0.995))) {
shadowSpacePosition.y += 2.0;
shadowSpacePosition.y *= SUN_SHADOW_MAP_FRAC;
shadowSample = scatterSampleInterpolated(u_sunShadowDepthTexture, vec3(shadowSpacePosition.xy, shadowSpacePosition.z + 0.00015));
break;
}
#endif
output1f = normalVector4f.a * min(material1f, 0.5);
return;
}
material1f = (1.0 - material1f) * 512.0;
output1f = max(1.0 - shadowSample * material1f, 0.0);
}

View File

@ -247,6 +247,13 @@ eaglercraft.shaders.gui.option.POST_FXAA.desc.2=This is the preferred antialiasi
eaglercraft.shaders.gui.option.POST_FXAA.desc.4=ON: enable fxaa (slower)
eaglercraft.shaders.gui.option.POST_FXAA.desc.5=OFF: disable fxaa (faster)
eaglercraft.shaders.gui.option.SUBSURFACE_SCATTERING.label=S.S. Scattering
eaglercraft.shaders.gui.option.SUBSURFACE_SCATTERING.desc.0=Applies subsurface scattering to sunlight calculations, requires shadows to be enabled!
eaglercraft.shaders.gui.option.SUBSURFACE_SCATTERING.desc.2=This effect is mainly used on grass and leaf blocks to make them look more realistic in sunlight, however it is not a perfect model of reality
eaglercraft.shaders.gui.option.SUBSURFACE_SCATTERING.desc.4=ON: enable subsurf scattering (slower)
eaglercraft.shaders.gui.option.SUBSURFACE_SCATTERING.desc.5=OFF: disable subsurf scattering (faster)
eaglercraft.shaders.gui.unsupported.title=Shaders are unavailable on this device!
eaglercraft.shaders.gui.unsupported.reason.hdrFramebuffer=Reason: No HDR render target support
eaglercraft.shaders.gui.unsupported.reason.oldOpenGLVersion=Reason: OpenGL ES 3.0 (WebGL 2.0) is not supported!

View File

@ -1845,9 +1845,6 @@ public class Minecraft implements IThreadListener {
public void launchIntegratedServer(String folderName, String worldName, WorldSettings worldSettingsIn) {
this.loadWorld((WorldClient) null);
renderManager.setEnableFNAWSkins(this.gameSettings.enableFNAWSkins);
session.reset();
EaglerProfile.clearServerSkinOverride();
PauseMenuCustomizeState.reset();
SingleplayerServerController.launchEaglercraftServer(folderName, gameSettings.difficulty.getDifficultyId(),
Math.max(gameSettings.renderDistanceChunks, 2), worldSettingsIn);
EagRuntime.setMCServerWindowGlobal("singleplayer");
@ -1880,6 +1877,7 @@ public class Minecraft implements IThreadListener {
EaglerProfile.clearServerSkinOverride();
PauseMenuCustomizeState.reset();
ClientUUIDLoadingCache.flushRequestCache();
ClientUUIDLoadingCache.resetFlags();
WebViewOverlayController.setPacketSendCallback(null);
this.guiAchievement.clearAchievements();

View File

@ -2,6 +2,8 @@ package net.minecraft.client.gui;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
import static net.lax1dude.eaglercraft.v1_8.internal.PlatformOpenGL.*;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
@ -25,6 +27,7 @@ import net.lax1dude.eaglercraft.v1_8.crypto.SHA1Digest;
import net.lax1dude.eaglercraft.v1_8.internal.EnumCursorType;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.lax1dude.eaglercraft.v1_8.minecraft.MainMenuSkyboxTexture;
import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.WorldRenderer;
@ -40,7 +43,6 @@ import net.lax1dude.eaglercraft.v1_8.update.UpdateService;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.texture.DynamicTexture;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.MathHelper;
@ -82,7 +84,8 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback {
* Texture allocated for the current viewport of the main menu's
* panorama background.
*/
private static DynamicTexture viewportTexture = null;
private static MainMenuSkyboxTexture viewportTexture = null;
private static MainMenuSkyboxTexture viewportTexture2 = null;
private boolean field_175375_v = true;
private String openGLWarning1;
private String openGLWarning2;
@ -109,6 +112,7 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback {
private int field_92020_v;
private int field_92019_w;
private static ResourceLocation backgroundTexture = null;
private static ResourceLocation backgroundTexture2 = null;
private GuiUpdateCheckerOverlay updateCheckerOverlay;
private GuiButton downloadOfflineButton;
private boolean enableBlur = true;
@ -252,8 +256,10 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback {
*/
public void initGui() {
if (viewportTexture == null) {
viewportTexture = new DynamicTexture(256, 256);
viewportTexture = new MainMenuSkyboxTexture(256, 256);
backgroundTexture = this.mc.getTextureManager().getDynamicTextureLocation("background", viewportTexture);
viewportTexture2 = new MainMenuSkyboxTexture(256, 256);
backgroundTexture2 = this.mc.getTextureManager().getDynamicTextureLocation("background", viewportTexture2);
}
this.updateCheckerOverlay.setResolution(mc, width, height);
Calendar calendar = Calendar.getInstance();
@ -429,7 +435,7 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback {
GlStateManager.disableCull();
GlStateManager.depthMask(false);
GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0);
byte b0 = enableBlur ? (byte) 8 : (byte) 1;
byte b0 = enableBlur ? (byte) 4 : (byte) 1;
for (int i = 0; i < b0 * b0; ++i) {
GlStateManager.pushMatrix();
@ -494,10 +500,9 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback {
* Rotate and blurs the skybox view in the main menu
*/
private void rotateAndBlurSkybox(float parFloat1) {
this.mc.getTextureManager().bindTexture(backgroundTexture);
EaglercraftGPU.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
EaglercraftGPU.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
EaglercraftGPU.glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256);
// EaglercraftGPU.glCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256);
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GlStateManager.colorMask(true, true, true, false);
@ -531,15 +536,42 @@ public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback {
* Renders the skybox in the main menu
*/
private void renderSkybox(int parInt1, int parInt2, float parFloat1) {
viewportTexture.bindFramebuffer();
GlStateManager.viewport(0, 0, 256, 256);
GlStateManager.clearColor(0.0f, 0.0f, 0.0f, 1.0f);
GlStateManager.clear(GL_COLOR_BUFFER_BIT);
this.drawPanorama(parInt1, parInt2, parFloat1);
viewportTexture2.bindFramebuffer();
GlStateManager.clearColor(0.0f, 0.0f, 0.0f, 1.0f);
GlStateManager.clear(GL_COLOR_BUFFER_BIT);
this.mc.getTextureManager().bindTexture(backgroundTexture);
this.rotateAndBlurSkybox(parFloat1);
viewportTexture.bindFramebuffer();
this.mc.getTextureManager().bindTexture(backgroundTexture2);
this.rotateAndBlurSkybox(parFloat1);
viewportTexture2.bindFramebuffer();
this.mc.getTextureManager().bindTexture(backgroundTexture);
this.rotateAndBlurSkybox(parFloat1);
viewportTexture.bindFramebuffer();
this.mc.getTextureManager().bindTexture(backgroundTexture2);
this.rotateAndBlurSkybox(parFloat1);
viewportTexture2.bindFramebuffer();
this.mc.getTextureManager().bindTexture(backgroundTexture);
this.rotateAndBlurSkybox(parFloat1);
viewportTexture.bindFramebuffer();
this.mc.getTextureManager().bindTexture(backgroundTexture2);
this.rotateAndBlurSkybox(parFloat1);
this.rotateAndBlurSkybox(parFloat1);
// Notch fucked up, the last iteration is not necessary, in the vanilla renderer
// it is unintentionally discarded and the previous iteration is used
// viewportTexture2.bindFramebuffer();
// this.mc.getTextureManager().bindTexture(backgroundTexture);
// this.rotateAndBlurSkybox(parFloat1);
_wglBindFramebuffer(0x8D40, null);
this.mc.getTextureManager().bindTexture(backgroundTexture);
GlStateManager.viewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
float f = this.width > this.height ? 120.0F / (float) this.width : 120.0F / (float) this.height;
float f1 = (float) this.height * f / 256.0F;

View File

@ -459,7 +459,7 @@ public class GuiMultiplayer extends GuiScreen implements GuiYesNoCallback {
}
public boolean func_175394_b(ServerListEntryNormal parServerListEntryNormal, int parInt1) {
return parInt1 < this.savedServerList.countServers();
return parInt1 < this.savedServerList.countServers() - 1;
}
public void func_175391_a(ServerListEntryNormal parServerListEntryNormal, int parInt1, boolean parFlag) {

View File

@ -3,7 +3,6 @@ package net.minecraft.client.model;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.boss.EntityDragon;
@ -187,7 +186,7 @@ public class ModelDragon extends ModelBase {
this.body.rotateAngleZ = 0.0F;
this.body.render(f);
boolean flag = DeferredStateManager.isEnableShadowRender();
// boolean flag = DeferredStateManager.isEnableShadowRender();
for (int j = 0; j < 2; ++j) {
GlStateManager.enableCull();
float f12 = f1 * 3.1415927F * 2.0F;
@ -206,12 +205,14 @@ public class ModelDragon extends ModelBase {
this.rearLeg.render(f);
GlStateManager.scale(-1.0F, 1.0F, 1.0F);
if (j == 0) {
GlStateManager.cullFace(flag ? GL_BACK : GL_FRONT);
// GlStateManager.cullFace(flag ? GL_BACK : GL_FRONT);
GlStateManager.cullFace(GL_FRONT);
}
}
GlStateManager.popMatrix();
GlStateManager.cullFace(flag ? GL_FRONT : GL_BACK);
// GlStateManager.cullFace(flag ? GL_FRONT : GL_BACK);
GlStateManager.cullFace(GL_BACK);
GlStateManager.disableCull();
float f11 = -((float) Math.sin((double) (f1 * 3.1415927F * 2.0F))) * 0.0F;
f9 = f1 * 3.1415927F * 2.0F;

View File

@ -164,6 +164,8 @@ public class GuiConnecting extends GuiScreen {
if (ConnectionHandshake.attemptHandshake(this.mc, webSocket, this, previousGuiScreen,
currentPassword, allowPlaintext, allowCookies, cookieData)) {
logger.info("Handshake Success");
webSocket.setEnableStringFrames(false);
webSocket.clearStringFrames();
this.networkManager = new WebSocketNetworkManager(webSocket);
this.networkManager.setPluginInfo(ConnectionHandshake.pluginBrand,
ConnectionHandshake.pluginVersion);

View File

@ -1835,7 +1835,7 @@ public class EntityRenderer implements IResourceManagerReloadListener {
GlStateManager.setFogStart(f1 * 0.25F);
GlStateManager.setFogEnd(f1);
}
EaglercraftGPU.glFogi('\u855a', '\u855b');
// EaglercraftGPU.glFogi('\u855a', '\u855b');
} else if (this.cloudFog) {
GlStateManager.setFog(GL_EXP);
GlStateManager.setFogDensity(0.1F);
@ -1865,8 +1865,6 @@ public class EntityRenderer implements IResourceManagerReloadListener {
GlStateManager.setFogEnd(f);
}
EaglercraftGPU.glFogi('\u855a', '\u855b');
if (this.mc.theWorld.provider.doesXZShowFog((int) entity.posX, (int) entity.posZ)) {
GlStateManager.setFogStart(f * 0.05F);
GlStateManager.setFogEnd(Math.min(f, 192.0F) * 0.5F);

View File

@ -140,6 +140,10 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
private List<RenderGlobal.ContainerLocalRenderInformation> renderInfos = Lists.newArrayListWithCapacity(69696);
private final Set<TileEntity> field_181024_n = Sets.newHashSet();
private ViewFrustum viewFrustum;
private int glSunList = -1;
private int moonPhase = -1;
private int glMoonList = -1;
private int glHorizonList = -1;
/**+
* The star GL Call list
*/
@ -204,6 +208,8 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
this.renderContainer = new RenderList();
this.renderChunkFactory = new ListChunkFactory();
this.cloudRenderer = new EaglerCloudRenderer(mcIn);
this.generateSun();
this.generateHorizon();
this.generateStars();
this.generateSky();
this.generateSky2();
@ -238,6 +244,92 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
return false;
}
private void generateSun() {
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
if (this.glSunList >= 0) {
GLAllocation.deleteDisplayLists(this.glSunList);
this.glSunList = -1;
}
this.glSunList = GLAllocation.generateDisplayLists();
EaglercraftGPU.glNewList(this.glSunList, GL_COMPILE);
float f17 = 30.0F;
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos((double) (-f17), 100.0D, (double) (-f17)).tex(0.0D, 0.0D).endVertex();
worldrenderer.pos((double) f17, 100.0D, (double) (-f17)).tex(1.0D, 0.0D).endVertex();
worldrenderer.pos((double) f17, 100.0D, (double) f17).tex(1.0D, 1.0D).endVertex();
worldrenderer.pos((double) (-f17), 100.0D, (double) f17).tex(0.0D, 1.0D).endVertex();
tessellator.draw();
EaglercraftGPU.glEndList();
}
private int getMoonList(int phase) {
if (phase != moonPhase) {
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
if (glMoonList == -1) {
glMoonList = GLAllocation.generateDisplayLists();
}
EaglercraftGPU.glNewList(this.glMoonList, GL_COMPILE);
float f17 = 20.0F;
int j = phase % 4;
int l = phase / 4 % 2;
float f22 = (float) (j + 0) / 4.0F;
float f23 = (float) (l + 0) / 2.0F;
float f24 = (float) (j + 1) / 4.0F;
float f14 = (float) (l + 1) / 2.0F;
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos((double) (-f17), -100.0D, (double) f17).tex((double) f24, (double) f14).endVertex();
worldrenderer.pos((double) f17, -100.0D, (double) f17).tex((double) f22, (double) f14).endVertex();
worldrenderer.pos((double) f17, -100.0D, (double) (-f17)).tex((double) f22, (double) f23).endVertex();
worldrenderer.pos((double) (-f17), -100.0D, (double) (-f17)).tex((double) f24, (double) f23).endVertex();
tessellator.draw();
EaglercraftGPU.glEndList();
moonPhase = phase;
}
return glMoonList;
}
private void generateHorizon() {
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
if (this.glHorizonList >= 0) {
GLAllocation.deleteDisplayLists(this.glHorizonList);
this.glHorizonList = -1;
}
this.glHorizonList = GLAllocation.generateDisplayLists();
EaglercraftGPU.glNewList(this.glHorizonList, GL_COMPILE);
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
worldrenderer.pos(-1.0D, 0.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, 0.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(-1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(-1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, 0.0D, -1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(-1.0D, 0.0D, -1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, 0.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, 0.0D, -1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(-1.0D, 0.0D, -1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(-1.0D, 0.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(-1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(-1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(-1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(-1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex();
tessellator.draw();
EaglercraftGPU.glEndList();
}
private void generateSky2() {
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
@ -411,6 +503,7 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
if (theWorld.provider.getHasNoSky()) {
dfc.is_rendering_shadowsSun_clamped = 0;
dfc.is_rendering_lightShafts = false;
dfc.is_rendering_subsurfaceScattering = false;
} else {
int maxDist = renderDistanceChunks << 4;
int ss = dfc.is_rendering_shadowsSun;
@ -418,7 +511,9 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
--ss;
}
dfc.is_rendering_shadowsSun_clamped = ss;
dfc.is_rendering_lightShafts = dfc.lightShafts;
dfc.is_rendering_lightShafts = ss > 0 && dfc.lightShafts && dfc.shaderPackInfo.LIGHT_SHAFTS;
dfc.is_rendering_subsurfaceScattering = ss > 0 && dfc.subsurfaceScattering
&& dfc.shaderPackInfo.SUBSURFACE_SCATTERING;
}
boolean flag = false;
if (EaglerDeferredPipeline.instance == null) {
@ -1334,29 +1429,10 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F);
CustomSky.renderSky(this.theWorld, this.renderEngine, partialTicks);
GlStateManager.rotate(this.theWorld.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F);
float f17 = 30.0F;
this.renderEngine.bindTexture(locationSunPng);
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos((double) (-f17), 100.0D, (double) (-f17)).tex(0.0D, 0.0D).endVertex();
worldrenderer.pos((double) f17, 100.0D, (double) (-f17)).tex(1.0D, 0.0D).endVertex();
worldrenderer.pos((double) f17, 100.0D, (double) f17).tex(1.0D, 1.0D).endVertex();
worldrenderer.pos((double) (-f17), 100.0D, (double) f17).tex(0.0D, 1.0D).endVertex();
tessellator.draw();
f17 = 20.0F;
GlStateManager.callList(glSunList);
this.renderEngine.bindTexture(locationMoonPhasesPng);
int i = this.theWorld.getMoonPhase();
int j = i % 4;
int l = i / 4 % 2;
float f22 = (float) (j + 0) / 4.0F;
float f23 = (float) (l + 0) / 2.0F;
float f24 = (float) (j + 1) / 4.0F;
float f14 = (float) (l + 1) / 2.0F;
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos((double) (-f17), -100.0D, (double) f17).tex((double) f24, (double) f14).endVertex();
worldrenderer.pos((double) f17, -100.0D, (double) f17).tex((double) f22, (double) f14).endVertex();
worldrenderer.pos((double) f17, -100.0D, (double) (-f17)).tex((double) f22, (double) f23).endVertex();
worldrenderer.pos((double) (-f17), -100.0D, (double) (-f17)).tex((double) f24, (double) f23).endVertex();
tessellator.draw();
GlStateManager.callList(getMoonList(this.theWorld.getMoonPhase()));
GlStateManager.disableTexture2D();
float f15 = this.theWorld.getStarBrightness(partialTicks) * f16;
boolean b = !CustomSky.hasSkyLayers(this.theWorld);
@ -1379,31 +1455,13 @@ public class RenderGlobal implements IWorldAccess, IResourceManagerReloadListene
GlStateManager.callList(this.glSkyList2);
GlStateManager.popMatrix();
float f18 = 1.0F;
float f19 = -((float) (d0 + 65.0D));
float f20 = -1.0F;
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
worldrenderer.pos(-1.0D, (double) f19, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, (double) f19, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(-1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(-1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, (double) f19, -1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(-1.0D, (double) f19, -1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, (double) f19, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, (double) f19, -1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(-1.0D, (double) f19, -1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(-1.0D, (double) f19, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(-1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(-1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(-1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(-1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, -1.0D, 1.0D).color(0, 0, 0, 255).endVertex();
worldrenderer.pos(1.0D, -1.0D, -1.0D).color(0, 0, 0, 255).endVertex();
tessellator.draw();
GlStateManager.pushMatrix();
GlStateManager.translate(0.0F, f19, 0.0F);
GlStateManager.scale(1.0f, 1.0f - f19, 1.0f);
GlStateManager.callList(this.glHorizonList);
GlStateManager.popMatrix();
}
if (this.theWorld.provider.isSkyColored()) {

View File

@ -57,6 +57,11 @@ public class Tessellator {
WorldVertexBufferUploader.func_181679_a(this.worldRenderer);
}
public void uploadDisplayList(int displayList) {
this.worldRenderer.finishDrawing();
WorldVertexBufferUploader.uploadDisplayList(displayList, this.worldRenderer);
}
public WorldRenderer getWorldRenderer() {
return this.worldRenderer;
}

View File

@ -386,13 +386,15 @@ public class RenderItem implements IResourceManagerReloadListener {
GlStateManager.pushMatrix();
ItemCameraTransforms itemcameratransforms = model.getItemCameraTransforms();
itemcameratransforms.applyTransform(cameraTransformType);
boolean flag = DeferredStateManager.isEnableShadowRender();
// boolean flag = DeferredStateManager.isEnableShadowRender();
if (this.func_183005_a(itemcameratransforms.getTransform(cameraTransformType))) {
GlStateManager.cullFace(flag ? GL_BACK : GL_FRONT);
// GlStateManager.cullFace(flag ? GL_BACK : GL_FRONT);
GlStateManager.cullFace(GL_FRONT);
}
this.renderItem(stack, model);
GlStateManager.cullFace(flag ? GL_FRONT : GL_BACK);
// GlStateManager.cullFace(flag ? GL_FRONT : GL_BACK);
GlStateManager.cullFace(GL_BACK);
GlStateManager.popMatrix();
GlStateManager.disableRescaleNormal();
GlStateManager.disableBlend();

View File

@ -3,7 +3,6 @@ package net.minecraft.client.renderer.entity.layers;
import static net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums.*;
import net.lax1dude.eaglercraft.v1_8.opengl.GlStateManager;
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.DeferredStateManager;
import net.minecraft.client.Minecraft;
import net.minecraft.client.model.ModelQuadruped;
import net.minecraft.client.renderer.BlockRendererDispatcher;
@ -45,8 +44,9 @@ public class LayerMooshroomMushroom implements LayerRenderer<EntityMooshroom> {
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
this.mooshroomRenderer.bindTexture(TextureMap.locationBlocksTexture);
GlStateManager.enableCull();
boolean flag = DeferredStateManager.isEnableShadowRender();
GlStateManager.cullFace(flag ? GL_BACK : GL_FRONT);
// boolean flag = DeferredStateManager.isEnableShadowRender();
// GlStateManager.cullFace(flag ? GL_BACK : GL_FRONT);
GlStateManager.cullFace(GL_FRONT);
GlStateManager.pushMatrix();
GlStateManager.scale(1.0F, -1.0F, 1.0F);
GlStateManager.translate(0.2F, 0.35F, 0.5F);
@ -70,7 +70,8 @@ public class LayerMooshroomMushroom implements LayerRenderer<EntityMooshroom> {
GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(Blocks.red_mushroom.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.cullFace(flag ? GL_FRONT : GL_BACK);
// GlStateManager.cullFace(flag ? GL_FRONT : GL_BACK);
GlStateManager.cullFace(GL_BACK);
GlStateManager.disableCull();
}
}

View File

@ -132,7 +132,7 @@ public class TextureManager implements ITickable, IResourceManagerReloadListener
}
}
public ResourceLocation getDynamicTextureLocation(String name, DynamicTexture texture) {
public ResourceLocation getDynamicTextureLocation(String name, ITextureObject texture) {
int integer = this.mapTextureCounters.getOrDefault(name, 0) + 1;
this.mapTextureCounters.put(name, integer);
ResourceLocation resourcelocation = new ResourceLocation(

View File

@ -1364,7 +1364,7 @@ public class GameSettings {
}
this.mc.thePlayer.sendQueue.addToSendQueue(new C15PacketClientSettings(this.language,
Math.max(this.renderDistanceChunks, 2), this.chatVisibility, this.chatColours, i));
Math.max(this.renderDistanceChunks, 3), this.chatVisibility, this.chatColours, i));
}
}

View File

@ -77,7 +77,7 @@ import net.minecraft.world.WorldServer;
*/
public abstract class Entity implements ICommandSender {
private static final AxisAlignedBB ZERO_AABB = new AxisAlignedBB(0.0D, 0.0D, 0.0D, 0.0D, 0.0D, 0.0D);
private static int nextEntityID;
private static int nextEntityID = 1;
private int entityId;
public double renderDistanceWeight;
public boolean preventEntitySpawning;
@ -2151,12 +2151,12 @@ public abstract class Entity implements ICommandSender {
return Entity.this.getName();
}
});
category.addCrashSection("Entity\'s Exact location", String.format("%.2f, %.2f, %.2f",
category.addCrashSection("Entity\'s Exact location", HString.format("%.2f, %.2f, %.2f",
new Object[] { Double.valueOf(this.posX), Double.valueOf(this.posY), Double.valueOf(this.posZ) }));
category.addCrashSection("Entity\'s Block location",
CrashReportCategory.getCoordinateInfo((double) MathHelper.floor_double(this.posX),
(double) MathHelper.floor_double(this.posY), (double) MathHelper.floor_double(this.posZ)));
category.addCrashSection("Entity\'s Momentum", String.format("%.2f, %.2f, %.2f", new Object[] {
category.addCrashSection("Entity\'s Momentum", HString.format("%.2f, %.2f, %.2f", new Object[] {
Double.valueOf(this.motionX), Double.valueOf(this.motionY), Double.valueOf(this.motionZ) }));
category.addCrashSectionCallable("Entity\'s Rider", new Callable<String>() {
public String call() throws Exception {

View File

@ -1636,7 +1636,7 @@ public abstract class EntityPlayer extends EntityLivingBase implements ICommandS
}
EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo) EntityList.entityEggs
.get(Integer.valueOf(EntityList.getEntityID(entitylivingbase)));
.get(EntityList.getEntityID(entitylivingbase));
if (entitylist$entityegginfo != null) {
this.triggerAchievement(entitylist$entityegginfo.field_151512_d);
}

View File

@ -482,7 +482,7 @@ public class EntityPlayerMP extends EntityPlayer implements ICrafting {
EntityLivingBase entitylivingbase = this.func_94060_bK();
if (entitylivingbase != null) {
EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo) EntityList.entityEggs
.get(Integer.valueOf(EntityList.getEntityID(entitylivingbase)));
.get(EntityList.getEntityID(entitylivingbase));
if (entitylist$entityegginfo != null) {
this.triggerAchievement(entitylist$entityegginfo.field_151513_e);
}

View File

@ -2,6 +2,8 @@ package net.minecraft.item;
import java.util.List;
import com.carrotsearch.hppc.IntObjectHashMap;
import com.carrotsearch.hppc.SortedIterationIntObjectHashMap;
import com.carrotsearch.hppc.cursors.ObjectCursor;
import net.minecraft.block.BlockFence;
@ -64,7 +66,7 @@ public class ItemMonsterPlacer extends Item {
public int getColorFromItemStack(ItemStack itemstack, int i) {
EntityList.EntityEggInfo entitylist$entityegginfo = (EntityList.EntityEggInfo) EntityList.entityEggs
.get(Integer.valueOf(itemstack.getMetadata()));
.get(itemstack.getMetadata());
return entitylist$entityegginfo != null
? (i == 0 ? entitylist$entityegginfo.primaryColor : entitylist$entityegginfo.secondaryColor)
: 16777215;
@ -169,7 +171,7 @@ public class ItemMonsterPlacer extends Item {
* world, entityID, x, y, z.
*/
public static Entity spawnCreature(World worldIn, int entityID, double x, double y, double z) {
if (!EntityList.entityEggs.containsKey(Integer.valueOf(entityID))) {
if (!EntityList.entityEggs.containsKey(entityID)) {
return null;
} else {
Entity entity = null;
@ -198,7 +200,8 @@ public class ItemMonsterPlacer extends Item {
* (eg: dye returns 16 items)
*/
public void getSubItems(Item item, CreativeTabs var2, List<ItemStack> list) {
for (ObjectCursor<EntityList.EntityEggInfo> entitylist$entityegginfo : EntityList.entityEggs.values()) {
for (ObjectCursor<EntityList.EntityEggInfo> entitylist$entityegginfo : new SortedIterationIntObjectHashMap<>(
(IntObjectHashMap<EntityList.EntityEggInfo>) EntityList.entityEggs, (a, b) -> a - b).values()) {
list.add(new ItemStack(item, 1, entitylist$entityegginfo.value.spawnedID));
}

View File

@ -1,6 +1,8 @@
package net.minecraft.item;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
@ -8,9 +10,6 @@ import java.util.Set;
import com.carrotsearch.hppc.IntObjectHashMap;
import com.carrotsearch.hppc.IntObjectMap;
import com.carrotsearch.hppc.ObjectIntHashMap;
import com.carrotsearch.hppc.ObjectIntMap;
import com.carrotsearch.hppc.cursors.IntCursor;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Lists;
@ -57,7 +56,7 @@ public class ItemPotion extends Item {
* recalculating it).
*/
private IntObjectMap<List<PotionEffect>> effectCache = new IntObjectHashMap<>();
private static final ObjectIntMap<List<PotionEffect>> SUB_ITEMS_CACHE = new ObjectIntHashMap<>();
private static final Map<List<PotionEffect>, Integer> SUB_ITEMS_CACHE = new HashMap<>();
public ItemPotion() {
this.setMaxStackSize(1);
@ -340,15 +339,18 @@ public class ItemPotion extends Item {
List list = PotionHelper.getPotionEffects(i1, false);
if (list != null && !list.isEmpty()) {
SUB_ITEMS_CACHE.put(list, i1);
SUB_ITEMS_CACHE.put(list, Integer.valueOf(i1));
}
}
}
}
}
for (IntCursor cur : SUB_ITEMS_CACHE.values()) {
subItems.add(new ItemStack(itemIn, 1, cur.value));
Iterator iterator = SUB_ITEMS_CACHE.values().iterator();
while (iterator.hasNext()) {
int j1 = ((Integer) iterator.next()).intValue();
subItems.add(new ItemStack(itemIn, 1, j1));
}
}

View File

@ -1,6 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal;
/**
/*
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -15,6 +13,9 @@ package net.lax1dude.eaglercraft.v1_8.internal;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal;
class OpenGLObjects {
static class BufferGL implements IBufferGL {
@ -36,11 +37,11 @@ class OpenGLObjects {
}
static class BufferArrayGL implements IBufferArrayGL {
static class VertexArrayGL implements IVertexArrayGL {
final int ptr;
BufferArrayGL(int ptr) {
VertexArrayGL(int ptr) {
this.ptr = ptr;
}
@ -205,4 +206,4 @@ class OpenGLObjects {
}
}
}

View File

@ -1,3 +1,19 @@
/*
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal;
import static org.lwjgl.glfw.GLFW.*;
@ -33,21 +49,6 @@ import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.lax1dude.eaglercraft.v1_8.opengl.RealOpenGLEnums;
/**
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class PlatformApplication {
private static long win = 0l;
@ -331,4 +332,4 @@ public class PlatformApplication {
}
}
}

View File

@ -1,3 +1,19 @@
/*
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal;
import java.awt.image.BufferedImage;
@ -13,21 +29,6 @@ import javax.imageio.ImageIO;
import net.lax1dude.eaglercraft.v1_8.EaglerInputStream;
import net.lax1dude.eaglercraft.v1_8.opengl.ImageData;
/**
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class PlatformAssets {
static URL getDesktopResourceURL(String path) {
@ -98,4 +99,4 @@ public class PlatformAssets {
return loadImageFile(new EaglerInputStream(data), mime);
}
}
}

View File

@ -1,18 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal;
import java.net.URL;
import net.lax1dude.eaglercraft.v1_8.internal.paulscode.lwjgl3.LibraryLWJGLOpenAL;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.minecraft.util.MathHelper;
import paulscode.sound.SoundSystem;
import paulscode.sound.SoundSystemConfig;
import paulscode.sound.SoundSystemLogger;
import paulscode.sound.codecs.CodecJOrbis;
import paulscode.sound.codecs.CodecWav;
/**
/*
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -27,6 +13,21 @@ import paulscode.sound.codecs.CodecWav;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal;
import java.net.URL;
import net.lax1dude.eaglercraft.v1_8.internal.paulscode.lwjgl3.LibraryLWJGLOpenAL;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.minecraft.util.MathHelper;
import paulscode.sound.SoundSystem;
import paulscode.sound.SoundSystemConfig;
import paulscode.sound.SoundSystemLogger;
import paulscode.sound.codecs.CodecJOrbis;
import paulscode.sound.codecs.CodecWav;
public class PlatformAudio {
protected static class PaulscodeAudioResource implements IAudioResource {
@ -238,4 +239,4 @@ public class PlatformAudio {
// nope
}
}
}

View File

@ -1,14 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal;
import java.io.File;
import net.lax1dude.eaglercraft.v1_8.internal.lwjgl.DebugFilesystem;
import net.lax1dude.eaglercraft.v1_8.internal.lwjgl.JDBCFilesystem;
import net.lax1dude.eaglercraft.v1_8.internal.lwjgl.JDBCFilesystemConverter;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
/**
/*
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -23,6 +13,17 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal;
import java.io.File;
import net.lax1dude.eaglercraft.v1_8.internal.lwjgl.DebugFilesystem;
import net.lax1dude.eaglercraft.v1_8.internal.lwjgl.JDBCFilesystem;
import net.lax1dude.eaglercraft.v1_8.internal.lwjgl.JDBCFilesystemConverter;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
public class PlatformFilesystem {
public static final Logger logger = LogManager.getLogger("PlatformFilesystem");
@ -73,4 +74,4 @@ public class PlatformFilesystem {
}
}
}
}

View File

@ -1,3 +1,19 @@
/*
* Copyright (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal;
import static org.lwjgl.glfw.GLFW.*;
@ -14,21 +30,6 @@ import org.lwjgl.glfw.GLFWGamepadState;
import org.lwjgl.glfw.GLFWVidMode;
import org.lwjgl.system.MemoryStack;
/**
* Copyright (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class PlatformInput {
private static long win = 0l;
@ -896,4 +897,4 @@ public class PlatformInput {
return ret;
}
}
}

View File

@ -1,13 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal;
import java.net.URI;
import java.net.URISyntaxException;
import net.lax1dude.eaglercraft.v1_8.internal.lwjgl.DesktopWebSocketClient;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
/**
/*
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -22,6 +13,16 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal;
import java.net.URI;
import java.net.URISyntaxException;
import net.lax1dude.eaglercraft.v1_8.internal.lwjgl.DesktopWebSocketClient;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
public class PlatformNetworking {
private static final Logger logger = LogManager.getLogger("PlatformNetworking");
@ -42,4 +43,4 @@ public class PlatformNetworking {
return new DesktopWebSocketClient(uri);
}
}
}

View File

@ -1,3 +1,19 @@
/*
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal;
import net.lax1dude.eaglercraft.v1_8.internal.buffer.EaglerLWJGLAllocator;
@ -16,21 +32,6 @@ import java.util.List;
import org.lwjgl.opengles.GLESCapabilities;
/**
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class PlatformOpenGL {
private static int glesVers = -1;
@ -113,7 +114,7 @@ public class PlatformOpenGL {
}
}
public static final List<String> dumpActiveExtensions() {
public static List<String> dumpActiveExtensions() {
List<String> exts = new ArrayList<>();
if(hasANGLEInstancedArrays) exts.add("ANGLE_instanced_arrays");
if(hasEXTColorBufferFloat) exts.add("EXT_color_buffer_float");
@ -132,63 +133,63 @@ public class PlatformOpenGL {
return exts;
}
public static final void _wglEnable(int glEnum) {
public static void _wglEnable(int glEnum) {
glEnable(glEnum);
}
public static final void _wglDisable(int glEnum) {
public static void _wglDisable(int glEnum) {
glDisable(glEnum);
}
public static final void _wglClearColor(float r, float g, float b, float a) {
public static void _wglClearColor(float r, float g, float b, float a) {
glClearColor(r, g, b, a);
}
public static final void _wglClearDepth(float f) {
public static void _wglClearDepth(float f) {
glClearDepthf(f);
}
public static final void _wglClear(int bits) {
public static void _wglClear(int bits) {
glClear(bits);
}
public static final void _wglDepthFunc(int glEnum) {
public static void _wglDepthFunc(int glEnum) {
glDepthFunc(glEnum);
}
public static final void _wglDepthMask(boolean mask) {
public static void _wglDepthMask(boolean mask) {
glDepthMask(mask);
}
public static final void _wglCullFace(int glEnum) {
public static void _wglCullFace(int glEnum) {
glCullFace(glEnum);
}
public static final void _wglViewport(int x, int y, int w, int h) {
public static void _wglViewport(int x, int y, int w, int h) {
glViewport(x, y, w, h);
}
public static final void _wglBlendFunc(int src, int dst) {
public static void _wglBlendFunc(int src, int dst) {
glBlendFunc(src, dst);
}
public static final void _wglBlendFuncSeparate(int srcColor, int dstColor, int srcAlpha, int dstAlpha) {
public static void _wglBlendFuncSeparate(int srcColor, int dstColor, int srcAlpha, int dstAlpha) {
glBlendFuncSeparate(srcColor, dstColor, srcAlpha, dstAlpha);
}
public static final void _wglBlendEquation(int glEnum) {
public static void _wglBlendEquation(int glEnum) {
glBlendEquation(glEnum);
}
public static final void _wglBlendColor(float r, float g, float b, float a) {
public static void _wglBlendColor(float r, float g, float b, float a) {
glBlendColor(r, g, b, a);
}
public static final void _wglColorMask(boolean r, boolean g, boolean b, boolean a) {
public static void _wglColorMask(boolean r, boolean g, boolean b, boolean a) {
glColorMask(r, g, b, a);
}
public static final void _wglDrawBuffers(int buffer) {
public static void _wglDrawBuffers(int buffer) {
if(glesVers == 200) {
if(buffer != 0x8CE0) { // GL_COLOR_ATTACHMENT0
throw new UnsupportedOperationException();
@ -198,7 +199,7 @@ public class PlatformOpenGL {
}
}
public static final void _wglDrawBuffers(int[] buffers) {
public static void _wglDrawBuffers(int[] buffers) {
if(glesVers == 200) {
if(buffers.length != 1 || buffers[0] != 0x8CE0) { // GL_COLOR_ATTACHMENT0
throw new UnsupportedOperationException();
@ -208,83 +209,83 @@ public class PlatformOpenGL {
}
}
public static final void _wglReadBuffer(int buffer) {
public static void _wglReadBuffer(int buffer) {
glReadBuffer(buffer);
}
public static final void _wglReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer data) {
public static void _wglReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer data) {
nglReadPixels(x, y, width, height, format, type, EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglReadPixels_u16(int x, int y, int width, int height, int format, int type, ByteBuffer data) {
public static void _wglReadPixels_u16(int x, int y, int width, int height, int format, int type, ByteBuffer data) {
nglReadPixels(x, y, width, height, format, type, EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglReadPixels(int x, int y, int width, int height, int format, int type, IntBuffer data) {
public static void _wglReadPixels(int x, int y, int width, int height, int format, int type, IntBuffer data) {
nglReadPixels(x, y, width, height, format, type, EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglReadPixels(int x, int y, int width, int height, int format, int type, FloatBuffer data) {
public static void _wglReadPixels(int x, int y, int width, int height, int format, int type, FloatBuffer data) {
nglReadPixels(x, y, width, height, format, type, EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglPolygonOffset(float f1, float f2) {
public static void _wglPolygonOffset(float f1, float f2) {
glPolygonOffset(f1, f2);
}
public static final void _wglLineWidth(float width) {
public static void _wglLineWidth(float width) {
glLineWidth(width);
}
public static final IBufferGL _wglGenBuffers() {
public static IBufferGL _wglGenBuffers() {
return new OpenGLObjects.BufferGL(glGenBuffers());
}
public static final ITextureGL _wglGenTextures() {
public static ITextureGL _wglGenTextures() {
return new OpenGLObjects.TextureGL(glGenTextures());
}
public static final IBufferArrayGL _wglGenVertexArrays() {
public static IVertexArrayGL _wglGenVertexArrays() {
switch(vertexArrayImpl) {
case VAO_IMPL_CORE:
return new OpenGLObjects.BufferArrayGL(glGenVertexArrays());
return new OpenGLObjects.VertexArrayGL(glGenVertexArrays());
case VAO_IMPL_OES:
return new OpenGLObjects.BufferArrayGL(glGenVertexArraysOES());
return new OpenGLObjects.VertexArrayGL(glGenVertexArraysOES());
default:
throw new UnsupportedOperationException();
}
}
public static final IProgramGL _wglCreateProgram() {
public static IProgramGL _wglCreateProgram() {
return new OpenGLObjects.ProgramGL(glCreateProgram());
}
public static final IShaderGL _wglCreateShader(int type) {
public static IShaderGL _wglCreateShader(int type) {
return new OpenGLObjects.ShaderGL(glCreateShader(type));
}
public static final IFramebufferGL _wglCreateFramebuffer() {
public static IFramebufferGL _wglCreateFramebuffer() {
return new OpenGLObjects.FramebufferGL(glGenFramebuffers());
}
public static final IRenderbufferGL _wglCreateRenderbuffer() {
public static IRenderbufferGL _wglCreateRenderbuffer() {
return new OpenGLObjects.RenderbufferGL(glGenRenderbuffers());
}
public static final IQueryGL _wglGenQueries() {
public static IQueryGL _wglGenQueries() {
return new OpenGLObjects.QueryGL(glGenQueries());
}
public static final void _wglDeleteBuffers(IBufferGL obj) {
public static void _wglDeleteBuffers(IBufferGL obj) {
glDeleteBuffers(((OpenGLObjects.BufferGL) obj).ptr);
}
public static final void _wglDeleteTextures(ITextureGL obj) {
public static void _wglDeleteTextures(ITextureGL obj) {
glDeleteTextures(((OpenGLObjects.TextureGL) obj).ptr);
}
public static final void _wglDeleteVertexArrays(IBufferArrayGL obj) {
int ptr = ((OpenGLObjects.BufferArrayGL) obj).ptr;
public static void _wglDeleteVertexArrays(IVertexArrayGL obj) {
int ptr = ((OpenGLObjects.VertexArrayGL) obj).ptr;
switch(vertexArrayImpl) {
case VAO_IMPL_CORE:
glDeleteVertexArrays(ptr);
@ -297,66 +298,66 @@ public class PlatformOpenGL {
}
}
public static final void _wglDeleteProgram(IProgramGL obj) {
public static void _wglDeleteProgram(IProgramGL obj) {
glDeleteProgram(((OpenGLObjects.ProgramGL) obj).ptr);
}
public static final void _wglDeleteShader(IShaderGL obj) {
public static void _wglDeleteShader(IShaderGL obj) {
glDeleteShader(((OpenGLObjects.ShaderGL) obj).ptr);
}
public static final void _wglDeleteFramebuffer(IFramebufferGL obj) {
public static void _wglDeleteFramebuffer(IFramebufferGL obj) {
glDeleteFramebuffers(((OpenGLObjects.FramebufferGL) obj).ptr);
}
public static final void _wglDeleteRenderbuffer(IRenderbufferGL obj) {
public static void _wglDeleteRenderbuffer(IRenderbufferGL obj) {
glDeleteRenderbuffers(((OpenGLObjects.RenderbufferGL) obj).ptr);
}
public static final void _wglDeleteQueries(IQueryGL obj) {
public static void _wglDeleteQueries(IQueryGL obj) {
glDeleteQueries(((OpenGLObjects.QueryGL) obj).ptr);
}
public static final void _wglBindBuffer(int target, IBufferGL obj) {
public static void _wglBindBuffer(int target, IBufferGL obj) {
glBindBuffer(target, obj == null ? 0 : ((OpenGLObjects.BufferGL) obj).ptr);
}
public static final void _wglBufferData(int target, ByteBuffer data, int usage) {
public static void _wglBufferData(int target, ByteBuffer data, int usage) {
nglBufferData(target, data == null ? 0 : data.remaining(),
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data), usage);
}
public static final void _wglBufferData(int target, IntBuffer data, int usage) {
public static void _wglBufferData(int target, IntBuffer data, int usage) {
nglBufferData(target, data == null ? 0 : (data.remaining() << 2),
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data), usage);
}
public static final void _wglBufferData(int target, FloatBuffer data, int usage) {
public static void _wglBufferData(int target, FloatBuffer data, int usage) {
nglBufferData(target, data == null ? 0 : (data.remaining() << 2),
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data), usage);
}
public static final void _wglBufferData(int target, int size, int usage) {
public static void _wglBufferData(int target, int size, int usage) {
glBufferData(target, size, usage);
}
public static final void _wglBufferSubData(int target, int offset, ByteBuffer data) {
public static void _wglBufferSubData(int target, int offset, ByteBuffer data) {
nglBufferSubData(target, offset, data == null ? 0 : data.remaining(),
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglBufferSubData(int target, int offset, IntBuffer data) {
public static void _wglBufferSubData(int target, int offset, IntBuffer data) {
nglBufferSubData(target, offset, data == null ? 0 : (data.remaining() << 2),
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglBufferSubData(int target, int offset, FloatBuffer data) {
public static void _wglBufferSubData(int target, int offset, FloatBuffer data) {
nglBufferSubData(target, offset, data == null ? 0 : (data.remaining() << 2),
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglBindVertexArray(IBufferArrayGL obj) {
int ptr = obj == null ? 0 : ((OpenGLObjects.BufferArrayGL) obj).ptr;
public static void _wglBindVertexArray(IVertexArrayGL obj) {
int ptr = obj == null ? 0 : ((OpenGLObjects.VertexArrayGL) obj).ptr;
switch(vertexArrayImpl) {
case VAO_IMPL_CORE:
glBindVertexArray(ptr);
@ -369,20 +370,20 @@ public class PlatformOpenGL {
}
}
public static final void _wglEnableVertexAttribArray(int index) {
public static void _wglEnableVertexAttribArray(int index) {
glEnableVertexAttribArray(index);
}
public static final void _wglDisableVertexAttribArray(int index) {
public static void _wglDisableVertexAttribArray(int index) {
glDisableVertexAttribArray(index);
}
public static final void _wglVertexAttribPointer(int index, int size, int type, boolean normalized, int stride,
public static void _wglVertexAttribPointer(int index, int size, int type, boolean normalized, int stride,
int offset) {
glVertexAttribPointer(index, size, type, normalized, stride, offset);
}
public static final void _wglVertexAttribDivisor(int index, int divisor) {
public static void _wglVertexAttribDivisor(int index, int divisor) {
switch(instancingImpl) {
case INSTANCE_IMPL_CORE:
glVertexAttribDivisor(index, divisor);
@ -398,88 +399,88 @@ public class PlatformOpenGL {
}
}
public static final void _wglActiveTexture(int texture) {
public static void _wglActiveTexture(int texture) {
glActiveTexture(texture);
}
public static final void _wglBindTexture(int target, ITextureGL obj) {
public static void _wglBindTexture(int target, ITextureGL obj) {
glBindTexture(target, obj == null ? 0 : ((OpenGLObjects.TextureGL) obj).ptr);
}
public static final void _wglTexParameterf(int target, int param, float value) {
public static void _wglTexParameterf(int target, int param, float value) {
glTexParameterf(target, param, value);
}
public static final void _wglTexParameteri(int target, int param, int value) {
public static void _wglTexParameteri(int target, int param, int value) {
glTexParameteri(target, param, value);
}
public static final void _wglTexImage3D(int target, int level, int internalFormat, int width, int height, int depth,
public static void _wglTexImage3D(int target, int level, int internalFormat, int width, int height, int depth,
int border, int format, int type, ByteBuffer data) {
nglTexImage3D(target, level, internalFormat, width, height, depth, border, format, type,
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglTexImage2D(int target, int level, int internalFormat, int width, int height,
public static void _wglTexImage2D(int target, int level, int internalFormat, int width, int height,
int border, int format, int type, ByteBuffer data) {
nglTexImage2D(target, level, internalFormat, width, height, border, format, type,
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglTexImage2D(int target, int level, int internalFormat, int width, int height,
public static void _wglTexImage2D(int target, int level, int internalFormat, int width, int height,
int border, int format, int type, IntBuffer data) {
nglTexImage2D(target, level, internalFormat, width, height, border, format, type,
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglTexImage2Df32(int target, int level, int internalFormat, int width, int height,
public static void _wglTexImage2Df32(int target, int level, int internalFormat, int width, int height,
int border, int format, int type, FloatBuffer data) {
nglTexImage2D(target, level, internalFormat, width, height, border, format, type,
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglTexImage2Du16(int target, int level, int internalFormat, int width, int height,
public static void _wglTexImage2Du16(int target, int level, int internalFormat, int width, int height,
int border, int format, int type, ByteBuffer data) {
nglTexImage2D(target, level, internalFormat, width, height, border, format, type,
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglTexImage2Df32(int target, int level, int internalFormat, int width, int height,
public static void _wglTexImage2Df32(int target, int level, int internalFormat, int width, int height,
int border, int format, int type, ByteBuffer data) {
nglTexImage2D(target, level, internalFormat, width, height, border, format, type,
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height,
public static void _wglTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height,
int format, int type, ByteBuffer data) {
nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type,
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height,
public static void _wglTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height,
int format, int type, IntBuffer data) {
nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type,
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglTexSubImage2Df32(int target, int level, int xoffset, int yoffset, int width, int height,
public static void _wglTexSubImage2Df32(int target, int level, int xoffset, int yoffset, int width, int height,
int format, int type, FloatBuffer data) {
nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type,
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglTexSubImage2Du16(int target, int level, int xoffset, int yoffset, int width, int height,
public static void _wglTexSubImage2Du16(int target, int level, int xoffset, int yoffset, int width, int height,
int format, int type, ByteBuffer data) {
nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type,
data == null ? 0l : EaglerLWJGLAllocator.getAddress(data));
}
public static final void _wglCopyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x, int y,
public static void _wglCopyTexSubImage2D(int target, int level, int xoffset, int yoffset, int x, int y,
int width, int height) {
glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
}
public static final void _wglTexStorage2D(int target, int levels, int internalFormat, int w, int h) {
public static void _wglTexStorage2D(int target, int levels, int internalFormat, int w, int h) {
switch(texStorageImpl) {
case TEX_STORAGE_IMPL_CORE:
glTexStorage2D(target, levels, internalFormat, w, h);
@ -492,67 +493,67 @@ public class PlatformOpenGL {
}
}
public static final void _wglPixelStorei(int pname, int value) {
public static void _wglPixelStorei(int pname, int value) {
glPixelStorei(pname, value);
}
public static final void _wglGenerateMipmap(int target) {
public static void _wglGenerateMipmap(int target) {
glGenerateMipmap(target);
}
public static final void _wglShaderSource(IShaderGL obj, String source) {
public static void _wglShaderSource(IShaderGL obj, String source) {
glShaderSource(((OpenGLObjects.ShaderGL) obj).ptr, source);
}
public static final void _wglCompileShader(IShaderGL obj) {
public static void _wglCompileShader(IShaderGL obj) {
glCompileShader(((OpenGLObjects.ShaderGL) obj).ptr);
}
public static final int _wglGetShaderi(IShaderGL obj, int param) {
public static int _wglGetShaderi(IShaderGL obj, int param) {
return glGetShaderi(((OpenGLObjects.ShaderGL) obj).ptr, param);
}
public static final String _wglGetShaderInfoLog(IShaderGL obj) {
public static String _wglGetShaderInfoLog(IShaderGL obj) {
return glGetShaderInfoLog(((OpenGLObjects.ShaderGL) obj).ptr);
}
public static final void _wglUseProgram(IProgramGL obj) {
public static void _wglUseProgram(IProgramGL obj) {
glUseProgram(obj == null ? 0 : ((OpenGLObjects.ProgramGL) obj).ptr);
}
public static final void _wglAttachShader(IProgramGL obj, IShaderGL shader) {
public static void _wglAttachShader(IProgramGL obj, IShaderGL shader) {
glAttachShader(((OpenGLObjects.ProgramGL) obj).ptr, ((OpenGLObjects.ShaderGL) shader).ptr);
}
public static final void _wglDetachShader(IProgramGL obj, IShaderGL shader) {
public static void _wglDetachShader(IProgramGL obj, IShaderGL shader) {
glDetachShader(((OpenGLObjects.ProgramGL) obj).ptr, ((OpenGLObjects.ShaderGL) shader).ptr);
}
public static final void _wglLinkProgram(IProgramGL obj) {
public static void _wglLinkProgram(IProgramGL obj) {
glLinkProgram(((OpenGLObjects.ProgramGL) obj).ptr);
}
public static final int _wglGetProgrami(IProgramGL obj, int param) {
public static int _wglGetProgrami(IProgramGL obj, int param) {
return glGetProgrami(((OpenGLObjects.ProgramGL) obj).ptr, param);
}
public static final String _wglGetProgramInfoLog(IProgramGL obj) {
public static String _wglGetProgramInfoLog(IProgramGL obj) {
return glGetProgramInfoLog(((OpenGLObjects.ProgramGL) obj).ptr);
}
public static final void _wglBindAttribLocation(IProgramGL obj, int index, String name) {
public static void _wglBindAttribLocation(IProgramGL obj, int index, String name) {
glBindAttribLocation(((OpenGLObjects.ProgramGL) obj).ptr, index, name);
}
public static final int _wglGetAttribLocation(IProgramGL obj, String name) {
public static int _wglGetAttribLocation(IProgramGL obj, String name) {
return glGetAttribLocation(((OpenGLObjects.ProgramGL) obj).ptr, name);
}
public static final void _wglDrawArrays(int mode, int first, int count) {
public static void _wglDrawArrays(int mode, int first, int count) {
glDrawArrays(mode, first, count);
}
public static final void _wglDrawArraysInstanced(int mode, int first, int count, int instanced) {
public static void _wglDrawArraysInstanced(int mode, int first, int count, int instanced) {
switch(instancingImpl) {
case INSTANCE_IMPL_CORE:
glDrawArraysInstanced(mode, first, count, instanced);
@ -568,11 +569,11 @@ public class PlatformOpenGL {
}
}
public static final void _wglDrawElements(int mode, int count, int type, int offset) {
public static void _wglDrawElements(int mode, int count, int type, int offset) {
glDrawElements(mode, count, type, offset);
}
public static final void _wglDrawElementsInstanced(int mode, int count, int type, int offset, int instanced) {
public static void _wglDrawElementsInstanced(int mode, int count, int type, int offset, int instanced) {
switch(instancingImpl) {
case INSTANCE_IMPL_CORE:
glDrawElementsInstanced(mode, count, type, offset, instanced);
@ -588,49 +589,49 @@ public class PlatformOpenGL {
}
}
public static final IUniformGL _wglGetUniformLocation(IProgramGL obj, String name) {
public static IUniformGL _wglGetUniformLocation(IProgramGL obj, String name) {
int loc = glGetUniformLocation(((OpenGLObjects.ProgramGL) obj).ptr, name);
return loc < 0 ? null : new OpenGLObjects.UniformGL(loc);
}
public static final int _wglGetUniformBlockIndex(IProgramGL obj, String name) {
public static int _wglGetUniformBlockIndex(IProgramGL obj, String name) {
return glGetUniformBlockIndex(((OpenGLObjects.ProgramGL) obj).ptr, name);
}
public static final void _wglBindBufferRange(int target, int index, IBufferGL buffer, int offset, int size) {
public static void _wglBindBufferRange(int target, int index, IBufferGL buffer, int offset, int size) {
glBindBufferRange(target, index, ((OpenGLObjects.BufferGL) buffer).ptr, offset, size);
}
public static final void _wglUniformBlockBinding(IProgramGL obj, int blockIndex, int bufferIndex) {
public static void _wglUniformBlockBinding(IProgramGL obj, int blockIndex, int bufferIndex) {
glUniformBlockBinding(((OpenGLObjects.ProgramGL) obj).ptr, blockIndex, bufferIndex);
}
public static final void _wglUniform1f(IUniformGL obj, float x) {
public static void _wglUniform1f(IUniformGL obj, float x) {
if (obj != null)
glUniform1f(((OpenGLObjects.UniformGL) obj).ptr, x);
}
public static final void _wglUniform2f(IUniformGL obj, float x, float y) {
public static void _wglUniform2f(IUniformGL obj, float x, float y) {
if (obj != null)
glUniform2f(((OpenGLObjects.UniformGL) obj).ptr, x, y);
}
public static final void _wglUniform3f(IUniformGL obj, float x, float y, float z) {
public static void _wglUniform3f(IUniformGL obj, float x, float y, float z) {
if (obj != null)
glUniform3f(((OpenGLObjects.UniformGL) obj).ptr, x, y, z);
}
public static final void _wglUniform4f(IUniformGL obj, float x, float y, float z, float w) {
public static void _wglUniform4f(IUniformGL obj, float x, float y, float z, float w) {
if (obj != null)
glUniform4f(((OpenGLObjects.UniformGL) obj).ptr, x, y, z, w);
}
public static final void _wglUniform1i(IUniformGL obj, int x) {
public static void _wglUniform1i(IUniformGL obj, int x) {
if (obj != null)
glUniform1i(((OpenGLObjects.UniformGL) obj).ptr, x);
}
public static final void _wglUniform2i(IUniformGL obj, int x, int y) {
public static void _wglUniform2i(IUniformGL obj, int x, int y) {
if (obj != null)
glUniform2i(((OpenGLObjects.UniformGL) obj).ptr, x, y);
}
@ -640,48 +641,48 @@ public class PlatformOpenGL {
glUniform3i(((OpenGLObjects.UniformGL) obj).ptr, x, y, z);
}
public static final void _wglUniform4i(IUniformGL obj, int x, int y, int z, int w) {
public static void _wglUniform4i(IUniformGL obj, int x, int y, int z, int w) {
if (obj != null)
glUniform4i(((OpenGLObjects.UniformGL) obj).ptr, x, y, z, w);
}
public static final void _wglUniformMatrix2fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
public static void _wglUniformMatrix2fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
if (obj != null)
nglUniformMatrix2fv(((OpenGLObjects.UniformGL) obj).ptr, mat.remaining() >> 2, transpose,
EaglerLWJGLAllocator.getAddress(mat));
}
public static final void _wglUniformMatrix3fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
public static void _wglUniformMatrix3fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
if (obj != null)
nglUniformMatrix3fv(((OpenGLObjects.UniformGL) obj).ptr, mat.remaining() / 9, transpose,
EaglerLWJGLAllocator.getAddress(mat));
}
public static final void _wglUniformMatrix3x2fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
public static void _wglUniformMatrix3x2fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
if (obj != null)
nglUniformMatrix3x2fv(((OpenGLObjects.UniformGL) obj).ptr, mat.remaining() / 6, transpose,
EaglerLWJGLAllocator.getAddress(mat));
}
public static final void _wglUniformMatrix4fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
public static void _wglUniformMatrix4fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
if (obj != null)
nglUniformMatrix4fv(((OpenGLObjects.UniformGL) obj).ptr, mat.remaining() >> 4, transpose,
EaglerLWJGLAllocator.getAddress(mat));
}
public static final void _wglUniformMatrix4x2fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
public static void _wglUniformMatrix4x2fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
if (obj != null)
nglUniformMatrix4x2fv(((OpenGLObjects.UniformGL) obj).ptr, mat.remaining() >> 3, transpose,
EaglerLWJGLAllocator.getAddress(mat));
}
public static final void _wglUniformMatrix4x3fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
public static void _wglUniformMatrix4x3fv(IUniformGL obj, boolean transpose, FloatBuffer mat) {
if (obj != null)
nglUniformMatrix4x3fv(((OpenGLObjects.UniformGL) obj).ptr, mat.remaining() / 12, transpose,
EaglerLWJGLAllocator.getAddress(mat));
}
public static final void _wglBindFramebuffer(int target, IFramebufferGL framebuffer) {
public static void _wglBindFramebuffer(int target, IFramebufferGL framebuffer) {
if(framebuffer == null) {
glBindFramebuffer(target, 0);
}else {
@ -689,87 +690,87 @@ public class PlatformOpenGL {
}
}
public static final int _wglCheckFramebufferStatus(int target) {
public static int _wglCheckFramebufferStatus(int target) {
return glCheckFramebufferStatus(target);
}
public static final void _wglFramebufferTexture2D(int target, int attachment, int texTarget, ITextureGL texture,
public static void _wglFramebufferTexture2D(int target, int attachment, int texTarget, ITextureGL texture,
int level) {
glFramebufferTexture2D(target, attachment, texTarget, ((OpenGLObjects.TextureGL) texture).ptr, level);
}
public static final void _wglFramebufferTextureLayer(int target, int attachment, ITextureGL texture, int level, int layer) {
public static void _wglFramebufferTextureLayer(int target, int attachment, ITextureGL texture, int level, int layer) {
glFramebufferTextureLayer(target, attachment, ((OpenGLObjects.TextureGL) texture).ptr, level, layer);
}
public static final void _wglBlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0,
public static void _wglBlitFramebuffer(int srcX0, int srcY0, int srcX1, int srcY1, int dstX0, int dstY0,
int dstX1, int dstY1, int bits, int filter) {
glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, bits, filter);
}
public static final void _wglBindRenderbuffer(int target, IRenderbufferGL renderbuffer) {
public static void _wglBindRenderbuffer(int target, IRenderbufferGL renderbuffer) {
glBindRenderbuffer(target, renderbuffer == null ? 0 : ((OpenGLObjects.RenderbufferGL) renderbuffer).ptr);
}
public static final void _wglRenderbufferStorage(int target, int internalformat, int width, int height) {
public static void _wglRenderbufferStorage(int target, int internalformat, int width, int height) {
glRenderbufferStorage(target, internalformat, width, height);
}
public static final void _wglFramebufferRenderbuffer(int target, int attachment, int renderbufferTarget,
public static void _wglFramebufferRenderbuffer(int target, int attachment, int renderbufferTarget,
IRenderbufferGL renderbuffer) {
glFramebufferRenderbuffer(target, attachment, renderbufferTarget,
((OpenGLObjects.RenderbufferGL) renderbuffer).ptr);
}
public static final String _wglGetString(int param) {
public static String _wglGetString(int param) {
return glGetString(param);
}
public static final int _wglGetInteger(int param) {
public static int _wglGetInteger(int param) {
return glGetInteger(param);
}
public static final int _wglGetError() {
public static int _wglGetError() {
return glGetError();
}
public static final int checkOpenGLESVersion() {
public static int checkOpenGLESVersion() {
return glesVers;
}
public static final boolean checkEXTGPUShader5Capable() {
public static boolean checkEXTGPUShader5Capable() {
return hasEXTGPUShader5;
}
public static final boolean checkOESGPUShader5Capable() {
public static boolean checkOESGPUShader5Capable() {
return hasOESGPUShader5;
}
public static final boolean checkFBORenderMipmapCapable() {
public static boolean checkFBORenderMipmapCapable() {
return hasOESFBORenderMipmap;
}
public static final boolean checkVAOCapable() {
public static boolean checkVAOCapable() {
return vertexArrayImpl != VAO_IMPL_NONE;
}
public static final boolean checkInstancingCapable() {
public static boolean checkInstancingCapable() {
return instancingImpl != INSTANCE_IMPL_NONE;
}
public static final boolean checkTexStorageCapable() {
public static boolean checkTexStorageCapable() {
return texStorageImpl != TEX_STORAGE_IMPL_NONE;
}
public static final boolean checkTextureLODCapable() {
public static boolean checkTextureLODCapable() {
return glesVers >= 300 || hasEXTShaderTextureLOD;
}
public static final boolean checkNPOTCapable() {
public static boolean checkNPOTCapable() {
return glesVers >= 300;
}
public static final boolean checkHDRFramebufferSupport(int bits) {
public static boolean checkHDRFramebufferSupport(int bits) {
switch(bits) {
case 16:
return hasFBO16FSupport;
@ -780,7 +781,7 @@ public class PlatformOpenGL {
}
}
public static final boolean checkLinearHDRFilteringSupport(int bits) {
public static boolean checkLinearHDRFilteringSupport(int bits) {
switch(bits) {
case 16:
return hasLinearHDR16FSupport;
@ -792,20 +793,20 @@ public class PlatformOpenGL {
}
// legacy
public static final boolean checkLinearHDR32FSupport() {
public static boolean checkLinearHDR32FSupport() {
return hasLinearHDR32FSupport;
}
public static final boolean checkAnisotropicFilteringSupport() {
public static boolean checkAnisotropicFilteringSupport() {
return hasEXTTextureFilterAnisotropic;
}
public static final String[] getAllExtensions() {
public static String[] getAllExtensions() {
return glGetString(GL_EXTENSIONS).split(" ");
}
public static final void enterVAOEmulationHook() {
public static void enterVAOEmulationHook() {
}
}
}

View File

@ -1,3 +1,19 @@
/*
* Copyright (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal;
import static org.lwjgl.egl.EGL10.*;
@ -55,21 +71,6 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.lax1dude.eaglercraft.v1_8.minecraft.EaglerFolderResourcePack;
import net.lax1dude.eaglercraft.v1_8.sp.server.internal.ServerPlatformSingleplayer;
/**
* Copyright (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class PlatformRuntime {
static final Logger logger = LogManager.getLogger("RuntimeLWJGL3");
@ -679,4 +680,4 @@ public class PlatformRuntime {
return false;
}
}
}

View File

@ -1,8 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal;
import net.lax1dude.eaglercraft.v1_8.recording.EnumScreenRecordingCodec;
/**
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -17,6 +13,11 @@ import net.lax1dude.eaglercraft.v1_8.recording.EnumScreenRecordingCodec;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal;
import net.lax1dude.eaglercraft.v1_8.recording.EnumScreenRecordingCodec;
public class PlatformScreenRecord {
public static boolean isSupported() {
@ -56,4 +57,4 @@ public class PlatformScreenRecord {
}
}
}

View File

@ -1,10 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal;
import net.lax1dude.eaglercraft.v1_8.update.UpdateCertificate;
import net.lax1dude.eaglercraft.v1_8.update.UpdateProgressStruct;
import net.lax1dude.eaglercraft.v1_8.update.UpdateResultObj;
/**
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -19,6 +13,13 @@ import net.lax1dude.eaglercraft.v1_8.update.UpdateResultObj;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal;
import net.lax1dude.eaglercraft.v1_8.update.UpdateCertificate;
import net.lax1dude.eaglercraft.v1_8.update.UpdateProgressStruct;
import net.lax1dude.eaglercraft.v1_8.update.UpdateResultObj;
public class PlatformUpdateSvc {
private static final UpdateProgressStruct dummyStruct = new UpdateProgressStruct();
@ -63,4 +64,4 @@ public class PlatformUpdateSvc {
public static void quine(UpdateCertificate clientUpdate, byte[] data) {
}
}
}

View File

@ -1,9 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal;
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
import net.lax1dude.eaglercraft.v1_8.voice.EnumVoiceChannelReadyState;
/**
/*
* Copyright (c) 2022-2024 ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -18,6 +13,12 @@ import net.lax1dude.eaglercraft.v1_8.voice.EnumVoiceChannelReadyState;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal;
import net.lax1dude.eaglercraft.v1_8.EaglercraftUUID;
import net.lax1dude.eaglercraft.v1_8.voice.EnumVoiceChannelReadyState;
public class PlatformVoiceClient {
public static void initialize() {
@ -92,4 +93,4 @@ public class PlatformVoiceClient {
return EnumVoiceChannelReadyState.NONE;
}
}
}

View File

@ -1,3 +1,19 @@
/*
* Copyright (c) 2022-2024 ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal;
import dev.onvoid.webrtc.*;
@ -21,21 +37,6 @@ import java.nio.ByteBuffer;
import java.nio.file.Paths;
import java.util.*;
/**
* Copyright (c) 2022-2024 ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class PlatformWebRTC {
private static final Logger logger = LogManager.getLogger("PlatformWebRTC");

View File

@ -1,10 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal;
import net.lax1dude.eaglercraft.v1_8.internal.lwjgl.FallbackWebViewServer;
import net.lax1dude.eaglercraft.v1_8.socket.protocol.pkt.server.SPacketWebViewMessageV4EAG;
import net.lax1dude.eaglercraft.v1_8.webview.WebViewOverlayController.IPacketSendCallback;
/**
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -19,6 +13,13 @@ import net.lax1dude.eaglercraft.v1_8.webview.WebViewOverlayController.IPacketSen
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal;
import net.lax1dude.eaglercraft.v1_8.internal.lwjgl.FallbackWebViewServer;
import net.lax1dude.eaglercraft.v1_8.socket.protocol.pkt.server.SPacketWebViewMessageV4EAG;
import net.lax1dude.eaglercraft.v1_8.webview.WebViewOverlayController.IPacketSendCallback;
public class PlatformWebView {
private static FallbackWebViewServer fallbackServer = null;
@ -90,4 +91,4 @@ public class PlatformWebView {
}
}
}
}

View File

@ -1,8 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal.buffer;
import org.lwjgl.system.jemalloc.JEmalloc;
/**
/*
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -17,6 +13,11 @@ import org.lwjgl.system.jemalloc.JEmalloc;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.buffer;
import org.lwjgl.system.jemalloc.JEmalloc;
public class EaglerLWJGLAllocator {
public static class WrongBufferClassType extends RuntimeException {
@ -209,4 +210,4 @@ public class EaglerLWJGLAllocator {
return new WrongBufferClassType("Tried to pass a " + clazz.getClass().getSimpleName() + " which is not a native eagler buffer");
}
}
}

View File

@ -1,9 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal.buffer;
import net.lax1dude.unsafememcpy.UnsafeMemcpy;
import net.lax1dude.unsafememcpy.UnsafeUtils;
/**
/*
* Copyright (c) 2022-2025 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -18,6 +13,12 @@ import net.lax1dude.unsafememcpy.UnsafeUtils;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.buffer;
import net.lax1dude.unsafememcpy.UnsafeMemcpy;
import net.lax1dude.unsafememcpy.UnsafeUtils;
public class EaglerLWJGLByteBuffer extends ByteBuffer {
final long address;
@ -375,4 +376,4 @@ public class EaglerLWJGLByteBuffer extends ByteBuffer {
return this;
}
}
}

View File

@ -1,9 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal.buffer;
import net.lax1dude.unsafememcpy.UnsafeMemcpy;
import net.lax1dude.unsafememcpy.UnsafeUtils;
/**
/*
* Copyright (c) 2022-2025 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -18,6 +13,12 @@ import net.lax1dude.unsafememcpy.UnsafeUtils;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.buffer;
import net.lax1dude.unsafememcpy.UnsafeMemcpy;
import net.lax1dude.unsafememcpy.UnsafeUtils;
public class EaglerLWJGLFloatBuffer extends FloatBuffer {
final long address;
@ -229,4 +230,4 @@ public class EaglerLWJGLFloatBuffer extends FloatBuffer {
return this;
}
}
}

View File

@ -1,9 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal.buffer;
import net.lax1dude.unsafememcpy.UnsafeMemcpy;
import net.lax1dude.unsafememcpy.UnsafeUtils;
/**
/*
* Copyright (c) 2022-2025 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -18,6 +13,12 @@ import net.lax1dude.unsafememcpy.UnsafeUtils;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.buffer;
import net.lax1dude.unsafememcpy.UnsafeMemcpy;
import net.lax1dude.unsafememcpy.UnsafeUtils;
public class EaglerLWJGLIntBuffer extends IntBuffer {
final long address;
@ -229,4 +230,4 @@ public class EaglerLWJGLIntBuffer extends IntBuffer {
return this;
}
}
}

View File

@ -1,9 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal.buffer;
import net.lax1dude.unsafememcpy.UnsafeMemcpy;
import net.lax1dude.unsafememcpy.UnsafeUtils;
/**
/*
* Copyright (c) 2022-2025 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -18,6 +13,12 @@ import net.lax1dude.unsafememcpy.UnsafeUtils;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.buffer;
import net.lax1dude.unsafememcpy.UnsafeMemcpy;
import net.lax1dude.unsafememcpy.UnsafeUtils;
public class EaglerLWJGLShortBuffer extends ShortBuffer {
final long address;
@ -229,4 +230,4 @@ public class EaglerLWJGLShortBuffer extends ShortBuffer {
return this;
}
}
}

View File

@ -1,3 +1,19 @@
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import java.io.File;
@ -13,21 +29,6 @@ import net.lax1dude.eaglercraft.v1_8.internal.buffer.ByteBuffer;
import net.lax1dude.eaglercraft.v1_8.internal.vfs2.EaglerFileSystemException;
import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFSIterator2.BreakLoop;
/**
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class DebugFilesystem implements IEaglerFilesystem {
public static DebugFilesystem initialize(String fsName, File filesystemRoot) {
@ -245,4 +246,4 @@ public class DebugFilesystem implements IEaglerFilesystem {
}
}
}

View File

@ -1,18 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
import org.json.JSONObject;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion;
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapter;
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapterHooks;
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayEntry;
/**
/*
* Copyright (c) 2022 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -27,6 +13,21 @@ import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayEntry;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
import org.json.JSONObject;
import net.lax1dude.eaglercraft.v1_8.EaglercraftRandom;
import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion;
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapter;
import net.lax1dude.eaglercraft.v1_8.internal.IClientConfigAdapterHooks;
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayEntry;
public class DesktopClientConfigAdapter implements IClientConfigAdapter {
public static final IClientConfigAdapter instance = new DesktopClientConfigAdapter();
@ -233,4 +234,4 @@ public class DesktopClientConfigAdapter implements IClientConfigAdapter {
}
}
}

View File

@ -1,14 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import java.net.URI;
import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion;
import net.lax1dude.eaglercraft.v1_8.internal.AbstractWebSocketClient;
import net.lax1dude.eaglercraft.v1_8.internal.EnumEaglerConnectionState;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
/**
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -23,6 +13,17 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import java.net.URI;
import net.lax1dude.eaglercraft.v1_8.EaglercraftVersion;
import net.lax1dude.eaglercraft.v1_8.internal.AbstractWebSocketClient;
import net.lax1dude.eaglercraft.v1_8.internal.EnumEaglerConnectionState;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
public class DesktopWebSocketClient extends AbstractWebSocketClient {
static final Logger logger = LogManager.getLogger("DesktopWebSocketClient");
@ -106,4 +107,4 @@ public class DesktopWebSocketClient extends AbstractWebSocketClient {
addRecievedFrame(new DesktopWebSocketFrameBinary(array));
}
}
}

View File

@ -1,12 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import java.io.InputStream;
import net.lax1dude.eaglercraft.v1_8.EaglerInputStream;
import net.lax1dude.eaglercraft.v1_8.internal.IWebSocketFrame;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
/**
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -21,6 +13,15 @@ import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import java.io.InputStream;
import net.lax1dude.eaglercraft.v1_8.EaglerInputStream;
import net.lax1dude.eaglercraft.v1_8.internal.IWebSocketFrame;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
public class DesktopWebSocketFrameBinary implements IWebSocketFrame {
private final byte[] byteArray;
@ -61,4 +62,4 @@ public class DesktopWebSocketFrameBinary implements IWebSocketFrame {
return timestamp;
}
}
}

View File

@ -1,11 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import java.io.InputStream;
import net.lax1dude.eaglercraft.v1_8.internal.IWebSocketFrame;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
/**
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -20,6 +13,14 @@ import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import java.io.InputStream;
import net.lax1dude.eaglercraft.v1_8.internal.IWebSocketFrame;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
public class DesktopWebSocketFrameString implements IWebSocketFrame {
private final String string;
@ -60,4 +61,4 @@ public class DesktopWebSocketFrameString implements IWebSocketFrame {
return timestamp;
}
}
}

View File

@ -1,10 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import fi.iki.elonen.NanoHTTPD;
import fi.iki.elonen.NanoHTTPD.Response.Status;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
/**
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -19,6 +13,13 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import fi.iki.elonen.NanoHTTPD;
import fi.iki.elonen.NanoHTTPD.Response.Status;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
class FallbackWebViewHTTPD extends NanoHTTPD {
static final Logger logger = FallbackWebViewServer.logger;
@ -38,4 +39,4 @@ class FallbackWebViewHTTPD extends NanoHTTPD {
return newFixedLengthResponse(Status.NOT_FOUND, MIME_HTML, "<!DOCTYPE html><html><head><title>Eaglercraft Desktop Runtime</title></head><body><h1>404 Not Found</h1></body></html>");
}
}
}
}

View File

@ -1,17 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
import net.lax1dude.eaglercraft.v1_8.internal.WebViewOptions;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.lax1dude.eaglercraft.v1_8.webview.PermissionsCache;
/**
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -26,6 +13,20 @@ import net.lax1dude.eaglercraft.v1_8.webview.PermissionsCache;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONException;
import org.json.JSONObject;
import net.lax1dude.eaglercraft.v1_8.internal.WebViewOptions;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.lax1dude.eaglercraft.v1_8.webview.PermissionsCache;
class FallbackWebViewProtocol {
static final Logger logger = FallbackWebViewServer.logger;
@ -296,4 +297,4 @@ class FallbackWebViewProtocol {
}
}
}

View File

@ -1,3 +1,19 @@
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import java.io.BufferedReader;
@ -19,21 +35,6 @@ import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.lax1dude.eaglercraft.v1_8.socket.protocol.pkt.server.SPacketWebViewMessageV4EAG;
import net.lax1dude.eaglercraft.v1_8.webview.WebViewOverlayController.IPacketSendCallback;
/**
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class FallbackWebViewServer {
static final Logger logger = LogManager.getLogger("FallbackWebViewServer");
@ -187,4 +188,4 @@ public class FallbackWebViewServer {
}
}
}
}

View File

@ -1,3 +1,19 @@
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import java.net.InetSocketAddress;
@ -19,21 +35,6 @@ import net.lax1dude.eaglercraft.v1_8.webview.WebViewOverlayController.IPacketSen
import static net.lax1dude.eaglercraft.v1_8.internal.lwjgl.FallbackWebViewProtocol.*;
/**
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
class FallbackWebViewWSD extends WebSocketServer {
static final Logger logger = FallbackWebViewServer.logger;
@ -270,4 +271,4 @@ class FallbackWebViewWSD extends WebSocketServer {
this.callback = callback;
}
}
}

View File

@ -1,3 +1,19 @@
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import javax.swing.JFrame;
@ -13,21 +29,6 @@ import javax.swing.JLabel;
import javax.swing.SwingConstants;
import javax.swing.UIManager;
/**
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class FilesystemConvertingDialog extends JFrame {
private static final long serialVersionUID = 1L;
@ -75,4 +76,4 @@ public class FilesystemConvertingDialog extends JFrame {
progressBar.setValue(val);
}
}
}

View File

@ -1,3 +1,19 @@
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import java.sql.Connection;
@ -23,21 +39,6 @@ import net.lax1dude.eaglercraft.v1_8.internal.vfs2.VFSIterator2;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
/**
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class JDBCFilesystem implements IEaglerFilesystem {
public static final Logger logger = LogManager.getLogger("JDBCFilesystem");
@ -456,4 +457,4 @@ public class JDBCFilesystem implements IEaglerFilesystem {
return false;
}
}
}

View File

@ -1,3 +1,19 @@
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import java.io.File;
@ -14,21 +30,6 @@ import net.lax1dude.eaglercraft.v1_8.internal.vfs2.EaglerFileSystemException;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
/**
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class JDBCFilesystemConverter {
private static final Logger logger = LogManager.getLogger("JDBCFilesystemConverter");
@ -127,4 +128,4 @@ public class JDBCFilesystemConverter {
}
file.delete();
}
}
}

View File

@ -1,18 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.EagUtils;
import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformANGLE;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.program.ShaderSource;
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager;
import net.minecraft.client.main.Main;
/**
/*
* Copyright (c) 2022-2023 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -27,6 +13,21 @@ import net.minecraft.client.main.Main;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import net.lax1dude.eaglercraft.v1_8.EagRuntime;
import net.lax1dude.eaglercraft.v1_8.EagUtils;
import net.lax1dude.eaglercraft.v1_8.internal.EnumPlatformANGLE;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
import net.lax1dude.eaglercraft.v1_8.opengl.ext.deferred.program.ShaderSource;
import net.lax1dude.eaglercraft.v1_8.sp.relay.RelayManager;
import net.minecraft.client.main.Main;
public class LWJGLEntryPoint {
public static Thread mainThread = null;
@ -98,4 +99,4 @@ public class LWJGLEntryPoint {
}
}
}
}

View File

@ -1,3 +1,19 @@
/*
* Copyright (c) 2022 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
@ -21,21 +37,6 @@ import java.awt.Dimension;
import javax.swing.JSeparator;
/**
* Copyright (c) 2022 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class LaunchRenderDocDialog extends JDialog {
private static final long serialVersionUID = 8312760039213612790L;
@ -110,4 +111,4 @@ public class LaunchRenderDocDialog extends JDialog {
JSeparator separator = new JSeparator();
getContentPane().add(separator, BorderLayout.NORTH);
}
}
}

View File

@ -1,16 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import java.awt.Font;
import java.awt.GraphicsEnvironment;
import java.awt.Toolkit;
import javax.swing.ScrollPaneConstants;
/**
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -25,6 +13,19 @@ import javax.swing.ScrollPaneConstants;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import java.awt.Font;
import java.awt.GraphicsEnvironment;
import java.awt.Toolkit;
import javax.swing.ScrollPaneConstants;
public class MainMenuCreditsDialog extends JFrame {
private static final long serialVersionUID = 696969696L;
@ -72,4 +73,4 @@ public class MainMenuCreditsDialog extends JFrame {
public void setCreditsText(String str) {
textArea.setText(str);
}
}
}

View File

@ -1,17 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import java.net.URI;
import java.nio.ByteBuffer;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.drafts.Draft;
import org.java_websocket.drafts.Draft_6455;
import org.java_websocket.extensions.permessage_deflate.PerMessageDeflateExtension;
import org.java_websocket.handshake.ServerHandshake;
import net.lax1dude.eaglercraft.v1_8.internal.EnumEaglerConnectionState;
/**
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -26,6 +13,20 @@ import net.lax1dude.eaglercraft.v1_8.internal.EnumEaglerConnectionState;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.internal.lwjgl;
import java.net.URI;
import java.nio.ByteBuffer;
import org.java_websocket.client.WebSocketClient;
import org.java_websocket.drafts.Draft;
import org.java_websocket.drafts.Draft_6455;
import org.java_websocket.extensions.permessage_deflate.PerMessageDeflateExtension;
import org.java_websocket.handshake.ServerHandshake;
import net.lax1dude.eaglercraft.v1_8.internal.EnumEaglerConnectionState;
class WebSocketClientImpl extends WebSocketClient {
private static final Draft perMessageDeflateDraft = new Draft_6455(new PerMessageDeflateExtension());
@ -76,4 +77,4 @@ class WebSocketClientImpl extends WebSocketClient {
clientObj.handleBytes(arg0.array());
}
}
}

View File

@ -1,15 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.sp.internal;
import java.util.ArrayList;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
import net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl.CrashScreenPopup;
import net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl.DesktopIntegratedServer;
import net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl.MemoryConnection;
/**
/*
* Copyright (c) 2023-2024 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -24,6 +13,18 @@ import net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl.MemoryConnection;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.sp.internal;
import java.util.ArrayList;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
import net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl.CrashScreenPopup;
import net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl.DesktopIntegratedServer;
import net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl.MemoryConnection;
public class ClientPlatformSingleplayer {
private static CrashScreenPopup crashOverlay = null;
@ -96,4 +97,4 @@ public class ClientPlatformSingleplayer {
crashOverlay.setVisible(false);
}
}
}

View File

@ -1,3 +1,19 @@
/*
* Copyright (c) 2023-2024 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.sp.server.internal;
import java.util.ArrayList;
@ -13,21 +29,6 @@ import net.lax1dude.eaglercraft.v1_8.internal.lwjgl.DesktopClientConfigAdapter;
import net.lax1dude.eaglercraft.v1_8.sp.server.IWASMCrashCallback;
import net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl.MemoryConnection;
/**
* Copyright (c) 2023-2024 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class ServerPlatformSingleplayer {
private static IEaglerFilesystem filesystem = null;
@ -100,4 +101,4 @@ public class ServerPlatformSingleplayer {
return false;
}
}
}

View File

@ -1,16 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.ScrollPaneConstants;
import java.awt.Font;
import java.awt.Toolkit;
import java.awt.Color;
/**
/*
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -25,6 +13,19 @@ import java.awt.Color;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl;
import javax.swing.JFrame;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.ScrollPaneConstants;
import java.awt.Font;
import java.awt.Toolkit;
import java.awt.Color;
public class CrashScreenPopup extends JFrame {
private static final long serialVersionUID = 1L;
@ -68,4 +69,4 @@ public class CrashScreenPopup extends JFrame {
public void setCrashText(String txt) {
txtrTest.setText(txt);
}
}
}

View File

@ -1,9 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl;
import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerIntegratedServerWorker;
import net.lax1dude.eaglercraft.v1_8.sp.server.internal.ServerPlatformSingleplayer;
/**
/*
* Copyright (c) 2023-2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -18,6 +13,12 @@ import net.lax1dude.eaglercraft.v1_8.sp.server.internal.ServerPlatformSingleplay
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl;
import net.lax1dude.eaglercraft.v1_8.sp.server.EaglerIntegratedServerWorker;
import net.lax1dude.eaglercraft.v1_8.sp.server.internal.ServerPlatformSingleplayer;
public class DesktopIntegratedServer implements Runnable {
public static Thread serverThread = null;
@ -40,4 +41,4 @@ public class DesktopIntegratedServer implements Runnable {
}
}
}
}

View File

@ -1,11 +1,4 @@
package net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl;
import java.util.LinkedList;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData;
/**
/*
* Copyright (c) 2023-2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -20,9 +13,17 @@ import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8.sp.server.internal.lwjgl;
import java.util.LinkedList;
import java.util.List;
import net.lax1dude.eaglercraft.v1_8.internal.IPCPacketData;
public class MemoryConnection {
public static final List<IPCPacketData> clientToServerQueue = new LinkedList<>();
public static final List<IPCPacketData> serverToClientQueue = new LinkedList<>();
}
}

View File

@ -1,10 +1,4 @@
package net.lax1dude.eaglercraft.v1_8;
import java.util.List;
import net.minecraft.client.settings.KeyBinding;
/**
/*
* Copyright (c) 2022 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -19,6 +13,13 @@ import net.minecraft.client.settings.KeyBinding;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8;
import java.util.List;
import net.minecraft.client.settings.KeyBinding;
public class ArrayUtils {
public static KeyBinding[] clone(KeyBinding[] keyBinding) {
@ -77,4 +78,4 @@ public class ArrayUtils {
}
}
}
}

View File

@ -1,18 +1,4 @@
package net.lax1dude.eaglercraft.v1_8;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.lax1dude.eaglercraft.v1_8.socket.protocol.pkt.client.CPacketGetOtherClientUUIDV4EAG;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
/**
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -27,6 +13,21 @@ import net.minecraft.entity.player.EntityPlayerMP;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import net.lax1dude.eaglercraft.v1_8.log4j.LogManager;
import net.lax1dude.eaglercraft.v1_8.log4j.Logger;
import net.lax1dude.eaglercraft.v1_8.socket.protocol.pkt.client.CPacketGetOtherClientUUIDV4EAG;
import net.minecraft.client.Minecraft;
import net.minecraft.client.entity.AbstractClientPlayer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
public class ClientUUIDLoadingCache {
private static final Logger logger = LogManager.getLogger("ClientUUIDLoadingCache");
@ -52,16 +53,20 @@ public class ClientUUIDLoadingCache {
if(ret == null) {
Minecraft mc = Minecraft.getMinecraft();
if(mc != null && mc.thePlayer != null && mc.thePlayer.sendQueue.getEaglerMessageProtocol().ver >= 4) {
ret = PENDING_UUID;
EaglercraftUUID playerUUID = player.getUniqueID();
if(!waitingUUIDs.containsKey(playerUUID) && !evictedUUIDs.containsKey(playerUUID)) {
int reqID = ++requestId & 0x3FFF;
WaitingLookup newLookup = new WaitingLookup(reqID, playerUUID, EagRuntime.steadyTimeMillis(),
(AbstractClientPlayer) player);
waitingIDs.put(reqID, newLookup);
waitingUUIDs.put(playerUUID, newLookup);
mc.thePlayer.sendQueue.sendEaglerMessage(
new CPacketGetOtherClientUUIDV4EAG(reqID, newLookup.uuid.msb, newLookup.uuid.lsb));
if(ignoreNonEaglerPlayers && !player.getGameProfile().getTextures().eaglerPlayer) {
ret = VANILLA_UUID;
}else {
ret = PENDING_UUID;
EaglercraftUUID playerUUID = player.getUniqueID();
if(!waitingUUIDs.containsKey(playerUUID) && !evictedUUIDs.containsKey(playerUUID)) {
int reqID = ++requestId & 0x3FFF;
WaitingLookup newLookup = new WaitingLookup(reqID, playerUUID, EagRuntime.steadyTimeMillis(),
(AbstractClientPlayer) player);
waitingIDs.put(reqID, newLookup);
waitingUUIDs.put(playerUUID, newLookup);
mc.thePlayer.sendQueue.sendEaglerMessage(
new CPacketGetOtherClientUUIDV4EAG(reqID, newLookup.uuid.msb, newLookup.uuid.lsb));
}
}
}
}
@ -81,6 +86,7 @@ public class ClientUUIDLoadingCache {
private static int requestId = 0;
private static long lastFlushReq = EagRuntime.steadyTimeMillis();
private static long lastFlushEvict = EagRuntime.steadyTimeMillis();
private static boolean ignoreNonEaglerPlayers = false;
public static void update() {
long timestamp = EagRuntime.steadyTimeMillis();
@ -116,13 +122,19 @@ public class ClientUUIDLoadingCache {
evictedUUIDs.clear();
}
private static final EaglercraftUUID MAGIC_DISABLE_NON_EAGLER_PLAYERS = new EaglercraftUUID(0xEEEEA64771094C4EL, 0x86E55B81D17E67EBL);
public static void handleResponse(int requestId, EaglercraftUUID clientId) {
WaitingLookup lookup = waitingIDs.remove(requestId);
if(lookup != null) {
lookup.player.clientBrandUUIDCache = clientId;
waitingUUIDs.remove(lookup.uuid);
}else {
logger.warn("Unsolicited client brand UUID lookup response #{} recieved! (Brand UUID: {})", requestId, clientId);
if(requestId == -1 && MAGIC_DISABLE_NON_EAGLER_PLAYERS.equals(clientId)) {
ignoreNonEaglerPlayers = true;
}else {
logger.warn("Unsolicited client brand UUID lookup response #{} recieved! (Brand UUID: {})", requestId, clientId);
}
}
}
@ -134,6 +146,10 @@ public class ClientUUIDLoadingCache {
}
}
public static void resetFlags() {
ignoreNonEaglerPlayers = false;
}
private static class WaitingLookup {
private final int reqID;
@ -149,4 +165,4 @@ public class ClientUUIDLoadingCache {
}
}
}
}

View File

@ -1,6 +1,4 @@
package net.lax1dude.eaglercraft.v1_8;
/**
/*
* Copyright (c) 2022 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -15,6 +13,9 @@ package net.lax1dude.eaglercraft.v1_8;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8;
public class DecoderException extends RuntimeException {
public DecoderException() {
@ -33,4 +34,4 @@ public class DecoderException extends RuntimeException {
super(cause);
}
}
}

View File

@ -1,8 +1,4 @@
package net.lax1dude.eaglercraft.v1_8;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput;
/**
/*
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -17,6 +13,11 @@ import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformInput;
public class Display {
private static long lastDPIUpdate = -250l;
@ -111,4 +112,4 @@ public class Display {
return cacheDPI;
}
}
}

View File

@ -1,3 +1,19 @@
/*
* Copyright (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8;
import java.io.BufferedReader;
@ -28,21 +44,6 @@ import net.lax1dude.eaglercraft.v1_8.opengl.EaglercraftGPU;
import net.lax1dude.eaglercraft.v1_8.recording.ScreenRecordingController;
import net.lax1dude.eaglercraft.v1_8.update.UpdateService;
/**
* Copyright (c) 2022-2024 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class EagRuntime {
private static final Logger logger = LogManager.getLogger("EagRuntime");
@ -379,4 +380,4 @@ public class EagRuntime {
return PlatformRuntime.immediateContinueSupported();
}
}
}

View File

@ -1,13 +1,4 @@
package net.lax1dude.eaglercraft.v1_8;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
/**
/*
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -22,6 +13,16 @@ import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8;
import java.nio.charset.StandardCharsets;
import java.util.Arrays;
import java.util.List;
import java.util.regex.Pattern;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
public class EagUtils {
private static final String hex = "0123456789ABCDEF";
@ -104,4 +105,4 @@ public class EagUtils {
PlatformRuntime.sleep(500);
}
}
}

View File

@ -1,8 +1,4 @@
package net.lax1dude.eaglercraft.v1_8;
import jdk_internal.bidi.Bidi;
/**
/*
* Copyright (c) 2025 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -17,6 +13,11 @@ import jdk_internal.bidi.Bidi;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8;
import jdk_internal.bidi.Bidi;
public class EaglerBidiReorder {
/**
@ -84,4 +85,4 @@ public class EaglerBidiReorder {
}
}
}
}

View File

@ -1,12 +1,4 @@
package net.lax1dude.eaglercraft.v1_8;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
/**
/*
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -21,6 +13,15 @@ import java.util.Arrays;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8;
import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Arrays;
public class EaglerInputStream extends InputStream {
protected byte buf[];
@ -178,4 +179,4 @@ public class EaglerInputStream extends InputStream {
return count;
}
}
}

View File

@ -1,10 +1,4 @@
package net.lax1dude.eaglercraft.v1_8;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Arrays;
/**
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -19,6 +13,13 @@ import java.util.Arrays;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Arrays;
public class EaglerOutputStream extends OutputStream {
protected byte buf[];
@ -81,4 +82,4 @@ public class EaglerOutputStream extends OutputStream {
public void close() throws IOException {
}
}
}

View File

@ -1,8 +1,4 @@
package net.lax1dude.eaglercraft.v1_8;
import org.json.JSONObject;
/**
/*
* Copyright (c) 2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -17,6 +13,11 @@ import org.json.JSONObject;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8;
import org.json.JSONObject;
public class EaglerXBungeeVersion {
public static final String pluginFileEPK = "plugin_download.zip";
@ -87,4 +88,4 @@ public class EaglerXBungeeVersion {
long verz = getVersionAsLong(vers);
return verz != -1l && verz < pluginVersionLong;
}
}
}

View File

@ -1,12 +1,4 @@
package net.lax1dude.eaglercraft.v1_8;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
/**
/*
* Copyright (c) 2022 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -21,6 +13,15 @@ import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
public class EaglerZLIB {
public static OutputStream newDeflaterOutputStream(OutputStream os) throws IOException {
@ -57,4 +58,4 @@ public class EaglerZLIB {
return PlatformRuntime.newGZIPInputStream(is);
}
}
}

View File

@ -1,8 +1,4 @@
package net.lax1dude.eaglercraft.v1_8;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
/**
/*
* Copyright (c) 2022-2024 lax1dude. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
@ -17,6 +13,11 @@ import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8;
import net.lax1dude.eaglercraft.v1_8.internal.PlatformRuntime;
public class EaglercraftRandom {
private static final long multiplier = 0x5DEECE66DL;
@ -131,4 +132,4 @@ public class EaglercraftRandom {
return v1 * multiplier;
}
}
}
}

View File

@ -1,3 +1,19 @@
/*
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
package net.lax1dude.eaglercraft.v1_8;
import java.util.Iterator;
@ -24,21 +40,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.MathHelper;
import net.minecraft.util.ResourceLocation;
/**
* Copyright (c) 2022-2023 lax1dude, ayunami2000. All Rights Reserved.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
public class EaglercraftSoundManager {
protected class ActiveSoundEvent {
@ -373,4 +374,4 @@ public class EaglercraftSoundManager {
}
}
}
}

Some files were not shown because too many files have changed in this diff Show More