Refactoring: Cleaned Minecraft.cpp and Windows64_Minecraft.cpp#1062
Open
NSDeathman wants to merge 1 commit intosmartcmd:mainfrom
Open
Refactoring: Cleaned Minecraft.cpp and Windows64_Minecraft.cpp#1062NSDeathman wants to merge 1 commit intosmartcmd:mainfrom
NSDeathman wants to merge 1 commit intosmartcmd:mainfrom
Conversation
…t dead #if 0 blocks and commented out code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refactor: Clean up dead code and commented-out blocks from Minecraft.cpp and Windows64_Minecraft.cpp
This pull request performs a thorough cleanup of Minecraft.cpp and Windows64_Minecraft.cpp by removing all unused, obsolete, and commented-out code without altering any existing functionality. The goal is to improve code readability, maintainability, and reduce noise in the source files.
Changes made:
Removed all #if 0 … #endif blocks that contained dead code (e.g., old Java‑style input handling, legacy rendering experiments, debug snippets).
Deleted commented‑out function calls, variable declarations, and conditional logic that were left over from previous development stages.
Eliminated unused macros, constants, and static variables (e.g., #define DISABLE_SPU_CODE, #define DEBUG_RENDER_SHOWS_PACKETS, #define SPLITSCREEN_TEST).
Removed obsolete try/catch blocks and exception handling that are no longer relevant in the current C++ environment.
Cleaned up large sections of code that were conditionally compiled out (e.g., old LWJGL‑related setup, unused OpenGL capability checks).
Stripped out debugging leftovers (e.g., System.out.println equivalents, commented printf statements).
Removed redundant variable initializations and unused class members.
Deleted empty or stubbed functions (e.g., checkGlError with empty body, renderLoadingScreen with only debug code).
Consolidated and simplified several condition checks by removing dead branches.
All changes are purely refactoring – no game logic, rendering, or network behaviour has been touched. The code compiles and runs identically to the previous version.
Why this is needed:
Maintainability: Large amounts of dead code make it harder to understand the actual flow and introduce confusion during debugging.
Readability: Removing commented‑out blocks and #if 0 sections makes the files cleaner and easier to navigate.
Future development: A cleaner codebase reduces the risk of accidentally reintroducing old bugs and simplifies the addition of new features.
Files affected:
Minecraft.cpp
Windows64_Minecraft.cpp
No other files are impacted. All changes have been tested locally to ensure no functional regression.
Please review and let me know if any further cleanup is desired.