From d8bac9df8cc834dec5315ca8e0e5ac9ed3fd3af4 Mon Sep 17 00:00:00 2001 From: James Seibel Date: Mon, 8 Apr 2024 07:17:17 -0500 Subject: [PATCH] Remove deprecated DhApiScreenResizeEvent --- .../DhApiScreenResizeEvent.java | 77 ------------------- .../core/render/renderer/LodRenderer.java | 8 -- 2 files changed, 85 deletions(-) delete mode 100644 api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiScreenResizeEvent.java diff --git a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiScreenResizeEvent.java b/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiScreenResizeEvent.java deleted file mode 100644 index 2fdad3b66..000000000 --- a/api/src/main/java/com/seibel/distanthorizons/api/methods/events/abstractEvents/DhApiScreenResizeEvent.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * This file is part of the Distant Horizons mod - * licensed under the GNU LGPL v3 License. - * - * Copyright (C) 2020-2023 James Seibel - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published by - * the Free Software Foundation, version 3. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program. If not, see . - */ - -package com.seibel.distanthorizons.api.methods.events.abstractEvents; - -import com.seibel.distanthorizons.api.methods.events.interfaces.IDhApiEvent; -import com.seibel.distanthorizons.api.methods.events.sharedParameterObjects.DhApiEventParam; - -/** - * TODO remove - * - * @author James Seibel - * @version 2023-1-23 - * @since API 1.1.0 - */ -@Deprecated // TODO remove before stable release and write a merge request for Iris -public abstract class DhApiScreenResizeEvent implements IDhApiEvent -{ - /** Fired immediately before Distant Horizons handles the screen resize. */ - public abstract void onResize(DhApiEventParam event); - - - //=========================// - // internal DH API methods // - //=========================// - - @Override - public final void fireEvent(DhApiEventParam event) { this.onResize(event); } - - - //==================// - // parameter object // - //==================// - - public static class EventParam - { - /** Measured in pixels */ - public final int previousWidth; - /** Measured in pixels */ - public final int previousHeight; - - /** Measured in pixels */ - public final int newWidth; - /** Measured in pixels */ - public final int newHeight; - - - public EventParam( - int previousWidth, int previousHeight, - int newWidth, int newHeight) - { - this.previousWidth = previousWidth; - this.previousHeight = previousHeight; - - this.newWidth = newWidth; - this.newHeight = newHeight; - - } - } - -} \ No newline at end of file diff --git a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderer.java b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderer.java index 78de044ef..2d66a10fd 100644 --- a/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderer.java +++ b/core/src/main/java/com/seibel/distanthorizons/core/render/renderer/LodRenderer.java @@ -744,19 +744,11 @@ public class LodRenderer this.cachedHeight = MC_RENDER.getTargetFrameBufferViewportHeight(); - // TODO add on texture (re)created event - // https://discord.com/channels/881614130614767666/1211290858134052894/1211431000580554752 ApiEventInjector.INSTANCE.fireAllEvents(DhApiColorDepthTextureCreatedEvent.class, new DhApiColorDepthTextureCreatedEvent.EventParam( oldWidth, oldHeight, this.cachedWidth, this.cachedHeight )); - - ApiEventInjector.INSTANCE.fireAllEvents(DhApiScreenResizeEvent.class, - new DhApiScreenResizeEvent.EventParam( - oldWidth, oldHeight, - this.cachedWidth, this.cachedHeight - )); // also update the override if present