From bdea96cc2a1ffac7b19894a4318257f5a5c29a1a Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Tue, 25 Oct 2022 19:11:22 +0200 Subject: [PATCH] Astyle --- neo/idlib/sys/sys_defines.h | 2 +- neo/renderer/GuiModel.cpp | 2 +- neo/renderer/ImmediateMode.cpp | 2 +- neo/renderer/NVRHI/RenderBackend_NVRHI.cpp | 4 ++-- neo/renderer/Passes/TemporalAntiAliasingPass.cpp | 10 +++++----- neo/renderer/RenderCommon.h | 4 ++-- neo/sys/DeviceManager.cpp | 2 +- neo/sys/sdl/sdl_vkimp.cpp | 6 +++--- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/neo/idlib/sys/sys_defines.h b/neo/idlib/sys/sys_defines.h index 2fa7fced..f053d9ae 100644 --- a/neo/idlib/sys/sys_defines.h +++ b/neo/idlib/sys/sys_defines.h @@ -191,7 +191,7 @@ Defines and macros usable in all code // RB: changed UINT_PTR to uintptr_t #if !defined(__APPLE__) -#include + #include #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 ) ) diff --git a/neo/renderer/GuiModel.cpp b/neo/renderer/GuiModel.cpp index b88669b4..08744f1b 100644 --- a/neo/renderer/GuiModel.cpp +++ b/neo/renderer/GuiModel.cpp @@ -402,7 +402,7 @@ void idGuiModel::EmitImGui( ImDrawData* drawData ) mat = ( const idMaterial* )pcmd->TextureId; } - idScreenRect clipRect = { static_cast(pcmd->ClipRect.x), static_cast(pcmd->ClipRect.y), static_cast(pcmd->ClipRect.z), static_cast(pcmd->ClipRect.w) }; + idScreenRect clipRect = { static_cast( pcmd->ClipRect.x ), static_cast( pcmd->ClipRect.y ), static_cast( pcmd->ClipRect.z ), static_cast( pcmd->ClipRect.w ) }; idDrawVert* verts = AllocTris( numVerts, indexBufferOffset, numIndexes, mat, tr.currentGLState, STEREO_DEPTH_TYPE_NONE, clipRect ); if( verts == NULL ) diff --git a/neo/renderer/ImmediateMode.cpp b/neo/renderer/ImmediateMode.cpp index de030774..a44d22ac 100644 --- a/neo/renderer/ImmediateMode.cpp +++ b/neo/renderer/ImmediateMode.cpp @@ -150,7 +150,7 @@ void fhImmediateMode::End() uint64_t stateBits = tr.backend.glStateBits; int program = renderProgManager.CurrentProgram(); - PipelineKey key{ stateBits, program, static_cast(tr.backend.depthBias), tr.backend.slopeScaleBias, tr.backend.currentFrameBuffer }; + PipelineKey key{ stateBits, program, static_cast( tr.backend.depthBias ), tr.backend.slopeScaleBias, tr.backend.currentFrameBuffer }; auto pipeline = tr.backend.pipelineCache.GetOrCreatePipeline( key ); { diff --git a/neo/renderer/NVRHI/RenderBackend_NVRHI.cpp b/neo/renderer/NVRHI/RenderBackend_NVRHI.cpp index ea354967..9bb37790 100644 --- a/neo/renderer/NVRHI/RenderBackend_NVRHI.cpp +++ b/neo/renderer/NVRHI/RenderBackend_NVRHI.cpp @@ -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(depthBias), slopeScaleBias, currentFrameBuffer }; + const PipelineKey key{ stateBits, program, static_cast( depthBias ), slopeScaleBias, currentFrameBuffer }; const auto pipeline = pipelineCache.GetOrCreatePipeline( key ); if( currentPipeline != pipeline ) diff --git a/neo/renderer/Passes/TemporalAntiAliasingPass.cpp b/neo/renderer/Passes/TemporalAntiAliasingPass.cpp index ab5028cd..20ec9806 100644 --- a/neo/renderer/Passes/TemporalAntiAliasingPass.cpp +++ b/neo/renderer/Passes/TemporalAntiAliasingPass.cpp @@ -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 dist( -0.5f, 0.5f ); return idVec2{ dist( rng ), dist( rng ) }; } - case (int)TemporalAntiAliasingJitter::None: + case( int )TemporalAntiAliasingJitter::None: { return idVec2( 0, 0 ); } diff --git a/neo/renderer/RenderCommon.h b/neo/renderer/RenderCommon.h index fecd6ab2..e113f8f7 100644 --- a/neo/renderer/RenderCommon.h +++ b/neo/renderer/RenderCommon.h @@ -1422,9 +1422,9 @@ struct glimpParms_t // Helper functions for using SDL2 and Vulkan on Linux. std::vector 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. diff --git a/neo/sys/DeviceManager.cpp b/neo/sys/DeviceManager.cpp index 33a1455b..2dfd6eeb 100644 --- a/neo/sys/DeviceManager.cpp +++ b/neo/sys/DeviceManager.cpp @@ -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; } } diff --git a/neo/sys/sdl/sdl_vkimp.cpp b/neo/sys/sdl/sdl_vkimp.cpp index eb561895..7ee07135 100644 --- a/neo/sys/sdl/sdl_vkimp.cpp +++ b/neo/sys/sdl/sdl_vkimp.cpp @@ -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(); }