From d46ff88ffd67cea35434b12dbc20bb3ac7eceed8 Mon Sep 17 00:00:00 2001 From: Robert Konrad Date: Fri, 12 Jan 2024 19:12:05 +0100 Subject: [PATCH] Re-format sources --- .../Sources/kinc/backend/graphics4/Direct3D11.c.h | 4 ++-- .../Metal/Sources/kinc/backend/graphics5/shader.m.h | 2 +- .../Sources/kinc/backend/graphics5/commandlist.c.h | 12 +++--------- .../System/Android/Sources/kinc/backend/system.c.h | 6 +++--- .../System/Android/Sources/kinc/backend/video.c.h | 3 +-- Backends/System/iOS/Sources/kinc/backend/system.m.h | 2 +- .../System/macOS/Sources/kinc/backend/system.m.h | 4 ++-- 7 files changed, 13 insertions(+), 20 deletions(-) diff --git a/Backends/Graphics4/Direct3D11/Sources/kinc/backend/graphics4/Direct3D11.c.h b/Backends/Graphics4/Direct3D11/Sources/kinc/backend/graphics4/Direct3D11.c.h index 7ba75b6d6..de20defb9 100644 --- a/Backends/Graphics4/Direct3D11/Sources/kinc/backend/graphics4/Direct3D11.c.h +++ b/Backends/Graphics4/Direct3D11/Sources/kinc/backend/graphics4/Direct3D11.c.h @@ -217,8 +217,8 @@ void kinc_g4_internal_init(void) { if (result == E_FAIL || result == DXGI_ERROR_SDK_COMPONENT_MISSING) { kinc_log(KINC_LOG_LEVEL_WARNING, "%s", "Failed to create device with D3D11_CREATE_DEVICE_DEBUG, trying without"); flags &= ~D3D11_CREATE_DEVICE_DEBUG; - result = D3D11CreateDevice(adapter, D3D_DRIVER_TYPE_HARDWARE, NULL, flags, featureLevels, ARRAYSIZE(featureLevels), D3D11_SDK_VERSION, - &dx_ctx.device, &featureLevel, &dx_ctx.context); + result = D3D11CreateDevice(adapter, D3D_DRIVER_TYPE_HARDWARE, NULL, flags, featureLevels, ARRAYSIZE(featureLevels), D3D11_SDK_VERSION, &dx_ctx.device, + &featureLevel, &dx_ctx.context); } #endif diff --git a/Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/shader.m.h b/Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/shader.m.h index a495855b0..0921a7de7 100644 --- a/Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/shader.m.h +++ b/Backends/Graphics5/Metal/Sources/kinc/backend/graphics5/shader.m.h @@ -18,7 +18,7 @@ void kinc_g5_shader_init(kinc_g5_shader_t *shader, const void *source, size_t le #ifdef KINC_KONG strcpy(shader->impl.name, (const char *)source); shader->impl.mtlFunction = (__bridge_retained void *)[getMetalLibrary() newFunctionWithName:[NSString stringWithCString:shader->impl.name - encoding:NSUTF8StringEncoding]]; + encoding:NSUTF8StringEncoding]]; #else shader->impl.name[0] = 0; diff --git a/Backends/Graphics5/Vulkan/Sources/kinc/backend/graphics5/commandlist.c.h b/Backends/Graphics5/Vulkan/Sources/kinc/backend/graphics5/commandlist.c.h index 0231e5c54..45659392b 100644 --- a/Backends/Graphics5/Vulkan/Sources/kinc/backend/graphics5/commandlist.c.h +++ b/Backends/Graphics5/Vulkan/Sources/kinc/backend/graphics5/commandlist.c.h @@ -822,21 +822,15 @@ void kinc_g5_command_list_execute(kinc_g5_command_list_t *list) { submit_info.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO; submit_info.pNext = NULL; - VkSemaphore semaphores[2] = { - framebuffer_available, - relay_semaphore - }; - VkPipelineStageFlags dst_stage_flags[2] = { - VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, - VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT - }; + VkSemaphore semaphores[2] = {framebuffer_available, relay_semaphore}; + VkPipelineStageFlags dst_stage_flags[2] = {VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT}; if (wait_for_framebuffer) { submit_info.pWaitSemaphores = semaphores; submit_info.pWaitDstStageMask = dst_stage_flags; submit_info.waitSemaphoreCount = wait_for_relay ? 2 : 1; wait_for_framebuffer = false; } - else if(wait_for_relay) { + else if (wait_for_relay) { submit_info.waitSemaphoreCount = 1; submit_info.pWaitSemaphores = &semaphores[1]; submit_info.pWaitDstStageMask = &dst_stage_flags[1]; diff --git a/Backends/System/Android/Sources/kinc/backend/system.c.h b/Backends/System/Android/Sources/kinc/backend/system.c.h index e473dd550..656a19cf8 100644 --- a/Backends/System/Android/Sources/kinc/backend/system.c.h +++ b/Backends/System/Android/Sources/kinc/backend/system.c.h @@ -897,9 +897,9 @@ void KincAndroidKeyboardInit() { int methodTableSize = sizeof(methodTable) / sizeof(methodTable[0]); int failure = (*env)->RegisterNatives(env, clazz, methodTable, methodTableSize); - if (failure != 0) { - kinc_log(KINC_LOG_LEVEL_WARNING, "Failed to register KincActivity.nativeKincKeyPress"); - } + if (failure != 0) { + kinc_log(KINC_LOG_LEVEL_WARNING, "Failed to register KincActivity.nativeKincKeyPress"); + } (*activity->vm)->DetachCurrentThread(activity->vm); } diff --git a/Backends/System/Android/Sources/kinc/backend/video.c.h b/Backends/System/Android/Sources/kinc/backend/video.c.h index 4fb702e69..04454c1be 100644 --- a/Backends/System/Android/Sources/kinc/backend/video.c.h +++ b/Backends/System/Android/Sources/kinc/backend/video.c.h @@ -452,8 +452,7 @@ void KoreAndroidVideoInit() { jclass clazz = kinc_android_find_class(env, "tech.kinc.KincMoviePlayer"); // String path, Surface surface, int id - JNINativeMethod methodTable[] = { - {"nativeCreate", "(Ljava/lang/String;Landroid/view/Surface;I)V", (void *)Java_tech_kinc_KincMoviePlayer_nativeCreate}}; + JNINativeMethod methodTable[] = {{"nativeCreate", "(Ljava/lang/String;Landroid/view/Surface;I)V", (void *)Java_tech_kinc_KincMoviePlayer_nativeCreate}}; int methodTableSize = sizeof(methodTable) / sizeof(methodTable[0]); diff --git a/Backends/System/iOS/Sources/kinc/backend/system.m.h b/Backends/System/iOS/Sources/kinc/backend/system.m.h index 4da9571ab..5c1a459b0 100644 --- a/Backends/System/iOS/Sources/kinc/backend/system.m.h +++ b/Backends/System/iOS/Sources/kinc/backend/system.m.h @@ -101,7 +101,7 @@ int kinc_init(const char *name, int width, int height, struct kinc_window_option } kinc_g4_internal_init(); kinc_g4_internal_init_window(0, frame->depth_bits, frame->stencil_bits, true); - + #ifdef KINC_KONG kong_init(); #endif diff --git a/Backends/System/macOS/Sources/kinc/backend/system.m.h b/Backends/System/macOS/Sources/kinc/backend/system.m.h index 783169ed2..a36cbbd61 100644 --- a/Backends/System/macOS/Sources/kinc/backend/system.m.h +++ b/Backends/System/macOS/Sources/kinc/backend/system.m.h @@ -212,11 +212,11 @@ int kinc_init(const char *name, int width, int height, kinc_window_options_t *wi int windowId = createWindow(win); kinc_g4_internal_init(); kinc_g4_internal_init_window(windowId, frame->depth_bits, frame->stencil_bits, true); - + #ifdef KINC_KONG kong_init(); #endif - + return 0; }