mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-28 18:23:53 +00:00
chore: drop a few more dead LinuxGame.h includes
This commit is contained in:
parent
61a0d9690b
commit
33fe5fec3a
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue