Skip to content

Refactoring: Cleaned Minecraft.cpp and Windows64_Minecraft.cpp#1062

Open
NSDeathman wants to merge 1 commit intosmartcmd:mainfrom
NSDeathman:Tiding
Open

Refactoring: Cleaned Minecraft.cpp and Windows64_Minecraft.cpp#1062
NSDeathman wants to merge 1 commit intosmartcmd:mainfrom
NSDeathman:Tiding

Conversation

@NSDeathman
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant