22w16d video playback fixes, fixed line endings in unix scripts

This commit is contained in:
LAX1DUDE 2022-04-21 13:17:50 -07:00
parent 8655ed05f0
commit b8cf84e97c
11 changed files with 54824 additions and 54806 deletions

5
.gitattributes vendored
View File

@ -1,6 +1,7 @@
#
# https://help.github.com/articles/dealing-with-line-endings/
#
# These are explicitly windows files and should use crlf
*.bat text eol=crlf
*.bat text eol=crlf
*.sh text eol=lf
gradlew text eol=lf

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -34,8 +34,8 @@ public class VideoMapPacketCodec {
this.posX = posX;
this.posY = posY;
this.posZ = posZ;
this.volume = 1.0f;
this.frameRate = 60;
this.volume = volume;
this.frameRate = 30;
this.requiresPositionPacket = true;
this.requiresFullResetPacket = true;
this.isDisabled = true;

View File

@ -4,7 +4,7 @@ public class ConfigConstants {
public static boolean profanity = false;
public static final String version = "22w16c";
public static final String version = "22w16d";
public static final String mainMenuString = "eaglercraft " + version;
public static final String forkMe = "https://github.com/LAX1DUDE/eaglercraft";

View File

@ -891,7 +891,7 @@ public class EaglerAdapterImpl2 {
private static TextureGL videoTexture = null;
private static boolean videoIsLoaded = false;
private static boolean videoTexIsInitialized = false;
private static int frameRate = 17;
private static int frameRate = 33;
private static long frameTimer = 0l;
public static final boolean isVideoSupported() {
@ -937,6 +937,7 @@ public class EaglerAdapterImpl2 {
videosBuffer.remove(src);
}else {
currentVideo = (HTMLVideoElement) win.getDocument().createElement("video");
currentVideo.setAttribute("crossorigin", "anonymous");
currentVideo.setAutoplay(autoplay);
}
@ -1019,6 +1020,7 @@ public class EaglerAdapterImpl2 {
if(!videosBuffer.containsKey(src)) {
HTMLVideoElement video = (HTMLVideoElement) win.getDocument().createElement("video");
video.setAutoplay(false);
video.setAttribute("crossorigin", "anonymous");
video.setPreload("auto");
video.setControls(false);
video.setSrc(src);
@ -1105,16 +1107,20 @@ public class EaglerAdapterImpl2 {
}
frameTimer = ms;
if(currentVideo != null && videoTexture != null && videoIsLoaded) {
_wglBindTexture(_wGL_TEXTURE_2D, videoTexture);
if(videoTexIsInitialized) {
html5VideoTexSubImage2D(webgl, _wGL_TEXTURE_2D, _wGL_RGBA, _wGL_UNSIGNED_BYTE, currentVideo);
}else {
html5VideoTexImage2D(webgl, _wGL_TEXTURE_2D, _wGL_RGBA, _wGL_RGBA, _wGL_UNSIGNED_BYTE, currentVideo);
_wglTexParameteri(_wGL_TEXTURE_2D, _wGL_TEXTURE_WRAP_S, _wGL_CLAMP);
_wglTexParameteri(_wGL_TEXTURE_2D, _wGL_TEXTURE_WRAP_T, _wGL_CLAMP);
_wglTexParameteri(_wGL_TEXTURE_2D, _wGL_TEXTURE_MIN_FILTER, _wGL_LINEAR);
_wglTexParameteri(_wGL_TEXTURE_2D, _wGL_TEXTURE_MAG_FILTER, _wGL_LINEAR);
videoTexIsInitialized = true;
try {
_wglBindTexture(_wGL_TEXTURE_2D, videoTexture);
if(videoTexIsInitialized) {
html5VideoTexSubImage2D(webgl, _wGL_TEXTURE_2D, _wGL_RGBA, _wGL_UNSIGNED_BYTE, currentVideo);
}else {
html5VideoTexImage2D(webgl, _wGL_TEXTURE_2D, _wGL_RGBA, _wGL_RGBA, _wGL_UNSIGNED_BYTE, currentVideo);
_wglTexParameteri(_wGL_TEXTURE_2D, _wGL_TEXTURE_WRAP_S, _wGL_CLAMP);
_wglTexParameteri(_wGL_TEXTURE_2D, _wGL_TEXTURE_WRAP_T, _wGL_CLAMP);
_wglTexParameteri(_wGL_TEXTURE_2D, _wGL_TEXTURE_MIN_FILTER, _wGL_LINEAR);
_wglTexParameteri(_wGL_TEXTURE_2D, _wGL_TEXTURE_MAG_FILTER, _wGL_LINEAR);
videoTexIsInitialized = true;
}
}catch(Throwable t) {
// rip
}
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long