2020-01-23 23:12:15 +00:00
// SONIC ROBO BLAST 2
2014-03-15 16:59:03 +00:00
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
2022-03-03 19:24:46 +00:00
// Copyright (C) 1999-2022 by Sonic Team Junior.
2014-03-15 16:59:03 +00:00
//
2020-01-23 23:12:15 +00:00
// This program is free software distributed under the
// terms of the GNU General Public License, version 2.
// See the 'LICENSE' file for more details.
2014-03-15 16:59:03 +00:00
//-----------------------------------------------------------------------------
2020-01-23 23:12:15 +00:00
/// \file hw_main.h
2014-03-15 16:59:03 +00:00
/// \brief 3D render mode functions
# ifndef __HWR_MAIN_H__
# define __HWR_MAIN_H__
# include "hw_data.h"
# include "hw_defs.h"
# include "../am_map.h"
# include "../d_player.h"
# include "../r_defs.h"
2021-10-25 17:49:15 +00:00
# include "../m_perfstats.h"
2014-03-15 16:59:03 +00:00
// Startup & Shutdown the hardware mode renderer
void HWR_Startup ( void ) ;
2019-12-17 19:12:44 +00:00
void HWR_Switch ( void ) ;
2014-03-15 16:59:03 +00:00
void HWR_Shutdown ( void ) ;
void HWR_drawAMline ( const fline_t * fl , INT32 color ) ;
2018-02-12 17:47:31 +00:00
void HWR_FadeScreenMenuBack ( UINT16 color , UINT8 strength ) ;
2014-03-15 16:59:03 +00:00
void HWR_DrawConsoleBack ( UINT32 color , INT32 height ) ;
2018-11-03 21:14:17 +00:00
void HWR_DrawTutorialBack ( UINT32 color , INT32 boxheight ) ;
2014-03-20 20:13:15 +00:00
void HWR_RenderSkyboxView ( INT32 viewnumber , player_t * player ) ;
2014-03-15 16:59:03 +00:00
void HWR_RenderPlayerView ( INT32 viewnumber , player_t * player ) ;
2020-07-17 05:48:05 +00:00
void HWR_ClearSkyDome ( void ) ;
void HWR_BuildSkyDome ( void ) ;
2014-03-15 16:59:03 +00:00
void HWR_DrawViewBorder ( INT32 clearlines ) ;
void HWR_DrawFlatFill ( INT32 x , INT32 y , INT32 w , INT32 h , lumpnum_t flatlumpnum ) ;
void HWR_InitTextureMapping ( void ) ;
void HWR_SetViewSize ( void ) ;
2020-08-08 08:16:47 +00:00
void HWR_DrawPatch ( patch_t * gpatch , INT32 x , INT32 y , INT32 option ) ;
void HWR_DrawStretchyFixedPatch ( patch_t * gpatch , fixed_t x , fixed_t y , fixed_t pscale , fixed_t vscale , INT32 option , const UINT8 * colormap ) ;
2020-12-11 22:43:38 +00:00
void HWR_DrawCroppedPatch ( patch_t * gpatch , fixed_t x , fixed_t y , fixed_t pscale , fixed_t vscale , INT32 option , const UINT8 * colormap , fixed_t sx , fixed_t sy , fixed_t w , fixed_t h ) ;
2017-08-19 17:51:56 +00:00
void HWR_MakePatch ( const patch_t * patch , GLPatch_t * grPatch , GLMipmap_t * grMipmap , boolean makebitmap ) ;
2014-03-15 16:59:03 +00:00
void HWR_CreatePlanePolygons ( INT32 bspnum ) ;
void HWR_CreateStaticLightmaps ( INT32 bspnum ) ;
void HWR_DrawFill ( INT32 x , INT32 y , INT32 w , INT32 h , INT32 color ) ;
A good and bad ending cutscene now exist.
Also:
* SPR2_XTRA - instead of defining lumpnames in S_SKIN, those kinds of assets can just be bundled into the spriteset. Required for ending cutscene stuff, I guess, but also done for HUD life icon and character select image (aside from Sonic&Tails, still SOC'd in).
* Minor oversights in SPR2 support corrected.
* Better evaluation, featuring ending assets.
* Intro has warping-in blackrock, reusing ending assets.
* Cutscene text now supports lowercase (intro and custom).
* Disable the asset-fucking "gamma correction" I put in over two years ago when implementing colour cube. (This is the only thing I could move into another branch if you MUST, but it's basically invisble in the diff so w/e.)
* Don't blank the screen if the top left pixel of a screen-covering patch is transparent. (Checked via nonzero topdelta for first column)
Bugs:
* OPENGL ONLY: The first ~20 frames of both endings are fucked. A little help here? Might be HWR_DrawFadeFill's fault, which I just created. OR it could be in f_finale, but I doubt it, since it doesn't appear in Software.
2019-07-27 23:32:57 +00:00
void HWR_DrawFadeFill ( INT32 x , INT32 y , INT32 w , INT32 h , INT32 color , UINT16 actualcolor , UINT8 strength ) ;
2019-08-04 09:27:09 +00:00
void HWR_DrawConsoleFill ( INT32 x , INT32 y , INT32 w , INT32 h , INT32 color , UINT32 actualcolor ) ; // Lat: separate flags from color since color needs to be an uint to work right.
2014-03-15 16:59:03 +00:00
void HWR_DrawPic ( INT32 x , INT32 y , lumpnum_t lumpnum ) ;
2019-01-02 03:41:52 +00:00
UINT8 * HWR_GetScreenshot ( void ) ;
2019-01-02 04:01:57 +00:00
boolean HWR_Screenshot ( const char * pathname ) ;
2019-01-02 03:41:52 +00:00
2014-03-15 16:59:03 +00:00
void HWR_AddCommands ( void ) ;
2019-12-13 00:43:19 +00:00
void HWR_AddSessionCommands ( void ) ;
2014-03-15 16:59:03 +00:00
void transform ( float * cx , float * cy , float * cz ) ;
INT32 HWR_GetTextureUsed ( void ) ;
void HWR_DoPostProcessor ( player_t * player ) ;
void HWR_StartScreenWipe ( void ) ;
void HWR_EndScreenWipe ( void ) ;
void HWR_DrawIntermissionBG ( void ) ;
2014-09-04 00:35:29 +00:00
void HWR_DoWipe ( UINT8 wipenum , UINT8 scrnnum ) ;
2019-11-05 15:10:42 +00:00
void HWR_DoTintedWipe ( UINT8 wipenum , UINT8 scrnnum ) ;
2014-11-14 00:06:38 +00:00
void HWR_MakeScreenFinalTexture ( void ) ;
void HWR_DrawScreenFinalTexture ( int width , int height ) ;
2014-03-15 16:59:03 +00:00
2020-10-27 03:03:41 +00:00
// This stuff is put here so models can use them
2019-12-25 19:22:01 +00:00
void HWR_Lighting ( FSurfaceInfo * Surface , INT32 light_level , extracolormap_t * colormap ) ;
UINT8 HWR_FogBlockAlpha ( INT32 light , extracolormap_t * colormap ) ; // Let's see if this can work
2020-10-27 03:03:41 +00:00
UINT8 HWR_GetTranstableAlpha ( INT32 transtablenum ) ;
2021-04-27 03:20:41 +00:00
FBITFIELD HWR_GetBlendModeFlag ( INT32 style ) ;
2020-10-27 03:03:41 +00:00
FBITFIELD HWR_SurfaceBlend ( INT32 style , INT32 transtablenum , FSurfaceInfo * pSurf ) ;
FBITFIELD HWR_TranstableToAlpha ( INT32 transtablenum , FSurfaceInfo * pSurf ) ;
2020-08-07 21:17:05 +00:00
boolean HWR_CompileShaders ( void ) ;
2014-03-15 16:59:03 +00:00
2020-08-07 21:17:05 +00:00
void HWR_LoadAllCustomShaders ( void ) ;
void HWR_LoadCustomShadersFromFile ( UINT16 wadnum , boolean PK3 ) ;
const char * HWR_GetShaderName ( INT32 shader ) ;
extern customshaderxlat_t shaderxlat [ ] ;
2014-03-15 16:59:03 +00:00
2020-10-09 05:06:13 +00:00
extern CV_PossibleValue_t glanisotropicmode_cons_t [ ] ;
2014-03-15 16:59:03 +00:00
2016-04-21 17:50:30 +00:00
# ifdef ALAM_LIGHTING
2020-07-06 04:15:08 +00:00
extern consvar_t cv_gldynamiclighting ;
extern consvar_t cv_glstaticlighting ;
extern consvar_t cv_glcoronas ;
extern consvar_t cv_glcoronasize ;
2016-04-21 17:50:30 +00:00
# endif
2020-01-16 19:55:55 +00:00
2020-10-09 05:06:13 +00:00
extern consvar_t cv_glshaders , cv_glallowshaders ;
2020-07-06 04:15:08 +00:00
extern consvar_t cv_glmodels ;
extern consvar_t cv_glmodelinterpolation ;
extern consvar_t cv_glmodellighting ;
extern consvar_t cv_glfiltermode ;
extern consvar_t cv_glanisotropicmode ;
2019-12-31 17:21:46 +00:00
extern consvar_t cv_fovchange ;
2020-07-06 04:15:08 +00:00
extern consvar_t cv_glsolvetjoin ;
extern consvar_t cv_glshearing ;
extern consvar_t cv_glspritebillboarding ;
extern consvar_t cv_glskydome ;
extern consvar_t cv_glfakecontrast ;
extern consvar_t cv_glslopecontrast ;
2014-03-15 16:59:03 +00:00
2020-07-06 04:15:08 +00:00
extern consvar_t cv_glbatching ;
2020-06-07 18:20:52 +00:00
2020-07-06 04:15:08 +00:00
extern float gl_viewwidth , gl_viewheight , gl_baseviewwindowy ;
2014-03-15 16:59:03 +00:00
2020-07-06 04:15:08 +00:00
extern float gl_viewwindowx , gl_basewindowcentery ;
2014-03-15 16:59:03 +00:00
// BP: big hack for a test in lighting ref : 1249753487AB
extern fixed_t * hwbbox ;
extern FTransform atransform ;
2020-04-18 22:25:28 +00:00
2020-05-02 17:43:53 +00:00
// Render stats
2021-10-25 17:49:15 +00:00
extern ps_metric_t ps_hw_skyboxtime ;
extern ps_metric_t ps_hw_nodesorttime ;
extern ps_metric_t ps_hw_nodedrawtime ;
extern ps_metric_t ps_hw_spritesorttime ;
extern ps_metric_t ps_hw_spritedrawtime ;
2020-04-18 22:25:28 +00:00
2020-06-07 18:20:52 +00:00
// Render stats for batching
2021-10-25 17:49:15 +00:00
extern ps_metric_t ps_hw_numpolys ;
extern ps_metric_t ps_hw_numverts ;
extern ps_metric_t ps_hw_numcalls ;
extern ps_metric_t ps_hw_numshaders ;
extern ps_metric_t ps_hw_numtextures ;
extern ps_metric_t ps_hw_numpolyflags ;
extern ps_metric_t ps_hw_numcolors ;
extern ps_metric_t ps_hw_batchsorttime ;
extern ps_metric_t ps_hw_batchdrawtime ;
2020-06-07 18:20:52 +00:00
2020-10-15 17:31:16 +00:00
extern boolean gl_init ;
extern boolean gl_maploaded ;
extern boolean gl_maptexturesloaded ;
extern boolean gl_sessioncommandsadded ;
2020-07-06 04:15:08 +00:00
extern boolean gl_shadersavailable ;
2020-06-18 14:39:34 +00:00
2014-03-15 16:59:03 +00:00
# endif