diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000000..53b7916472 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +!defined__APPLE__ && defined__MACH__v!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__r!defined__APPLE__ && defined__MACH__s!defined__APPLE__ && defined__MACH__i!defined__APPLE__ && defined__MACH__o!defined__APPLE__ && defined__MACH__n!defined__APPLE__ && defined__MACH__:!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__2!defined__APPLE__ && defined__MACH__ +!defined__APPLE__ && defined__MACH__u!defined__APPLE__ && defined__MACH__p!defined__APPLE__ && defined__MACH__d!defined__APPLE__ && defined__MACH__a!defined__APPLE__ && defined__MACH__t!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__s!defined__APPLE__ && defined__MACH__:!defined__APPLE__ && defined__MACH__ +!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__-!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__p!defined__APPLE__ && defined__MACH__a!defined__APPLE__ && defined__MACH__c!defined__APPLE__ && defined__MACH__k!defined__APPLE__ && defined__MACH__a!defined__APPLE__ && defined__MACH__g!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__-!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__c!defined__APPLE__ && defined__MACH__o!defined__APPLE__ && defined__MACH__s!defined__APPLE__ && defined__MACH__y!defined__APPLE__ && defined__MACH__s!defined__APPLE__ && defined__MACH__t!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__m!defined__APPLE__ && defined__MACH__:!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__"!defined__APPLE__ && defined__MACH__g!defined__APPLE__ && defined__MACH__i!defined__APPLE__ && defined__MACH__t!defined__APPLE__ && defined__MACH__h!defined__APPLE__ && defined__MACH__u!defined__APPLE__ && defined__MACH__b!defined__APPLE__ && defined__MACH__-!defined__APPLE__ && defined__MACH__a!defined__APPLE__ && defined__MACH__c!defined__APPLE__ && defined__MACH__t!defined__APPLE__ && defined__MACH__i!defined__APPLE__ && defined__MACH__o!defined__APPLE__ && defined__MACH__n!defined__APPLE__ && defined__MACH__s!defined__APPLE__ && defined__MACH__"!defined__APPLE__ && defined__MACH__ +!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__d!defined__APPLE__ && defined__MACH__i!defined__APPLE__ && defined__MACH__r!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__c!defined__APPLE__ && defined__MACH__t!defined__APPLE__ && defined__MACH__o!defined__APPLE__ && defined__MACH__r!defined__APPLE__ && defined__MACH__y!defined__APPLE__ && defined__MACH__:!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__"!defined__APPLE__ && defined__MACH__/!defined__APPLE__ && defined__MACH__"!defined__APPLE__ && defined__MACH__ +!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__s!defined__APPLE__ && defined__MACH__c!defined__APPLE__ && defined__MACH__h!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__d!defined__APPLE__ && defined__MACH__u!defined__APPLE__ && defined__MACH__l!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__:!defined__APPLE__ && defined__MACH__ +!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__#!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__C!defined__APPLE__ && defined__MACH__h!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__c!defined__APPLE__ && defined__MACH__k!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__f!defined__APPLE__ && defined__MACH__o!defined__APPLE__ && defined__MACH__r!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__u!defined__APPLE__ && defined__MACH__p!defined__APPLE__ && defined__MACH__d!defined__APPLE__ && defined__MACH__a!defined__APPLE__ && defined__MACH__t!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__s!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__t!defined__APPLE__ && defined__MACH__o!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__G!defined__APPLE__ && defined__MACH__i!defined__APPLE__ && defined__MACH__t!defined__APPLE__ && defined__MACH__H!defined__APPLE__ && defined__MACH__u!defined__APPLE__ && defined__MACH__b!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__A!defined__APPLE__ && defined__MACH__c!defined__APPLE__ && defined__MACH__t!defined__APPLE__ && defined__MACH__i!defined__APPLE__ && defined__MACH__o!defined__APPLE__ && defined__MACH__n!defined__APPLE__ && defined__MACH__s!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__v!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__r!defined__APPLE__ && defined__MACH__y!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__w!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__k!defined__APPLE__ && defined__MACH__ +!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__i!defined__APPLE__ && defined__MACH__n!defined__APPLE__ && defined__MACH__t!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__r!defined__APPLE__ && defined__MACH__v!defined__APPLE__ && defined__MACH__a!defined__APPLE__ && defined__MACH__l!defined__APPLE__ && defined__MACH__:!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__"!defined__APPLE__ && defined__MACH__w!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__k!defined__APPLE__ && defined__MACH__l!defined__APPLE__ && defined__MACH__y!defined__APPLE__ && defined__MACH__"!defined__APPLE__ && defined__MACH__ +!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__a!defined__APPLE__ && defined__MACH__l!defined__APPLE__ && defined__MACH__l!defined__APPLE__ && defined__MACH__o!defined__APPLE__ && defined__MACH__w!defined__APPLE__ && defined__MACH__:!defined__APPLE__ && defined__MACH__ +!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__#!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__A!defined__APPLE__ && defined__MACH__l!defined__APPLE__ && defined__MACH__l!defined__APPLE__ && defined__MACH__o!defined__APPLE__ && defined__MACH__w!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__b!defined__APPLE__ && defined__MACH__o!defined__APPLE__ && defined__MACH__t!defined__APPLE__ && defined__MACH__h!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__d!defined__APPLE__ && defined__MACH__i!defined__APPLE__ && defined__MACH__r!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__c!defined__APPLE__ && defined__MACH__t!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__a!defined__APPLE__ && defined__MACH__n!defined__APPLE__ && defined__MACH__d!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__i!defined__APPLE__ && defined__MACH__n!defined__APPLE__ && defined__MACH__d!defined__APPLE__ && defined__MACH__i!defined__APPLE__ && defined__MACH__r!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__c!defined__APPLE__ && defined__MACH__t!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__u!defined__APPLE__ && defined__MACH__p!defined__APPLE__ && defined__MACH__d!defined__APPLE__ && defined__MACH__a!defined__APPLE__ && defined__MACH__t!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__s!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__f!defined__APPLE__ && defined__MACH__o!defined__APPLE__ && defined__MACH__r!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__a!defined__APPLE__ && defined__MACH__l!defined__APPLE__ && defined__MACH__l!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__p!defined__APPLE__ && defined__MACH__a!defined__APPLE__ && defined__MACH__c!defined__APPLE__ && defined__MACH__k!defined__APPLE__ && defined__MACH__a!defined__APPLE__ && defined__MACH__g!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__s!defined__APPLE__ && defined__MACH__ +!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__-!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__d!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__p!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__n!defined__APPLE__ && defined__MACH__d!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__n!defined__APPLE__ && defined__MACH__c!defined__APPLE__ && defined__MACH__y!defined__APPLE__ && defined__MACH__-!defined__APPLE__ && defined__MACH__t!defined__APPLE__ && defined__MACH__y!defined__APPLE__ && defined__MACH__p!defined__APPLE__ && defined__MACH__e!defined__APPLE__ && defined__MACH__:!defined__APPLE__ && defined__MACH__ !defined__APPLE__ && defined__MACH__"!defined__APPLE__ && defined__MACH__a!defined__APPLE__ && defined__MACH__l!defined__APPLE__ && defined__MACH__l!defined__APPLE__ && defined__MACH__"!defined__APPLE__ && defined__MACH__ +!defined__APPLE__ && defined__MACH__ \ No newline at end of file diff --git a/.github/workflows/Windows-Release.yml b/.github/workflows/Windows-Release.yml index 7cb4e38872..30b9aa000e 100644 --- a/.github/workflows/Windows-Release.yml +++ b/.github/workflows/Windows-Release.yml @@ -111,7 +111,7 @@ jobs: GTEST_COLOR: 1 run: .\script\test.ps1 -Generator ${{ matrix.cmake-generator }} -EnablePIE ${{ matrix.enable-pie }} -BuildType ${{ matrix.build-type }} - - name: Upload artifacts + - name: Upload artifacts uses: skx/github-action-publish-binaries@44887b225ceca96efd8a912d39c09ad70312af31 # master env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/engine/launcher/general.cpp b/engine/launcher/general.cpp index 13bcbb89cb..7d488235b2 100644 --- a/engine/launcher/general.cpp +++ b/engine/launcher/general.cpp @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2022 Daniel Horn, David Ranger, pyramid3d, + * general.cpp + * + * Copyright (C) 2001-2024 Daniel Horn, David Ranger, pyramid3d, * Stephen G. Tuggy, and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -13,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -24,7 +26,7 @@ * This allows it to be used with other programs with minimal changes */ #include "general.h" -#if defined(__APPLE__) || defined(MACOSX) +#if defined(__APPLE__) && defined(__MACH__) #include // For MAXPATHLEN #endif #ifdef __MINGW32__ @@ -492,7 +494,7 @@ int isdir(const char *file) { glob_t *FindPath(char *path, int type) { glob_t *FILES = new glob_t; string mypath(path); -#if defined(__APPLE__) || defined(MACOSX) +#if defined(__APPLE__) && defined(__MACH__) char thispath[MAXPATHLEN]; #else char thispath[800000]; @@ -504,7 +506,7 @@ glob_t *FindPath(char *path, int type) { dirent *entry; unsigned int cur; char *newpath = 0; -#if defined(__APPLE__) || defined(MACOSX) +#if defined(__APPLE__) && defined(__MACH__) getcwd(thispath, MAXPATHLEN); #else getcwd(thispath, 790000); diff --git a/engine/objconv/asteroidgen.cpp b/engine/objconv/asteroidgen.cpp index 4aad7557cd..7dfcd39935 100644 --- a/engine/objconv/asteroidgen.cpp +++ b/engine/objconv/asteroidgen.cpp @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2022 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * asteroidgen.cpp + * + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, * and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -13,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -30,7 +32,7 @@ #define M_PI 3.14159265358979323846264338328 #endif #include -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) #define sqrtf sqrt #define cosf cos #define sinf sin diff --git a/engine/objconv/basemaker/base_maker.cpp b/engine/objconv/basemaker/base_maker.cpp index 693d3b2eba..da479c466d 100644 --- a/engine/objconv/basemaker/base_maker.cpp +++ b/engine/objconv/basemaker/base_maker.cpp @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2022 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * base_maker.cpp + * + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, * and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -13,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -46,7 +48,7 @@ #include //for mkdir #include -#if defined (__APPLE__) || defined (MACOSX) +#if defined(__APPLE__) && defined(__MACH__) #include #include #else diff --git a/engine/objconv/basemaker/base_maker_texture.cpp b/engine/objconv/basemaker/base_maker_texture.cpp index a5a5a0c486..7d11c51308 100644 --- a/engine/objconv/basemaker/base_maker_texture.cpp +++ b/engine/objconv/basemaker/base_maker_texture.cpp @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2022 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * base_maker_texture.cpp + * + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, * and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -13,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -325,7 +327,7 @@ void Texture::loadTexture(FILE *file, TextureTransform tt) { handle = (unsigned int) -1; return; } -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) glGenTextures( 1, (GLuint*) &handle ); #else glGenTextures(1, &handle); diff --git a/engine/objconv/basemaker/sprite.h b/engine/objconv/basemaker/sprite.h index 56fe296a8a..4c5a8221d0 100644 --- a/engine/objconv/basemaker/sprite.h +++ b/engine/objconv/basemaker/sprite.h @@ -1,6 +1,8 @@ /* - * Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy, Benjamen R. Meyer, - * and other Vega Strike contributors. + * sprite.h + * + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Benjamen R. Meyer, and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -13,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -28,7 +30,7 @@ #include "gfx/hud.h" #include "vs_globals.h" -#if defined (__APPLE__) || defined (MACOSX) +#if defined(__APPLE__) && defined(__MACH__) #include #include #else diff --git a/engine/objconv/trisort.cpp b/engine/objconv/trisort.cpp index f314f6a3ef..ccb31282e8 100644 --- a/engine/objconv/trisort.cpp +++ b/engine/objconv/trisort.cpp @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2022 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * trisort.cpp + * + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, * and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -13,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -29,7 +31,7 @@ #include #include "trisort.h" -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) #define sqrtf sqrt #endif diff --git a/engine/src/aldrv/al_globals.cpp b/engine/src/aldrv/al_globals.cpp index aaaa75d5e2..3f5c85315f 100644 --- a/engine/src/aldrv/al_globals.cpp +++ b/engine/src/aldrv/al_globals.cpp @@ -1,10 +1,8 @@ -/** +/* * al_globals.cpp * - * Copyright (C) Daniel Horn - * Copyright (C) 2020 pyramid3d, Stephen G. Tuggy, and other Vega Strike - * contributors - * Copyright (C) 2022 Stephen G. Tuggy + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * and other Vega Strike contributors * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -17,11 +15,11 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Vega Strike. If not, see . + * along with Vega Strike. If not, see . */ diff --git a/engine/src/aldrv/al_globals.h b/engine/src/aldrv/al_globals.h index a7a5b8ce51..ba3ba70a97 100644 --- a/engine/src/aldrv/al_globals.h +++ b/engine/src/aldrv/al_globals.h @@ -1,10 +1,8 @@ -/** +/* * al_globals.h * - * Copyright (C) Daniel Horn - * Copyright (C) 2020 pyramid3d, Stephen G. Tuggy, and other Vega Strike - * contributors - * Copyright (C) 2023 Stephen G. Tuggy, Benjamen R. Meyer + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Benjamen R. Meyer, and other Vega Strike contributors * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -17,11 +15,11 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Vega Strike. If not, see . + * along with Vega Strike. If not, see . */ #ifndef VEGA_STRIKE_ENGINE_AL_GLOBALS_H #define VEGA_STRIKE_ENGINE_AL_GLOBALS_H @@ -33,7 +31,7 @@ #include #ifdef HAVE_AL -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) #include #else #include diff --git a/engine/src/aldrv/al_init.cpp b/engine/src/aldrv/al_init.cpp index fddcb00dd6..c08911e43d 100644 --- a/engine/src/aldrv/al_init.cpp +++ b/engine/src/aldrv/al_init.cpp @@ -1,9 +1,8 @@ /* * al_init.cpp * - * Copyright (C) Daniel Horn - * Copyright (C) 2020 pyramid3d, Stephen G. Tuggy, and other Vega Strike contributors - * Copyright (C) 2021-2022 Stephen G. Tuggy + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Benjamen R. Meyer, and other Vega Strike contributors * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -16,16 +15,16 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Vega Strike. If not, see . + * along with Vega Strike. If not, see . */ #ifdef HAVE_AL -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) #include #include #define KeyMap AppleKeyMap diff --git a/engine/src/aldrv/al_listen.cpp b/engine/src/aldrv/al_listen.cpp index 91fff10820..231e428704 100644 --- a/engine/src/aldrv/al_listen.cpp +++ b/engine/src/aldrv/al_listen.cpp @@ -1,9 +1,8 @@ /* * al_listen.cpp * - * Copyright (C) Daniel Horn - * Copyright (C) 2020 pyramid3d, Stephen G. Tuggy, and other Vega Strike contributors - * Copyright (C) 2021-2022 Stephen G. Tuggy + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Benjamen R. Meyer, and other Vega Strike contributors * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -16,16 +15,16 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Vega Strike. If not, see . + * along with Vega Strike. If not, see . */ #ifdef HAVE_AL -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) #include #else #include diff --git a/engine/src/aldrv/al_sound.cpp b/engine/src/aldrv/al_sound.cpp index 4aca3bb2e7..173922a77a 100644 --- a/engine/src/aldrv/al_sound.cpp +++ b/engine/src/aldrv/al_sound.cpp @@ -1,10 +1,8 @@ /* * al_sound.cpp * - * Copyright (C) Daniel Horn - * Copyright (C) 2020 pyramid3d, Nachum Barcohen, Roy Falk, Stephen G. Tuggy, - * and other Vega Strike contributors - * Copyright (C) 2021-2022 Stephen G. Tuggy + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Benjamen R. Meyer, and other Vega Strike contributors * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -17,11 +15,11 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Vega Strike. If not, see . + * along with Vega Strike. If not, see . */ @@ -182,7 +180,7 @@ void blutLoadWAVMemory(ALbyte *memory, ALenum } } -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) #include #include //#include diff --git a/engine/src/audio/renderers/OpenAL/OpenALRenderer.cpp b/engine/src/audio/renderers/OpenAL/OpenALRenderer.cpp index cd5bf3ed27..ad4d2436d9 100644 --- a/engine/src/audio/renderers/OpenAL/OpenALRenderer.cpp +++ b/engine/src/audio/renderers/OpenAL/OpenALRenderer.cpp @@ -151,7 +151,7 @@ struct RendererData { #ifdef _WIN32 deviceSpecifier = "DirectSound3D"; #else - #ifdef __APPLE__ + #if defined(__APPLE__) && defined(__MACH__) deviceSpecifier = "sdl"; #endif #endif diff --git a/engine/src/audio/renderers/OpenAL/al.h b/engine/src/audio/renderers/OpenAL/al.h index 22d34bced0..388048eb65 100644 --- a/engine/src/audio/renderers/OpenAL/al.h +++ b/engine/src/audio/renderers/OpenAL/al.h @@ -1,10 +1,8 @@ -/** +/* * al.h * - * Copyright (C) Daniel Horn - * Copyright (C) 2020 pyramid3d, Stephen G. Tuggy, and other Vega Strike - * contributors - * Copyright (C) 2022-2023 Stephen G. Tuggy, Benjamen R. Meyer + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Benjamen R. Meyer, and other Vega Strike contributors * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -17,16 +15,16 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Vega Strike. If not, see . + * along with Vega Strike. If not, see . */ #ifndef VEGA_STRIKE_ENGINE_AUDIO_RENDERERS_OPENAL_AL_H #define VEGA_STRIKE_ENGINE_AUDIO_RENDERERS_OPENAL_AL_H -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) #include #include #else diff --git a/engine/src/cg_global.h b/engine/src/cg_global.h index a21cfd01ba..c0718a1cd3 100644 --- a/engine/src/cg_global.h +++ b/engine/src/cg_global.h @@ -1,9 +1,8 @@ /* * cg_global.h * - * Copyright (C) Daniel Horn - * Copyright (C) 2020 pyramid3d, Stephen G. Tuggy, and other Vega Strike contributors - * Copyright (C) 2021-2023 Stephen G. Tuggy, Benjamen R. Meyer + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Benjamen R. Meyer, and other Vega Strike contributors * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -16,18 +15,18 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Vega Strike. If not, see . + * along with Vega Strike. If not, see . */ #ifndef VEGA_STRIKE_ENGINE_CG_GLOBAL_H #define VEGA_STRIKE_ENGINE_CG_GLOBAL_H #if defined (CG_SUPPORT) -#if defined (__APPLE__) || defined (MACOSX) +#if defined(__APPLE__) && defined(__MACH__) #define MACOS 1 #elif !defined (WIN32) #define UNIX 1 diff --git a/engine/src/cmd/ai/flykeyboard.h b/engine/src/cmd/ai/flykeyboard.h index dcde8f78fe..7778325c27 100644 --- a/engine/src/cmd/ai/flykeyboard.h +++ b/engine/src/cmd/ai/flykeyboard.h @@ -1,10 +1,8 @@ -/** +/* * flykeyboard.h * - * Copyright (C) Daniel Horn - * Copyright (C) 2020 pyramid3d, Stephen G. Tuggy, and other Vega Strike - * contributors - * Copyright (C) 2022-2023 Stephen G. Tuggy, Benjamen R. Meyer + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Benjamen R. Meyer, and other Vega Strike contributors * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -17,17 +15,17 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Vega Strike. If not, see . + * along with Vega Strike. If not, see . */ #ifndef VEGA_STRIKE_ENGINE_CMD_AI_FLY_KEYBOARD_H #define VEGA_STRIKE_ENGINE_CMD_AI_FLY_KEYBOARD_H #include "in.h" -#if defined (__APPLE__) || defined (MACOSX) +#if defined(__APPLE__) && defined(__MACH__) #include #else #include diff --git a/engine/src/cmd/collide_map.h b/engine/src/cmd/collide_map.h index db74b864da..e59a55f919 100644 --- a/engine/src/cmd/collide_map.h +++ b/engine/src/cmd/collide_map.h @@ -1,7 +1,7 @@ /* * collide_map.h * - * Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, * Benjamen R. Meyer, and other Vega Strike contributors * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -15,11 +15,11 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Vega Strike. If not, see . + * along with Vega Strike. If not, see . */ #ifndef VEGA_STRIKE_ENGINE_CMD_COLLIDE_MAP_H #define VEGA_STRIKE_ENGINE_CMD_COLLIDE_MAP_H @@ -52,7 +52,7 @@ class Collidable { void SetPosition(const QVector &bpos) { //in case we want to drop in an xtra radius parameter when we get performance testing this->position = bpos; -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) if ( !FINITE( getKey() ) ) position = QVector( 0, 0, 0 ); //hack for now @@ -98,7 +98,7 @@ class Collidable { ref.bolt_index = bolt_index; radius = -speed * SIMULATION_ATOM; if ( -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) !FINITE( radius ) #else ISNAN(radius) diff --git a/engine/src/cmd/script/c_alike/c_alike.h b/engine/src/cmd/script/c_alike/c_alike.h index 9d71cfaa0d..76c3aab3ba 100644 --- a/engine/src/cmd/script/c_alike/c_alike.h +++ b/engine/src/cmd/script/c_alike/c_alike.h @@ -1,23 +1,25 @@ -/* - * Vega Strike - * Copyright (C) 2001-2002 Daniel Horn - * Copyright (C) 2022-2023 Stephen G. Tuggy, Benjamen R. Meyer - * - * http://vegastrike.sourceforge.net/ +/* + * c_alike.h + * + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, Benjamen R. Meyer, + * and other Vega Strike contributors. + * + * https://github.com/vegastrike/Vega-Strike-Engine-Source * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, + * This file is part of Vega Strike. + * + * Vega Strike is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * + * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + * along with Vega Strike. If not, see . */ // NO HEADER GUARD @@ -32,7 +34,7 @@ #include #elif defined(HAVE_LINUX_MALLOC_H) #include -#elif defined(__APPLE__) || defined(MACOSX) +#elif defined(__APPLE__) && defined(__MACH__) #include #elif defined(HAVE_MALLOC_H) #include diff --git a/engine/src/endianness.h b/engine/src/endianness.h index 459c4d10e4..61b9787e86 100644 --- a/engine/src/endianness.h +++ b/engine/src/endianness.h @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy, Benjamen R. Meyer, + * endianness.h + * + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, Benjamen R. Meyer, * and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -13,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -42,7 +44,7 @@ double DONTUSE__NXSwapBigDoubleToLittleEndian(double x); #endif //defined (IRIX) #endif //defined (__HAIKU__) -#if defined (__APPLE__) +#if defined (__APPLE__) && defined(__MACH__) #if defined (__BIG_ENDIAN__) #if defined (__x86_64__) #include @@ -60,7 +62,7 @@ double DONTUSE__NXSwapBigDoubleToLittleEndian(double x); #define le16_to_cpu( x ) (x) #define le64_to_cpu( x ) (x) #endif //defined (__BIG_ENDIAN__) -#else //defined (__APPLE__) +#else //defined (__APPLE__) && defined(__MACH__) #if defined (IRIX) || (defined (__SVR4) && defined (__sun )) #include # if BYTE_ORDER == BIG_ENDIAN /* depends on MIPSEB or MIPSEL and SGIAPI */ diff --git a/engine/src/gfx/mesh_gfx.cpp b/engine/src/gfx/mesh_gfx.cpp index 7e784982ab..5979a792f5 100644 --- a/engine/src/gfx/mesh_gfx.cpp +++ b/engine/src/gfx/mesh_gfx.cpp @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2022 Daniel Horn, surfdargent, hellcatv, ace123, + * mesh_gfx.cpp + * + * Copyright (C) 2001-2024 Daniel Horn, surfdargent, hellcatv, ace123, * klaussfreire, dan_w, pyramid3d, Stephen G. Tuggy, * and other Vega Strike contributors. * @@ -14,7 +16,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -2071,7 +2073,7 @@ void Mesh::initTechnique(const std::string &xmltechnique) { string effective; if (Decal.size() > 1 || getEnvMap()) { //Use shader-ified technique for multitexture or environment-mapped meshes -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) static string shader_technique = vs_config->getVariable( "graphics", "default_full_technique", "mac" ); #else static string shader_technique = vs_config->getVariable("graphics", "default_full_technique", "default"); diff --git a/engine/src/gfx/star.cpp b/engine/src/gfx/star.cpp index 752b2bc928..ecad7de42a 100644 --- a/engine/src/gfx/star.cpp +++ b/engine/src/gfx/star.cpp @@ -1,9 +1,8 @@ /* * star.cpp * - * Copyright (C) Daniel Horn - * Copyright (C) 2020 pyramid3d, Stephen G. Tuggy, and other Vega Strike contributors - * Copyright (C) 2021-2022 Stephen G. Tuggy + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Benjamen R. Meyer, and other Vega Strike contributors * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -16,11 +15,11 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Vega Strike. If not, see . + * along with Vega Strike. If not, see . */ @@ -37,7 +36,7 @@ #include "universe.h" #include "vs_logging.h" -#if defined (__APPLE__) || defined (MACOSX) +#if defined(__APPLE__) && defined(__MACH__) #include #else #include diff --git a/engine/src/gfx/vsimage.cpp b/engine/src/gfx/vsimage.cpp index af9baa1090..b81f750fae 100644 --- a/engine/src/gfx/vsimage.cpp +++ b/engine/src/gfx/vsimage.cpp @@ -1,7 +1,7 @@ /* * vsimage.cpp * - * Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, * and other Vega Strike contributors * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -15,17 +15,17 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Vega Strike. If not, see . + * along with Vega Strike. If not, see . */ #include "vsimage.h" -#if defined (__APPLE__) || defined (MACOSX) +#if defined(__APPLE__) && defined(__MACH__) # include # include #else diff --git a/engine/src/gfxlib.h b/engine/src/gfxlib.h index ddbee14d5c..83b3e009f7 100644 --- a/engine/src/gfxlib.h +++ b/engine/src/gfxlib.h @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy, Benjamen R. Meyer, + * gfxlib.h + * + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, Benjamen R. Meyer, * and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -13,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -32,16 +34,6 @@ #define GFXDRVAPI #endif //defined (_WIN32) && !defined (__CYGWIN__) -/* - * #if 0 - * #if defined(__APPLE__) || defined(MACOSX) - * #include - * #else - * #include - * #endif - * #endif - */ - #include #include class Matrix; diff --git a/engine/src/gldrv/gl_globals.h b/engine/src/gldrv/gl_globals.h index 074f28a669..429cb4012c 100644 --- a/engine/src/gldrv/gl_globals.h +++ b/engine/src/gldrv/gl_globals.h @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2023 Daniel Horn, Alan Shieh, pyramid3d, + * gl_globals.h + * + * Copyright (C) 2001-2024 Daniel Horn, Alan Shieh, pyramid3d, * Stephen G. Tuggy, Benjamen R. Meyer, and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -13,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -100,7 +102,7 @@ struct GFXStats #include #include #endif -#if defined (__APPLE__) || defined (MACOSX) +#if defined(__APPLE__) && defined(__MACH__) #include //#if defined( GL_INIT_CPP) || defined( GL_MISC_CPP) || defined( GL_STATE_CPP) #if defined (GL_ARB_vertex_program) && defined (GL_ARB_fragment_program) diff --git a/engine/src/gldrv/gl_include.h b/engine/src/gldrv/gl_include.h index 5c94db9481..81dc20f80b 100644 --- a/engine/src/gldrv/gl_include.h +++ b/engine/src/gldrv/gl_include.h @@ -1,6 +1,8 @@ /* - * Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy, Benjamen R. Meyer, - * and other Vega Strike contributors. + * gl_include.h + * + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Benjamen R. Meyer, and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -13,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -23,7 +25,7 @@ #ifndef VEGA_STRIKE_ENGINE_GLDRV_GL_INCLUDE_H #define VEGA_STRIKE_ENGINE_GLDRV_GL_INCLUDE_H -#if defined (__APPLE__) || defined (MACOSX) +#if defined(__APPLE__) && defined(__MACH__) # include #else # include diff --git a/engine/src/gldrv/gl_init.cpp b/engine/src/gldrv/gl_init.cpp index 8596ec0402..3bf4951dfd 100644 --- a/engine/src/gldrv/gl_init.cpp +++ b/engine/src/gldrv/gl_init.cpp @@ -1,7 +1,7 @@ /* * gl_init.cpp * - * Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, * and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -15,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -40,23 +40,13 @@ #if !defined (_WIN32) && !defined (__CYGWIN__) -//#if !(defined(__APPLE__) || defined(MACOSX)) -//#define GL_GLEXT_PROTOTYPES 1 -//#define GLX_GLXEXT_PROTOTYPES 1 -//#define GLX_GLXEXT_LEGACY 1 - -//# include -//# include -//# include -//#endif - #include #else #ifndef NOMINMAX #define NOMINMAX #endif //tells VCC not to generate min/max macros -// #if defined (__APPLE__) || defined (MACOSX) +// #if defined(__APPLE__) && defined(__MACH__) // #include // #else #define GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB 0x884F @@ -64,7 +54,7 @@ #include #endif #define GL_GLEXT_PROTOTYPES 1 -#if defined (__APPLE__) || defined (MACOSX) +#if defined(__APPLE__) && defined(__MACH__) #include #include #include @@ -260,7 +250,7 @@ void init_opengl_extensions() { #ifndef NO_COMPILEDVERTEXARRAY_SUPPORT if (vsExtensionSupported("GL_EXT_compiled_vertex_array") && game_options()->LockVertexArrays) { -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) #ifndef __APPLE_PANTHER_GCC33_CLI__ #if defined (glLockArraysEXT) && defined (glUnlockArraysEXT) glLockArraysEXT_p = &glLockArraysEXT; @@ -281,7 +271,7 @@ void init_opengl_extensions() { #endif VS_LOG(trace, "OpenGL::GL_EXT_compiled_vertex_array supported"); } else { -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) glLockArraysEXT_p = nullptr; glUnlockArraysEXT_p = nullptr; #endif diff --git a/engine/src/gldrv/gl_init.h b/engine/src/gldrv/gl_init.h index 0c85fad020..a74fd305c8 100644 --- a/engine/src/gldrv/gl_init.h +++ b/engine/src/gldrv/gl_init.h @@ -1,9 +1,8 @@ -/** +/* * gl_init.h * - * Copyright (C) 2001-2002 Daniel Horn - * Copyright (C) 2020-2023 pyramid3d, Stephen G. Tuggy, Benjamen R. Meyer, and other Vega Strike - * contributors + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Benjamen R. Meyer, and other Vega Strike contributors * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -11,16 +10,16 @@ * * Vega Strike is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or + * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with Vega Strike. If not, see . + * along with Vega Strike. If not, see . */ #ifndef VEGA_STRIKE_ENGINE_GLDRV_GL_INIT_H #define VEGA_STRIKE_ENGINE_GLDRV_GL_INIT_H @@ -62,7 +61,7 @@ typedef void (*PFNGLLOCKARRAYSEXTPROC)( GLint first, GLsizei count ); typedef void (*PFNGLUNLOCKARRAYSEXTPROC)( void ); #elif !defined (_WIN32) -#if defined (__APPLE__) || defined (MACOSX) +#if defined(__APPLE__) && defined(__MACH__) #include #include #else diff --git a/engine/src/gldrv/gl_program.cpp b/engine/src/gldrv/gl_program.cpp index 75b5770ac2..28673755f8 100644 --- a/engine/src/gldrv/gl_program.cpp +++ b/engine/src/gldrv/gl_program.cpp @@ -1,7 +1,7 @@ /* * gl_program.cpp * - * Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, * and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -15,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -395,7 +395,7 @@ static int hifiprog = 0; // THIS IS STUPID! -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) std::string hifiProgramName = "mac"; std::string lowfiProgramName = "maclite"; #else @@ -410,7 +410,7 @@ int getDefaultProgram() { if (!initted) { // THIS IS STUPID, Also why is lofi not configurable ? -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) hifiProgramName = game_options()->mac_shader_name; #else hifiProgramName = game_options()->shader_name; diff --git a/engine/src/gldrv/gl_texture.cpp b/engine/src/gldrv/gl_texture.cpp index abd11fab78..149fa30ed1 100644 --- a/engine/src/gldrv/gl_texture.cpp +++ b/engine/src/gldrv/gl_texture.cpp @@ -123,7 +123,7 @@ bool isPowerOfTwo(int num, int &which) { return true; } -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) static GLint round2( GLint n ) { @@ -403,7 +403,7 @@ GFXBOOL /*GFXDRVAPI*/ GFXCreateTexture(int width, void /*GFXDRVAPI*/ GFXPrioritizeTexture(unsigned int handle, float priority) { glPrioritizeTextures(1, -#if defined (__APPLE__) +#if defined (__APPLE__) && defined(__MACH__) (GLuint*) #endif &handle, &priority); diff --git a/engine/src/gldrv/winsys.cpp b/engine/src/gldrv/winsys.cpp index 79e396840d..272d3adce6 100644 --- a/engine/src/gldrv/winsys.cpp +++ b/engine/src/gldrv/winsys.cpp @@ -1,25 +1,10 @@ /* - * Tux Racer - * Copyright (C) 1999-2001 Jasmin F. Patry + * winsys.cpp + * + * Incorporated into Vega Strike from Tux Racer * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Incorporated into Vega Strike - * - * Copyright (C) 2001-2022 Daniel Horn, pyramid3d, Stephen G. Tuggy, - * and other Vega Strike contributors. + * Copyright (C) 1999-2024 Jasmin F. Patry, Daniel Horn, pyramid3d, + * Benjamen R. Meyer, Stephen G. Tuggy, and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -753,7 +738,7 @@ void winsys_init( int *argc, char **argv, char const *window_title, char const * gl_options.color_depth = game_options()->colordepth; glutInit( argc, argv ); if (game_options()->glut_stencil) { -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) if ( !(glutInitDisplayMode( GLUT_RGBA|GLUT_DEPTH|GLUT_DOUBLE|GLUT_STENCIL ), 1) ) glutInitDisplayMode( GLUT_RGBA|GLUT_DEPTH|GLUT_DOUBLE ); #else diff --git a/engine/src/gldrv/winsys.h b/engine/src/gldrv/winsys.h index 06fdd8463b..b1b7f11ba4 100644 --- a/engine/src/gldrv/winsys.h +++ b/engine/src/gldrv/winsys.h @@ -1,26 +1,10 @@ /* - * Tux Racer - * Copyright (C) 1999-2001 Jasmin F. Patry - * Copyright (C) 2023 Benjamen R. Meyer + * winsys.h * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. + * Incorporated into Vega Strike from Tux Racer * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Incorporated into Vega Strike - * - * Copyright (C) 2001-2022 Daniel Horn, pyramid3d, Stephen G. Tuggy, - * and other Vega Strike contributors. + * Copyright (C) 1999-2024 Jasmin F. Patry, Daniel Horn, pyramid3d, + * Benjamen R. Meyer, Stephen G. Tuggy, and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -51,7 +35,7 @@ #if defined( SDL_WINDOWING ) && defined (HAVE_SDL) # include "SDL2/SDL.h" #elif defined( HAVE_GLUT ) -#if defined(__APPLE__) || defined(MACOSX) +#if defined(__APPLE__) && defined(__MACH__) #include #else #include @@ -100,13 +84,13 @@ typedef enum { WSK_TAB = '\t', WSK_ESCAPE = 27, WSK_BACKSPACE = -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) 127, #else 8, #endif WSK_DELETE = -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) 8, #else 127, @@ -227,13 +211,13 @@ typedef enum { WSK_TAB = '\t', WSK_ESCAPE = 27, WSK_BACKSPACE = -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) 127, #else 8, #endif WSK_DELETE = -#ifdef __APPLE__ +#if defined(__APPLE__) && defined(__MACH__) 8, #else 127, diff --git a/engine/src/gui/button.h b/engine/src/gui/button.h index 14d266bc82..17a3632030 100644 --- a/engine/src/gui/button.h +++ b/engine/src/gui/button.h @@ -1,6 +1,8 @@ /* - * Copyright (C) 2001-2023 Daniel Horn, David Ranger, pyramid3d, Stephen G. Tuggy, Benjamen R. Meyer, - * and other Vega Strike contributors. + * button.h + * + * Copyright (C) 2001-2024 Daniel Horn, David Ranger, pyramid3d, + * Stephen G. Tuggy, Benjamen R. Meyer, and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -13,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -28,7 +30,7 @@ * The only external functions it requires that aren't provided by system libs are in glut_support.h */ -#if defined (__APPLE__) || defined (MACOSX) +#if defined(__APPLE__) && defined(__MACH__) #include #include #else diff --git a/engine/src/gui/text_area.h b/engine/src/gui/text_area.h index b232415aab..8d8937ae11 100644 --- a/engine/src/gui/text_area.h +++ b/engine/src/gui/text_area.h @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2023 Daniel Horn, David Ranger, pyramid3d, + * text_area.h + * + * Copyright (C) 2001-2024 Daniel Horn, David Ranger, pyramid3d, * Stephen G. Tuggy, Benjamen R. Meyer, and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -13,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -35,7 +37,7 @@ //There are places where a float is converted to an int. This define takes extra steps to convert without a warning (float -> char -> int) #define NO_WARNINGS -#if defined (__APPLE__) || defined (MACOSX) +#if defined(__APPLE__) && defined(__MACH__) #include #include #else diff --git a/engine/src/macosx_math.cpp b/engine/src/macosx_math.cpp index b7623560d7..a3f3b26433 100644 --- a/engine/src/macosx_math.cpp +++ b/engine/src/macosx_math.cpp @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2022 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * macosx_math.cpp + * + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, * and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -13,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -23,7 +25,7 @@ #include #include #include "posh.h" -#if defined (__APPLE__) +#if defined (__APPLE__) && defined(__MACH__) //these stuffs are included in OSX 10.4 and above--so just check for x86 #include #include diff --git a/engine/src/macosx_math.h b/engine/src/macosx_math.h index cccef2bc15..041a41fe7a 100644 --- a/engine/src/macosx_math.h +++ b/engine/src/macosx_math.h @@ -1,6 +1,8 @@ /* - * Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy, Benjamen R. Meyer, - * and other Vega Strike contributors. + * macosx_math.h + * + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Benjamen R. Meyer, and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -13,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -25,7 +27,7 @@ /// works on *any* float... INF is 0x7ffffff and -INF is -(1<<31) NaN is 0 extern int float_to_int(float); extern int double_to_int(float); //works on *any* float -#if defined (__APPLE__) || defined (MACOSX) +#if defined(__APPLE__) && defined(__MACH__) #include extern float sqrtf( float v ); extern float cosf( float v ); diff --git a/engine/src/precompiled.h b/engine/src/precompiled.h index ff806236da..4b8cae670d 100644 --- a/engine/src/precompiled.h +++ b/engine/src/precompiled.h @@ -1,6 +1,8 @@ /* - * Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy, Benjamen R. Meyer, - * and other Vega Strike contributors. + * precompiled.h + * + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Benjamen R. Meyer, and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -13,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -51,7 +53,7 @@ #define GL_GLEXT_PROTOTYPES 1 -#if defined (__APPLE__) || defined (MACOSX) +#if defined(__APPLE__) && defined(__MACH__) #include #include #else //defined (__APPLE__) || defined (MACOSX) diff --git a/engine/src/universe.cpp b/engine/src/universe.cpp index ceb935368d..4eabb25d0b 100644 --- a/engine/src/universe.cpp +++ b/engine/src/universe.cpp @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2022 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * universe.cpp + * + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, * and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -13,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -40,7 +42,7 @@ #include "in_kb.h" #include "in_kb_data.h" #include "in_main.h" -#if defined (__APPLE__) +#if defined (__APPLE__) && defined(__MACH__) #import #endif #include "savegame.h" @@ -324,13 +326,13 @@ void CleanupUnitTables() { // Constructors and Init Universe::Universe(int argc, char **argv, const char *galaxy_str) { //Select drivers -#if defined (__APPLE__) +#if defined (__APPLE__) && defined(__MACH__) //get the current working directory so when glut trashes it we can restore. char pwd[MAXPATHLEN]; getcwd( pwd, MAXPATHLEN ); #endif GFXInit(argc, argv); -#if defined (__APPLE__) +#if defined (__APPLE__) && defined(__MACH__) //Restore it chdir( pwd ); #endif diff --git a/engine/src/vegastrike.h b/engine/src/vegastrike.h index 41fed397ea..93e2054a12 100644 --- a/engine/src/vegastrike.h +++ b/engine/src/vegastrike.h @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy, Benjamen R. Meyer, + * vegastrike.h + * + * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, Benjamen R. Meyer, * and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -13,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -67,7 +69,7 @@ extern float AUDIO_ATOM; #endif //defined (WIN32) || defined (__CYGWIN__) #ifndef NO_GFX - #if defined (__APPLE__) || defined (MACOSX) + #if defined(__APPLE__) && defined(__MACH__) #include #include #include diff --git a/engine/vcpkg.json b/engine/vcpkg.json index d1e6597b2e..e7d79b999e 100644 --- a/engine/vcpkg.json +++ b/engine/vcpkg.json @@ -2,7 +2,7 @@ "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", "name": "vega-strike", "version-string": "0.9.0", - "builtin-baseline": "a34c873a9717a888f58dc05268dea15592c2f0ff", + "builtin-baseline": "da4b78d35084ec4e9808aa02017028da03b8d2ab", "dependencies": [ "boost-python", "boost-log", diff --git a/script/bootstrap-on-macos.sh b/script/bootstrap-on-macos.sh new file mode 100644 index 0000000000..9b81772402 --- /dev/null +++ b/script/bootstrap-on-macos.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +# +# bootstrap-on-macos.sh +# +# Copyright (C) 2023-2024 Stephen G. Tuggy and other +# Vega Strike contributors +# +# This file is part of Vega Strike. +# +# Vega Strike is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Vega Strike is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Vega Strike. If not, see . + +set -e + +declare -a packages_to_install=("openssl@3" "python@3.11" "python@3.12" "boost" "boost-python3" "gtk+3" "gtkglext" "sdl12-compat" "sdl2" "mesa" "mesa-glu" "freeglut" "openal-soft" "cmake" "expat" "jpeg" "libpng" "libvorbis") +declare -a links_to_delete=("2to3" "idle3" "pydoc3" "python3" "python3-config" "2to3-3.11" "idle3.11" "pydoc3.11" "python3.11" "python3.11-config" "2to3-3.12" "idle3.12" "pydoc3.12" "python3.12" "python3.12-config") + +for i in "${links_to_delete[@]}" +do + link_path="/usr/local/bin/$i" + if [ -f "$link_path" ] + then + rm "/usr/local/bin/$i" + fi +done + +brew update + +for j in "${packages_to_install[@]}" +do + brew install "$j" + PACKAGE_INSTALLED_PREFIX=$(brew --prefix "$j") + PACKAGE_INSTALLED_BIN="$PACKAGE_INSTALLED_PREFIX/bin" + export PATH="$PACKAGE_INSTALLED_BIN:$PATH" + export CMAKE_PREFIX_PATH="$PACKAGE_INSTALLED_PREFIX:$CMAKE_PREFIX_PATH" +done + +ln -s /usr/local/include/GL /usr/local/include/OpenGL +ln -s /usr/local/include/GL /usr/local/include/GLUT +OPENALDIR=$(brew --prefix openal-soft) +export OPENALDIR diff --git a/script/brew-install-for-cmake.sh b/script/brew-install-for-cmake.sh new file mode 100644 index 0000000000..f4f600ef2b --- /dev/null +++ b/script/brew-install-for-cmake.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +#==================================== +# @file : brew-install-for-cmake.sh +# @brief : installs a package with Homebrew, keg-only, then registers that package's +# include, lib, bin, etc. directories for use by CMake +# @usage : script/brew-install-for-cmake.sh +# @param : first, the brew formula name, optionally including a version suffix +# second, a truthy value indicating whether or not to leave it linked +#==================================== +# Copyright (C) 2023-2024 Stephen G. Tuggy and other +# Vega Strike contributors +# +# This file is part of Vega Strike. +# +# Vega Strike is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Vega Strike is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Vega Strike. If not, see . + +set -e + +PACKAGE_SPEC="$1" +LEAVE_LINKED="$2" + +#export HOMEBREW_NO_AUTO_UPDATE=1 +#export HOMEBREW_NO_INSTALL_UPGRADE=1 +#export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 + +if ! brew list "$PACKAGE_SPEC" &>/dev/null; then + if "$LEAVE_LINKED"; then + brew install --force --overwrite "$PACKAGE_SPEC" + else + brew install "$PACKAGE_SPEC" + brew unlink "$PACKAGE_SPEC" + fi +fi +PACKAGE_INSTALLED_PREFIX=$(brew --prefix "$PACKAGE_SPEC") +PACKAGE_INSTALLED_BIN="$PACKAGE_INSTALLED_PREFIX/bin" +#PACKAGE_INSTALLED_INCLUDE="$PACKAGE_INSTALLED_PREFIX/include" +#PACKAGE_INSTALLED_LIB="$PACKAGE_INSTALLED_PREFIX/lib" +export PATH="$PACKAGE_INSTALLED_BIN:$PATH" +export CMAKE_PREFIX_PATH="$PACKAGE_INSTALLED_PREFIX:$CMAKE_PREFIX_PATH"