diff --git a/TODO b/TODO index c25ae7a..f0411a6 100644 --- a/TODO +++ b/TODO @@ -1,2 +1,2 @@ - Cleanup of d_scan, d_polyse and d_surf -- Fixing up of coloured statusbars + diff --git a/engine/draw.c b/engine/draw.c index f7ca174..e73c783 100644 --- a/engine/draw.c +++ b/engine/draw.c @@ -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 ; vheight ; 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 ; vheight ; v++) - { - for (u=0 ; uwidth ; 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; + 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,106 +1985,51 @@ void Draw_TransPic (int x, int y, qpic_t *pic) } } -/* - -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); - 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) +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++) { - 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++) { - 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; + 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; diff --git a/engine/host_cmd.c b/engine/host_cmd.c index e7dba75..92021d3 100644 --- a/engine/host_cmd.c +++ b/engine/host_cmd.c @@ -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; + 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; - } + 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; - } + 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; - } + 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; } } diff --git a/engine/menu.c b/engine/menu.c index 5fa175e..b8d847f 100644 --- a/engine/menu.c +++ b/engine/menu.c @@ -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,20 +636,12 @@ 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) - Draw_Pic_Scaled (x + ((vid.vconwidth - 320)>>1), y, pic); + Draw_Pic_Scaled (x + ((vid.vconwidth - 320)>>1), y, pic); else - Draw_Pic (x + ((vid.width - 320)>>1), y, pic); + Draw_Pic (x + ((vid.width - 320)>>1), y, pic); } byte identityTable[256]; @@ -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; + 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,17 +1156,15 @@ 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; + + f = (int)(realtime * 10)%6; // 2001-10-20 TIMESCALE extension by Tomaz/Maddes end #ifdef QSB_NET // leilei - warn, because it most likely will not work. @@ -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 (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); - } + 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; + count = episodes[startepisode].levels; + if (startlevel < 0) startlevel = count - 1; @@ -5761,13 +5585,7 @@ 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) ); + 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 diff --git a/engine/model.c b/engine/model.c index d240236..757d395 100644 --- a/engine/model.c +++ b/engine/model.c @@ -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; } diff --git a/engine/sbar.c b/engine/sbar.c index ca095c4..eab1f23 100644 --- a/engine/sbar.c +++ b/engine/sbar.c @@ -48,50 +48,15 @@ qpic_t *sb_face_invis_invuln; qboolean sb_showscores; -int sb_lines; // scan lines to draw -int sb_what_lines; // scan lines to draw - -qpic_t *rsb_invbar[2]; -qpic_t *rsb_weapons[5]; -qpic_t *rsb_items[2]; -qpic_t *rsb_ammo[3]; -qpic_t *rsb_teambord; // PGM 01/19/97 - team color border - -//MED 01/04/97 added two more weapons + 3 alternates for grenade launcher -qpic_t *hsb_weapons[7][5]; // 0 is active, 1 is owned, 2-5 are flashes -//MED 01/04/97 added array to simplify weapon parsing -int hipweapons[4] = {HIT_LASER_CANNON_BIT,HIT_MJOLNIR_BIT,4,HIT_PROXIMITY_GUN_BIT}; -//MED 01/04/97 added hipnotic items array -qpic_t *hsb_items[2]; +cvar_t *hud_background, *hud_inv_background; +cvar_t *hud_health, *hud_health_posx, *hud_health_posy, *hud_health_icon; +cvar_t *hud_armor, *hud_armor_posx, *hud_armor_posy, *hud_armor_icon; +cvar_t *hud_ammo, *hud_ammo_posx, *hud_ammo_posy, *hud_ammo_icon; +cvar_t *hud_inv, *hud_inv_posx, *hud_inv_posy, *hud_inv_numbers; void Sbar_MiniDeathmatchOverlay (void); void Sbar_DeathmatchOverlay (void); void M_DrawPic (int x, int y, qpic_t *pic); -// -// Transfusion / Build hud -// - -qpic_t *hud_amo[2][10]; -qpic_t *hud_inv[2][10]; -qpic_t *hud_main; - - - -// leilei colors -extern byte menumap[256][16]; // leilei - for coloring the sbar (novelty) -int col_sbar = 16; -int col_ibar = 16; -int col_numbers = 16; // 16 disables colors. -int col_numbers_critical = 16; -int col_menu = 16; -int col_chars1 = 16; -int col_chars2 = 16; -int col_face = 16; -int col_light = 2; -int col_toremap = 1; // range of color to choose to remap (16 * i) -int col_toremap2 = 6; // range of color to choose to remap (16 * i) - - /* ============= Draw_SubPic @@ -127,48 +92,6 @@ void Draw_SubPic(int x, int y, qpic_t *pic, int srcx, int srcy, int width, int h } -/* -============= -Draw_SubPic - - void Draw_Pic_Scaled (int x, int y, qpic_t *pic) -{ - byte *source; - int v, u, s; - float vmax, umax; - - - 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; - } - } - -} - - -============= -*/ void Draw_SubPic_Scaled(int x, int y, qpic_t *pic, int srcx, int srcy, int width, int height) { byte *dest, *source; @@ -221,22 +144,6 @@ void Sbar_DrawSubPic(int x, int y, qpic_t *pic, int srcx, int srcy, int width, i } - - -// leilei - colorable status bar and stuff. -cvar_t *sbcolor_sbar; -cvar_t *sbcolor_ibar; -cvar_t *sbcolor_nums; -cvar_t *sbcolor_menu; -cvar_t *sbcolor_chars1; -cvar_t *sbcolor_chars2; -cvar_t *sbcolor_critnum; -cvar_t *sbcolor_face; -cvar_t *sbcolor_remap1; -cvar_t *sbcolor_remap2; - - - /* =============== Sbar_ShowScores @@ -266,17 +173,6 @@ void Sbar_DontShowScores (void) } -void Sbar_Colors (void) -{ -#ifndef linux // eukara - FIX ME, segfaults - // leilei - update - col_sbar = sbcolor_sbar->value; - col_ibar = sbcolor_ibar->value; - col_toremap = sbcolor_remap1->value; - col_toremap2 = sbcolor_remap2->value; -#endif -} - /* =============== Sbar_Changed @@ -284,12 +180,7 @@ Sbar_Changed */ void Sbar_Changed (void) { - - // use new colors now - Sbar_Colors(); - sb_updates = 0; // update next frame - } @@ -380,10 +271,6 @@ void Sbar_Init (void) sb_face_invis = Draw_PicFromWad ("face_invis"); sb_face_invuln = Draw_PicFromWad ("face_invul2"); sb_face_invis_invuln = Draw_PicFromWad ("face_inv2"); - - if (qbeta) - sb_face_quad = Draw_PicFromWad ("face5"); // beta doesn't have it - else sb_face_quad = Draw_PicFromWad ("face_quad"); Cmd_AddCommand ("+showscores", Sbar_ShowScores); @@ -393,19 +280,28 @@ void Sbar_Init (void) sb_ibar = Draw_PicFromWad ("ibar"); sb_scorebar = Draw_PicFromWad ("scorebar"); - // leilei - colorable 2d stuff - // also a reminder - 16 means DISABLED - sbcolor_sbar = Cvar_Get ("sb_colorsbar", "16", CVAR_ARCHIVE |CVAR_ORIGINAL); - sbcolor_ibar = Cvar_Get ("sb_coloribar", "16", CVAR_ARCHIVE |CVAR_ORIGINAL); - sbcolor_nums = Cvar_Get ("sb_colornums", "16", CVAR_ARCHIVE |CVAR_ORIGINAL); - sbcolor_menu = Cvar_Get ("sb_colormenu", "16", CVAR_ARCHIVE |CVAR_ORIGINAL); - sbcolor_chars1 = Cvar_Get ("sb_colorchars1", "16", CVAR_ARCHIVE |CVAR_ORIGINAL); - sbcolor_chars2 = Cvar_Get ("sb_colorchars2", "16", CVAR_ARCHIVE |CVAR_ORIGINAL); - sbcolor_critnum = Cvar_Get ("sb_colornumscrit", "16", CVAR_ARCHIVE |CVAR_ORIGINAL); - sbcolor_face = Cvar_Get ("sb_colorface", "16", CVAR_ARCHIVE |CVAR_ORIGINAL); - sbcolor_remap1 = Cvar_Get ("sb_colorremap1", "0", CVAR_ARCHIVE |CVAR_ORIGINAL); - sbcolor_remap2 = Cvar_Get ("sb_colorremap2", "0", CVAR_ARCHIVE |CVAR_ORIGINAL); + hud_health = Cvar_Get ("hud_health", "1", CVAR_ARCHIVE | CVAR_ORIGINAL); + hud_health_icon = Cvar_Get ("hud_health_icon", "1", CVAR_ARCHIVE | CVAR_ORIGINAL); + hud_health_posx = Cvar_Get ("hud_health_posx", "112", CVAR_ARCHIVE | CVAR_ORIGINAL); + hud_health_posy = Cvar_Get ("hud_health_posy", "0", CVAR_ARCHIVE | CVAR_ORIGINAL); + hud_armor = Cvar_Get ("hud_armor", "1", CVAR_ARCHIVE | CVAR_ORIGINAL); + hud_armor_icon = Cvar_Get ("hud_armor_icon", "1", CVAR_ARCHIVE | CVAR_ORIGINAL); + hud_armor_posx = Cvar_Get ("hud_armor_posx", "0", CVAR_ARCHIVE | CVAR_ORIGINAL); + hud_armor_posy = Cvar_Get ("hud_armor_posy", "0", CVAR_ARCHIVE | CVAR_ORIGINAL); + + hud_ammo = Cvar_Get ("hud_ammo", "1", CVAR_ARCHIVE | CVAR_ORIGINAL); + hud_ammo_icon = Cvar_Get ("hud_ammo_icon", "1", CVAR_ARCHIVE | CVAR_ORIGINAL); + hud_ammo_posx = Cvar_Get ("hud_ammo_posx", "224", CVAR_ARCHIVE | CVAR_ORIGINAL); + hud_ammo_posy = Cvar_Get ("hud_ammo_posy", "0", CVAR_ARCHIVE | CVAR_ORIGINAL); + + hud_inv = Cvar_Get ("hud_inv", "1", CVAR_ARCHIVE | CVAR_ORIGINAL); + hud_inv_numbers = Cvar_Get ("hud_inv_numbers", "1", CVAR_ARCHIVE | CVAR_ORIGINAL); + hud_inv_posx = Cvar_Get ("hud_inv_posx", "0", CVAR_ARCHIVE | CVAR_ORIGINAL); + hud_inv_posy = Cvar_Get ("hud_inv_posy", "-24", CVAR_ARCHIVE | CVAR_ORIGINAL); + + hud_background = Cvar_Get ("hud_background", "0", CVAR_ARCHIVE | CVAR_ORIGINAL); + hud_inv_background = Cvar_Get ("hud_inv_background", "0", CVAR_ARCHIVE | CVAR_ORIGINAL); } #endif @@ -418,64 +314,31 @@ void Sbar_Init (void) Sbar_DrawPic ============= */ -void Sbar_DrawPic (int x, int y, qpic_t *pic, int col) +void Sbar_DrawPic (int x, int y, qpic_t *pic) { - if (sb_scaled){ if (cl.gametype == GAME_DEATHMATCH) - Draw_Pic_Scaled_Color (x /* + ((vid.vconwidth - 320)>>1)*/, y + (vid.vconheight-SBAR_HEIGHT), pic, col); + x += ((vid.vconwidth - 320)>>1); + + y += (vid.vconheight-SBAR_HEIGHT); + + if (sb_scaled) + Draw_Pic_Scaled (x, y, pic); else - Draw_Pic_Scaled_Color (x + ((vid.vconwidth - 320)>>1), y + (vid.vconheight-SBAR_HEIGHT), pic, col); - } - else - { - if (cl.gametype == GAME_DEATHMATCH) - Draw_Pic (x /* + ((vid.width - 320)>>1)*/, y + (vid.height-SBAR_HEIGHT), pic); - else - Draw_Pic (x + ((vid.width - 320)>>1), y + (vid.height-SBAR_HEIGHT), pic); - } + Draw_Pic (x, y, pic); + } -/* -============= -Sbar_DrawTransPic -============= -*/ -void Sbar_DrawTransPic (int x, int y, qpic_t *pic) +void Sbar_DrawPicHalf (int x, int y, qpic_t *pic) { - if (sb_scaled){ if (cl.gametype == GAME_DEATHMATCH) - Draw_TransPic_Scaled (x /*+ ((vid.vconwidth - 320)>>1)*/, y + (vid.vconheight-SBAR_HEIGHT), pic); - else - Draw_TransPic_Scaled (x + ((vid.vconwidth - 320)>>1), y + (vid.vconheight-SBAR_HEIGHT), pic); - } - else - { - if (cl.gametype == GAME_DEATHMATCH) - Draw_TransPic (x /*+ ((vid.width - 320)>>1)*/, y + (vid.height-SBAR_HEIGHT), pic); - else - Draw_TransPic (x + ((vid.width - 320)>>1), y + (vid.height-SBAR_HEIGHT), pic); + x += ((vid.vconwidth - 320)>>1); - } + y += (vid.vconheight-SBAR_HEIGHT); -} - -void Sbar_DrawTransPicHalf (int x, int y, qpic_t *pic) -{ - if (sb_scaled){ - if (cl.gametype == GAME_DEATHMATCH) - Draw_TransPic_Scaled_Two (x /*+ ((vid.vconwidth - 320)>>1)*/, y + (vid.vconheight-SBAR_HEIGHT), pic, 2); + if (sb_scaled) + Draw_Pic_Scaled_Two (x, y, pic); else - Draw_TransPic_Scaled_Two (x + ((vid.vconwidth - 320)>>1), y + (vid.vconheight-SBAR_HEIGHT), pic, 2); - } - else - { - if (cl.gametype == GAME_DEATHMATCH) - Draw_TransPic (x /*+ ((vid.width - 320)>>1)*/, y + (vid.height-SBAR_HEIGHT), pic); - else - Draw_TransPic (x + ((vid.width - 320)>>1), y + (vid.height-SBAR_HEIGHT), pic); - - } - + Draw_Pic (x, y, pic); } @@ -588,8 +451,8 @@ void Sbar_DrawNum (int x, int y, int num, int digits, int color) else frame = *ptr -'0'; - //Sbar_DrawTransPic (x,y,sb_nums[color][frame]); - Sbar_DrawTransPic (x,y,sb_nums[color][frame]); + //Sbar_DrawPic (x,y,sb_nums[color][frame]); + Sbar_DrawPic (x,y,sb_nums[color][frame]); x += 24; ptr++; } @@ -732,30 +595,17 @@ Sbar_DrawInventory */ void Sbar_DrawInventory (void) { - int i; + int i; char num[6]; float time; - int flashon; + int flashon; -// qw - qboolean headsup; - qboolean hudswap; + if(!hud_inv->value) + return; - headsup = !(cl_sbar->value || scr_viewsize->value<100); - hudswap = cl_hudswap->value; // Get that nasty float out :) - - if (!headsup) - if (rogue) - { - if ( cl.stats[STAT_ACTIVEWEAPON] >= RIT_LAVA_NAILGUN ) - Sbar_DrawPic (0, -24, rsb_invbar[0], col_ibar); - else - Sbar_DrawPic (0, -24, rsb_invbar[1], col_ibar); - } - else - { - Sbar_DrawPic (0, -24, sb_ibar, col_ibar); - } + // Background + if(hud_inv_background->value) + Sbar_DrawPic (0, hud_inv_posy->value, sb_ibar); // weapons for (i=0 ; i<7 ; i++) @@ -774,112 +624,24 @@ void Sbar_DrawInventory (void) else flashon = (flashon%5) + 2; - if (headsup) { - if (i || vid.height>200) - Sbar_DrawSubPic ((hudswap) ? 0 : (vid.width-24),-68-(7-i)*16 , sb_weapons[flashon][i],0,0,24,16); - - } else - Sbar_DrawPic (i*24, -16, sb_weapons[flashon][i], col_ibar); + Sbar_DrawPic (i*24, hud_inv_posy->value+8, sb_weapons[flashon][i]); if (flashon > 1) sb_updates = 0; // force update to remove flash } } -// MED 01/04/97 -// hipnotic weapons - if (hipnotic) - { - int grenadeflashing=0; - for (i=0 ; i<4 ; i++) - { - if (cl.items & (1<= 10) - { - if ( cl.stats[STAT_ACTIVEWEAPON] == (1< 1) - sb_updates = 0; // force update to remove flash - } - } - } - - if (rogue) - { - // check for powered up weapon. - if ( cl.stats[STAT_ACTIVEWEAPON] >= RIT_LAVA_NAILGUN ) - { - for (i=0;i<5;i++) - { - if (cl.stats[STAT_ACTIVEWEAPON] == (RIT_LAVA_NAILGUN << i)) - { - Sbar_DrawPic ((i+2)*24, -16, rsb_weapons[i], col_ibar); - } - } - } - } - -// ammo counts + if(hud_inv_numbers->value) for (i=0 ; i<4 ; i++) { sprintf (num, "%3i",cl.stats[STAT_SHELLS+i] ); - if (headsup) { - Sbar_DrawSubPic((hudswap) ? 0 : (vid.width-42), -24 - (4-i)*11, sb_ibar, 3+(i*48), 0, 42, 11); - if (num[0] != ' ') - Sbar_DrawCharacter ( (hudswap) ? 3 : (vid.width-39), -24 - (4-i)*11, 18 + num[0] - '0'); - if (num[1] != ' ') - Sbar_DrawCharacter ( (hudswap) ? 11 : (vid.width-31), -24 - (4-i)*11, 18 + num[1] - '0'); - if (num[2] != ' ') - Sbar_DrawCharacter ( (hudswap) ? 19 : (vid.width-23), -24 - (4-i)*11, 18 + num[2] - '0'); - } - else - { if (num[0] != ' ') - Sbar_DrawCharacter ( (6*i+1)*8 - 2, -24, 18 + num[0] - '0'); + Sbar_DrawCharacter ( (6*i+1)*8 - 2, hud_inv_posy->value, 18 + num[0] - '0'); if (num[1] != ' ') - Sbar_DrawCharacter ( (6*i+2)*8 - 2, -24, 18 + num[1] - '0'); + Sbar_DrawCharacter ( (6*i+2)*8 - 2, hud_inv_posy->value, 18 + num[1] - '0'); if (num[2] != ' ') - Sbar_DrawCharacter ( (6*i+3)*8 - 2, -24, 18 + num[2] - '0'); - } + Sbar_DrawCharacter ( (6*i+3)*8 - 2, hud_inv_posy->value, 18 + num[2] - '0'); + } flashon = 0; @@ -895,77 +657,31 @@ void Sbar_DrawInventory (void) else { //MED 01/04/97 changed keys - if (!hipnotic || (i>1)) + if ((i>1)) { - Sbar_DrawPic (192 + i*16, -16, sb_items[i], col_ibar); + Sbar_DrawPic (192 + i*16, hud_inv_posy->value + 4, sb_items[i]); } } if (time && time > cl.time - 2) sb_updates = 0; } - //MED 01/04/97 added hipnotic items - // hipnotic items - if (hipnotic) - { - for (i=0 ; i<2 ; i++) - if (cl.items & (1<<(24+i))) - { - time = cl.item_gettime[24+i]; - if (time && time > cl.time - 2 && flashon ) - { // flash frame - sb_updates = 0; - } - else - { - Sbar_DrawPic (288 + i*16, -16, hsb_items[i], col_ibar); - } - if (time && time > cl.time - 2) - sb_updates = 0; - } - } - - if (rogue) - { - // new rogue items - for (i=0 ; i<2 ; i++) - { - if (cl.items & (1<<(29+i))) - { - time = cl.item_gettime[29+i]; - - if (time && time > cl.time - 2 && flashon ) - { // flash frame - sb_updates = 0; - } - else - { - Sbar_DrawPic (288 + i*16, -16, rsb_items[i], col_ibar); - } - - if (time && time > cl.time - 2) - sb_updates = 0; - } - } - } - else - { // sigils - for (i=0 ; i<4 ; i++) + for (i=0 ; i<4 ; i++) + { + if (cl.items & (1<<(28+i))) { - if (cl.items & (1<<(28+i))) - { - time = cl.item_gettime[28+i]; - if (time && time > cl.time - 2 && flashon ) - { // flash frame - sb_updates = 0; - } - else - Sbar_DrawPic (320-32 + i*8, -16, sb_sigil[i], col_ibar); - if (time && time > cl.time - 2) - sb_updates = 0; + time = cl.item_gettime[28+i]; + if (time && time > cl.time - 2 && flashon ) + { // flash frame + sb_updates = 0; } + else + Sbar_DrawPic (320-32 + i*8, hud_inv_posy->value + 4, sb_sigil[i]); + if (time && time > cl.time - 2) + sb_updates = 0; } } + } //============================================================================= @@ -1059,92 +775,26 @@ void Sbar_DrawFace (void) { int f, anim; -// PGM 01/19/97 - team color drawing -// PGM 03/02/97 - fixed so color swatch only appears in CTF modes - if (rogue && - (cl.maxclients != 1) && - (teamplay->value>3) && - (teamplay->value<7)) - { - int top, bottom; - int xofs; - char num[12]; - scoreboard_t *s; - - s = &cl.scores[cl.viewentity - 1]; - // draw background - top = s->colors & 0xf0; - bottom = (s->colors & 15)<<4; - top = Sbar_ColorForMap (top); - bottom = Sbar_ColorForMap (bottom); - - if (sb_scaled){ - if (cl.gametype == GAME_DEATHMATCH) - xofs = 113; - else - xofs = ((vid.vconwidth - 320)>>1) + 113; - - Sbar_DrawPic (112, 0, rsb_teambord, 16); - - Draw_Fill_Scaled (xofs, vid.vconheight-SBAR_HEIGHT+3, 22, 9, top); - Draw_Fill_Scaled (xofs, vid.vconheight-SBAR_HEIGHT+12, 22, 9, bottom); - } - else - { - if (cl.gametype == GAME_DEATHMATCH) - xofs = 113; - else - xofs = ((vid.width - 320)>>1) + 113; - - Sbar_DrawPic (112, 0, rsb_teambord, 16); - - Draw_Fill (xofs, vid.height-SBAR_HEIGHT+3, 22, 9, top); - Draw_Fill (xofs, vid.height-SBAR_HEIGHT+12, 22, 9, bottom); - } - - // draw number - f = s->frags; - sprintf (num, "%3i",f); - - if (top==8) - { - if (num[0] != ' ') - Sbar_DrawCharacter(109, 3, 18 + num[0] - '0'); - if (num[1] != ' ') - Sbar_DrawCharacter(116, 3, 18 + num[1] - '0'); - if (num[2] != ' ') - Sbar_DrawCharacter(123, 3, 18 + num[2] - '0'); - } - else - { - Sbar_DrawCharacter ( 109, 3, num[0]); - Sbar_DrawCharacter ( 116, 3, num[1]); - Sbar_DrawCharacter ( 123, 3, num[2]); - } - - return; - } -// PGM 01/19/97 - team color drawing if ( (cl.items & (IT_INVISIBILITY | IT_INVULNERABILITY) ) == (IT_INVISIBILITY | IT_INVULNERABILITY) ) { - Sbar_DrawPic (112, 0, sb_face_invis_invuln, col_face); + Sbar_DrawPic (hud_health_posx->value, hud_health_posy->value, sb_face_invis_invuln); return; } if (cl.items & IT_QUAD) { - Sbar_DrawPic (112, 0, sb_face_quad , col_face); + Sbar_DrawPic (hud_health_posx->value, hud_health_posy->value, sb_face_quad ); return; } if (cl.items & IT_INVISIBILITY) { - Sbar_DrawPic (112, 0, sb_face_invis , col_face); + Sbar_DrawPic (hud_health_posx->value, hud_health_posy->value, sb_face_invis ); return; } if (cl.items & IT_INVULNERABILITY) { - Sbar_DrawPic (112, 0, sb_face_invuln, col_face); + Sbar_DrawPic (hud_health_posx->value, hud_health_posy->value, sb_face_invuln); return; } @@ -1160,91 +810,9 @@ void Sbar_DrawFace (void) } else anim = 0; - Sbar_DrawPic (112, 0, sb_faces[f][anim], col_face); + Sbar_DrawPic (hud_health_posx->value, hud_health_posy->value, sb_faces[f][anim]); } -/* -=============== -Sbar_Draw -=============== -*/ -extern cvar_t *temp1; -void Sbar_Draw_Fight (void) -{ - int x, y; - - float health1_real; - float health1_regen; - - float health2_real; - float health2_regen; - - int healthbarwidth = 140; - - float healthbardiv = 0.56f; - - x = 12 + ((vid.vconwidth - 320)>>1); - - health1_real = cl.stats[STAT_SHELLS] * healthbardiv; - health1_regen = cl.stats[STAT_NAILS] * healthbardiv; - - health2_real = cl.stats[STAT_ROCKETS] * healthbardiv; - health2_regen = cl.stats[STAT_CELLS] * healthbardiv; - - - - - -// if (sb_updates >= vid.numpages) -// return; - - // Player 1 health // sb_ammo[0] - Draw_Fill_Scaled ( x, 32, health1_regen, 12, 77); - Draw_Fill_Scaled ( x, 32, health1_real, 12, 96); - - // Player 2 health - - x = 310 + ((vid.vconwidth - 320)>>1); - - Draw_Fill_Scaled ( x - health2_regen, 32, health2_regen, 12, 77); - Draw_Fill_Scaled ( x - health2_real, 32, health2_real, 12, 96); - -} - - -void Sbar_Draw_TFN (void) -{ - if (scr_con_current == vid.height) - return; // console is full screen - - if (sb_updates >= vid.numpages) - return; - - scr_copyeverything = 1; - - sb_updates++; - - if (sb_what_lines && vid.width > 320) - Draw_TileClear (0, vid.height - sb_what_lines, vid.width, sb_what_lines); - -if (sb_what_lines) - { - - //Sbar_DrawTransPic (444, 355, sb_sbar); - - } - - // face - // Sbar_DrawFace (); - - // health - // Sbar_DrawNum (136, 0, cl.stats[STAT_HEALTH], 3 - // , cl.stats[STAT_HEALTH] <= 25); - -} -# - - /* ============= Sbar_DrawNormal @@ -1252,87 +820,58 @@ Sbar_DrawNormal */ void Sbar_DrawNormal (void) { - if (cl_sbar->value || scr_viewsize->value<100) - Sbar_DrawPic (0, 0, sb_sbar, col_sbar); - - if (hipnotic) - { - if (cl.items & IT_KEY1) - Sbar_DrawPic (209, 3, sb_items[0], col_ibar); - if (cl.items & IT_KEY2) - Sbar_DrawPic (209, 12, sb_items[1], col_ibar); - } + // Background + if(hud_background->value) + Sbar_DrawPic (0, 0, sb_sbar); // armor + if(hud_armor->value) if (cl.items & IT_INVULNERABILITY) { - Sbar_DrawNum (24, 0, 666, 3, 1); - Sbar_DrawPic (0, 0, draw_disc, col_ibar); + Sbar_DrawNum (hud_armor_posx->value + 24, hud_armor_posy->value, 666, 3, 1); + + if(hud_armor_icon->value) + Sbar_DrawPic (hud_armor_posx->value, hud_armor_posy->value, draw_disc); } else { - if (rogue) - { - Sbar_DrawNum (24, 0, cl.stats[STAT_ARMOR], 3, - cl.stats[STAT_ARMOR] <= 25); - if (cl.items & RIT_ARMOR3) - Sbar_DrawPic (0, 0, sb_armor[2], col_ibar); - else if (cl.items & RIT_ARMOR2) - Sbar_DrawPic (0, 0, sb_armor[1], col_ibar); - else if (cl.items & RIT_ARMOR1) - Sbar_DrawPic (0, 0, sb_armor[0], col_ibar); - } - else - { - Sbar_DrawNum (24, 0, cl.stats[STAT_ARMOR], 3 + Sbar_DrawNum (hud_armor_posx->value + 24, hud_armor_posy->value, cl.stats[STAT_ARMOR], 3 , cl.stats[STAT_ARMOR] <= 25); + + if(hud_armor_icon->value) if (cl.items & IT_ARMOR3) - Sbar_DrawPic (0, 0, sb_armor[2], col_ibar); + Sbar_DrawPic (hud_armor_posx->value, hud_armor_posy->value, sb_armor[2]); else if (cl.items & IT_ARMOR2) - Sbar_DrawPic (0, 0, sb_armor[1], col_ibar); + Sbar_DrawPic (hud_armor_posx->value, hud_armor_posy->value, sb_armor[1]); else if (cl.items & IT_ARMOR1) - Sbar_DrawPic (0, 0, sb_armor[0], col_ibar); - } + Sbar_DrawPic (hud_armor_posx->value, hud_armor_posy->value, sb_armor[0]); } -// face - Sbar_DrawFace (); - -// health - Sbar_DrawNum (136, 0, cl.stats[STAT_HEALTH], 3 - , cl.stats[STAT_HEALTH] <= 25); + + if(hud_health->value) + { + if(hud_health_icon->value) + Sbar_DrawFace (); + + Sbar_DrawNum (hud_health_posx->value + 24, hud_health_posy->value, cl.stats[STAT_HEALTH], 3, cl.stats[STAT_HEALTH] <= 25); + } // ammo icon - if (rogue) - { - if (cl.items & RIT_SHELLS) - Sbar_DrawPic (224, 0, sb_ammo[0], col_sbar); - else if (cl.items & RIT_NAILS) - Sbar_DrawPic (224, 0, sb_ammo[1], col_sbar); - else if (cl.items & RIT_ROCKETS) - Sbar_DrawPic (224, 0, sb_ammo[2], col_sbar); - else if (cl.items & RIT_CELLS) - Sbar_DrawPic (224, 0, sb_ammo[3], col_sbar); - else if (cl.items & RIT_LAVA_NAILS) - Sbar_DrawPic (224, 0, rsb_ammo[0], col_sbar); - else if (cl.items & RIT_PLASMA_AMMO) - Sbar_DrawPic (224, 0, rsb_ammo[1], col_sbar); - else if (cl.items & RIT_MULTI_ROCKETS) - Sbar_DrawPic (224, 0, rsb_ammo[2], col_sbar); - } - else - { - if (cl.items & IT_SHELLS) - Sbar_DrawPic (224, 0, sb_ammo[0], col_sbar); - else if (cl.items & IT_NAILS) - Sbar_DrawPic (224, 0, sb_ammo[1], col_sbar); - else if (cl.items & IT_ROCKETS) - Sbar_DrawPic (224, 0, sb_ammo[2], col_sbar); - else if (cl.items & IT_CELLS) - Sbar_DrawPic (224, 0, sb_ammo[3], col_sbar); - } - Sbar_DrawNum (248, 0, cl.stats[STAT_AMMO], 3 - , cl.stats[STAT_AMMO] <= 10); + if(hud_ammo->value) + { + if(hud_ammo_icon->value) + if (cl.items & IT_SHELLS) + Sbar_DrawPic (hud_ammo_posx->value, hud_ammo_posy->value, sb_ammo[0]); + else if (cl.items & IT_NAILS) + Sbar_DrawPic (hud_ammo_posx->value, hud_ammo_posy->value, sb_ammo[1]); + else if (cl.items & IT_ROCKETS) + Sbar_DrawPic (hud_ammo_posx->value, hud_ammo_posy->value, sb_ammo[2]); + else if (cl.items & IT_CELLS) + Sbar_DrawPic (hud_ammo_posx->value, hud_ammo_posy->value, sb_ammo[3]); + + Sbar_DrawNum (hud_ammo_posx->value + 24, hud_ammo_posy->value, cl.stats[STAT_AMMO], 3 + , cl.stats[STAT_AMMO] <= 10); + } } @@ -1342,9 +881,6 @@ void Sbar_DrawNodrmal (void) qboolean headsup; char st[512]; - if (cl_sbar->value || scr_viewsize->value<100) - Sbar_DrawPic (0, 0, sb_sbar, col_sbar); - if (scr_con_current == vid.height) return; // console is full screen @@ -1356,65 +892,41 @@ void Sbar_DrawNodrmal (void) sb_updates++; - if (sb_lines && vid.width > 320) - Draw_TileClear (0, vid.height - sb_lines, vid.width, sb_lines); + if (vid.width > 320) + Draw_TileClear (0, vid.height - 24, vid.width, 24); - if (sb_lines > 24) - { - Sbar_DrawInventory (); - if (cl.maxclients != 1) - Sbar_DrawFrags (); - } + Sbar_DrawInventory (); + + if (cl.maxclients != 1) + Sbar_DrawFrags (); + if (sb_showscores || cl.stats[STAT_HEALTH] <= 0) { - Sbar_DrawPic (0, 0, sb_scorebar, col_sbar); + Sbar_DrawPic (0, 0, sb_scorebar); Sbar_DrawScoreboard (); sb_updates = 0; } - else if (sb_lines) + else { - Sbar_DrawPic (0, 0, sb_sbar, col_sbar); + Sbar_DrawPic (0, 0, sb_sbar); + - // keys (hipnotic only) - //MED 01/04/97 moved keys here so they would not be overwritten - if (hipnotic) - { - if (cl.items & IT_KEY1) - Sbar_DrawPic (209, 3, sb_items[0], col_ibar); - if (cl.items & IT_KEY2) - Sbar_DrawPic (209, 12, sb_items[1], col_ibar); - } // armor if (cl.items & IT_INVULNERABILITY) { Sbar_DrawNum (24, 0, 666, 3, 1); - Sbar_DrawPic (0, 0, draw_disc, col_sbar); + Sbar_DrawPic (0, 0, draw_disc); } else { - if (rogue) - { - Sbar_DrawNum (24, 0, cl.stats[STAT_ARMOR], 3, - cl.stats[STAT_ARMOR] <= 25); - if (cl.items & RIT_ARMOR3) - Sbar_DrawPic (0, 0, sb_armor[2], col_sbar); - else if (cl.items & RIT_ARMOR2) - Sbar_DrawPic (0, 0, sb_armor[1], col_sbar); - else if (cl.items & RIT_ARMOR1) - Sbar_DrawPic (0, 0, sb_armor[0], col_sbar); - } - else - { - Sbar_DrawNum (24, 0, cl.stats[STAT_ARMOR], 3 - , cl.stats[STAT_ARMOR] <= 25); - if (cl.items & IT_ARMOR3) - Sbar_DrawPic (0, 0, sb_armor[2], col_sbar); - else if (cl.items & IT_ARMOR2) - Sbar_DrawPic (0, 0, sb_armor[1], col_sbar); - else if (cl.items & IT_ARMOR1) - Sbar_DrawPic (0, 0, sb_armor[0], col_sbar); - } + Sbar_DrawNum (24, 0, cl.stats[STAT_ARMOR], 3, cl.stats[STAT_ARMOR] <= 25); + if (cl.items & IT_ARMOR3) + Sbar_DrawPic (0, 0, sb_armor[2]); + else if (cl.items & IT_ARMOR2) + Sbar_DrawPic (0, 0, sb_armor[1]); + else if (cl.items & IT_ARMOR1) + Sbar_DrawPic (0, 0, sb_armor[0]); } // face @@ -1425,35 +937,15 @@ void Sbar_DrawNodrmal (void) , cl.stats[STAT_HEALTH] <= 25); // ammo icon - if (rogue) - { - if (cl.items & RIT_SHELLS) - Sbar_DrawPic (224, 0, sb_ammo[0], col_sbar); - else if (cl.items & RIT_NAILS) - Sbar_DrawPic (224, 0, sb_ammo[1], col_sbar); - else if (cl.items & RIT_ROCKETS) - Sbar_DrawPic (224, 0, sb_ammo[2], col_sbar); - else if (cl.items & RIT_CELLS) - Sbar_DrawPic (224, 0, sb_ammo[3], col_sbar); - else if (cl.items & RIT_LAVA_NAILS) - Sbar_DrawPic (224, 0, rsb_ammo[0], col_sbar); - else if (cl.items & RIT_PLASMA_AMMO) - Sbar_DrawPic (224, 0, rsb_ammo[1], col_sbar); - else if (cl.items & RIT_MULTI_ROCKETS) - Sbar_DrawPic (224, 0, rsb_ammo[2], col_sbar); - } - else - { - if (cl.items & IT_SHELLS) - Sbar_DrawPic (224, 0, sb_ammo[0], col_sbar); - else if (cl.items & IT_NAILS) - Sbar_DrawPic (224, 0, sb_ammo[1], col_sbar); - else if (cl.items & IT_ROCKETS) - Sbar_DrawPic (224, 0, sb_ammo[2], col_sbar); - else if (cl.items & IT_CELLS) - Sbar_DrawPic (224, 0, sb_ammo[3], col_sbar); - } - + if (cl.items & IT_SHELLS) + Sbar_DrawPic (224, 0, sb_ammo[0]); + else if (cl.items & IT_NAILS) + Sbar_DrawPic (224, 0, sb_ammo[1]); + else if (cl.items & IT_ROCKETS) + Sbar_DrawPic (224, 0, sb_ammo[2]); + else if (cl.items & IT_CELLS) + Sbar_DrawPic (224, 0, sb_ammo[3]); + Sbar_DrawNum (248, 0, cl.stats[STAT_AMMO], 3, cl.stats[STAT_AMMO] <= 10); } @@ -1466,13 +958,13 @@ void Sbar_DrawNodrmal (void) void Sbar_Draw (void) { + if(!(cl_sbar->value)) + return; + qboolean headsup; char st[512]; - headsup = !(cl_sbar->value || scr_viewsize->value<100); - - - + headsup = !(cl_sbar->value); if (scr_con_current == vid.height) return; // console is full screen @@ -1485,29 +977,21 @@ void Sbar_Draw (void) sb_updates++; + Sbar_DrawInventory (); + if (cl.maxclients != 1) + Sbar_DrawFrags (); + -// top line - if (sb_lines > 24) - { - Sbar_DrawInventory (); - // if (!headsup || vid.width<512 || cl.maxclients != 1) - if (cl.maxclients != 1) - Sbar_DrawFrags (); - } - -// main area - if (sb_lines > 0) - { if (sb_showscores || cl.stats[STAT_HEALTH] <= 0) Sbar_SoloScoreboard (); else Sbar_DrawNormal (); - } + if (sb_showscores || cl.stats[STAT_HEALTH] <= 0) { - Sbar_DrawPic (0, 0, sb_scorebar, col_sbar); + Sbar_DrawPic (0, 0, sb_scorebar); Sbar_DrawScoreboard (); sb_updates = 0; } @@ -1546,7 +1030,7 @@ void Sbar_IntermissionNumber (int x, int y, int num, int digits, int color) else frame = *ptr -'0'; - Draw_TransPic (x,y,sb_nums[color][frame]); + Draw_Pic (x,y,sb_nums[color][frame]); x += 24; ptr++; } @@ -1579,7 +1063,7 @@ void Sbar_IntermissionNumber_Scaled (int x, int y, int num, int digits, int colo else frame = *ptr -'0'; - Draw_TransPic_Scaled (x,y,sb_nums[color][frame]); + Draw_Pic_Scaled (x,y,sb_nums[color][frame]); x += 24; ptr++; } @@ -1683,12 +1167,12 @@ void Sbar_MiniDeathmatchOverlay (void) int numlines; if (sb_scaled){ - if (vid.vconwidth < 512 || !sb_lines) + if (vid.vconwidth < 512) return; } else { - if (vid.width < 512 || !sb_lines) + if (vid.width < 512) return; } @@ -1699,8 +1183,8 @@ void Sbar_MiniDeathmatchOverlay (void) Sbar_SortFrags (); // draw the text - y = vid.vconheight - sb_lines; - numlines = sb_lines/8; + y = vid.vconheight - 24; + numlines = 24/8; if (numlines < 3) return; @@ -1809,22 +1293,22 @@ void Sbar_IntermissionOverlay (void) Draw_Pic_Scaled (64, 24, pic); pic = Draw_CachePic ("gfx/inter.lmp"); - Draw_TransPic_Scaled (0, 56, pic); + Draw_Pic_Scaled (0, 56, pic); // time dig = cl.completed_time/60; Sbar_IntermissionNumber_Scaled (160, 64, dig, 3, 0); num = cl.completed_time - dig*60; - Draw_TransPic_Scaled (234,64,sb_colon); - Draw_TransPic_Scaled (246,64,sb_nums[0][num/10]); - Draw_TransPic_Scaled (266,64,sb_nums[0][num%10]); + Draw_Pic_Scaled (234,64,sb_colon); + Draw_Pic_Scaled (246,64,sb_nums[0][num/10]); + Draw_Pic_Scaled (266,64,sb_nums[0][num%10]); Sbar_IntermissionNumber_Scaled (160, 104, cl.stats[STAT_SECRETS], 3, 0); - Draw_TransPic_Scaled (232,104,sb_slash); + Draw_Pic_Scaled (232,104,sb_slash); Sbar_IntermissionNumber_Scaled (240, 104, cl.stats[STAT_TOTALSECRETS], 3, 0); Sbar_IntermissionNumber_Scaled (160, 144, cl.stats[STAT_MONSTERS], 3, 0); - Draw_TransPic_Scaled (232,144,sb_slash); + Draw_Pic_Scaled (232,144,sb_slash); Sbar_IntermissionNumber_Scaled (240, 144, cl.stats[STAT_TOTALMONSTERS], 3, 0); } else @@ -1833,22 +1317,22 @@ void Sbar_IntermissionOverlay (void) Draw_Pic (64, 24, pic); pic = Draw_CachePic ("gfx/inter.lmp"); - Draw_TransPic (0, 56, pic); + Draw_Pic (0, 56, pic); // time dig = cl.completed_time/60; Sbar_IntermissionNumber (160, 64, dig, 3, 0); num = cl.completed_time - dig*60; - Draw_TransPic (234,64,sb_colon); - Draw_TransPic (246,64,sb_nums[0][num/10]); - Draw_TransPic (266,64,sb_nums[0][num%10]); + Draw_Pic (234,64,sb_colon); + Draw_Pic (246,64,sb_nums[0][num/10]); + Draw_Pic (266,64,sb_nums[0][num%10]); Sbar_IntermissionNumber (160, 104, cl.stats[STAT_SECRETS], 3, 0); - Draw_TransPic (232,104,sb_slash); + Draw_Pic (232,104,sb_slash); Sbar_IntermissionNumber (240, 104, cl.stats[STAT_TOTALSECRETS], 3, 0); Sbar_IntermissionNumber (160, 144, cl.stats[STAT_MONSTERS], 3, 0); - Draw_TransPic (232,144,sb_slash); + Draw_Pic (232,144,sb_slash); Sbar_IntermissionNumber (240, 144, cl.stats[STAT_TOTALMONSTERS], 3, 0); } @@ -1870,7 +1354,7 @@ void Sbar_FinaleOverlay (void) pic = Draw_CachePic ("gfx/finale.lmp"); if(sb_scaled) - Draw_TransPic_Scaled ( (vid.vconwidth-pic->width)/2, 16, pic); + Draw_Pic_Scaled ( (vid.vconwidth-pic->width)/2, 16, pic); else - Draw_TransPic ( (vid.width-pic->width)/2, 16, pic); + Draw_Pic ( (vid.width-pic->width)/2, 16, pic); } diff --git a/engine/screen.c b/engine/screen.c index c28d86e..fb250fd 100644 --- a/engine/screen.c +++ b/engine/screen.c @@ -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,13 +1421,8 @@ 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) + if (oldsbar != cl_sbar->value) { oldsbar = cl_sbar->value; vid.recalc_refdef = true; @@ -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); diff --git a/engine/sv_main.c b/engine/sv_main.c index e4d0d88..dbcba0c 100644 --- a/engine/sv_main.c +++ b/engine/sv_main.c @@ -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; } diff --git a/engine/view.c b/engine/view.c index 92ace2e..f86c35f 100644 --- a/engine/view.c +++ b/engine/view.c @@ -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->origin[2] += 1; 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; diff --git a/include/d_iface.h b/include/d_iface.h index f5d2d09..b0a41c3 100644 --- a/include/d_iface.h +++ b/include/d_iface.h @@ -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 diff --git a/include/draw.h b/include/draw.h index 4385d3f..c262a67 100644 --- a/include/draw.h +++ b/include/draw.h @@ -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,23 +56,13 @@ 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_ready; int rmap_models; int rmap_maps; int rmap_pics; int rmap_particles; -extern byte coltranslate[256]; // TranslateToCustomPal +extern byte coltranslate[256]; // TranslateToCustomPal diff --git a/include/globaldef.h b/include/globaldef.h index 8c7fca2..5fe3eb8 100644 --- a/include/globaldef.h +++ b/include/globaldef.h @@ -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<spans ; span ; span=span->pnext) { - p32dest = (unsigned int *)d_viewbuffer + screenwidth*span->v; + p32dest = (unsigned int *)d_viewbuffer + screenwidth * span->v; u = span->u; u2 = span->u + span->count - 1; p32dest[u] = pix; @@ -114,7 +97,7 @@ void D_DrawSolidSurface (surf_t *surf, int color) pix = vid.colormap16[color]; for (span=surf->spans ; span ; span=span->pnext) { - p16dest = (unsigned short *)d_viewbuffer + screenwidth*span->v; + p16dest = (unsigned short *)d_viewbuffer + screenwidth * span->v; u = span->u; u2 = span->u + span->count - 1; p16dest[u] = pix; @@ -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) } } } - diff --git a/renderer/d_fill.c b/renderer/d_fill.c index 810875f..48e02c6 100644 --- a/renderer/d_fill.c +++ b/renderer/d_fill.c @@ -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) } } } - diff --git a/renderer/d_init.c b/renderer/d_init.c index e3260e5..0987be3 100644 --- a/renderer/d_init.c +++ b/renderer/d_init.c @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "globaldef.h" #include "d_local.h" -#define NUM_MIPS 4 +#define NUM_MIPS 4 cvar_t *d_subdiv16; cvar_t *r_filter; @@ -32,17 +32,17 @@ cvar_t *d_mipdetail; cvar_t *r_wateralpha; float oldwateralpha; -float newwateralpha; // leilei - dirty hack to see if our values changed - // and if so, make a new translucency table! +float newwateralpha; // leilei - dirty hack to see if our values changed + // and if so, make a new translucency table! -surfcache_t *d_initial_rover; -qboolean d_roverwrapped; -int d_minmip; -float d_scalemip[NUM_MIPS-1]; +surfcache_t *d_initial_rover; +qboolean d_roverwrapped; +int d_minmip; +float d_scalemip[NUM_MIPS-1]; static float basemip[NUM_MIPS-1] = {1.0, 0.5*0.8, 0.25*0.8}; -extern int d_aflatcolor; +extern int d_aflatcolor; void (*d_drawspans) (espan_t *pspan); void (*d_fogspans) (espan_t *pspan); // leilei - alternate fogging method (to get along with the asm spans etc) @@ -67,8 +67,10 @@ void D_Init (void) r_drawpolys = false; r_worldpolysbacktofront = false; r_recursiveaffinetriangles = true; + if (!r_pixbytes) - r_pixbytes = 1; + 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) diff --git a/renderer/d_scan.c b/renderer/d_scan.c index fa6ead3..815b2b4 100644 --- a/renderer/d_scan.c +++ b/renderer/d_scan.c @@ -42,12 +42,12 @@ 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 wootel[32][32][32]; extern int reflectavailable; -int gonnareflect; // well are we gonna reflect or not? +int gonnareflect; // well are we gonna reflect or not? extern cvar_t *r_tranquality; extern cvar_t *r_wateralpha; @@ -76,33 +76,32 @@ void WaterTablgeGet (void) for (c=0 ; c<255 ; c++) { if (oldwaterblend == 1){ // additive - red = host_basepal[c*3] + (host_basepal[l*3] *ay); - green = host_basepal[c*3+1] + (host_basepal[l*3+1] *ay); - blue = host_basepal[c*3+2] + (host_basepal[l*3+2] *ay); + red = host_basepal[c*3] + (host_basepal[l*3] *ay); + green = host_basepal[c*3+1] + (host_basepal[l*3+1] *ay); + blue = host_basepal[c*3+2] + (host_basepal[l*3+2] *ay); } else if (oldwaterblend == 2){ // multiplicative - red = host_basepal[c*3] *ae + ((host_basepal[c*3] * (host_basepal[l*3] * 0.05)) * ay); - green = host_basepal[c*3+1] *ae + ((host_basepal[c*3+1]* (host_basepal[l*3+1] * 0.05)) * ay); - blue = host_basepal[c*3+2] *ae + ((host_basepal[c*3+2] * (host_basepal[l*3+2] * 0.05)) * ay); + red = host_basepal[c*3] *ae + ((host_basepal[c*3] * (host_basepal[l*3] * 0.05)) * ay); + green = host_basepal[c*3+1] *ae + ((host_basepal[c*3+1]* (host_basepal[l*3+1] * 0.05)) * ay); + 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); + 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); } else if (oldwaterblend == 5){ // weird alpha thing /* how it works - goes through each color row from transparent(0) to opaque (16) this would also be used for the future (can you say decals?) */ - red = host_basepal[c*3] *(fademap[l] * ae) + (host_basepal[l*3] * (fademap[l]+0.3 * ay)); - green = host_basepal[c*3+1] *(fademap[l] * ae) + (host_basepal[l*3+1] * (fademap[l]+0.3 * ay)); - blue = host_basepal[c*3+2] * (fademap[l] * ae) + (host_basepal[l*3+2] * (fademap[l]+0.3 * ay)); + red = host_basepal[c*3] *(fademap[l] * ae) + (host_basepal[l*3] * (fademap[l]+0.3 * ay)); + green = host_basepal[c*3+1] *(fademap[l] * ae) + (host_basepal[l*3+1] * (fademap[l]+0.3 * ay)); + blue = host_basepal[c*3+2] * (fademap[l] * ae) + (host_basepal[l*3+2] * (fademap[l]+0.3 * ay)); } else { - red = host_basepal[c*3] *ae + (host_basepal[l*3] * ay); - green = host_basepal[c*3+1] *ae + (host_basepal[l*3+1] * ay); - blue = host_basepal[c*3+2] *ae + (host_basepal[l*3+2] * ay); + red = host_basepal[c*3] *ae + (host_basepal[l*3] * ay); + green = host_basepal[c*3+1] *ae + (host_basepal[l*3+1] * ay); + blue = host_basepal[c*3+2] *ae + (host_basepal[l*3+2] * ay); } if (red > 255) red = 255; if (green > 255) green = 255; @@ -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 ; vvalue; -// 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,92 +505,22 @@ void D_DrawTurbulent8SpanAlpha (void) // Leilei - this is very simple. void D_DrawGelWaterSpan (void) { + do + { + if (*pz <= (izi >> 16)) + { + if (foguse) + *r_turb_pdest = foggmap[menumap[*r_turb_pdest][gmcol] + (ferg >> 2 & 0xFF00)]; + else + *r_turb_pdest = menumap[*r_turb_pdest][gmcol]; + } - - do - { - if (*pz <= (izi >> 16)) - { - if (foguse) - *r_turb_pdest = foggmap[menumap[*r_turb_pdest][gmcol] + (ferg >> 2 & 0xFF00)]; - else - *r_turb_pdest = menumap[*r_turb_pdest][gmcol]; - } - *r_turb_pdest++; - izi += izistep; - pz++; - } while (--r_turb_spancount > 0); - - + *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; @@ -747,43 +529,27 @@ void D_DrawGelWaterSpanRefractions (void) unsigned char temp, tempd2, tempd3, temp3, temp4; depthen = (depthen) >> 2; - do - { - if (*pz <= (izi >> 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 = transTable[*(r_turb_pdest + ((refracttturb) + refractsturb >> 2))][*(r_turb_pdest + ((refractsturb) + refracttturb >> 2))]; - temp3 = tempd3; - - + do + { + if (*pz <= (izi >> 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 = 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; - - - - - - - - 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); - - + } 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 - /* ============= diff --git a/renderer/r_draw.c b/renderer/r_draw.c index 17899ed..6f1a751 100644 --- a/renderer/r_draw.c +++ b/renderer/r_draw.c @@ -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 diff --git a/renderer/r_main.c b/renderer/r_main.c index 79c1605..08021a8 100644 --- a/renderer/r_main.c +++ b/renderer/r_main.c @@ -505,87 +505,53 @@ 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; + size = 100.0; + + 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; + + h = pvrectin->height; + + pvrect->width = pvrectin->width; + 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; + + 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; + pvrect->y = 0; + + if (lcd_x->value) { - 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 + pvrect->y >>= 1; + pvrect->height >>= 1; } - { - if (v_detail->value == 1) - { - pvrect->y >>= 1; - pvrect->height >>= 1; - } - if (v_detail->value == 2) - { - pvrect->x >>= 1; - pvrect->width >>= 1; - } + 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) { diff --git a/renderer/r_misc.c b/renderer/r_misc.c index 6a03cc1..c7c624e 100644 --- a/renderer/r_misc.c +++ b/renderer/r_misc.c @@ -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_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)), + (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)); + (h/(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; diff --git a/video/vid_x.c b/video/vid_x.c index ab6b0ff..240dca0 100644 --- a/video/vid_x.c +++ b/video/vid_x.c @@ -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;