chore: drop a few more dead LinuxGame.h includes

This commit is contained in:
MatthewBeshay 2026-04-08 21:41:09 +10:00
parent 61a0d9690b
commit 33fe5fec3a
4 changed files with 9 additions and 4 deletions

View file

@ -48,10 +48,18 @@ USAGE_PATTERNS = [
]
def strip_comments(text: str) -> str:
text = re.sub(r'/\*.*?\*/', '', text, flags=re.DOTALL)
text = re.sub(r'//[^\n]*', '', text)
return text
def file_needs_linuxgame(text: str) -> bool:
# Strip the LinuxGame.h include line itself before checking, to avoid
# the include path matching `LinuxGame`.
# the include path matching `LinuxGame`. Also strip comments so
# references in commented-out code don't keep the include alive.
scan = INCLUDE_RE.sub("", text)
scan = strip_comments(scan)
for pat in USAGE_PATTERNS:
if pat.search(scan):
return True

View file

@ -10,7 +10,6 @@
#include "app/common/Tutorial/Tutorial.h"
#include "app/common/Tutorial/TutorialEnum.h"
#include "app/common/Tutorial/TutorialMode.h"
#include "app/linux/LinuxGame.h"
#include "minecraft/client/Minecraft.h"
#include "minecraft/client/multiplayer/MultiPlayerGameMode.h"
#include "minecraft/client/player/Input.h"

View file

@ -27,7 +27,6 @@
#include "minecraft/Minecraft_Macros.h"
#include "app/common/DLC/DLCManager.h"
#include "app/common/DLC/DLCSkinFile.h"
#include "app/linux/LinuxGame.h"
#include "java/JavaMath.h"
#include "java/Random.h"
#include "minecraft/Direction.h"

View file

@ -3,7 +3,6 @@
#include <memory>
#include "app/linux/LinuxGame.h"
#include "java/Random.h"
#include "minecraft/Direction.h"
#include "minecraft/core/particles/ParticleTypes.h"