aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/Font.cpp
diff options
context:
space:
mode:
authorLoki Rautio <lokirautio@gmail.com>2026-03-04 03:56:03 -0600
committerLoki Rautio <lokirautio@gmail.com>2026-03-04 03:56:03 -0600
commit42aec6dac53dffa6afe072560a7e1d4986112538 (patch)
tree0836426857391df1b6a83f6368a183f83ec9b104 /Minecraft.Client/Font.cpp
parentc9d58eeac7c72f0b3038e084667b4d89a6249fce (diff)
parentef9b6fd500dfabd9463267b0dd9e29577eea8a2b (diff)
Merge branch 'main' into pr/win64-world-saves
# Conflicts: # Minecraft.Client/MinecraftServer.cpp # README.md
Diffstat (limited to 'Minecraft.Client/Font.cpp')
-rw-r--r--Minecraft.Client/Font.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/Minecraft.Client/Font.cpp b/Minecraft.Client/Font.cpp
index 17f72853..7a37dd7b 100644
--- a/Minecraft.Client/Font.cpp
+++ b/Minecraft.Client/Font.cpp
@@ -3,12 +3,13 @@
#include "Font.h"
#include "Options.h"
#include "Tesselator.h"
+#include "ResourceLocation.h"
#include "..\Minecraft.World\IntBuffer.h"
#include "..\Minecraft.World\net.minecraft.h"
#include "..\Minecraft.World\StringHelpers.h"
#include "..\Minecraft.World\Random.h"
-Font::Font(Options *options, const wstring& name, Textures* textures, bool enforceUnicode, TEXTURE_NAME textureName, int cols, int rows, int charWidth, int charHeight, unsigned short charMap[]/* = nullptr */) : textures(textures)
+Font::Font(Options *options, const wstring& name, Textures* textures, bool enforceUnicode, ResourceLocation *textureLocation, int cols, int rows, int charWidth, int charHeight, unsigned short charMap[]/* = nullptr */) : textures(textures)
{
int charC = cols * rows; // Number of characters in the font
@@ -26,7 +27,7 @@ Font::Font(Options *options, const wstring& name, Textures* textures, bool enfor
m_rows = rows;
m_charWidth = charWidth;
m_charHeight = charHeight;
- m_textureName = textureName;
+ m_textureLocation = textureLocation;
// Build character map
if (charMap != NULL)
@@ -40,7 +41,7 @@ Font::Font(Options *options, const wstring& name, Textures* textures, bool enfor
random = new Random();
// Load the image
- BufferedImage *img = textures->readImage(m_textureName, name);
+ BufferedImage *img = textures->readImage(textureLocation->getTexture(), name);
/* - 4J - TODO
try {
@@ -195,7 +196,7 @@ wstring Font::reorderBidi(const wstring &str)
void Font::draw(const wstring &str, bool dropShadow)
{
// Bind the texture
- textures->bindTexture(m_textureName);
+ textures->bindTexture(m_textureLocation);
bool noise = false;
wstring cleanStr = sanitize(str);