diff --git a/neo/CMakeLists.txt b/neo/CMakeLists.txt index 19e4e6e6..c175f36e 100644 --- a/neo/CMakeLists.txt +++ b/neo/CMakeLists.txt @@ -173,7 +173,7 @@ if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID STREQUAL "Clang") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -DNDEBUG -ffast-math -fno-unsafe-math-optimizations -fomit-frame-pointer -fno-strict-aliasing ${my_warn_flags}") set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -g -rdynamic -O3 -DID_RETAIL -DALLOW_DEV -D_GLDEBUG -DNDEBUG -ffast-math -fno-unsafe-math-optimizations -fomit-frame-pointer -fno-strict-aliasing -Werror -Wno-error=invalid-pch -Wno-error=invalid-offsetof ${my_warn_flags}") #set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} -Os -ffast-math -fno-unsafe-math-optimizations -fomit-frame-pointer -fno-strict-aliasing ${my_warn_flags}") - set(CMAKE_C_FLAGS_RETAIL "${CMAKE_C_FLAGS_RETAIL} -s -O3 -DID_RETAIL -DNDEBUG -ffast-math -fno-strict-aliasing -Werror -Wno-error=invalid-pch -Wno-error=invalid-offsetof ${my_warn_flags}" CACHE STRING "" FORCE) + set(CMAKE_C_FLAGS_RETAIL "${CMAKE_C_FLAGS_RETAIL} -s -O3 -DID_RETAIL -DNDEBUG -ffast-math -fno-strict-aliasing -Werror -Wno-error=invalid-pch -Wno-error=invalid-offsetof -Wno-error=uninitialized ${my_warn_flags}" CACHE STRING "" FORCE) @@ -503,8 +503,8 @@ if (USE_OPENXR) set(BUILD_API_LAYERS ON) FetchContent_Declare( OpenXR - URL_HASH MD5=927EE8D4699DFB4DDD9B0A16A37EDBFC - URL https://github.com/KhronosGroup/OpenXR-SDK-Source/archive/refs/tags/release-1.1.37.tar.gz + URL_HASH MD5=A8DE805EE5C34C180A5B630EBD816850 + URL https://github.com/KhronosGroup/OpenXR-SDK-Source/archive/refs/tags/release-1.1.43.tar.gz SOURCE_DIR ../neo/libs/openxr ) @@ -1067,11 +1067,6 @@ if (USE_DXGI) else() list(APPEND WIN32_SOURCES sys/win32/win_glimp.cpp) endif() - -if (USE_OPENXR) - list(APPEND WIN32_SOURCES sys/win32/win_oxr.cpp) - list(APPEND WIN32_INCLUDES sys/win32/win_oxr.h) -endif() if(MSVC) list(APPEND WIN32_SOURCES sys/win32/win_cpu.cpp) @@ -1437,6 +1432,12 @@ include_directories( # ${CMAKE_CURRENT_SOURCE_DIR}/libs/curl/lib # ${CMAKE_CURRENT_SOURCE_DIR}/libs/openal/lib) + +if (USE_OPENXR) + list(APPEND RBDOOM3_INCLUDES ${RENDERER_OPENXR_INCLUDES}) + list(APPEND RBDOOM3_SOURCES ${RENDERER_OPENXR_SOURCES}) + endif() + if(MSVC) # if(MSVC_VERSION EQUAL 1700) @@ -1527,11 +1528,6 @@ if(MSVC) glu32) endif() - if (USE_OPENXR) - list(APPEND RBDOOM3_INCLUDES ${RENDERER_OPENXR_INCLUDES}) - list(APPEND RBDOOM3_SOURCES ${RENDERER_OPENXR_SOURCES}) - endif() - list(APPEND RBDOOM3_INCLUDES ${SOUND_COMMON_INCLUDES}) @@ -2071,6 +2067,9 @@ else() ${GLU_LIBRARY} ${CMAKE_DL_LIBS} ) + if (USE_OPENXR) + target_link_libraries(DoomBFA openxr-gfxwrapper openxr_loader) + endif() endif() endif() diff --git a/neo/CMakePresets.json b/neo/CMakePresets.json index 3484102d..2165c7db 100644 --- a/neo/CMakePresets.json +++ b/neo/CMakePresets.json @@ -258,7 +258,15 @@ "generator": "Unix Makefiles", "inherits": "linux-base", "cacheVariables": { - "CMAKE_BUILD_TYPE": "RelWithDebInfo" + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "USE_OPENXR": { + "type": "BOOL", + "value": "ON" + }, + "CMAKE_DISABLE_FIND_PACKAGE_jsoncpp" : { + "type": "BOOL", + "value": "ON" + } } }, { @@ -294,7 +302,15 @@ "generator": "Unix Makefiles", "inherits": "linux-base", "cacheVariables": { - "CMAKE_BUILD_TYPE": "Retail" + "CMAKE_BUILD_TYPE": "Retail", + "USE_OPENXR": { + "type": "BOOL", + "value": "ON" + }, + "CMAKE_DISABLE_FIND_PACKAGE_jsoncpp" : { + "type": "BOOL", + "value": "ON" + } } }, { @@ -319,6 +335,14 @@ "INSIDE_PACKAGE": { "type": "BOOL", "value": "ON" + }, + "USE_OPENXR": { + "type": "BOOL", + "value": "ON" + }, + "CMAKE_DISABLE_FIND_PACKAGE_jsoncpp" : { + "type": "BOOL", + "value": "ON" } } }, diff --git a/neo/aas/AASFile.h b/neo/aas/AASFile.h index c7030c25..5973c6c1 100644 --- a/neo/aas/AASFile.h +++ b/neo/aas/AASFile.h @@ -41,45 +41,45 @@ If you have questions concerning this license or the applicable additional terms #define AAS_FILEVERSION "1.07" // travel flags -#define TFL_INVALID BIT(0) // not valid -#define TFL_WALK BIT(1) // walking -#define TFL_CROUCH BIT(2) // crouching -#define TFL_WALKOFFLEDGE BIT(3) // walking of a ledge -#define TFL_BARRIERJUMP BIT(4) // jumping onto a barrier -#define TFL_JUMP BIT(5) // jumping -#define TFL_LADDER BIT(6) // climbing a ladder -#define TFL_SWIM BIT(7) // swimming -#define TFL_WATERJUMP BIT(8) // jump out of the water -#define TFL_TELEPORT BIT(9) // teleportation -#define TFL_ELEVATOR BIT(10) // travel by elevator -#define TFL_FLY BIT(11) // fly -#define TFL_SPECIAL BIT(12) // special -#define TFL_WATER BIT(21) // travel through water -#define TFL_AIR BIT(22) // travel through air +#define TFL_INVALID IDBIT(0) // not valid +#define TFL_WALK IDBIT(1) // walking +#define TFL_CROUCH IDBIT(2) // crouching +#define TFL_WALKOFFLEDGE IDBIT(3) // walking of a ledge +#define TFL_BARRIERJUMP IDBIT(4) // jumping onto a barrier +#define TFL_JUMP IDBIT(5) // jumping +#define TFL_LADDER IDBIT(6) // climbing a ladder +#define TFL_SWIM IDBIT(7) // swimming +#define TFL_WATERJUMP IDBIT(8) // jump out of the water +#define TFL_TELEPORT IDBIT(9) // teleportation +#define TFL_ELEVATOR IDBIT(10) // travel by elevator +#define TFL_FLY IDBIT(11) // fly +#define TFL_SPECIAL IDBIT(12) // special +#define TFL_WATER IDBIT(21) // travel through water +#define TFL_AIR IDBIT(22) // travel through air // face flags -#define FACE_SOLID BIT(0) // solid at the other side -#define FACE_LADDER BIT(1) // ladder surface -#define FACE_FLOOR BIT(2) // standing on floor when on this face -#define FACE_LIQUID BIT(3) // face seperating two areas with liquid -#define FACE_LIQUIDSURFACE BIT(4) // face seperating liquid and air +#define FACE_SOLID IDBIT(0) // solid at the other side +#define FACE_LADDER IDBIT(1) // ladder surface +#define FACE_FLOOR IDBIT(2) // standing on floor when on this face +#define FACE_LIQUID IDBIT(3) // face seperating two areas with liquid +#define FACE_LIQUIDSURFACE IDBIT(4) // face seperating liquid and air // area flags -#define AREA_FLOOR BIT(0) // AI can stand on the floor in this area -#define AREA_GAP BIT(1) // area has a gap -#define AREA_LEDGE BIT(2) // if entered the AI bbox partly floats above a ledge -#define AREA_LADDER BIT(3) // area contains one or more ladder faces -#define AREA_LIQUID BIT(4) // area contains a liquid -#define AREA_CROUCH BIT(5) // AI cannot walk but can only crouch in this area -#define AREA_REACHABLE_WALK BIT(6) // area is reachable by walking or swimming -#define AREA_REACHABLE_FLY BIT(7) // area is reachable by flying +#define AREA_FLOOR IDBIT(0) // AI can stand on the floor in this area +#define AREA_GAP IDBIT(1) // area has a gap +#define AREA_LEDGE IDBIT(2) // if entered the AI bbox partly floats above a ledge +#define AREA_LADDER IDBIT(3) // area contains one or more ladder faces +#define AREA_LIQUID IDBIT(4) // area contains a liquid +#define AREA_CROUCH IDBIT(5) // AI cannot walk but can only crouch in this area +#define AREA_REACHABLE_WALK IDBIT(6) // area is reachable by walking or swimming +#define AREA_REACHABLE_FLY IDBIT(7) // area is reachable by flying // area contents flags -#define AREACONTENTS_SOLID BIT(0) // solid, not a valid area -#define AREACONTENTS_WATER BIT(1) // area contains water -#define AREACONTENTS_CLUSTERPORTAL BIT(2) // area is a cluster portal -#define AREACONTENTS_OBSTACLE BIT(3) // area contains (part of) a dynamic obstacle -#define AREACONTENTS_TELEPORTER BIT(4) // area contains (part of) a teleporter trigger +#define AREACONTENTS_SOLID IDBIT(0) // solid, not a valid area +#define AREACONTENTS_WATER IDBIT(1) // area contains water +#define AREACONTENTS_CLUSTERPORTAL IDBIT(2) // area is a cluster portal +#define AREACONTENTS_OBSTACLE IDBIT(3) // area contains (part of) a dynamic obstacle +#define AREACONTENTS_TELEPORTER IDBIT(4) // area contains (part of) a teleporter trigger // bits for different bboxes #define AREACONTENTS_BBOX_BIT 24 diff --git a/neo/d3xp/Item.h b/neo/d3xp/Item.h index 50061391..ec80be7e 100644 --- a/neo/d3xp/Item.h +++ b/neo/d3xp/Item.h @@ -54,9 +54,9 @@ ITEM_GIVE_FEEDBACK | ITEM_GIVE_UPDATE_STATE. */ enum itemGiveFlags_t { - ITEM_GIVE_FEEDBACK = BIT( 0 ), - ITEM_GIVE_UPDATE_STATE = BIT( 1 ), - ITEM_GIVE_FROM_WEAPON = BIT( 2 ), // indicates this was given via a weapon's launchPowerup (for bloodstone powerups) + ITEM_GIVE_FEEDBACK = IDBIT( 0 ), + ITEM_GIVE_UPDATE_STATE = IDBIT( 1 ), + ITEM_GIVE_FROM_WEAPON = IDBIT( 2 ), // indicates this was given via a weapon's launchPowerup (for bloodstone powerups) }; class idItem : public idEntity diff --git a/neo/d3xp/Leaderboards.cpp b/neo/d3xp/Leaderboards.cpp index 88764d2a..3d161ce2 100644 --- a/neo/d3xp/Leaderboards.cpp +++ b/neo/d3xp/Leaderboards.cpp @@ -121,7 +121,7 @@ void LeaderboardLocal_Init() { // Check the supported modes on the map. - if( maps[ mapIdx ].supportedModes & BIT( modeIdx ) ) + if( maps[ mapIdx ].supportedModes & IDBIT( modeIdx ) ) { const columnGameMode_t gamemode = gameMode_columnDefs[ modeIdx ]; diff --git a/neo/d3xp/ai/AI.h b/neo/d3xp/ai/AI.h index 832bbc8e..93df3237 100644 --- a/neo/d3xp/ai/AI.h +++ b/neo/d3xp/ai/AI.h @@ -133,11 +133,11 @@ typedef struct obstaclePath_s // path prediction typedef enum { - SE_BLOCKED = BIT( 0 ), - SE_ENTER_LEDGE_AREA = BIT( 1 ), - SE_ENTER_OBSTACLE = BIT( 2 ), - SE_FALL = BIT( 3 ), - SE_LAND = BIT( 4 ) + SE_BLOCKED = IDBIT( 0 ), + SE_ENTER_LEDGE_AREA = IDBIT( 1 ), + SE_ENTER_OBSTACLE = IDBIT( 2 ), + SE_FALL = IDBIT( 3 ), + SE_LAND = IDBIT( 4 ) } stopEvent_t; typedef struct predictedPath_s diff --git a/neo/d3xp/anim/Anim.h b/neo/d3xp/anim/Anim.h index 0e877199..e31d1993 100644 --- a/neo/d3xp/anim/Anim.h +++ b/neo/d3xp/anim/Anim.h @@ -110,12 +110,12 @@ typedef struct #define ANIM_BIT_QY 4 #define ANIM_BIT_QZ 5 -#define ANIM_TX BIT( ANIM_BIT_TX ) -#define ANIM_TY BIT( ANIM_BIT_TY ) -#define ANIM_TZ BIT( ANIM_BIT_TZ ) -#define ANIM_QX BIT( ANIM_BIT_QX ) -#define ANIM_QY BIT( ANIM_BIT_QY ) -#define ANIM_QZ BIT( ANIM_BIT_QZ ) +#define ANIM_TX IDBIT( ANIM_BIT_TX ) +#define ANIM_TY IDBIT( ANIM_BIT_TY ) +#define ANIM_TZ IDBIT( ANIM_BIT_TZ ) +#define ANIM_QX IDBIT( ANIM_BIT_QX ) +#define ANIM_QY IDBIT( ANIM_BIT_QY ) +#define ANIM_QZ IDBIT( ANIM_BIT_QZ ) typedef enum { diff --git a/neo/d3xp/gamesys/SysCmds.cpp b/neo/d3xp/gamesys/SysCmds.cpp index 83baf07c..9cacc319 100644 --- a/neo/d3xp/gamesys/SysCmds.cpp +++ b/neo/d3xp/gamesys/SysCmds.cpp @@ -405,7 +405,7 @@ void Cmd_Give_f( const idCmdArgs& args ) if( give_all || idStr::Icmp( name, "weapons" ) == 0 ) { - player->inventory.weapons = ( int )( BIT( MAX_WEAPONS ) - 1 ); + player->inventory.weapons = ( int )( IDBIT( MAX_WEAPONS ) - 1 ); player->CacheWeapons(); if( !give_all ) diff --git a/neo/d3xp/menus/MenuScreen_Shell_Leaderboards.cpp b/neo/d3xp/menus/MenuScreen_Shell_Leaderboards.cpp index aefdbb61..7744e6d2 100644 --- a/neo/d3xp/menus/MenuScreen_Shell_Leaderboards.cpp +++ b/neo/d3xp/menus/MenuScreen_Shell_Leaderboards.cpp @@ -177,7 +177,7 @@ void idMenuScreen_Shell_Leaderboards::Initialize( idMenuHandler* data ) for( int modeIndex = 0; modeIndex < numModes; ++modeIndex ) { // Check the supported modes on the map. - if( maps[ mapIndex ].supportedModes & BIT( modeIndex ) ) + if( maps[ mapIndex ].supportedModes & IDBIT( modeIndex ) ) { #ifdef __MONOLITH__ int boardID = LeaderboardLocal_GetID( mapIndex, modeIndex ); diff --git a/neo/d3xp/menus/MenuScreen_Shell_MatchSettings.cpp b/neo/d3xp/menus/MenuScreen_Shell_MatchSettings.cpp index 5448d60d..41b24e19 100644 --- a/neo/d3xp/menus/MenuScreen_Shell_MatchSettings.cpp +++ b/neo/d3xp/menus/MenuScreen_Shell_MatchSettings.cpp @@ -409,7 +409,7 @@ void idMenuScreen_Shell_MatchSettings::idMenuDataSource_MatchSettings::AdjustFie } matchParameters.gameMap %= maps.Num(); matchParameters.mapName = maps[ matchParameters.gameMap ].mapFile; - if( ( maps[matchParameters.gameMap].supportedModes & BIT( matchParameters.gameMode ) ) != 0 ) + if( ( maps[matchParameters.gameMap].supportedModes & IDBIT( matchParameters.gameMode ) ) != 0 ) { // This map supports this mode break; @@ -434,11 +434,11 @@ void idMenuScreen_Shell_MatchSettings::idMenuDataSource_MatchSettings::AdjustFie } matchParameters.gameMode %= modes.Num(); updateMap = false; - if( ( maps[matchParameters.gameMap].supportedModes & BIT( matchParameters.gameMode ) ) == 0 ) + if( ( maps[matchParameters.gameMap].supportedModes & IDBIT( matchParameters.gameMode ) ) == 0 ) { for( int i = 0; i < maps.Num(); ++i ) { - if( ( maps[i].supportedModes & BIT( matchParameters.gameMode ) ) != 0 ) + if( ( maps[i].supportedModes & IDBIT( matchParameters.gameMode ) ) != 0 ) { matchParameters.gameMap = i; updateMap = true; diff --git a/neo/d3xp/menus/MenuScreen_Shell_Stereoscopics.cpp b/neo/d3xp/menus/MenuScreen_Shell_Stereoscopics.cpp index 6dac8e3c..14aaf797 100644 --- a/neo/d3xp/menus/MenuScreen_Shell_Stereoscopics.cpp +++ b/neo/d3xp/menus/MenuScreen_Shell_Stereoscopics.cpp @@ -398,10 +398,10 @@ void idMenuScreen_Shell_Stereoscopics::idMenuDataSource_StereoSettings::AdjustFi if( fieldIndex == STEREO_FIELD_ENABLE ) { int numOptions = NUM_STEREO_ENABLE; - if( !renderSystem->HasQuadBufferSupport() ) - { - numOptions--; - } + // if( !renderSystem->HasQuadBufferSupport() ) + // { + // numOptions--; + // } #ifndef USE_OPENXR numOptions--; #endif diff --git a/neo/d3xp/physics/Clip.cpp b/neo/d3xp/physics/Clip.cpp index d66e12fd..fc8fb2a0 100644 --- a/neo/d3xp/physics/Clip.cpp +++ b/neo/d3xp/physics/Clip.cpp @@ -78,7 +78,7 @@ static idList traceModelCache; static idList traceModelCache_Unsaved; static idHashIndex traceModelHash; static idHashIndex traceModelHash_Unsaved; -const static int TRACE_MODEL_SAVED = BIT( 16 ); +const static int TRACE_MODEL_SAVED = IDBIT( 16 ); /* diff --git a/neo/framework/CVarSystem.h b/neo/framework/CVarSystem.h index 115d2815..67cc5bb4 100644 --- a/neo/framework/CVarSystem.h +++ b/neo/framework/CVarSystem.h @@ -82,25 +82,25 @@ If you have questions concerning this license or the applicable additional terms typedef enum { CVAR_ALL = -1, // all flags - CVAR_BOOL = BIT( 0 ), // variable is a boolean - CVAR_INTEGER = BIT( 1 ), // variable is an integer - CVAR_FLOAT = BIT( 2 ), // variable is a float - CVAR_SYSTEM = BIT( 3 ), // system variable - CVAR_RENDERER = BIT( 4 ), // renderer variable - CVAR_SOUND = BIT( 5 ), // sound variable - CVAR_GUI = BIT( 6 ), // gui variable - CVAR_GAME = BIT( 7 ), // game variable - CVAR_TOOL = BIT( 8 ), // tool variable + CVAR_BOOL = IDBIT( 0 ), // variable is a boolean + CVAR_INTEGER = IDBIT( 1 ), // variable is an integer + CVAR_FLOAT = IDBIT( 2 ), // variable is a float + CVAR_SYSTEM = IDBIT( 3 ), // system variable + CVAR_RENDERER = IDBIT( 4 ), // renderer variable + CVAR_SOUND = IDBIT( 5 ), // sound variable + CVAR_GUI = IDBIT( 6 ), // gui variable + CVAR_GAME = IDBIT( 7 ), // game variable + CVAR_TOOL = IDBIT( 8 ), // tool variable // original doom3 used to have CVAR_USERINFO ("sent to servers, available to menu") here - CVAR_SERVERINFO = BIT( 10 ), // sent from servers, available to menu - CVAR_NETWORKSYNC = BIT( 11 ), // cvar is synced from the server to clients - CVAR_STATIC = BIT( 12 ), // statically declared, not user created - CVAR_CHEAT = BIT( 13 ), // variable is considered a cheat - CVAR_NOCHEAT = BIT( 14 ), // variable is not considered a cheat - CVAR_INIT = BIT( 15 ), // can only be set from the command-line - CVAR_ROM = BIT( 16 ), // display only, cannot be set by user at all - CVAR_ARCHIVE = BIT( 17 ), // set to cause it to be saved to a config file - CVAR_MODIFIED = BIT( 18 ) // set when the variable is modified + CVAR_SERVERINFO = IDBIT( 10 ), // sent from servers, available to menu + CVAR_NETWORKSYNC = IDBIT( 11 ), // cvar is synced from the server to clients + CVAR_STATIC = IDBIT( 12 ), // statically declared, not user created + CVAR_CHEAT = IDBIT( 13 ), // variable is considered a cheat + CVAR_NOCHEAT = IDBIT( 14 ), // variable is not considered a cheat + CVAR_INIT = IDBIT( 15 ), // can only be set from the command-line + CVAR_ROM = IDBIT( 16 ), // display only, cannot be set by user at all + CVAR_ARCHIVE = IDBIT( 17 ), // set to cause it to be saved to a config file + CVAR_MODIFIED = IDBIT( 18 ) // set when the variable is modified } cvarFlags_t; diff --git a/neo/framework/CmdSystem.h b/neo/framework/CmdSystem.h index c79da2d4..3d3414ab 100644 --- a/neo/framework/CmdSystem.h +++ b/neo/framework/CmdSystem.h @@ -48,12 +48,12 @@ If you have questions concerning this license or the applicable additional terms typedef enum { CMD_FL_ALL = -1, - CMD_FL_CHEAT = BIT( 0 ), // command is considered a cheat - CMD_FL_SYSTEM = BIT( 1 ), // system command - CMD_FL_RENDERER = BIT( 2 ), // renderer command - CMD_FL_SOUND = BIT( 3 ), // sound command - CMD_FL_GAME = BIT( 4 ), // game command - CMD_FL_TOOL = BIT( 5 ) // tool command + CMD_FL_CHEAT = IDBIT( 0 ), // command is considered a cheat + CMD_FL_SYSTEM = IDBIT( 1 ), // system command + CMD_FL_RENDERER = IDBIT( 2 ), // renderer command + CMD_FL_SOUND = IDBIT( 3 ), // sound command + CMD_FL_GAME = IDBIT( 4 ), // game command + CMD_FL_TOOL = IDBIT( 5 ) // tool command } cmdFlags_t; // parameters for command buffer stuffing diff --git a/neo/framework/Common.h b/neo/framework/Common.h index 9313fcb4..1fbc71a9 100644 --- a/neo/framework/Common.h +++ b/neo/framework/Common.h @@ -119,17 +119,17 @@ ID_INLINE bool EndTraceRecording() typedef enum { EDITOR_NONE = 0, - EDITOR_GUI = BIT( 1 ), - EDITOR_DEBUGGER = BIT( 2 ), - EDITOR_SCRIPT = BIT( 3 ), - EDITOR_LIGHT = BIT( 4 ), - EDITOR_SOUND = BIT( 5 ), - EDITOR_DECL = BIT( 6 ), - EDITOR_AF = BIT( 7 ), - EDITOR_PARTICLE = BIT( 8 ), - EDITOR_PDA = BIT( 9 ), - EDITOR_AAS = BIT( 10 ), - EDITOR_MATERIAL = BIT( 11 ) + EDITOR_GUI = IDBIT( 1 ), + EDITOR_DEBUGGER = IDBIT( 2 ), + EDITOR_SCRIPT = IDBIT( 3 ), + EDITOR_LIGHT = IDBIT( 4 ), + EDITOR_SOUND = IDBIT( 5 ), + EDITOR_DECL = IDBIT( 6 ), + EDITOR_AF = IDBIT( 7 ), + EDITOR_PARTICLE = IDBIT( 8 ), + EDITOR_PDA = IDBIT( 9 ), + EDITOR_AAS = IDBIT( 10 ), + EDITOR_MATERIAL = IDBIT( 11 ) } toolFlag_t; #define STRTABLE_ID "#str_" diff --git a/neo/framework/Common_menu.cpp b/neo/framework/Common_menu.cpp index c76e4565..310937a6 100644 --- a/neo/framework/Common_menu.cpp +++ b/neo/framework/Common_menu.cpp @@ -62,7 +62,7 @@ void idCommonLocal::InitializeMPMapsModes() { if( mapDef->dict.GetBool( gameModes[j], false ) ) { - supportedModes |= BIT( j ); + supportedModes |= IDBIT( j ); } } if( supportedModes != 0 ) @@ -99,7 +99,7 @@ void idCommonLocal::OnStartHosting( idMatchParameters& parms ) { // Select a map which supports the chosen mode idList supportedMaps; - uint32 supportedMode = BIT( parms.gameMode ); + uint32 supportedMode = IDBIT( parms.gameMode ); for( int i = 0; i < mpGameMaps.Num(); i++ ) { if( mpGameMaps[i].supportedModes & supportedMode ) @@ -126,7 +126,7 @@ void idCommonLocal::OnStartHosting( idMatchParameters& parms ) int numSupportedModes = 0; for( int i = 0; i < 32; i++ ) { - if( supportedModes & BIT( i ) ) + if( supportedModes & IDBIT( i ) ) { supportedModeList[numSupportedModes] = i; numSupportedModes++; diff --git a/neo/framework/File_SaveGame.h b/neo/framework/File_SaveGame.h index d406feb7..68b2e845 100644 --- a/neo/framework/File_SaveGame.h +++ b/neo/framework/File_SaveGame.h @@ -38,14 +38,14 @@ If you have questions concerning this license or the applicable additional terms enum saveGameType_t { SAVEGAMEFILE_NONE = 0, - SAVEGAMEFILE_TEXT = BIT( 0 ), // implies that no checksum will be used - SAVEGAMEFILE_BINARY = BIT( 1 ), // implies that a checksum will also be used - SAVEGAMEFILE_COMPRESSED = BIT( 2 ), - SAVEGAMEFILE_PIPELINED = BIT( 3 ), - SAVEGAMEFILE_THUMB = BIT( 4 ), // for special processing on certain platforms - SAVEGAMEFILE_BKGRND_IMAGE = BIT( 5 ), // for special processing on certain platforms, large background used on PS3 - SAVEGAMEFILE_AUTO_DELETE = BIT( 6 ), // to be deleted automatically after completed - SAVEGAMEFILE_OPTIONAL = BIT( 7 ) // if this flag is not set and missing, there is an error + SAVEGAMEFILE_TEXT = IDBIT( 0 ), // implies that no checksum will be used + SAVEGAMEFILE_BINARY = IDBIT( 1 ), // implies that a checksum will also be used + SAVEGAMEFILE_COMPRESSED = IDBIT( 2 ), + SAVEGAMEFILE_PIPELINED = IDBIT( 3 ), + SAVEGAMEFILE_THUMB = IDBIT( 4 ), // for special processing on certain platforms + SAVEGAMEFILE_BKGRND_IMAGE = IDBIT( 5 ), // for special processing on certain platforms, large background used on PS3 + SAVEGAMEFILE_AUTO_DELETE = IDBIT( 6 ), // to be deleted automatically after completed + SAVEGAMEFILE_OPTIONAL = IDBIT( 7 ) // if this flag is not set and missing, there is an error }; /* diff --git a/neo/framework/UsercmdGen.h b/neo/framework/UsercmdGen.h index 19e3bc10..4eb6581b 100644 --- a/neo/framework/UsercmdGen.h +++ b/neo/framework/UsercmdGen.h @@ -40,17 +40,17 @@ If you have questions concerning this license or the applicable additional terms */ // usercmd_t->button bits -const int BUTTON_ATTACK = BIT( 0 ); -const int BUTTON_RUN = BIT( 1 ); -const int BUTTON_ZOOM = BIT( 2 ); -const int BUTTON_SCORES = BIT( 3 ); -const int BUTTON_USE = BIT( 4 ); -const int BUTTON_JUMP = BIT( 5 ); -const int BUTTON_CROUCH = BIT( 6 ); -const int BUTTON_CHATTING = BIT( 7 ); +const int BUTTON_ATTACK = IDBIT( 0 ); +const int BUTTON_RUN = IDBIT( 1 ); +const int BUTTON_ZOOM = IDBIT( 2 ); +const int BUTTON_SCORES = IDBIT( 3 ); +const int BUTTON_USE = IDBIT( 4 ); +const int BUTTON_JUMP = IDBIT( 5 ); +const int BUTTON_CROUCH = IDBIT( 6 ); +const int BUTTON_CHATTING = IDBIT( 7 ); //GK: Two new bits for cycling weapons -const int BUTTON_NEXTWEAP = BIT( 8 ); -const int BUTTON_PREVWEAP = BIT( 9 ); +const int BUTTON_NEXTWEAP = IDBIT( 8 ); +const int BUTTON_PREVWEAP = IDBIT( 9 ); // usercmd_t->impulse commands const int IMPULSE_0 = 0; // weap 0 diff --git a/neo/idlib/Lexer.h b/neo/idlib/Lexer.h index 2a502f6d..c1dd89fd 100644 --- a/neo/idlib/Lexer.h +++ b/neo/idlib/Lexer.h @@ -52,20 +52,20 @@ If you have questions concerning this license or the applicable additional terms // lexer flags typedef enum { - LEXFL_NOERRORS = BIT( 0 ), // don't print any errors - LEXFL_NOWARNINGS = BIT( 1 ), // don't print any warnings - LEXFL_NOFATALERRORS = BIT( 2 ), // errors aren't fatal - LEXFL_NOSTRINGCONCAT = BIT( 3 ), // multiple strings separated by whitespaces are not concatenated - LEXFL_NOSTRINGESCAPECHARS = BIT( 4 ), // no escape characters inside strings - LEXFL_NODOLLARPRECOMPILE = BIT( 5 ), // don't use the $ sign for precompilation - LEXFL_NOBASEINCLUDES = BIT( 6 ), // don't include files embraced with < > - LEXFL_ALLOWPATHNAMES = BIT( 7 ), // allow path seperators in names - LEXFL_ALLOWNUMBERNAMES = BIT( 8 ), // allow names to start with a number - LEXFL_ALLOWIPADDRESSES = BIT( 9 ), // allow ip addresses to be parsed as numbers - LEXFL_ALLOWFLOATEXCEPTIONS = BIT( 10 ), // allow float exceptions like 1.#INF or 1.#IND to be parsed - LEXFL_ALLOWMULTICHARLITERALS = BIT( 11 ), // allow multi character literals - LEXFL_ALLOWBACKSLASHSTRINGCONCAT = BIT( 12 ), // allow multiple strings separated by '\' to be concatenated - LEXFL_ONLYSTRINGS = BIT( 13 ) // parse as whitespace deliminated strings (quoted strings keep quotes) + LEXFL_NOERRORS = IDBIT( 0 ), // don't print any errors + LEXFL_NOWARNINGS = IDBIT( 1 ), // don't print any warnings + LEXFL_NOFATALERRORS = IDBIT( 2 ), // errors aren't fatal + LEXFL_NOSTRINGCONCAT = IDBIT( 3 ), // multiple strings separated by whitespaces are not concatenated + LEXFL_NOSTRINGESCAPECHARS = IDBIT( 4 ), // no escape characters inside strings + LEXFL_NODOLLARPRECOMPILE = IDBIT( 5 ), // don't use the $ sign for precompilation + LEXFL_NOBASEINCLUDES = IDBIT( 6 ), // don't include files embraced with < > + LEXFL_ALLOWPATHNAMES = IDBIT( 7 ), // allow path seperators in names + LEXFL_ALLOWNUMBERNAMES = IDBIT( 8 ), // allow names to start with a number + LEXFL_ALLOWIPADDRESSES = IDBIT( 9 ), // allow ip addresses to be parsed as numbers + LEXFL_ALLOWFLOATEXCEPTIONS = IDBIT( 10 ), // allow float exceptions like 1.#INF or 1.#IND to be parsed + LEXFL_ALLOWMULTICHARLITERALS = IDBIT( 11 ), // allow multi character literals + LEXFL_ALLOWBACKSLASHSTRINGCONCAT = IDBIT( 12 ), // allow multiple strings separated by '\' to be concatenated + LEXFL_ONLYSTRINGS = IDBIT( 13 ) // parse as whitespace deliminated strings (quoted strings keep quotes) } lexerFlags_t; // punctuation ids diff --git a/neo/idlib/Lib.h b/neo/idlib/Lib.h index 93f8e616..eaacd63c 100644 --- a/neo/idlib/Lib.h +++ b/neo/idlib/Lib.h @@ -104,7 +104,7 @@ class idVec4; #endif #ifndef BIT -#define BIT( num ) ( 1ULL << ( num ) ) +#define IDBIT( num ) ( 1ULL << ( num ) ) #endif #define MAX_STRING_CHARS 1024 // max length of a string diff --git a/neo/idlib/ParallelJobList.cpp b/neo/idlib/ParallelJobList.cpp index 1d17a773..a4b2373e 100644 --- a/neo/idlib/ParallelJobList.cpp +++ b/neo/idlib/ParallelJobList.cpp @@ -243,9 +243,9 @@ class idParallelJobList_Threads enum runResult_t { RUN_OK = 0, - RUN_PROGRESS = BIT( 0 ), - RUN_DONE = BIT( 1 ), - RUN_STALLED = BIT( 2 ) + RUN_PROGRESS = IDBIT( 0 ), + RUN_DONE = IDBIT( 1 ), + RUN_STALLED = IDBIT( 2 ) }; int RunJobs( unsigned int threadNum, threadJobListState_t& state, bool singleJob ); diff --git a/neo/idlib/sys/sys_types.h b/neo/idlib/sys/sys_types.h index c6337b95..ee102017 100644 --- a/neo/idlib/sys/sys_types.h +++ b/neo/idlib/sys/sys_types.h @@ -123,8 +123,8 @@ struct idNullPtr #endif #endif -#ifndef BIT -#define BIT( num ) ( 1ULL << ( num ) ) +#ifndef IDBIT +#define IDBIT( num ) ( 1ULL << ( num ) ) #endif #ifndef NUMBITS diff --git a/neo/renderer/Image.h b/neo/renderer/Image.h index 2271ecfc..a61c9fc2 100644 --- a/neo/renderer/Image.h +++ b/neo/renderer/Image.h @@ -110,11 +110,11 @@ int BitsForFormat( textureFormat_t format ); enum textureSamples_t { - SAMPLE_1 = BIT( 0 ), - SAMPLE_2 = BIT( 1 ), - SAMPLE_4 = BIT( 2 ), - SAMPLE_8 = BIT( 3 ), - SAMPLE_16 = BIT( 4 ) + SAMPLE_1 = IDBIT( 0 ), + SAMPLE_2 = IDBIT( 1 ), + SAMPLE_4 = IDBIT( 2 ), + SAMPLE_8 = IDBIT( 3 ), + SAMPLE_16 = IDBIT( 4 ) }; /* diff --git a/neo/renderer/Material.h b/neo/renderer/Material.h index ed0c1693..7d4b9b8b 100644 --- a/neo/renderer/Material.h +++ b/neo/renderer/Material.h @@ -232,11 +232,11 @@ typedef struct stencilStage_s // (if either Pass, Fail or ZFail is set to replace). byte ref = 0; - // An 8 bit mask as an 0–255 integer, used when comparing the reference value with the contents of the buffer + // An 8 bit mask as an 0�255 integer, used when comparing the reference value with the contents of the buffer // (referenceValue & readMask) comparisonFunction (stencilBufferValue & readMask). byte readMask = 255; - // An 8 bit mask as an 0–255 integer, used when writing to the buffer.Note that, like other write masks, + // An 8 bit mask as an 0�255 integer, used when writing to the buffer.Note that, like other write masks, // it specifies which bits of stencil buffer will be affected by write // (i.e.WriteMask 0 means that no bits are affected and not that 0 will be written). byte writeMask = 255; @@ -345,45 +345,45 @@ const int MAX_GLOBAL_SHADER_PARMS = 12; // ? this looks like it should only be 8 // material flags typedef enum { - MF_DEFAULTED = BIT( 0 ), - MF_POLYGONOFFSET = BIT( 1 ), - MF_NOSHADOWS = BIT( 2 ), - MF_FORCESHADOWS = BIT( 3 ), - MF_NOSELFSHADOW = BIT( 4 ), - MF_NOPORTALFOG = BIT( 5 ), // this fog volume won't ever consider a portal fogged out - MF_EDITOR_VISIBLE = BIT( 6 ), // in use (visible) per editor + MF_DEFAULTED = IDBIT( 0 ), + MF_POLYGONOFFSET = IDBIT( 1 ), + MF_NOSHADOWS = IDBIT( 2 ), + MF_FORCESHADOWS = IDBIT( 3 ), + MF_NOSELFSHADOW = IDBIT( 4 ), + MF_NOPORTALFOG = IDBIT( 5 ), // this fog volume won't ever consider a portal fogged out + MF_EDITOR_VISIBLE = IDBIT( 6 ), // in use (visible) per editor // motorsep 11-23-2014; material LOD keys that define what LOD iteration the surface falls into MF_LOD1_SHIFT = 7, - MF_LOD1 = BIT( 7 ), // motorsep 11-24-2014; material flag for LOD1 iteration - MF_LOD2 = BIT( 8 ), // motorsep 11-24-2014; material flag for LOD2 iteration - MF_LOD3 = BIT( 9 ), // motorsep 11-24-2014; material flag for LOD3 iteration - MF_LOD4 = BIT( 10 ), // motorsep 11-24-2014; material flag for LOD4 iteration - MF_LOD_PERSISTENT = BIT( 11 ) // motorsep 11-24-2014; material flag for persistent LOD iteration + MF_LOD1 = IDBIT( 7 ), // motorsep 11-24-2014; material flag for LOD1 iteration + MF_LOD2 = IDBIT( 8 ), // motorsep 11-24-2014; material flag for LOD2 iteration + MF_LOD3 = IDBIT( 9 ), // motorsep 11-24-2014; material flag for LOD3 iteration + MF_LOD4 = IDBIT( 10 ), // motorsep 11-24-2014; material flag for LOD4 iteration + MF_LOD_PERSISTENT = IDBIT( 11 ) // motorsep 11-24-2014; material flag for persistent LOD iteration } materialFlags_t; // contents flags, NOTE: make sure to keep the defines in doom_defs.script up to date with these! typedef enum { - CONTENTS_SOLID = BIT( 0 ), // an eye is never valid in a solid - CONTENTS_OPAQUE = BIT( 1 ), // blocks visibility (for ai) - CONTENTS_WATER = BIT( 2 ), // used for water - CONTENTS_PLAYERCLIP = BIT( 3 ), // solid to players - CONTENTS_MONSTERCLIP = BIT( 4 ), // solid to monsters - CONTENTS_MOVEABLECLIP = BIT( 5 ), // solid to moveable entities - CONTENTS_IKCLIP = BIT( 6 ), // solid to IK - CONTENTS_BLOOD = BIT( 7 ), // used to detect blood decals - CONTENTS_BODY = BIT( 8 ), // used for actors - CONTENTS_PROJECTILE = BIT( 9 ), // used for projectiles - CONTENTS_CORPSE = BIT( 10 ), // used for dead bodies - CONTENTS_RENDERMODEL = BIT( 11 ), // used for render models for collision detection - CONTENTS_TRIGGER = BIT( 12 ), // used for triggers - CONTENTS_AAS_SOLID = BIT( 13 ), // solid for AAS - CONTENTS_AAS_OBSTACLE = BIT( 14 ), // used to compile an obstacle into AAS that can be enabled/disabled - CONTENTS_FLASHLIGHT_TRIGGER = BIT( 15 ), // used for triggers that are activated by the flashlight + CONTENTS_SOLID = IDBIT( 0 ), // an eye is never valid in a solid + CONTENTS_OPAQUE = IDBIT( 1 ), // blocks visibility (for ai) + CONTENTS_WATER = IDBIT( 2 ), // used for water + CONTENTS_PLAYERCLIP = IDBIT( 3 ), // solid to players + CONTENTS_MONSTERCLIP = IDBIT( 4 ), // solid to monsters + CONTENTS_MOVEABLECLIP = IDBIT( 5 ), // solid to moveable entities + CONTENTS_IKCLIP = IDBIT( 6 ), // solid to IK + CONTENTS_BLOOD = IDBIT( 7 ), // used to detect blood decals + CONTENTS_BODY = IDBIT( 8 ), // used for actors + CONTENTS_PROJECTILE = IDBIT( 9 ), // used for projectiles + CONTENTS_CORPSE = IDBIT( 10 ), // used for dead bodies + CONTENTS_RENDERMODEL = IDBIT( 11 ), // used for render models for collision detection + CONTENTS_TRIGGER = IDBIT( 12 ), // used for triggers + CONTENTS_AAS_SOLID = IDBIT( 13 ), // solid for AAS + CONTENTS_AAS_OBSTACLE = IDBIT( 14 ), // used to compile an obstacle into AAS that can be enabled/disabled + CONTENTS_FLASHLIGHT_TRIGGER = IDBIT( 15 ), // used for triggers that are activated by the flashlight // contents used by utils - CONTENTS_AREAPORTAL = BIT( 20 ), // portal separating renderer areas - CONTENTS_NOCSG = BIT( 21 ), // don't cut this brush with CSG operations in the editor + CONTENTS_AREAPORTAL = IDBIT( 20 ), // portal separating renderer areas + CONTENTS_NOCSG = IDBIT( 21 ), // don't cut this brush with CSG operations in the editor CONTENTS_REMOVE_UTIL = ~( CONTENTS_AREAPORTAL | CONTENTS_NOCSG ) } contentsFlags_t; @@ -415,21 +415,21 @@ typedef enum // surface flags typedef enum { - SURF_TYPE_BIT0 = BIT( 0 ), // encodes the material type (metal, flesh, concrete, etc.) - SURF_TYPE_BIT1 = BIT( 1 ), // " - SURF_TYPE_BIT2 = BIT( 2 ), // " - SURF_TYPE_BIT3 = BIT( 3 ), // " + SURF_TYPE_BIT0 = IDBIT( 0 ), // encodes the material type (metal, flesh, concrete, etc.) + SURF_TYPE_BIT1 = IDBIT( 1 ), // " + SURF_TYPE_BIT2 = IDBIT( 2 ), // " + SURF_TYPE_BIT3 = IDBIT( 3 ), // " SURF_TYPE_MASK = ( 1 << NUM_SURFACE_BITS ) - 1, - SURF_NODAMAGE = BIT( 4 ), // never give falling damage - SURF_SLICK = BIT( 5 ), // effects game physics - SURF_COLLISION = BIT( 6 ), // collision surface - SURF_LADDER = BIT( 7 ), // player can climb up this surface - SURF_NOIMPACT = BIT( 8 ), // don't make missile explosions - SURF_NOSTEPS = BIT( 9 ), // no footstep sounds - SURF_DISCRETE = BIT( 10 ), // not clipped or merged by utilities - SURF_NOFRAGMENT = BIT( 11 ), // dmap won't cut surface at each bsp boundary - SURF_NULLNORMAL = BIT( 12 ) // renderbump will draw this surface as 0x80 0x80 0x80, which + SURF_NODAMAGE = IDBIT( 4 ), // never give falling damage + SURF_SLICK = IDBIT( 5 ), // effects game physics + SURF_COLLISION = IDBIT( 6 ), // collision surface + SURF_LADDER = IDBIT( 7 ), // player can climb up this surface + SURF_NOIMPACT = IDBIT( 8 ), // don't make missile explosions + SURF_NOSTEPS = IDBIT( 9 ), // no footstep sounds + SURF_DISCRETE = IDBIT( 10 ), // not clipped or merged by utilities + SURF_NOFRAGMENT = IDBIT( 11 ), // dmap won't cut surface at each bsp boundary + SURF_NULLNORMAL = IDBIT( 12 ) // renderbump will draw this surface as 0x80 0x80 0x80, which // won't collect light from any angle } surfaceFlags_t; diff --git a/neo/renderer/OpenGL/RenderProgs_GL.cpp b/neo/renderer/OpenGL/RenderProgs_GL.cpp index 83cd5a51..a6a2cb41 100644 --- a/neo/renderer/OpenGL/RenderProgs_GL.cpp +++ b/neo/renderer/OpenGL/RenderProgs_GL.cpp @@ -207,7 +207,7 @@ void idRenderProgManager::LoadShader( shader_t& shader ) idStrList compileMacros; for( int j = 0; j < MAX_SHADER_MACRO_NAMES; j++ ) { - if( BIT( j ) & shader.shaderFeatures ) + if( IDBIT( j ) & shader.shaderFeatures ) { const char* macroName = GetGLSLMacroName( ( shaderFeature_t ) j ); compileMacros.Append( idStr( macroName ) ); @@ -221,7 +221,7 @@ void idRenderProgManager::LoadShader( shader_t& shader ) if( idStr::Icmp( shader.name.c_str(), "heatHaze" ) == 0 || idStr::Icmp( shader.name.c_str(), "heatHazeWithMask" ) == 0 || idStr::Icmp( shader.name.c_str(), "heatHazeWithMaskAndVertex" ) == 0 || - ( BIT( USE_GPU_SKINNING ) & shader.shaderFeatures ) ) + ( IDBIT( USE_GPU_SKINNING ) & shader.shaderFeatures ) ) { hasGPUSkinning = true; } diff --git a/neo/sys/win32/win_oxr.cpp b/neo/renderer/OpenXR/oxrImpl.cpp similarity index 95% rename from neo/sys/win32/win_oxr.cpp rename to neo/renderer/OpenXR/oxrImpl.cpp index 005969d3..d8cc1f2d 100644 --- a/neo/sys/win32/win_oxr.cpp +++ b/neo/renderer/OpenXR/oxrImpl.cpp @@ -22,12 +22,12 @@ * SOFTWARE. */ #include "precompiled.h" -#include "win_oxr.h" +#include "oxrImpl.h" idCVar vr_recordInitialPosition("vr_recordInitialPosition", "1", CVAR_BOOL, "Boolean to Determine if the current HMD Input must be recorded for initial Position"); extern idCVar in_invertLook; -idXR_Win xrWinSystem; -idXR* xrSystem = &xrWinSystem; +idXRLocal xrLocalSystem; +idXR* xrSystem = &xrLocalSystem; XrBool32 DebugXR(XrDebugUtilsMessageSeverityFlagsEXT messageSeverity, XrDebugUtilsMessageTypeFlagsEXT messageType, const XrDebugUtilsMessengerCallbackDataEXT* pCallbackData, void* pUserData) { // it probably isn't safe to do an idLib::Printf at this point @@ -74,7 +74,7 @@ XrBool32 DebugXR(XrDebugUtilsMessageSeverityFlagsEXT messageSeverity, XrDebugUti return XrBool32(); } -void idXR_Win::PollXREvents() +void idXRLocal::PollXREvents() { if (isInitialized) { XrEventDataBuffer eventData{ XR_TYPE_EVENT_DATA_BUFFER }; @@ -129,7 +129,7 @@ void idXR_Win::PollXREvents() } } -void idXR_Win::StartFrame() +void idXRLocal::StartFrame() { bool activeSession = (sessionState == XR_SESSION_STATE_SYNCHRONIZED || sessionState == XR_SESSION_STATE_VISIBLE || sessionState == XR_SESSION_STATE_FOCUSED || sessionState == XR_SESSION_STATE_READY); if (!inFrame && activeSession) { @@ -192,7 +192,7 @@ void idXR_Win::StartFrame() } } -void idXR_Win::BindSwapchainImage(int eye) +void idXRLocal::BindSwapchainImage(int eye) { if (inFrame) { renderingEye = eye; @@ -238,7 +238,7 @@ void idXR_Win::BindSwapchainImage(int eye) } -void idXR_Win::ReleaseSwapchainImage() +void idXRLocal::ReleaseSwapchainImage() { if (inFrame) { glFBO = MAX_UNSIGNED_TYPE(int); @@ -250,7 +250,7 @@ void idXR_Win::ReleaseSwapchainImage() } } -void idXR_Win::RenderFrame(int srcX, int srcY, int srcW, int srcH) +void idXRLocal::RenderFrame(int srcX, int srcY, int srcW, int srcH) { if (inFrame) { if (glConfig.directStateAccess) { @@ -264,7 +264,7 @@ void idXR_Win::RenderFrame(int srcX, int srcY, int srcW, int srcH) } } -void idXR_Win::EndFrame() +void idXRLocal::EndFrame() { if (inFrame) { glBindFramebuffer(GL_FRAMEBUFFER, 0); @@ -293,7 +293,7 @@ void idXR_Win::EndFrame() } -void idXR_Win::SetActionSet(idStr name) +void idXRLocal::SetActionSet(idStr name) { for (idXrActionSet actionSet : actionSets) { if (!actionSet.name.Cmp(name.c_str())) { @@ -302,7 +302,7 @@ void idXR_Win::SetActionSet(idStr name) } } -XrPath idXR_Win::StringToXRPath(const char* strPath) +XrPath idXRLocal::StringToXRPath(const char* strPath) { XrPath xrPath; if (xrStringToPath(instance, strPath, &xrPath) != XR_SUCCESS) { @@ -311,7 +311,7 @@ XrPath idXR_Win::StringToXRPath(const char* strPath) return xrPath; } -idStr idXR_Win::XRPathToString(XrPath xrPath) +idStr idXRLocal::XRPathToString(XrPath xrPath) { uint32_t length; char buffer[XR_MAX_PATH_LENGTH]; @@ -322,7 +322,7 @@ idStr idXR_Win::XRPathToString(XrPath xrPath) return idStr(); } -void idXR_Win::CreateXrMappings() +void idXRLocal::CreateXrMappings() { handPaths.push_back(StringToXRPath("/user/hand/left")); handPaths.push_back(StringToXRPath("/user/hand/right")); @@ -364,7 +364,7 @@ void idXR_Win::CreateXrMappings() actionSets.push_back(gameActionSet); } -idXR_Win::idXrAction idXR_Win::CreateAction(XrActionSet actionSet, const char* name, XrActionType type, uint32_t mappedKey, std::vector subActions) +idXRLocal::idXrAction idXRLocal::CreateAction(XrActionSet actionSet, const char* name, XrActionType type, uint32_t mappedKey, std::vector subActions) { idXrAction action; action.name = name; @@ -387,7 +387,7 @@ idXR_Win::idXrAction idXR_Win::CreateAction(XrActionSet actionSet, const char* n return action; } -void idXR_Win::SuggestBindings(const char* profilePath, std::vector bindings) +void idXRLocal::SuggestBindings(const char* profilePath, std::vector bindings) { XrInteractionProfileSuggestedBinding ipsb{ XR_TYPE_INTERACTION_PROFILE_SUGGESTED_BINDING }; ipsb.interactionProfile = StringToXRPath(profilePath); @@ -399,7 +399,7 @@ void idXR_Win::SuggestBindings(const char* profilePath, std::vectorSetAngles(viewAngles); usercmdGen->SetAngles(viewAngles); } -idVec3 idXR_Win::ConvertQuatToVec3(XrQuaternionf viewQuat) +idVec3 idXRLocal::ConvertQuatToVec3(XrQuaternionf viewQuat) { idVec3 viewAngles = idQuat(viewQuat.x, viewQuat.y, viewQuat.z, viewQuat.w).ToAngles().ToAngularVelocity() * 127.0f; viewAngles[PITCH] *= in_invertLook.GetBool() ? 1.0f : -1.0f; @@ -580,7 +580,7 @@ idVec3 idXR_Win::ConvertQuatToVec3(XrQuaternionf viewQuat) return viewAngles; } -uint idXR_Win::EnumerateSwapchainImage(std::vector swapchainInfo, idXRSwapchainType type, int index) +uint idXRLocal::EnumerateSwapchainImage(std::vector swapchainInfo, idXRSwapchainType type, int index) { uint imageCount = 0; XrSwapchain targetSwapchain = swapchainInfo[index].swapchain; @@ -595,16 +595,19 @@ uint idXR_Win::EnumerateSwapchainImage(std::vector swapchainInfo, return imageCount; } -void* idXR_Win::CreateFrameBuffer(const FrameBufferCreateInfo& FbCI) +void* idXRLocal::CreateFrameBuffer(const FrameBufferCreateInfo& FbCI) { GLuint fb = 0; if (glConfig.directStateAccess) { glCreateFramebuffers(1, &fb); GLenum attachment = FbCI.aspect == FrameBufferCreateInfo::Aspect::COLOR_BIT ? GL_COLOR_ATTACHMENT0 : GL_DEPTH_ATTACHMENT; +#ifdef WIN32 if (FbCI.view == FrameBufferCreateInfo::View::TYPE_2D_ARRAY) { glNamedFramebufferTextureMultiviewOVR(fb, attachment, (GLuint)(uint64_t)FbCI.image, FbCI.baseMipLevel, FbCI.baseArrayLayer, FbCI.layerCount); } - else if (FbCI.view == FrameBufferCreateInfo::View::TYPE_2D) { + else +#endif + if (FbCI.view == FrameBufferCreateInfo::View::TYPE_2D) { glNamedFramebufferTexture(fb, attachment, (GLuint)(uint64_t)FbCI.image, FbCI.baseMipLevel); } else { @@ -644,7 +647,7 @@ void* idXR_Win::CreateFrameBuffer(const FrameBufferCreateInfo& FbCI) -bool idXR_Win::InitXR() { +bool idXRLocal::InitXR() { XrApplicationInfo XRAppInfo; strncpy(XRAppInfo.applicationName, "DOOM BFA\0", 9); XRAppInfo.apiVersion = XR_CURRENT_API_VERSION; @@ -855,17 +858,17 @@ bool idXR_Win::InitXR() { common->Warning("OpenXR Error: Failed to Initiate the enumeration for Swapchain Formats"); return false; } - std::vector formats(formatCount); + std::vector formats(formatCount); if (xrEnumerateSwapchainFormats(session, formatCount, &formatCount, formats.data()) != XR_SUCCESS) { common->Warning("OpenXR Error: Failed to Enumerate Swapchain Formats"); return false; } - std::vector supportedColorFormats = { + std::vector supportedColorFormats = { GL_SRGB8_ALPHA8 }; - int64 colorFormat = 0; - std::vector::const_iterator colorFormatIterator = std::find_first_of(formats.begin(), formats.end(), supportedColorFormats.begin(), supportedColorFormats.end()); + int64_t colorFormat = 0; + std::vector::const_iterator colorFormatIterator = std::find_first_of(formats.begin(), formats.end(), supportedColorFormats.begin(), supportedColorFormats.end()); if (colorFormatIterator == formats.end()) { common->Warning("OpenXR Error: Failed to find Color Format"); @@ -948,7 +951,7 @@ bool idXR_Win::InitXR() { } -void idXR_Win::ShutDownXR() +void idXRLocal::ShutDownXR() { if (GeneralFB > 0) { glBindFramebuffer(GL_FRAMEBUFFER, 0); diff --git a/neo/sys/win32/win_oxr.h b/neo/renderer/OpenXR/oxrImpl.h similarity index 97% rename from neo/sys/win32/win_oxr.h rename to neo/renderer/OpenXR/oxrImpl.h index 62b90361..6a6efbc5 100644 --- a/neo/sys/win32/win_oxr.h +++ b/neo/renderer/OpenXR/oxrImpl.h @@ -23,18 +23,21 @@ */ #pragma once -#include "renderer/OpenXR/XRCommon.h" +#include "XRCommon.h" #include #include #include #include "gfxwrapper_opengl.h" #include "renderer/RenderCommon.h" #include -#include "win_local.h" - -class idXR_Win :public idXR { +#ifdef _WIN32 +#include "sys/win32/win_local.h" +#else +#include "sys/sdl/sdl_local.h" +#endif +class idXRLocal :public idXR { public: - idXR_Win() {} + idXRLocal() {} virtual bool InitXR(); virtual void ShutDownXR(); virtual void PollXREvents(); diff --git a/neo/renderer/RenderProgs.cpp b/neo/renderer/RenderProgs.cpp index 9e7a494b..664cf8d6 100644 --- a/neo/renderer/RenderProgs.cpp +++ b/neo/renderer/RenderProgs.cpp @@ -105,29 +105,29 @@ void idRenderProgManager::Init() { BUILTIN_GUI, "gui.vfp", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_COLOR, "color.vfp", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, // RB begin - { BUILTIN_COLOR_SKINNED, "color", "_skinned", BIT( USE_GPU_SKINNING ), true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, + { BUILTIN_COLOR_SKINNED, "color", "_skinned", IDBIT( USE_GPU_SKINNING ), true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_VERTEX_COLOR, "vertex_color.vfp", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_AMBIENT_LIGHTING, "ambient_lighting", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, - { BUILTIN_AMBIENT_LIGHTING_SKINNED, "ambient_lighting", "_skinned", BIT( USE_GPU_SKINNING ), true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, + { BUILTIN_AMBIENT_LIGHTING_SKINNED, "ambient_lighting", "_skinned", IDBIT( USE_GPU_SKINNING ), true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_SMALL_GEOMETRY_BUFFER, "gbuffer", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, - { BUILTIN_SMALL_GEOMETRY_BUFFER_SKINNED, "gbuffer", "_skinned", BIT( USE_GPU_SKINNING ), true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, + { BUILTIN_SMALL_GEOMETRY_BUFFER_SKINNED, "gbuffer", "_skinned", IDBIT( USE_GPU_SKINNING ), true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, // RB end { BUILTIN_TEXTURED, "texture.vfp", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_TEXTURE_VERTEXCOLOR, "texture_color.vfp", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, - { BUILTIN_TEXTURE_VERTEXCOLOR_SRGB, "texture_color.vfp", "_SRGB", BIT( USE_SRGB ), false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, + { BUILTIN_TEXTURE_VERTEXCOLOR_SRGB, "texture_color.vfp", "_SRGB", IDBIT( USE_SRGB ), false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_TEXTURE_VERTEXCOLOR_SKINNED, "texture_color_skinned.vfp", "", 0, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_TEXTURE_TEXGEN_VERTEXCOLOR, "texture_color_texgen.vfp", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, // RB begin { BUILTIN_INTERACTION, "interaction.vfp", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, - { BUILTIN_INTERACTION_SKINNED, "interaction", "_skinned", BIT( USE_GPU_SKINNING ), true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, + { BUILTIN_INTERACTION_SKINNED, "interaction", "_skinned", IDBIT( USE_GPU_SKINNING ), true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_INTERACTION_AMBIENT, "interactionAmbient.vfp", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_INTERACTION_AMBIENT_SKINNED, "interactionAmbient_skinned.vfp", "", 0, true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_INTERACTION_SHADOW_MAPPING_SPOT, "interactionSM", "_spot", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, - { BUILTIN_INTERACTION_SHADOW_MAPPING_SPOT_SKINNED, "interactionSM", "_spot_skinned", BIT( USE_GPU_SKINNING ), true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, - { BUILTIN_INTERACTION_SHADOW_MAPPING_POINT, "interactionSM", "_point", BIT( LIGHT_POINT ), false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, - { BUILTIN_INTERACTION_SHADOW_MAPPING_POINT_SKINNED, "interactionSM", "_point_skinned", BIT( USE_GPU_SKINNING ) | BIT( LIGHT_POINT ), true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, - { BUILTIN_INTERACTION_SHADOW_MAPPING_PARALLEL, "interactionSM", "_parallel", BIT( LIGHT_PARALLEL ), false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, - { BUILTIN_INTERACTION_SHADOW_MAPPING_PARALLEL_SKINNED, "interactionSM", "_parallel_skinned", BIT( USE_GPU_SKINNING ) | BIT( LIGHT_PARALLEL ), true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, + { BUILTIN_INTERACTION_SHADOW_MAPPING_SPOT_SKINNED, "interactionSM", "_spot_skinned", IDBIT( USE_GPU_SKINNING ), true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, + { BUILTIN_INTERACTION_SHADOW_MAPPING_POINT, "interactionSM", "_point", IDBIT( LIGHT_POINT ), false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, + { BUILTIN_INTERACTION_SHADOW_MAPPING_POINT_SKINNED, "interactionSM", "_point_skinned", IDBIT( USE_GPU_SKINNING ) | IDBIT( LIGHT_POINT ), true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, + { BUILTIN_INTERACTION_SHADOW_MAPPING_PARALLEL, "interactionSM", "_parallel", IDBIT( LIGHT_PARALLEL ), false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, + { BUILTIN_INTERACTION_SHADOW_MAPPING_PARALLEL_SKINNED, "interactionSM", "_parallel_skinned", IDBIT( USE_GPU_SKINNING ) | IDBIT( LIGHT_PARALLEL ), true, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, // RB end { BUILTIN_ENVIRONMENT, "environment.vfp", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_ENVIRONMENT_SKINNED, "environment_skinned.vfp", "", 0, true , SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT}, @@ -152,23 +152,23 @@ void idRenderProgManager::Init() // RB begin { BUILTIN_SCREEN, "screen", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_TONEMAP, "tonemap", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, - { BUILTIN_BRIGHTPASS, "tonemap", "_brightpass", BIT( BRIGHTPASS ), false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, + { BUILTIN_BRIGHTPASS, "tonemap", "_brightpass", IDBIT( BRIGHTPASS ), false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_HDR_GLARE_CHROMATIC, "hdr_glare_chromatic", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, - { BUILTIN_HDR_DEBUG, "tonemap", "_debug", BIT( HDR_DEBUG ), false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, + { BUILTIN_HDR_DEBUG, "tonemap", "_debug", IDBIT( HDR_DEBUG ), false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_SMAA_EDGE_DETECTION, "SMAA_edge_detection", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_SMAA_BLENDING_WEIGHT_CALCULATION, "SMAA_blending_weight_calc", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_SMAA_NEIGHBORHOOD_BLENDING, "SMAA_final", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_AMBIENT_OCCLUSION, "AmbientOcclusion_AO", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, - { BUILTIN_AMBIENT_OCCLUSION_AND_OUTPUT, "AmbientOcclusion_AO", "_write", BIT( BRIGHTPASS ), false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, + { BUILTIN_AMBIENT_OCCLUSION_AND_OUTPUT, "AmbientOcclusion_AO", "_write", IDBIT( BRIGHTPASS ), false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_AMBIENT_OCCLUSION_BLUR, "AmbientOcclusion_blur", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, - { BUILTIN_AMBIENT_OCCLUSION_BLUR_AND_OUTPUT, "AmbientOcclusion_blur", "_write", BIT( BRIGHTPASS ), false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, + { BUILTIN_AMBIENT_OCCLUSION_BLUR_AND_OUTPUT, "AmbientOcclusion_blur", "_write", IDBIT( BRIGHTPASS ), false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_AMBIENT_OCCLUSION_MINIFY, "AmbientOcclusion_minify", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, - { BUILTIN_AMBIENT_OCCLUSION_RECONSTRUCT_CSZ, "AmbientOcclusion_minify", "_mip0", BIT( BRIGHTPASS ), false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, + { BUILTIN_AMBIENT_OCCLUSION_RECONSTRUCT_CSZ, "AmbientOcclusion_minify", "_mip0", IDBIT( BRIGHTPASS ), false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_DEEP_GBUFFER_RADIOSITY_SSGI, "DeepGBufferRadiosity_radiosity", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_DEEP_GBUFFER_RADIOSITY_BLUR, "DeepGBufferRadiosity_blur", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, - { BUILTIN_DEEP_GBUFFER_RADIOSITY_BLUR_AND_OUTPUT, "DeepGBufferRadiosity_blur", "_write", BIT( BRIGHTPASS ), false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, + { BUILTIN_DEEP_GBUFFER_RADIOSITY_BLUR_AND_OUTPUT, "DeepGBufferRadiosity_blur", "_write", IDBIT( BRIGHTPASS ), false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, // RB end { BUILTIN_STEREO_DEGHOST, "stereoDeGhost.vfp", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, { BUILTIN_STEREO_WARP, "stereoWarp.vfp", "", 0, false, SHADER_STAGE_DEFAULT, LAYOUT_DRAW_VERT }, @@ -205,7 +205,7 @@ void idRenderProgManager::Init() uint32 shaderFeatures = builtins[i].shaderFeatures; if( builtins[i].requireGPUSkinningSupport ) { - shaderFeatures |= BIT( USE_GPU_SKINNING ); + shaderFeatures |= IDBIT( USE_GPU_SKINNING ); } int vIndex = -1; diff --git a/neo/renderer/RenderProgs.h b/neo/renderer/RenderProgs.h index 54362814..b049af76 100644 --- a/neo/renderer/RenderProgs.h +++ b/neo/renderer/RenderProgs.h @@ -56,12 +56,12 @@ permutations defined by the vertexMask_t bits on the Xbox 360 (see MAX_VERTEX_DE */ enum vertexMask_t { - VERTEX_MASK_XYZ = BIT( PC_ATTRIB_INDEX_VERTEX ), - VERTEX_MASK_ST = BIT( PC_ATTRIB_INDEX_ST ), - VERTEX_MASK_NORMAL = BIT( PC_ATTRIB_INDEX_NORMAL ), - VERTEX_MASK_COLOR = BIT( PC_ATTRIB_INDEX_COLOR ), - VERTEX_MASK_TANGENT = BIT( PC_ATTRIB_INDEX_TANGENT ), - VERTEX_MASK_COLOR2 = BIT( PC_ATTRIB_INDEX_COLOR2 ), + VERTEX_MASK_XYZ = IDBIT( PC_ATTRIB_INDEX_VERTEX ), + VERTEX_MASK_ST = IDBIT( PC_ATTRIB_INDEX_ST ), + VERTEX_MASK_NORMAL = IDBIT( PC_ATTRIB_INDEX_NORMAL ), + VERTEX_MASK_COLOR = IDBIT( PC_ATTRIB_INDEX_COLOR ), + VERTEX_MASK_TANGENT = IDBIT( PC_ATTRIB_INDEX_TANGENT ), + VERTEX_MASK_COLOR2 = IDBIT( PC_ATTRIB_INDEX_COLOR2 ), }; @@ -197,9 +197,9 @@ enum renderParm_t enum rpStage_t { - SHADER_STAGE_VERTEX = BIT( 0 ), - SHADER_STAGE_FRAGMENT = BIT( 1 ), - SHADER_STAGE_COMPUTE = BIT( 2 ), // RB: for future use + SHADER_STAGE_VERTEX = IDBIT( 0 ), + SHADER_STAGE_FRAGMENT = IDBIT( 1 ), + SHADER_STAGE_COMPUTE = IDBIT( 2 ), // RB: for future use SHADER_STAGE_DEFAULT = SHADER_STAGE_VERTEX | SHADER_STAGE_FRAGMENT }; @@ -214,13 +214,13 @@ enum rpBinding_t #define VERTEX_UNIFORM_ARRAY_NAME "_va_" #define FRAGMENT_UNIFORM_ARRAY_NAME "_fa_" -static const int AT_VS_IN = BIT( 1 ); -static const int AT_VS_OUT = BIT( 2 ); -static const int AT_PS_IN = BIT( 3 ); -static const int AT_PS_OUT = BIT( 4 ); -static const int AT_VS_OUT_RESERVED = BIT( 5 ); -static const int AT_PS_IN_RESERVED = BIT( 6 ); -static const int AT_PS_OUT_RESERVED = BIT( 7 ); +static const int AT_VS_IN = IDBIT( 1 ); +static const int AT_VS_OUT = IDBIT( 2 ); +static const int AT_PS_IN = IDBIT( 3 ); +static const int AT_PS_OUT = IDBIT( 4 ); +static const int AT_VS_OUT_RESERVED = IDBIT( 5 ); +static const int AT_PS_IN_RESERVED = IDBIT( 6 ); +static const int AT_PS_OUT_RESERVED = IDBIT( 7 ); struct attribInfo_t { diff --git a/neo/renderer/Vulkan/RenderProgs_VK.cpp b/neo/renderer/Vulkan/RenderProgs_VK.cpp index aca86edf..9510d38e 100644 --- a/neo/renderer/Vulkan/RenderProgs_VK.cpp +++ b/neo/renderer/Vulkan/RenderProgs_VK.cpp @@ -538,7 +538,7 @@ static int CompileGLSLtoSPIRV( const char* filename, const idStr& dataGLSL, cons idLib::Printf( "%s\n", shader.getInfoDebugLog() ); } - // All that’s left to do now is to convert the program’s intermediate representation into SpirV: + // All that�s left to do now is to convert the program�s intermediate representation into SpirV: std::vector spirV; spv::SpvBuildLogger logger; glslang::SpvOptions spvOptions; @@ -655,7 +655,7 @@ void idRenderProgManager::LoadShader( shader_t& shader ) idStrList compileMacros; for( int j = 0; j < MAX_SHADER_MACRO_NAMES; j++ ) { - if( BIT( j ) & shader.shaderFeatures ) + if( IDBIT( j ) & shader.shaderFeatures ) { const char* macroName = GetGLSLMacroName( ( shaderFeature_t ) j ); compileMacros.Append( idStr( macroName ) ); @@ -669,7 +669,7 @@ void idRenderProgManager::LoadShader( shader_t& shader ) if( idStr::Icmp( shader.name.c_str(), "heatHaze" ) == 0 || idStr::Icmp( shader.name.c_str(), "heatHazeWithMask" ) == 0 || idStr::Icmp( shader.name.c_str(), "heatHazeWithMaskAndVertex" ) == 0 || - ( BIT( USE_GPU_SKINNING ) & shader.shaderFeatures ) ) + ( IDBIT( USE_GPU_SKINNING ) & shader.shaderFeatures ) ) { hasGPUSkinning = true; } diff --git a/neo/sound/SoundVoice.cpp b/neo/sound/SoundVoice.cpp index 0e641e6b..1ac6b0a1 100644 --- a/neo/sound/SoundVoice.cpp +++ b/neo/sound/SoundVoice.cpp @@ -118,7 +118,7 @@ void idSoundVoice_Base::InitSurround( int outputChannels, int channelMask ) memset( invMap, 0, sizeof( invMap ) ); for( int i = 0, c = 0; i < idWaveFile::CHANNEL_INDEX_MAX && c < MAX_CHANNELS_PER_VOICE; i++ ) { - if( dstMask & BIT( i ) ) + if( dstMask & IDBIT( i ) ) { if( i == idWaveFile::CHANNEL_INDEX_LOW_FREQUENCY ) { diff --git a/neo/sound/WaveFile.h b/neo/sound/WaveFile.h index 85c301db..9caaa947 100644 --- a/neo/sound/WaveFile.h +++ b/neo/sound/WaveFile.h @@ -81,18 +81,18 @@ class idWaveFile }; enum { - CHANNEL_MASK_FRONT_LEFT = BIT( CHANNEL_INDEX_FRONT_LEFT ), - CHANNEL_MASK_FRONT_RIGHT = BIT( CHANNEL_INDEX_FRONT_RIGHT ), - CHANNEL_MASK_FRONT_CENTER = BIT( CHANNEL_INDEX_FRONT_CENTER ), - CHANNEL_MASK_LOW_FREQUENCY = BIT( CHANNEL_INDEX_LOW_FREQUENCY ), - CHANNEL_MASK_BACK_LEFT = BIT( CHANNEL_INDEX_BACK_LEFT ), - CHANNEL_MASK_BACK_RIGHT = BIT( CHANNEL_INDEX_BACK_RIGHT ), - CHANNEL_MASK_FRONT_LEFT_CENTER = BIT( CHANNEL_INDEX_FRONT_LEFT_CENTER ), - CHANNEL_MASK_FRONT_RIGHT_CENTER = BIT( CHANNEL_INDEX_FRONT_RIGHT_CENTER ), - CHANNEL_MASK_BACK_CENTER = BIT( CHANNEL_INDEX_BACK_CENTER ), - CHANNEL_MASK_SIDE_LEFT = BIT( CHANNEL_INDEX_SIDE_LEFT ), - CHANNEL_MASK_SIDE_RIGHT = BIT( CHANNEL_INDEX_SIDE_RIGHT ), - CHANNEL_MASK_ALL = BIT( CHANNEL_INDEX_MAX ) - 1, + CHANNEL_MASK_FRONT_LEFT = IDBIT( CHANNEL_INDEX_FRONT_LEFT ), + CHANNEL_MASK_FRONT_RIGHT = IDBIT( CHANNEL_INDEX_FRONT_RIGHT ), + CHANNEL_MASK_FRONT_CENTER = IDBIT( CHANNEL_INDEX_FRONT_CENTER ), + CHANNEL_MASK_LOW_FREQUENCY = IDBIT( CHANNEL_INDEX_LOW_FREQUENCY ), + CHANNEL_MASK_BACK_LEFT = IDBIT( CHANNEL_INDEX_BACK_LEFT ), + CHANNEL_MASK_BACK_RIGHT = IDBIT( CHANNEL_INDEX_BACK_RIGHT ), + CHANNEL_MASK_FRONT_LEFT_CENTER = IDBIT( CHANNEL_INDEX_FRONT_LEFT_CENTER ), + CHANNEL_MASK_FRONT_RIGHT_CENTER = IDBIT( CHANNEL_INDEX_FRONT_RIGHT_CENTER ), + CHANNEL_MASK_BACK_CENTER = IDBIT( CHANNEL_INDEX_BACK_CENTER ), + CHANNEL_MASK_SIDE_LEFT = IDBIT( CHANNEL_INDEX_SIDE_LEFT ), + CHANNEL_MASK_SIDE_RIGHT = IDBIT( CHANNEL_INDEX_SIDE_RIGHT ), + CHANNEL_MASK_ALL = IDBIT( CHANNEL_INDEX_MAX ) - 1, }; // This matches waveFmt_t::formatTag diff --git a/neo/sound/XAudio2/XA2_SoundHardware.cpp b/neo/sound/XAudio2/XA2_SoundHardware.cpp index fcb44a44..29cf590e 100644 --- a/neo/sound/XAudio2/XA2_SoundHardware.cpp +++ b/neo/sound/XAudio2/XA2_SoundHardware.cpp @@ -576,7 +576,7 @@ void idSoundHardware_XAudio2::Init() const char* channelNames[] = { "L", "R", "C", "S", "Lb", "Rb", "Lf", "Rf", "Cb", "Ls", "Rs" }; for (int i = 0, ci = 0; ci < sizeof(channelNames) / sizeof(channelNames[0]); ci++) { - if ((channelMask & BIT(ci)) == 0) + if ((channelMask & IDBIT(ci)) == 0) { continue; } diff --git a/neo/sound/sound.h b/neo/sound/sound.h index 7641ee43..03ec577d 100644 --- a/neo/sound/sound.h +++ b/neo/sound/sound.h @@ -48,18 +48,18 @@ const float DB_SILENCE = -60.0f; class idSoundSample; // sound shader flags -static const int SSF_PRIVATE_SOUND = BIT( 0 ); // only plays for the current listenerId -static const int SSF_ANTI_PRIVATE_SOUND = BIT( 1 ); // plays for everyone but the current listenerId -static const int SSF_NO_OCCLUSION = BIT( 2 ); // don't flow through portals, only use straight line -static const int SSF_GLOBAL = BIT( 3 ); // play full volume to all speakers and all listeners -static const int SSF_OMNIDIRECTIONAL = BIT( 4 ); // fall off with distance, but play same volume in all speakers -static const int SSF_LOOPING = BIT( 5 ); // repeat the sound continuously -static const int SSF_PLAY_ONCE = BIT( 6 ); // never restart if already playing on any channel of a given emitter -static const int SSF_UNCLAMPED = BIT( 7 ); // don't clamp calculated volumes at 1.0 -static const int SSF_NO_FLICKER = BIT( 8 ); // always return 1.0 for volume queries -static const int SSF_NO_DUPS = BIT( 9 ); // try not to play the same sound twice in a row -static const int SSF_VO = BIT( 10 ); // VO - direct a portion of the sound through the center channel (set automatically on shaders that contain files that start with "sound/vo/") -static const int SSF_MUSIC = BIT( 11 ); // Music - Muted when the player is playing his own music +static const int SSF_PRIVATE_SOUND = IDBIT( 0 ); // only plays for the current listenerId +static const int SSF_ANTI_PRIVATE_SOUND = IDBIT( 1 ); // plays for everyone but the current listenerId +static const int SSF_NO_OCCLUSION = IDBIT( 2 ); // don't flow through portals, only use straight line +static const int SSF_GLOBAL = IDBIT( 3 ); // play full volume to all speakers and all listeners +static const int SSF_OMNIDIRECTIONAL = IDBIT( 4 ); // fall off with distance, but play same volume in all speakers +static const int SSF_LOOPING = IDBIT( 5 ); // repeat the sound continuously +static const int SSF_PLAY_ONCE = IDBIT( 6 ); // never restart if already playing on any channel of a given emitter +static const int SSF_UNCLAMPED = IDBIT( 7 ); // don't clamp calculated volumes at 1.0 +static const int SSF_NO_FLICKER = IDBIT( 8 ); // always return 1.0 for volume queries +static const int SSF_NO_DUPS = IDBIT( 9 ); // try not to play the same sound twice in a row +static const int SSF_VO = IDBIT( 10 ); // VO - direct a portion of the sound through the center channel (set automatically on shaders that contain files that start with "sound/vo/") +static const int SSF_MUSIC = IDBIT( 11 ); // Music - Muted when the player is playing his own music // these options can be overriden from sound shader defaults on a per-emitter and per-channel basis typedef struct diff --git a/neo/swf/SWF_ScriptFunction.cpp b/neo/swf/SWF_ScriptFunction.cpp index 46bd4b65..9d32ea42 100644 --- a/neo/swf/SWF_ScriptFunction.cpp +++ b/neo/swf/SWF_ScriptFunction.cpp @@ -160,18 +160,18 @@ idSWFScriptVar idSWFScriptFunction_Script::Call( idSWFScriptObject* thisObject, stack.A().SetInteger( parms.Num() ); int preloadReg = 1; - if( flags & BIT( 0 ) ) + if( flags & IDBIT( 0 ) ) { // load "this" into a register registers[ preloadReg ].SetObject( thisObject ); preloadReg++; } - if( ( flags & BIT( 1 ) ) == 0 ) + if( ( flags & IDBIT( 1 ) ) == 0 ) { // create "this" locals->Set( "this", idSWFScriptVar( thisObject ) ); } - if( flags & BIT( 2 ) ) + if( flags & IDBIT( 2 ) ) { idSWFScriptObject* arguments = idSWFScriptObject::Alloc(); // load "arguments" into a register @@ -189,7 +189,7 @@ idSWFScriptVar idSWFScriptFunction_Script::Call( idSWFScriptObject* thisObject, arguments->Release(); } - if( ( flags & BIT( 3 ) ) == 0 ) + if( ( flags & IDBIT( 3 ) ) == 0 ) { idSWFScriptObject* arguments = idSWFScriptObject::Alloc(); @@ -207,24 +207,24 @@ idSWFScriptVar idSWFScriptFunction_Script::Call( idSWFScriptObject* thisObject, arguments->Release(); } - if( flags & BIT( 4 ) ) + if( flags & IDBIT( 4 ) ) { // load "super" into a register registers[ preloadReg ].SetObject( thisObject->GetPrototype() ); preloadReg++; } - if( ( flags & BIT( 5 ) ) == 0 ) + if( ( flags & IDBIT( 5 ) ) == 0 ) { // create "super" locals->Set( "super", idSWFScriptVar( thisObject->GetPrototype() ) ); } - if( flags & BIT( 6 ) ) + if( flags & IDBIT( 6 ) ) { // preload _root registers[ preloadReg ] = scope[0]->Get( "_root" ); preloadReg++; } - if( flags & BIT( 7 ) ) + if( flags & IDBIT( 7 ) ) { // preload _parent if( thisObject->GetSprite() != NULL && thisObject->GetSprite()->parent != NULL ) @@ -237,7 +237,7 @@ idSWFScriptVar idSWFScriptFunction_Script::Call( idSWFScriptObject* thisObject, } preloadReg++; } - if( flags & BIT( 8 ) ) + if( flags & IDBIT( 8 ) ) { // load "_global" into a register registers[ preloadReg ].SetObject( scope[0] ); @@ -309,18 +309,18 @@ idStr idSWFScriptFunction_Script::CallToScript( idSWFScriptObject* thisObject, c stack.A().SetInteger( parms.Num() ); int preloadReg = 1; - if( flags & BIT( 0 ) ) + if( flags & IDBIT( 0 ) ) { // load "this" into a register registers[ preloadReg ].SetObject( thisObject ); preloadReg++; } - if( ( flags & BIT( 1 ) ) == 0 ) + if( ( flags & IDBIT( 1 ) ) == 0 ) { // create "this" locals->Set( "this", idSWFScriptVar( thisObject ) ); } - if( flags & BIT( 2 ) ) + if( flags & IDBIT( 2 ) ) { idSWFScriptObject* arguments = idSWFScriptObject::Alloc(); // load "arguments" into a register @@ -338,7 +338,7 @@ idStr idSWFScriptFunction_Script::CallToScript( idSWFScriptObject* thisObject, c arguments->Release(); } - if( ( flags & BIT( 3 ) ) == 0 ) + if( ( flags & IDBIT( 3 ) ) == 0 ) { idSWFScriptObject* arguments = idSWFScriptObject::Alloc(); @@ -356,24 +356,24 @@ idStr idSWFScriptFunction_Script::CallToScript( idSWFScriptObject* thisObject, c arguments->Release(); } - if( flags & BIT( 4 ) ) + if( flags & IDBIT( 4 ) ) { // load "super" into a register registers[ preloadReg ].SetObject( thisObject->GetPrototype() ); preloadReg++; } - if( ( flags & BIT( 5 ) ) == 0 ) + if( ( flags & IDBIT( 5 ) ) == 0 ) { // create "super" locals->Set( "super", idSWFScriptVar( thisObject->GetPrototype() ) ); } - if( flags & BIT( 6 ) ) + if( flags & IDBIT( 6 ) ) { // preload _root registers[ preloadReg ] = scope[0]->Get( "_root" ); preloadReg++; } - if( flags & BIT( 7 ) ) + if( flags & IDBIT( 7 ) ) { // preload _parent if( thisObject->GetSprite() != NULL && thisObject->GetSprite()->parent != NULL ) @@ -386,7 +386,7 @@ idStr idSWFScriptFunction_Script::CallToScript( idSWFScriptObject* thisObject, c } preloadReg++; } - if( flags & BIT( 8 ) ) + if( flags & IDBIT( 8 ) ) { // load "_global" into a register registers[ preloadReg ].SetObject( scope[0] ); diff --git a/neo/swf/SWF_ScriptObject.h b/neo/swf/SWF_ScriptObject.h index e25ded09..0f9bb9f4 100644 --- a/neo/swf/SWF_ScriptObject.h +++ b/neo/swf/SWF_ScriptObject.h @@ -190,8 +190,8 @@ class idSWFScriptObject enum swfNamedVarFlags_t { SWF_VAR_FLAG_NONE = 0, - SWF_VAR_FLAG_READONLY = BIT( 1 ), - SWF_VAR_FLAG_DONTENUM = BIT( 2 ) + SWF_VAR_FLAG_READONLY = IDBIT( 1 ), + SWF_VAR_FLAG_DONTENUM = IDBIT( 2 ) }; struct swfNamedVar_t { diff --git a/neo/swf/SWF_SpriteInstance.h b/neo/swf/SWF_SpriteInstance.h index 4cd03aa3..56ad2d27 100644 --- a/neo/swf/SWF_SpriteInstance.h +++ b/neo/swf/SWF_SpriteInstance.h @@ -29,23 +29,23 @@ If you have questions concerning this license or the applicable additional terms #define __SWF_SPRITEINSTANCE_H__ // RB: moved here -#define PlaceFlagHasClipActions BIT( 7 ) -#define PlaceFlagHasClipDepth BIT( 6 ) -#define PlaceFlagHasName BIT( 5 ) -#define PlaceFlagHasRatio BIT( 4 ) -#define PlaceFlagHasColorTransform BIT( 3 ) -#define PlaceFlagHasMatrix BIT( 2 ) -#define PlaceFlagHasCharacter BIT( 1 ) -#define PlaceFlagMove BIT( 0 ) +#define PlaceFlagHasClipActions IDBIT( 7 ) +#define PlaceFlagHasClipDepth IDBIT( 6 ) +#define PlaceFlagHasName IDBIT( 5 ) +#define PlaceFlagHasRatio IDBIT( 4 ) +#define PlaceFlagHasColorTransform IDBIT( 3 ) +#define PlaceFlagHasMatrix IDBIT( 2 ) +#define PlaceFlagHasCharacter IDBIT( 1 ) +#define PlaceFlagMove IDBIT( 0 ) -#define PlaceFlagPad0 BIT( 7 ) -#define PlaceFlagPad1 BIT( 6 ) -#define PlaceFlagPad2 BIT( 5 ) -#define PlaceFlagHasImage BIT( 4 ) -#define PlaceFlagHasClassName BIT( 3 ) -#define PlaceFlagCacheAsBitmap BIT( 2 ) -#define PlaceFlagHasBlendMode BIT( 1 ) -#define PlaceFlagHasFilterList BIT( 0 ) +#define PlaceFlagPad0 IDBIT( 7 ) +#define PlaceFlagPad1 IDBIT( 6 ) +#define PlaceFlagPad2 IDBIT( 5 ) +#define PlaceFlagHasImage IDBIT( 4 ) +#define PlaceFlagHasClassName IDBIT( 3 ) +#define PlaceFlagCacheAsBitmap IDBIT( 2 ) +#define PlaceFlagHasBlendMode IDBIT( 1 ) +#define PlaceFlagHasFilterList IDBIT( 0 ) // RB end /* diff --git a/neo/swf/SWF_Text.cpp b/neo/swf/SWF_Text.cpp index e1f88798..42e41f67 100644 --- a/neo/swf/SWF_Text.cpp +++ b/neo/swf/SWF_Text.cpp @@ -56,7 +56,7 @@ void idSWF::DefineFont2( idSWFBitStream& bitstream ) uint16 numGlyphs = bitstream.ReadU16(); entry->font->glyphs.SetNum( numGlyphs ); - if( flags & BIT( 3 ) ) + if( flags & IDBIT( 3 ) ) { // 32 bit offsets uint32 offsetTableSize = ( numGlyphs + 1 ) * 4; @@ -98,7 +98,7 @@ void idSWF::DefineFont2( idSWFBitStream& bitstream ) swfShapeParser.ParseFont( shapeStream, entry->font->glyphs[i] ); } } - if( flags & BIT( 2 ) ) + if( flags & IDBIT( 2 ) ) { // 16 bit codes for( int i = 0; i < numGlyphs; i++ ) @@ -114,7 +114,7 @@ void idSWF::DefineFont2( idSWFBitStream& bitstream ) entry->font->glyphs[i].code = bitstream.ReadU8(); } } - if( flags & BIT( 7 ) ) + if( flags & IDBIT( 7 ) ) { entry->font->ascent = bitstream.ReadS16(); entry->font->descent = bitstream.ReadS16(); @@ -129,7 +129,7 @@ void idSWF::DefineFont2( idSWFBitStream& bitstream ) bitstream.ReadRect( ignored ); } uint16 kearningCount = bitstream.ReadU16(); - if( flags & BIT( 2 ) ) + if( flags & IDBIT( 2 ) ) { for( int i = 0; i < kearningCount; i++ ) { @@ -190,11 +190,11 @@ void idSWF::DefineTextX( idSWFBitStream& bitstream, bool rgba ) } idSWFTextRecord& textRecord = text->textRecords.Alloc(); - if( flags & BIT( 3 ) ) + if( flags & IDBIT( 3 ) ) { textRecord.fontID = bitstream.ReadU16(); } - if( flags & BIT( 2 ) ) + if( flags & IDBIT( 2 ) ) { if( rgba ) { @@ -205,15 +205,15 @@ void idSWF::DefineTextX( idSWFBitStream& bitstream, bool rgba ) bitstream.ReadColorRGB( textRecord.color ); } } - if( flags & BIT( 0 ) ) + if( flags & IDBIT( 0 ) ) { textRecord.xOffset = bitstream.ReadS16(); } - if( flags & BIT( 1 ) ) + if( flags & IDBIT( 1 ) ) { textRecord.yOffset = bitstream.ReadS16(); } - if( flags & BIT( 3 ) ) + if( flags & IDBIT( 3 ) ) { textRecord.textHeight = bitstream.ReadU16(); } diff --git a/neo/swf/SWF_Types.h b/neo/swf/SWF_Types.h index 06782e35..1b08be8a 100644 --- a/neo/swf/SWF_Types.h +++ b/neo/swf/SWF_Types.h @@ -268,12 +268,12 @@ class idSWFText enum swfEditTextFlags_t { SWF_ET_NONE = 0, - SWF_ET_WORDWRAP = BIT( 0 ), - SWF_ET_MULTILINE = BIT( 1 ), - SWF_ET_PASSWORD = BIT( 2 ), - SWF_ET_READONLY = BIT( 3 ), - SWF_ET_AUTOSIZE = BIT( 4 ), - SWF_ET_BORDER = BIT( 5 ), + SWF_ET_WORDWRAP = IDBIT( 0 ), + SWF_ET_MULTILINE = IDBIT( 1 ), + SWF_ET_PASSWORD = IDBIT( 2 ), + SWF_ET_READONLY = IDBIT( 3 ), + SWF_ET_AUTOSIZE = IDBIT( 4 ), + SWF_ET_BORDER = IDBIT( 5 ), }; enum swfEditTextAlign_t { diff --git a/neo/sys/sdl/sdl_glimp.cpp b/neo/sys/sdl/sdl_glimp.cpp index 1334dc1d..42fc8aa7 100644 --- a/neo/sys/sdl/sdl_glimp.cpp +++ b/neo/sys/sdl/sdl_glimp.cpp @@ -991,3 +991,13 @@ Sys_ChangeTitle { SDL_SetWindowTitle(window, string); } + +#ifdef USE_OPENXR +void* GetOpenXRGraphicsBinding() +{ + + graphicsBinding = {XR_TYPE_GRAPHICS_BINDING_OPENGL_WAYLAND_KHR}; + graphicsBinding.display = NULL; + return &graphicsBinding; +} +#endif \ No newline at end of file diff --git a/neo/sys/sdl/sdl_local.h b/neo/sys/sdl/sdl_local.h index 39d3bc5d..d3ba2e70 100644 --- a/neo/sys/sdl/sdl_local.h +++ b/neo/sys/sdl/sdl_local.h @@ -28,13 +28,21 @@ If you have questions concerning this license or the applicable additional terms */ #ifndef __SDL_LOCAL_H__ #define __SDL_LOCAL_H__ - +#include // glimp.cpp const int GRAB_ENABLE = ( 1 << 0 ); const int GRAB_REENABLE = ( 1 << 1 ); const int GRAB_HIDECURSOR = ( 1 << 2 ); const int GRAB_SETSTATE = ( 1 << 3 ); +#ifdef USE_OPENXR +#define XR_USE_GRAPHICS_API_OPENGL +#define XR_USE_PLATFORM_WAYLAND +#include +#include +static XrGraphicsBindingOpenGLWaylandKHR graphicsBinding{}; +#endif + //GK: Keep that here in order to be used by more than one places #if SDL_VERSION_ATLEAST(2, 0, 0) static SDL_Window* window = NULL; @@ -44,4 +52,10 @@ void GLimp_GrabInput( int flags ); char* Sys_ConsoleInput(); +#ifdef USE_OPENXR +void* GetOpenXRGraphicsBinding(); +#endif + +void Sys_QueEvent( sysEventType_t type, int value, int value2, int ptrLength, void *ptr, int inputDeviceNum ); + #endif diff --git a/neo/sys/sys_lobby.cpp b/neo/sys/sys_lobby.cpp index e6be72c3..44385164 100644 --- a/neo/sys/sys_lobby.cpp +++ b/neo/sys/sys_lobby.cpp @@ -677,7 +677,7 @@ void idLobby::HandlePacket( lobbyAddress_t& remoteAddress, idBitMsg fragMsg, idP int usercmdSize = lzwCompressor.Read( usercmdBuffer, sizeof( usercmdBuffer ), true ); lzwCompressor.End(); - float receivedBps = ( receivedBps_quantized / ( float )( BIT( idLobby::BANDWIDTH_REPORTING_BITS ) - 1 ) ) * ( float )idLobby::BANDWIDTH_REPORTING_MAX; + float receivedBps = ( receivedBps_quantized / ( float )( IDBIT( idLobby::BANDWIDTH_REPORTING_BITS ) - 1 ) ) * ( float )idLobby::BANDWIDTH_REPORTING_MAX; if( peers[ peerNum ].receivedBpsIndex != snapNum ) { peers[ peerNum ].receivedBps = receivedBps; @@ -4585,7 +4585,7 @@ void idLobby::SendReliable( int type, idBitMsg& msg, bool callReceiveReliable /* } // Don't sent to a user if they are in the exlusion session user mask - if( sessionUserMask != 0 && ( sessionUserMask & ( BIT( i ) ) ) == 0 ) + if( sessionUserMask != 0 && ( sessionUserMask & ( IDBIT( i ) ) ) == 0 ) { continue; } diff --git a/neo/sys/sys_localuser.h b/neo/sys/sys_localuser.h index 7c3dd679..49418b0b 100644 --- a/neo/sys/sys_localuser.h +++ b/neo/sys/sys_localuser.h @@ -36,9 +36,9 @@ class idProfileMgr; enum onlineCaps_t { - CAP_IS_ONLINE = BIT( 0 ), - CAP_BLOCKED_PERMISSION = BIT( 1 ), - CAP_CAN_PLAY_ONLINE = BIT( 2 ), + CAP_IS_ONLINE = IDBIT( 0 ), + CAP_BLOCKED_PERMISSION = IDBIT( 1 ), + CAP_CAN_PLAY_ONLINE = IDBIT( 2 ), }; class idSerializer; diff --git a/neo/sys/sys_savegame.h b/neo/sys/sys_savegame.h index 9cff178d..b7d81bcd 100644 --- a/neo/sys/sys_savegame.h +++ b/neo/sys/sys_savegame.h @@ -80,20 +80,20 @@ class idSaveGameManager; enum saveGameError_t { SAVEGAME_E_NONE = 0, - SAVEGAME_E_CANCELLED = BIT( 0 ), - SAVEGAME_E_INSUFFICIENT_ROOM = BIT( 1 ), - SAVEGAME_E_CORRUPTED = BIT( 2 ), - SAVEGAME_E_UNABLE_TO_SELECT_STORAGE_DEVICE = BIT( 3 ), - SAVEGAME_E_UNKNOWN = BIT( 4 ), - SAVEGAME_E_INVALID_FILENAME = BIT( 5 ), - SAVEGAME_E_STEAM_ERROR = BIT( 6 ), - SAVEGAME_E_FOLDER_NOT_FOUND = BIT( 7 ), - SAVEGAME_E_FILE_NOT_FOUND = BIT( 8 ), - SAVEGAME_E_DLC_NOT_FOUND = BIT( 9 ), - SAVEGAME_E_INVALID_USER = BIT( 10 ), - SAVEGAME_E_PROFILE_TOO_BIG = BIT( 11 ), - SAVEGAME_E_DISC_SWAP = BIT( 12 ), - SAVEGAME_E_INCOMPATIBLE_NEWER_VERSION = BIT( 13 ), + SAVEGAME_E_CANCELLED = IDBIT( 0 ), + SAVEGAME_E_INSUFFICIENT_ROOM = IDBIT( 1 ), + SAVEGAME_E_CORRUPTED = IDBIT( 2 ), + SAVEGAME_E_UNABLE_TO_SELECT_STORAGE_DEVICE = IDBIT( 3 ), + SAVEGAME_E_UNKNOWN = IDBIT( 4 ), + SAVEGAME_E_INVALID_FILENAME = IDBIT( 5 ), + SAVEGAME_E_STEAM_ERROR = IDBIT( 6 ), + SAVEGAME_E_FOLDER_NOT_FOUND = IDBIT( 7 ), + SAVEGAME_E_FILE_NOT_FOUND = IDBIT( 8 ), + SAVEGAME_E_DLC_NOT_FOUND = IDBIT( 9 ), + SAVEGAME_E_INVALID_USER = IDBIT( 10 ), + SAVEGAME_E_PROFILE_TOO_BIG = IDBIT( 11 ), + SAVEGAME_E_DISC_SWAP = IDBIT( 12 ), + SAVEGAME_E_INCOMPATIBLE_NEWER_VERSION = IDBIT( 13 ), SAVEGAME_E_BITS_USED = 14, SAVEGAME_E_NUM = SAVEGAME_E_BITS_USED + 1 // because we're counting "none" @@ -103,16 +103,16 @@ enum saveGameError_t enum saveGameModeBitfield_t { SAVEGAME_MBF_NONE = 0, - SAVEGAME_MBF_LOAD = BIT( 0 ), // standard file load (can be individual/multiple files described in parms) - SAVEGAME_MBF_SAVE = BIT( 1 ), // standard file save (can be individual/multiple files described in parms) - SAVEGAME_MBF_DELETE_FOLDER = BIT( 2 ), // standard package delete - SAVEGAME_MBF_DELETE_ALL_FOLDERS = BIT( 3 ), // deletes all of the savegame folders (should only be used in testing) - SAVEGAME_MBF_ENUMERATE = BIT( 4 ), // gets listing of all savegame folders, typically used with READ_DETAILS to read the description file - SAVEGAME_MBF_NO_COMPRESS = BIT( 5 ), // tells the system the files aren't compressed, usually only needed when reading the descriptors file internally - SAVEGAME_MBF_ENUMERATE_FILES = BIT( 6 ), // enumerates all the files within a particular savegame folder (can be individual/multiple files or pattern described in parms) - SAVEGAME_MBF_DELETE_FILES = BIT( 7 ), // deletes individual files within a particular savegame folder (can be individual/multiple files or pattern described in parms) - SAVEGAME_MBF_READ_DETAILS = BIT( 8 ), // reads the description file (if specified, parms.enumeratedEntry.name & parms.enumeratedEntry.type must be specified) - SAVEGAME_MBF_KEEP_FOLDER = BIT( 9 ) // don't delete the folder before saving + SAVEGAME_MBF_LOAD = IDBIT( 0 ), // standard file load (can be individual/multiple files described in parms) + SAVEGAME_MBF_SAVE = IDBIT( 1 ), // standard file save (can be individual/multiple files described in parms) + SAVEGAME_MBF_DELETE_FOLDER = IDBIT( 2 ), // standard package delete + SAVEGAME_MBF_DELETE_ALL_FOLDERS = IDBIT( 3 ), // deletes all of the savegame folders (should only be used in testing) + SAVEGAME_MBF_ENUMERATE = IDBIT( 4 ), // gets listing of all savegame folders, typically used with READ_DETAILS to read the description file + SAVEGAME_MBF_NO_COMPRESS = IDBIT( 5 ), // tells the system the files aren't compressed, usually only needed when reading the descriptors file internally + SAVEGAME_MBF_ENUMERATE_FILES = IDBIT( 6 ), // enumerates all the files within a particular savegame folder (can be individual/multiple files or pattern described in parms) + SAVEGAME_MBF_DELETE_FILES = IDBIT( 7 ), // deletes individual files within a particular savegame folder (can be individual/multiple files or pattern described in parms) + SAVEGAME_MBF_READ_DETAILS = IDBIT( 8 ), // reads the description file (if specified, parms.enumeratedEntry.name & parms.enumeratedEntry.type must be specified) + SAVEGAME_MBF_KEEP_FOLDER = IDBIT( 9 ) // don't delete the folder before saving }; typedef interlockedInt_t saveGameHandle_t; diff --git a/neo/sys/sys_session.h b/neo/sys/sys_session.h index 3b65fe32..faee010c 100644 --- a/neo/sys/sys_session.h +++ b/neo/sys/sys_session.h @@ -40,15 +40,15 @@ static const int MAX_LOCAL_PLAYERS = 2; static const int MAX_INPUT_DEVICES = 4; enum matchFlags_t { - MATCH_STATS = BIT( 0 ), // Match will upload leaderboard/achievement scores - MATCH_ONLINE = BIT( 1 ), // Match will require users to be online - MATCH_RANKED = BIT( 2 ), // Match will affect rank - MATCH_PRIVATE = BIT( 3 ), // Match will NOT be searchable through FindOrCreateMatch - MATCH_INVITE_ONLY = BIT( 4 ), // Match visible through invite only - - MATCH_REQUIRE_PARTY_LOBBY = BIT( 5 ), // This session uses a party lobby - MATCH_PARTY_INVITE_PLACEHOLDER = BIT( 6 ), // Party is never shown in the UI, it's simply used as a placeholder for invites - MATCH_JOIN_IN_PROGRESS = BIT( 7 ), // Join in progress supported for this match + MATCH_STATS = IDBIT( 0 ), // Match will upload leaderboard/achievement scores + MATCH_ONLINE = IDBIT( 1 ), // Match will require users to be online + MATCH_RANKED = IDBIT( 2 ), // Match will affect rank + MATCH_PRIVATE = IDBIT( 3 ), // Match will NOT be searchable through FindOrCreateMatch + MATCH_INVITE_ONLY = IDBIT( 4 ), // Match visible through invite only + + MATCH_REQUIRE_PARTY_LOBBY = IDBIT( 5 ), // This session uses a party lobby + MATCH_PARTY_INVITE_PLACEHOLDER = IDBIT( 6 ), // Party is never shown in the UI, it's simply used as a placeholder for invites + MATCH_JOIN_IN_PROGRESS = IDBIT( 7 ), // Join in progress supported for this match }; ID_INLINE bool MatchTypeIsOnline( uint8 matchFlags ) @@ -439,7 +439,7 @@ class idSession enum sessionOption_t { - OPTION_LEAVE_WITH_PARTY = BIT( 0 ), // As a party leader, whether or not to drag your party members with you when you leave a game lobby + OPTION_LEAVE_WITH_PARTY = IDBIT( 0 ), // As a party leader, whether or not to drag your party members with you when you leave a game lobby OPTION_ALL = 0xFFFFFFFF }; diff --git a/neo/sys/sys_session_local.cpp b/neo/sys/sys_session_local.cpp index 3cae0aee..f9571479 100644 --- a/neo/sys/sys_session_local.cpp +++ b/neo/sys/sys_session_local.cpp @@ -2383,7 +2383,7 @@ void idSessionLocal::SendUsercmds( idBitMsg& msg ) hostPeer.receivedBpsIndex = sequence; hostPeer.receivedBps = incomingBPS; } - uint16 incomingBPS_quantized = idMath::Ftoi( incomingBPS * ( ( BIT( idLobby::BANDWIDTH_REPORTING_BITS ) - 1 ) / idLobby::BANDWIDTH_REPORTING_MAX ) ); + uint16 incomingBPS_quantized = idMath::Ftoi( incomingBPS * ( ( IDBIT( idLobby::BANDWIDTH_REPORTING_BITS ) - 1 ) / idLobby::BANDWIDTH_REPORTING_MAX ) ); byte buffer[idPacketProcessor::MAX_FINAL_PACKET_SIZE]; lzwCompressionData_t lzwData; diff --git a/neo/sys/sys_voicechat.h b/neo/sys/sys_voicechat.h index f9a76142..ae6dbb65 100644 --- a/neo/sys/sys_voicechat.h +++ b/neo/sys/sys_voicechat.h @@ -68,8 +68,8 @@ class idVoiceChatMgr enum disableVoiceReason_t { - REASON_GENERIC = BIT( 0 ), - REASON_PRIVILEGES = BIT( 1 ), + REASON_GENERIC = IDBIT( 0 ), + REASON_PRIVILEGES = IDBIT( 1 ), }; void SetDisableVoiceReason( disableVoiceReason_t reason ); diff --git a/neo/tools/compilers/aas/AASBuild_gravity.cpp b/neo/tools/compilers/aas/AASBuild_gravity.cpp index 37e5942e..7d52c68b 100644 --- a/neo/tools/compilers/aas/AASBuild_gravity.cpp +++ b/neo/tools/compilers/aas/AASBuild_gravity.cpp @@ -122,7 +122,7 @@ bool idAASBuild::PortalIsGap( idBrushBSPPortal* portal, int side ) idAASBuild::GravSubdivLeafNode ============ */ -#define FACE_CHECKED BIT(31) +#define FACE_CHECKED IDBIT(31) #define GRAVSUBDIV_EPSILON 0.1f void idAASBuild::GravSubdivLeafNode( idBrushBSPNode* node ) diff --git a/neo/tools/compilers/aas/BrushBSP.h b/neo/tools/compilers/aas/BrushBSP.h index 7ae2e6ef..593fa012 100644 --- a/neo/tools/compilers/aas/BrushBSP.h +++ b/neo/tools/compilers/aas/BrushBSP.h @@ -115,8 +115,8 @@ class idBrushBSPPortal // //=============================================================== -#define NODE_VISITED BIT(30) -#define NODE_DONE BIT(31) +#define NODE_VISITED IDBIT(30) +#define NODE_DONE IDBIT(31) class idBrushBSPNode {