| 1 |
// |
| 2 |
// Copyright(C) 2022 by Ryan Krafnick |
| 3 |
// |
| 4 |
// This program is free software; you can redistribute it and/or |
| 5 |
// modify it under the terms of the GNU General Public License |
| 6 |
// as published by the Free Software Foundation; either version 2 |
| 7 |
// of the License, or (at your option) any later version. |
| 8 |
// |
| 9 |
// This program is distributed in the hope that it will be useful, |
| 10 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
// GNU General Public License for more details. |
| 13 |
// |
| 14 |
// DESCRIPTION: |
| 15 |
// DSDA Stretch |
| 16 |
// |
| 17 |
|
| 18 |
#ifndef __DSDA_STRETCH__ |
| 19 |
#define __DSDA_STRETCH__ |
| 20 |
|
| 21 |
typedef struct |
| 22 |
{ |
| 23 |
fixed_t xstep; |
| 24 |
fixed_t ystep; |
| 25 |
int width, height; |
| 26 |
short x1lookup[321]; |
| 27 |
short y1lookup[201]; |
| 28 |
short x2lookup[321]; |
| 29 |
short y2lookup[201]; |
| 30 |
} cb_video_t; |
| 31 |
|
| 32 |
typedef struct stretch_param_s |
| 33 |
{ |
| 34 |
cb_video_t *video; |
| 35 |
int deltax1; |
| 36 |
int deltay1; |
| 37 |
int deltax2; |
| 38 |
int deltay2; |
| 39 |
} stretch_param_t; |
| 40 |
|
| 41 |
typedef enum |
| 42 |
{ |
| 43 |
patch_stretch_not_adjusted, |
| 44 |
patch_stretch_doom_format, |
| 45 |
patch_stretch_fit_to_width, |
| 46 |
|
| 47 |
patch_stretch_max_config, |
| 48 |
|
| 49 |
patch_stretch_ex_text = patch_stretch_max_config, |
| 50 |
|
| 51 |
patch_stretch_max |
| 52 |
} patch_stretch_t; |
| 53 |
|
| 54 |
// Raven HUD breaks in "patch_stretch_not_adjusted", |
| 55 |
// so let's use "patch_stretch_doom_format" settings |
| 56 |
#define stretch_hud(a) ((raven && (a) == patch_stretch_not_adjusted) ? patch_stretch_doom_format : (a)) |
| 57 |
|
| 58 |
extern int wide_offsetx; |
| 59 |
extern int wide_offset2x; |
| 60 |
extern int wide_offsety; |
| 61 |
extern int wide_offset2y; |
| 62 |
|
| 63 |
extern int render_stretch_hud; |
| 64 |
|
| 65 |
extern int patches_scalex; |
| 66 |
extern int patches_scaley; |
| 67 |
|
| 68 |
stretch_param_t* dsda_StretchParams(int flags); |
| 69 |
void dsda_SetupStretchParams(void); |
| 70 |
void dsda_EvaluatePatchScale(void); |
| 71 |
|
| 72 |
#endif |