mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-26 06:10:56 +00:00
[model] Initialize r_notexture_mip in the right places
That being in the renderer. This is why qwaq needed that call to Mod_ProcessTexture (but no longer does :)
This commit is contained in:
parent
41a12f066b
commit
2818fc12a5
6 changed files with 11 additions and 9 deletions
|
@ -52,8 +52,6 @@
|
||||||
#include "mod_internal.h"
|
#include "mod_internal.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
|
||||||
static gltex_t gl_notexture = { };
|
|
||||||
|
|
||||||
static tex_t *
|
static tex_t *
|
||||||
Mod_LoadAnExternalTexture (const char *tname, const char *mname)
|
Mod_LoadAnExternalTexture (const char *tname, const char *mname)
|
||||||
{
|
{
|
||||||
|
@ -122,7 +120,6 @@ gl_Mod_ProcessTexture (model_t *mod, texture_t *tx)
|
||||||
const char *name;
|
const char *name;
|
||||||
|
|
||||||
if (!tx) {
|
if (!tx) {
|
||||||
r_notexture_mip->render = &gl_notexture;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (gl_textures_external) {
|
if (gl_textures_external) {
|
||||||
|
|
|
@ -60,8 +60,6 @@
|
||||||
#include "mod_internal.h"
|
#include "mod_internal.h"
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
|
|
||||||
static glsltex_t glsl_notexture = { };
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
glsl_brush_clear (model_t *m, void *data)
|
glsl_brush_clear (model_t *m, void *data)
|
||||||
{
|
{
|
||||||
|
@ -105,7 +103,6 @@ void
|
||||||
glsl_Mod_ProcessTexture (model_t *mod, texture_t *tx)
|
glsl_Mod_ProcessTexture (model_t *mod, texture_t *tx)
|
||||||
{
|
{
|
||||||
if (!tx) {
|
if (!tx) {
|
||||||
r_notexture_mip->render = &glsl_notexture;
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
glsltex_t *tex = tx->render;
|
glsltex_t *tex = tx->render;
|
||||||
|
|
|
@ -62,8 +62,6 @@
|
||||||
#include "r_internal.h"
|
#include "r_internal.h"
|
||||||
#include "vid_vulkan.h"
|
#include "vid_vulkan.h"
|
||||||
|
|
||||||
static vulktex_t vulkan_notexture = { };
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
vulkan_brush_clear (model_t *mod, void *data)
|
vulkan_brush_clear (model_t *mod, void *data)
|
||||||
{
|
{
|
||||||
|
@ -302,7 +300,6 @@ Vulkan_Mod_ProcessTexture (model_t *mod, texture_t *tx, vulkan_ctx_t *ctx)
|
||||||
mod->clear = vulkan_brush_clear;
|
mod->clear = vulkan_brush_clear;
|
||||||
mod->data = mctx;
|
mod->data = mctx;
|
||||||
|
|
||||||
r_notexture_mip->render = &vulkan_notexture;
|
|
||||||
if (mod->brush.numtextures) {
|
if (mod->brush.numtextures) {
|
||||||
load_textures (mod, ctx);
|
load_textures (mod, ctx);
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,6 +73,8 @@
|
||||||
#include "varrays.h"
|
#include "varrays.h"
|
||||||
#include "vid_gl.h"
|
#include "vid_gl.h"
|
||||||
|
|
||||||
|
static gltex_t gl_notexture = { };
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gl_R_LoadSky_f (void)
|
gl_R_LoadSky_f (void)
|
||||||
{
|
{
|
||||||
|
@ -115,6 +117,8 @@ gl_R_TimeRefresh_f (void)
|
||||||
void
|
void
|
||||||
gl_R_Init (void)
|
gl_R_Init (void)
|
||||||
{
|
{
|
||||||
|
r_notexture_mip->render = &gl_notexture;
|
||||||
|
|
||||||
R_Init_Cvars ();
|
R_Init_Cvars ();
|
||||||
|
|
||||||
Cmd_AddCommand ("timerefresh", gl_R_TimeRefresh_f,
|
Cmd_AddCommand ("timerefresh", gl_R_TimeRefresh_f,
|
||||||
|
|
|
@ -103,6 +103,7 @@ static double sky_time;
|
||||||
|
|
||||||
static quat_t default_color = { 1, 1, 1, 1 };
|
static quat_t default_color = { 1, 1, 1, 1 };
|
||||||
static quat_t last_color;
|
static quat_t last_color;
|
||||||
|
static glsltex_t glsl_notexture = { };
|
||||||
|
|
||||||
static const char *bsp_vert_effects[] =
|
static const char *bsp_vert_effects[] =
|
||||||
{
|
{
|
||||||
|
@ -1282,6 +1283,8 @@ glsl_R_InitBsp (void)
|
||||||
int vert;
|
int vert;
|
||||||
int frag;
|
int frag;
|
||||||
|
|
||||||
|
r_notexture_mip->render = &glsl_notexture;
|
||||||
|
|
||||||
vert_shader = GLSL_BuildShader (bsp_vert_effects);
|
vert_shader = GLSL_BuildShader (bsp_vert_effects);
|
||||||
frag_shader = GLSL_BuildShader (bsp_lit_effects);
|
frag_shader = GLSL_BuildShader (bsp_lit_effects);
|
||||||
vert = GLSL_CompileShader ("quakebsp.vert", vert_shader,
|
vert = GLSL_CompileShader ("quakebsp.vert", vert_shader,
|
||||||
|
|
|
@ -98,6 +98,8 @@ static float identity[] = {
|
||||||
0, 0, 0, 1,
|
0, 0, 0, 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static vulktex_t vulkan_notexture = { };
|
||||||
|
|
||||||
#define ALLOC_CHUNK 64
|
#define ALLOC_CHUNK 64
|
||||||
|
|
||||||
typedef struct bsppoly_s {
|
typedef struct bsppoly_s {
|
||||||
|
@ -1342,6 +1344,8 @@ Vulkan_Bsp_Init (vulkan_ctx_t *ctx)
|
||||||
{
|
{
|
||||||
qfv_device_t *device = ctx->device;
|
qfv_device_t *device = ctx->device;
|
||||||
|
|
||||||
|
r_notexture_mip->render = &vulkan_notexture;
|
||||||
|
|
||||||
qfvPushDebug (ctx, "bsp init");
|
qfvPushDebug (ctx, "bsp init");
|
||||||
|
|
||||||
bspctx_t *bctx = calloc (1, sizeof (bspctx_t));
|
bspctx_t *bctx = calloc (1, sizeof (bspctx_t));
|
||||||
|
|
Loading…
Reference in a new issue