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/ # 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.posX = posX;
this.posY = posY; this.posY = posY;
this.posZ = posZ; this.posZ = posZ;
this.volume = 1.0f; this.volume = volume;
this.frameRate = 60; this.frameRate = 30;
this.requiresPositionPacket = true; this.requiresPositionPacket = true;
this.requiresFullResetPacket = true; this.requiresFullResetPacket = true;
this.isDisabled = true; this.isDisabled = true;

View File

@ -4,7 +4,7 @@ public class ConfigConstants {
public static boolean profanity = false; 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 mainMenuString = "eaglercraft " + version;
public static final String forkMe = "https://github.com/LAX1DUDE/eaglercraft"; 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 TextureGL videoTexture = null;
private static boolean videoIsLoaded = false; private static boolean videoIsLoaded = false;
private static boolean videoTexIsInitialized = false; private static boolean videoTexIsInitialized = false;
private static int frameRate = 17; private static int frameRate = 33;
private static long frameTimer = 0l; private static long frameTimer = 0l;
public static final boolean isVideoSupported() { public static final boolean isVideoSupported() {
@ -937,6 +937,7 @@ public class EaglerAdapterImpl2 {
videosBuffer.remove(src); videosBuffer.remove(src);
}else { }else {
currentVideo = (HTMLVideoElement) win.getDocument().createElement("video"); currentVideo = (HTMLVideoElement) win.getDocument().createElement("video");
currentVideo.setAttribute("crossorigin", "anonymous");
currentVideo.setAutoplay(autoplay); currentVideo.setAutoplay(autoplay);
} }
@ -1019,6 +1020,7 @@ public class EaglerAdapterImpl2 {
if(!videosBuffer.containsKey(src)) { if(!videosBuffer.containsKey(src)) {
HTMLVideoElement video = (HTMLVideoElement) win.getDocument().createElement("video"); HTMLVideoElement video = (HTMLVideoElement) win.getDocument().createElement("video");
video.setAutoplay(false); video.setAutoplay(false);
video.setAttribute("crossorigin", "anonymous");
video.setPreload("auto"); video.setPreload("auto");
video.setControls(false); video.setControls(false);
video.setSrc(src); video.setSrc(src);
@ -1105,6 +1107,7 @@ public class EaglerAdapterImpl2 {
} }
frameTimer = ms; frameTimer = ms;
if(currentVideo != null && videoTexture != null && videoIsLoaded) { if(currentVideo != null && videoTexture != null && videoIsLoaded) {
try {
_wglBindTexture(_wGL_TEXTURE_2D, videoTexture); _wglBindTexture(_wGL_TEXTURE_2D, videoTexture);
if(videoTexIsInitialized) { if(videoTexIsInitialized) {
html5VideoTexSubImage2D(webgl, _wGL_TEXTURE_2D, _wGL_RGBA, _wGL_UNSIGNED_BYTE, currentVideo); html5VideoTexSubImage2D(webgl, _wGL_TEXTURE_2D, _wGL_RGBA, _wGL_UNSIGNED_BYTE, currentVideo);
@ -1116,6 +1119,9 @@ public class EaglerAdapterImpl2 {
_wglTexParameteri(_wGL_TEXTURE_2D, _wGL_TEXTURE_MAG_FILTER, _wGL_LINEAR); _wglTexParameteri(_wGL_TEXTURE_2D, _wGL_TEXTURE_MAG_FILTER, _wGL_LINEAR);
videoTexIsInitialized = true; videoTexIsInitialized = true;
} }
}catch(Throwable t) {
// rip
}
} }
} }
public static final void bindVideoTexture() { public static final void bindVideoTexture() {

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