Descent3/scripts
Chris Sarbora 9ec7714ebc
Delete unused sources
None of these sources are referenced, either directly or indirectly,
    in any CMakeLists.txt file.

    NOTE: All of legacy/ is unused, but we're keeping it around.

    Process for this commit: (in bash)
    **NOTE: THIS MUST BE DONE ON A CASE-SENSITIVE FILESYSTEM**. There are a
    few instances of differing-in-case-only (hogmaker vs HogMaker, etc) that
    will catch you out otherwise.
    ```
      # *** 1: Find all directly-referenced c/cpp files in CMakeLists.txt
      find . -name CMakeLists.txt -exec cat {} \+ |
      # Then, convert spaces and tabs to newlines for easy tokenizing
        tr -s ' \t' '\n' |
      # Filter to just tokens descripting c/cpp filenames (case insensitive)
        grep -iE '\.c(pp)?' |
      # Massage each filename to remove CMake-specific chars
        sed 's/[")]//g' |
      # Remove a URL that happens to match the pattern so far
        grep -v https: |
      # Remove files that start with # (and are thus comments, not refs)
        grep -Ev '^#' |
      # *** 2: In the output so far there is a curious entry ${SCRIPT}.cpp
      # Turns out, the makefiles generate some further filenames from script
      # names. So, delete the ${SCRIPT}.cpp filename...
        grep -v '${SCRIPT}.cpp' |
      # .. and add in the cpps.
        (
      # We use a bash subshell to let us "concatenate" to the pipe. This
      # writes stdin back to stdout, and then starts a *new command* to
      # generate more to stdout.
          cat -;
      # All the generated script cpp references live in scripts/
          cat scripts/CMakeLists.txt |
      # Squash the makefile onto one line for regex ease
            tr '\n' ' ' |
      # Extract the script names
            sed -E 's/.*set\(SCRIPTS([^)]+)\).*/\1/' |
      # Convert spaces and tabs to newlines for easy tokenizing
            tr -s ' \t' '\n' |
      # Remove blank lines
            grep -v '^$' |
      # Add cpp extension to each token
            while read TOKEN; do
              echo ${TOKEN}.cpp;
            done
        ) |
      # *** 3: Being referenced by CMakeFiles.txt isn't the only way a src
      # file can be used - it could also be potentially #include'ed. Let's
      # find those, with another subshell concatenation:
        (
          cat -;
      # Look in ALL source files. We could actually probably limit the
      # search here to just src files listed so far in stdin + *.h, but
      # that'd require a bunch of redirections and this bash pipeline is
      # already ridiculous enough. (Case!)
          find . -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" |
      # Pull out the #include directives from them
            xargs grep --no-filename '#include' |
      # Look for any include of a .c or .cpp file (Case!)
            grep -iE '\.c(pp)?' |
      # Squash multiple spaces and tabs into one single space
            tr -s ' \t' ' ' |
      # Split on spaces, take the second field
            cut -d ' ' -f 2 |
      # Delete off quotes and angle brackets to get the included filename
            tr -d '"<>'
        ) |
      # *** 4: Protect all files under legacy/, per @Lgt2x's request
        (
          cat -;
          find legacy -iname "*.cpp" -or -iname "*.c"
        ) |
      # *** 5: Reduce all entries to their basename
        while read FILENAME; do
          basename $FILENAME;
        done |
      # *** 6: FINALLY, sort and dedupe the output into a file.
        sort | uniq > used_srcs

      # Now that we know all the used source files, we need to find all of
      # the source files in the repo, and delete them if they do not appear
      # in the used_srcs list.
      for SRC in $(find . -iname "*.cpp" -or -iname "*.c"); do
      # find outputs the relative path, we want to operate on just filename
        basename $SRC |
      # grep to see if the basename occurs in the used_srcs list.
      # -q means be quiet, do not print the match (so this doesn't spam)
      # -x means match the entire line (so macfile.cpp doesn't sneak thru
      #    via cfile.cpp)
      # -F means treat the lines patterns as fixed (not regexp)
      # -f means load patterns from the given file
          grep -qxFf used_srcs ||
      # If the grep command *fails*, then the file is not in the list.
      # Bash performs logic short-circuiting, so we can use logical-OR
        git rm $SRC;
      done
    ```

    Test Plan:
    On all three of `[win, mac, linux]`:
    ```
    cmake --preset <platform>
    cmake --build --preset <platform> --config Debug
    cmake --build --preset <platform> --config Release
    ```
