From 087b7e7abfe81dd7f0fdcdea36ac9f245950df1a Mon Sep 17 00:00:00 2001 From: Loki Rautio Date: Sat, 7 Mar 2026 21:12:22 -0600 Subject: Revert "Project modernization (#630)" This code was not tested and breaks in Release builds, reverting to restore functionality of the nightly. All in-game menus do not work and generating a world crashes. This reverts commit a9be52c41a02d207233199e98898fe7483d7e817. --- Minecraft.Client/StitchedTexture.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'Minecraft.Client/StitchedTexture.cpp') diff --git a/Minecraft.Client/StitchedTexture.cpp b/Minecraft.Client/StitchedTexture.cpp index b9693f3d..64ab2f36 100644 --- a/Minecraft.Client/StitchedTexture.cpp +++ b/Minecraft.Client/StitchedTexture.cpp @@ -26,7 +26,7 @@ StitchedTexture *StitchedTexture::create(const wstring &name) StitchedTexture::StitchedTexture(const wstring &name, const wstring &filename) : name(name) { // 4J Initialisers - source = nullptr; + source = NULL; rotated = false; x = 0; y = 0; @@ -40,9 +40,9 @@ StitchedTexture::StitchedTexture(const wstring &name, const wstring &filename) : heightTranslation = 0.0f; frame = 0; subFrame = 0; - frameOverride = nullptr; + frameOverride = NULL; flags = 0; - frames = nullptr; + frames = NULL; m_fileName = filename; } @@ -94,10 +94,10 @@ void StitchedTexture::init(Texture *source, vector *frames, int x, in float marginX = 0.0f; //0.01f / source->getWidth(); float marginY = 0.0f; //0.01f / source->getHeight(); - this->u0 = x / static_cast(source->getWidth()) + marginX; - this->u1 = (x + width) / static_cast(source->getWidth()) - marginX; - this->v0 = y / static_cast(source->getHeight()) + marginY; - this->v1 = (y + height) / static_cast(source->getHeight()) - marginY; + this->u0 = x / (float) source->getWidth() + marginX; + this->u1 = (x + width) / (float) source->getWidth() - marginX; + this->v0 = y / (float) source->getHeight() + marginY; + this->v1 = (y + height) / (float) source->getHeight() - marginY; #ifndef _CONTENT_PACKAGE bool addBreakpoint = false; @@ -112,8 +112,8 @@ void StitchedTexture::init(Texture *source, vector *frames, int x, in } #endif - this->widthTranslation = width / static_cast(SharedConstants::WORLD_RESOLUTION); - this->heightTranslation = height / static_cast(SharedConstants::WORLD_RESOLUTION); + this->widthTranslation = width / (float) SharedConstants::WORLD_RESOLUTION; + this->heightTranslation = height / (float) SharedConstants::WORLD_RESOLUTION; } void StitchedTexture::replaceWith(StitchedTexture *texture) @@ -156,7 +156,7 @@ float StitchedTexture::getU1(bool adjust/*=false*/) const float StitchedTexture::getU(double offset, bool adjust/*=false*/) const { float diff = getU1(adjust) - getU0(adjust); - return getU0(adjust) + (diff * (static_cast(offset) / SharedConstants::WORLD_RESOLUTION)); + return getU0(adjust) + (diff * ((float) offset / SharedConstants::WORLD_RESOLUTION)); } float StitchedTexture::getV0(bool adjust/*=false*/) const @@ -172,7 +172,7 @@ float StitchedTexture::getV1(bool adjust/*=false*/) const float StitchedTexture::getV(double offset, bool adjust/*=false*/) const { float diff = getV1(adjust) - getV0(adjust); - return getV0(adjust) + (diff * (static_cast(offset) / SharedConstants::WORLD_RESOLUTION)); + return getV0(adjust) + (diff * ((float) offset / SharedConstants::WORLD_RESOLUTION)); } wstring StitchedTexture::getName() const @@ -192,7 +192,7 @@ int StitchedTexture::getSourceHeight() const void StitchedTexture::cycleFrames() { - if (frameOverride != nullptr) + if (frameOverride != NULL) { pair current = frameOverride->at(frame); subFrame++; @@ -250,10 +250,10 @@ int StitchedTexture::getFrames() */ void StitchedTexture::loadAnimationFrames(BufferedReader *bufferedReader) { - if(frameOverride != nullptr) + if(frameOverride != NULL) { delete frameOverride; - frameOverride = nullptr; + frameOverride = NULL; } frame = 0; subFrame = 0; @@ -303,10 +303,10 @@ void StitchedTexture::loadAnimationFrames(BufferedReader *bufferedReader) void StitchedTexture::loadAnimationFrames(const wstring &string) { - if(frameOverride != nullptr) + if(frameOverride != NULL) { delete frameOverride; - frameOverride = nullptr; + frameOverride = NULL; } frame = 0; subFrame = 0; -- cgit v1.2.3