move video definition to v_video.c, add comments

This commit is contained in:
Roman Fomin 2023-12-16 20:59:05 +07:00
parent 6a214d5b9c
commit f012f8f839
3 changed files with 14 additions and 14 deletions

View File

@ -46,8 +46,6 @@
#define ACTUALHEIGHT 240
video_t video;
resolution_mode_t resolution_mode, default_resolution_mode;
boolean use_vsync; // killough 2/8/98: controls whether vsync is called
@ -1033,11 +1031,6 @@ static void ResetResolution(int height)
video.fov = 2 * atan(video.unscaledw / (1.2 * SCREENHEIGHT) * 3 / 4) / M_PI * ANG180;
video.xscale = (video.width << FRACBITS) / video.unscaledw;
video.yscale = (video.height << FRACBITS) / SCREENHEIGHT;
video.xstep = ((video.unscaledw << FRACBITS) / video.width) + 1;
video.ystep = ((SCREENHEIGHT << FRACBITS) / video.height) + 1;
Z_FreeTag(PU_VALLOC);
V_Init();

View File

@ -282,6 +282,8 @@ void WriteGeneratedLumpWad(const char *filename)
free(lumps);
}
video_t video;
#define WIDE_SCREENWIDTH 576 // corresponds to 2.4 aspect ratio
static int x1lookup[WIDE_SCREENWIDTH + 1];
@ -970,6 +972,11 @@ void V_Init(void)
linesize = video.width;
video.xscale = (video.width << FRACBITS) / video.unscaledw;
video.yscale = (video.height << FRACBITS) / SCREENHEIGHT;
video.xstep = ((video.unscaledw << FRACBITS) / video.width) + 1;
video.ystep = ((SCREENHEIGHT << FRACBITS) / video.height) + 1;
x1lookup[0] = 0;
lastfrac = frac = 0;
for (i = 0; i < video.width; i++)

View File

@ -93,15 +93,15 @@ typedef struct
{
int width;
int height;
int unscaledw;
int deltaw;
int unscaledw; // unscaled width with correction for widecreen
int deltaw; // widescreen delta
fixed_t xscale;
fixed_t yscale;
fixed_t xstep;
fixed_t ystep;
fixed_t xscale; // x-axis scaling multiplier
fixed_t yscale; // y-axis scaling multiplier
fixed_t xstep; // x-axis scaling step
fixed_t ystep; // y-axis scaling step
angle_t fov;
angle_t fov; // widescreen FOV
} video_t;
extern video_t video;