fixup try

screen.h: viddef_s: remove duplicate member fdup and bpp
i_video.c: Impl_InitOpenGL: fix list of functions to find in Impl_InitOpenGL
hw_main.c : remove FOV?
d_main.c: put back in viewnumber parm in same funcs
hw_main.c : put back in viewnumber parm in same funcs
r_opengl.c: remove MakeScreenFinalTexture()
This commit is contained in:
Logan Aerl Arias 2024-03-10 01:24:29 -05:00
parent 7a2bc2752c
commit 9335b0082f
6 changed files with 15 additions and 68 deletions

View file

@ -487,7 +487,7 @@ static void D_Display(void)
objectsdrawn = 0;
#ifdef HWRENDER
if (rendermode != render_soft)
HWR_RenderPlayerView(&players[displayplayer]);
HWR_RenderPlayerView(0, &players[displayplayer]);
else
#endif
if (rendermode != render_none)
@ -499,7 +499,7 @@ static void D_Display(void)
{
#ifdef HWRENDER
if (rendermode != render_soft)
HWR_RenderPlayerView(&players[secondarydisplayplayer]);
HWR_RenderPlayerView(1, &players[secondarydisplayplayer]);
else
#endif
if (rendermode != render_none)

View file

@ -82,7 +82,6 @@ static sector_t *gl_backsector;
FTransform atransform;
// duplicates of the main code, set after R_SetupFrame() passed them into sharedstruct,
// copied here for local use
static fixed_t dup_viewx, dup_viewy, dup_viewz;
static angle_t dup_viewangle;
static float gl_viewx, gl_viewy, gl_viewz;
@ -93,7 +92,6 @@ static float gl_viewludsin, gl_viewludcos; // look up down kik test
static float gl_fovlud;
static angle_t gl_aimingangle;
static float HWR_GetFOV(player_t *player);
static void HWR_SetTransformAiming(FTransform *trans, player_t *player, boolean skybox);
// Render stats
@ -5174,21 +5172,6 @@ void HWR_SetViewSize(void)
HWD.pfnFlushScreenTextures();
}
float HWR_GetFOV(player_t *player)
{
float fov = FixedToFloat(R_GetFOV() + player->fovadd);
// Adjust field of view to the aspect ratio
if (cv_fovadjust.value)
{
fixed_t ftan = FloatToFixed(tan(fov * M_PI / 360));
ftan = R_AdjustFOV(ftan);
fov = atan(FixedToFloat(ftan)) * 360 / M_PI;
}
return fov;
}
// Set view aiming, for the sky dome, the skybox,
// and the normal view, all with a single function.
static void HWR_SetTransformAiming(FTransform *trans, player_t *player, boolean skybox)
@ -5294,7 +5277,7 @@ static void HWR_SetupView(player_t *player, INT32 viewnumber, float fpov, boolea
// ==========================================================================
// Same as rendering the player view, but from the skybox object
// ==========================================================================
void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player)
static void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player)
{
const float fpov = FixedToFloat(R_GetPlayerFov(player));
@ -5386,7 +5369,7 @@ void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player)
// ==========================================================================
//
// ==========================================================================
void HWR_RenderPlayerView(player_t *player)
void HWR_RenderPlayerView(INT32 viewnumber, player_t *player)
{
const float fpov = FixedToFloat(R_GetPlayerFov(player));
@ -5407,7 +5390,7 @@ void HWR_RenderPlayerView(player_t *player)
PS_START_TIMING(ps_hw_skyboxtime);
if (skybox && drawsky) // If there's a skybox and we should be drawing the sky, draw the skybox
HWR_RenderSkyboxView(player); // This is drawn before everything else so it is placed behind
HWR_RenderSkyboxView(viewnumber, player); // This is drawn before everything else so it is placed behind
PS_STOP_TIMING(ps_hw_skyboxtime);
HWR_SetupView(player, viewnumber, fpov, false);

View file

@ -31,7 +31,7 @@ void HWR_drawAMline(const fline_t *fl, INT32 color);
void HWR_FadeScreenMenuBack(UINT16 color, UINT8 strength);
void HWR_DrawConsoleBack(UINT32 color, INT32 height);
void HWR_DrawTutorialBack(UINT32 color, INT32 boxheight);
void HWR_RenderPlayerView(player_t *player);
void HWR_RenderPlayerView(INT32 viewnumber, player_t *player);
void HWR_ClearSkyDome(void);
void HWR_BuildSkyDome(void);
void HWR_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum);

View file

