mirror of
https://github.com/nzp-team/fteqw.git
synced 2024-11-22 20:11:44 +00:00
------------------------------------------------------------------------
r4183 | acceptthis | 2013-01-28 01:13:22 +0000 (Mon, 28 Jan 2013) | 8 lines visedicts limit tuned to be more aggressive/pre-emptive. binds now triggers the quit option's cfg_save prompt. quit console command now shows cfg_save prompt if a preset was applied. fix fatal menu-related crash at startup. add r_noframegrouplerp cvar to uglify flame/torch model animations. fix gl_texturemode(2d) affecting skins and lightmaps and stuff. Its all more explicit now. extend saved game string limits. extend default pr_maxedicts value. ------------------------------------------------------------------------ git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4181 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
parent
141b00a636
commit
02f7e7e9f2
25 changed files with 180 additions and 221 deletions
|
@ -4765,9 +4765,9 @@ Made up of: clients, packet_entities, nails, and tents
|
|||
*/
|
||||
void CL_ClearEntityLists(void)
|
||||
{
|
||||
if (cl_numvisedicts == cl_maxvisedicts)
|
||||
if (cl_numvisedicts+128 >= cl_maxvisedicts)
|
||||
{
|
||||
int newnum = cl_maxvisedicts + 32;
|
||||
int newnum = cl_maxvisedicts + 256;
|
||||
entity_t *n = BZ_Realloc(cl_visedicts, newnum * sizeof(*n));
|
||||
if (n)
|
||||
{
|
||||
|
|
|
@ -95,6 +95,7 @@ cvar_t localid = SCVAR("localid", "");
|
|||
|
||||
cvar_t r_drawflame = CVARD("r_drawflame", "1", "Set to -1 to disable ALL static entities. Set to 0 to disable only wall torches and standing flame. Set to 1 for everything drawn as normal.");
|
||||
|
||||
qboolean forcesaveprompt;
|
||||
static qboolean allowremotecmd = true;
|
||||
|
||||
extern int total_loading_size, current_loading_size, loading_stage;
|
||||
|
@ -242,6 +243,7 @@ cvar_t developer = SCVAR("developer","0");
|
|||
#endif
|
||||
|
||||
int fps_count;
|
||||
qboolean forcesaveprompt;
|
||||
|
||||
jmp_buf host_abort;
|
||||
|
||||
|
@ -307,6 +309,11 @@ CL_Quit_f
|
|||
*/
|
||||
void CL_Quit_f (void)
|
||||
{
|
||||
if (forcesaveprompt)
|
||||
{
|
||||
Cmd_ExecuteString("menu_quit", RESTRICT_LOCAL);
|
||||
return;
|
||||
}
|
||||
|
||||
TP_ExecTrigger("f_quit");
|
||||
Cbuf_Execute();
|
||||
|
@ -4042,6 +4049,7 @@ void Host_Init (quakeparms_t *parms)
|
|||
R_SetRenderer(NULL);//set the renderer stuff to unset...
|
||||
|
||||
host_initialized = true;
|
||||
forcesaveprompt = false;
|
||||
|
||||
Sys_SendKeyEvents();
|
||||
|
||||
|
|
|
@ -1100,95 +1100,65 @@ void Key_Console (unsigned int unicode, int key)
|
|||
return;
|
||||
}
|
||||
|
||||
key = unicode;
|
||||
if (!key)
|
||||
if (unicode < ' ')
|
||||
return;
|
||||
|
||||
if (com_parseutf8.ival >= 0) //don't do this for iso8859-1. the major user of that is hexen2 which doesn't have these chars.
|
||||
{
|
||||
unsigned char c1;
|
||||
unsigned char c2;
|
||||
unsigned char c3;
|
||||
|
||||
if (unicode > ((com_parseutf8.ival<0)?255:127))
|
||||
if (keydown[K_CTRL])
|
||||
{
|
||||
extern cvar_t com_parseutf8;
|
||||
if (com_parseutf8.ival>0)
|
||||
if (unicode >= '0' && unicode <= '9')
|
||||
unicode = unicode - '0' + 0xe012; // yellow number
|
||||
else switch (unicode)
|
||||
{
|
||||
if (unicode > 0xffff)
|
||||
{
|
||||
}
|
||||
else if (unicode > 0x7ff)
|
||||
{
|
||||
c1 = 0xe0 | ((unicode>>12)&0x0f);
|
||||
c2 = 0x80 | ((unicode>> 6)&0x3f);
|
||||
c3 = 0x80 | ((unicode>> 0)&0x3f);
|
||||
if (key_linepos < MAXCMDLINE-3)
|
||||
{
|
||||
memmove(key_lines[edit_line]+key_linepos+2, key_lines[edit_line]+key_linepos, strlen(key_lines[edit_line]+key_linepos)+1);
|
||||
key_lines[edit_line][key_linepos] = c1;
|
||||
key_linepos++;
|
||||
key_lines[edit_line][key_linepos] = c2;
|
||||
key_linepos++;
|
||||
key_lines[edit_line][key_linepos] = c3;
|
||||
key_linepos++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
c1 = 0xc0 | ((unicode>>6)&0x1f);
|
||||
c2 = 0x80 | ((unicode>>0)&0x3f);
|
||||
if (key_linepos < MAXCMDLINE-2)
|
||||
{
|
||||
memmove(key_lines[edit_line]+key_linepos+2, key_lines[edit_line]+key_linepos, strlen(key_lines[edit_line]+key_linepos)+1);
|
||||
key_lines[edit_line][key_linepos] = c1;
|
||||
key_linepos++;
|
||||
key_lines[edit_line][key_linepos] = c2;
|
||||
key_linepos++;
|
||||
}
|
||||
return;
|
||||
}
|
||||
case '[': unicode = 0xe010; break;
|
||||
case ']': unicode = 0xe011; break;
|
||||
case 'g': unicode = 0xe086; break;
|
||||
case 'r': unicode = 0xe087; break;
|
||||
case 'y': unicode = 0xe088; break;
|
||||
case 'b': unicode = 0xe089; break;
|
||||
case '(': unicode = 0xe080; break;
|
||||
case '=': unicode = 0xe081; break;
|
||||
case ')': unicode = 0xe082; break;
|
||||
case 'a': unicode = 0xe083; break;
|
||||
case '<': unicode = 0xe01d; break;
|
||||
case '-': unicode = 0xe01e; break;
|
||||
case '>': unicode = 0xe01f; break;
|
||||
case ',': unicode = 0xe01c; break;
|
||||
case '.': unicode = 0xe09c; break;
|
||||
case 'B': unicode = 0xe08b; break;
|
||||
case 'C': unicode = 0xe08d; break;
|
||||
case 'n': unicode = '\r'; break;
|
||||
}
|
||||
unicode = '?'; //sorry
|
||||
}
|
||||
|
||||
if (keydown[K_ALT] && unicode > 32 && unicode < 128)
|
||||
unicode |= 0xe080; // red char
|
||||
}
|
||||
|
||||
if (!com_parseutf8.ival)
|
||||
if (com_parseutf8.ival>0 && unicode > 127)
|
||||
{
|
||||
if (keydown[K_CTRL]) {
|
||||
if (key >= '0' && key <= '9')
|
||||
key = key - '0' + 0x12; // yellow number
|
||||
else switch (key) {
|
||||
case '[': key = 0x10; break;
|
||||
case ']': key = 0x11; break;
|
||||
case 'g': key = 0x86; break;
|
||||
case 'r': key = 0x87; break;
|
||||
case 'y': key = 0x88; break;
|
||||
case 'b': key = 0x89; break;
|
||||
case '(': key = 0x80; break;
|
||||
case '=': key = 0x81; break;
|
||||
case ')': key = 0x82; break;
|
||||
case 'a': key = 0x83; break;
|
||||
case '<': key = 0x1d; break;
|
||||
case '-': key = 0x1e; break;
|
||||
case '>': key = 0x1f; break;
|
||||
case ',': key = 0x1c; break;
|
||||
case '.': key = 0x9c; break;
|
||||
case 'B': key = 0x8b; break;
|
||||
case 'C': key = 0x8d; break;
|
||||
case 'n': key = '\r'; break;
|
||||
}
|
||||
char utf8[8];
|
||||
int l = utf8_encode(utf8, unicode, sizeof(utf8)-1);
|
||||
if (l)
|
||||
{
|
||||
utf8[l] = 0;
|
||||
Key_ConsoleInsert(utf8);
|
||||
return;
|
||||
}
|
||||
|
||||
if (keydown[K_ALT] && key > 32 && key < 128)
|
||||
key |= 128; // red char
|
||||
unicode = '?';
|
||||
}
|
||||
else if (unicode >= 0xe000 && unicode <= 0xe0ff && !com_parseutf8.ival)
|
||||
unicode -= 0xe000; //text line is quake-safe
|
||||
else if (unicode >= ((com_parseutf8.ival<0)?256:128))
|
||||
{
|
||||
unicode = '?'; //sorry, char cannot be expressed using this encoding.
|
||||
}
|
||||
|
||||
|
||||
if (strlen(key_lines[edit_line])+1 < MAXCMDLINE-1)
|
||||
{
|
||||
memmove(key_lines[edit_line]+key_linepos+1, key_lines[edit_line]+key_linepos, strlen(key_lines[edit_line]+key_linepos)+1);
|
||||
key_lines[edit_line][key_linepos] = key;
|
||||
key_lines[edit_line][key_linepos] = unicode;
|
||||
key_linepos++;
|
||||
}
|
||||
|
||||
|
@ -1372,9 +1342,12 @@ void Key_SetBinding (int keynum, int modifier, char *binding, int level)
|
|||
return;
|
||||
}
|
||||
|
||||
if (keynum == -1)
|
||||
if (keynum < 0 || keynum >= K_MAX)
|
||||
return;
|
||||
|
||||
//just so the quit menu realises it needs to show something.
|
||||
Cvar_ConfigChanged();
|
||||
|
||||
// free old bindings
|
||||
if (keybindings[keynum][modifier])
|
||||
{
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
#include "quakedef.h"
|
||||
#include "winquake.h"
|
||||
extern qboolean forcesaveprompt;
|
||||
|
||||
menu_t *M_Options_Title(int *y, int infosize)
|
||||
{
|
||||
|
@ -528,6 +529,7 @@ static void ApplyPreset (int presetnum)
|
|||
Cbuf_AddText("r_particledesc $r_particledesc h2part\n", RESTRICT_LOCAL);
|
||||
Cbuf_Execute();
|
||||
}
|
||||
forcesaveprompt = true;
|
||||
}
|
||||
|
||||
void M_Menu_Preset_f (void)
|
||||
|
@ -683,7 +685,7 @@ void M_Menu_Render_f (void)
|
|||
};
|
||||
|
||||
menu_t *menu;
|
||||
extern cvar_t r_novis, cl_item_bobbing, r_waterwarp, r_nolerp, r_fastsky, gl_nocolors, gl_lerpimages, r_wateralpha, r_drawviewmodel, gl_cshiftenabled;
|
||||
extern cvar_t r_novis, cl_item_bobbing, r_waterwarp, r_nolerp, r_noframegrouplerp, r_fastsky, gl_nocolors, gl_lerpimages, r_wateralpha, r_drawviewmodel, gl_cshiftenabled;
|
||||
#ifdef GLQUAKE
|
||||
extern cvar_t r_bloom;
|
||||
#endif
|
||||
|
@ -696,6 +698,7 @@ void M_Menu_Render_f (void)
|
|||
MB_CHECKBOXCVAR("Calculate VIS", r_novis, 0),
|
||||
MB_CHECKBOXCVAR("Fast Sky", r_fastsky, 0),
|
||||
MB_CHECKBOXCVAR("Disable Model Lerp", r_nolerp, 0),
|
||||
MB_CHECKBOXCVAR("Disable Framegroup Lerp", r_noframegrouplerp, 0),
|
||||
MB_CHECKBOXCVAR("Lerp Images", gl_lerpimages, 0),
|
||||
MB_COMBOCVAR("Water Warp", r_waterwarp, warpopts, warpvalues, NULL),
|
||||
MB_SLIDER("Water Alpha", r_wateralpha, 0, 1, 0.1, NULL),
|
||||
|
|
|
@ -192,8 +192,10 @@ typedef enum uploadfmt
|
|||
TF_BGRA32, /*bgra byte order*/
|
||||
TF_RGBX32, /*rgb byte order, with extra wasted byte after blue*/
|
||||
TF_BGRX32, /*rgb byte order, with extra wasted byte after blue*/
|
||||
TF_RGB24, /*bgr byte order, no alpha channel nor pad, and top down*/
|
||||
TF_RGB24, /*rgb byte order, no alpha channel nor pad, and regular top down*/
|
||||
TF_BGR24, /*bgr byte order, no alpha channel nor pad, and regular top down*/
|
||||
TF_BGR24_FLIP, /*bgr byte order, no alpha channel nor pad, and bottom up*/
|
||||
TF_LUM8, /*8bit greyscale image*/
|
||||
TF_SOLID8, /*8bit quake-palette image*/
|
||||
TF_TRANS8, /*8bit quake-palette image, index 255=transparent*/
|
||||
TF_TRANS8_FULLBRIGHT, /*fullbright 8 - fullbright texels have alpha 255, everything else 0*/
|
||||
|
|
|
@ -1613,7 +1613,8 @@ static struct {
|
|||
{"crypto_getmykeyfp", PF_crypto_getmykeyfp, 636},
|
||||
{"crypto_getmyidfp", PF_crypto_getmyidfp, 637},
|
||||
{"digest_hex", PF_digest_hex, 639},
|
||||
{"crypto_getmyidstatus", PF_crypto_getmyidfp, 641}
|
||||
{"crypto_getmyidstatus", PF_crypto_getmyidfp, 641},
|
||||
{NULL}
|
||||
};
|
||||
builtin_t menu_builtins[1024];
|
||||
|
||||
|
|
|
@ -174,9 +174,9 @@ void R2D_Init(void)
|
|||
"}\n"
|
||||
"}\n");
|
||||
if (!TEXVALID(draw_backtile->defaulttextures.base))
|
||||
draw_backtile->defaulttextures.base = R_LoadHiResTexture("gfx/backtile", NULL, IF_NOPICMIP|IF_NOMIPMAP);
|
||||
draw_backtile->defaulttextures.base = R_LoadHiResTexture("gfx/backtile", NULL, IF_2D|IF_NOPICMIP|IF_NOMIPMAP);
|
||||
if (!TEXVALID(draw_backtile->defaulttextures.base))
|
||||
draw_backtile->defaulttextures.base = R_LoadHiResTexture("gfx/menu/backtile", NULL, IF_NOPICMIP|IF_NOMIPMAP);
|
||||
draw_backtile->defaulttextures.base = R_LoadHiResTexture("gfx/menu/backtile", NULL, IF_2D|IF_NOPICMIP|IF_NOMIPMAP);
|
||||
|
||||
shader_draw_fill = R_RegisterShader("fill_opaque",
|
||||
"{\n"
|
||||
|
@ -471,7 +471,7 @@ void R2D_TransPicTranslate (int x, int y, int width, int height, qbyte *pic, qby
|
|||
translate_shader->defaulttextures.base = translate_texture;
|
||||
}
|
||||
/* could avoid reuploading already translated textures but this func really isn't used enough anyway */
|
||||
R_Upload(translate_texture, NULL, TF_RGBA32, trans, NULL, 64, 64, IF_NOMIPMAP|IF_NOGAMMA);
|
||||
R_Upload(translate_texture, NULL, TF_RGBA32, trans, NULL, 64, 64, IF_2D|IF_NOMIPMAP|IF_NOGAMMA);
|
||||
R2D_ScalePic(x, y, width, height, translate_shader);
|
||||
}
|
||||
|
||||
|
@ -1046,7 +1046,7 @@ void R2D_Crosshair_Update(void)
|
|||
return;
|
||||
else if (crosshairimage.string[0] && c == 1)
|
||||
{
|
||||
shader_crosshair->defaulttextures.base = R_LoadHiResTexture (crosshairimage.string, "crosshairs", IF_NOMIPMAP|IF_NOGAMMA);
|
||||
shader_crosshair->defaulttextures.base = R_LoadHiResTexture (crosshairimage.string, "crosshairs", IF_2D|IF_NOMIPMAP|IF_NOGAMMA);
|
||||
if (TEXVALID(shader_crosshair->defaulttextures.base))
|
||||
return;
|
||||
}
|
||||
|
@ -1057,7 +1057,7 @@ void R2D_Crosshair_Update(void)
|
|||
c = c % (sizeof(crosshair_pixels) / (CS_HEIGHT*sizeof(*crosshair_pixels)));
|
||||
|
||||
if (!TEXVALID(ch_int_texture))
|
||||
ch_int_texture = R_AllocNewTexture("***crosshair***", CS_WIDTH, CS_HEIGHT, 0);
|
||||
ch_int_texture = R_AllocNewTexture("***crosshair***", CS_WIDTH, CS_HEIGHT, IF_2D|IF_NOMIPMAP);
|
||||
shader_crosshair->defaulttextures.base = ch_int_texture;
|
||||
|
||||
Q_memset(crossdata, 0, sizeof(crossdata));
|
||||
|
@ -1074,7 +1074,7 @@ void R2D_Crosshair_Update(void)
|
|||
}
|
||||
}
|
||||
|
||||
R_Upload(ch_int_texture, NULL, TF_RGBA32, crossdata, NULL, CS_WIDTH, CS_HEIGHT, IF_NOMIPMAP|IF_NOGAMMA);
|
||||
R_Upload(ch_int_texture, NULL, TF_RGBA32, crossdata, NULL, CS_WIDTH, CS_HEIGHT, IF_2D|IF_NOMIPMAP|IF_NOGAMMA);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -268,6 +268,8 @@ enum imageflags
|
|||
/*warning: many of these flags only apply the first time it is requested*/
|
||||
IF_CLAMP = 1<<0,
|
||||
IF_NEAREST = 1<<1,
|
||||
IF_2D = 1<<10, //subject to texturemode2d
|
||||
IF_LINEAR = 1<<11,
|
||||
IF_NOPICMIP = 1<<2,
|
||||
IF_NOMIPMAP = 1<<3,
|
||||
IF_NOALPHA = 1<<4,
|
||||
|
|
|
@ -117,6 +117,7 @@ cvar_t r_menutint = SCVARF ("r_menutint", "0.68 0.4 0.13",
|
|||
CVAR_RENDERERCALLBACK);
|
||||
cvar_t r_netgraph = SCVAR ("r_netgraph", "0");
|
||||
cvar_t r_nolerp = CVARF ("r_nolerp", "0", CVAR_ARCHIVE);
|
||||
cvar_t r_noframegrouplerp = CVARF ("r_noframegrouplerp", "0", CVAR_ARCHIVE);
|
||||
cvar_t r_nolightdir = CVARF ("r_nolightdir", "0", CVAR_ARCHIVE);
|
||||
cvar_t r_novis = CVARF ("r_novis", "0", CVAR_ARCHIVE);
|
||||
cvar_t r_part_rain = CVARFD ("r_part_rain", "0",
|
||||
|
@ -415,6 +416,7 @@ void GLRenderer_Init(void)
|
|||
Cvar_Register (&r_postprocshader, GLRENDEREROPTIONS);
|
||||
|
||||
Cvar_Register (&dpcompat_psa_ungroup, GLRENDEREROPTIONS);
|
||||
Cvar_Register (&r_noframegrouplerp, GLRENDEREROPTIONS);
|
||||
Cvar_Register (&r_noportals, GLRENDEREROPTIONS);
|
||||
Cvar_Register (&r_noaliasshadows, GLRENDEREROPTIONS);
|
||||
Cvar_Register (&gl_maxshadowlights, GLRENDEREROPTIONS);
|
||||
|
|
|
@ -1020,7 +1020,6 @@ void VARGS Sys_Printf (char *fmt, ...)
|
|||
vsnprintf (text, sizeof(text), fmt, argptr);
|
||||
va_end (argptr);
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (debugout)
|
||||
{
|
||||
//msvc debug output
|
||||
|
@ -1037,7 +1036,6 @@ void VARGS Sys_Printf (char *fmt, ...)
|
|||
*out = 0;
|
||||
OutputDebugStringW(wide);
|
||||
}
|
||||
#endif
|
||||
if (houtput)
|
||||
WriteFile (houtput, text, strlen(text), &dummy, NULL);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ extern model_t *loadmodel;
|
|||
extern char loadname[];
|
||||
qboolean r_loadbumpmapping;
|
||||
extern cvar_t dpcompat_psa_ungroup;
|
||||
extern cvar_t r_noframegrouplerp;
|
||||
|
||||
//Common loader function.
|
||||
void Mod_DoCRC(model_t *mod, char *buffer, int buffersize)
|
||||
|
@ -744,7 +745,7 @@ static int Alias_BuildLerps(float plerp[4], float *pose[4], int numbones, galias
|
|||
frame2=(frame2>g1->numposes-1)?g1->numposes-1:frame2;
|
||||
}
|
||||
|
||||
if (frame1 == frame2)
|
||||
if (frame1 == frame2 || r_noframegrouplerp.ival)
|
||||
mlerp = 0;
|
||||
plerp[l] = (1-mlerp)*(1-lerpfrac);
|
||||
if (plerp[l]>0)
|
||||
|
@ -771,7 +772,7 @@ static int Alias_BuildLerps(float plerp[4], float *pose[4], int numbones, galias
|
|||
frame1=(frame1>g2->numposes-1)?g2->numposes-1:frame1;
|
||||
frame2=(frame2>g2->numposes-1)?g2->numposes-1:frame2;
|
||||
}
|
||||
if (frame1 == frame2)
|
||||
if (frame1 == frame2 || r_noframegrouplerp.ival)
|
||||
mlerp = 0;
|
||||
plerp[l] = (1-mlerp)*(lerpfrac);
|
||||
if (plerp[l]>0)
|
||||
|
@ -1630,6 +1631,8 @@ qboolean Alias_GAliasBuildMesh(mesh_t *mesh, galiasinfo_t *inf, int surfnum, ent
|
|||
frame1=lerp;
|
||||
frame2=frame1+1;
|
||||
lerp-=frame1;
|
||||
if (r_noframegrouplerp.ival)
|
||||
lerp = 0;
|
||||
if (g1->loop)
|
||||
{
|
||||
frame1=frame1%g1->numposes;
|
||||
|
|
|
@ -595,6 +595,10 @@ qboolean Cvar_UnsavedArchive(void)
|
|||
{
|
||||
return cvar_archivedvaluechanged;
|
||||
}
|
||||
void Cvar_ConfigChanged(void)
|
||||
{
|
||||
cvar_archivedvaluechanged = true;
|
||||
}
|
||||
void Cvar_Saved(void)
|
||||
{
|
||||
cvar_archivedvaluechanged = false;
|
||||
|
@ -723,7 +727,7 @@ cvar_t *Cvar_SetCore (cvar_t *var, const char *value, qboolean force)
|
|||
var->callback(var, latch);
|
||||
|
||||
if ((var->flags & CVAR_ARCHIVE) && !(var->flags & CVAR_SERVEROVERRIDE) && cl_warncmd.ival)
|
||||
cvar_archivedvaluechanged = true;
|
||||
Cvar_ConfigChanged();
|
||||
}
|
||||
|
||||
Z_Free (latch); // free the old value string
|
||||
|
|
|
@ -161,6 +161,7 @@ qboolean Cvar_ApplyLatchFlag(cvar_t *var, char *value, int flag);
|
|||
|
||||
qboolean Cvar_UnsavedArchive(void);
|
||||
void Cvar_Saved(void);
|
||||
void Cvar_ConfigChanged(void);
|
||||
|
||||
int Cvar_ApplyLatches(int latchflag);
|
||||
//sets vars to their latched values
|
||||
|
|
|
@ -1719,6 +1719,7 @@
|
|||
AdditionalLibraryDirectories="../libs/dxsdk7/lib"
|
||||
GenerateManifest="false"
|
||||
IgnoreDefaultLibraryNames="libc.lib;msvcrt.lib"
|
||||
GenerateMapFile="true"
|
||||
SubSystem="2"
|
||||
LargeAddressAware="2"
|
||||
OptimizeReferences="2"
|
||||
|
|
|
@ -532,15 +532,7 @@ static shader_t *GL_ChooseSkin(galiasinfo_t *inf, model_t *model, int surfnum, e
|
|||
frac += fracstep;
|
||||
}
|
||||
}
|
||||
if (qrenderer == QR_OPENGL)
|
||||
{
|
||||
cm->texnum.base = R_AllocNewTexture(cm->name, scaled_width, scaled_height, IF_NOMIPMAP);
|
||||
R_Upload(cm->texnum.base, cm->name, h2playertranslations?TF_RGBA32:TF_RGBX32, pixels, NULL, scaled_width, scaled_height, IF_NOMIPMAP);
|
||||
}
|
||||
else
|
||||
{
|
||||
cm->texnum.base = R_LoadTexture(cm->name, scaled_width, scaled_height, h2playertranslations?TF_RGBA32:TF_RGBX32, pixels, 0);
|
||||
}
|
||||
cm->texnum.base = R_LoadTexture(cm->name, scaled_width, scaled_height, h2playertranslations?TF_RGBA32:TF_RGBX32, pixels, IF_NOMIPMAP);
|
||||
|
||||
if (!h2playertranslations)
|
||||
{
|
||||
|
@ -558,15 +550,7 @@ static shader_t *GL_ChooseSkin(galiasinfo_t *inf, model_t *model, int surfnum, e
|
|||
frac += fracstep;
|
||||
}
|
||||
}
|
||||
if (qrenderer == QR_OPENGL)
|
||||
{
|
||||
cm->texnum.fullbright = R_AllocNewTexture(cm->name, scaled_width, scaled_height, IF_NOMIPMAP);
|
||||
R_Upload(cm->texnum.fullbright, cm->name, TF_RGBA32, pixels, NULL, scaled_width, scaled_height, IF_NOMIPMAP);
|
||||
}
|
||||
else
|
||||
{
|
||||
cm->texnum.fullbright = R_LoadTexture(cm->name, scaled_width, scaled_height, h2playertranslations?TF_RGBA32:TF_RGBX32, pixels, 0);
|
||||
}
|
||||
cm->texnum.fullbright = R_LoadTexture(cm->name, scaled_width, scaled_height, h2playertranslations?TF_RGBA32:TF_RGBX32, pixels, IF_NOMIPMAP);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -4031,7 +4031,7 @@ static void BE_UpdateLightmaps(void)
|
|||
lm->modified = false;
|
||||
if (!TEXVALID(lm->lightmap_texture))
|
||||
{
|
||||
TEXASSIGN(lm->lightmap_texture, R_AllocNewTexture("***lightmap***", lm->width, lm->height, 0));
|
||||
TEXASSIGN(lm->lightmap_texture, R_AllocNewTexture("***lightmap***", lm->width, lm->height, IF_LINEAR|IF_NOMIPMAP));
|
||||
GL_MTBind(0, GL_TEXTURE_2D, lm->lightmap_texture);
|
||||
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
|
|
|
@ -176,7 +176,7 @@ typedef struct gltexture_s
|
|||
|
||||
static gltexture_t *gltextures;
|
||||
|
||||
static gltexture_t *GL_AllocNewGLTexture(char *ident, int w, int h)
|
||||
static gltexture_t *GL_AllocNewGLTexture(char *ident, int w, int h, unsigned int flags)
|
||||
{
|
||||
gltexture_t *glt;
|
||||
glt = BZ_Malloc(sizeof(*glt) + sizeof(bucket_t));
|
||||
|
@ -185,7 +185,7 @@ static gltexture_t *GL_AllocNewGLTexture(char *ident, int w, int h)
|
|||
|
||||
glt->texnum.ref = &glt->com;
|
||||
Q_strncpyz (glt->identifier, ident, sizeof(glt->identifier));
|
||||
glt->flags = IF_NOMIPMAP;
|
||||
glt->flags = flags;
|
||||
glt->width = w;
|
||||
glt->height = h;
|
||||
glt->bpp = 0;
|
||||
|
@ -200,7 +200,7 @@ static gltexture_t *GL_AllocNewGLTexture(char *ident, int w, int h)
|
|||
|
||||
texid_t GL_AllocNewTexture(char *name, int w, int h, unsigned int flags)
|
||||
{
|
||||
gltexture_t *glt = GL_AllocNewGLTexture(name, w, h);
|
||||
gltexture_t *glt = GL_AllocNewGLTexture(name, w, h, flags);
|
||||
return glt->texnum;
|
||||
}
|
||||
|
||||
|
@ -289,6 +289,36 @@ void GL_Mipcap_Callback (struct cvar_s *var, char *oldvalue)
|
|||
}
|
||||
}
|
||||
}
|
||||
void GL_Texturemode_Apply(GLenum targ, unsigned int flags)
|
||||
{
|
||||
int mag;
|
||||
if (flags & IF_2D)
|
||||
{
|
||||
qglTexParameteri(targ, GL_TEXTURE_MIN_FILTER, gl_filter_max_2d);
|
||||
if (flags & IF_NEAREST)
|
||||
qglTexParameteri(targ, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
else if (flags & IF_LINEAR)
|
||||
qglTexParameteri(targ, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
|
||||
else
|
||||
qglTexParameteri(targ, GL_TEXTURE_MAG_FILTER, gl_filter_max_2d);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (flags & IF_NEAREST)
|
||||
mag = GL_NEAREST;
|
||||
else if (flags & IF_LINEAR)
|
||||
mag = GL_LINEAR;
|
||||
else
|
||||
mag = gl_filter_max;
|
||||
|
||||
if (flags & IF_NOMIPMAP)
|
||||
qglTexParameteri(targ, GL_TEXTURE_MIN_FILTER, mag);
|
||||
else
|
||||
qglTexParameteri(targ, GL_TEXTURE_MIN_FILTER, gl_filter_min);
|
||||
qglTexParameteri(targ, GL_TEXTURE_MAG_FILTER, mag);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
===============
|
||||
Draw_TextureMode_f
|
||||
|
@ -322,7 +352,7 @@ void GL_Texturemode_Callback (struct cvar_s *var, char *oldvalue)
|
|||
// change all the existing mipmap texture objects
|
||||
for (glt=gltextures ; glt ; glt=glt->next)
|
||||
{
|
||||
if (!(glt->flags & IF_NOMIPMAP))
|
||||
if (!(glt->flags & IF_2D))
|
||||
{
|
||||
if (glt->flags & IF_CUBEMAP)
|
||||
targ = GL_TEXTURE_CUBE_MAP_ARB;
|
||||
|
@ -330,11 +360,7 @@ void GL_Texturemode_Callback (struct cvar_s *var, char *oldvalue)
|
|||
targ = GL_TEXTURE_2D;
|
||||
|
||||
GL_MTBind(0, targ, glt->texnum);
|
||||
qglTexParameteri(targ, GL_TEXTURE_MIN_FILTER, gl_filter_min);
|
||||
if (glt->flags & IF_NEAREST)
|
||||
qglTexParameteri(targ, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
else
|
||||
qglTexParameteri(targ, GL_TEXTURE_MAG_FILTER, gl_filter_max);
|
||||
GL_Texturemode_Apply(targ, glt->flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -365,14 +391,10 @@ void GL_Texturemode2d_Callback (struct cvar_s *var, char *oldvalue)
|
|||
// change all the existing mipmap texture objects
|
||||
for (glt=gltextures ; glt ; glt=glt->next)
|
||||
{
|
||||
if (glt->flags & IF_NOMIPMAP)
|
||||
if (glt->flags & IF_2D)
|
||||
{
|
||||
GL_MTBind(0, GL_TEXTURE_2D, glt->texnum);
|
||||
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_max_2d);
|
||||
if (glt->flags & IF_NEAREST)
|
||||
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
else
|
||||
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max_2d);
|
||||
GL_Texturemode_Apply(GL_TEXTURE_2D, glt->flags);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1012,22 +1034,7 @@ qboolean GL_UploadCompressed (qbyte *file, int *out_width, int *out_height, unsi
|
|||
file += compressed_size;
|
||||
}
|
||||
|
||||
if (!((*out_flags) & IF_NOMIPMAP))
|
||||
{
|
||||
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_min);
|
||||
if (*out_flags & IF_NEAREST)
|
||||
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
else
|
||||
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max);
|
||||
}
|
||||
else
|
||||
{
|
||||
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_max_2d);
|
||||
if (*out_flags & IF_NEAREST)
|
||||
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
else
|
||||
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max_2d);
|
||||
}
|
||||
GL_Texturemode_Apply(GL_TEXTURE_2D, *out_flags);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1246,22 +1253,7 @@ void GL_Upload32_Int (char *name, unsigned *data, int width, int height, unsigne
|
|||
qglTexParameteri(targ, GL_GENERATE_MIPMAP_SGIS, GL_TRUE);
|
||||
}
|
||||
|
||||
if (!(flags&IF_NOMIPMAP))
|
||||
{
|
||||
qglTexParameteri(targ, GL_TEXTURE_MIN_FILTER, gl_filter_min);
|
||||
if (flags & IF_NEAREST)
|
||||
qglTexParameteri(targ, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
else
|
||||
qglTexParameteri(targ, GL_TEXTURE_MAG_FILTER, gl_filter_max);
|
||||
}
|
||||
else
|
||||
{
|
||||
qglTexParameteri(targ, GL_TEXTURE_MIN_FILTER, gl_filter_max_2d);
|
||||
if (flags & IF_NEAREST)
|
||||
qglTexParameteri(targ, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
else
|
||||
qglTexParameteri(targ, GL_TEXTURE_MAG_FILTER, gl_filter_max_2d);
|
||||
}
|
||||
GL_Texturemode_Apply(targ, flags);
|
||||
|
||||
if (scaled_width == width && scaled_height == height)
|
||||
{
|
||||
|
@ -1572,22 +1564,7 @@ void GL_Upload8Grey (unsigned char*data, int width, int height, unsigned int fla
|
|||
}
|
||||
done: ;
|
||||
|
||||
if (!(flags&IF_NOMIPMAP))
|
||||
{
|
||||
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_min);
|
||||
if (flags & IF_NEAREST)
|
||||
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
else
|
||||
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max);
|
||||
}
|
||||
else
|
||||
{
|
||||
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_max_2d);
|
||||
if (flags & IF_NEAREST)
|
||||
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
|
||||
else
|
||||
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max_2d);
|
||||
}
|
||||
GL_Texturemode_Apply(GL_TEXTURE_2D, flags);
|
||||
}
|
||||
|
||||
|
||||
|
@ -1712,7 +1689,7 @@ unsigned int * genNormalMap(qbyte *pixels, int w, int h, float scale)
|
|||
}
|
||||
|
||||
//PENTA
|
||||
void GL_UploadBump(qbyte *data, int width, int height, qboolean mipmap, float bumpscale)
|
||||
void GL_UploadBump(qbyte *data, int width, int height, unsigned int mipmap, float bumpscale)
|
||||
{
|
||||
unsigned char *scaled = uploadmemorybuffer;
|
||||
int scaled_width, scaled_height;
|
||||
|
@ -2148,7 +2125,7 @@ texid_t GL_LoadTexture (char *identifier, int width, int height, qbyte *data, un
|
|||
return glt->texnum;
|
||||
}
|
||||
if (!glt)
|
||||
glt = GL_AllocNewGLTexture(identifier, width, height);
|
||||
glt = GL_AllocNewGLTexture(identifier, width, height, flags);
|
||||
|
||||
TRACE(("dbg: GL_LoadTexture: new %s\n", identifier));
|
||||
|
||||
|
@ -2181,7 +2158,7 @@ texid_t GL_LoadTextureFB (char *identifier, int width, int height, qbyte *data,
|
|||
if (i == width*height)
|
||||
return r_nulltex; //none found, don't bother uploading.
|
||||
|
||||
glt = GL_AllocNewGLTexture(identifier, width, height);
|
||||
glt = GL_AllocNewGLTexture(identifier, width, height, flags);
|
||||
glt->bpp = 8;
|
||||
glt->flags = flags;
|
||||
|
||||
|
@ -2204,7 +2181,7 @@ texid_t GL_LoadTexture8Pal24 (char *identifier, int width, int height, qbyte *da
|
|||
return glt->texnum;
|
||||
}
|
||||
|
||||
glt = GL_AllocNewGLTexture(identifier, width, height);
|
||||
glt = GL_AllocNewGLTexture(identifier, width, height, flags);
|
||||
glt->bpp = 24;
|
||||
glt->flags = flags;
|
||||
|
||||
|
@ -2226,7 +2203,7 @@ texid_t GL_LoadTexture8Pal32 (char *identifier, int width, int height, qbyte *da
|
|||
return glt->texnum;
|
||||
}
|
||||
|
||||
glt = GL_AllocNewGLTexture(identifier, width, height);
|
||||
glt = GL_AllocNewGLTexture(identifier, width, height, flags);
|
||||
glt->bpp = 32;
|
||||
glt->flags = flags;
|
||||
|
||||
|
@ -2251,7 +2228,7 @@ texid_t GL_LoadTexture32 (char *identifier, int width, int height, void *data, u
|
|||
return glt->texnum;
|
||||
}
|
||||
if (!glt)
|
||||
glt = GL_AllocNewGLTexture(identifier, width, height);
|
||||
glt = GL_AllocNewGLTexture(identifier, width, height, flags);
|
||||
glt->bpp = 32;
|
||||
glt->flags = flags;
|
||||
|
||||
|
@ -2287,7 +2264,7 @@ texid_t GL_LoadTexture32_BGRA (char *identifier, int width, int height, unsigned
|
|||
return glt->texnum;
|
||||
}
|
||||
|
||||
glt = GL_AllocNewGLTexture(identifier, width, height);
|
||||
glt = GL_AllocNewGLTexture(identifier, width, height, flags);
|
||||
glt->bpp = 32;
|
||||
glt->flags = flags;
|
||||
|
||||
|
@ -2324,7 +2301,7 @@ texid_t GL_LoadCompressed(char *name)
|
|||
if (!file)
|
||||
return r_nulltex;
|
||||
|
||||
glt = GL_AllocNewGLTexture(name, 0, 0);
|
||||
glt = GL_AllocNewGLTexture(name, 0, 0, 0);
|
||||
glt->bpp = 32;
|
||||
glt->flags = 0;
|
||||
|
||||
|
@ -2352,7 +2329,7 @@ texid_t GL_LoadTexture8Grey (char *identifier, int width, int height, unsigned c
|
|||
|
||||
flags |= IF_NOALPHA;
|
||||
|
||||
glt = GL_AllocNewGLTexture(identifier, width, height);
|
||||
glt = GL_AllocNewGLTexture(identifier, width, height, flags);
|
||||
glt->bpp = 8;
|
||||
glt->flags = flags;
|
||||
|
||||
|
@ -2382,7 +2359,7 @@ texid_t GL_LoadTexture8Bump (char *identifier, int width, int height, unsigned c
|
|||
|
||||
TRACE(("dbg: GL_LoadTexture8Bump: new %s\n", identifier));
|
||||
|
||||
glt = GL_AllocNewGLTexture(identifier, width, height);
|
||||
glt = GL_AllocNewGLTexture(identifier, width, height, flags);
|
||||
glt->bpp = 8;
|
||||
glt->flags = flags;
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ static const char *imgs[] =
|
|||
};
|
||||
|
||||
#define FONTCHARS (1<<16)
|
||||
#define FONTPLANES (1<<2) //no more than 16 textures per font
|
||||
#define FONTPLANES 1//(1<<2) //this is total, not per font.
|
||||
#define PLANEIDXTYPE unsigned short
|
||||
#define CHARIDXTYPE unsigned short
|
||||
|
||||
|
@ -256,7 +256,7 @@ void Font_Init(void)
|
|||
|
||||
for (i = 0; i < FONTPLANES; i++)
|
||||
{
|
||||
TEXASSIGN(fontplanes.texnum[i], R_AllocNewTexture("***fontplane***", PLANEWIDTH, PLANEHEIGHT, IF_NOMIPMAP));
|
||||
TEXASSIGN(fontplanes.texnum[i], R_AllocNewTexture("***fontplane***", PLANEWIDTH, PLANEHEIGHT, IF_2D|IF_NEAREST|IF_NOPICMIP|IF_NOMIPMAP|IF_NOGAMMA));
|
||||
}
|
||||
|
||||
fontplanes.shader = R_RegisterShader("ftefont",
|
||||
|
@ -297,7 +297,7 @@ static void Font_Flush(void)
|
|||
return;
|
||||
if (fontplanes.planechanged)
|
||||
{
|
||||
R_Upload(fontplanes.texnum[fontplanes.activeplane], NULL, TF_RGBA32, (void*)fontplanes.plane, NULL, PLANEWIDTH, PLANEHEIGHT, IF_NEAREST|IF_NOPICMIP|IF_NOMIPMAP|IF_NOGAMMA);
|
||||
R_Upload(fontplanes.texnum[fontplanes.activeplane], NULL, TF_RGBA32, (void*)fontplanes.plane, NULL, PLANEWIDTH, PLANEHEIGHT, IF_2D|IF_NEAREST|IF_NOPICMIP|IF_NOMIPMAP|IF_NOGAMMA);
|
||||
|
||||
fontplanes.planechanged = false;
|
||||
}
|
||||
|
@ -366,13 +366,15 @@ void Font_FlushPlane(font_t *f)
|
|||
fontplanes.planerowh = 0;
|
||||
fontplanes.planerowx = 0;
|
||||
fontplanes.planerowy = 0;
|
||||
for (; fontplanes.oldestchar; fontplanes.oldestchar = fontplanes.oldestchar->nextchar)
|
||||
|
||||
while (fontplanes.oldestchar)
|
||||
{
|
||||
if (fontplanes.oldestchar->texplane != fontplanes.activeplane)
|
||||
break;
|
||||
|
||||
//invalidate it
|
||||
//remove it from the list of active chars, and invalidate it
|
||||
fontplanes.oldestchar->texplane = INVALIDPLANE;
|
||||
fontplanes.oldestchar = fontplanes.oldestchar->nextchar;
|
||||
}
|
||||
if (!fontplanes.oldestchar)
|
||||
fontplanes.newestchar = NULL;
|
||||
|
@ -720,15 +722,15 @@ static texid_t Font_LoadReplacementConchars(void)
|
|||
{
|
||||
texid_t tex;
|
||||
//q1 replacement
|
||||
tex = R_LoadReplacementTexture("gfx/conchars.lmp", NULL, IF_NOMIPMAP|IF_NOGAMMA);
|
||||
tex = R_LoadReplacementTexture("gfx/conchars.lmp", NULL, IF_2D|IF_NOMIPMAP|IF_NOGAMMA);
|
||||
if (TEXVALID(tex))
|
||||
return tex;
|
||||
//q2
|
||||
tex = R_LoadHiResTexture("pics/conchars.pcx", NULL, IF_NOMIPMAP|IF_NOGAMMA);
|
||||
tex = R_LoadHiResTexture("pics/conchars.pcx", NULL, IF_2D|IF_NOMIPMAP|IF_NOGAMMA);
|
||||
if (TEXVALID(tex))
|
||||
return tex;
|
||||
//q3
|
||||
tex = R_LoadHiResTexture("gfx/2d/bigchars.tga", NULL, IF_NOMIPMAP|IF_NOGAMMA);
|
||||
tex = R_LoadHiResTexture("gfx/2d/bigchars.tga", NULL, IF_2D|IF_NOMIPMAP|IF_NOGAMMA);
|
||||
if (TEXVALID(tex))
|
||||
return tex;
|
||||
return r_nulltex;
|
||||
|
@ -751,7 +753,7 @@ static texid_t Font_LoadQuakeConchars(void)
|
|||
if (lump[i] == 0)
|
||||
lump[i] = 255; // proper transparent color
|
||||
|
||||
return R_LoadTexture8("charset", 128, 128, (void*)lump, IF_NOMIPMAP|IF_NOGAMMA, 1);
|
||||
return R_LoadTexture8("charset", 128, 128, (void*)lump, IF_2D|IF_NOMIPMAP|IF_NOGAMMA, 1);
|
||||
}
|
||||
return r_nulltex;
|
||||
}
|
||||
|
@ -837,7 +839,7 @@ static texid_t Font_LoadHexen2Conchars(qboolean iso88591)
|
|||
for (i=0 ; i<128*128 ; i++)
|
||||
if (outbuf[i] == 0)
|
||||
outbuf[i] = 255; // proper transparent color
|
||||
tex = R_LoadTexture8 (iso88591?"gfx/menu/8859-1.lmp":"charset", 128, 128, outbuf, IF_NOMIPMAP|IF_NOGAMMA, 1);
|
||||
tex = R_LoadTexture8 (iso88591?"gfx/menu/8859-1.lmp":"charset", 128, 128, outbuf, IF_2D|IF_NOMIPMAP|IF_NOGAMMA, 1);
|
||||
Z_Free(outbuf);
|
||||
return tex;
|
||||
}
|
||||
|
@ -863,7 +865,7 @@ static texid_t Font_LoadFallbackConchars(void)
|
|||
lump[i*4+1] = 255;
|
||||
lump[i*4+2] = 255;
|
||||
}
|
||||
tex = R_LoadTexture32("charset", width, height, (void*)lump, IF_NOMIPMAP|IF_NOGAMMA);
|
||||
tex = R_LoadTexture32("charset", width, height, (void*)lump, IF_2D|IF_NOMIPMAP|IF_NOGAMMA);
|
||||
BZ_Free(lump);
|
||||
return tex;
|
||||
}
|
||||
|
@ -1019,7 +1021,7 @@ struct font_s *Font_LoadFont(int vheight, char *fontfilename)
|
|||
for (x = 0; x < 128; x++)
|
||||
img[x + y*PLANEWIDTH] = w[x + y*128]?d_8to24rgbtable[w[x + y*128]]:0;
|
||||
|
||||
f->singletexture = R_LoadTexture(fontfilename,PLANEWIDTH,PLANEWIDTH,TF_RGBA32,img,IF_NOPICMIP|IF_NOMIPMAP);
|
||||
f->singletexture = R_LoadTexture(fontfilename,PLANEWIDTH,PLANEWIDTH,TF_RGBA32,img,IF_2D|IF_NOPICMIP|IF_NOMIPMAP);
|
||||
Z_Free(img);
|
||||
|
||||
for (i = 0x00; i <= 0xff; i++)
|
||||
|
@ -1070,7 +1072,7 @@ struct font_s *Font_LoadFont(int vheight, char *fontfilename)
|
|||
if (!Font_LoadFreeTypeFont(f, height, fontfilename))
|
||||
{
|
||||
if (*fontfilename)
|
||||
f->singletexture = R_LoadHiResTexture(fontfilename, "fonts", IF_NOMIPMAP);
|
||||
f->singletexture = R_LoadHiResTexture(fontfilename, "fonts", IF_2D|IF_NOMIPMAP);
|
||||
|
||||
/*force it to load, even if there's nothing there*/
|
||||
for (; i < 256; i++)
|
||||
|
@ -1130,7 +1132,7 @@ struct font_s *Font_LoadFont(int vheight, char *fontfilename)
|
|||
//removes a font from memory.
|
||||
void Font_Free(struct font_s *f)
|
||||
{
|
||||
struct charcache_s **link;
|
||||
struct charcache_s **link, *c;
|
||||
|
||||
//kill the alt font first.
|
||||
if (f->alt)
|
||||
|
@ -1141,14 +1143,16 @@ void Font_Free(struct font_s *f)
|
|||
//walk all chars, unlinking any that appear to be within this font's char cache
|
||||
for (link = &fontplanes.oldestchar; *link; )
|
||||
{
|
||||
if (*link >= f->chars && *link <= f->chars + FONTCHARS)
|
||||
c = *link;
|
||||
if (c >= f->chars && c <= f->chars + FONTCHARS)
|
||||
{
|
||||
*link = (*link)->nextchar;
|
||||
if (!*link)
|
||||
c = c->nextchar;
|
||||
if (!c)
|
||||
fontplanes.newestchar = NULL;
|
||||
*link = c;
|
||||
}
|
||||
else
|
||||
link = &(*link)->nextchar;
|
||||
link = &c->nextchar;
|
||||
}
|
||||
|
||||
#ifdef AVAIL_FREETYPE
|
||||
|
|
|
@ -122,7 +122,7 @@ void R_NetGraph (void)
|
|||
Draw_FunString(8, y, st);
|
||||
y += 8;
|
||||
|
||||
R_Upload(netgraphtexture, "***netgraph***", TF_RGBA32, ngraph_pixels, NULL, NET_TIMINGS, NET_GRAPHHEIGHT, IF_NOMIPMAP|IF_NOPICMIP);
|
||||
R_Upload(netgraphtexture, "***netgraph***", TF_RGBA32, ngraph_pixels, NULL, NET_TIMINGS, NET_GRAPHHEIGHT, IF_2D|IF_NOMIPMAP|IF_NOPICMIP);
|
||||
x=8;
|
||||
R2D_Image(x, y, NET_TIMINGS, NET_GRAPHHEIGHT, 0, 0, 1, 1, netgraphshader);
|
||||
}
|
||||
|
@ -163,14 +163,14 @@ void R_FrameTimeGraph (int frametime)
|
|||
Draw_FunString(8, y, st);
|
||||
y += 8;
|
||||
|
||||
R_Upload(netgraphtexture, "***netgraph***", TF_RGBA32, ngraph_pixels, NULL, NET_TIMINGS, NET_GRAPHHEIGHT, IF_NOMIPMAP|IF_NOPICMIP);
|
||||
R_Upload(netgraphtexture, "***netgraph***", TF_RGBA32, ngraph_pixels, NULL, NET_TIMINGS, NET_GRAPHHEIGHT, IF_2D|IF_NOMIPMAP|IF_NOPICMIP);
|
||||
x=8;
|
||||
R2D_Image(x, y, NET_TIMINGS, NET_GRAPHHEIGHT, 0, 0, 1, 1, netgraphshader);
|
||||
}
|
||||
|
||||
void R_NetgraphInit(void)
|
||||
{
|
||||
TEXASSIGN(netgraphtexture, R_AllocNewTexture("***netgraph***", NET_TIMINGS, NET_GRAPHHEIGHT, IF_NOMIPMAP));
|
||||
TEXASSIGN(netgraphtexture, R_AllocNewTexture("***netgraph***", NET_TIMINGS, NET_GRAPHHEIGHT, IF_2D|IF_NOMIPMAP));
|
||||
netgraphshader = R_RegisterShader("netgraph",
|
||||
"{\n"
|
||||
"program default2d\n"
|
||||
|
|
|
@ -491,7 +491,7 @@ void GLBE_UploadAllLightmaps(void)
|
|||
lm->modified = false;
|
||||
if (!TEXVALID(lm->lightmap_texture))
|
||||
{
|
||||
TEXASSIGN(lm->lightmap_texture, R_AllocNewTexture("***lightmap***", lm->width, lm->height, 0));
|
||||
TEXASSIGN(lm->lightmap_texture, R_AllocNewTexture("***lightmap***", lm->width, lm->height, IF_LINEAR|IF_NOMIPMAP));
|
||||
}
|
||||
GL_MTBind(0, GL_TEXTURE_2D, lm->lightmap_texture);
|
||||
qglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
|
||||
|
|
|
@ -4665,7 +4665,7 @@ void Shader_Default2D(char *shortname, shader_t *s, const void *genargs)
|
|||
"}\n"
|
||||
);
|
||||
|
||||
TEXASSIGN(s->defaulttextures.base, R_LoadHiResTexture(shortname, NULL, IF_NOPICMIP|IF_NOMIPMAP|IF_CLAMP));
|
||||
TEXASSIGN(s->defaulttextures.base, R_LoadHiResTexture(shortname, NULL, IF_2D|IF_NOPICMIP|IF_NOMIPMAP|IF_CLAMP));
|
||||
if (!TEXVALID(s->defaulttextures.base))
|
||||
{
|
||||
unsigned char data[4*4] = {0};
|
||||
|
|
|
@ -476,7 +476,7 @@ Returns a string describing *data in a human-readable type specific manner
|
|||
*/
|
||||
char *PR_ValueString (progfuncs_t *progfuncs, etype_t type, eval_t *val)
|
||||
{
|
||||
static char line[256];
|
||||
static char line[4096];
|
||||
fdef_t *fielddef;
|
||||
dfunction_t *f;
|
||||
|
||||
|
@ -589,7 +589,7 @@ Easier to parse than PR_ValueString
|
|||
char *PDECL PR_UglyValueString (pubprogfuncs_t *ppf, etype_t type, eval_t *val)
|
||||
{
|
||||
progfuncs_t *progfuncs = (progfuncs_t*)ppf;
|
||||
static char line[256];
|
||||
static char line[4096];
|
||||
fdef_t *fielddef;
|
||||
dfunction_t *f;
|
||||
int i, j;
|
||||
|
@ -698,7 +698,7 @@ char *PDECL PR_UglyValueString (pubprogfuncs_t *ppf, etype_t type, eval_t *val)
|
|||
//compatible with Q1 (for savegames)
|
||||
char *PR_UglyOldValueString (progfuncs_t *progfuncs, etype_t type, eval_t *val)
|
||||
{
|
||||
static char line[256];
|
||||
static char line[4096];
|
||||
fdef_t *fielddef;
|
||||
dfunction_t *f;
|
||||
|
||||
|
@ -1427,8 +1427,7 @@ char *ED_WriteGlobals(progfuncs_t *progfuncs, char *buffer) //switch first.
|
|||
continue;
|
||||
|
||||
add16:
|
||||
AddS (qcva("\"%s\" ", name));
|
||||
AddS (qcva("\"%s\"\n", PR_UglyValueString(&progfuncs->funcs, def16->type&~DEF_SAVEGLOBAL, (eval_t *)v)));
|
||||
AddS("\""); AddS(name); AddS("\" \""); AddS(PR_UglyValueString(&progfuncs->funcs, def16->type&~DEF_SAVEGLOBAL, (eval_t *)v)); AddS("\"\n");
|
||||
}
|
||||
break;
|
||||
case PST_QTEST:
|
||||
|
@ -1481,8 +1480,7 @@ char *ED_WriteGlobals(progfuncs_t *progfuncs, char *buffer) //switch first.
|
|||
if (j == type_size[type])
|
||||
continue;
|
||||
add32:
|
||||
AddS (qcva("\"%s\" ", name));
|
||||
AddS (qcva("\"%s\"\n", PR_UglyValueString(&progfuncs->funcs, def32->type&~DEF_SAVEGLOBAL, (eval_t *)v)));
|
||||
AddS("\""); AddS(name); AddS("\" \""); AddS(PR_UglyValueString(&progfuncs->funcs, def32->type&~DEF_SAVEGLOBAL, (eval_t *)v)); AddS("\"\n");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -1527,14 +1525,12 @@ char *ED_WriteEdict(progfuncs_t *progfuncs, edictrun_t *ed, char *buffer, pbool
|
|||
continue;
|
||||
|
||||
//add it to the file
|
||||
tmp = qcva("\"%s\"\n", name);
|
||||
AddS (tmp);
|
||||
AddS("\""); AddS(name); AddS("\" ");
|
||||
if (q1compatible)
|
||||
tmp = PR_UglyOldValueString(progfuncs, d->type, (eval_t *)v);
|
||||
else
|
||||
tmp = PR_UglyValueString(&progfuncs->funcs, d->type, (eval_t *)v);
|
||||
tmp = qcva("\"%s\"\n", tmp);
|
||||
AddS (tmp);
|
||||
AddS("\""); AddS(tmp); AddS("\"\n");
|
||||
}
|
||||
|
||||
return buffer;
|
||||
|
@ -2309,8 +2305,7 @@ char *PDECL PR_SaveEnt (pubprogfuncs_t *ppf, char *buf, int *size, struct edict_
|
|||
continue;
|
||||
|
||||
//add it to the file
|
||||
AddS (qcva("\"%s\" ",name));
|
||||
AddS (qcva("\"%s\"\n", PR_UglyValueString(&progfuncs->funcs, d->type, (eval_t *)v)));
|
||||
AddS("\""); AddS(name); AddS("\" \""); AddS(PR_UglyValueString(&progfuncs->funcs, d->type, (eval_t *)v)); AddS("\"\n");
|
||||
}
|
||||
|
||||
AddS ("}\n");
|
||||
|
|
|
@ -68,7 +68,7 @@ cvar_t pr_imitatemvdsv = CVARFD("pr_imitatemvdsv", "0", CVAR_LATCH, "Enables mvd
|
|||
cvar_t pr_fixbrokenqccarrays = CVARFD("pr_fixbrokenqccarrays", "1", CVAR_LATCH, "When set, ensures that fields are not relocated unless remapped, working around stripped/immediate field offsets. This results in higher memory usage.");
|
||||
|
||||
/*other stuff*/
|
||||
cvar_t pr_maxedicts = CVARAFD("pr_maxedicts", "8192", "max_edicts", CVAR_LATCH, "Maximum number of entities spawnable on the map at once. Low values will crash the server on some maps/mods. High values will result in excessive memory useage (see pr_ssqc_memsize). Illegible server messages may occur with old/other clients above 32k. FTE's network protocols have a maximum at a little over 4 million. Please don't ever make a mod that actually uses that many...");
|
||||
cvar_t pr_maxedicts = CVARAFD("pr_maxedicts", "32768", "max_edicts", CVAR_LATCH, "Maximum number of entities spawnable on the map at once. Low values will crash the server on some maps/mods. High values will result in excessive memory useage (see pr_ssqc_memsize). Illegible server messages may occur with old/other clients above 32k. FTE's network protocols have a maximum at a little over 4 million. Please don't ever make a mod that actually uses that many...");
|
||||
|
||||
cvar_t pr_no_playerphysics = CVARFD("pr_no_playerphysics", "0", CVAR_LATCH, "Prevents support of the 'SV_PlayerPhysics' QC function. This allows servers to prevent needless breakage of player prediction.");
|
||||
cvar_t pr_no_parsecommand = CVARFD("pr_no_parsecommand", "0", 0, "Provides a way around invalid mod usage of SV_ParseClientCommand, eg xonotic.");
|
||||
|
|
|
@ -6044,7 +6044,6 @@ void SV_AckEntityFrame(client_t *cl, int framenum)
|
|||
if (cl->lastsequence_acknowledged + UPDATE_BACKUP > framenum)
|
||||
{
|
||||
int i;
|
||||
Con_DPrintf("SV: Acked %i\n", framenum);
|
||||
for (i = cl->lastsequence_acknowledged+1; i < framenum; i++)
|
||||
SV_CSQC_DroppedPacket(cl, i);
|
||||
}
|
||||
|
|
|
@ -46,7 +46,8 @@ texture_t r_notexture_mip_real;
|
|||
texture_t *r_notexture_mip = &r_notexture_mip_real;
|
||||
|
||||
cvar_t sv_nogetlight = SCVAR("sv_nogetlight", "0");
|
||||
cvar_t dpcompat_psa_ungroup = SCVAR ("dpcompat_psa_ungroup", "0");
|
||||
cvar_t dpcompat_psa_ungroup = CVAR ("dpcompat_psa_ungroup", "0");
|
||||
cvar_t r_noframegrouplerp = CVARF ("r_noframegrouplerp", "0", CVAR_ARCHIVE);
|
||||
|
||||
unsigned *model_checksum;
|
||||
|
||||
|
@ -202,6 +203,7 @@ void Mod_Init (void)
|
|||
memset (mod_novis, 0xff, sizeof(mod_novis));
|
||||
Cvar_Register(&sv_nogetlight, "Memory preservation");
|
||||
Cvar_Register (&dpcompat_psa_ungroup, "Darkplaces compatibility");
|
||||
Cvar_Register (&r_noframegrouplerp, "Oooga booga");
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue