mirror of
https://github.com/id-Software/DOOM-3-BFG.git
synced 2025-03-14 22:50:45 +00:00
Astyle
This commit is contained in:
parent
7ee1180d22
commit
bdea96cc2a
8 changed files with 16 additions and 16 deletions
|
@ -191,7 +191,7 @@ Defines and macros usable in all code
|
|||
|
||||
// RB: changed UINT_PTR to uintptr_t
|
||||
#if !defined(__APPLE__)
|
||||
#include <malloc.h>
|
||||
#include <malloc.h>
|
||||
#endif
|
||||
#define _alloca16( x ) ((void *)ALIGN( (uintptr_t)_alloca( ALIGN( x, 16 ) + 16 ), 16 ) )
|
||||
#define _alloca128( x ) ((void *)ALIGN( (uintptr_t)_alloca( ALIGN( x, 128 ) + 128 ), 128 ) )
|
||||
|
|
|
@ -402,7 +402,7 @@ void idGuiModel::EmitImGui( ImDrawData* drawData )
|
|||
mat = ( const idMaterial* )pcmd->TextureId;
|
||||
}
|
||||
|
||||
idScreenRect clipRect = { static_cast<short>(pcmd->ClipRect.x), static_cast<short>(pcmd->ClipRect.y), static_cast<short>(pcmd->ClipRect.z), static_cast<short>(pcmd->ClipRect.w) };
|
||||
idScreenRect clipRect = { static_cast<short>( pcmd->ClipRect.x ), static_cast<short>( pcmd->ClipRect.y ), static_cast<short>( pcmd->ClipRect.z ), static_cast<short>( pcmd->ClipRect.w ) };
|
||||
|
||||
idDrawVert* verts = AllocTris( numVerts, indexBufferOffset, numIndexes, mat, tr.currentGLState, STEREO_DEPTH_TYPE_NONE, clipRect );
|
||||
if( verts == NULL )
|
||||
|
|
|
@ -150,7 +150,7 @@ void fhImmediateMode::End()
|
|||
uint64_t stateBits = tr.backend.glStateBits;
|
||||
|
||||
int program = renderProgManager.CurrentProgram();
|
||||
PipelineKey key{ stateBits, program, static_cast<int>(tr.backend.depthBias), tr.backend.slopeScaleBias, tr.backend.currentFrameBuffer };
|
||||
PipelineKey key{ stateBits, program, static_cast<int>( tr.backend.depthBias ), tr.backend.slopeScaleBias, tr.backend.currentFrameBuffer };
|
||||
auto pipeline = tr.backend.pipelineCache.GetOrCreatePipeline( key );
|
||||
|
||||
{
|
||||
|
|
|
@ -196,7 +196,7 @@ void idRenderBackend::Init()
|
|||
void idRenderBackend::Shutdown()
|
||||
{
|
||||
delete ssaoPass;
|
||||
|
||||
|
||||
#if defined( VULKAN_USE_PLATFORM_SDL )
|
||||
VKimp_Shutdown();
|
||||
#else
|
||||
|
@ -347,7 +347,7 @@ void idRenderBackend::DrawElementsWithCounters( const drawSurf_t* surf )
|
|||
const uint64_t stateBits = glStateBits;
|
||||
|
||||
const int program = renderProgManager.CurrentProgram();
|
||||
const PipelineKey key{ stateBits, program, static_cast<int>(depthBias), slopeScaleBias, currentFrameBuffer };
|
||||
const PipelineKey key{ stateBits, program, static_cast<int>( depthBias ), slopeScaleBias, currentFrameBuffer };
|
||||
const auto pipeline = pipelineCache.GetOrCreatePipeline( key );
|
||||
|
||||
if( currentPipeline != pipeline )
|
||||
|
|
|
@ -340,7 +340,7 @@ idVec2 TemporalAntiAliasingPass::GetCurrentPixelOffset()
|
|||
switch( r_taaJitter.GetInteger() )
|
||||
{
|
||||
default:
|
||||
case (int)TemporalAntiAliasingJitter::MSAA:
|
||||
case( int )TemporalAntiAliasingJitter::MSAA:
|
||||
{
|
||||
const idVec2 offsets[] =
|
||||
{
|
||||
|
@ -350,22 +350,22 @@ idVec2 TemporalAntiAliasingPass::GetCurrentPixelOffset()
|
|||
|
||||
return offsets[m_FrameIndex % 8];
|
||||
}
|
||||
case (int)TemporalAntiAliasingJitter::Halton:
|
||||
case( int )TemporalAntiAliasingJitter::Halton:
|
||||
{
|
||||
uint32_t index = ( m_FrameIndex % 16 ) + 1;
|
||||
return idVec2{ VanDerCorput( 2, index ), VanDerCorput( 3, index ) } - idVec2( 0.5f, 0.5f );
|
||||
}
|
||||
case (int)TemporalAntiAliasingJitter::R2:
|
||||
case( int )TemporalAntiAliasingJitter::R2:
|
||||
{
|
||||
return m_R2Jitter - idVec2( 0.5f, 0.5f );
|
||||
}
|
||||
case (int)TemporalAntiAliasingJitter::WhiteNoise:
|
||||
case( int )TemporalAntiAliasingJitter::WhiteNoise:
|
||||
{
|
||||
std::mt19937 rng( m_FrameIndex );
|
||||
std::uniform_real_distribution<float> dist( -0.5f, 0.5f );
|
||||
return idVec2{ dist( rng ), dist( rng ) };
|
||||
}
|
||||
case (int)TemporalAntiAliasingJitter::None:
|
||||
case( int )TemporalAntiAliasingJitter::None:
|
||||
{
|
||||
return idVec2( 0, 0 );
|
||||
}
|
||||
|
|
|
@ -1422,9 +1422,9 @@ struct glimpParms_t
|
|||
// Helper functions for using SDL2 and Vulkan on Linux.
|
||||
std::vector<const char*> get_required_extensions();
|
||||
#if defined( USE_NVRHI )
|
||||
bool CreateSDLWindowSurface( VkInstance instance, VkSurfaceKHR* surface );
|
||||
bool CreateSDLWindowSurface( VkInstance instance, VkSurfaceKHR* surface );
|
||||
#else
|
||||
extern vulkanContext_t vkcontext;
|
||||
extern vulkanContext_t vkcontext;
|
||||
#endif
|
||||
|
||||
// DG: R_GetModeListForDisplay is called before GLimp_Init(), but SDL needs SDL_Init() first.
|
||||
|
|
|
@ -23,7 +23,7 @@ DeviceManager* DeviceManager::Create( nvrhi::GraphicsAPI api )
|
|||
return CreateVK();
|
||||
#endif
|
||||
default:
|
||||
common->Error( "DeviceManager::Create: Unsupported Graphics API (%u)", (unsigned int)api );
|
||||
common->Error( "DeviceManager::Create: Unsupported Graphics API (%u)", ( unsigned int )api );
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,7 +101,7 @@ bool CreateSDLWindowSurface( VkInstance instance, VkSurfaceKHR* surface )
|
|||
common->Warning( "Error while creating SDL Vulkan surface: %s", SDL_GetError() );
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -328,7 +328,7 @@ bool VKimp_Init( glimpParms_t parms )
|
|||
#if defined( USE_NVRHI )
|
||||
glimpParms_t createParms = parms;
|
||||
createParms.x = createParms.y = windowPos;
|
||||
|
||||
|
||||
if( !deviceManager->CreateWindowDeviceAndSwapChain( createParms, GAME_NAME ) )
|
||||
#else
|
||||
window = SDL_CreateWindow( GAME_NAME,
|
||||
|
@ -537,7 +537,7 @@ void DeviceManager::Shutdown()
|
|||
|
||||
// destroy window
|
||||
VKimp_Shutdown();
|
||||
|
||||
|
||||
// restore gamma
|
||||
//VKimp_RestoreGamma();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue