mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2025-01-18 06:51:47 +00:00
Legibility. Whitespace. Stuff like that.
This commit is contained in:
parent
e381d2a0fc
commit
4b32916298
1 changed files with 17 additions and 20 deletions
|
@ -43,7 +43,7 @@ static const char rcsid[] =
|
||||||
#ifdef HAVE_UNISTD_H
|
#ifdef HAVE_UNISTD_H
|
||||||
# include <unistd.h>
|
# include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
#if defined(HAVE_SYS_IO_H)
|
#ifdef HAVE_SYS_IO_H
|
||||||
# include <sys/io.h>
|
# include <sys/io.h>
|
||||||
#elif defined(HAVE_ASM_IO_H)
|
#elif defined(HAVE_ASM_IO_H)
|
||||||
# include <asm/io.h>
|
# include <asm/io.h>
|
||||||
|
@ -67,6 +67,8 @@ static int num_modes, current_mode;
|
||||||
static vga_modeinfo *modes;
|
static vga_modeinfo *modes;
|
||||||
|
|
||||||
static byte vid_current_palette[768];
|
static byte vid_current_palette[768];
|
||||||
|
static byte backingbuf[48 * 24];
|
||||||
|
static char *framebuffer_ptr;
|
||||||
|
|
||||||
static int svgalib_inited = 0;
|
static int svgalib_inited = 0;
|
||||||
static int svgalib_backgrounded = 0;
|
static int svgalib_backgrounded = 0;
|
||||||
|
@ -74,20 +76,15 @@ static int svgalib_backgrounded = 0;
|
||||||
static cvar_t *vid_redrawfull;
|
static cvar_t *vid_redrawfull;
|
||||||
static cvar_t *vid_waitforrefresh;
|
static cvar_t *vid_waitforrefresh;
|
||||||
|
|
||||||
static char *framebuffer_ptr;
|
|
||||||
|
|
||||||
static byte backingbuf[48 * 24];
|
|
||||||
|
|
||||||
int VGA_width, VGA_height, VGA_rowbytes, VGA_bufferrowbytes, VGA_planar;
|
int VGA_width, VGA_height, VGA_rowbytes, VGA_bufferrowbytes, VGA_planar;
|
||||||
byte *VGA_pagebase;
|
byte *VGA_pagebase;
|
||||||
|
|
||||||
int VID_options_items = 0;
|
int VID_options_items = 0;
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
D_BeginDirectRect (int x, int y, byte * pbitmap, int width, int height)
|
D_BeginDirectRect (int x, int y, byte * pbitmap, int width, int height)
|
||||||
{
|
{
|
||||||
int i, j, k, plane, reps, repshift, offset, vidpage, off;
|
int plane, reps, repshift, offset, vidpage, off, i, j, k;
|
||||||
|
|
||||||
if (!svgalib_inited || !vid.direct || svgalib_backgrounded
|
if (!svgalib_inited || !vid.direct || svgalib_backgrounded
|
||||||
|| !vga_oktowrite ())
|
|| !vga_oktowrite ())
|
||||||
|
@ -144,7 +141,7 @@ D_BeginDirectRect (int x, int y, byte * pbitmap, int width, int height)
|
||||||
void
|
void
|
||||||
D_EndDirectRect (int x, int y, int width, int height)
|
D_EndDirectRect (int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
int i, j, k, plane, reps, repshift, offset, vidpage, off;
|
int plane, reps, repshift, offset, vidpage, off, i, j, k;
|
||||||
|
|
||||||
if (!svgalib_inited || !vid.direct || svgalib_backgrounded
|
if (!svgalib_inited || !vid.direct || svgalib_backgrounded
|
||||||
|| !vga_oktowrite ())
|
|| !vga_oktowrite ())
|
||||||
|
@ -223,13 +220,13 @@ get_mode (int width, int height, int depth)
|
||||||
{
|
{
|
||||||
int i, ok, match;
|
int i, ok, match;
|
||||||
|
|
||||||
match = (!!width) + (!!height) * 2 + (!!depth) * 4;
|
match = (!!depth) << 2 + (!!height) << 1 + (!!width);
|
||||||
|
|
||||||
for (i = 0; i < num_modes; i++) {
|
for (i = 0; i < num_modes; i++) {
|
||||||
if (modes[i].width) {
|
if (modes[i].width) {
|
||||||
ok = (modes[i].width == width)
|
ok = (modes[i].bytesperpixel == (depth / 8)) << 2
|
||||||
+ (modes[i].height == height) * 2
|
+ (modes[i].height == height) << 1
|
||||||
+ (modes[i].bytesperpixel == depth / 8) * 4;
|
+ (modes[i].width == width);
|
||||||
if ((ok & match) == match)
|
if ((ok & match) == match)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -305,7 +302,7 @@ VID_SetMode (int modenum, unsigned char *palette)
|
||||||
vid.rowbytes = modes[current_mode].linewidth * 4;
|
vid.rowbytes = modes[current_mode].linewidth * 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
vid.aspect = ((float) vid.height / (float) vid.width) * (320.0 / 240.0);
|
vid.aspect = ((float) vid.height / (float) vid.width) * (4.0 / 3.0);
|
||||||
vid.colormap8 = (byte *) vid_colormap;
|
vid.colormap8 = (byte *) vid_colormap;
|
||||||
vid.fullbright = 256 - LittleLong (*((int *) vid.colormap8 + 2048));
|
vid.fullbright = 256 - LittleLong (*((int *) vid.colormap8 + 2048));
|
||||||
vid.conrowbytes = vid.rowbytes;
|
vid.conrowbytes = vid.rowbytes;
|
||||||
|
|
Loading…
Reference in a new issue