Get render module mostly working
This commit is contained in:
@@ -42,6 +42,7 @@ import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.NoSuchFileException;
|
||||
import java.nio.file.Path;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
@@ -300,7 +301,7 @@ public class GuiRenderSettings extends GuiScreen implements Closeable {
|
||||
String json = "{}";
|
||||
try {
|
||||
json = new String(Files.readAllBytes(getSettingsPath()), StandardCharsets.UTF_8);
|
||||
} catch (FileNotFoundException ignored) {
|
||||
} catch (NoSuchFileException | FileNotFoundException ignored) {
|
||||
} catch (IOException e) {
|
||||
LOGGER.error("Reading render settings:", e);
|
||||
}
|
||||
|
||||
@@ -273,10 +273,13 @@ public class GuiVideoRenderer extends GuiScreen implements Tickable {
|
||||
//#if MC>=11300
|
||||
NativeImage data = previewTexture.getTextureData();
|
||||
assert data != null;
|
||||
for (int x = 0; x < data.getWidth(); x++) {
|
||||
for (int y = 0; y < data.getHeight(); y++) {
|
||||
int value = 0xff << 24 | (buffer.get() & 0xff) << 16 | (buffer.get() & 0xff) << 8 | (buffer.get() & 0xff);
|
||||
data.setPixelRGBA(x, y, value);
|
||||
for (int y = 0; y < data.getHeight(); y++) {
|
||||
for (int x = 0; x < data.getWidth(); x++) {
|
||||
int r = buffer.get() & 0xff;
|
||||
int g = buffer.get() & 0xff;
|
||||
int b = buffer.get() & 0xff;
|
||||
int value = 0xff << 24 | b << 16 | g << 8 | r;
|
||||
data.setPixelRGBA(x, y, value); // actually takes ABGR, not RGBA
|
||||
}
|
||||
}
|
||||
//#else
|
||||
|
||||
Reference in New Issue
Block a user