@ -2876,7 +2876,6 @@ EXPORT void HWRAPI(PostImgRedraw) (float points[SCREENVERTS][SCREENVERTS][2])
INT32 x, y;
float float_x, float_y, float_nextx, float_nexty;
float xfix, yfix;
INT32 texsize = 512;
const float blackBack[16] =
{
@ -2971,7 +2970,6 @@ EXPORT void HWRAPI(FlushScreenTextures) (void)
EXPORT void HWRAPI(DrawScreenTexture)(int tex, FSurfaceInfo *surf, FBITFIELD polyflags)
{
float xfix, yfix;
INT32 texsize = 512;
const float screenVerts[12] =
{
@ -3020,7 +3018,6 @@ EXPORT void HWRAPI(DrawScreenTexture)(int tex, FSurfaceInfo *surf, FBITFIELD pol
EXPORT void HWRAPI(DoScreenWipe)(int wipeStart, int wipeEnd, FSurfaceInfo *surf,
FBITFIELD polyFlags)
{
INT32 texsize = 512;
float xfix, yfix;
INT32 fademaskdownloaded = tex_downloaded; // the fade mask that has been set
@ -3127,7 +3124,6 @@ EXPORT void HWRAPI(DoScreenWipe)(int wipeStart, int wipeEnd, FSurfaceInfo *surf,
// Create a texture from the screen.
EXPORT void HWRAPI(MakeScreenTexture) (int tex)
{
INT32 texsize = 512;
boolean firstTime = (screenTextures[tex] == 0);
// look for power of two that is large enough for the screen
@ -3153,36 +3149,12 @@ EXPORT void HWRAPI(MakeScreenTexture) (int tex)
tex_downloaded = screenTextures[tex];
}
EXPORT void HWRAPI(MakeScreenFinalTexture) (void)
{
boolean firstTime = (finalScreenTexture == 0);
// Create screen texture
if (firstTime)
pglGenTextures(1, &finalScreenTexture);
pglBindTexture(GL_TEXTURE_2D, finalScreenTexture);
if (firstTime)
{
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
Clamp2D(GL_TEXTURE_WRAP_S);
Clamp2D(GL_TEXTURE_WRAP_T);
pglCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, texsize, texsize, 0);
}
else
pglCopyTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 0, 0, texsize, texsize);
tex_downloaded = finalScreenTexture;
}
EXPORT void HWRAPI(DrawScreenFinalTexture)(int tex, int width, int height)
{
float xfix, yfix;
float origaspect, newaspect;
float xoff = 1, yoff = 1; // xoffset and yoffset for the polygon to have black bars around the screen
FRGBAFloat clearColour;
INT32 texsize = 512;
float off[12];
float fix[8];

View file

@ -53,7 +53,7 @@ typedef struct viddef_s
INT32 dup; // scale 1, 2, 3 value for menus & overlays
INT32/*fixed_t*/ fdup; // same as dup, but exact value when aspect ratio isn't 320/200
INT32 bpp; // BYTES per pixel: 1 = 256color
INT32 bpp; // BYTES per pixel: 1 = 256color, 2 = highcolor
INT32 baseratio; // Used to get the correct value for lighting walls
@ -62,9 +62,6 @@ typedef struct viddef_s
UINT8 smalldup; // factor for a little bit of scaling
UINT8 meddup; // factor for moderate, but not full, scaling
INT32 fdup; // same as dupx, dupy, but exact value when aspect ratio isn't 320/200
INT32 bpp; // BYTES per pixel: 1 = 256color, 2 = highcolor
struct {
INT32 width;
INT32 height;

View file

@ -1385,8 +1385,6 @@ void I_FinishUpdate(void)
OglSdlFinishUpdate(cv_vidwait.value);
}
#endif
exposevideo = SDL_FALSE;
}
//
@ -1811,33 +1809,30 @@ static void Impl_InitOpenGL(void)
HWD.pfnSetTexture = hwSym("SetTexture",NULL);
HWD.pfnUpdateTexture = hwSym("UpdateTexture",NULL);
HWD.pfnDeleteTexture = hwSym("DeleteTexture",NULL);
HWD.pfnReadRect = hwSym("ReadRect",NULL);
HWD.pfnReadScreenTexture= hwSym("ReadScreenTexture",NULL);
HWD.pfnGClipRect = hwSym("GClipRect",NULL);
HWD.pfnClearMipMapCache = hwSym("ClearMipMapCache",NULL);
HWD.pfnSetSpecialState = hwSym("SetSpecialState",NULL);
HWD.pfnSetPalette = hwSym("SetPalette",NULL);
HWD.pfnSetTexturePalette= hwSym("SetTexturePalette",NULL);
HWD.pfnGetTextureUsed = hwSym("GetTextureUsed",NULL);
HWD.pfnDrawModel = hwSym("DrawModel",NULL);
HWD.pfnCreateModelVBOs = hwSym("CreateModelVBOs",NULL);
HWD.pfnSetTransform = hwSym("SetTransform",NULL);
HWD.pfnPostImgRedraw = hwSym("PostImgRedraw",NULL);
HWD.pfnFlushScreenTextures=hwSym("FlushScreenTextures",NULL);
HWD.pfnStartScreenWipe = hwSym("StartScreenWipe",NULL);
HWD.pfnEndScreenWipe = hwSym("EndScreenWipe",NULL);
HWD.pfnDoScreenWipe = hwSym("DoScreenWipe",NULL);
HWD.pfnDrawIntermissionBG=hwSym("DrawIntermissionBG",NULL);
HWD.pfnDrawScreenTexture= hwSym("DrawScreenTexture",NULL);
HWD.pfnMakeScreenTexture= hwSym("MakeScreenTexture",NULL);
HWD.pfnMakeScreenFinalTexture=hwSym("MakeScreenFinalTexture",NULL);
HWD.pfnDrawScreenFinalTexture=hwSym("DrawScreenFinalTexture",NULL);
HWD.pfnCompileShaders = hwSym("CompileShaders",NULL);
HWD.pfnCleanShaders = hwSym("CleanShaders",NULL);
HWD.pfnInitShaders = hwSym("InitShaders",NULL);
HWD.pfnLoadShader = hwSym("LoadShader",NULL);
HWD.pfnCompileShader = hwSym("CompileShader",NULL);
HWD.pfnSetShader = hwSym("SetShader",NULL);
HWD.pfnUnSetShader = hwSym("UnSetShader",NULL);
HWD.pfnSetShaderInfo = hwSym("SetShaderInfo",NULL);
HWD.pfnLoadCustomShader = hwSym("LoadCustomShader",NULL);
HWD.pfnSetPaletteLookup = hwSym("SetPaletteLookup",NULL);
HWD.pfnCreateLightTable = hwSym("CreateLightTable",NULL);
HWD.pfnClearLightTables = hwSym("ClearLightTables",NULL);