From 19481991859938293694c63d0a2ee6b3c9cf1705 Mon Sep 17 00:00:00 2001 From: Stephen G Tuggy Date: Thu, 9 Jan 2025 21:46:34 -0800 Subject: [PATCH] Updates to 33 files to (hopefully) get VS 0.10.x working on Mac! --- engine/CMakeLists.txt | 40 +++++++++++++++---- engine/objconv/asteroidgen.cpp | 8 ++-- engine/objconv/basemaker/base_maker.cpp | 16 ++++---- .../objconv/basemaker/base_maker_texture.cpp | 8 ++-- engine/objconv/basemaker/sprite.h | 16 ++++---- engine/objconv/trisort.cpp | 8 ++-- engine/src/aldrv/al_globals.h | 14 +++---- engine/src/aldrv/al_init.cpp | 11 +++-- engine/src/aldrv/al_listen.cpp | 11 +++-- engine/src/aldrv/al_sound.cpp | 12 +++--- .../audio/renderers/OpenAL/OpenALRenderer.cpp | 8 ++-- engine/src/audio/renderers/OpenAL/al.h | 14 +++---- engine/src/cg_global.h | 18 ++++----- engine/src/cmd/ai/flykeyboard.h | 19 ++++----- engine/src/cmd/collide_map.h | 10 ++--- engine/src/gfx/mesh_gfx.cpp | 8 ++-- engine/src/gfx/screenshot.cpp | 19 ++++----- engine/src/gfx/sprite.h | 6 ++- engine/src/gfx/star.cpp | 16 ++++---- engine/src/gfx/vsimage.cpp | 16 +++----- engine/src/gldrv/gl_globals.h | 21 ++++++---- engine/src/gldrv/gl_include.h | 14 ++++--- engine/src/gldrv/gl_init.cpp | 25 ++++++------ engine/src/gldrv/gl_init.h | 28 ++++++------- engine/src/gldrv/gl_program.cpp | 8 ++-- engine/src/gldrv/gl_texture.cpp | 6 +-- engine/src/gldrv/winsys.cpp | 11 ++--- engine/src/gldrv/winsys.h | 32 +++++++-------- engine/src/gui/button.h | 21 +++++----- engine/src/gui/text_area.h | 19 +++++---- engine/src/macosx_math.h | 12 +++--- engine/src/precompiled.h | 16 ++++---- engine/src/vegastrike.h | 29 ++++++++------ 33 files changed, 271 insertions(+), 249 deletions(-) diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt index 1790f5c2f6..ea9336694f 100644 --- a/engine/CMakeLists.txt +++ b/engine/CMakeLists.txt @@ -209,13 +209,23 @@ INCLUDE_DIRECTORIES(${TST_INCLUDES}) IF (NOT DISABLE_CLIENT) ########## #Find GL + SET(CMAKE_FIND_FRAMEWORK "FIRST") FIND_PACKAGE(OpenGL REQUIRED) IF (OPENGL_FOUND AND OPENGL_GLU_FOUND) - SET(TST_INCLUDES ${TST_INCLUDES} ${OPENGL_INCLUDE_DIR}) - # SET(TST_LIBS ${TST_LIBS} "${OpenGL::GL}" "${OpenGL::GLU}") - MESSAGE("++ OpenGL found") + MESSAGE(STATUS "OpenGL found") + SET(CMAKE_FIND_FRAMEWORK "LAST") + FIND_FILE(VEGA_GLEXT_H_PATH glext.h PATH_SUFFIXES GL/ OpenGL/) + get_filename_component(VEGA_GLEXT_H_DIRECTORY ${VEGA_GLEXT_H_PATH} DIRECTORY) + MESSAGE(STATUS "Path to glext.h: ${VEGA_GLEXT_H_PATH}") + FIND_FILE(VEGA_GL_H_PATH gl.h PATH_SUFFIXES GL/ OpenGL/) + get_filename_component(VEGA_GL_H_DIRECTORY ${VEGA_GL_H_PATH} DIRECTORY) + MESSAGE(STATUS "Path to gl.h: ${VEGA_GL_H_PATH}") + FIND_FILE(VEGA_GLU_H_PATH glu.h PATH_SUFFIXES GL/ OpenGL/) + get_filename_component(VEGA_GLU_H_DIRECTORY ${VEGA_GLU_H_PATH} DIRECTORY) + MESSAGE(STATUS "Path to glu.h: ${VEGA_GLU_H_PATH}") + SET(TST_INCLUDES ${TST_INCLUDES} ${VEGA_GLEXT_H_DIRECTORY} ${VEGA_GL_H_DIRECTORY} ${VEGA_GLU_H_DIRECTORY}) ELSE (OPENGL_FOUND AND OPENGL_GLU_FOUND) - MESSAGE("!! Why you no have GL?") + MESSAGE(SEND_WARNING "Why you no have GL?") ENDIF (OPENGL_FOUND AND OPENGL_GLU_FOUND) # Workaround two oversights in FindGLUT (when trying to use freeglut on MacOS): @@ -236,16 +246,22 @@ IF (NOT DISABLE_CLIENT) ########## SET(OPENGL_LIBRARY_DIR "${OPENGL_INCLUDE_DIR}/GLUT") #Find GLUT + SET(CMAKE_FIND_FRAMEWORK "FIRST") FIND_PACKAGE(GLUT REQUIRED) IF (GLUT_FOUND) - SET(TST_INCLUDES ${TST_INCLUDES} ${GLUT_INCLUDE_DIR}) + MESSAGE(STATUS "GLUT found : ${GLUT_LIBRARIES}") + SET(CMAKE_FIND_FRAMEWORK "LAST") + FIND_FILE(VEGA_GLUT_H_PATH glut.h PATH_SUFFIXES GL/ GLUT/) + get_filename_component(VEGA_GLUT_H_DIRECTORY ${VEGA_GLUT_H_PATH} DIRECTORY) + MESSAGE(STATUS "Path to glut.h: ${VEGA_GLUT_H_PATH}") + SET(TST_INCLUDES ${TST_INCLUDES} ${VEGA_GLUT_H_DIRECTORY} ${GLUT_INCLUDE_DIR}) SET(TST_LIBS ${TST_LIBS} ${GLUT_LIBRARIES}) - MESSAGE("++ GLUT found : ${GLUT_LIBRARIES}") ELSE (GLUT_FOUND) - MESSAGE("!! I can't build this, missing GLUT") + MESSAGE(SEND_WARNING "I can't build this, missing GLUT") ENDIF (GLUT_FOUND) UNSET(OPENGL_LIBRARY_DIR) + SET(CMAKE_FIND_FRAMEWORK "LAST") #Find OpenAL FIND_PACKAGE(OpenAL REQUIRED) @@ -916,6 +932,10 @@ TARGET_LINK_LIBRARIES( SET_TARGET_PROPERTIES(vegastrike_python PROPERTIES PREFIX "") ADD_LIBRARY(vegastrike-engine_com + ${VEGA_GL_H_PATH} + ${VEGA_GLU_H_PATH} + ${VEGA_GLEXT_H_PATH} + ${VEGA_GLUT_H_PATH} ${LIBPYTHON} ${LIBVS_LOGGING} ${LIBCONFIG} @@ -946,6 +966,10 @@ IF (WIN32) ENDIF() SET(VEGASTRIKE_SOURCES + ${VEGA_GL_H_PATH} + ${VEGA_GLU_H_PATH} + ${VEGA_GLEXT_H_PATH} + ${VEGA_GLUT_H_PATH} ${LIBGUI_SOURCES} ${LIBNETCLIENT_SOURCES} ${LIBROOTCLIENT_SOURCES} @@ -1051,7 +1075,7 @@ ENDIF (NOT DISABLE_CLIENT) # Vssetup Sub build file ADD_SUBDIRECTORY(setup) -# Add other utilies here +# Add other utilities here ADD_SUBDIRECTORY(objconv) ## show debug output diff --git a/engine/objconv/asteroidgen.cpp b/engine/objconv/asteroidgen.cpp index 4aad7557cd..f1afdb3fee 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-2025 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 0b449932ea..eb79d89adf 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-2025 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,13 +48,9 @@ #include //for mkdir #include -#if defined (__APPLE__) || defined (MACOSX) - #include - #include -#else - #include - #include -#endif +// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766 +#include +#include /* * Globals diff --git a/engine/objconv/basemaker/base_maker_texture.cpp b/engine/objconv/basemaker/base_maker_texture.cpp index a5a5a0c486..d56140ecdd 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-2025 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..275426eb7f 100644 --- a/engine/objconv/basemaker/sprite.h +++ b/engine/objconv/basemaker/sprite.h @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy, Benjamen R. Meyer, + * sprite.h + * + * Copyright (C) 2001-2025 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,13 +30,9 @@ #include "gfx/hud.h" #include "vs_globals.h" -#if defined (__APPLE__) || defined (MACOSX) - #include - #include -#else - #include - #include -#endif +// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766 +#include +#include #include //#include diff --git a/engine/objconv/trisort.cpp b/engine/objconv/trisort.cpp index f314f6a3ef..41e18de456 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-2025 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.h b/engine/src/aldrv/al_globals.h index a7a5b8ce51..75e8a482d6 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-2025 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..a9ad706a74 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-2025 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * 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..7236506f75 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-2025 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * 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..56020778f7 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-2025 Daniel Horn, pyramid3d, Nachum Barcohen, + * Roy Falk, 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 . */ @@ -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..2099b65c38 100644 --- a/engine/src/audio/renderers/OpenAL/OpenALRenderer.cpp +++ b/engine/src/audio/renderers/OpenAL/OpenALRenderer.cpp @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2022 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * OpenALRenderer.cpp + * + * Copyright (C) 2001-2025 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 @@ -151,7 +153,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..6375000ec6 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-2025 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..2c276fe3dd 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-2025 Daniel Horn, pyramid3d, Benjamen R. Meyer, + * Stephen G. Tuggy, and other Vega Strike contributors * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -16,32 +15,33 @@ * * 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 -#endif //defined (__APPLE__) || defined (MACOSX) +#endif #include "gldrv/gl_globals.h" #if defined (UNIX) +// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766 #define GLX_GLXEXT_PROTOTYPES 1 -#include +#include #include "gldrv/glx_undefined_extensions.h" -#include +#include #endif //defined (UNIX) diff --git a/engine/src/cmd/ai/flykeyboard.h b/engine/src/cmd/ai/flykeyboard.h index dcde8f78fe..4f740b0ec7 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-2025 Daniel Horn, pyramid3d, Benjamen R. Meyer, + * Stephen G. Tuggy, and other Vega Strike contributors * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -17,21 +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_CMD_AI_FLY_KEYBOARD_H #define VEGA_STRIKE_ENGINE_CMD_AI_FLY_KEYBOARD_H #include "in.h" -#if defined (__APPLE__) || defined (MACOSX) -#include -#else -#include -#endif +// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766 +#include #include "flybywire.h" class FlyByKeyboard : public FlyByWire { diff --git a/engine/src/cmd/collide_map.h b/engine/src/cmd/collide_map.h index db74b864da..3121ff94e9 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-2025 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/gfx/mesh_gfx.cpp b/engine/src/gfx/mesh_gfx.cpp index 91f2d7c4b1..abb7eeb5ea 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-2025 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 @@ -2070,7 +2072,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/screenshot.cpp b/engine/src/gfx/screenshot.cpp index b98b544ca3..2545e1cfc6 100644 --- a/engine/src/gfx/screenshot.cpp +++ b/engine/src/gfx/screenshot.cpp @@ -1,10 +1,8 @@ -/** +/* * screenshot.cpp * - * Copyright (c) 2001-2002 Daniel Horn - * Copyright (c) 2002-2019 pyramid3d and other Vega Strike Contributors - * Copyright (c) 2019-2021 Stephen G. Tuggy, and other Vega Strike Contributors - * Copyright (C) 2022 Stephen G. Tuggy + * Copyright (c) 2001-2025 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * and other Vega Strike Contributors * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -12,12 +10,12 @@ * * 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 @@ -29,11 +27,8 @@ #include "vs_globals.h" #include "xml_support.h" #include "vsimage.h" -#ifndef __APPLE__ -#include -#else -#include -#endif +// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766 +#include using namespace VSFileSystem; diff --git a/engine/src/gfx/sprite.h b/engine/src/gfx/sprite.h index 150ec7b166..6979fd52d7 100644 --- a/engine/src/gfx/sprite.h +++ b/engine/src/gfx/sprite.h @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2023 Daniel Horn, Alan Shieh, klaussfreire, + * sprite.h + * + * Copyright (C) 2001-2025 Daniel Horn, Alan Shieh, klaussfreire, * surfdargent, dan_w, pyramid3d, Stephen G. Tuggy, Benjamen R. Meyer, * 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 diff --git a/engine/src/gfx/star.cpp b/engine/src/gfx/star.cpp index 752b2bc928..0738a662dd 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-2025 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * 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,10 +36,11 @@ #include "universe.h" #include "vs_logging.h" -#if defined (__APPLE__) || defined (MACOSX) -#include +// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766 +#if defined(__APPLE__) && defined (__MACH__) +#include #else -#include +#include #endif #define SINX 1 diff --git a/engine/src/gfx/vsimage.cpp b/engine/src/gfx/vsimage.cpp index af9baa1090..221f0a9aa7 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-2025 Daniel Horn, pyramid3d, Stephen G. Tuggy, * and other Vega Strike contributors * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -15,23 +15,19 @@ * * 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) -# include -# include -#else -# include -# include -#endif +// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766 +#include +#include #include "cmd/unit_generic.h" diff --git a/engine/src/gldrv/gl_globals.h b/engine/src/gldrv/gl_globals.h index 074f28a669..0b7aa8b0fb 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-2025 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 @@ -23,7 +25,7 @@ #define VEGA_STRIKE_ENGINE_GLDRV_GL_GLOBALS_H #include -const static bool GFX_BUFFER_MAP_UNMAP = false; +static constexpr bool GFX_BUFFER_MAP_UNMAP = false; /* Hack for multitexture on Mac, here and in gl_init, ifdefined - griff */ //Moved this because defining GL_EXT_texture... doesn't work under Jaguar #ifdef __APPLE_PANTHER_GCC33_CLI__ @@ -91,17 +93,20 @@ struct GFXStats #ifndef _WIN32 //#define GL_GLEXT_PROTOTYPES - #endif + +// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766 #if defined (_WIN32) || defined (__CYGWIN__) #ifndef NOMINMAX #define NOMINMAX #endif //tells VCC not to generate min/max macros #include -#include +#include #endif -#if defined (__APPLE__) || defined (MACOSX) -#include + +// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766 +#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) #define OSX_AT_LEAST_10_4 @@ -110,7 +115,7 @@ struct GFXStats #endif #define GL_GLEXT_PROTOTYPES //#endif -#include +#include #else #define __glext_h_ #include diff --git a/engine/src/gldrv/gl_include.h b/engine/src/gldrv/gl_include.h index 5c94db9481..1338a17cd4 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-2025 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,10 +25,10 @@ #ifndef VEGA_STRIKE_ENGINE_GLDRV_GL_INCLUDE_H #define VEGA_STRIKE_ENGINE_GLDRV_GL_INCLUDE_H -#if defined (__APPLE__) || defined (MACOSX) -# include +#if defined(__APPLE__) && defined (__MACH__) +# include #else -# include +# include #endif #endif //VEGA_STRIKE_ENGINE_GLDRV_GL_INCLUDE_H diff --git a/engine/src/gldrv/gl_init.cpp b/engine/src/gldrv/gl_init.cpp index 8596ec0402..6b2a44bc39 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-2025 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 @@ -56,7 +56,7 @@ #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,13 +64,14 @@ #include #endif #define GL_GLEXT_PROTOTYPES 1 -#if defined (__APPLE__) || defined (MACOSX) - #include - #include +// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766 +#if defined(__APPLE__) && defined (__MACH__) + #include + #include #include #else - #include - #include + #include + #include #endif #ifdef GL_EXT_compiled_vertex_array # ifndef PFNGLLOCKARRAYSEXTPROC @@ -159,7 +160,7 @@ typedef void ( *(*get_gl_proc_fptr_t)(const GLubyte *))(); #if defined(__HAIKU__) typedef char * GET_GL_PTR_TYP; #define GET_GL_PROC glutGetProcAddress - #elif defined (__MACOSX__) + #elif defined (__APPLE__) && defined (__MACH__) typedef const char * GET_GL_PTR_TYP; void * vega_dlsym(GET_GL_PTR_TYP function_name) { return dlsym(RTLD_SELF, function_name); @@ -260,7 +261,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,14 +282,14 @@ 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 VS_LOG(debug, "OpenGL::GL_EXT_compiled_vertex_array unsupported"); } #endif -#if defined (__MACOSX__) +#if defined(__APPLE__) && defined (__MACH__) if (vsExtensionSupported("GL_EXT_multi_draw_arrays")) { glMultiDrawArrays_p = (PFNGLMULTIDRAWARRAYSEXTPROC) GET_GL_PROC((GET_GL_PTR_TYP) "glMultiDrawArraysEXT"); diff --git a/engine/src/gldrv/gl_init.h b/engine/src/gldrv/gl_init.h index 0c85fad020..4f9fa41a43 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-2025 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 @@ -56,19 +55,16 @@ extern "C" * count on that... */ #if defined (IRIX) -#include -#include +// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766 +#include +#include typedef void (*PFNGLLOCKARRAYSEXTPROC)( GLint first, GLsizei count ); typedef void (*PFNGLUNLOCKARRAYSEXTPROC)( void ); #elif !defined (_WIN32) -#if defined (__APPLE__) || defined (MACOSX) - #include - #include -#else - #include - #include -#endif +// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766 +#include +#include #if !defined (GL_GLEXT_VERSION) || GL_GLEXT_VERSION < 6 # error "*** You need a more recent copy of glext.h. You can get one at http: //oss.sgi.com/projects/ogl-sample/ABI/glext.h ; it goes in /usr/include/GL. ***" diff --git a/engine/src/gldrv/gl_program.cpp b/engine/src/gldrv/gl_program.cpp index 75b5770ac2..7b5027350c 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-2025 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 fec050b630..7a743cc712 100644 --- a/engine/src/gldrv/gl_texture.cpp +++ b/engine/src/gldrv/gl_texture.cpp @@ -1,7 +1,7 @@ /* * gl_texture.cpp * - * Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Copyright (C) 2001-2025 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 @@ -123,7 +123,7 @@ bool isPowerOfTwo(int num, int &which) { return true; } -#ifdef __APPLE__ +#if defined(__APPLE__) && defined (__MACH__) static GLint round2( GLint n ) { diff --git a/engine/src/gldrv/winsys.cpp b/engine/src/gldrv/winsys.cpp index 7cb3dd8b97..58a7a3eeb0 100644 --- a/engine/src/gldrv/winsys.cpp +++ b/engine/src/gldrv/winsys.cpp @@ -1,20 +1,21 @@ /* * Tux Racer * Copyright (C) 1999-2001 Jasmin F. Patry + * Copyright (C) 2001-2025 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * and other Vega Strike contributors as part of Vega Strike (see below) * * 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 + * as published by the Free Software Foundation; either version 3 * 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 + * 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 this program. If not, see . * * Incorporated into Vega Strike * @@ -762,7 +763,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..afbc6a84ff 100644 --- a/engine/src/gldrv/winsys.h +++ b/engine/src/gldrv/winsys.h @@ -1,26 +1,27 @@ /* * Tux Racer + * * Copyright (C) 1999-2001 Jasmin F. Patry - * Copyright (C) 2023 Benjamen R. Meyer + * Copyright (C) 2001-2025 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Benjamen R. Meyer, and other Vega Strike contributors * * 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 + * as published by the Free Software Foundation; either version 3 * 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 + * 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 this program. If not, see . * * Incorporated into Vega Strike * - * Copyright (C) 2001-2022 Daniel Horn, pyramid3d, Stephen G. Tuggy, - * and other Vega Strike contributors. + * Copyright (C) 2001-2025 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Benjamen R. Meyer, and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source * @@ -31,7 +32,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,11 +52,8 @@ #if defined( SDL_WINDOWING ) && defined (HAVE_SDL) # include "SDL2/SDL.h" #elif defined( HAVE_GLUT ) -#if defined(__APPLE__) || defined(MACOSX) - #include -#else - #include -#endif +// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766 +# include #else # error "Neither SDL nor GLUT are present." #endif @@ -100,13 +98,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 +225,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..8968d7b209 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-2025 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 @@ -24,13 +26,14 @@ //Version: 1.0 - Initial Release (Feb 18, 2002) -/* This class is designed to be self sufficient. +/* This class is designed to be self-sufficient. * The only external functions it requires that aren't provided by system libs are in glut_support.h */ -#if defined (__APPLE__) || defined (MACOSX) - #include - #include +// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766 +#if defined(__APPLE__) && defined(__MACH__) + #include + #include #else #ifdef _WIN32 #ifndef NOMINMAX @@ -38,9 +41,9 @@ #endif //tells VCC not to generate min/max macros #include #else - #include + #include #endif - #include + #include #endif #include "glut_support.h" diff --git a/engine/src/gui/text_area.h b/engine/src/gui/text_area.h index b232415aab..6284c345de 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-2025 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,16 +30,17 @@ //1.2 - Added sorting //1.3 - Added DoMouse to classes. Also fixed bug where button class would always 1 for dragging -/* This class is designed to be self sufficient. +/* This class is designed to be self-sufficient. * The only external functions it requires that aren't provided by system libs are in glut_support.h */ //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) - #include - #include +// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766 +#if defined (__APPLE__) && defined (__MACH__) + #include + #include #else #ifdef _WIN32 #ifndef NOMINMAX @@ -45,8 +48,8 @@ #endif //tells VCC not to generate min/max macros #include #endif - #include - #include + #include + #include #endif #include "glut_support.h" diff --git a/engine/src/macosx_math.h b/engine/src/macosx_math.h index cccef2bc15..f5f4c66373 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-2025 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 ); @@ -33,7 +35,7 @@ extern float sinf( float v ); extern float tanf( float v ); extern float powf( float v, float p ); -#endif //defined (__APPLE__) || defined (MACOSX) +#endif #endif //VEGA_STRIKE_ENGINE_MACOSX_MATH diff --git a/engine/src/precompiled.h b/engine/src/precompiled.h index ff806236da..6431a10e7b 100644 --- a/engine/src/precompiled.h +++ b/engine/src/precompiled.h @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy, Benjamen R. Meyer, + * precompiled.h + * + * Copyright (C) 2001-2025 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,11 +53,7 @@ #define GL_GLEXT_PROTOTYPES 1 -#if defined (__APPLE__) || defined (MACOSX) - #include - #include -#else //defined (__APPLE__) || defined (MACOSX) - #include - #include -#endif //defined (__APPLE__) || defined (MACOSX) +// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766 +#include +#include diff --git a/engine/src/vegastrike.h b/engine/src/vegastrike.h index 4b5de10409..64aa8698e6 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-2025 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 @@ -65,18 +67,19 @@ extern float AUDIO_ATOM; #include #endif //defined (WIN32) || defined (__CYGWIN__) +// See https://github.com/vegastrike/Vega-Strike-Engine-Source/pull/851#discussion_r1589254766 #ifndef NO_GFX - #if defined (__APPLE__) || defined (MACOSX) - #include - #include - #include - #else //defined (__APPLE__) || defined (MACOSX) - #define __glext_h_ - #include - #include - #include - #undef __glext_h_ - #endif //defined (__APPLE__) || defined (MACOSX) +# if defined(__APPLE__) && defined(__MACH__) +# include +# include +# include +# else //defined(__APPLE__) && defined(__MACH__) +# define __glext_h_ +# include +# include +# include +# undef __glext_h_ +# endif //defined(__APPLE__) && defined(__MACH__) #endif //NO_GFX #define PROG_NAME "vegastrike"