mirror of
https://github.com/yquake2/ref_vk.git
synced 2025-02-17 01:22:13 +00:00
Fix function propotypes -Wmissing-prototypes
This commit is contained in:
parent
2c4c8421fb
commit
41f12687a4
13 changed files with 83 additions and 30 deletions
|
@ -29,7 +29,7 @@
|
||||||
#ifndef CO_COMMON_H
|
#ifndef CO_COMMON_H
|
||||||
#define CO_COMMON_H
|
#define CO_COMMON_H
|
||||||
|
|
||||||
#include "shared.h"
|
#include "shared_safe.h"
|
||||||
#include "crc.h"
|
#include "crc.h"
|
||||||
|
|
||||||
#define VKVERSION "1.0"
|
#define VKVERSION "1.0"
|
||||||
|
|
42
src/common/header/shared_safe.h
Normal file
42
src/common/header/shared_safe.h
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/*
|
||||||
|
* Copyright (C) 1997-2001 Id Software, Inc.
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation; either version 2 of the License, or (at
|
||||||
|
* your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
|
*
|
||||||
|
* See the GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
||||||
|
* 02111-1307, USA.
|
||||||
|
*
|
||||||
|
* =======================================================================
|
||||||
|
*
|
||||||
|
* Updated prototypes of shared functions and definitions
|
||||||
|
*
|
||||||
|
* =======================================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef COMMON_SHARED_SAFE_H
|
||||||
|
#define COMMON_SHARED_SAFE_H
|
||||||
|
|
||||||
|
#include "shared.h"
|
||||||
|
|
||||||
|
// Not exported by default but not static
|
||||||
|
float Q_fabs(float f);
|
||||||
|
int BoxOnPlaneSide2(vec3_t emins, vec3_t emaxs, struct cplane_s *p);
|
||||||
|
short ShortSwap(short l);
|
||||||
|
short ShortNoSwap(short l);
|
||||||
|
int LongSwap(int l);
|
||||||
|
int LongNoSwap(int l);
|
||||||
|
float FloatSwap(float f);
|
||||||
|
float FloatNoSwap(float f);
|
||||||
|
|
||||||
|
#endif // COMMON_SHARED_SAFE_H
|
|
@ -7,6 +7,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <inttypes.h>
|
#include <inttypes.h>
|
||||||
|
#include "header/common.h"
|
||||||
|
|
||||||
#define ROTATELEFT32(x, s) (((x) << (s)) | ((x) >> (32 - (s))))
|
#define ROTATELEFT32(x, s) (((x) << (s)) | ((x) >> (32 - (s))))
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "header/shared.h"
|
#include "header/shared_safe.h"
|
||||||
|
|
||||||
#define DEG2RAD(a) (a * M_PI) / 180.0F
|
#define DEG2RAD(a) (a * M_PI) / 180.0F
|
||||||
|
|
||||||
|
|
|
@ -149,6 +149,7 @@ extern cvar_t *vk_lmaptexturemode;
|
||||||
extern cvar_t *vk_aniso;
|
extern cvar_t *vk_aniso;
|
||||||
extern cvar_t *vk_sampleshading;
|
extern cvar_t *vk_sampleshading;
|
||||||
extern cvar_t *vk_device_idx;
|
extern cvar_t *vk_device_idx;
|
||||||
|
extern cvar_t *vk_mip_nearfilter;
|
||||||
#if defined(__APPLE__)
|
#if defined(__APPLE__)
|
||||||
extern cvar_t *vk_molten_fastmath;
|
extern cvar_t *vk_molten_fastmath;
|
||||||
extern cvar_t *vk_molten_metalbuffers;
|
extern cvar_t *vk_molten_metalbuffers;
|
||||||
|
@ -179,6 +180,14 @@ extern model_t *r_worldmodel;
|
||||||
|
|
||||||
extern unsigned d_8to24table[256];
|
extern unsigned d_8to24table[256];
|
||||||
|
|
||||||
|
extern unsigned r_rawpalette[256];
|
||||||
|
extern qvktexture_t vk_rawTexture;
|
||||||
|
extern int vk_activeBufferIdx;
|
||||||
|
extern float r_view_matrix[16];
|
||||||
|
extern float r_projection_matrix[16];
|
||||||
|
extern float r_viewproj_matrix[16];
|
||||||
|
extern vec3_t lightspot;
|
||||||
|
|
||||||
extern int registration_sequence;
|
extern int registration_sequence;
|
||||||
extern qvksampler_t vk_current_sampler;
|
extern qvksampler_t vk_current_sampler;
|
||||||
extern qvksampler_t vk_current_lmap_sampler;
|
extern qvksampler_t vk_current_lmap_sampler;
|
||||||
|
@ -186,12 +195,17 @@ extern qvksampler_t vk_current_lmap_sampler;
|
||||||
void RE_Shutdown( void );
|
void RE_Shutdown( void );
|
||||||
|
|
||||||
void Vk_ScreenShot_f (void);
|
void Vk_ScreenShot_f (void);
|
||||||
|
void Vk_Strings_f(void);
|
||||||
|
void Vk_Mem_f(void);
|
||||||
|
|
||||||
void R_DrawAliasModel (entity_t *currententity, model_t *currentmodel);
|
void R_DrawAliasModel (entity_t *currententity, model_t *currentmodel);
|
||||||
void R_DrawBrushModel (entity_t *currententity, model_t *currentmodel);
|
void R_DrawBrushModel (entity_t *currententity, model_t *currentmodel);
|
||||||
void R_DrawSpriteModel (entity_t *currententity, model_t *currentmodel);
|
void R_DrawSpriteModel (entity_t *currententity, model_t *currentmodel);
|
||||||
void R_DrawBeam (entity_t *currententity);
|
void R_DrawBeam (entity_t *currententity);
|
||||||
void R_DrawWorld (void);
|
void R_DrawWorld (void);
|
||||||
void R_RenderDlights (void);
|
void R_RenderDlights (void);
|
||||||
|
void R_SetCacheState( msurface_t *surf );
|
||||||
|
void R_BuildLightMap (msurface_t *surf, byte *dest, int stride);
|
||||||
void R_DrawAlphaSurfaces (void);
|
void R_DrawAlphaSurfaces (void);
|
||||||
void RE_InitParticleTexture (void);
|
void RE_InitParticleTexture (void);
|
||||||
void Draw_InitLocal (void);
|
void Draw_InitLocal (void);
|
||||||
|
@ -346,4 +360,7 @@ void Mesh_Init (void);
|
||||||
void Mesh_Free (void);
|
void Mesh_Free (void);
|
||||||
int Mesh_VertsRealloc(int count);
|
int Mesh_VertsRealloc(int count);
|
||||||
|
|
||||||
|
// All renders should export such function
|
||||||
|
Q2_DLL_EXPORTED refexport_t GetRefAPI(refimport_t imp);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -305,12 +305,12 @@ VkSampler QVk_UpdateTextureSampler(qvktexture_t *texture, qvksampler_t samplerTy
|
||||||
void QVk_ReadPixels(uint8_t *dstBuffer, const VkOffset2D *offset, const VkExtent2D *extent);
|
void QVk_ReadPixels(uint8_t *dstBuffer, const VkOffset2D *offset, const VkExtent2D *extent);
|
||||||
VkResult QVk_BeginCommand(const VkCommandBuffer *commandBuffer);
|
VkResult QVk_BeginCommand(const VkCommandBuffer *commandBuffer);
|
||||||
void QVk_SubmitCommand(const VkCommandBuffer *commandBuffer, const VkQueue *queue);
|
void QVk_SubmitCommand(const VkCommandBuffer *commandBuffer, const VkQueue *queue);
|
||||||
VkCommandBuffer QVk_CreateCommandBuffer(const VkCommandPool *commandPool, VkCommandBufferLevel level);
|
VkCommandBuffer QVk_CreateCommandBuffer(const VkCommandPool *commandPool, VkCommandBufferLevel level);
|
||||||
const char* QVk_GetError(VkResult errorCode);
|
const char* QVk_GetError(VkResult errorCode);
|
||||||
VkResult QVk_BeginFrame(const VkViewport* viewport, const VkRect2D* scissor);
|
VkResult QVk_BeginFrame(const VkViewport* viewport, const VkRect2D* scissor);
|
||||||
VkResult QVk_EndFrame(qboolean force);
|
VkResult QVk_EndFrame(qboolean force);
|
||||||
void QVk_BeginRenderpass(qvkrenderpasstype_t rpType);
|
void QVk_BeginRenderpass(qvkrenderpasstype_t rpType);
|
||||||
qboolean QVk_RecreateSwapchain();
|
qboolean QVk_RecreateSwapchain();
|
||||||
void QVk_FreeStagingBuffer(qvkstagingbuffer_t *buffer);
|
void QVk_FreeStagingBuffer(qvkstagingbuffer_t *buffer);
|
||||||
VkResult QVk_CreateBuffer(VkDeviceSize size, qvkbuffer_t *dstBuffer, const qvkbufferopts_t options);
|
VkResult QVk_CreateBuffer(VkDeviceSize size, qvkbuffer_t *dstBuffer, const qvkbufferopts_t options);
|
||||||
void QVk_FreeBuffer(qvkbuffer_t *buffer);
|
void QVk_FreeBuffer(qvkbuffer_t *buffer);
|
||||||
|
@ -318,7 +318,7 @@ VkResult QVk_CreateStagingBuffer(VkDeviceSize size, qvkstagingbuffer_t *dstBuffe
|
||||||
VkResult QVk_CreateUniformBuffer(VkDeviceSize size, qvkbuffer_t *dstBuffer, VkMemoryPropertyFlags reqMemFlags, VkMemoryPropertyFlags prefMemFlags);
|
VkResult QVk_CreateUniformBuffer(VkDeviceSize size, qvkbuffer_t *dstBuffer, VkMemoryPropertyFlags reqMemFlags, VkMemoryPropertyFlags prefMemFlags);
|
||||||
void QVk_CreateVertexBuffer(const void *data, VkDeviceSize size, qvkbuffer_t *dstBuffer, VkMemoryPropertyFlags reqMemFlags, VkMemoryPropertyFlags prefMemFlags);
|
void QVk_CreateVertexBuffer(const void *data, VkDeviceSize size, qvkbuffer_t *dstBuffer, VkMemoryPropertyFlags reqMemFlags, VkMemoryPropertyFlags prefMemFlags);
|
||||||
void QVk_CreateIndexBuffer(const void *data, VkDeviceSize size, qvkbuffer_t *dstBuffer, VkMemoryPropertyFlags reqMemFlags, VkMemoryPropertyFlags prefMemFlags);
|
void QVk_CreateIndexBuffer(const void *data, VkDeviceSize size, qvkbuffer_t *dstBuffer, VkMemoryPropertyFlags reqMemFlags, VkMemoryPropertyFlags prefMemFlags);
|
||||||
qvkshader_t QVk_CreateShader(const uint32_t *shaderSrc, size_t shaderCodeSize, VkShaderStageFlagBits shaderStage);
|
qvkshader_t QVk_CreateShader(const uint32_t *shaderSrc, size_t shaderCodeSize, VkShaderStageFlagBits shaderStage);
|
||||||
void QVk_CreatePipeline(const VkDescriptorSetLayout *descriptorLayout, const uint32_t descLayoutCount, const VkPipelineVertexInputStateCreateInfo *vertexInputInfo, qvkpipeline_t *pipeline, const qvkrenderpass_t *renderpass, const qvkshader_t *shaders, uint32_t shaderCount);
|
void QVk_CreatePipeline(const VkDescriptorSetLayout *descriptorLayout, const uint32_t descLayoutCount, const VkPipelineVertexInputStateCreateInfo *vertexInputInfo, qvkpipeline_t *pipeline, const qvkrenderpass_t *renderpass, const qvkshader_t *shaders, uint32_t shaderCount);
|
||||||
void QVk_DestroyPipeline(qvkpipeline_t *pipeline);
|
void QVk_DestroyPipeline(qvkpipeline_t *pipeline);
|
||||||
uint8_t* QVk_GetVertexBuffer(VkDeviceSize size, VkBuffer *dstBuffer, VkDeviceSize *dstOffset);
|
uint8_t* QVk_GetVertexBuffer(VkDeviceSize size, VkBuffer *dstBuffer, VkDeviceSize *dstOffset);
|
||||||
|
|
|
@ -268,8 +268,6 @@ void RE_Draw_FadeScreen (void)
|
||||||
RE_Draw_StretchRaw
|
RE_Draw_StretchRaw
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
extern unsigned r_rawpalette[256];
|
|
||||||
extern qvktexture_t vk_rawTexture;
|
|
||||||
static int vk_rawTexture_height;
|
static int vk_rawTexture_height;
|
||||||
static int vk_rawTexture_width;
|
static int vk_rawTexture_width;
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,6 @@ static byte intensitytable[256];
|
||||||
static unsigned char overbrightable[256];
|
static unsigned char overbrightable[256];
|
||||||
|
|
||||||
static cvar_t *intensity;
|
static cvar_t *intensity;
|
||||||
extern cvar_t *vk_mip_nearfilter;
|
|
||||||
|
|
||||||
unsigned d_8to24table[256];
|
unsigned d_8to24table[256];
|
||||||
|
|
||||||
|
@ -511,7 +510,6 @@ void QVk_ReadPixels(uint8_t *dstBuffer, const VkOffset2D *offset, const VkExtent
|
||||||
BufferResource_t buff;
|
BufferResource_t buff;
|
||||||
uint8_t *pMappedData;
|
uint8_t *pMappedData;
|
||||||
VkCommandBuffer cmdBuffer;
|
VkCommandBuffer cmdBuffer;
|
||||||
extern int vk_activeBufferIdx;
|
|
||||||
|
|
||||||
VkBufferCreateInfo bcInfo = {
|
VkBufferCreateInfo bcInfo = {
|
||||||
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
|
.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO,
|
||||||
|
|
|
@ -34,7 +34,8 @@ DYNAMIC LIGHTS BLEND RENDERING
|
||||||
=============================================================================
|
=============================================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void R_RenderDlight (dlight_t *light)
|
static void
|
||||||
|
R_RenderDlight (dlight_t *light)
|
||||||
{
|
{
|
||||||
int i, j;
|
int i, j;
|
||||||
float rad;
|
float rad;
|
||||||
|
|
|
@ -73,10 +73,6 @@ static float r_avertexnormal_dots[SHADEDOT_QUANT][256] = {
|
||||||
|
|
||||||
float *shadedots = r_avertexnormal_dots[0];
|
float *shadedots = r_avertexnormal_dots[0];
|
||||||
|
|
||||||
extern float r_view_matrix[16];
|
|
||||||
extern float r_projection_matrix[16];
|
|
||||||
extern float r_viewproj_matrix[16];
|
|
||||||
|
|
||||||
// correction matrix with "hacked depth" for models with RF_DEPTHHACK flag set
|
// correction matrix with "hacked depth" for models with RF_DEPTHHACK flag set
|
||||||
static float r_vulkan_correction_dh[16] = {
|
static float r_vulkan_correction_dh[16] = {
|
||||||
1.f, 0.f, 0.f, 0.f,
|
1.f, 0.f, 0.f, 0.f,
|
||||||
|
@ -516,8 +512,6 @@ static void Vk_DrawAliasFrameLerp (dmdl_t *paliashdr, float backlerp, image_t *s
|
||||||
Vk_DrawAliasShadow
|
Vk_DrawAliasShadow
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
extern vec3_t lightspot;
|
|
||||||
|
|
||||||
static void Vk_DrawAliasShadow (dmdl_t *paliashdr, int posenum, float *modelMatrix, entity_t *currententity)
|
static void Vk_DrawAliasShadow (dmdl_t *paliashdr, int posenum, float *modelMatrix, entity_t *currententity)
|
||||||
{
|
{
|
||||||
int *order;
|
int *order;
|
||||||
|
|
|
@ -88,7 +88,8 @@ const byte *Mod_ClusterPVS (int cluster, const model_t *model)
|
||||||
Mod_Reallocate
|
Mod_Reallocate
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
void Mod_Reallocate (void)
|
static void
|
||||||
|
Mod_Reallocate (void)
|
||||||
{
|
{
|
||||||
if ((models_known_max >= (mod_max * 4)) && (models_known != NULL))
|
if ((models_known_max >= (mod_max * 4)) && (models_known != NULL))
|
||||||
{
|
{
|
||||||
|
|
|
@ -49,9 +49,6 @@ int c_brush_polys, c_alias_polys;
|
||||||
|
|
||||||
static float v_blend[4]; // final blending color
|
static float v_blend[4]; // final blending color
|
||||||
|
|
||||||
void Vk_Strings_f(void);
|
|
||||||
void Vk_Mem_f(void);
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// view origin
|
// view origin
|
||||||
//
|
//
|
||||||
|
@ -260,7 +257,8 @@ void R_DrawSpriteModel (entity_t *currententity, model_t *currentmodel)
|
||||||
R_DrawNullModel
|
R_DrawNullModel
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
void R_DrawNullModel (entity_t *currententity)
|
static void
|
||||||
|
R_DrawNullModel (entity_t *currententity)
|
||||||
{
|
{
|
||||||
vec3_t shadelight;
|
vec3_t shadelight;
|
||||||
int i,j;
|
int i,j;
|
||||||
|
@ -331,7 +329,8 @@ void R_DrawNullModel (entity_t *currententity)
|
||||||
R_DrawEntitiesOnList
|
R_DrawEntitiesOnList
|
||||||
=============
|
=============
|
||||||
*/
|
*/
|
||||||
void R_DrawEntitiesOnList (void)
|
static void
|
||||||
|
R_DrawEntitiesOnList (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -421,7 +420,8 @@ void R_DrawEntitiesOnList (void)
|
||||||
** Vk_DrawParticles
|
** Vk_DrawParticles
|
||||||
**
|
**
|
||||||
*/
|
*/
|
||||||
void Vk_DrawParticles(int num_particles, const particle_t particles[], const unsigned *colortable)
|
static void
|
||||||
|
Vk_DrawParticles(int num_particles, const particle_t particles[], const unsigned *colortable)
|
||||||
{
|
{
|
||||||
typedef struct {
|
typedef struct {
|
||||||
float x,y,z,r,g,b,a,u,v;
|
float x,y,z,r,g,b,a,u,v;
|
||||||
|
@ -535,7 +535,8 @@ void Vk_DrawParticles(int num_particles, const particle_t particles[], const uns
|
||||||
R_DrawParticles
|
R_DrawParticles
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
void R_DrawParticles (void)
|
static void
|
||||||
|
R_DrawParticles (void)
|
||||||
{
|
{
|
||||||
if (vk_custom_particles->value == 1)
|
if (vk_custom_particles->value == 1)
|
||||||
{
|
{
|
||||||
|
@ -614,7 +615,8 @@ void R_DrawParticles (void)
|
||||||
R_PolyBlend
|
R_PolyBlend
|
||||||
============
|
============
|
||||||
*/
|
*/
|
||||||
void R_PolyBlend (void)
|
static void
|
||||||
|
R_PolyBlend (void)
|
||||||
{
|
{
|
||||||
if (!vk_polyblend->value)
|
if (!vk_polyblend->value)
|
||||||
return;
|
return;
|
||||||
|
@ -671,7 +673,8 @@ R_SetFrustum (float fovx, float fovy)
|
||||||
R_SetupFrame
|
R_SetupFrame
|
||||||
===============
|
===============
|
||||||
*/
|
*/
|
||||||
void R_SetupFrame (void)
|
static void
|
||||||
|
R_SetupFrame (void)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
mleaf_t *leaf;
|
mleaf_t *leaf;
|
||||||
|
@ -1270,7 +1273,8 @@ Vkimp_SetMode(int *pwidth, int *pheight, int mode, int fullscreen)
|
||||||
R_SetMode
|
R_SetMode
|
||||||
==================
|
==================
|
||||||
*/
|
*/
|
||||||
qboolean R_SetMode (void)
|
static qboolean
|
||||||
|
R_SetMode (void)
|
||||||
{
|
{
|
||||||
rserr_t err;
|
rserr_t err;
|
||||||
int fullscreen;
|
int fullscreen;
|
||||||
|
|
|
@ -58,9 +58,6 @@ static void LM_InitBlock( void );
|
||||||
static void LM_UploadBlock( qboolean dynamic );
|
static void LM_UploadBlock( qboolean dynamic );
|
||||||
static qboolean LM_AllocBlock (int w, int h, int *x, int *y);
|
static qboolean LM_AllocBlock (int w, int h, int *x, int *y);
|
||||||
|
|
||||||
extern void R_SetCacheState( msurface_t *surf );
|
|
||||||
extern void R_BuildLightMap (msurface_t *surf, byte *dest, int stride);
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
=============================================================
|
=============================================================
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue