mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-03-21 18:01:15 +00:00
[renderer] Stub out all the vulkan functions
nq-x11 now gets through all three demos without crashing (but without rendering anything useful, though).
This commit is contained in:
parent
abd3b90004
commit
dacda50130
12 changed files with 596 additions and 170 deletions
include
libs
models/alias
video/renderer
15
include/QF/Vulkan/qf_particles.h
Normal file
15
include/QF/Vulkan/qf_particles.h
Normal file
|
@ -0,0 +1,15 @@
|
|||
#ifndef __QF_Vulkan_qf_particles_h
|
||||
#define __QF_Vulkan_qf_particles_h
|
||||
|
||||
#include "QF/image.h"
|
||||
|
||||
struct cvar_s;
|
||||
struct vulkan_ctx_s;;
|
||||
|
||||
void Vulkan_R_ClearParticles (struct vulkan_ctx_s *ctx);
|
||||
void Vulkan_R_InitParticles (struct vulkan_ctx_s *ctx);
|
||||
void Vulkan_r_easter_eggs_f (struct cvar_s *var, struct vulkan_ctx_s *ctx);
|
||||
void Vulkan_r_particles_style_f (struct cvar_s *var, struct vulkan_ctx_s *ctx);
|
||||
void Vulkan_Particles_Init (struct vulkan_ctx_s *ctx);
|
||||
|
||||
#endif//__QF_Vulkan_qf_particles_h
|
|
@ -49,12 +49,6 @@ void R_PushDlights (const vec3_t entorigin);
|
|||
struct cvar_s;
|
||||
void R_MaxDlightsCheck (struct cvar_s *var);
|
||||
void R_Particles_Init_Cvars (void);
|
||||
void R_Particle_New (ptype_t type, int texnum, const vec3_t org, float scale,
|
||||
const vec3_t vel, float die, int color, float alpha,
|
||||
float ramp);
|
||||
void R_Particle_NewRandom (ptype_t type, int texnum, const vec3_t org,
|
||||
int org_fuzz, float scale, int vel_fuzz, float die,
|
||||
int color, float alpha, float ramp);
|
||||
void R_InitBubble (void);
|
||||
|
||||
void R_InitParticles (void);
|
||||
|
|
|
@ -16,6 +16,7 @@ extern vid_render_funcs_t gl_vid_render_funcs;
|
|||
extern vid_render_funcs_t glsl_vid_render_funcs;
|
||||
extern vid_render_funcs_t sw_vid_render_funcs;
|
||||
extern vid_render_funcs_t sw32_vid_render_funcs;
|
||||
extern vid_render_funcs_t vulkan_vid_render_funcs;
|
||||
extern vid_render_funcs_t *vid_render_funcs;
|
||||
|
||||
#define vr_data vid_render_data
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
#include "compat.h"
|
||||
|
||||
void *
|
||||
gl_Mod_LoadSkin (byte * skin, int skinsize, int snum, int gnum, qboolean group,
|
||||
gl_Mod_LoadSkin (byte *skin, int skinsize, int snum, int gnum, qboolean group,
|
||||
maliasskindesc_t *skindesc)
|
||||
{
|
||||
byte *pskin;
|
||||
|
|
|
@ -237,6 +237,7 @@ libs_video_renderer_vid_render_vulkan_la_SOURCES = \
|
|||
libs/video/renderer/vulkan/vkparse.c \
|
||||
libs/video/renderer/vulkan/vulkan_draw.c \
|
||||
libs/video/renderer/vulkan/vulkan_matrices.c \
|
||||
libs/video/renderer/vulkan/vulkan_particles.c \
|
||||
libs/video/renderer/vulkan/vulkan_texture.c \
|
||||
libs/video/renderer/vulkan/vulkan_vid_common.c
|
||||
|
||||
|
|
|
@ -1591,6 +1591,27 @@ gl_R_DrawParticles (void)
|
|||
qfglDepthMask (GL_TRUE);
|
||||
}
|
||||
|
||||
static void
|
||||
gl_R_Particle_New (ptype_t type, int texnum, const vec3_t org, float scale,
|
||||
const vec3_t vel, float die, int color, float alpha,
|
||||
float ramp)
|
||||
{
|
||||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new (type, texnum, org, scale, vel, die, color, alpha, ramp);
|
||||
}
|
||||
|
||||
static void
|
||||
gl_R_Particle_NewRandom (ptype_t type, int texnum, const vec3_t org,
|
||||
int org_fuzz, float scale, int vel_fuzz, float die,
|
||||
int color, float alpha, float ramp)
|
||||
{
|
||||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new_random (type, texnum, org, org_fuzz, scale, vel_fuzz, die,
|
||||
color, alpha, ramp);
|
||||
}
|
||||
|
||||
static vid_particle_funcs_t particles_QF = {
|
||||
R_RocketTrail_QF,
|
||||
R_GrenadeTrail_QF,
|
||||
|
@ -1775,24 +1796,3 @@ gl_R_Particles_Init_Cvars (void)
|
|||
"0 for Id, 1 for QF.");
|
||||
R_ParticleFunctionInit ();
|
||||
}
|
||||
|
||||
void
|
||||
gl_R_Particle_New (ptype_t type, int texnum, const vec3_t org, float scale,
|
||||
const vec3_t vel, float die, int color, float alpha,
|
||||
float ramp)
|
||||
{
|
||||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new (type, texnum, org, scale, vel, die, color, alpha, ramp);
|
||||
}
|
||||
|
||||
void
|
||||
gl_R_Particle_NewRandom (ptype_t type, int texnum, const vec3_t org,
|
||||
int org_fuzz, float scale, int vel_fuzz, float die,
|
||||
int color, float alpha, float ramp)
|
||||
{
|
||||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new_random (type, texnum, org, org_fuzz, scale, vel_fuzz, die,
|
||||
color, alpha, ramp);
|
||||
}
|
||||
|
|
|
@ -1800,6 +1800,27 @@ glsl_R_DrawParticles (void)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
glsl_R_Particle_New (ptype_t type, int texnum, const vec3_t org, float scale,
|
||||
const vec3_t vel, float die, int color, float alpha,
|
||||
float ramp)
|
||||
{
|
||||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new (type, texnum, org, scale, vel, die, color, alpha, ramp);
|
||||
}
|
||||
|
||||
static void
|
||||
glsl_R_Particle_NewRandom (ptype_t type, int texnum, const vec3_t org,
|
||||
int org_fuzz, float scale, int vel_fuzz, float die,
|
||||
int color, float alpha, float ramp)
|
||||
{
|
||||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new_random (type, texnum, org, org_fuzz, scale, vel_fuzz, die,
|
||||
color, alpha, ramp);
|
||||
}
|
||||
|
||||
static vid_particle_funcs_t particles_QF = {
|
||||
R_RocketTrail_QF,
|
||||
R_GrenadeTrail_QF,
|
||||
|
@ -1984,24 +2005,3 @@ glsl_R_Particles_Init_Cvars (void)
|
|||
"0 for Id, 1 for QF.");
|
||||
R_ParticleFunctionInit ();
|
||||
}
|
||||
|
||||
void
|
||||
glsl_R_Particle_New (ptype_t type, int texnum, const vec3_t org, float scale,
|
||||
const vec3_t vel, float die, int color, float alpha,
|
||||
float ramp)
|
||||
{
|
||||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new (type, texnum, org, scale, vel, die, color, alpha, ramp);
|
||||
}
|
||||
|
||||
void
|
||||
glsl_R_Particle_NewRandom (ptype_t type, int texnum, const vec3_t org,
|
||||
int org_fuzz, float scale, int vel_fuzz, float die,
|
||||
int color, float alpha, float ramp)
|
||||
{
|
||||
if (numparticles >= r_maxparticles)
|
||||
return;
|
||||
particle_new_random (type, texnum, org, org_fuzz, scale, vel_fuzz, die,
|
||||
color, alpha, ramp);
|
||||
}
|
||||
|
|
|
@ -199,7 +199,7 @@ R_AddEfrags (entity_t *ent)
|
|||
{
|
||||
model_t *entmodel;
|
||||
|
||||
if (!ent->model)
|
||||
if (!ent->model || !r_worldentity.model)
|
||||
return;
|
||||
|
||||
if (ent == &r_worldentity)
|
||||
|
|
|
@ -801,6 +801,52 @@ r_particles_style_f (cvar_t *var)
|
|||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_Particle_New (ptype_t type, int texnum, const vec3_t org, float scale,
|
||||
const vec3_t vel, float die, int color, float alpha, float ramp)
|
||||
{
|
||||
particle_t *p;
|
||||
|
||||
if (!free_particles)
|
||||
return;
|
||||
p = free_particles;
|
||||
free_particles = p->next;
|
||||
p->next = active_particles;
|
||||
active_particles = p;
|
||||
|
||||
VectorCopy (org, p->org);
|
||||
p->color = color;
|
||||
p->tex = texnum;
|
||||
p->scale = scale;
|
||||
p->alpha = alpha;
|
||||
VectorCopy (vel, p->vel);
|
||||
p->type = type;
|
||||
p->phys = R_ParticlePhysics (p->type);
|
||||
p->die = die;
|
||||
p->ramp = ramp;
|
||||
}
|
||||
|
||||
static void
|
||||
R_Particle_NewRandom (ptype_t type, int texnum, const vec3_t org, int org_fuzz,
|
||||
float scale, int vel_fuzz, float die, int color,
|
||||
float alpha, float ramp)
|
||||
{
|
||||
float o_fuzz = org_fuzz, v_fuzz = vel_fuzz;
|
||||
int rnd;
|
||||
vec3_t porg, pvel;
|
||||
|
||||
rnd = mtwist_rand (&mt);
|
||||
porg[0] = o_fuzz * ((rnd & 63) - 31.5) / 63.0 + org[0];
|
||||
porg[1] = o_fuzz * (((rnd >> 6) & 63) - 31.5) / 63.0 + org[1];
|
||||
porg[2] = o_fuzz * (((rnd >> 10) & 63) - 31.5) / 63.0 + org[2];
|
||||
rnd = mtwist_rand (&mt);
|
||||
pvel[0] = v_fuzz * ((rnd & 63) - 31.5) / 63.0;
|
||||
pvel[1] = v_fuzz * (((rnd >> 6) & 63) - 31.5) / 63.0;
|
||||
pvel[2] = v_fuzz * (((rnd >> 10) & 63) - 31.5) / 63.0;
|
||||
|
||||
R_Particle_New (type, texnum, porg, scale, pvel, die, color, alpha, ramp);
|
||||
}
|
||||
|
||||
static vid_particle_funcs_t particles_QF = {
|
||||
R_RocketTrail_QF,
|
||||
R_GrenadeTrail_QF,
|
||||
|
@ -874,49 +920,3 @@ R_Particles_Init_Cvars (void)
|
|||
"0 for Id, 1 for QF.");
|
||||
R_ParticleFunctionInit ();
|
||||
}
|
||||
|
||||
void
|
||||
R_Particle_New (ptype_t type, int texnum, const vec3_t org, float scale,
|
||||
const vec3_t vel, float die, int color, float alpha, float ramp)
|
||||
{
|
||||
particle_t *p;
|
||||
|
||||
if (!free_particles)
|
||||
return;
|
||||
p = free_particles;
|
||||
free_particles = p->next;
|
||||
p->next = active_particles;
|
||||
active_particles = p;
|
||||
|
||||
VectorCopy (org, p->org);
|
||||
p->color = color;
|
||||
p->tex = texnum;
|
||||
p->scale = scale;
|
||||
p->alpha = alpha;
|
||||
VectorCopy (vel, p->vel);
|
||||
p->type = type;
|
||||
p->phys = R_ParticlePhysics (p->type);
|
||||
p->die = die;
|
||||
p->ramp = ramp;
|
||||
}
|
||||
|
||||
void
|
||||
R_Particle_NewRandom (ptype_t type, int texnum, const vec3_t org, int org_fuzz,
|
||||
float scale, int vel_fuzz, float die, int color,
|
||||
float alpha, float ramp)
|
||||
{
|
||||
float o_fuzz = org_fuzz, v_fuzz = vel_fuzz;
|
||||
int rnd;
|
||||
vec3_t porg, pvel;
|
||||
|
||||
rnd = mtwist_rand (&mt);
|
||||
porg[0] = o_fuzz * ((rnd & 63) - 31.5) / 63.0 + org[0];
|
||||
porg[1] = o_fuzz * (((rnd >> 6) & 63) - 31.5) / 63.0 + org[1];
|
||||
porg[2] = o_fuzz * (((rnd >> 10) & 63) - 31.5) / 63.0 + org[2];
|
||||
rnd = mtwist_rand (&mt);
|
||||
pvel[0] = v_fuzz * ((rnd & 63) - 31.5) / 63.0;
|
||||
pvel[1] = v_fuzz * (((rnd >> 6) & 63) - 31.5) / 63.0;
|
||||
pvel[2] = v_fuzz * (((rnd >> 10) & 63) - 31.5) / 63.0;
|
||||
|
||||
R_Particle_New (type, texnum, porg, scale, pvel, die, color, alpha, ramp);
|
||||
}
|
||||
|
|
|
@ -814,6 +814,53 @@ sw32_r_particles_style_f (cvar_t *var)
|
|||
{
|
||||
}
|
||||
|
||||
static void
|
||||
sw32_R_Particle_New (ptype_t type, int texnum, const vec3_t org, float scale,
|
||||
const vec3_t vel, float die, int color, float alpha,
|
||||
float ramp)
|
||||
{
|
||||
particle_t *p;
|
||||
|
||||
if (!free_particles)
|
||||
return;
|
||||
p = free_particles;
|
||||
free_particles = p->next;
|
||||
p->next = active_particles;
|
||||
active_particles = p;
|
||||
|
||||
VectorCopy (org, p->org);
|
||||
p->color = color;
|
||||
p->tex = texnum;
|
||||
p->scale = scale;
|
||||
p->alpha = alpha;
|
||||
VectorCopy (vel, p->vel);
|
||||
p->type = type;
|
||||
p->phys = R_ParticlePhysics (p->type);
|
||||
p->die = die;
|
||||
p->ramp = ramp;
|
||||
}
|
||||
|
||||
static void
|
||||
sw32_R_Particle_NewRandom (ptype_t type, int texnum, const vec3_t org,
|
||||
int org_fuzz, float scale, int vel_fuzz, float die,
|
||||
int color, float alpha, float ramp)
|
||||
{
|
||||
float o_fuzz = org_fuzz, v_fuzz = vel_fuzz;
|
||||
int rnd;
|
||||
vec3_t porg, pvel;
|
||||
|
||||
rnd = mtwist_rand (&mt);
|
||||
porg[0] = o_fuzz * ((rnd & 63) - 31.5) / 63.0 + org[0];
|
||||
porg[1] = o_fuzz * (((rnd >> 6) & 63) - 31.5) / 63.0 + org[1];
|
||||
porg[2] = o_fuzz * (((rnd >> 12) & 63) - 31.5) / 63.0 + org[2];
|
||||
rnd = mtwist_rand (&mt);
|
||||
pvel[0] = v_fuzz * ((rnd & 63) - 31.5) / 63.0;
|
||||
pvel[1] = v_fuzz * (((rnd >> 6) & 63) - 31.5) / 63.0;
|
||||
pvel[2] = v_fuzz * (((rnd >> 12) & 63) - 31.5) / 63.0;
|
||||
|
||||
sw32_R_Particle_New (type, texnum, porg, scale, pvel, die, color, alpha, ramp);
|
||||
}
|
||||
|
||||
static vid_particle_funcs_t particles_QF = {
|
||||
R_RocketTrail_QF,
|
||||
R_GrenadeTrail_QF,
|
||||
|
@ -887,50 +934,3 @@ sw32_R_Particles_Init_Cvars (void)
|
|||
"0 for Id, 1 for QF.");
|
||||
R_ParticleFunctionInit ();
|
||||
}
|
||||
|
||||
void
|
||||
sw32_R_Particle_New (ptype_t type, int texnum, const vec3_t org, float scale,
|
||||
const vec3_t vel, float die, int color, float alpha,
|
||||
float ramp)
|
||||
{
|
||||
particle_t *p;
|
||||
|
||||
if (!free_particles)
|
||||
return;
|
||||
p = free_particles;
|
||||
free_particles = p->next;
|
||||
p->next = active_particles;
|
||||
active_particles = p;
|
||||
|
||||
VectorCopy (org, p->org);
|
||||
p->color = color;
|
||||
p->tex = texnum;
|
||||
p->scale = scale;
|
||||
p->alpha = alpha;
|
||||
VectorCopy (vel, p->vel);
|
||||
p->type = type;
|
||||
p->phys = R_ParticlePhysics (p->type);
|
||||
p->die = die;
|
||||
p->ramp = ramp;
|
||||
}
|
||||
|
||||
void
|
||||
sw32_R_Particle_NewRandom (ptype_t type, int texnum, const vec3_t org,
|
||||
int org_fuzz, float scale, int vel_fuzz, float die,
|
||||
int color, float alpha, float ramp)
|
||||
{
|
||||
float o_fuzz = org_fuzz, v_fuzz = vel_fuzz;
|
||||
int rnd;
|
||||
vec3_t porg, pvel;
|
||||
|
||||
rnd = mtwist_rand (&mt);
|
||||
porg[0] = o_fuzz * ((rnd & 63) - 31.5) / 63.0 + org[0];
|
||||
porg[1] = o_fuzz * (((rnd >> 6) & 63) - 31.5) / 63.0 + org[1];
|
||||
porg[2] = o_fuzz * (((rnd >> 12) & 63) - 31.5) / 63.0 + org[2];
|
||||
rnd = mtwist_rand (&mt);
|
||||
pvel[0] = v_fuzz * ((rnd & 63) - 31.5) / 63.0;
|
||||
pvel[1] = v_fuzz * (((rnd >> 6) & 63) - 31.5) / 63.0;
|
||||
pvel[2] = v_fuzz * (((rnd >> 12) & 63) - 31.5) / 63.0;
|
||||
|
||||
sw32_R_Particle_New (type, texnum, porg, scale, pvel, die, color, alpha, ramp);
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#include "QF/plugin/vid_render.h"
|
||||
|
||||
#include "QF/Vulkan/qf_draw.h"
|
||||
#include "QF/Vulkan/qf_particles.h"
|
||||
#include "QF/Vulkan/qf_vid.h"
|
||||
#include "QF/Vulkan/command.h"
|
||||
#include "QF/Vulkan/device.h"
|
||||
|
@ -57,6 +58,29 @@
|
|||
|
||||
static vulkan_ctx_t *vulkan_ctx;
|
||||
|
||||
static tex_t *
|
||||
vulkan_SCR_CaptureBGR (void)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static tex_t *
|
||||
vulkan_SCR_ScreenShot (int width, int height)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_Fog_Update (float density, float red, float green, float blue,
|
||||
float time)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_Fog_ParseWorldspawn (struct plitem_s *worldspawn)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_R_Init (void)
|
||||
{
|
||||
|
@ -69,6 +93,7 @@ vulkan_R_Init (void)
|
|||
// are being built
|
||||
vulkan_ctx->pipeline = Vulkan_CreatePipeline (vulkan_ctx, "pipeline");
|
||||
Vulkan_Draw_Init (vulkan_ctx);
|
||||
Vulkan_Particles_Init (vulkan_ctx);
|
||||
|
||||
Sys_Printf ("R_Init %p %d", vulkan_ctx->swapchain->swapchain,
|
||||
vulkan_ctx->swapchain->numImages);
|
||||
|
@ -180,6 +205,31 @@ vulkan_R_RenderFrame (SCR_Func scr_3dfunc, SCR_Func *scr_funcs)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_R_ClearState (void)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_R_LoadSkys (const char *skyname)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_R_NewMap (model_t *worldmodel, model_t **models, int num_models)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_R_LineGraph (int x, int y, int *h_vals, int count)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_R_RenderView (void)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_Draw_Character (int x, int y, unsigned ch)
|
||||
{
|
||||
|
@ -306,30 +356,127 @@ vulkan_R_ViewChanged (float aspect)
|
|||
Vulkan_CalcProjectionMatrices (vulkan_ctx, aspect);
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_R_ClearParticles (void)
|
||||
{
|
||||
Vulkan_R_ClearParticles (vulkan_ctx);
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_R_InitParticles (void)
|
||||
{
|
||||
Vulkan_R_InitParticles (vulkan_ctx);
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_SCR_ScreenShot_f (void)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_r_easter_eggs_f (struct cvar_s *var)
|
||||
{
|
||||
Vulkan_r_easter_eggs_f (var, vulkan_ctx);
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_r_particles_style_f (struct cvar_s *var)
|
||||
{
|
||||
Vulkan_r_particles_style_f (var, vulkan_ctx);
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_Mod_LoadExternalTextures (model_t *mod)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_Mod_LoadLighting (bsp_t *bsp)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_Mod_SubdivideSurface (msurface_t *fa)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_Mod_ProcessTexture (texture_t *tx)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_Mod_MakeAliasModelDisplayLists (model_t *m, aliashdr_t *hdr,
|
||||
void *_m, int _s, int extra)
|
||||
{
|
||||
}
|
||||
|
||||
static void *
|
||||
vulkan_Mod_LoadSkin (byte *skin, int skinsize, int snum, int gnum,
|
||||
qboolean group, maliasskindesc_t *skindesc)
|
||||
{
|
||||
return skin + skinsize;
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_Mod_FinalizeAliasModel (model_t *m, aliashdr_t *hdr)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_Mod_LoadExternalSkins (model_t *mod)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_Mod_IQMFinish (model_t *mod)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_Mod_SpriteLoadTexture (mspriteframe_t *pspriteframe, int framenum)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_Skin_SetupSkin (struct skin_s *skin, int cmap)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_Skin_ProcessTranslation (int cmap, const byte *translation)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
vulkan_Skin_InitTranslations (void)
|
||||
{
|
||||
}
|
||||
|
||||
static vid_model_funcs_t model_funcs = {
|
||||
0,//vulkan_Mod_LoadExternalTextures,
|
||||
0,//vulkan_Mod_LoadLighting,
|
||||
0,//vulkan_Mod_SubdivideSurface,
|
||||
0,//vulkan_Mod_ProcessTexture,
|
||||
vulkan_Mod_LoadExternalTextures,
|
||||
vulkan_Mod_LoadLighting,
|
||||
vulkan_Mod_SubdivideSurface,
|
||||
vulkan_Mod_ProcessTexture,
|
||||
|
||||
Mod_LoadIQM,
|
||||
Mod_LoadAliasModel,
|
||||
Mod_LoadSpriteModel,
|
||||
|
||||
0,//vulkan_Mod_MakeAliasModelDisplayLists,
|
||||
0,//vulkan_Mod_LoadSkin,
|
||||
0,//vulkan_Mod_FinalizeAliasModel,
|
||||
0,//vulkan_Mod_LoadExternalSkins,
|
||||
0,//vulkan_Mod_IQMFinish,
|
||||
vulkan_Mod_MakeAliasModelDisplayLists,
|
||||
vulkan_Mod_LoadSkin,
|
||||
vulkan_Mod_FinalizeAliasModel,
|
||||
vulkan_Mod_LoadExternalSkins,
|
||||
vulkan_Mod_IQMFinish,
|
||||
0,
|
||||
0,//vulkan_Mod_SpriteLoadTexture,
|
||||
vulkan_Mod_SpriteLoadTexture,
|
||||
|
||||
Skin_SetColormap,
|
||||
Skin_SetSkin,
|
||||
0,//vulkan_Skin_SetupSkin,
|
||||
vulkan_Skin_SetupSkin,
|
||||
Skin_SetTranslation,
|
||||
0,//vulkan_Skin_ProcessTranslation,
|
||||
0,//vulkan_Skin_InitTranslations,
|
||||
vulkan_Skin_ProcessTranslation,
|
||||
vulkan_Skin_InitTranslations,
|
||||
};
|
||||
|
||||
vid_render_funcs_t vulkan_vid_render_funcs = {
|
||||
|
@ -357,33 +504,33 @@ vid_render_funcs_t vulkan_vid_render_funcs = {
|
|||
SCR_DrawRam,
|
||||
SCR_DrawTurtle,
|
||||
SCR_DrawPause,
|
||||
0,//vulkan_SCR_CaptureBGR,
|
||||
0,//vulkan_SCR_ScreenShot,
|
||||
vulkan_SCR_CaptureBGR,
|
||||
vulkan_SCR_ScreenShot,
|
||||
SCR_DrawStringToSnap,
|
||||
|
||||
0,//vulkan_Fog_Update,
|
||||
0,//vulkan_Fog_ParseWorldspawn,
|
||||
vulkan_Fog_Update,
|
||||
vulkan_Fog_ParseWorldspawn,
|
||||
|
||||
vulkan_R_Init,
|
||||
vulkan_R_RenderFrame,
|
||||
0,//vulkan_R_ClearState,
|
||||
0,//vulkan_R_LoadSkys,
|
||||
0,//vulkan_R_NewMap,
|
||||
vulkan_R_ClearState,
|
||||
vulkan_R_LoadSkys,
|
||||
vulkan_R_NewMap,
|
||||
R_AddEfrags,
|
||||
R_RemoveEfrags,
|
||||
R_EnqueueEntity,
|
||||
0,//vulkan_R_LineGraph,
|
||||
vulkan_R_LineGraph,
|
||||
R_AllocDlight,
|
||||
R_AllocEntity,
|
||||
R_MaxDlightsCheck,
|
||||
0,//vulkan_R_RenderView,
|
||||
vulkan_R_RenderView,
|
||||
R_DecayLights,
|
||||
vulkan_R_ViewChanged,
|
||||
0,//vulkan_R_ClearParticles,
|
||||
0,//vulkan_R_InitParticles,
|
||||
0,//vulkan_SCR_ScreenShot_f,
|
||||
0,//vulkan_r_easter_eggs_f,
|
||||
0,//vulkan_r_particles_style_f,
|
||||
vulkan_R_ClearParticles,
|
||||
vulkan_R_InitParticles,
|
||||
vulkan_SCR_ScreenShot_f,
|
||||
vulkan_r_easter_eggs_f,
|
||||
vulkan_r_particles_style_f,
|
||||
0,
|
||||
&model_funcs
|
||||
};
|
||||
|
|
268
libs/video/renderer/vulkan/vulkan_particles.c
Normal file
268
libs/video/renderer/vulkan/vulkan_particles.c
Normal file
|
@ -0,0 +1,268 @@
|
|||
/*
|
||||
vulkan_particles.c
|
||||
|
||||
Quake specific Vulkan particle manager
|
||||
|
||||
Copyright (C) 2021 Bill Currie <bill@taniwha.org>
|
||||
|
||||
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:
|
||||
|
||||
Free Software Foundation, Inc.
|
||||
59 Temple Place - Suite 330
|
||||
Boston, MA 02111-1307, USA
|
||||
|
||||
*/
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_MATH_H
|
||||
# include <math.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRING_H
|
||||
# include <string.h>
|
||||
#endif
|
||||
#ifdef HAVE_STRINGS_H
|
||||
# include <strings.h>
|
||||
#endif
|
||||
|
||||
#include "QF/cvar.h"
|
||||
#include "QF/render.h"
|
||||
#include "QF/plugin/vid_render.h"
|
||||
#include "QF/Vulkan/qf_vid.h"
|
||||
#include "QF/Vulkan/qf_particles.h"
|
||||
|
||||
#include "r_internal.h"
|
||||
#include "vid_vulkan.h"
|
||||
|
||||
void
|
||||
Vulkan_R_ClearParticles (struct vulkan_ctx_s *ctx)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
Vulkan_R_InitParticles (struct vulkan_ctx_s *ctx)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_RocketTrail_QF (const entity_t *ent)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_GrenadeTrail_QF (const entity_t *ent)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_BloodTrail_QF (const entity_t *ent)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_SlightBloodTrail_QF (const entity_t *ent)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_WizTrail_QF (const entity_t *ent)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_FlameTrail_QF (const entity_t *ent)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_VoorTrail_QF (const entity_t *ent)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_GlowTrail_QF (const entity_t *ent, int glow_color)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_RunParticleEffect_QF (const vec3_t org, const vec3_t dir, int color,
|
||||
int count)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_BloodPuffEffect_QF (const vec3_t org, int count)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_GunshotEffect_QF (const vec3_t org, int count)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_LightningBloodEffect_QF (const vec3_t org)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_SpikeEffect_QF (const vec3_t org)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_KnightSpikeEffect_QF (const vec3_t org)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_SuperSpikeEffect_QF (const vec3_t org)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_WizSpikeEffect_QF (const vec3_t org)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_BlobExplosion_QF (const vec3_t org)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_ParticleExplosion_QF (const vec3_t org)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_ParticleExplosion2_QF (const vec3_t org, int colorStart, int colorLength)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_LavaSplash_QF (const vec3_t org)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_TeleportSplash_QF (const vec3_t org)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_DarkFieldParticles_ID (const entity_t *ent)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_EntityParticles_ID (const entity_t *ent)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_Particle_New (ptype_t type, int texnum, const vec3_t org,
|
||||
float scale, const vec3_t vel, float die,
|
||||
int color, float alpha, float ramp)
|
||||
{
|
||||
}
|
||||
|
||||
static void
|
||||
R_Particle_NewRandom (ptype_t type, int texnum, const vec3_t org,
|
||||
int org_fuzz, float scale, int vel_fuzz,
|
||||
float die, int color, float alpha,
|
||||
float ramp)
|
||||
{
|
||||
}
|
||||
|
||||
static vid_particle_funcs_t vulkan_particles_QF = {
|
||||
R_RocketTrail_QF,
|
||||
R_GrenadeTrail_QF,
|
||||
R_BloodTrail_QF,
|
||||
R_SlightBloodTrail_QF,
|
||||
R_WizTrail_QF,
|
||||
R_FlameTrail_QF,
|
||||
R_VoorTrail_QF,
|
||||
R_GlowTrail_QF,
|
||||
R_RunParticleEffect_QF,
|
||||
R_BloodPuffEffect_QF,
|
||||
R_GunshotEffect_QF,
|
||||
R_LightningBloodEffect_QF,
|
||||
R_SpikeEffect_QF,
|
||||
R_KnightSpikeEffect_QF,
|
||||
R_SuperSpikeEffect_QF,
|
||||
R_WizSpikeEffect_QF,
|
||||
R_BlobExplosion_QF,
|
||||
R_ParticleExplosion_QF,
|
||||
R_ParticleExplosion2_QF,
|
||||
R_LavaSplash_QF,
|
||||
R_TeleportSplash_QF,
|
||||
R_DarkFieldParticles_ID,
|
||||
R_EntityParticles_ID,
|
||||
R_Particle_New,
|
||||
R_Particle_NewRandom,
|
||||
};
|
||||
|
||||
void
|
||||
Vulkan_r_easter_eggs_f (cvar_t *var, struct vulkan_ctx_s *ctx)
|
||||
{
|
||||
if (!easter_eggs || !r_particles_style) {
|
||||
return;
|
||||
}
|
||||
if (easter_eggs->int_val) {
|
||||
if (r_particles_style->int_val) {
|
||||
//vulkan_vid_render_funcs.particles = &vulkan_particles_QF_egg;
|
||||
} else {
|
||||
//vulkan_vid_render_funcs.particles = &vulkan_particles_ID_egg;
|
||||
}
|
||||
} else {
|
||||
if (r_particles_style->int_val) {
|
||||
//vulkan_vid_render_funcs.particles = &vulkan_particles_QF;
|
||||
} else {
|
||||
//vulkan_vid_render_funcs.particles = &vulkan_particles_ID;
|
||||
}
|
||||
}
|
||||
vulkan_vid_render_funcs.particles = &vulkan_particles_QF;
|
||||
}
|
||||
|
||||
void
|
||||
Vulkan_r_particles_style_f (cvar_t *var, struct vulkan_ctx_s *ctx)
|
||||
{
|
||||
Vulkan_r_particles_style_f (var, ctx);
|
||||
}
|
||||
|
||||
void
|
||||
Vulkan_Particles_Init (struct vulkan_ctx_s *ctx)
|
||||
{
|
||||
/*
|
||||
easter_eggs = Cvar_Get ("easter_eggs", "0", CVAR_NONE, r_easter_eggs_f,
|
||||
"Enables easter eggs.");
|
||||
r_particles = Cvar_Get ("r_particles", "1", CVAR_ARCHIVE, r_particles_f,
|
||||
"Toggles drawing of particles.");
|
||||
r_particles_max = Cvar_Get ("r_particles_max", "2048", CVAR_ARCHIVE,
|
||||
r_particles_max_f, "Maximum amount of "
|
||||
"particles to display. No maximum, minimum "
|
||||
"is 0.");
|
||||
r_particles_nearclip = Cvar_Get ("r_particles_nearclip", "32",
|
||||
CVAR_ARCHIVE, r_particles_nearclip_f,
|
||||
"Distance of the particle near clipping "
|
||||
"plane from the player.");
|
||||
r_particles_style = Cvar_Get ("r_particles_style", "1", CVAR_ARCHIVE,
|
||||
r_particles_style_f, "Sets particle style. "
|
||||
"0 for Id, 1 for QF.");
|
||||
*/
|
||||
vulkan_vid_render_funcs.particles = &vulkan_particles_QF;
|
||||
}
|
Loading…
Reference in a new issue