Search in sources :

Example 1 with SodiumGameOptions

use of me.jellysquid.mods.sodium.client.gui.SodiumGameOptions in project reeses-sodium-options by FlashyReese.

the class SodiumVideoOptionsScreen method hideDonationButton.

private void hideDonationButton() {
    SodiumGameOptions options = SodiumClientMod.options();
    options.notifications.hideDonationButton = true;
    try {
        options.writeChanges();
    } catch (IOException e) {
        throw new RuntimeException("Failed to save configuration", e);
    }
    this.setDonationButtonVisibility(false);
    // Hackalicious! Rebuild UI
    this.remove(this.frame);
    this.frame = this.parentFrameBuilder().build();
    this.addDrawableChild(this.frame);
}
Also used : IOException(java.io.IOException) SodiumGameOptions(me.jellysquid.mods.sodium.client.gui.SodiumGameOptions)

Example 2 with SodiumGameOptions

use of me.jellysquid.mods.sodium.client.gui.SodiumGameOptions in project sodium-fabric by CaffeineMC.

the class ChunkGraph method calculateVisible.

public void calculateVisible(Camera camera, Vec3d cameraPos, BlockPos blockPos, int frame, Frustum frustum, boolean spectator) {
    BlockPos center = new BlockPos(MathHelper.floor(cameraPos.x / 16.0D) * 16, MathHelper.floor(cameraPos.y / 16.0D) * 16, MathHelper.floor(cameraPos.z / 16.0D) * 16);
    this.minX = center.getX() - (this.renderDistance * 16);
    this.minZ = center.getZ() - (this.renderDistance * 16);
    this.maxX = center.getX() + (this.renderDistance * 16);
    this.maxZ = center.getZ() + (this.renderDistance * 16);
    this.visibleNodes.clear();
    boolean cull = this.init(blockPos, camera, cameraPos, frustum, frame, spectator);
    SodiumGameOptions options = SodiumClientMod.options();
    boolean fogCulling = cull && this.renderDistance > 4 && options.quality.enableFog && options.performance.useFogChunkCulling;
    int maxChunkDistance = (this.renderDistance * 16) + 16;
    ObjectArrayFIFOQueue<ChunkGraphNode<T>> queue = this.iterationQueue;
    while (!queue.isEmpty()) {
        ChunkGraphNode<T> node = this.iterationQueue.dequeue();
        this.visibleNodes.add(node);
        if (fogCulling && !node.getOrigin().isWithinDistance(cameraPos, maxChunkDistance)) {
            continue;
        }
        Direction dir = node.direction;
        for (Direction adjDir : DirectionUtil.ALL_DIRECTIONS) {
            ChunkGraphNode<T> adjNode = this.getAdjacentChunk(node, adjDir);
            if (adjNode == null) {
                continue;
            }
            if (adjNode.getRebuildFrame() == frame) {
                continue;
            }
            if (cull) {
                if (node.canCull(adjDir.getOpposite())) {
                    continue;
                }
                if (dir != null && !node.isVisibleThrough(dir.getOpposite(), adjDir)) {
                    continue;
                }
                if (!frustum.isVisible(adjNode.getBoundingBox())) {
                    continue;
                }
            }
            if (!adjNode.hasNeighbors()) {
                continue;
            }
            adjNode.setDirection(adjDir);
            adjNode.setRebuildFrame(frame);
            adjNode.updateCullingState(node.cullingState, adjDir);
            queue.enqueue(adjNode);
        }
    }
}
Also used : SodiumGameOptions(me.jellysquid.mods.sodium.client.gui.SodiumGameOptions)

Aggregations

SodiumGameOptions (me.jellysquid.mods.sodium.client.gui.SodiumGameOptions)2 IOException (java.io.IOException)1