move video_t to v_video.h, clean up

This commit is contained in:
Roman Fomin 2023-12-15 20:50:30 +07:00
parent 9921171a9d
commit 06e7a74f82
7 changed files with 37 additions and 45 deletions

View File

@ -18,17 +18,16 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "doomstat.h" #include "doomstat.h"
#include "doomkeys.h"
#include "st_stuff.h" #include "st_stuff.h"
#include "r_main.h" #include "r_main.h"
#include "r_things.h" #include "r_things.h"
#include "p_setup.h" #include "p_setup.h"
#include "p_maputl.h" #include "p_maputl.h"
#include "w_wad.h" #include "w_wad.h"
#include "i_video.h"
#include "v_video.h" #include "v_video.h"
#include "p_spec.h" #include "p_spec.h"
#include "am_map.h" #include "am_map.h"
#include "dstrings.h"
#include "d_deh.h" // Ty 03/27/98 - externalizations #include "d_deh.h" // Ty 03/27/98 - externalizations
#include "m_input.h" #include "m_input.h"
#include "m_menu.h" #include "m_menu.h"

View File

@ -77,12 +77,9 @@ typedef enum
// [FG] flashing disk icon // [FG] flashing disk icon
#define DISK_ICON_THRESHOLD (20 * 1024) #define DISK_ICON_THRESHOLD (20 * 1024)
// killough 2/8/98: MAX versions for maximum screen sizes
// allows us to avoid the overhead of dynamic allocation
// when multiple screen sizes are supported
#define SCREENWIDTH 320 #define SCREENWIDTH 320
#define SCREENHEIGHT 200 #define SCREENHEIGHT 200
#define NONWIDEWIDTH SCREENWIDTH // [crispy] non-widescreen SCREENWIDTH
// The maximum number of players, multiplayer/networking. // The maximum number of players, multiplayer/networking.
#define MAXPLAYERS 4 #define MAXPLAYERS 4

View File

@ -23,27 +23,6 @@
#include "doomtype.h" #include "doomtype.h"
#include "doomdef.h"
#include "tables.h"
#define NONWIDEWIDTH SCREENWIDTH // [crispy] non-widescreen SCREENWIDTH
typedef struct
{
int width;
int height;
int unscaledw;
int deltaw;
fixed_t xscale;
fixed_t yscale;
fixed_t xstep;
fixed_t ystep;
angle_t fov;
} video_t;
extern video_t video;
enum enum
{ {
@ -87,7 +66,7 @@ void I_ToggleVsync(void); // [JN] Calls native SDL vsync toggle
extern boolean use_vsync; // killough 2/8/98: controls whether vsync is called extern boolean use_vsync; // killough 2/8/98: controls whether vsync is called
extern boolean disk_icon; // killough 10/98 extern boolean disk_icon; // killough 10/98
extern int resolution_mode, default_resolution_mode; // killough 11/98 extern resolution_mode_t resolution_mode, default_resolution_mode;
extern boolean use_aspect; extern boolean use_aspect;
extern boolean uncapped, default_uncapped; // [FG] uncapped rendering frame rate extern boolean uncapped, default_uncapped; // [FG] uncapped rendering frame rate

View File

@ -25,6 +25,7 @@
#include "r_segs.h" #include "r_segs.h"
#include "r_plane.h" #include "r_plane.h"
#include "r_things.h" #include "r_things.h"
#include "v_video.h"
seg_t *curline; seg_t *curline;
side_t *sidedef; side_t *sidedef;

View File

@ -27,10 +27,10 @@
#include "r_draw.h" #include "r_draw.h"
#include "r_sky.h" #include "r_sky.h"
#include "r_voxel.h" #include "r_voxel.h"
#include "i_video.h"
#include "v_video.h" #include "v_video.h"
#include "am_map.h" #include "am_map.h"
#include "st_stuff.h" #include "st_stuff.h"
#include "hu_stuff.h"
// Fineangles in the SCREENWIDTH wide window. // Fineangles in the SCREENWIDTH wide window.
#define FIELDOFVIEW 2048 #define FIELDOFVIEW 2048

View File

@ -31,7 +31,6 @@
// //
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
#include "i_video.h"
#include "z_zone.h" /* memory allocation wrappers -- killough */ #include "z_zone.h" /* memory allocation wrappers -- killough */
#include "doomstat.h" #include "doomstat.h"
@ -43,6 +42,7 @@
#include "r_plane.h" #include "r_plane.h"
#include "r_bmaps.h" // [crispy] R_BrightmapForTexName() #include "r_bmaps.h" // [crispy] R_BrightmapForTexName()
#include "r_swirl.h" // [crispy] R_DistortedFlat() #include "r_swirl.h" // [crispy] R_DistortedFlat()
#include "v_video.h"
#define MAXVISPLANES 128 /* must be a power of 2 */ #define MAXVISPLANES 128 /* must be a power of 2 */

View File

@ -25,7 +25,6 @@
#include "doomtype.h" #include "doomtype.h"
#include "doomdef.h" #include "doomdef.h"
#include "i_video.h"
// Needed because we are refering to patches. // Needed because we are refering to patches.
#include "r_data.h" #include "r_data.h"
@ -92,22 +91,39 @@ void V_InitColorTranslation(void);
typedef struct typedef struct
{ {
int x; // original x coordinate for upper left corner int width;
int y; // original y coordinate for upper left corner int height;
int w; // original width int unscaledw;
int h; // original height int deltaw;
int cx1; // clipped x coordinate for left edge fixed_t xscale;
int cx2; // clipped x coordinate for right edge fixed_t yscale;
int cy1; // clipped y coordinate for upper edge fixed_t xstep;
int cy2; // clipped y coordinate for lower edge fixed_t ystep;
int cw; // clipped width
int ch; // clipped height
int sx; // scaled x angle_t fov;
int sy; // scaled y } video_t;
int sw; // scaled width
int sh; // scaled height extern video_t video;
typedef struct
{
int x; // original x coordinate for upper left corner
int y; // original y coordinate for upper left corner
int w; // original width
int h; // original height
int cx1; // clipped x coordinate for left edge
int cx2; // clipped x coordinate for right edge
int cy1; // clipped y coordinate for upper edge
int cy2; // clipped y coordinate for lower edge
int cw; // clipped width
int ch; // clipped height
int sx; // scaled x
int sy; // scaled y
int sw; // scaled width
int sh; // scaled height
} vrect_t; } vrect_t;
void V_ScaleRect(vrect_t *rect); void V_ScaleRect(vrect_t *rect);