Fixes #7 (Crap Screen Crash), adds new HUD control commands (prefix hud_) and makes the sbar stuff seperate from most other operations

This commit is contained in:
eukos 2015-08-21 15:56:42 +02:00
parent e86408bdcb
commit 11d92b89cf
21 changed files with 425 additions and 2713 deletions

2
TODO
View file

@ -1,2 +1,2 @@
- Cleanup of d_scan, d_polyse and d_surf
- Fixing up of coloured statusbars

View file

@ -324,7 +324,8 @@ qpic_t *Draw_CachePic (char *path)
dat = (qpic_t *)pic->cache.data;
if (!dat)
{
Sys_Error ("Draw_CachePic: failed to load %s", path);
Con_Printf ("Draw_CachePic: failed to load %s\n", path);
return;
}
// leilei - quick palette translation
@ -1898,318 +1899,22 @@ Draw_Pic
=============
*/
void Draw_Pic (int x, int y, qpic_t *pic)
{
byte *dest, *source;
unsigned short *pusdest;
int v, u;
if(pic == NULL)
{
Con_DPrintf("WARNING: pic in Draw_Pic is empty!\n");
return;
}
if ((x < 0) ||
(x + pic->width > vid.width) ||
(y < 0) ||
(y + pic->height > vid.height))
{
Sys_Error ("Draw_Pic: bad coordinates");
}
source = pic->data;
if (r_pixbytes == 1)
{
dest = vid.buffer + y * vid.rowbytes + x;
for (v=0 ; v<pic->height ; v++)
{
Q_memcpy (dest, source, pic->width);
dest += vid.rowbytes;
source += pic->width;
}
}
else
{
// FIXME: pretranslate at load time?
pusdest = (unsigned short *)vid.buffer + y * (vid.rowbytes >> 1) + x;
for (v=0 ; v<pic->height ; v++)
{
for (u=0 ; u<pic->width ; u++)
{
pusdest[u] = d_8to16table[source[u]];
}
pusdest += vid.rowbytes >> 1;
source += pic->width;
}
}
}
void Draw_Pic_Scaled (int x, int y, qpic_t *pic)
{
byte *source;
int v, u, s;
float vmax, umax;
if(pic == NULL)
{
Con_DPrintf("WARNING: pic in Draw_Pic_Scaled is empty!\n");
return;
}
if ((x < 0) ||
(x + pic->width > vid.width) ||
(y < 0) ||
(y + pic->height > vid.height))
{
Sys_Error ("Draw_Pic: bad coordinates");
}
source = pic->data;
umax = pic->width * vid.width / (float)vid.vconwidth;
vmax = pic->height * vid.height / (float)vid.vconheight;
{
byte *dest = vid.buffer + (y*vid.height/vid.vconheight) * vid.rowbytes + (x*vid.width/vid.vconwidth);
for (v = 0; v < vmax; v++)
{
for (u = 0; u < umax; u++)
{
s = u * vid.vconwidth / vid.width + (v * vid.vconheight/vid.height) * pic->width;
dest[u] = source[s];
}
dest += vid.rowbytes;
}
}
}
extern int col_toremap;
extern int col_light;
extern int col_toremap2;
// for recolorable status bars
void Draw_Pic_Scaled_Color (int x, int y, qpic_t *pic, int color)
{
byte *source;
int v, u, s;
float vmax, umax;
int remapfrom, remapto, special;
int remapfrombrown1, remaptobrown1;
int remapfrombrown2, remaptobrown2;
int remapfromorange, remaptoorange;
remapfrom = col_toremap * 16;
remapto = col_toremap * 16 + 16;
remapfrombrown1 = 10 * 16;
remaptobrown1 = 10 * 16 + 16;
remapfrombrown2 = 7 * 16;
remaptobrown2 = 7 * 16 + 16;
remapfromorange = col_toremap2 * 16;
remaptoorange = col_toremap2 * 16 + 16;
if (color == 16){
Draw_Pic_Scaled(x, y, pic); //use normal function instead
return;
}
if ((x < 0) ||
(x + pic->width > vid.width) ||
(y < 0) ||
(y + pic->height > vid.height))
{
Sys_Error ("Draw_Pic: bad coordinates");
}
source = pic->data;
umax = pic->width * vid.width / (float)vid.vconwidth;
vmax = pic->height * vid.height / (float)vid.vconheight;
if (col_toremap == 1)
special = 1;
{
byte *dest = vid.buffer + (y*vid.height/vid.vconheight) * vid.rowbytes + (x*vid.width/vid.vconwidth);
for (v = 0; v < vmax; v++)
{
for (u = 0; u < umax; u++)
{
s = u * vid.vconwidth / vid.width + (v * vid.vconheight/vid.height) * pic->width;
if (source[s] > remapfrom && source[s] < remapto || source[s] > remapfrombrown1 && source[s] < remaptobrown1 || source[s] > remapfrombrown2 && source[s] < remaptobrown2)
dest[u] = menumap[source[s]][color];
else if (source[s] > remapfromorange && source[s] < remaptoorange)
dest[u] = menumap[source[s]][col_light];
else
if (source[s] > remapfrom && source[s] < remapto)
dest[u] = menumap[source[s]][color];
else
dest[u] = source[s];
}
dest += vid.rowbytes;
}
}
}
//==========================================================================
//
// Draw_PicCropped
//
// Draws a qpic_t that is clipped at the bottom/top edges of the screen.
//
//==========================================================================
void Draw_PicCropped (int x, int y, qpic_t *pic)
{
byte *source;
int v, u, height;
if ((x < 0) || (x+pic->width > (int)vid.width))
{
Sys_Error("%s: bad coordinates");
}
if (y >= vid.height || y+pic->height < 0)
{ // Totally off screen
return;
}
if (y+pic->height > vid.height)
{
height = vid.height-y;
}
else if (y < 0)
{
height = pic->height+y;
}
else
{
height = pic->height;
}
source = pic->data;
if (y < 0)
{
source += (pic->width * (-y));
y = 0;
}
if (r_pixbytes == 1)
{
byte *dest = vid.buffer + y*vid.rowbytes + x;
for (v = 0; v < height; v++)
{
memcpy(dest, source, pic->width);
dest += vid.rowbytes;
source += pic->width;
}
}
else /* r_pixbytes == 2 */
{
// FIXME: pretranslate at load time?
unsigned short *dest = (unsigned short *)vid.buffer + y * (vid.rowbytes>>1) + x;
// FIXME: transparency bits are missing
for (v = 0; v < height; v++)
{
for (u = 0; u < pic->width; u++)
{
dest[u] = d_8to16table[source[u]];
}
dest += vid.rowbytes>>1;
source += pic->width;
}
}
}
void Draw_PicCropped_Scaled (int x, int y, qpic_t *pic)
{
byte *source;
int v, u, height, s;
float vmax, umax;
if ((x < 0) || (x+pic->width > (int)vid.width))
Sys_Error("%s: bad coordinates");
if (y >= vid.height || y+pic->height < 0)
return;
if (y+pic->height > vid.vconheight)
height = vid.vconheight-y;
else if (y < 0)
height = pic->height+y;
else
height = pic->height;
source = pic->data;
if (y < 0)
{
source += (pic->width * (-y));
y = 0;
}
vmax = height * vid.height / (float)vid.vconheight;
umax = pic->width * vid.width / (float)vid.vconwidth;
if (r_pixbytes == 1)
{
byte *dest = vid.buffer + (y * vid.height / vid.vconheight) * vid.rowbytes
+ (x * vid.width / vid.vconwidth);
for (v = 0; v < vmax; v++)
{
for (u = 0; u < umax; u++)
{
s = u*vid.vconwidth/vid.width + (v*vid.vconheight/vid.height) * pic->width;
dest[u] = source[s];
}
dest += vid.rowbytes;
}
}
else /* r_pixbytes == 2 */
{
unsigned short *dest = (unsigned short *)vid.buffer
+ (y*vid.height/vid.vconheight) * (vid.rowbytes>>1) + (x*vid.width/vid.vconwidth);
for (v = 0; v < vmax; v++)
{
for (u = 0; u < umax; u++)
{
s = u * vid.vconwidth / vid.width
+ (v * vid.vconheight / vid.height) * pic->width;
dest[u] = d_8to16table[source[s]];
}
dest += vid.rowbytes>>1;
}
}
}
/*
=============
Draw_TransPic
=============
*/
void Draw_TransPic (int x, int y, qpic_t *pic)
{
byte *dest, *source, tbyte;
unsigned short *pusdest;
int v, u;
if (x < 0 || (unsigned)(x + pic->width) > vid.width || y < 0 ||
/* if (x < 0 || (unsigned)(x + pic->width) > vid.width || y < 0 ||
(unsigned)(y + pic->height) > vid.height)
{
Sys_Error ("Draw_TransPic: bad coordinates");
Con_Printf("WARNING: Wrong coordinates for pic at %ix%i!\n", x, y);
return;
}
*/
if(x < 0) x = 0;
if(y < 0) y = 0;
if((x + pic->width) > vid.vconwidth) x = vid.vconwidth - pic->width;
if((y + pic->height) > vid.vconheight) x = vid.vconheight - pic->height;
source = pic->data;
@ -2280,71 +1985,23 @@ void Draw_TransPic (int x, int y, qpic_t *pic)
}
}
/*
void Draw_TransPic_Scaled (int x, int y, qpic_t *pic)
void Draw_Pic_Scaled (int x, int y, qpic_t *pic)
{
byte *source, tbyte;
int v, u, s;
float vmax, umax;
if (x < 0 || (x + pic->width) > vid.vconwidth ||
y < 0 || (y + pic->height) > vid.vconheight)
{
Sys_Error("%s: bad coordinates");
}
if(x < 0) x = 0;
if(y < 0) y = 0;
if((x + pic->width) > vid.vconwidth) x = vid.vconwidth - pic->width;
if((y + pic->height) > vid.vconheight) x = vid.vconheight - pic->height;
source = pic->data;
vmax = pic->height * vid.height / (float)vid.vconheight;
umax = pic->width * vid.width / (float)vid.vconwidth;
{
byte *dest = vid.buffer + (y * vid.height / vid.vconheight) * vid.rowbytes
+ (x * vid.width / vid.vconwidth);
for (v = 0; v < vmax; v++)
{
for (u = 0; u < umax; u++)
{
s = u * vid.vconwidth / vid.width
+ (v * vid.vconheight / vid.height) * pic->width;
if ((tbyte = source[s]) != TRANSPARENT_COLOR)
{
dest[u] = tbyte;
}
}
dest += vid.rowbytes;
}
}
}
*/
void Draw_TransPic_Scaled (int x, int y, qpic_t *pic)
{
byte *source, tbyte;
int v, u, s;
float vmax, umax;
if (x < 0 || (x + pic->width) > vid.vconwidth ||
y < 0 || (y + pic->height) > vid.vconheight)
{
Sys_Error("%s: bad coordinates");
}
source = pic->data;
vmax = pic->height * vid.height / (float)vid.vconheight;
umax = pic->width * vid.width / (float)vid.vconwidth;
{
byte *dest = vid.buffer + (y * vid.height / vid.vconheight) * vid.rowbytes
+ (x * vid.width / vid.vconwidth);
byte *dest = vid.buffer + (y * vid.height / vid.vconheight) * vid.rowbytes + (x * vid.width / vid.vconwidth);
for (v = 0; v < vmax; v++)
{
@ -2353,33 +2010,26 @@ void Draw_TransPic_Scaled (int x, int y, qpic_t *pic)
s = u * vid.vconwidth / vid.width + (v * vid.vconheight / vid.height) * pic->width;
if ((tbyte = source[s]) != TRANSPARENT_COLOR)
{
dest[u] = tbyte;
}
}
dest += vid.rowbytes;
}
}
}
void Draw_TransPic_Scaled_Two (int x, int y, qpic_t *pic, float scel)
void Draw_Pic_Scaled_Two (int x, int y, qpic_t *pic, float scel)
{
byte *source, tbyte;
int v, u, s;
float vmax, umax;
float scal;
int scol;
if (x < 0 || (x + pic->width) > vid.vconwidth ||
y < 0 || (y + pic->height) > vid.vconheight)
{
Sys_Error("%s: bad coordinates");
}
if(x < 0) x = 0;
if(y < 0) y = 0;
if((x + pic->width) > vid.vconwidth) x = vid.vconwidth - pic->width;
if((y + pic->height) > vid.vconheight) x = vid.vconheight - pic->height;
source = pic->data;
@ -2413,22 +2063,15 @@ void Draw_TransPic_Scaled_Two (int x, int y, qpic_t *pic, float scel)
}
}
//==========================================================================
//
// Draw_TransPicCropped
//
// Draws a holey qpic_t that is clipped at the bottom edge of the screen.
//
//==========================================================================
void Draw_TransPicCropped (int x, int y, qpic_t *pic)
void Draw_PicCropped (int x, int y, qpic_t *pic)
{
byte *source, tbyte;
int v, u, height;
if ((x < 0) || (x+pic->width > vid.width))
{
Sys_Error("%s: bad coordinates");
Sys_Error("DrawPic: bad coordinates");
}
if (y >= vid.height || y+pic->height < 0)
@ -2525,7 +2168,7 @@ void Draw_TransPicCropped (int x, int y, qpic_t *pic)
}
}
void Draw_TransPicCropped_Scaled (int x, int y, qpic_t *pic)
void Draw_PicCropped_Scaled (int x, int y, qpic_t *pic)
{
byte *source, tbyte;
int v, u, height, s;
@ -2534,7 +2177,7 @@ void Draw_TransPicCropped_Scaled (int x, int y, qpic_t *pic)
if ((x < 0) || (x+pic->width > vid.width))
{
Sys_Error("%s: bad coordinates");
Sys_Error("DrawPic: bad coordinates");
}
if (y >= vid.vconheight || y+pic->height < 0)
@ -2590,10 +2233,10 @@ void Draw_TransPicCropped_Scaled (int x, int y, qpic_t *pic)
/*
=============
Draw_TransPicTranslate
Draw_PicTranslate
=============
*/
void Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte *translation)
void Draw_PicTranslate (int x, int y, qpic_t *pic, byte *translation)
{
byte *dest, *source, tbyte;
unsigned short *pusdest;
@ -2602,7 +2245,7 @@ void Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte *translation)
if (x < 0 || (unsigned)(x + pic->width) > vid.width || y < 0 ||
(unsigned)(y + pic->height) > vid.height)
{
Sys_Error ("Draw_TransPic: bad coordinates");
Sys_Error ("Draw_Pic: bad coordinates");
}
source = pic->data;
@ -2677,12 +2320,12 @@ void Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte *translation)
/*
=============
Draw_TransPicTranslate_Scaled
Draw_PicTranslate_Scaled
=============
*/
void Draw_TransPicTranslate_Scaled (int x, int y, qpic_t *pic, byte *translation)
void Draw_PicTranslate_Scaled (int x, int y, qpic_t *pic, byte *translation)
{
byte *source, tbyte;
int v, u, s;
@ -2692,7 +2335,7 @@ void Draw_TransPicTranslate_Scaled (int x, int y, qpic_t *pic, byte *translation
if (x < 0 || (x + pic->width) > vid.vconwidth ||
y < 0 || (y + pic->height) > vid.vconheight)
{
Sys_Error("%s: bad coordinates");
Sys_Error("DrawPic: bad coordinates\n");
}
source = pic->data;
@ -2723,7 +2366,7 @@ void Draw_TransPicTranslate_Scaled (int x, int y, qpic_t *pic, byte *translation
}
void Draw_TransPicTranslatde_Scaled (int x, int y, qpic_t *pic, byte *translation)
void Draw_PicTranslatde_Scaled (int x, int y, qpic_t *pic, byte *translation)
{
byte *dest, *source, tbyte;
unsigned short *pusdest;
@ -2732,7 +2375,7 @@ void Draw_TransPicTranslatde_Scaled (int x, int y, qpic_t *pic, byte *translatio
if (x < 0 || (unsigned)(x + pic->width) > vid.width || y < 0 ||
(unsigned)(y + pic->height) > vid.height)
{
Sys_Error ("Draw_TransPic: bad coordinates");
Sys_Error ("Draw_Pic: bad coordinates\n");
}
source = pic->data;

View file

@ -2114,147 +2114,31 @@ void Host_Give_f (void)
case '7':
case '8':
case '9':
// MED 01/04/97 added hipnotic give stuff
if (hipnotic)
{
if (t[0] == '6')
{
if (t[1] == 'a')
sv_player->v.items = (int)sv_player->v.items | HIT_PROXIMITY_GUN;
else
sv_player->v.items = (int)sv_player->v.items | IT_GRENADE_LAUNCHER;
}
else if (t[0] == '9')
sv_player->v.items = (int)sv_player->v.items | HIT_LASER_CANNON;
else if (t[0] == '0')
sv_player->v.items = (int)sv_player->v.items | HIT_MJOLNIR;
else if (t[0] >= '2')
sv_player->v.items = (int)sv_player->v.items | (IT_SHOTGUN << (t[0] - '2'));
}
else
{
if (t[0] >= '2')
sv_player->v.items = (int)sv_player->v.items | (IT_SHOTGUN << (t[0] - '2'));
}
break;
case 's':
if (rogue)
{
// 2001-11-15 Better GetEdictFieldValue performance by LordHavoc/Maddes start
// val = GetEdictFieldValue(sv_player, "ammo_shells1");
val = GETEDICTFIELDVALUE(sv_player, pr_field_ammo_shells1);
// 2001-11-15 Better GetEdictFieldValue performance by LordHavoc/Maddes end
if (val)
val->_float = v;
}
sv_player->v.ammo_shells = v;
break;
case 'n':
if (rogue)
{
// 2001-11-15 Better GetEdictFieldValue performance by LordHavoc/Maddes start
// val = GetEdictFieldValue(sv_player, "ammo_nails1");
val = GETEDICTFIELDVALUE(sv_player, pr_field_ammo_nails1);
// 2001-11-15 Better GetEdictFieldValue performance by LordHavoc/Maddes end
if (val)
{
val->_float = v;
if (sv_player->v.weapon <= IT_LIGHTNING)
sv_player->v.ammo_nails = v;
}
}
else
{
sv_player->v.ammo_nails = v;
}
break;
case 'l':
if (rogue)
{
// 2001-11-15 Better GetEdictFieldValue performance by LordHavoc/Maddes start
// val = GetEdictFieldValue(sv_player, "ammo_lava_nails");
val = GETEDICTFIELDVALUE(sv_player, pr_field_ammo_lava_nails);
// 2001-11-15 Better GetEdictFieldValue performance by LordHavoc/Maddes end
if (val)
{
val->_float = v;
if (sv_player->v.weapon > IT_LIGHTNING)
sv_player->v.ammo_nails = v;
}
}
break;
case 'r':
if (rogue)
{
// 2001-11-15 Better GetEdictFieldValue performance by LordHavoc/Maddes start
// val = GetEdictFieldValue(sv_player, "ammo_rockets1");
val = GETEDICTFIELDVALUE(sv_player, pr_field_ammo_rockets1);
// 2001-11-15 Better GetEdictFieldValue performance by LordHavoc/Maddes end
if (val)
{
val->_float = v;
if (sv_player->v.weapon <= IT_LIGHTNING)
sv_player->v.ammo_rockets = v;
}
}
else
{
sv_player->v.ammo_rockets = v;
}
break;
case 'm':
if (rogue)
{
// 2001-11-15 Better GetEdictFieldValue performance by LordHavoc/Maddes start
// val = GetEdictFieldValue(sv_player, "ammo_multi_rockets");
val = GETEDICTFIELDVALUE(sv_player, pr_field_ammo_multi_rockets);
// 2001-11-15 Better GetEdictFieldValue performance by LordHavoc/Maddes end
if (val)
{
val->_float = v;
if (sv_player->v.weapon > IT_LIGHTNING)
sv_player->v.ammo_rockets = v;
}
}
break;
case 'h':
sv_player->v.health = v;
break;
case 'c':
if (rogue)
{
// 2001-11-15 Better GetEdictFieldValue performance by LordHavoc/Maddes start
// val = GetEdictFieldValue(sv_player, "ammo_cells1");
val = GETEDICTFIELDVALUE(sv_player, pr_field_ammo_cells1);
// 2001-11-15 Better GetEdictFieldValue performance by LordHavoc/Maddes end
if (val)
{
val->_float = v;
if (sv_player->v.weapon <= IT_LIGHTNING)
sv_player->v.ammo_cells = v;
}
}
else
{
sv_player->v.ammo_cells = v;
}
break;
case 'p':
if (rogue)
{
// 2001-11-15 Better GetEdictFieldValue performance by LordHavoc/Maddes start
// val = GetEdictFieldValue(sv_player, "ammo_plasma");
val = GETEDICTFIELDVALUE(sv_player, pr_field_ammo_plasma);
// 2001-11-15 Better GetEdictFieldValue performance by LordHavoc/Maddes end
if (val)
{
val->_float = v;
if (sv_player->v.weapon > IT_LIGHTNING)
sv_player->v.ammo_cells = v;
}
}
break;
}
}

View file

@ -215,7 +215,7 @@ extern cvar_t *vid_stretch_by_2;
#define MENU_CUSTOMIZE_CONTROLS 101
#define MENU_GO_TO_CONSOLE 102
#define MENU_LOAD_DEFAULT_CFG 103
#define MENU_SCREENSIZE 104
#define MENU_BRIGHTNESS 105
#define MENU_MOUSESPEED 106
#define MENU_CD_VOLUME 107
@ -547,7 +547,7 @@ menu_definition_t m_menu_content_options[] =
menu_definition_t m_menu_view_options[] =
{ // Video Options
{MENU_OPTIONS, MENU_OPTIONS}, // this is the ESC key function and title
{MENU_SCREENSIZE, MENU_SELECTABLE},
{MENU_ASPECT, MENU_SELECTABLE},
{MENU_BRIGHTNESS, MENU_SELECTABLE},
{MENU_SATURATION, MENU_SELECTABLE},
@ -615,8 +615,6 @@ void M_DrawCharacter (int cx, int line, int num)
void M_Print (int cx, int cy, char *str)
{
//int ye; if(lilchar) ye = 4; else ye = 8;
if (!qbeta){
while (*str)
{
@ -624,17 +622,7 @@ void M_Print (int cx, int cy, char *str)
str++;
cx += 8;
}
}
else
{
while (*str)
{ // leilei - old versions had white menus
M_DrawCharacter (cx, cy, *str);
str++;
cx += 8;
}
}
}
void M_PrintWhite (int cx, int cy, char *str)
@ -648,14 +636,6 @@ void M_PrintWhite (int cx, int cy, char *str)
}
}
void M_DrawTransPic (int x, int y, qpic_t *pic)
{
if (menu_scaled)
Draw_TransPic_Scaled (x + ((vid.vconwidth - 320)>>1), y, pic);
else
Draw_TransPic (x + ((vid.width - 320)>>1), y, pic);
}
void M_DrawPic (int x, int y, qpic_t *pic)
{
if (menu_scaled)
@ -692,12 +672,12 @@ void M_BuildTranslationTable(int top, int bottom)
}
void M_DrawTransPicTranslate (int x, int y, qpic_t *pic)
void M_DrawPicTranslate (int x, int y, qpic_t *pic)
{
if (menu_scaled)
Draw_TransPicTranslate_Scaled (x + ((vid.vconwidth - 320)>>1), y, pic, translationTable);
Draw_PicTranslate_Scaled (x + ((vid.vconwidth - 320)>>1), y, pic, translationTable);
else
Draw_TransPicTranslate (x + ((vid.width - 320)>>1), y, pic, translationTable);
Draw_PicTranslate (x + ((vid.width - 320)>>1), y, pic, translationTable);
}
@ -711,15 +691,15 @@ void M_DrawTextBox (int x, int y, int width, int lines)
cx = x;
cy = y;
p = Draw_CachePic ("gfx/box_tl.lmp");
M_DrawTransPic (cx, cy, p);
M_DrawPic (cx, cy, p);
p = Draw_CachePic ("gfx/box_ml.lmp");
for (n = 0; n < lines; n++)
{
cy += 8;
M_DrawTransPic (cx, cy, p);
M_DrawPic (cx, cy, p);
}
p = Draw_CachePic ("gfx/box_bl.lmp");
M_DrawTransPic (cx, cy+8, p);
M_DrawPic (cx, cy+8, p);
// draw middle
cx += 8;
@ -727,17 +707,17 @@ void M_DrawTextBox (int x, int y, int width, int lines)
{
cy = y;
p = Draw_CachePic ("gfx/box_tm.lmp");
M_DrawTransPic (cx, cy, p);
M_DrawPic (cx, cy, p);
p = Draw_CachePic ("gfx/box_mm.lmp");
for (n = 0; n < lines; n++)
{
cy += 8;
if (n == 1)
p = Draw_CachePic ("gfx/box_mm2.lmp");
M_DrawTransPic (cx, cy, p);
M_DrawPic (cx, cy, p);
}
p = Draw_CachePic ("gfx/box_bm.lmp");
M_DrawTransPic (cx, cy+8, p);
M_DrawPic (cx, cy+8, p);
width -= 2;
cx += 16;
}
@ -745,15 +725,15 @@ void M_DrawTextBox (int x, int y, int width, int lines)
// draw right side
cy = y;
p = Draw_CachePic ("gfx/box_tr.lmp");
M_DrawTransPic (cx, cy, p);
M_DrawPic (cx, cy, p);
p = Draw_CachePic ("gfx/box_mr.lmp");
for (n = 0; n < lines; n++)
{
cy += 8;
M_DrawTransPic (cx, cy, p);
M_DrawPic (cx, cy, p);
}
p = Draw_CachePic ("gfx/box_br.lmp");
M_DrawTransPic (cx, cy+8, p);
M_DrawPic (cx, cy+8, p);
}
//=============================================================================
@ -819,23 +799,19 @@ void M_Main_Draw (void)
int f;
qpic_t *p;
if (qbeta){
M_DrawTransPic (0, 0, Draw_CachePic ("gfx/mainmenu.lmp") );
}
else
{
M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/ttl_main.lmp");
M_DrawPic ( (320-p->width)/2, 4, p);
M_DrawTransPic (72, 32, Draw_CachePic ("gfx/mainmenu.lmp") );
}
M_DrawPic (72, 32, Draw_CachePic ("gfx/mainmenu.lmp") );
// 2001-10-20 TIMESCALE extension by Tomaz/Maddes start
// f = (int)(host_time * 10)%6;
if (qbeta) f = (int)(realtime * 10)%2; else f = (int)(realtime * 10)%6;
f = (int)(realtime * 10)%6;
// 2001-10-20 TIMESCALE extension by Tomaz/Maddes end
M_DrawTransPic (54, 32 + m_main_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) );
M_DrawPic (54, 32 + m_main_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) );
}
@ -929,17 +905,14 @@ void M_SinglePlayer_Draw (void)
int f;
qpic_t *p;
M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/ttl_sgl.lmp");
M_DrawPic ( (320-p->width)/2, 4, p);
M_DrawTransPic (72, 32, Draw_CachePic ("gfx/sp_menu.lmp") );
M_DrawPic (72, 32, Draw_CachePic ("gfx/sp_menu.lmp") );
if (qbeta)
f = (int)(realtime * 10)%2;
else
f = (int)(realtime * 10)%6;
M_DrawTransPic (54, 32 + m_singleplayer_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) );
M_DrawPic (54, 32 + m_singleplayer_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) );
}
@ -1183,16 +1156,14 @@ void M_MultiPlayer_Draw (void)
int f;
qpic_t *p;
M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/p_multi.lmp");
M_DrawPic ( (320-p->width)/2, 4, p);
M_DrawTransPic (72, 32, Draw_CachePic ("gfx/mp_menu.lmp") );
M_DrawPic (72, 32, Draw_CachePic ("gfx/mp_menu.lmp") );
// 2001-10-20 TIMESCALE extension by Tomaz/Maddes start
// f = (int)(host_time * 10)%6;
if (qbeta)
f = (int)(realtime * 10)%2;
else
f = (int)(realtime * 10)%6;
// 2001-10-20 TIMESCALE extension by Tomaz/Maddes end
#ifdef QSB_NET
@ -1204,7 +1175,7 @@ void M_MultiPlayer_Draw (void)
M_PrintWhite ((320/2) - ((27*8)/2), 180, " USE AT YOUR OWN RISK!!! PERIOD!!!");
#endif
M_DrawTransPic (54, 32 + m_multiplayer_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) );
M_DrawPic (54, 32 + m_multiplayer_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) );
if (serialAvailable || ipxAvailable || tcpipAvailable)
return;
@ -1306,7 +1277,7 @@ void M_Setup_Draw (void)
{
qpic_t *p;
M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/p_multi.lmp");
M_DrawPic ( (320-p->width)/2, 4, p);
@ -1326,11 +1297,11 @@ void M_Setup_Draw (void)
M_Print (72, 140, "Accept Changes");
p = Draw_CachePic ("gfx/bigbox.lmp");
M_DrawTransPic (160, 64, p);
M_DrawPic (160, 64, p);
p = Draw_CachePic ("gfx/menuplyr.lmp");
M_BuildTranslationTable(setup_top*16, setup_bottom*16);
M_DrawTransPicTranslate (172, 72, p);
M_DrawPicTranslate (172, 72, p);
M_DrawCharacter (56, setup_cursor_table [setup_cursor], 12+((int)(realtime*4)&1));
@ -1525,7 +1496,7 @@ void M_Net_Draw (void)
int f;
qpic_t *p;
M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/p_multi.lmp");
M_DrawPic ( (320-p->width)/2, 4, p);
@ -1542,7 +1513,7 @@ void M_Net_Draw (void)
}
if (p)
M_DrawTransPic (72, f, p);
M_DrawPic (72, f, p);
f += 19;
@ -1556,27 +1527,27 @@ void M_Net_Draw (void)
}
if (p)
M_DrawTransPic (72, f, p);
M_DrawPic (72, f, p);
f += 19;
if (ipxAvailable)
p = Draw_CachePic ("gfx/netmen3.lmp");
else
p = Draw_CachePic ("gfx/dim_ipx.lmp");
M_DrawTransPic (72, f, p);
M_DrawPic (72, f, p);
f += 19;
if (tcpipAvailable)
p = Draw_CachePic ("gfx/netmen4.lmp");
else
p = Draw_CachePic ("gfx/dim_tcp.lmp");
M_DrawTransPic (72, f, p);
M_DrawPic (72, f, p);
if (m_net_items == 5) // JDC, could just be removed
{
f += 19;
p = Draw_CachePic ("gfx/netmen5.lmp");
M_DrawTransPic (72, f, p);
M_DrawPic (72, f, p);
}
f = (320-26*8)/2;
@ -1588,10 +1559,10 @@ void M_Net_Draw (void)
M_Print (f, 166, net_helpMessage[m_net_cursor*4+3]);
// 2001-10-20 TIMESCALE extension by Tomaz/Maddes start
// f = (int)(host_time * 10)%6;
if (qbeta) f = (int)(realtime * 10)%2; else f = (int)(realtime * 10)%6;
f = (int)(realtime * 10)%6;
// 2001-10-20 TIMESCALE extension by Tomaz/Maddes end
M_DrawTransPic (54, 32 + m_net_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) );
M_DrawPic (54, 32 + m_net_cursor * 20,Draw_CachePic( va("gfx/menudot%i.lmp", f+1 ) ) );
}
@ -1821,12 +1792,10 @@ void M_DrawCheckboxBlood (int x, int y, int on)
void M_DrawCheckboxWaterQuality (int x, int y, int on)
{
if (on == 1)
M_Print (x, y, "refractions");
else if (on == 2)
M_Print (x, y, "reflections");
if (on)
M_Print (x, y, "on");
else
M_Print (x, y, "none");
M_Print (x, y, "off");
}
@ -2313,25 +2282,11 @@ int M_DrawFunction (menu_definition_t *menu_definition, int y)
M_Print (16, y, " View options");
y += 8;
break;
case MENU_BROKEN_OPTIONS:
M_Print (16, y, " FIXME FIXME FIX");
y += 8;
break;
case MENU_COLORMAP_OPTIONS:
M_Print (16, y, " Shading Options");
y += 8;
break;
case MENU_SCREENSIZE:
M_Print (16, y, " Screen size");
r = (scr_viewsize->value - 30) / (120 - 30);
M_DrawSlider (220, y, r);
y += 8;
break;
case MENU_BRIGHTNESS:
M_Print (16, y, " Brightness");
r = (1.0 - v_gamma->value) / 0.5;
@ -2353,8 +2308,6 @@ int M_DrawFunction (menu_definition_t *menu_definition, int y)
M_DrawSlider (220, y, r);
y += 8;
break;
case MENU_BLOODLEVEL:
M_Print (16, y, " Violence Level");
r = (r_particleblood->value) / 16;
@ -2364,14 +2317,11 @@ int M_DrawFunction (menu_definition_t *menu_definition, int y)
break;
case MENU_WATERQUALITY:
M_Print (16, y, " Water Effects");
r = (r_waterquality->value) / 2;
M_Print (16, y, " Water Refractions");
r = (r_waterquality->value);
M_DrawCheckboxWaterQuality (220, y, r_waterquality->value);
y += 8;
break;
case MENU_CON_ALPHA:
M_Print (16, y, " Console transparency");
r = (1.0 - con_alpha->value);
@ -2433,7 +2383,7 @@ int M_DrawFunction (menu_definition_t *menu_definition, int y)
y += 8;
break;
case MENU_OLDSTATBAR:
M_Print (16, y, " use old status bar");
M_Print (16, y, " draw hud");
M_DrawCheckbox (220, y, cl_sbar->value);
y += 8;
break;
@ -2774,7 +2724,7 @@ void M_Menu_Draw (menu_definition_t *menu_definition, int *current_index)
switch (menu_definition[0].type)
{
case MENU_OPTIONS:
M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/p_option.lmp");
M_DrawPic ( (320-p->width)/2, 4, p);
break;
@ -3292,20 +3242,6 @@ void M_ExecFunction (menu_definition_t *menu_definition, int key)
m_entersound = true;
}
break;
case MENU_SCREENSIZE:
if (dir != 0)
{
scr_viewsize->value += dir * 10;
if (scr_viewsize->value < 30)
scr_viewsize->value = 30;
if (scr_viewsize->value > 120)
scr_viewsize->value = 120;
Cvar_SetValue (scr_viewsize, scr_viewsize->value);
m_changesound = true;
}
break;
case MENU_BRIGHTNESS:
if (dir != 0)
{
@ -3361,12 +3297,7 @@ void M_ExecFunction (menu_definition_t *menu_definition, int key)
case MENU_WATERQUALITY:
if (dir != 0)
{
r_waterquality->value += dir * 1;
if (r_waterquality->value < 0)
r_waterquality->value = 0;
if (r_waterquality->value > 2)
r_waterquality->value = 2;
Cvar_SetValue (r_waterquality, r_waterquality->value);
Cvar_SetValue (r_waterquality, !r_waterquality->value);
m_changesound = true;
}
break;
@ -4698,7 +4629,7 @@ void M_SerialConfig_Draw (void)
char *startJoin;
char *directModem;
M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/p_multi.lmp");
basex = (320-p->width)/2;
M_DrawPic (basex, 4, p);
@ -4952,7 +4883,7 @@ void M_ModemConfig_Draw (void)
qpic_t *p;
int basex;
M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/p_multi.lmp");
basex = (320-p->width)/2;
@ -5139,7 +5070,7 @@ void M_LanConfig_Draw (void)
char *startJoin;
char *protocol;
M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/p_multi.lmp");
basex = (320-p->width)/2;
@ -5361,58 +5292,6 @@ level_t levels[] =
{"dm6", "The Dark Zone"}
};
//MED 01/06/97 added hipnotic levels
level_t hipnoticlevels[] =
{
{"start", "Command HQ"}, // 0
{"hip1m1", "The Pumping Station"}, // 1
{"hip1m2", "Storage Facility"},
{"hip1m3", "The Lost Mine"},
{"hip1m4", "Research Facility"},
{"hip1m5", "Military Complex"},
{"hip2m1", "Ancient Realms"}, // 6
{"hip2m2", "The Black Cathedral"},
{"hip2m3", "The Catacombs"},
{"hip2m4", "The Crypt"},
{"hip2m5", "Mortum's Keep"},
{"hip2m6", "The Gremlin's Domain"},
{"hip3m1", "Tur Torment"}, // 12
{"hip3m2", "Pandemonium"},
{"hip3m3", "Limbo"},
{"hip3m4", "The Gauntlet"},
{"hipend", "Armagon's Lair"}, // 16
{"hipdm1", "The Edge of Oblivion"} // 17
};
//PGM 01/07/97 added rogue levels
//PGM 03/02/97 added dmatch level
level_t roguelevels[] =
{
{"start", "Split Decision"},
{"r1m1", "Deviant's Domain"},
{"r1m2", "Dread Portal"},
{"r1m3", "Judgement Call"},
{"r1m4", "Cave of Death"},
{"r1m5", "Towers of Wrath"},
{"r1m6", "Temple of Pain"},
{"r1m7", "Tomb of the Overlord"},
{"r2m1", "Tempus Fugit"},
{"r2m2", "Elemental Fury I"},
{"r2m3", "Elemental Fury II"},
{"r2m4", "Curse of Osiris"},
{"r2m5", "Wizard's Keep"},
{"r2m6", "Blood Sacrifice"},
{"r2m7", "Last Bastion"},
{"r2m8", "Source of Evil"},
{"ctf1", "Division of Change"}
};
typedef struct
{
char *description;
@ -5432,27 +5311,6 @@ episode_t episodes[] =
};
//MED 01/06/97 added hipnotic episodes
episode_t hipnoticepisodes[] =
{
{"Scourge of Armagon", 0, 1},
{"Fortress of the Dead", 1, 5},
{"Dominion of Darkness", 6, 6},
{"The Rift", 12, 4},
{"Final Level", 16, 1},
{"Deathmatch Arena", 17, 1}
};
//PGM 01/07/97 added rogue episodes
//PGM 03/02/97 added dmatch episode
episode_t rogueepisodes[] =
{
{"Introduction", 0, 1},
{"Hell's Fortress", 1, 7},
{"Corridors of Time", 8, 8},
{"Deathmatch Arena", 16, 1}
};
int startepisode;
int startlevel;
int maxplayers;
@ -5483,7 +5341,7 @@ void M_GameOptions_Draw (void)
qpic_t *p;
int x;
M_DrawTransPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
M_DrawPic (16, 4, Draw_CachePic ("gfx/qplaque.lmp") );
p = Draw_CachePic ("gfx/p_multi.lmp");
M_DrawPic ( (320-p->width)/2, 4, p);
@ -5553,33 +5411,11 @@ void M_GameOptions_Draw (void)
M_Print (160, 96, va("%i minutes", (int)timelimit->value));
M_Print (0, 112, " Episode");
//MED 01/06/97 added hipnotic episodes
if (hipnotic)
M_Print (160, 112, hipnoticepisodes[startepisode].description);
//PGM 01/07/97 added rogue episodes
else if (rogue)
M_Print (160, 112, rogueepisodes[startepisode].description);
else
M_Print (160, 112, episodes[startepisode].description);
M_Print (0, 120, " Level");
//MED 01/06/97 added hipnotic episodes
if (hipnotic)
{
M_Print (160, 120, hipnoticlevels[hipnoticepisodes[startepisode].firstLevel + startlevel].description);
M_Print (160, 128, hipnoticlevels[hipnoticepisodes[startepisode].firstLevel + startlevel].name);
}
//PGM 01/07/97 added rogue episodes
else if (rogue)
{
M_Print (160, 120, roguelevels[rogueepisodes[startepisode].firstLevel + startlevel].description);
M_Print (160, 128, roguelevels[rogueepisodes[startepisode].firstLevel + startlevel].name);
}
else
{
M_Print (160, 120, levels[episodes[startepisode].firstLevel + startlevel].description);
M_Print (160, 128, levels[episodes[startepisode].firstLevel + startlevel].name);
}
// line cursor
M_DrawCharacter (144, gameoptions_cursor_table[gameoptions_cursor], 12+((int)(realtime*4)&1));
@ -5675,14 +5511,8 @@ void M_NetStart_Change (int dir)
case 7:
startepisode += dir;
//MED 01/06/97 added hipnotic count
if (hipnotic)
count = 6;
//PGM 01/07/97 added rogue count
//PGM 03/02/97 added 1 for dmatch episode
else if (rogue)
count = 4;
else if (registered->value)
if (registered->value)
count = 7;
else
count = 2;
@ -5698,14 +5528,8 @@ void M_NetStart_Change (int dir)
case 8:
startlevel += dir;
//MED 01/06/97 added hipnotic episodes
if (hipnotic)
count = hipnoticepisodes[startepisode].levels;
//PGM 01/06/97 added hipnotic episodes
else if (rogue)
count = rogueepisodes[startepisode].levels;
else
count = episodes[startepisode].levels;
if (startlevel < 0)
startlevel = count - 1;
@ -5761,12 +5585,6 @@ void M_GameOptions_Key (int key)
Cbuf_AddText ( va ("maxplayers %u\n", maxplayers) );
if (loadscreen->value)
SCR_BeginLoadingPlaque ();
if (hipnotic)
Cbuf_AddText ( va ("map %s\n", hipnoticlevels[hipnoticepisodes[startepisode].firstLevel + startlevel].name) );
else if (rogue)
Cbuf_AddText ( va ("map %s\n", roguelevels[rogueepisodes[startepisode].firstLevel + startlevel].name) );
else
Cbuf_AddText ( va ("map %s\n", levels[episodes[startepisode].firstLevel + startlevel].name) );
return;
}
@ -6073,7 +5891,7 @@ void Preset_U (void) // U
}
void Preset_Lei (void) // leilei - The kind of settings I prefer myself
void Preset_Lei (void)
{
Cvar_Set(cl_bobmodel, "3"); // fig 8
Cvar_Set(cl_leanmodel, "1");
@ -6266,12 +6084,6 @@ void M_Init (void)
Cmd_AddCommand ("help", M_Menu_Help_f);
Cmd_AddCommand ("menu_quit", M_Menu_Quit_f);
Cmd_AddCommand ("preset_q101", Preset_Q101);
Cmd_AddCommand ("preset_q107", Preset_Q107);
Cmd_AddCommand ("preset_glq", Preset_GLQ);
Cmd_AddCommand ("preset_d", Preset_D);
Cmd_AddCommand ("preset_u", Preset_U);
Cmd_AddCommand ("preset_q64", Preset_Q64);
menu_quitscreen = Cvar_Get ("menu_quitscreen", "0", CVAR_ARCHIVE |CVAR_ORIGINAL);
// 2002-01-31 New menu system by Maddes

View file

@ -169,7 +169,7 @@ model_t *Mod_LoadModel (model_t *mod, qboolean crash)
// 2001-09-12 Returning information about loaded file by Maddes end
{
if (crash)
Sys_Error ("Mod_NumForName: %s not found", mod->name);
Con_Printf ("Mod_NumForName: %s not found\n", mod->name);
return NULL;
}

File diff suppressed because it is too large Load diff

View file

@ -30,7 +30,7 @@ float scr_con_current;
float scr_conlines; // lines of console to display
float oldsbar;
float oldscreensize, oldfov;
cvar_t *scr_viewsize;
cvar_t *scr_fov; // 10 - 170
cvar_t *scr_fovadapt;// "Hor+" scaling
cvar_t *scr_conspeed;
@ -219,7 +219,7 @@ float AdaptFovx (float fov_x, float width, float height)
float ferv;
if (cl_sbar->value)
ferv = 0.15 * ((float)sb_lines * 0.02083333); // leilei - fudge around the size of fov
ferv = 0.15; // leilei - fudge around the size of fov
else
ferv = 0;
@ -643,14 +643,6 @@ static void SCR_CalcRefdef (void)
// force the status bar to redraw
Sbar_Changed ();
//========================================
// bound viewsize
if (scr_viewsize->value < 30)
Cvar_Set (scr_viewsize, "30");
else if (scr_viewsize->value > 130)
Cvar_Set (scr_viewsize, "130");
// bound field of view
if (scr_fov->value < 10)
Cvar_Set (scr_fov, "10");
@ -663,34 +655,7 @@ static void SCR_CalcRefdef (void)
if (cl.intermission)
size = 120;
else
size = scr_viewsize->value;
if(sb_scaled){
if (size >= 120)
sb_lines = 0; // no status bar at all
else if (size >= 110)
sb_lines = 24; // no inventory
else
sb_lines = 24+16+8;
} else
{
if (size >= 120)
sb_lines = 0; // no status bar at all
else if (size >= 110)
sb_lines = 24; // no inventory
else
sb_lines = 24+16+8;
}
if (sb_scaled)
sb_what_lines = sb_lines * (scalefactorv); // leilei - refdef hack fix
else
sb_what_lines = sb_lines;
size = 110;
// these calculations mirror those in R_Init() for r_refdef, but take no
// account of water warping
@ -726,34 +691,6 @@ static void SCR_CalcRefdef (void)
// R_ViewChanged (vid.aspect);
}
/*
=================
SCR_SizeUp_f
Keybinding command
=================
*/
void SCR_SizeUp_f (void)
{
Cvar_SetValue (scr_viewsize, scr_viewsize->value+10);
vid.recalc_refdef = 1;
}
/*
=================
SCR_SizeDown_f
Keybinding command
=================
*/
void SCR_SizeDown_f (void)
{
Cvar_SetValue (scr_viewsize, scr_viewsize->value-10);
vid.recalc_refdef = 1;
}
//============================================================================
extern cvar_t *cl_bobmodel;
@ -770,7 +707,6 @@ cvar_t *scr_fov_adapt;
void SCR_Init_Cvars (void)
{
scr_fov = Cvar_Get ("scr_fov", "90", CVAR_ORIGINAL);
scr_viewsize = Cvar_Get ("scr_viewsize", "100", CVAR_ARCHIVE|CVAR_ORIGINAL);
scr_conspeed = Cvar_Get ("scr_conspeed", "300", CVAR_ORIGINAL);
scr_showram = Cvar_Get ("scr_showram", "1", CVAR_ORIGINAL);
scr_showturtle = Cvar_Get ("scr_showturtle", "0", CVAR_ORIGINAL);
@ -798,8 +734,6 @@ SCR_Init
void SCR_Init (void)
{
Cmd_AddCommand ("screenshot",SCR_ScreenShot_f);
Cmd_AddCommand ("scr_sizeup",SCR_SizeUp_f);
Cmd_AddCommand ("scr_sizedown",SCR_SizeDown_f);
scr_ram = Draw_PicFromWad ("ram");
scr_net = Draw_PicFromWad ("net");
@ -1433,7 +1367,6 @@ void SCR_ReallyRender (void)
int dontevendraw;
void SCR_UpdateScreen (void)
{
static float oldscr_viewsize;
static float oldlcd_x;
static float oldv_detail;
vrect_t vrect;
@ -1468,12 +1401,6 @@ void SCR_UpdateScreen (void)
if (!scr_initialized || !con_initialized)
return; // not initialized yet
if (scr_viewsize->value != oldscr_viewsize)
{
oldscr_viewsize = scr_viewsize->value;
vid.recalc_refdef = 1;
}
//
// check for vid changes
//
@ -1494,11 +1421,6 @@ void SCR_UpdateScreen (void)
oldv_detail = v_detail->value;
vid.recalc_refdef = true;
}
if (oldscreensize != scr_viewsize->value)
{
oldscreensize = scr_viewsize->value;
vid.recalc_refdef = true;
}
if (oldsbar != cl_sbar->value)
{
@ -1617,13 +1539,6 @@ void SCR_UpdateScreen (void)
//
// update one of three areas
//
if (sb_scaled)
sb_what_lines = sb_lines * (vid.height / vid.vconheight); // leilei - refdef hack fix
else
// if (!reflectpass)
sb_what_lines = sb_lines;
// else
// sb_what_lines = 0;
if (scr_copyeverything)
{
vrect.x = 0;
@ -1639,7 +1554,7 @@ void SCR_UpdateScreen (void)
vrect.x = 0;
vrect.y = 0;
vrect.width = vid.width;
vrect.height = vid.height - sb_lines;
vrect.height = vid.height;
vrect.pnext = 0;
VID_Update (&vrect);

View file

@ -247,13 +247,6 @@ void SV_StartSound (edict_t *entity, int channel, char *sample, int volume,
MSG_WriteCoord (&sv.datagram, entity->v.origin[i]+0.5*(entity->v.mins[i]+entity->v.maxs[i]));
}
/*
==================
SV_StartSound2
@ -346,10 +339,10 @@ This will be sent on the initial connection and upon each server load.
void SV_SendServerinfo (client_t *client)
{
char **s;
char message[2048];
char message[64];
#ifdef DPPROTOCOLS
MSG_WriteByte (&client->message, svc_print);
sprintf (message, "%c\nENGOO VERSION %4.2f SERVER (%i CRC)", 2, VERSION, pr_crc);
sprintf (message, "%c\nNGUNIX VERSION %4.2f SERVER (%i CRC)", 2, VERSION, pr_crc);
MSG_WriteString (&client->message,message);
MSG_WriteByte (&client->message, svc_serverinfo);
@ -1244,7 +1237,7 @@ int SV_ModelIndex (char *name)
if (!strcmp(sv.model_precache[i], name))
return i;
if (i==MAX_MODELS || !sv.model_precache[i])
Sys_Error ("SV_ModelIndex: model %s not precached", name);
Con_Printf ("SV_ModelIndex: model %s not precached", name);
return i;
}
@ -1552,6 +1545,6 @@ void SV_SpawnServer (char *server)
if (host_client->active)
SV_SendServerinfo (host_client);
Con_DPrintf ("Server spawned.\n");
Con_DPrintf ("Server active.\n");
imsaving = 0;
}

View file

@ -1239,22 +1239,7 @@ static void V_CalcRefdef(void)
{
cl.weapon_origin[i] += forward[i]*bob*0.4;
}
cl.weapon_origin[2] += bob;
// if (v_fudgeweapon->value)
{
// fudge position around to keep amount of weapon visible
// roughly equal with different FOV
if (scr_viewsize->value == 110)
cl.weapon_origin[2] += 1;
else if (scr_viewsize->value == 100)
cl.weapon_origin[2] += 2;
else if (scr_viewsize->value == 90)
cl.weapon_origin[2] += 1;
else if (scr_viewsize->value == 80)
cl.weapon_origin[2] += 0.5;
}
cl.weapon_origin[2] += bob + 1;
// set up the refresh position
VectorAdd (r_refdef.viewangles, cl.punchangle, r_refdef.viewangles);
@ -1396,18 +1381,7 @@ void V_CalcRefdef (void)
// fudge position around to keep amount of weapon visible
// roughly equal with different FOV
if (scr_viewsize->value == 110)
view->origin[2] += 1;
else if (scr_viewsize->value == 100)
view->origin[2] += 2;
else if (scr_viewsize->value == 90)
view->origin[2] += 1;
else if (scr_viewsize->value == 80)
view->origin[2] += 0.5;
view->model = cl.model_precache[cl.stats[STAT_WEAPON]];
// leilei - gundraw
@ -1954,20 +1928,7 @@ void V_CalcRefdefOld (void)
// view->origin[i] += right[i]*bob*0.4;
// view->origin[i] += up[i]*bob*0.8;
}
view->origin[2] += bob;
// fudge position around to keep amount of weapon visible
// roughly equal with different FOV
if (scr_viewsize->value == 110)
view->origin[2] += 1;
else if (scr_viewsize->value == 100)
view->origin[2] += 2;
else if (scr_viewsize->value == 90)
view->origin[2] += 1;
else if (scr_viewsize->value == 80)
view->origin[2] += 0.5;
view->origin[2] += bob + 1;
view->model = cl.model_precache[cl.stats[STAT_WEAPON]];
view->frame = cl.stats[STAT_WEAPONFRAME];
view->colormap = vid.colormap;

View file

@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define WARP_WIDTH 320
#define WARP_HEIGHT 200
// LEI low detail hack
#define LOW_WIDTH 160
#define LOW_HEIGHT 100

View file

@ -27,8 +27,7 @@ void Draw_Init (void);
void Draw_Character (int x, int y, int num);
void Draw_DebugChar (char num);
void Draw_Pic (int x, int y, qpic_t *pic);
void Draw_TransPic (int x, int y, qpic_t *pic);
void Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte *translation);
void Draw_PicTranslate (int x, int y, qpic_t *pic, byte *translation);
void Draw_ConsoleBackground (int lines);
void Draw_BeginDisc (void);
void Draw_EndDisc (void);
@ -41,14 +40,10 @@ qpic_t *Draw_CachePic (char *path);
// Scaled up versions
void Draw_Pic_Scaled (int x, int y, qpic_t *pic);
void Draw_PicTranslate_Scaled (int x, int y, qpic_t *pic, byte *translation);
void Draw_PicCropped (int x, int y, qpic_t *pic);
void Draw_PicCropped_Scaled (int x, int y, qpic_t *pic);
void Draw_TransPic_Scaled (int x, int y, qpic_t *pic);
void Draw_TransPicTranslate_Scaled (int x, int y, qpic_t *pic, byte *translation);
void Draw_TransPicCropped (int x, int y, qpic_t *pic);
void Draw_TransPicCropped_Scaled (int x, int y, qpic_t *pic);
void Draw_Fill_Scaled (int x, int y, int w, int h, int c);
void Draw_Character_Scaled (int x, int y, unsigned int num);
@ -61,17 +56,7 @@ void Draw_SmallString_Scaled (int x, int y, const char *str);
#define GPART(c) (((c)>>8)&0xff)
#define BPART(c) ((c)&0xff)
// leilei's palette remappy stuffs
int rmap_ready;
int rmap_models;
int rmap_maps;

View file

@ -63,7 +63,6 @@ int inthedos;
// Versioning
// -----------------------------------------
int qbeta; // when 1, it tries to force guestimated pre-1.00 behaviors
int protocol; // OK.
int Nehahrademcompatibility; // LordHavoc: to allow playback of the early Nehahra movie segments
int dpprotocol;
@ -248,52 +247,11 @@ int dpprotocol;
#define IT_SIGIL3 (1<<30)
#define IT_SIGIL4 (1<<31)
//===========================================
//rogue changed and added defines
#define RIT_SHELLS 128
#define RIT_NAILS 256
#define RIT_ROCKETS 512
#define RIT_CELLS 1024
#define RIT_AXE 2048
#define RIT_LAVA_NAILGUN 4096
#define RIT_LAVA_SUPER_NAILGUN 8192
#define RIT_MULTI_GRENADE 16384
#define RIT_MULTI_ROCKET 32768
#define RIT_PLASMA_GUN 65536
#define RIT_ARMOR1 8388608
#define RIT_ARMOR2 16777216
#define RIT_ARMOR3 33554432
#define RIT_LAVA_NAILS 67108864
#define RIT_PLASMA_AMMO 134217728
#define RIT_MULTI_ROCKETS 268435456
#define RIT_SHIELD 536870912
#define RIT_ANTIGRAV 1073741824
#define RIT_SUPERHEALTH 2147483648
//MED 01/04/97 added hipnotic defines
//===========================================
//hipnotic added defines
#define HIT_PROXIMITY_GUN_BIT 16
#define HIT_MJOLNIR_BIT 7
#define HIT_LASER_CANNON_BIT 23
#define HIT_PROXIMITY_GUN (1<<HIT_PROXIMITY_GUN_BIT)
#define HIT_MJOLNIR (1<<HIT_MJOLNIR_BIT)
#define HIT_LASER_CANNON (1<<HIT_LASER_CANNON_BIT)
#define HIT_WETSUIT (1<<(23+2))
#define HIT_EMPATHY_SHIELDS (1<<(23+3))
//===========================================
#define MAX_SCOREBOARD 16
#define MAX_SCOREBOARDNAME 32
#define SOUND_CHANNELS 8
// This makes anyone on id's net privileged
// Use for multiplayer testing only - VERY dangerous!!!
// #define IDGODS
#include "common.h"
#include "bspfile.h"
#include "vid.h"

View file

@ -43,9 +43,6 @@ extern int sb_lines;
extern int clearnotify; // set to 0 whenever notify text is drawn
extern qboolean scr_disabled_for_loading;
extern qboolean scr_skipupdate;
extern cvar_t *scr_viewsize;
// only the refresh window will be updated unless these variables are flagged
extern int scr_copytop;
extern int scr_copyeverything;

View file

@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
static int miplevel;
float scale_for_mip;
int screenwidth;
int ubasestep, errorterm, erroradjustup, erroradjustdown;
@ -37,22 +36,6 @@ extern float oldwateralpha;
vec3_t transformed_modelorg;
/*
==============
D_DrawPoly
==============
*/
void D_DrawPoly (void)
{
// this driver takes spans, not polygons
// BULL SHIT!!!
}
/*
=============
@ -85,7 +68,6 @@ D_DrawSolidSurface
==============
*/
// FIXME: clean this up
void D_DrawSolidSurface (surf_t *surf, int color)
{
@ -97,6 +79,7 @@ void D_DrawSolidSurface (surf_t *surf, int color)
{
unsigned int *p32dest;
pix = d_8to24table[color];
for (span=surf->spans ; span ; span=span->pnext)
{
p32dest = (unsigned int *)d_viewbuffer + screenwidth * span->v;
@ -155,86 +138,6 @@ void D_DrawSolidSurface (surf_t *surf, int color)
}
}
/*
void D_GoThroughThisSurface (surf_t *surf)
{
espan_t *span;
int u, u2, pix;
{
for (span=surf->spans ; span ; span=span->pnext)
{
pdest = (byte *)d_viewbuffer + screenwidth*span->v;
u = span->u;
u2 = span->u + span->count - 1;
((byte *)pdest)[u] = pix;
if (u2 - u < 8)
{
for (u++ ; u <= u2 ; u++)
((byte *)pdest)[u] = pix;
}
else
{
for (u++ ; u & 3 ; u++)
((byte *)pdest)[u] = pix;
u2 -= 4;
for ( ; u <= u2 ; u+=4)
*(int *)((byte *)pdest + u) = pix;
u2 += 4;
for ( ; u <= u2 ; u++)
((byte *)pdest)[u] = pix;
}
}
}
}
*/
// leilei - just really, take a pixel buffer into it.
void D_DrawSolidMirrorSurface (surf_t *surf, int color)
{
espan_t *span;
byte *pdest;
byte *pbest;
int u, u2, pix;
#ifdef WATERREFLECTIONS
{
pix = 4;
for (span=surf->spans ; span ; span=span->pnext)
{
pdest = (byte *)d_viewbuffer + screenwidth*span->v;
pbest = (byte *)d_reflectbuffer + screenwidth*span->v;
u = span->u;
u2 = span->u + span->count - 1;
((byte *)pdest)[u] = pbest[u];
if (u2 - u < 8)
{
for (u++ ; u <= u2 ; u++)
((byte *)pdest)[u] = pbest[u];
}
else
{
for (u++ ; u & 3 ; u++)
((byte *)pdest)[u] = pbest[u];
u2 -= 4;
for ( ; u <= u2 ; u+=4)
*(int *)((byte *)pdest + u) = pbest[u];
u2 += 4;
for ( ; u <= u2 ; u++)
((byte *)pdest)[u] = pbest[u];
}
}
}
#endif
}
/*
==============
D_CalcGradients
@ -371,27 +274,10 @@ void D_DrawSurfaces (void)
D_DrawSolidSurface (s, (int)r_clearcolor->value & 0xFF);
D_DrawZSpans (s->spans);
}
/*
else if (s->flags & SURF_MIRROR)
{
// it is a mirror.
d_zistepu = 0;
d_zistepv = 0;
// d_ziorigin = -0.9;
D_DrawSolidMirrorSurface (s, (int)r_clearcolor->value & 55);
D_DrawZSpans (s->spans);
}
*/
else if (s->flags & SURF_DRAWTURB)
{
// if(reflectpass)
// return; // don't reflect our reflect
pface = s->data;
// if (reflectpass)
miplevel = 0;
cacheblock = (pixel_t *)
((byte *)pface->texinfo->texture +
@ -415,20 +301,10 @@ void D_DrawSurfaces (void)
D_CalcGradients (pface);
if (pface->plane->normal[2] != 1)
s->flags = s->flags ^ SURF_MIRROR; // leilei - revoke reflection privs from water that isnt up
#ifdef WATERREFLECTIONS
if (s->flags & SURF_MIRROR && r_waterquality->value > 1) { // leilei - water reflections
mirror_plane = pface->plane;
waterinsight = 1; // leilei - only allow waters that face up to reflect
gonnareflect = 1;
Turbulent8Reflect (s->spans);
}
else
#endif
{
waterinsight = 0;
Turbulent8 (s->spans);
}
if (!r_drawwater) // Manoel Kasimier - translucent water
@ -486,12 +362,6 @@ void D_DrawSurfaces (void)
}
// FIXME: make this passed in to D_CacheSurface
pcurrentcache = D_CacheSurface (pface, miplevel);
cacheblock = (pixel_t *)pcurrentcache->data;
@ -501,21 +371,6 @@ void D_DrawSurfaces (void)
D_CalcGradients (pface);
mirror_plane = pface->plane;
#ifdef WATERREFLECTIONS
if (s->flags & SURF_MIRROR) // we draw some special mirroring spans here......
{
mirror_plane = pface->plane;
waterinsight = 1; // i'm not water!
D_DrawSpans8_Mirror_C_Filter (s->spans);
//Con_Printf("%f %f %f Mirror\n", mirror_plane->normal[0],mirror_plane->normal[1],mirror_plane->normal[2]);
}
else
#endif
//D_DrawSpans8_C_FilterAlter (s->spans);
(*d_drawspans) (s->spans);
@ -544,4 +399,3 @@ void D_DrawSurfaces (void)
}
}
}

View file

@ -21,7 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "globaldef.h"
/*
================
D_FillRect
@ -85,4 +84,3 @@ void D_FillRect (vrect_t *rect, int color)
}
}
}

View file

@ -67,8 +67,10 @@ void D_Init (void)
r_drawpolys = false;
r_worldpolysbacktofront = false;
r_recursiveaffinetriangles = true;
if (!r_pixbytes)
r_pixbytes = 1;
r_aliasuvscale = 1.0;
}
@ -147,23 +149,10 @@ void D_SetupFrame (void)
#ifdef WATERLOW
else if (reflectpass)
d_viewbuffer = r_reflectbuffer;
#else
#ifdef WATERREFLECTIONS
else if (reflectpass)
d_viewbuffer = (void *)(byte *)vid.reflectbuffer;
#endif
#endif
else
d_viewbuffer = (void *)(byte *)vid.buffer;
// d_fogbuffer = r_fogbuffer;
#ifdef WATERREFLECTIONS
if (!reflectpass && !inthedos)
d_reflectbuffer = (void *)(byte *)vid.reflectbuffer; // crapscreenreflect will write to this.
#endif
if (r_docrap == 1)
screenwidth = LOW_WIDTH;
else if (r_docrap > 1)

View file

@ -42,8 +42,8 @@ extern float oldwateralpha;
byte menumap[256][16]; // haha hack
extern pixel_t addTable[256][256]; // Additive blending effect
extern pixel_t mulTable[256][256]; // Multiply blending effect (for colormod)
extern pixel_t ditherTable[262144][4];
static byte *foggmap;
extern int wootel[32][32][32];
extern int reflectavailable;
@ -86,7 +86,6 @@ void WaterTablgeGet (void)
blue = host_basepal[c*3+2] *ae + ((host_basepal[c*3+2] * (host_basepal[l*3+2] * 0.05)) * ay);
}
else if (oldwaterblend == 4){ // multiplicative
red = host_basepal[c*3] *ae + ((host_basepal[l*3] * 0.1 * (host_basepal[c*3] * 0.5)) * ay);
green = host_basepal[c*3+1] *ae + ((host_basepal[l*3+1] * 0.1 * (host_basepal[c*3+1] * 0.5)) * ay);
blue = host_basepal[c*3+2] *ae + ((host_basepal[l*3+2] * 0.1 * (host_basepal[c*3+2] * 0.5)) * ay);
@ -110,14 +109,14 @@ void WaterTablgeGet (void)
if (red < 0) red = 0;
if (green < 0) green = 0;
if (blue < 0) blue = 0;
if (ooh) waterTable[l][c] = BestColor(red,green,blue, 0, 255); // High quality color tables get best color
else if (palmap2) waterTable[l][c] = FindColor18(red,green,blue);
else waterTable[l][c] = FindColor(red,green,blue); // Since we do this live we must do this
// fast! or i'll cry.
if (ooh)
waterTable[l][c] = BestColor(red,green,blue, 0, 255); // High quality color tables get best color
else if (palmap2)
waterTable[l][c] = FindColor18(red,green,blue);
else
waterTable[l][c] = FindColor(red,green,blue); // Since we do this live we must do thisfast! or i'll cry.
}
}
}
@ -285,83 +284,6 @@ void D_CrapScreen (void)
}
}
void D_CrapScreenReflection (void)
{
int w, h;
int u,v;
byte *dest;
int *turb;
byte *rowptr[MAXHEIGHT+(AMP2*2)];
int column[MAXWIDTH+(AMP2*2)];
float wratio, hratio;
w = r_refdef.vrect.width;
h = r_refdef.vrect.height;
wratio = w / (float)scr_vrect.width;
hratio = h / (float)scr_vrect.height;
for (v=0 ; v<scr_vrect.height+AMP2*2 ; v++)
{
rowptr[v] = d_viewbuffer + (r_refdef.vrect.y * screenwidth) +
(screenwidth * (int)((float)v * hratio * h / (h + AMP2 * 2)));
}
for (u=0 ; u<scr_vrect.width+AMP2*2 ; u++)
{
column[u] = r_refdef.vrect.x +
(int)((float)u * wratio * w / (w + AMP2 * 2));
}
turb = atableofnothingtable;
dest = vid.buffer + scr_vrect.y * vid.rowbytes + scr_vrect.x;
// Shrooms case
if (r_doshrooms)
{
for (v = 0; v < scr_vrect.height; v++, dest += vid.rowbytes)
{
byte *myrow = rowptr[v];
int *mycol = column;
byte *mydest = dest;
for (u = 0; u < scr_vrect.width; u += 4, mycol += 4, mydest += 4)
{
// Shrooms effect test
mydest[0] = transTable[myrow[mycol[0]]][mydest[0]];
mydest[1] = transTable[myrow[mycol[1]]][mydest[1]];
mydest[2] = transTable[myrow[mycol[2]]][mydest[2]];
mydest[3] = transTable[myrow[mycol[3]]][mydest[3]];
}
}
}
// Normal case
else
{
for (v = 0; v < scr_vrect.height; v++, dest += vid.rowbytes)
{
byte *myrow = rowptr[v];
int *mycol = column;
int *mycolf = column;
byte *mydest = dest;
for (u = 0; u < scr_vrect.width; u += 4, mycol += 4, mydest += 4)
{
mydest[0] = myrow[mycol[0]];
mydest[1] = myrow[mycol[1]];
mydest[2] = myrow[mycol[2]];
mydest[3] = myrow[mycol[3]];
}
}
}
}
extern cvar_t *temp2;
// This is the MH version THANKS MH!!!
void D_CrapScreenMH (void)
@ -495,76 +417,6 @@ extern cvar_t *temp1;
extern cvar_t *r_waterquality;
extern cvar_t *r_wateralpha;
int depthen;
void D_DrawTurbulent8SpanAlphaReflections (void)
{
int sturb, tturb;
int refsturb, reftturb;
int refractsturb, refracttturb;
unsigned char temp, tempd2, tempd3, temp3, temp4;
int bleeh, bleeh2;
float wa;
//int pixsize = 2 * ( scr_vrect.width/ 640);
int pixsize = 2;
//wa = r_wateralpha->value;
// wa = depthen / 8192;
depthen = (depthen) >> 2;
if (reflectpass == 1)
return; // don't draw if we're doing water
do
{
if (*pz <= (izi >> 16))
{
// depthen = ferg / 512;
// depthen = 44;
sturb = ((r_turb_s + r_turb_turb[(r_turb_t>>16)&(CYCLE-1)])>>16)&63;
tturb = ((r_turb_t + r_turb_turb[(r_turb_s>>16)&(CYCLE-1)])>>16)&63;
if (r_waterquality->value > 1 && reflectavailable && !r_dowarp && !r_docrap){
refsturb = ((r_turb_s + r_turb_turb[(r_turb_t>>16)&(CYCLE-1)] * 4)>>16)&16;
reftturb = ((r_turb_t + r_turb_turb[(r_turb_s>>16)&(CYCLE-1)] * 4)>>16)&16;
refractsturb = ((r_turb_s + r_turb_turb[(r_turb_t>>16)&(CYCLE-1)] * 4)>>16)&16;
refracttturb = ((r_turb_t + r_turb_turb[(r_turb_s>>16)&(CYCLE-1)] * 4)>>16)&16;
tempd3 = *(r_turb_pdest + ((refracttturb) + refractsturb >> pixsize));
//tempd2 = *(r_turb_prefst + ((refsturb) + reftturb >> 2));
tempd2 = *(r_turb_prefst + ((refsturb) + reftturb >> pixsize)) ; // leilei - darken it based on wateralpha (for clarity etc) (+ ((int)(depthen) & 0xFF00))
temp3 = addTable[tempd2][tempd3];
}
else{
refractsturb = ((r_turb_s + r_turb_turb[(r_turb_t>>16)&(CYCLE-1)] * 4)>>16)&16;
refracttturb = ((r_turb_t + r_turb_turb[(r_turb_s>>16)&(CYCLE-1)] * 4)>>16)&16;
// if (!*(r_turb_pdest+9))
// tempd3 = *(r_turb_pdest); // todo - edge check to prevent bleed
// else
tempd3 = *(r_turb_pdest + ((refracttturb) + refractsturb >> pixsize));
temp3 = tempd3;
}
temp = *(r_turb_pbase + (tturb<<6) + sturb);
if (foguse)
*r_turb_pdest = foggmap[waterTable[temp][temp3]+ (ferg >> 2 & 0xFF00)];
//temp = foggmap[(temp + (tturb<<6) + sturb) + (ferg >> 2 & 0xFF00)];
else
*r_turb_pdest = waterTable[temp][temp3];
// *r_turb_pdest = tempd2;
}
*r_turb_pdest++;
*r_turb_prefst++;
izi += izistep;
pz++;
r_turb_s += r_turb_sstep;
r_turb_t += r_turb_tstep;
} while (--r_turb_spancount > 0);
}
void D_DrawTurbulent8SpanAlphaRefractions (void)
{
@ -653,8 +505,6 @@ void D_DrawTurbulent8SpanAlpha (void)
// Leilei - this is very simple.
void D_DrawGelWaterSpan (void)
{
do
{
if (*pz <= (izi >> 16))
@ -664,81 +514,13 @@ void D_DrawGelWaterSpan (void)
else
*r_turb_pdest = menumap[*r_turb_pdest][gmcol];
}
*r_turb_pdest++;
izi += izistep;
pz++;
} while (--r_turb_spancount > 0);
}
void D_DrawGelWaterSpanReflections (void)
{
int refsturb, reftturb;
int refractsturb, refracttturb;
int pixsize = 2;
unsigned char temp, tempd2, tempd3, temp3, temp4;
depthen = (depthen) >> 2;
do
{
if (*pz <= (izi >> 16))
{
if (r_waterquality->value > 1 && reflectavailable && !r_dowarp && !r_docrap){
refsturb = ((r_turb_s + r_turb_turb[(r_turb_t>>16)&(CYCLE-1)] * 4)>>16)&16;
reftturb = ((r_turb_t + r_turb_turb[(r_turb_s>>16)&(CYCLE-1)] * 4)>>16)&16;
refractsturb = ((r_turb_s + r_turb_turb[(r_turb_t>>16)&(CYCLE-1)] * 4)>>16)&16;
refracttturb = ((r_turb_t + r_turb_turb[(r_turb_s>>16)&(CYCLE-1)] * 4)>>16)&16;
tempd3 = *(r_turb_pdest + ((refracttturb) + refractsturb >> 2));
//tempd3 = transTable[*(r_turb_pdest + ((refracttturb) + refractsturb >> 2))][*(r_turb_pdest - ((refracttturb) + refractsturb >> 2))];
//tempd3 = *(r_turb_pdest + ((refracttturb) + refractsturb >> pixsize));
//tempd2 = *(r_turb_prefst + ((refsturb) + reftturb >> 2));
tempd2 = *(r_turb_prefst + ((refsturb) + reftturb >> pixsize)) ; // leilei - darken it based on wateralpha (for clarity etc) (+ ((int)(depthen) & 0xFF00))
//temp3 = addTable[tempd2][tempd3];
temp3 = tempd2;
}
else{
refractsturb = ((r_turb_s + r_turb_turb[(r_turb_t>>16)&(CYCLE-1)] * 4)>>16)&16;
refracttturb = ((r_turb_t + r_turb_turb[(r_turb_s>>16)&(CYCLE-1)] * 4)>>16)&16;
// tempd3 = *(r_turb_pdest + ((refracttturb) + refractsturb >> 2));
//tempd3 = transTable[*(r_turb_pdest + ((refracttturb) + refractsturb >> 2))][*(r_turb_pdest + ((refractsturb) + refracttturb >> 2))];
tempd3 = *(r_turb_pdest + ((refracttturb) + refractsturb >> 2));
temp3 = tempd3;
}
if (foguse)
*r_turb_pdest = foggmap[menumap[temp3][gmcol] + (ferg >> 2 & 0xFF00)];
else
*r_turb_pdest = menumap[temp3][gmcol];
}
*r_turb_pdest++;
*r_turb_prefst++;
izi += izistep;
pz++;
r_turb_s += r_turb_sstep;
r_turb_t += r_turb_tstep;
} while (--r_turb_spancount > 0);
}
void D_DrawGelWaterSpanRefractions (void)
{
int refsturb, reftturb;
@ -753,37 +535,21 @@ void D_DrawGelWaterSpanRefractions (void)
{
refractsturb = ((r_turb_s + r_turb_turb[(r_turb_t>>16)&(CYCLE-1)] * 4)>>16)&16;
refracttturb = ((r_turb_t + r_turb_turb[(r_turb_s>>16)&(CYCLE-1)] * 4)>>16)&16;
tempd3 = transTable[*(r_turb_pdest + ((refracttturb)+refractsturb >> 2))][*(r_turb_pdest+((refractsturb) + refracttturb >> 2))];
temp3 = tempd3;
if (foguse)
*r_turb_pdest = foggmap[menumap[temp3][gmcol] + (ferg >> 2 & 0xFF00)];
else
*r_turb_pdest = menumap[temp3][gmcol];
}
*r_turb_pdest++;
izi += izistep;
pz++;
r_turb_s += r_turb_sstep;
r_turb_t += r_turb_tstep;
} while (--r_turb_spancount > 0);
}
@ -1014,238 +780,6 @@ void Turbulent8 (espan_t *pspan)
} while ((pspan = pspan->pnext) != NULL);
}
// has extra stuff for reflections
void Turbulent8Reflect (espan_t *pspan)
{
int count;
fixed16_t snext, tnext;
float sdivz, tdivz, zi, z, du, dv, spancountminus1;
float sdivz16stepu, tdivz16stepu, zi16stepu;
int wb;
int gelmode;
int watqual;
float zer;
#ifdef WATERREFLECTIONS
wb = (int)r_waterblend->value;
if (wb == 3 || r_wateralpha->value < 1)
gelmode = 1; // leilei - skip the turb crap when in gelmode
watqual = (int)r_waterquality->value;
r_turb_turb = sintable + ((int)(cl.time*SPEED)&(CYCLE-1));
r_turb_sstep = 0; // keep compiler happy
r_turb_tstep = 0; // ditto
r_turb_pbase = (unsigned char *)cacheblock;
sdivz16stepu = d_sdivzstepu * 16;
tdivz16stepu = d_tdivzstepu * 16;
zi16stepu = d_zistepu * 16;
// mk transwater - begin
// we count on FP exceptions being turned off to avoid range problems
izistep = (int)(d_zistepu * 0x8000 * 0x10000);
izistep2 = izistep*2;
// mk transwater - end
// leilei - this is for the simple water
// reuses our menu background tables to blend it
// finds the nearest 'average' color from the color index
if (wb == 3){
// old values: 57 (breaks e3m1 slime/teleport),
//
gmcol = r_turb_pbase[2836]; // sample a pixel (TODO: Average a pixel on load)
if (gmcol < 16) gmcol = 0;
else if (gmcol < 32) gmcol = 1;
else if (gmcol < 48) gmcol = 2;
else if (gmcol < 64) gmcol = 3;
else if (gmcol < 80) gmcol = 4;
else if (gmcol < 96) gmcol = 5;
else if (gmcol < 112) gmcol = 6;
else if (gmcol < 128) gmcol = 7;
else if (gmcol < 144) gmcol = 8;
else if (gmcol < 160) gmcol = 9;
else if (gmcol < 176) gmcol = 10;
else if (gmcol < 192) gmcol = 11;
else if (gmcol < 208) gmcol = 12;
else if (gmcol < 224) gmcol = 13; // stupid elses huh?
else if (gmcol < 240) gmcol = 14;
else gmcol = 2; // stupid.
}
do
{
r_turb_pdest = (unsigned char *)((byte *)d_viewbuffer +
(screenwidth * pspan->v) + pspan->u);
// stupid hack to get reflections to align properly with the status bar
if (reflectavailable && gonnareflect && !r_dowarp && !r_docrap){
if (cl_sbar->value)
r_turb_prefst = (unsigned char *)((byte *)vid.reflectbuffer + (vid.width * (vid.height - sb_what_lines)) -
(screenwidth * pspan->v) + pspan->u);
else
r_turb_prefst = (unsigned char *)((byte *)vid.reflectbuffer + (vid.width * vid.height) -
(screenwidth * pspan->v) + pspan->u);
}
pz = d_pzbuffer + (d_zwidth * pspan->v) + pspan->u; // mk - transwater
count = pspan->count;
// calculate the initial s/z, t/z, 1/z, s, and t and clamp
du = (float)pspan->u;
dv = (float)pspan->v;
sdivz = d_sdivzorigin + dv*d_sdivzstepv + du*d_sdivzstepu;
tdivz = d_tdivzorigin + dv*d_tdivzstepv + du*d_tdivzstepu;
zi = d_ziorigin + dv*d_zistepv + du*d_zistepu;
z = (float)0x10000 / zi; // prescale to 16.16 fixed-point
// we count on FP exceptions being turned off to avoid range problems // mk transwoter
izi = (int)(zi * 0x8000 * 0x10000); // mk transwarter
r_turb_s = (int)(sdivz * z) + sadjust;
if (r_turb_s > bbextents)
r_turb_s = bbextents;
else if (r_turb_s < 0)
r_turb_s = 0;
r_turb_t = (int)(tdivz * z) + tadjust;
if (r_turb_t > bbextentt)
r_turb_t = bbextentt;
else if (r_turb_t < 0)
r_turb_t = 0;
do
{
// calculate s and t at the far end of the span
if (count >= 16)
r_turb_spancount = 16;
else
r_turb_spancount = count;
count -= r_turb_spancount;
if (count)
{
// calculate s/z, t/z, zi->fixed s and t at far end of span,
// calculate s and t steps across span by shifting
sdivz += sdivz16stepu;
tdivz += tdivz16stepu;
zi += zi16stepu;
z = (float)0x10000 / zi; // prescale to 16.16 fixed-point
snext = (int)(sdivz * z) + sadjust;
if (snext > bbextents)
snext = bbextents;
else if (snext < 16)
snext = 16; // prevent round-off error on <0 steps from
// from causing overstepping & running off the
// edge of the texture
tnext = (int)(tdivz * z) + tadjust;
if (tnext > bbextentt)
tnext = bbextentt;
else if (tnext < 16)
tnext = 16; // guard against round-off error on <0 steps
r_turb_sstep = (snext - r_turb_s) >> 4;
r_turb_tstep = (tnext - r_turb_t) >> 4;
}
else
{
// calculate s/z, t/z, zi->fixed s and t at last pixel in span (so
// can't step off polygon), clamp, calculate s and t steps across
// span by division, biasing steps low so we don't run off the
// texture
spancountminus1 = (float)(r_turb_spancount - 1);
sdivz += d_sdivzstepu * spancountminus1;
tdivz += d_tdivzstepu * spancountminus1;
zi += d_zistepu * spancountminus1;
z = (float)0x10000 / zi; // prescale to 16.16 fixed-point
snext = (int)(sdivz * z) + sadjust;
if (snext > bbextents)
snext = bbextents;
else if (snext < 16)
snext = 16; // prevent round-off error on <0 steps from
// from causing overstepping & running off the
// edge of the texture
tnext = (int)(tdivz * z) + tadjust;
if (tnext > bbextentt)
tnext = bbextentt;
else if (tnext < 16)
tnext = 16; // guard against round-off error on <0 steps
if (r_turb_spancount > 1)
{
r_turb_sstep = (snext - r_turb_s) / (r_turb_spancount - 1);
r_turb_tstep = (tnext - r_turb_t) / (r_turb_spancount - 1);
}
}
r_turb_s = r_turb_s & ((CYCLE<<16)-1);
r_turb_t = r_turb_t & ((CYCLE<<16)-1);
if (foguse){ ferg = (int)(z / 1024); if (ferg > 32762) ferg = 32762; } // leilei - fog
depthen = (int)z / 1024;
// skip_turb:
// mk transwater begin
// leilei modified this to accomodate our waterTable
// TODO: for hlbsp, use the rendertype/renderamt stuff
// and add/transtable instead of watertable
if (r_wateralpha->value < 1){
if (r_drawwater){
if (watqual && gonnareflect){
if (wb == 3){
D_DrawGelWaterSpanReflections ();
}
else{
D_DrawTurbulent8SpanAlphaReflections ();
}
}
else
{
if (wb == 3){
D_DrawGelWaterSpan ();
}
else{
D_DrawTurbulent8SpanAlpha ();
}
}
}
}
else
{
if (foguse){
D_DrawTurbulent8Span_Fog ();
} else {
D_DrawTurbulent8Span ();
}
}
r_turb_s = snext;
r_turb_t = tnext;
} while (count > 0);
} while ((pspan = pspan->pnext) != NULL);
#endif
}
#if !id386
/*
@ -2244,162 +1778,6 @@ extern qboolean r_dowarp;
extern int r_docrap;
extern byte *r_warpbuffer;
#ifdef WATERREFLECTIONS
void D_DrawSpans8_Mirror_C_Filter (espan_t *pspan)
{
int count, spancount;
unsigned char *pbase, *pdest, *pbest;
fixed16_t s, t, snext, tnext, sstep, tstep;
float sdivz, tdivz, zi, z, du, dv, spancountminus1;
float sdivz8stepu, tdivz8stepu, zi8stepu;
int forg; // leilei - fog
sstep = 0; // keep compiler happy
tstep = 0; // ditto
pbase = (unsigned char *)cacheblock;
sdivz8stepu = d_sdivzstepu * 8;
tdivz8stepu = d_tdivzstepu * 8;
zi8stepu = d_zistepu * 8;
do
{
pdest = (unsigned char *)((byte *)d_viewbuffer +
(screenwidth * pspan->v) + pspan->u);
if (r_dowarp || r_docrap > 1)
pbest = (unsigned char *)(r_warpbuffer +
(screenwidth * pspan->v) + pspan->u);
else
pbest = (unsigned char *)((byte *)vid.reflectbuffer +
(screenwidth * pspan->v) + pspan->u);
count = pspan->count;
// calculate the initial s/z, t/z, 1/z, s, and t and clamp
du = (float)pspan->u;
dv = (float)pspan->v;
sdivz = d_sdivzorigin + dv*d_sdivzstepv + du*d_sdivzstepu;
tdivz = d_tdivzorigin + dv*d_tdivzstepv + du*d_tdivzstepu;
zi = d_ziorigin + dv*d_zistepv + du*d_zistepu;
z = (float)0x10000 / zi; // prescale to 16.16 fixed-point
s = (int)(sdivz * z) + sadjust;
if (s > bbextents)
s = bbextents;
else if (s < 0)
s = 0;
t = (int)(tdivz * z) + tadjust;
if (t > bbextentt)
t = bbextentt;
else if (t < 0)
t = 0;
do
{
// calculate s and t at the far end of the span
spancount = count > 7 ? 8 : count; // mh
count -= spancount;
if (count)
{
// calculate s/z, t/z, zi->fixed s and t at far end of span,
// calculate s and t steps across span by shifting
sdivz += sdivz8stepu;
tdivz += tdivz8stepu;
zi += zi8stepu;
z = (float)0x10000 / zi; // prescale to 16.16 fixed-point
snext = (int)(sdivz * z) + sadjust;
if (snext > bbextents)
snext = bbextents;
else if (snext < 8)
snext = 8; // prevent round-off error on <0 steps from
// from causing overstepping & running off the
// edge of the texture
tnext = (int)(tdivz * z) + tadjust;
if (tnext > bbextentt)
tnext = bbextentt;
else if (tnext < 8)
tnext = 8; // guard against round-off error on <0 steps
sstep = (snext - s) >> 3;
tstep = (tnext - t) >> 3;
}
else
{
// calculate s/z, t/z, zi->fixed s and t at last pixel in span (so
// can't step off polygon), clamp, calculate s and t steps across
// span by division, biasing steps low so we don't run off the
// texture
spancountminus1 = (float)(spancount - 1);
sdivz += d_sdivzstepu * spancountminus1;
tdivz += d_tdivzstepu * spancountminus1;
zi += d_zistepu * spancountminus1;
z = (float)0x10000 / zi; // prescale to 16.16 fixed-point
snext = (int)(sdivz * z) + sadjust;
if (snext > bbextents)
snext = bbextents;
else if (snext < 8)
snext = 8; // prevent round-off error on <0 steps from
// from causing overstepping & running off the
// edge of the texture
tnext = (int)(tdivz * z) + tadjust;
if (tnext > bbextentt)
tnext = bbextentt;
else if (tnext < 8)
tnext = 8; // guard against round-off error on <0 steps
if (spancount > 1)
{
sstep = (snext - s) / (spancount - 1);
tstep = (tnext - t) / (spancount - 1);
}
}
if (foguse){ forg = (int)(z / 1024); if (forg > 32762) forg = 32762; } // leilei - fog
do
{
int idiths = s;
int iditht = t;
int X = (pspan->u + spancount) & 1;
int Y = (pspan->v)&1;
idiths += kernel[X][Y][0];
iditht += kernel[X][Y][1];
idiths = idiths >> 16;
idiths = idiths ? idiths -1 : idiths;
iditht = iditht >> 16;
iditht = iditht ? iditht -1 : iditht;
// *pdest++ = transTable[*pbest++][*pbase + idiths + iditht * cachewidth];
*pdest++ = transTable[*(pbase + idiths + iditht * cachewidth)][*pbest];
// *pdest++ = transTable[*(pbase + idiths + iditht * cachewidth)][*pbest];
*pbest++;
s += sstep;
t += tstep;
} while (--spancount > 0);
s = snext;
t = tnext;
} while (count > 0);
} while ((pspan = pspan->pnext) != NULL);
}
#endif
/*
=============

View file

@ -902,12 +902,8 @@ void R_RenderPoly (msurface_t *fa, int clipflags)
r_polydesc.nearzi = r_nearzi;
r_polydesc.pcurrentface = fa;
r_polydesc.pverts = pverts;
// draw the polygon
D_DrawPoly ();
}
/*
================
R_ZDrawSubmodelPolys

View file

@ -505,88 +505,54 @@ void R_SetVrect (vrect_t *pvrectin, vrect_t *pvrect, int lineadj)
{
int h;
float size;
#ifdef SPLIT
int curplayer = cursplit = 2;
#endif
qboolean full = false;
if (scr_viewsize->value >= 100.0) {
size = 100.0;
full = true;
} else
size = scr_viewsize->value;
size = scr_viewsize->value > 100 ? 100 : scr_viewsize->value;
if (cl.intermission)
{
size = 100;
lineadj = 0;
}
size /= 100.0; // 2000-01-07 Border with viewsize 100 fix by Radix
if (!cl_sbar->value && full)
h = pvrectin->height;
else
h = pvrectin->height - lineadj;
if (full)
pvrect->width = pvrectin->width;
else
pvrect->width = pvrectin->width * size;
if (pvrect->width < 96)
{
size = 96.0 / pvrectin->width;
pvrect->width = 96; // min for icons
}
pvrect->width &= ~7;
pvrect->height = pvrectin->height * size;
if (cl_sbar->value || !full) {
if (pvrect->height > pvrectin->height - lineadj)
pvrect->height = pvrectin->height - lineadj;
} else
if (pvrect->height > pvrectin->height)
pvrect->height = pvrectin->height;
pvrect->height &= ~1;
pvrect->x = (pvrectin->width - pvrect->width)/2;
if (full)
pvrect->y = 0;
else
pvrect->y = (h - pvrect->height)/2;
{
if (lcd_x->value)
{
pvrect->y >>= 1;
pvrect->height >>= 1;
}
#ifdef SPLIT
if (curplayer == 1){
pvrect->y >>= 1;
pvrect->height >>= 1;
}
else if (curplayer == 2){
pvrect->y >>= 1;
pvrect->height >>= 1;
}
#endif
}
{
if (v_detail->value == 1)
{
pvrect->y >>= 1;
pvrect->height >>= 1;
}
if (v_detail->value == 2)
{
pvrect->x >>= 1;
pvrect->width >>= 1;
}
}
}
@ -1746,23 +1712,7 @@ int reflectpass; // leilei - water reflection
int waterinsight; // leilei - water pixel shader
vec3_t reflectorg; // leilei - water reflection
extern pixel_t *d_viewbuffer;
#ifdef WATERREFLECTIONS
extern pixel_t *d_reflectbuffer;
extern pixel_t *d_shadowbuffer;
#endif
void R_TransferReflectBuffer (void)
{
#ifdef WATERREFLECTIONS
int refem;
for (refem = 0; refem < (vid.width * vid.height); refem++){
//*d_reflectbuffer++ = (d_viewbuffer + refem);
d_reflectbuffer[refem] = d_viewbuffer[refem];
}
#endif
};
#ifdef EXPREND
int shadowpass;
@ -1847,7 +1797,7 @@ void R_RenderView_ (void)
#ifdef SPLIT
if (cursplit){
sb_lines = 0;
R_SetupFrameSplit ();
}
else
@ -1933,18 +1883,12 @@ if (!reflectpass)
if (r_dspeeds->value)
dp_time2 = Sys_FloatTime ();
// Manoel Kasimier - translucent water - begin
if (r_foundwater && !reflectpass)
{
r_drawwater = true;
R_EdgeDrawing ();
}
// Manoel Kasimier - translucent water - end
#ifdef WATERLOW
if(reflectpass)
D_CrapScreenReflection ();
#endif
if (!reflectpass)
if (amilow != r_virtualmode->value)
{

View file

@ -500,8 +500,8 @@ void R_SetupFrame (void)
}
else
{
R_SetVrect (&vrect, &r_refdef.vrect, (sb_what_lines / scalefactoid));
R_ViewChanged (&vrect, (sb_what_lines / scalefactoid), vid.aspect);
R_SetVrect (&vrect, &r_refdef.vrect, 0);
R_ViewChanged (&vrect, 0, vid.aspect);
}
}
@ -527,18 +527,9 @@ void R_SetupFrame (void)
vrect.width = (int)w;
vrect.height = (int)h;
if (reflectpass)
{
R_SetVrect (&vrect, &r_refdef.vrect, (h/(float)vid.height));
R_SetVrect (&vrect, &r_refdef.vrect, ((float)vid.height));
R_ViewChanged (&vrect, 0, vid.aspect * (h / w) * ((float)vid.width / (float)vid.height));
}else{
R_SetVrect (&vrect, &r_refdef.vrect, (int)((float)sb_lines * (h/(float)vid.height)));
R_ViewChanged (&vrect, (sb_what_lines / scalefactoid), vid.aspect * (h / w) * ((float)vid.width / (float)vid.height));
}
// R_ViewChanged (&vrect,
// (int)((float)(sb_what_lines / scalefactoid) * (h/(float)vid.height)),
// vid.aspect * (h / w) *
// ((float)vid.width / (float)vid.height));
}
}
else if(r_docrap > 1)
@ -557,8 +548,8 @@ void R_SetupFrame (void)
else
{
R_SetVrect (&vrect, &r_refdef.vrect,
(int)((float)sb_lines * ((float)vid.height)));
R_ViewChanged (&vrect, (sb_what_lines / scalefactoid), vid.aspect);
((float)vid.height));
R_ViewChanged (&vrect, 0, vid.aspect);
}
}
else
@ -582,67 +573,12 @@ void R_SetupFrame (void)
vrect.y = 0;
vrect.width = (int)w;
vrect.height = (int)h;
if (reflectpass){
R_SetVrect (&vrect, &r_refdef.vrect, (h/(float)vid.height));
R_ViewChanged (&vrect,
(h/(float)vid.height),
vid.aspect * (h / w) *
((float)vid.width / (float)vid.height));
}
else
{
R_SetVrect (&vrect, &r_refdef.vrect, (int)((float)sb_lines * (h/(float)vid.height)));
R_ViewChanged (&vrect,
(int)((float)(sb_what_lines / scalefactoid) * (h/(float)vid.height)),
vid.aspect * (h / w) * ((float)vid.width / (float)vid.height));
}
}
}
#ifdef WATERLOW
else if (reflectpass)
{
if ((vid.width <= vid.maxwarpwidth) &&
(vid.height <= vid.maxwarpheight))
{
vrect.x = 0;
vrect.y = 0;
vrect.width = vid.width;
vrect.height = vid.height;
R_SetVrect (&vrect, &r_refdef.vrect, (int)((float)sb_lines * ((float)vid.height)));
R_ViewChanged (&vrect, (sb_what_lines / scalefactoid), vid.aspect);
}
else
{
w = vid.width;
h = vid.height;
if (w > vid.maxwarpwidth)
{
h *= (float)vid.maxwarpwidth / w;
w = vid.maxwarpwidth;
}
if (h > vid.maxwarpheight)
{
h = vid.maxwarpheight;
w *= (float)vid.maxwarpheight / h;
}
vrect.x = 0;
vrect.y = 0;
vrect.width = (int)w;
vrect.height = (int)h;
R_SetVrect (&vrect, &r_refdef.vrect, (int)((float)sb_lines * (h/(float)vid.height)));
R_ViewChanged (&vrect,
(int)((float)(sb_what_lines / scalefactoid) * (h/(float)vid.height)),
vid.aspect * (h / w) *
((float)vid.width / (float)vid.height));
}
}
#endif
else
if (r_dowarp)
@ -656,10 +592,7 @@ void R_SetupFrame (void)
vrect.y = 0;
vrect.width = vid.width / dtail;
vrect.height = vid.height;
if (reflectpass)
R_ViewChanged (&vrect, 0, vid.aspect);
else
R_ViewChanged (&vrect, (sb_what_lines / scalefactoid), vid.aspect);
}
else
@ -684,16 +617,9 @@ void R_SetupFrame (void)
vrect.width = (int)w / dtail;
vrect.height = (int)h;
if (reflectpass)
R_ViewChanged (&vrect,
(h/(float)vid.height),
vid.aspect * (h / w) *
((float)vid.width / (float)vid.height));
else
R_ViewChanged (&vrect,
(int)((float)(sb_what_lines / scalefactoid) * (h/(float)vid.height)),
vid.aspect * (h / w) *
((float)vid.width / (float)vid.height));
vid.aspect * (h / w) * ((float)vid.width / (float)vid.height));
}
}
else
@ -703,13 +629,7 @@ void R_SetupFrame (void)
vrect.y = 0;
vrect.width = vid.width;
vrect.height = vid.height;
if (reflectpass)
R_ViewChanged (&vrect, 0, vid.aspect);
else
R_ViewChanged (&vrect, (sb_what_lines / scalefactoid), vid.aspect);
}
r_viewchanged = false;

View file

@ -479,6 +479,8 @@ void VID_Init (unsigned char *palette)
vid.height = 200;
vid.maxwarpwidth = WARP_WIDTH;
vid.maxwarpheight = WARP_HEIGHT;
vid.maxlowwidth = LOW_WIDTH;
vid.maxlowheight = LOW_HEIGHT;
vid.numpages = 2;
vid.colormap = host_colormap;
// vid.cbits = VID_CBITS;