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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion common/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ dependencies {
compileOnly(group = "io.github.llamalad7", name = "mixinextras-common", version = "0.5.3")
annotationProcessor(group = "io.github.llamalad7", name = "mixinextras-common", version = "0.5.3")
compileOnly(group = "org.ow2.asm", name = "asm", version = "9.8")
compileOnly(group = "org.ow2.asm", name = "asm-tree", version = "9.8")
compileOnly(group = "com.google.code.findbugs", name = "jsr305", version = "3.0.2")

compileOnly("org.bytedeco:javacv-platform:1.5.11")
// compileOnly("org.bytedeco:javacv-platform:1.5.11")
}

configurations {
Expand Down Expand Up @@ -64,3 +65,12 @@ sourceSets.configureEach {
}
}
}

/*tasks.register<Copy>("extractRuntimeClasspath") {
from(configurations.runtimeClasspath)
into("$projectDir/build/runtimeClasspath")

doFirst {
file("$projectDir/build/runtimeClasspath").mkdirs()
}
}*/
Original file line number Diff line number Diff line change
@@ -1,41 +1,41 @@
package com.github.epsilon.graphics.video;

import com.github.epsilon.Epsilon;
import com.mojang.logging.LogUtils;
import net.minecraft.client.Minecraft;
import org.apache.commons.io.IOUtils;

import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Objects;

public class VideoManager {

private static final File directory = new File(Minecraft.getInstance().gameDirectory, "Sakura/Background");
private static final File backgroundFile = new File(directory, "background.mp4");

private static void unpackFile(File file, String name) throws IOException {
FileOutputStream fos = new FileOutputStream(file);
IOUtils.copy(Objects.requireNonNull(Epsilon.class.getClassLoader().getResourceAsStream(name)), fos);
fos.close();
}

public static void ensureBackgroundFile() throws IOException {
if (!directory.exists()) {
directory.mkdirs();
}
if (!backgroundFile.exists()) {
unpackFile(backgroundFile, "assets/epsilon/background/wallpaper.mp4");
}
}

public static void loadBackground(int fps) throws IOException {
if (!backgroundFile.exists()) {
LogUtils.getLogger().error("Background file not found, this should not happen! Reload files.");
ensureBackgroundFile();
}
VideoUtil.init(backgroundFile, fps);
}

}
//package com.github.epsilon.graphics.video;
//
//import com.github.epsilon.Epsilon;
//import com.mojang.logging.LogUtils;
//import net.minecraft.client.Minecraft;
//import org.apache.commons.io.IOUtils;
//
//import java.io.File;
//import java.io.FileOutputStream;
//import java.io.IOException;
//import java.util.Objects;
//
//public class VideoManager {
//
// private static final File directory = new File(Minecraft.getInstance().gameDirectory, "Sakura/Background");
// private static final File backgroundFile = new File(directory, "background.mp4");
//
// private static void unpackFile(File file, String name) throws IOException {
// FileOutputStream fos = new FileOutputStream(file);
// IOUtils.copy(Objects.requireNonNull(Epsilon.class.getClassLoader().getResourceAsStream(name)), fos);
// fos.close();
// }
//
// public static void ensureBackgroundFile() throws IOException {
// if (!directory.exists()) {
// directory.mkdirs();
// }
// if (!backgroundFile.exists()) {
// unpackFile(backgroundFile, "assets/epsilon/background/wallpaper.mp4");
// }
// }
//
// public static void loadBackground(int fps) throws IOException {
// if (!backgroundFile.exists()) {
// LogUtils.getLogger().error("Background file not found, this should not happen! Reload files.");
// ensureBackgroundFile();
// }
// VideoUtil.init(backgroundFile, fps);
// }
//
//}
Loading
Loading