mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-30 04:30:43 +00:00
diff--; break;
This commit is contained in:
parent
2f5e0cf603
commit
663c58cd24
13 changed files with 126 additions and 136 deletions
|
@ -35,7 +35,8 @@
|
|||
#include "d_local.h"
|
||||
#include "r_local.h"
|
||||
|
||||
unsigned char *r_turb_pbase, *r_turb_pdest;
|
||||
byte *r_turb_pbase;
|
||||
byte *r_turb_pdest;
|
||||
fixed16_t r_turb_s, r_turb_t, r_turb_sstep, r_turb_tstep;
|
||||
int *r_turb_turb;
|
||||
int r_turb_spancount;
|
||||
|
@ -131,15 +132,15 @@ Turbulent (espan_t *pspan)
|
|||
r_turb_sstep = 0; // keep compiler happy
|
||||
r_turb_tstep = 0; // ditto
|
||||
|
||||
r_turb_pbase = (unsigned char *) cacheblock;
|
||||
r_turb_pbase = (byte *) cacheblock;
|
||||
|
||||
sdivz16stepu = d_sdivzstepu * 16;
|
||||
tdivz16stepu = d_tdivzstepu * 16;
|
||||
zi16stepu = d_zistepu * 16;
|
||||
|
||||
do {
|
||||
r_turb_pdest = (unsigned char *) ((byte *) d_viewbuffer +
|
||||
(screenwidth * pspan->v) + pspan->u);
|
||||
r_turb_pdest = (byte *) d_viewbuffer + (screenwidth * pspan->v) +
|
||||
pspan->u;
|
||||
|
||||
count = pspan->count;
|
||||
|
||||
|
@ -381,8 +382,8 @@ D_DrawZSpans (espan_t *pspan)
|
|||
double zi;
|
||||
float du, dv;
|
||||
|
||||
// FIXME: check for clamping/range problems
|
||||
// we count on FP exceptions being turned off to avoid range problems
|
||||
// FIXME: check for clamping/range problems
|
||||
// we count on FP exceptions being turned off to avoid range problems
|
||||
izistep = (int) (d_zistepu * 0x8000 * 0x10000);
|
||||
|
||||
do {
|
||||
|
|
|
@ -59,8 +59,7 @@ D_Sky_uv_To_st (int u, int v, fixed16_t *s, fixed16_t *t)
|
|||
end[2] *= 3;
|
||||
VectorNormalize (end);
|
||||
|
||||
temp = skytime * skyspeed; // TODO: add D_SetupFrame & set this
|
||||
// there
|
||||
temp = skytime * skyspeed; // TODO: add D_SetupFrame & set this there
|
||||
*s = (int) ((temp + 6 * (SKYSIZE / 2 - 1) * end[0]) * 0x10000);
|
||||
*t = (int) ((temp + 6 * (SKYSIZE / 2 - 1) * end[1]) * 0x10000);
|
||||
}
|
||||
|
|
|
@ -402,7 +402,7 @@ D_DrawSprite (void)
|
|||
|
||||
cachewidth = r_spritedesc.pspriteframe->width;
|
||||
sprite_height = r_spritedesc.pspriteframe->height;
|
||||
cacheblock = (byte *) & r_spritedesc.pspriteframe->pixels[0];
|
||||
cacheblock = &r_spritedesc.pspriteframe->pixels[0];
|
||||
|
||||
// copy the first vertex to the last vertex, so we don't have to deal with
|
||||
// wrapping
|
||||
|
|
|
@ -104,7 +104,7 @@ void
|
|||
D_InitCaches (void *buffer, int size)
|
||||
{
|
||||
// if (!msg_suppress_1)
|
||||
// Con_Printf ("%ik surface cache\n", size/1024);
|
||||
// Con_Printf ("%ik surface cache\n", size/1024);
|
||||
|
||||
sc_size = size - GUARDSIZE;
|
||||
sc_base = (surfcache_t *) buffer;
|
||||
|
@ -293,9 +293,8 @@ D_CacheSurface (msurface_t *surface, int miplevel)
|
|||
r_drawsurf.surfheight = surface->extents[1] >> miplevel;
|
||||
|
||||
// allocate memory if needed
|
||||
if (!cache) // if a texture just animated, don't
|
||||
// reallocate it
|
||||
{
|
||||
if (!cache) {
|
||||
// if a texture just animated, don't reallocate it
|
||||
cache = D_SCAlloc (r_drawsurf.surfwidth,
|
||||
r_drawsurf.surfwidth * r_drawsurf.surfheight);
|
||||
surface->cachespots[miplevel] = cache;
|
||||
|
|
|
@ -80,11 +80,6 @@ Draw_PicFromWad (const char *name)
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
Draw_ClearCache
|
||||
|
||||
This is a no-op in software targets
|
||||
*/
|
||||
void
|
||||
Draw_ClearCache (void)
|
||||
{
|
||||
|
@ -207,7 +202,7 @@ Draw_Character (int x, int y, int num)
|
|||
{
|
||||
byte *dest;
|
||||
byte *source;
|
||||
unsigned short *pusdest;
|
||||
byte *pusdest;
|
||||
int drawline;
|
||||
int row, col;
|
||||
|
||||
|
@ -258,7 +253,7 @@ Draw_Character (int x, int y, int num)
|
|||
}
|
||||
} else {
|
||||
// FIXME: pre-expand to native format?
|
||||
pusdest = (unsigned short *)
|
||||
pusdest = (byte *)
|
||||
((byte *) vid.conbuffer + y * vid.conrowbytes + (x << 1));
|
||||
|
||||
while (drawline--) {
|
||||
|
@ -290,8 +285,7 @@ void
|
|||
Draw_String (int x, int y, const char *str)
|
||||
{
|
||||
while (*str) {
|
||||
Draw_Character (x, y, *str);
|
||||
str++;
|
||||
Draw_Character (x, y, *str++);
|
||||
x += 8;
|
||||
}
|
||||
}
|
||||
|
@ -301,8 +295,7 @@ void
|
|||
Draw_AltString (int x, int y, const char *str)
|
||||
{
|
||||
while (*str) {
|
||||
Draw_Character (x, y, (*str) | 0x80);
|
||||
str++;
|
||||
Draw_Character (x, y, (*str++) | 0x80);
|
||||
x += 8;
|
||||
}
|
||||
}
|
||||
|
@ -312,14 +305,14 @@ void
|
|||
Draw_Pixel (int x, int y, byte color)
|
||||
{
|
||||
byte *dest;
|
||||
unsigned short *pusdest;
|
||||
byte *pusdest;
|
||||
|
||||
if (r_pixbytes == 1) {
|
||||
dest = vid.conbuffer + y * vid.conrowbytes + x;
|
||||
*dest = color;
|
||||
} else {
|
||||
// FIXME: pre-expand to native format?
|
||||
pusdest = (unsigned short *)
|
||||
pusdest = (byte *)
|
||||
((byte *) vid.conbuffer + y * vid.conrowbytes + (x << 1));
|
||||
*pusdest = d_8to16table[color];
|
||||
}
|
||||
|
@ -357,7 +350,7 @@ void
|
|||
Draw_Pic (int x, int y, qpic_t *pic)
|
||||
{
|
||||
byte *dest, *source, tbyte;
|
||||
unsigned short *pusdest;
|
||||
byte *pusdest;
|
||||
int v, u;
|
||||
|
||||
if (x < 0 || (unsigned int) (x + pic->width) > vid.width || y < 0 ||
|
||||
|
@ -405,7 +398,7 @@ Draw_Pic (int x, int y, qpic_t *pic)
|
|||
}
|
||||
} else {
|
||||
// FIXME: pretranslate at load time?
|
||||
pusdest = (unsigned short *) vid.buffer + y * (vid.rowbytes >> 1) + x;
|
||||
pusdest = (byte *) vid.buffer + y * (vid.rowbytes >> 1) + x;
|
||||
|
||||
for (v = 0; v < pic->height; v++) {
|
||||
for (u = 0; u < pic->width; u++) {
|
||||
|
@ -428,12 +421,12 @@ Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width,
|
|||
int height)
|
||||
{
|
||||
byte *dest, *source;
|
||||
unsigned short *pusdest;
|
||||
byte *pusdest;
|
||||
int v, u;
|
||||
|
||||
if ((x < 0) ||
|
||||
(x + width > vid.width) || (y < 0) || (y + height > vid.height)) {
|
||||
Sys_Error ("Draw_Pic: bad coordinates");
|
||||
Sys_Error ("Draw_SubPic: bad coordinates");
|
||||
}
|
||||
|
||||
source = pic->data + srcy * pic->width + srcx;
|
||||
|
@ -448,7 +441,7 @@ Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width,
|
|||
}
|
||||
} else {
|
||||
// FIXME: pretranslate at load time?
|
||||
pusdest = (unsigned short *) vid.buffer + y * (vid.rowbytes >> 1) + x;
|
||||
pusdest = (byte *) vid.buffer + y * (vid.rowbytes >> 1) + x;
|
||||
|
||||
for (v = 0; v < height; v++) {
|
||||
for (u = srcx; u < (srcx + width); u++) {
|
||||
|
@ -466,7 +459,7 @@ void
|
|||
Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte * translation)
|
||||
{
|
||||
byte *dest, *source, tbyte;
|
||||
unsigned short *pusdest;
|
||||
byte *pusdest;
|
||||
int v, u;
|
||||
|
||||
if (x < 0 || (unsigned int) (x + pic->width) > vid.width || y < 0 ||
|
||||
|
@ -514,7 +507,7 @@ Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte * translation)
|
|||
}
|
||||
} else {
|
||||
// FIXME: pretranslate at load time?
|
||||
pusdest = (unsigned short *) vid.buffer + y * (vid.rowbytes >> 1) + x;
|
||||
pusdest = (byte *) vid.buffer + y * (vid.rowbytes >> 1) + x;
|
||||
|
||||
for (v = 0; v < pic->height; v++) {
|
||||
for (u = 0; u < pic->width; u++) {
|
||||
|
@ -537,7 +530,7 @@ Draw_ConsoleBackground (int lines)
|
|||
{
|
||||
int x, y, v;
|
||||
byte *src, *dest;
|
||||
unsigned short *pusdest;
|
||||
byte *pusdest;
|
||||
int f, fstep;
|
||||
qpic_t *conback;
|
||||
|
||||
|
@ -568,7 +561,7 @@ Draw_ConsoleBackground (int lines)
|
|||
}
|
||||
}
|
||||
} else {
|
||||
pusdest = (unsigned short *) vid.conbuffer;
|
||||
pusdest = (byte *) vid.conbuffer;
|
||||
|
||||
for (y = 0; y < lines; y++, pusdest += (vid.conrowbytes >> 1)) {
|
||||
// FIXME: pre-expand to native format?
|
||||
|
@ -636,11 +629,11 @@ R_DrawRect16 (vrect_t *prect, int rowbytes, byte * psrc, int transparent)
|
|||
{
|
||||
byte t;
|
||||
int i, j, srcdelta, destdelta;
|
||||
unsigned short *pdest;
|
||||
byte *pdest;
|
||||
|
||||
// FIXME: would it be better to pre-expand native-format versions?
|
||||
|
||||
pdest = (unsigned short *) vid.buffer +
|
||||
pdest = (byte *) vid.buffer +
|
||||
(prect->y * (vid.rowbytes >> 1)) + prect->x;
|
||||
|
||||
srcdelta = rowbytes - prect->width;
|
||||
|
@ -752,7 +745,7 @@ void
|
|||
Draw_Fill (int x, int y, int w, int h, int c)
|
||||
{
|
||||
byte *dest;
|
||||
unsigned short *pusdest;
|
||||
byte *pusdest;
|
||||
unsigned int uc;
|
||||
int u, v;
|
||||
|
||||
|
@ -769,7 +762,7 @@ Draw_Fill (int x, int y, int w, int h, int c)
|
|||
} else {
|
||||
uc = d_8to16table[c];
|
||||
|
||||
pusdest = (unsigned short *) vid.buffer + y * (vid.rowbytes >> 1) + x;
|
||||
pusdest = (byte *) vid.buffer + y * (vid.rowbytes >> 1) + x;
|
||||
for (v = 0; v < h; v++, pusdest += (vid.rowbytes >> 1))
|
||||
for (u = 0; u < w; u++)
|
||||
pusdest[u] = uc;
|
||||
|
@ -814,7 +807,6 @@ Draw_FadeScreen (void)
|
|||
void
|
||||
Draw_BeginDisc (void)
|
||||
{
|
||||
|
||||
D_BeginDirectRect (vid.width - 24, 0, draw_disc->data, 24, 24);
|
||||
}
|
||||
|
||||
|
@ -828,6 +820,5 @@ Draw_BeginDisc (void)
|
|||
void
|
||||
Draw_EndDisc (void)
|
||||
{
|
||||
|
||||
D_EndDirectRect (vid.width - 24, 0, 24, 24);
|
||||
}
|
||||
|
|
|
@ -73,7 +73,6 @@
|
|||
required background clears
|
||||
required update regions
|
||||
|
||||
|
||||
syncronous draw mode or async
|
||||
One off screen buffer, with updates either copied or xblited
|
||||
Need to double buffer?
|
||||
|
@ -151,8 +150,8 @@ int scr_erase_center;
|
|||
/*
|
||||
SCR_CenterPrint
|
||||
|
||||
Called for important messages that should stay in the center of the
|
||||
screen for a few moments
|
||||
Called for important messages that should stay in the center of the screen
|
||||
for a few moments
|
||||
*/
|
||||
void
|
||||
SCR_CenterPrint (const char *str)
|
||||
|
@ -473,9 +472,6 @@ SCR_DrawFPS (int swap)
|
|||
lastframetime = t;
|
||||
}
|
||||
snprintf (st, sizeof (st), "%3d FPS", lastfps);
|
||||
/* Misty: New trick! (for me) the ? makes this work like a if then else -
|
||||
IE: if cl_hudswap->int_val is not null, do first case, else (else is a
|
||||
: here) do second case. Deek taught me this trick */
|
||||
if (show_time->int_val <= 0) {
|
||||
i = 8;
|
||||
} else if (show_time->int_val == 1) {
|
||||
|
@ -483,6 +479,9 @@ SCR_DrawFPS (int swap)
|
|||
} else {
|
||||
i = 80;
|
||||
}
|
||||
/* Misty: New trick! (for me) the ? makes this work like a if then else -
|
||||
IE: if cl_hudswap->int_val is not null, do first case, else (else is a
|
||||
: here) do second case. Deek taught me this trick */
|
||||
x = swap ? vid.width - ((strlen (st) * 8) + i) : i;
|
||||
y = vid.height - (sb_lines + 8);
|
||||
Draw_String (x, y, st);
|
||||
|
@ -590,7 +589,7 @@ SCR_DrawConsole (int swap)
|
|||
}
|
||||
|
||||
/*
|
||||
SCREEN SHOTS
|
||||
SCREEN SHOTS
|
||||
*/
|
||||
|
||||
tex_t *
|
||||
|
|
|
@ -279,8 +279,8 @@ Turbulent (espan_t *pspan)
|
|||
zi16stepu = d_zistepu * 16 * 65536;
|
||||
|
||||
do {
|
||||
r_turb_pdest = ((byte *) d_viewbuffer + ((screenwidth * pspan->v) +
|
||||
pspan->u) * r_pixbytes);
|
||||
r_turb_pdest = (byte *) d_viewbuffer + ((screenwidth * pspan->v) +
|
||||
pspan->u) * r_pixbytes;
|
||||
|
||||
count = pspan->count;
|
||||
|
||||
|
@ -342,12 +342,9 @@ Turbulent (espan_t *pspan)
|
|||
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
|
||||
// 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;
|
||||
|
@ -357,10 +354,9 @@ Turbulent (espan_t *pspan)
|
|||
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
|
||||
snext = 16; // prevent round-off error on <0 steps
|
||||
// from causing overstepping & running
|
||||
// off the edge of the texture
|
||||
|
||||
tnext = (int) (tdivz * z) + tadjust;
|
||||
if (tnext > bbextentt)
|
||||
|
|
|
@ -712,7 +712,7 @@ D_DrawSprite (void)
|
|||
|
||||
cachewidth = r_spritedesc.pspriteframe->width;
|
||||
sprite_height = r_spritedesc.pspriteframe->height;
|
||||
cacheblock = (void *) (&r_spritedesc.pspriteframe->pixels[0]);
|
||||
cacheblock = &r_spritedesc.pspriteframe->pixels[0];
|
||||
|
||||
// copy the first vertex to the last vertex, so we don't have to deal with
|
||||
// wrapping
|
||||
|
|
|
@ -47,12 +47,13 @@ surfcache_t *sc_rover, *sc_base;
|
|||
#define GUARDSIZE 4
|
||||
|
||||
|
||||
void *
|
||||
void *
|
||||
D_SurfaceCacheAddress (void)
|
||||
{
|
||||
return sc_base;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
D_SurfaceCacheForRes (int width, int height)
|
||||
{
|
||||
|
@ -74,6 +75,7 @@ D_SurfaceCacheForRes (int width, int height)
|
|||
return size;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
D_CheckCacheGuard (void)
|
||||
{
|
||||
|
@ -86,6 +88,7 @@ D_CheckCacheGuard (void)
|
|||
Sys_Error ("D_CheckCacheGuard: failed");
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
D_ClearCacheGuard (void)
|
||||
{
|
||||
|
@ -97,6 +100,7 @@ D_ClearCacheGuard (void)
|
|||
s[i] = (byte) i;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
D_InitCaches (void *buffer, int size)
|
||||
{
|
||||
|
@ -116,6 +120,7 @@ D_InitCaches (void *buffer, int size)
|
|||
D_ClearCacheGuard ();
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
D_FlushCaches (void)
|
||||
{
|
||||
|
@ -135,6 +140,7 @@ D_FlushCaches (void)
|
|||
sc_base->size = sc_size;
|
||||
}
|
||||
|
||||
|
||||
surfcache_t *
|
||||
D_SCAlloc (int width, int size)
|
||||
{
|
||||
|
@ -161,8 +167,9 @@ D_SCAlloc (int width, int size)
|
|||
wrapped_this_time = false;
|
||||
|
||||
if (!sc_rover || (byte *) sc_rover - (byte *) sc_base > sc_size - size) {
|
||||
if (sc_rover)
|
||||
if (sc_rover) {
|
||||
wrapped_this_time = true;
|
||||
}
|
||||
sc_rover = sc_base;
|
||||
}
|
||||
// colect and free surfcache_t blocks until the rover block is large enough
|
||||
|
@ -205,13 +212,15 @@ D_SCAlloc (int width, int size)
|
|||
if (d_roverwrapped) {
|
||||
if (wrapped_this_time || (sc_rover >= d_initial_rover))
|
||||
r_cache_thrash = true;
|
||||
} else if (wrapped_this_time)
|
||||
} else if (wrapped_this_time) {
|
||||
d_roverwrapped = true;
|
||||
}
|
||||
|
||||
D_CheckCacheGuard (); // DEBUG
|
||||
return new;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
D_SCDump (void)
|
||||
{
|
||||
|
@ -225,10 +234,8 @@ D_SCDump (void)
|
|||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
||||
// if the num is not a power of 2, assume it will not repeat
|
||||
|
||||
int
|
||||
MaskForNum (int num)
|
||||
{
|
||||
|
@ -243,6 +250,7 @@ MaskForNum (int num)
|
|||
return 255;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
D_log2 (int num)
|
||||
{
|
||||
|
@ -255,7 +263,6 @@ D_log2 (int num)
|
|||
return c;
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
||||
surfcache_t *
|
||||
D_CacheSurface (msurface_t *surface, int miplevel)
|
||||
|
@ -288,8 +295,8 @@ D_CacheSurface (msurface_t *surface, int miplevel)
|
|||
r_drawsurf.surfheight = surface->extents[1] >> miplevel;
|
||||
|
||||
// allocate memory if needed
|
||||
if (!cache) // if a texture just animated, don't reallocate it
|
||||
{
|
||||
if (!cache) {
|
||||
// if a texture just animated, don't reallocate it
|
||||
cache = D_SCAlloc (r_drawsurf.surfwidth,
|
||||
r_drawsurf.rowbytes * r_drawsurf.surfheight);
|
||||
surface->cachespots[miplevel] = cache;
|
||||
|
|
|
@ -46,9 +46,9 @@ float d_sdivzorigin, d_tdivzorigin, d_ziorigin;
|
|||
|
||||
fixed16_t sadjust, tadjust, bbextents, bbextentt;
|
||||
|
||||
void *cacheblock;
|
||||
byte *cacheblock;
|
||||
int cachewidth;
|
||||
void *d_viewbuffer;
|
||||
byte *d_viewbuffer;
|
||||
short *d_pzbuffer;
|
||||
unsigned int d_zrowbytes;
|
||||
unsigned int d_zwidth;
|
||||
|
|
|
@ -41,9 +41,10 @@
|
|||
#include "QF/draw.h"
|
||||
#include "QF/sound.h"
|
||||
#include "QF/sys.h"
|
||||
#include "QF/vfs.h"
|
||||
#include "QF/vfs.h"
|
||||
|
||||
#include "d_iface.h"
|
||||
#include "r_cvar.h"
|
||||
|
||||
typedef struct {
|
||||
vrect_t rect;
|
||||
|
@ -59,9 +60,8 @@ byte *draw_chars; // 8*8 graphic characters
|
|||
qpic_t *draw_disc;
|
||||
qpic_t *draw_backtile;
|
||||
|
||||
cvar_t *cl_verstring;
|
||||
|
||||
// Support Routines ===========================================================
|
||||
/* Support Routines */
|
||||
|
||||
typedef struct cachepic_s {
|
||||
char name[MAX_QPATH];
|
||||
|
@ -69,37 +69,38 @@ typedef struct cachepic_s {
|
|||
} cachepic_t;
|
||||
|
||||
#define MAX_CACHED_PICS 128
|
||||
cachepic_t menu_cachepics[MAX_CACHED_PICS];
|
||||
int menu_numcachepics;
|
||||
cachepic_t cachepics[MAX_CACHED_PICS];
|
||||
int numcachepics;
|
||||
|
||||
|
||||
qpic_t *
|
||||
qpic_t *
|
||||
Draw_PicFromWad (const char *name)
|
||||
{
|
||||
return W_GetLumpName (name);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Draw_ClearCache (void)
|
||||
{
|
||||
// This is a no-op in software targets
|
||||
}
|
||||
|
||||
qpic_t *
|
||||
|
||||
qpic_t *
|
||||
Draw_CachePic (const char *path, qboolean alpha)
|
||||
{
|
||||
cachepic_t *pic;
|
||||
int i;
|
||||
qpic_t *dat;
|
||||
|
||||
for (pic = menu_cachepics, i = 0; i < menu_numcachepics; pic++, i++)
|
||||
for (pic = cachepics, i = 0; i < numcachepics; pic++, i++)
|
||||
if (!strcmp (path, pic->name))
|
||||
break;
|
||||
|
||||
if (i == menu_numcachepics) {
|
||||
if (menu_numcachepics == MAX_CACHED_PICS)
|
||||
Sys_Error ("menu_numcachepics == MAX_CACHED_PICS");
|
||||
menu_numcachepics++;
|
||||
if (i == numcachepics) {
|
||||
if (numcachepics == MAX_CACHED_PICS)
|
||||
Sys_Error ("numcachepics == MAX_CACHED_PICS");
|
||||
numcachepics++;
|
||||
strcpy (pic->name, path);
|
||||
}
|
||||
|
||||
|
@ -121,6 +122,7 @@ Draw_CachePic (const char *path, qboolean alpha)
|
|||
return dat;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Draw_TextBox (int x, int y, int width, int lines)
|
||||
{
|
||||
|
@ -173,6 +175,7 @@ Draw_TextBox (int x, int y, int width, int lines)
|
|||
Draw_Pic (cx, cy + 8, p);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Draw_Init (void)
|
||||
{
|
||||
|
@ -186,6 +189,7 @@ Draw_Init (void)
|
|||
r_rectdesc.rowbytes = draw_backtile->width;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Draw_Character
|
||||
|
||||
|
@ -225,7 +229,7 @@ Draw_Character (int x, int y, int num)
|
|||
switch(r_pixbytes) {
|
||||
case 1:
|
||||
{
|
||||
byte *dest = (byte *) vid.conbuffer + y * vid.conrowbytes + x;
|
||||
byte *dest = (byte *) vid.conbuffer + y * vid.conrowbytes + x;
|
||||
|
||||
while (drawline--) {
|
||||
if (source[0])
|
||||
|
@ -319,6 +323,7 @@ Draw_String (int x, int y, const char *str)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Draw_AltString (int x, int y, const char *str)
|
||||
{
|
||||
|
@ -328,6 +333,7 @@ Draw_AltString (int x, int y, const char *str)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Draw_Pixel (int x, int y, byte color)
|
||||
{
|
||||
|
@ -349,6 +355,7 @@ Draw_Pixel (int x, int y, byte color)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Draw_Crosshair (int swap)
|
||||
{
|
||||
|
@ -370,11 +377,12 @@ Draw_Crosshair (int swap)
|
|||
Draw_Pixel (x, y + 3, c);
|
||||
} else if (crosshair->int_val)
|
||||
Draw_Character (scr_vrect.x + scr_vrect.width / 2 - 4 +
|
||||
cl_crossx->int_val,
|
||||
scr_vrect.y + scr_vrect.height / 2 - 4 +
|
||||
cl_crossy->int_val, '+');
|
||||
cl_crossx->int_val,
|
||||
scr_vrect.y + scr_vrect.height / 2 - 4 +
|
||||
cl_crossy->int_val, '+');
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Draw_Pic (int x, int y, qpic_t *pic)
|
||||
{
|
||||
|
@ -391,7 +399,7 @@ Draw_Pic (int x, int y, qpic_t *pic)
|
|||
switch(r_pixbytes) {
|
||||
case 1:
|
||||
{
|
||||
byte *dest = (byte *) vid.buffer + y * vid.rowbytes + x;
|
||||
byte *dest = (byte *) vid.buffer + y * vid.rowbytes + x;
|
||||
|
||||
if (pic->width & 7) { // general
|
||||
for (v = 0; v < pic->height; v++) {
|
||||
|
@ -465,11 +473,12 @@ Draw_Pic (int x, int y, qpic_t *pic)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width,
|
||||
int height)
|
||||
{
|
||||
byte *source;
|
||||
byte *source;
|
||||
int v, u;
|
||||
|
||||
if ((x < 0) ||
|
||||
|
@ -482,7 +491,7 @@ Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width,
|
|||
switch (r_pixbytes) {
|
||||
case 1:
|
||||
{
|
||||
byte *dest = (byte *) vid.buffer + y * vid.rowbytes + x;
|
||||
byte *dest = (byte *) vid.buffer + y * vid.rowbytes + x;
|
||||
|
||||
for (v = 0; v < height; v++) {
|
||||
memcpy (dest, source, width);
|
||||
|
@ -516,10 +525,11 @@ Draw_SubPic (int x, int y, qpic_t *pic, int srcx, int srcy, int width,
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte * translation)
|
||||
{
|
||||
byte *source, tbyte;
|
||||
byte *source, tbyte;
|
||||
int v, u;
|
||||
|
||||
if (x < 0 || (unsigned int) (x + pic->width) > vid.width || y < 0 ||
|
||||
|
@ -532,7 +542,7 @@ Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte * translation)
|
|||
switch(r_pixbytes) {
|
||||
case 1:
|
||||
{
|
||||
byte *dest = (byte *) vid.buffer + y * vid.rowbytes + x;
|
||||
byte *dest = (byte *) vid.buffer + y * vid.rowbytes + x;
|
||||
|
||||
if (pic->width & 7) { // general
|
||||
for (v = 0; v < pic->height; v++) {
|
||||
|
@ -605,6 +615,7 @@ Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte * translation)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Draw_ConsoleBackground (int lines)
|
||||
{
|
||||
|
@ -619,7 +630,7 @@ Draw_ConsoleBackground (int lines)
|
|||
switch(r_pixbytes) {
|
||||
case 1:
|
||||
{
|
||||
byte *dest = vid.conbuffer;
|
||||
byte *dest = vid.conbuffer;
|
||||
|
||||
for (y = 0; y < lines; y++, dest += vid.conrowbytes) {
|
||||
v = (vid.conheight - lines + y) * 200 / vid.conheight;
|
||||
|
@ -975,6 +986,7 @@ R_DrawRect (vrect_t *prect, int rowbytes, byte * psrc, int transparent)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Draw_TileClear
|
||||
|
||||
|
@ -1028,17 +1040,16 @@ Draw_TileClear (int x, int y, int w, int h)
|
|||
|
||||
vr.x += vr.width;
|
||||
width -= vr.width;
|
||||
tileoffsetx = 0; // only the left tile can be
|
||||
// left-clipped
|
||||
tileoffsetx = 0; // only the left tile can be left-clipped
|
||||
}
|
||||
|
||||
vr.y += vr.height;
|
||||
height -= vr.height;
|
||||
tileoffsety = 0; // only the top tile can be
|
||||
// top-clipped
|
||||
tileoffsety = 0; // only the top tile can be top-clipped
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Draw_Fill
|
||||
|
||||
|
@ -1057,7 +1068,7 @@ Draw_Fill (int x, int y, int w, int h, int c)
|
|||
switch (r_pixbytes) {
|
||||
case 1:
|
||||
{
|
||||
byte *dest = (byte *) vid.buffer + y * vid.rowbytes + x;
|
||||
byte *dest = (byte *) vid.buffer + y * vid.rowbytes + x;
|
||||
for (v = 0; v < h; v++, dest += vid.rowbytes)
|
||||
for (u = 0; u < w; u++)
|
||||
dest[u] = c;
|
||||
|
@ -1088,7 +1099,6 @@ Draw_Fill (int x, int y, int w, int h, int c)
|
|||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
||||
void
|
||||
Draw_FadeScreen (void)
|
||||
|
@ -1144,7 +1154,6 @@ Draw_FadeScreen (void)
|
|||
VID_LockBuffer ();
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
|
||||
/*
|
||||
Draw_BeginDisc
|
||||
|
@ -1158,6 +1167,7 @@ Draw_BeginDisc (void)
|
|||
D_BeginDirectRect (vid.width - 24, 0, draw_disc->data, 24, 24);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
Draw_EndDisc
|
||||
|
||||
|
|
|
@ -44,8 +44,8 @@
|
|||
#include "QF/draw.h"
|
||||
#include "QF/keys.h"
|
||||
#include "QF/pcx.h"
|
||||
#include "QF/render.h"
|
||||
#include "QF/screen.h"
|
||||
#include "QF/render.h"
|
||||
#include "QF/screen.h"
|
||||
#include "QF/sys.h"
|
||||
#include "QF/texture.h"
|
||||
#include "QF/vfs.h"
|
||||
|
@ -91,8 +91,7 @@
|
|||
net
|
||||
turn off messages option
|
||||
|
||||
the refresh is allways rendered, unless the console is full screen
|
||||
|
||||
the refresh is always rendered, unless the console is full screen
|
||||
|
||||
console is:
|
||||
notify lines
|
||||
|
@ -109,19 +108,6 @@ float scr_conlines; // lines of console to display
|
|||
|
||||
int oldscreensize, oldfov;
|
||||
int oldsbar;
|
||||
cvar_t *scr_viewsize;
|
||||
cvar_t *scr_fov; // 10 - 170
|
||||
cvar_t *scr_conspeed;
|
||||
cvar_t *scr_consize;
|
||||
cvar_t *scr_centertime;
|
||||
cvar_t *scr_showram;
|
||||
cvar_t *scr_showturtle;
|
||||
cvar_t *scr_showpause;
|
||||
cvar_t *scr_printspeed;
|
||||
cvar_t *crosshair;
|
||||
cvar_t *crosshaircolor;
|
||||
cvar_t *cl_crossx;
|
||||
cvar_t *cl_crossy;
|
||||
|
||||
qboolean scr_initialized; // ready to draw
|
||||
|
||||
|
@ -346,7 +332,7 @@ SCR_CalcRefdef (void)
|
|||
vrect.width = vid.width;
|
||||
vrect.height = vid.height;
|
||||
|
||||
R_SetVrect (&vrect, &scr_vrect, sb_lines);
|
||||
R_SetVrect (&vrect, &scr_vrect, r_lineadj);
|
||||
|
||||
// guard against going from one mode to another that's less than half the
|
||||
// vertical resolution
|
||||
|
@ -354,13 +340,13 @@ SCR_CalcRefdef (void)
|
|||
scr_con_current = vid.height;
|
||||
|
||||
// notify the refresh of the change
|
||||
R_ViewChanged (&vrect, sb_lines, vid.aspect);
|
||||
R_ViewChanged (&vrect, r_lineadj, vid.aspect);
|
||||
}
|
||||
|
||||
extern float v_blend[4];
|
||||
extern float v_blend[4];
|
||||
|
||||
void
|
||||
SCR_ApplyBlend (void)
|
||||
SCR_ApplyBlend (void) // Used to be V_UpdatePalette
|
||||
{
|
||||
int r, b, g, i;
|
||||
byte *basepal, *newpal;
|
||||
|
@ -661,6 +647,7 @@ SCR_DrawConsole (int swap)
|
|||
if (scr_con_current) {
|
||||
scr_copyeverything = 1;
|
||||
Con_DrawConsole (scr_con_current);
|
||||
Con_DrawDownload (scr_con_current);
|
||||
clearconsole = 0;
|
||||
} else {
|
||||
if (key_dest == key_game || key_dest == key_message)
|
||||
|
@ -669,7 +656,7 @@ SCR_DrawConsole (int swap)
|
|||
}
|
||||
|
||||
/*
|
||||
SCREEN SHOTS
|
||||
SCREEN SHOTS
|
||||
*/
|
||||
|
||||
tex_t *
|
||||
|
@ -681,9 +668,9 @@ SCR_ScreenShot (int width, int height)
|
|||
void
|
||||
SCR_ScreenShot_f (void)
|
||||
{
|
||||
char pcxname[MAX_OSPATH];
|
||||
pcx_t *pcx;
|
||||
int pcx_len;
|
||||
char pcxname[MAX_OSPATH];
|
||||
pcx_t *pcx;
|
||||
int pcx_len;
|
||||
|
||||
// find a file name to save it to
|
||||
if (!COM_NextFilename (pcxname, "qf", ".pcx")) {
|
||||
|
@ -717,7 +704,7 @@ SCR_ScreenShot_f (void)
|
|||
}
|
||||
|
||||
/*
|
||||
Find closest color in the palette for named color
|
||||
Find closest color in the palette for named color
|
||||
*/
|
||||
int
|
||||
MipColor (int r, int g, int b)
|
||||
|
@ -784,7 +771,7 @@ SCR_DrawCharToSnap (int num, byte * dest, int width)
|
|||
void
|
||||
SCR_DrawStringToSnap (const char *s, tex_t *tex, int x, int y)
|
||||
{
|
||||
byte *buf = tex->data;
|
||||
byte *buf = tex->data;
|
||||
byte *dest;
|
||||
const unsigned char *p;
|
||||
int width = tex->width;
|
||||
|
@ -849,7 +836,7 @@ void
|
|||
SCR_UpdateScreen (double realtime, SCR_Func *scr_funcs, int swap)
|
||||
{
|
||||
static int oldscr_viewsize;
|
||||
vrect_t vrect;
|
||||
vrect_t vrect;
|
||||
|
||||
if (scr_skipupdate || block_drawing)
|
||||
return;
|
||||
|
@ -898,6 +885,7 @@ SCR_UpdateScreen (double realtime, SCR_Func *scr_funcs, int swap)
|
|||
// do 3D refresh drawing, and then update the screen
|
||||
D_EnableBackBufferAccess (); // of all overlay stuff if drawing
|
||||
// directly
|
||||
|
||||
if (scr_fullupdate++ < vid.numpages) { // clear the entire screen
|
||||
scr_copyeverything = 1;
|
||||
Draw_TileClear (0, 0, vid.width, vid.height);
|
||||
|
@ -916,6 +904,7 @@ SCR_UpdateScreen (double realtime, SCR_Func *scr_funcs, int swap)
|
|||
|
||||
D_EnableBackBufferAccess (); // of all overlay stuff if drawing
|
||||
// directly
|
||||
|
||||
if (r_force_fullscreen /*FIXME*/ == 1 && key_dest == key_game) {
|
||||
Sbar_IntermissionOverlay ();
|
||||
} else if (r_force_fullscreen /*FIXME*/ == 2 && key_dest == key_game) {
|
||||
|
@ -963,10 +952,3 @@ SCR_UpdateScreen (double realtime, SCR_Func *scr_funcs, int swap)
|
|||
VID_Update (&vrect);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
VID_ShiftPalette (unsigned char *p)
|
||||
{
|
||||
VID_SetPalette (p);
|
||||
}
|
||||
|
||||
|
|
|
@ -261,3 +261,9 @@ VID_InitBuffers (void)
|
|||
if (vid.init_caches)
|
||||
vid.init_caches (vid.surfcache, cachesize);
|
||||
}
|
||||
|
||||
void
|
||||
VID_ShiftPalette (unsigned char *p)
|
||||
{
|
||||
VID_SetPalette (p);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue