diff --git a/src/client/refresh/vk/header/vk_local.h b/src/client/refresh/vk/header/vk_local.h index ae20cc9c..cd0e6099 100644 --- a/src/client/refresh/vk/header/vk_local.h +++ b/src/client/refresh/vk/header/vk_local.h @@ -341,12 +341,8 @@ IMPLEMENTATION SPECIFIC FUNCTIONS ==================================================================== */ -void Vkimp_BeginFrame( float camera_separation ); -void Vkimp_EndFrame( void ); -int Vkimp_Init( void *hinstance, void *hWnd ); void Vkimp_Shutdown( void ); -void Vkimp_AppActivate( qboolean active ); void Vkimp_GetSurfaceExtensions(char **extensions, uint32_t *extCount); -VkResult Vkimp_CreateSurface(void); +qboolean Vkimp_CreateSurface(void); #endif diff --git a/src/client/refresh/vk/vk_common.c b/src/client/refresh/vk/vk_common.c index 430c992b..a6f85579 100644 --- a/src/client/refresh/vk/vk_common.c +++ b/src/client/refresh/vk/vk_common.c @@ -1619,10 +1619,8 @@ qboolean QVk_Init() if (vk_validation->value) QVk_CreateValidationLayers(); - res = Vkimp_CreateSurface(); - if (res != VK_SUCCESS) + if (!Vkimp_CreateSurface()) { - R_Printf(PRINT_ALL, "%s(): Could not create Vulkan surface: %s\n", __func__, QVk_GetError(res)); return false; } R_Printf(PRINT_ALL, "...created Vulkan surface\n"); diff --git a/src/client/refresh/vk/vk_light.c b/src/client/refresh/vk/vk_light.c index adb3aa23..19b4f728 100644 --- a/src/client/refresh/vk/vk_light.c +++ b/src/client/refresh/vk/vk_light.c @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "header/vk_local.h" -int r_dlightframecount; +static int r_dlightframecount; #define DLIGHT_CUTOFF 64 diff --git a/src/client/refresh/vk/vk_rmain.c b/src/client/refresh/vk/vk_rmain.c index 04795b31..696116d9 100644 --- a/src/client/refresh/vk/vk_rmain.c +++ b/src/client/refresh/vk/vk_rmain.c @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "header/vk_local.h" -// world rendered readdy to render 2d elements +// world rendered and ready to render 2d elements static qboolean world_rendered; viddef_t vid; @@ -1256,13 +1256,6 @@ void R_Shutdown (void) Vkimp_Shutdown(); } -/* -** Vkimp_BeginFrame -*/ -void Vkimp_BeginFrame( float camera_seperation ) -{ -} - /* ===================== R_BeginFrame @@ -1303,8 +1296,6 @@ void R_BeginFrame( float camera_separation ) } } - Vkimp_BeginFrame(camera_separation); - VkResult swapChainValid = QVk_BeginFrame(); // if the swapchain is invalid, just recreate the video system and revert to safe windowed mode if (swapChainValid != VK_SUCCESS) @@ -1507,14 +1498,15 @@ void Vkimp_Shutdown( void ) window = NULL; } -VkResult Vkimp_CreateSurface() +qboolean Vkimp_CreateSurface() { if (!SDL_Vulkan_CreateSurface(window, vk_instance, &vk_surface)) { - ri.Sys_Error(ERR_FATAL, "%s() SDL_Vulkan_CreateSurface failed", __func__); - return VK_ERROR_SURFACE_LOST_KHR; + ri.Sys_Error(ERR_FATAL, "%s() SDL_Vulkan_CreateSurface failed: %s", + __func__, SDL_GetError()); + return false; } - return VK_SUCCESS; + return true; } static void diff --git a/src/client/refresh/vk/vk_warp.c b/src/client/refresh/vk/vk_warp.c index 22499e0d..223e0954 100644 --- a/src/client/refresh/vk/vk_warp.c +++ b/src/client/refresh/vk/vk_warp.c @@ -23,16 +23,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern model_t *loadmodel; -char skyname[MAX_QPATH]; -float skyrotate; -vec3_t skyaxis; -image_t *sky_images[6]; +static char skyname[MAX_QPATH]; +static float skyrotate; +static vec3_t skyaxis; +static image_t *sky_images[6]; -msurface_t *warpface; +static msurface_t *warpface; #define SUBDIVIDE_SIZE 64 -void BoundPoly (int numverts, float *verts, vec3_t mins, vec3_t maxs) +static void BoundPoly (int numverts, float *verts, vec3_t mins, vec3_t maxs) { int i, j; float *v; @@ -50,7 +50,7 @@ void BoundPoly (int numverts, float *verts, vec3_t mins, vec3_t maxs) } } -void SubdividePolygon (int numverts, float *verts) +static void SubdividePolygon (int numverts, float *verts) { int i, j, k; vec3_t mins, maxs; @@ -276,7 +276,7 @@ void EmitWaterPolys (msurface_t *fa, image_t *texture, float *modelMatrix, float //=================================================================== -vec3_t skyclip[6] = { +static vec3_t skyclip[6] = { {1,1,0}, {1,-1,0}, {0,-1,1}, @@ -284,10 +284,9 @@ vec3_t skyclip[6] = { {1,0,1}, {-1,0,1} }; -int c_sky; // 1 = s, 2 = t, 3 = 2048 -int st_to_vec[6][3] = +static int st_to_vec[6][3] = { {3,-1,2}, {-3,1,2}, @@ -303,7 +302,7 @@ int st_to_vec[6][3] = }; // s = [0]/[2], t = [1]/[2] -int vec_to_st[6][3] = +static int vec_to_st[6][3] = { {-2,3,1}, {2,3,-1}, @@ -318,10 +317,10 @@ int vec_to_st[6][3] = // {1,2,-3} }; -float skymins[2][6], skymaxs[2][6]; -float sky_min, sky_max; +static float skymins[2][6], skymaxs[2][6]; +static float sky_min, sky_max; -void DrawSkyPolygon (int nump, vec3_t vecs) +static void DrawSkyPolygon (int nump, vec3_t vecs) { int i,j; vec3_t v, av; @@ -329,8 +328,6 @@ void DrawSkyPolygon (int nump, vec3_t vecs) int axis; float *vp; - c_sky++; - // decide which face it maps to VectorCopy (vec3_origin, v); for (i=0, vp=vecs ; i