2024-04-27 07:33:01 -07:00
..
data Initial import 2024-04-15 21:43:29 -06:00
lnx Updated source to reflect the license that this code is released under. 2024-04-20 09:57:49 -06:00
aigame2.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
aigame4.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
AIGame3_External.h Updated source to reflect the license that this code is released under. 2024-04-20 09:57:49 -06:00
AIGame3.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
AIGame.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
barney.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
BatteriesIncluded.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
BatteriesIncluded.msg Initial import 2024-04-15 21:43:29 -06:00
BossCamera.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
CanyonsCTF.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
CellTestLevel.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
CellTestLevel.msg Initial import 2024-04-15 21:43:29 -06:00
ChrisTest.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
ChrisTest.msg Initial import 2024-04-15 21:43:29 -06:00
clutter.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
CMakeLists.txt Update script CHECKSUM for 64 bit platforms 2024-04-25 09:39:41 -04:00
DallasFuncs.cpp Fix -Wcomment 2024-04-21 20:24:31 +02:00
Gamegauge_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
Gamegauge_GER.msg Initial import 2024-04-15 21:43:29 -06:00
Gamegauge_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
gamegauge_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
GameGauge.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
GameGauge.msg Initial import 2024-04-15 21:43:29 -06:00
gcc-game.def Initial import 2024-04-15 21:43:29 -06:00
gcc-lvl.def Initial import 2024-04-15 21:43:29 -06:00
generic.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
Geodomes.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
Geodomes.msg Initial import 2024-04-15 21:43:29 -06:00
HalfPipe_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
HalfPipe.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
HalfPipe.msg Initial import 2024-04-15 21:43:29 -06:00
InfernalBolt_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
InfernalBolt.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
InfernalBolt.msg Initial import 2024-04-15 21:43:29 -06:00
Inversion.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
Inversion.msg Initial import 2024-04-15 21:43:29 -06:00
level1_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
level1_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
level1.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
level1.msg Initial import 2024-04-15 21:43:29 -06:00
level2_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
level2_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
level2.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
level2.msg Initial import 2024-04-15 21:43:29 -06:00
level3_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
level3_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
level3.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
level3.msg Initial import 2024-04-15 21:43:29 -06:00
level4_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
level4_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
level4.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
level4.msg Initial import 2024-04-15 21:43:29 -06:00
level5_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
level5_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
level5.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
level5.msg Initial import 2024-04-15 21:43:29 -06:00
level6_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
level7_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
level7_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
level7.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
level7.msg Initial import 2024-04-15 21:43:29 -06:00
level8_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
level8_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
level8.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
level8.msg Initial import 2024-04-15 21:43:29 -06:00
level9_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
level10_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
level10_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
level10.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
level10.msg Initial import 2024-04-15 21:43:29 -06:00
level11_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
level11_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
level11.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
level11.msg Initial import 2024-04-15 21:43:29 -06:00
level12_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
level13_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
level13_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
level13.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
level13.msg Initial import 2024-04-15 21:43:29 -06:00
level14_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
level14_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
level14.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
level14.msg Initial import 2024-04-15 21:43:29 -06:00
level15_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
level17.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
level17.msg Initial import 2024-04-15 21:43:29 -06:00
Level1_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
Level1_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
Level2_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
Level2_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
Level3_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
Level3_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
Level4_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
Level4_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
Level5_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
Level5_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
Level6_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
Level6_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
Level6_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
Level6.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
Level6.msg Initial import 2024-04-15 21:43:29 -06:00
Level7_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
Level7_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
Level8_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
Level8_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
Level9_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
Level9_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
Level9_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
Level9.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
Level9.msg Initial import 2024-04-15 21:43:29 -06:00
Level10_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
Level10_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
Level11_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
Level11_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
Level12_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
Level12_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
Level12_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
Level12.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
Level12.msg Initial import 2024-04-15 21:43:29 -06:00
Level13_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
Level13_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
Level14_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
Level14_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
Level15_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
Level15_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
Level16.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
Level16.msg Initial import 2024-04-15 21:43:29 -06:00
LEVEL0.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
LEVEL15_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
LEVEL15.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
LEVEL15.msg Initial import 2024-04-15 21:43:29 -06:00
levels1_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
levels2_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
levelS2_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
levelS2.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
levelS2.msg Initial import 2024-04-15 21:43:29 -06:00
LevelS1_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
LevelS1_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
LevelS1.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
LevelS1.msg Initial import 2024-04-15 21:43:29 -06:00
LevelS2_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
LEVELS1_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
LEVELS2_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
linux_lib.cpp Updated source to reflect the license that this code is released under. 2024-04-20 09:57:49 -06:00
linux_lib.h Updated source to reflect the license that this code is released under. 2024-04-20 09:57:49 -06:00
merc5.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
merc5.msg Initial import 2024-04-15 21:43:29 -06:00
Merc1.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
Merc1.msg Initial import 2024-04-15 21:43:29 -06:00
Merc3.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
Merc3.msg Initial import 2024-04-15 21:43:29 -06:00
Merc4.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
Merc4.msg Initial import 2024-04-15 21:43:29 -06:00
Merc6.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
Merc6.msg Initial import 2024-04-15 21:43:29 -06:00
Merc7.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
Merc7.msg Initial import 2024-04-15 21:43:29 -06:00
Merc02.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
Merc02.msg Initial import 2024-04-15 21:43:29 -06:00
MS-GAME.DEF Initial import 2024-04-15 21:43:29 -06:00
MS-LVL.DEF Initial import 2024-04-15 21:43:29 -06:00
myPowerHouse.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
Mysterious_Isle.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
Mysterious_Isle.msg Initial import 2024-04-15 21:43:29 -06:00
orbital.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
osiris_common.h Updated source to reflect the license that this code is released under. 2024-04-20 09:57:49 -06:00
osiris_import.h More simple warning fixes 2024-04-20 16:22:29 -04:00
osiris_vector.h Updated source to reflect the license that this code is released under. 2024-04-20 09:57:49 -06:00
Paranoia.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
paranoia.msg Initial import 2024-04-15 21:43:29 -06:00
PiccuStation.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
PINBALL.MSG Initial import 2024-04-15 21:43:29 -06:00
Polaris_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
Polaris_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
Polaris_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
Polaris_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
Polaris.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
Polaris.msg Initial import 2024-04-15 21:43:29 -06:00
Quadsomniac_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
Quadsomniac.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
Quadsomniac.msg Initial import 2024-04-15 21:43:29 -06:00
RudeAwakening.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
RudeAwakening.msg Initial import 2024-04-15 21:43:29 -06:00
s.asm Initial import 2024-04-15 21:43:29 -06:00
SewerRat.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
SewerRat.msg Initial import 2024-04-15 21:43:29 -06:00
testscript.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
TrainingMission_FRN.msg Initial import 2024-04-15 21:43:29 -06:00
TrainingMission_Ger.msg Initial import 2024-04-15 21:43:29 -06:00
TrainingMission_ITN.msg Initial import 2024-04-15 21:43:29 -06:00
TrainingMission_SPN.msg Initial import 2024-04-15 21:43:29 -06:00
TrainingMission.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
TrainingMission.msg Initial import 2024-04-15 21:43:29 -06:00
Y2K.cpp Ensure STDCALL/STDCALLPTR is only invoked on x86 2024-04-21 22:24:50 -04:00
Y2K.msg Initial import 2024-04-15 21:43:29 -06:00