Share SURF_* values between renders

Reuse DRAWSKY value in soft render instead unused
DRAWSKYBOX and SURF_FLOW.

Move mipadjust calculation to usage place in soft render.
This commit is contained in:
Denis Pauk 2022-12-13 23:32:31 +02:00
parent 55330be2ae
commit a234f687a4
4 changed files with 22 additions and 27 deletions

View File

@ -85,6 +85,21 @@ extern const byte* Mod_DecompressVis(const byte *in, int row);
/* Shared models struct */
enum {
SIDE_FRONT = 0,
SIDE_BACK = 1,
SIDE_ON = 2
};
// FIXME: differentiate from texinfo SURF_ flags
enum {
SURF_PLANEBACK = 0x02,
SURF_DRAWSKY = 0x04, // sky brush face
SURF_DRAWTURB = 0x10,
SURF_DRAWBACKGROUND = 0x40,
SURF_UNDERWATER = 0x80
};
typedef struct mvertex_s
{
vec3_t position;
@ -99,7 +114,6 @@ typedef struct medge_s
typedef struct mtexinfo_s
{
float vecs[2][4];
float mipadjust; /* FIXME: Used only by soft render */
int flags;
int numframes;
struct mtexinfo_s *next; /* animation chain */

View File

@ -41,10 +41,6 @@ BRUSH MODELS
//
// in memory representation
//
typedef struct
{
vec3_t position;
} mvertex_t;
#define SIDE_FRONT 0
@ -58,21 +54,6 @@ typedef struct
#define SURF_DRAWBACKGROUND 0x40
#define SURF_UNDERWATER 0x80
typedef struct
{
unsigned short v[2];
unsigned int cachededgeoffset;
} medge_t;
typedef struct mtexinfo_s
{
float vecs[2][4];
int flags;
int numframes;
struct mtexinfo_s *next; // animation chain
image_t *image;
} mtexinfo_t;
#define VERTEXSIZE 7
typedef struct vkpoly_s

View File

@ -31,7 +31,7 @@ Draw_InitLocal
*/
void Draw_InitLocal (void)
{
draw_chars = FindPic ("conchars", (findimage_t)Vk_FindImage);
draw_chars = R_FindPic ("conchars", (findimage_t)Vk_FindImage);
if (!draw_chars)
{
ri.Sys_Error(ERR_FATAL, "%s: Couldn't load pics/conchars.pcx",
@ -86,7 +86,7 @@ RE_Draw_FindPic
*/
image_t *RE_Draw_FindPic (char *name)
{
return FindPic(name, (findimage_t)Vk_FindImage);
return R_FindPic(name, (findimage_t)Vk_FindImage);
}
/*
@ -98,7 +98,7 @@ void RE_Draw_GetPicSize (int *w, int *h, char *name)
{
image_t *image;
image = FindPic(name, (findimage_t)Vk_FindImage);
image = R_FindPic(name, (findimage_t)Vk_FindImage);
if (!image)
{
*w = *h = -1;
@ -121,7 +121,7 @@ void RE_Draw_StretchPic (int x, int y, int w, int h, char *name)
if (!vk_frameStarted)
return;
vk = FindPic(name, (findimage_t)Vk_FindImage);
vk = R_FindPic(name, (findimage_t)Vk_FindImage);
if (!vk)
{
R_Printf(PRINT_ALL, "%s(): Can't find pic: %s\n", __func__, name);
@ -144,7 +144,7 @@ void RE_Draw_PicScaled (int x, int y, char *name, float scale)
{
image_t *vk;
vk = FindPic(name, (findimage_t)Vk_FindImage);
vk = R_FindPic(name, (findimage_t)Vk_FindImage);
if (!vk)
{
R_Printf(PRINT_ALL, "%s(): Can't find pic: %s\n", __func__, name);
@ -169,7 +169,7 @@ void RE_Draw_TileClear (int x, int y, int w, int h, char *name)
if (!vk_frameStarted)
return;
image = FindPic(name, (findimage_t)Vk_FindImage);
image = R_FindPic(name, (findimage_t)Vk_FindImage);
if (!image)
{
R_Printf(PRINT_ALL, "%s(): Can't find pic: %s\n", __func__, name);

View File

@ -1275,7 +1275,7 @@ Vk_FindImage (const char *name, imagetype_t type)
//
// load the pic from disk
//
image = (image_t *)LoadImage(name, namewe, ext, type,
image = (image_t *)R_LoadImage(name, namewe, ext, type,
r_retexturing->value, (loadimage_t)Vk_LoadPic);
if (!image && r_validation->value > 0)