mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-18 03:25:18 +00:00
Add option for linear filtering of text texture (#7645)
This commit is contained in:
1 parent
65e99f9b58
commit
1d87831773
5 files changed
+136
-3
No files matched your search
+53
@@ -0,0 +1,53 @@
|
||||
/*
|
||||
* Minecraft Forge
|
||||
* Copyright (c) 2016-2020.
|
||||
*
|
||||
* This library 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 2.1
|
||||
* of the License.
|
||||
*
|
||||
* This library 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 library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
package net.minecraftforge.debug.client.rendering;
|
||||
|
||||
import net.minecraft.client.gui.screen.MainMenuScreen;
|
||||
import net.minecraftforge.client.ForgeRenderTypes;
|
||||
import net.minecraftforge.client.event.GuiScreenEvent.DrawScreenEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.common.Mod;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
|
||||
@Mod(LinearTextTextureFilteringTest.MODID)
|
||||
@Mod.EventBusSubscriber(value = Dist.CLIENT)
|
||||
public class LinearTextTextureFilteringTest
|
||||
{
|
||||
public static final String MODID = "text_linear_filtering_test";
|
||||
static final boolean ENABLED = false;
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onGuiRenderPre(DrawScreenEvent.Pre event)
|
||||
{
|
||||
if (ENABLED && event.getGui() instanceof MainMenuScreen)
|
||||
{
|
||||
ForgeRenderTypes.enableTextTextureLinearFiltering = true;
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public static void onGuiRenderPost(DrawScreenEvent.Post event)
|
||||
{
|
||||
if (ENABLED && event.getGui() instanceof MainMenuScreen)
|
||||
{
|
||||
ForgeRenderTypes.enableTextTextureLinearFiltering = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user