aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/TextureManager.cpp
diff options
context:
space:
mode:
authorModMaker101 <119018978+ModMaker101@users.noreply.github.com>2026-03-08 19:08:36 -0400
committerGitHub <noreply@github.com>2026-03-08 18:08:36 -0500
commit28614b922fb77149a54da1a87bebfbc98736f296 (patch)
tree7f828ba86a4ee18d0a80d29de64f6199a5412512 /Minecraft.Client/TextureManager.cpp
parent88798b501d0cf6287b6f87acb2592676e3cec58d (diff)
Modernize project codebase (#906)
* Fixed boats falling and a TP glitch #266 * Replaced every C-style cast with C++ ones * Replaced every C-style cast with C++ ones * Fixed boats falling and a TP glitch #266 * Updated NULL to nullptr and fixing some type issues * Modernized and fixed a few bugs - Replaced most instances of `NULL` with `nullptr`. - Replaced most `shared_ptr(new ...)` with `make_shared`. - Removed the `nullptr` macro as it was interfering with the actual nullptr keyword in some instances. * Fixing more conflicts * Replace int loops with size_t and start work on overrides * Add safety checks and fix a issue with vector going OOR
Diffstat (limited to 'Minecraft.Client/TextureManager.cpp')
-rw-r--r--Minecraft.Client/TextureManager.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/Minecraft.Client/TextureManager.cpp b/Minecraft.Client/TextureManager.cpp
index 542b9499..d6cbe2c3 100644
--- a/Minecraft.Client/TextureManager.cpp
+++ b/Minecraft.Client/TextureManager.cpp
@@ -7,7 +7,7 @@
#include "TextureManager.h"
#include "..\Minecraft.World\StringHelpers.h"
-TextureManager *TextureManager::instance = NULL;
+TextureManager *TextureManager::instance = nullptr;
void TextureManager::createInstance()
{
@@ -36,7 +36,7 @@ Texture *TextureManager::getTexture(const wstring &name)
return idToTextureMap.find(stringToIDMap.find(name)->second)->second;
}
- return NULL;
+ return nullptr;
}
void TextureManager::registerName(const wstring &name, Texture *texture)
@@ -136,7 +136,7 @@ vector<Texture *> *TextureManager::createTextures(const wstring &filename, bool
for (int i = 0; i < frameCount; i++)
{
BufferedImage *subImage = image->getSubimage(0, frameHeight * i, frameWidth, frameHeight);
- Texture *texture = createTexture(texName, mode, frameWidth, frameHeight, clamp, format, minFilter, magFilter, mipmap || image->getData(1) != NULL, subImage);
+ Texture *texture = createTexture(texName, mode, frameWidth, frameHeight, clamp, format, minFilter, magFilter, mipmap || image->getData(1) != nullptr, subImage);
delete subImage;
result->push_back(texture);
}
@@ -146,7 +146,7 @@ vector<Texture *> *TextureManager::createTextures(const wstring &filename, bool
// TODO: Remove this hack -- fix proper rotation support (needed for 'off-aspect textures')
if (width == height)
{
- result->push_back(createTexture(texName, mode, width, height, clamp, format, minFilter, magFilter, mipmap || image->getData(1) != NULL, image));
+ result->push_back(createTexture(texName, mode, width, height, clamp, format, minFilter, magFilter, mipmap || image->getData(1) != nullptr, image));
}
else
{
@@ -191,6 +191,6 @@ Texture *TextureManager::createTexture(const wstring &name, int mode, int width,
Texture *TextureManager::createTexture(const wstring &name, int mode, int width, int height, int format, bool mipmap)
{
// 4J Stu - Don't clamp as it causes issues with how we signal non-mipmmapped textures to the pixel shader
- //return createTexture(name, mode, width, height, Texture::WM_CLAMP, format, Texture::TFLT_NEAREST, Texture::TFLT_NEAREST, mipmap, NULL);
- return createTexture(name, mode, width, height, Texture::WM_WRAP, format, Texture::TFLT_NEAREST, Texture::TFLT_NEAREST, mipmap, NULL);
+ //return createTexture(name, mode, width, height, Texture::WM_CLAMP, format, Texture::TFLT_NEAREST, Texture::TFLT_NEAREST, mipmap, nullptr);
+ return createTexture(name, mode, width, height, Texture::WM_WRAP, format, Texture::TFLT_NEAREST, Texture::TFLT_NEAREST, mipmap, nullptr);
} \ No newline at end of file