more stuff. i hope i didnt mess this up.

This commit is contained in:
Jaime Passos 2019-09-08 18:59:49 -03:00
parent c7e01a558e
commit 19e50062cc
5 changed files with 27 additions and 26 deletions

View File

@ -6378,13 +6378,18 @@ static void Command_GrStats_f(void)
//added by Hurdler: console varibale that are saved
void HWR_AddCommands(void)
{
CV_RegisterVar(&cv_grrounddown);
CV_RegisterVar(&cv_grfov);
CV_RegisterVar(&cv_grfogdensity);
CV_RegisterVar(&cv_grfiltermode);
CV_RegisterVar(&cv_granisotropicmode);
CV_RegisterVar(&cv_grcorrecttricks);
CV_RegisterVar(&cv_grsolvetjoin);
static boolean alreadycalled = false;
if (!alreadycalled)
{
CV_RegisterVar(&cv_grrounddown);
CV_RegisterVar(&cv_grfov);
CV_RegisterVar(&cv_grfogdensity);
CV_RegisterVar(&cv_grfiltermode);
CV_RegisterVar(&cv_granisotropicmode);
CV_RegisterVar(&cv_grcorrecttricks);
CV_RegisterVar(&cv_grsolvetjoin);
}
alreadycalled = true;
}
static inline void HWR_AddEngineCommands(void)

View File

@ -1101,7 +1101,8 @@ static menuitem_t OP_VideoOptionsMenu[] =
{IT_STRING | IT_CALL, NULL, "Video Modes...", M_VideoModeMenu, 10},
#ifdef HWRENDER
{IT_SUBMENU|IT_STRING, NULL, "3D Card Options...", &OP_OpenGLOptionsDef, 20},
{IT_STRING|IT_CVAR, NULL, "Renderer", &cv_renderer, 20},
//{IT_SUBMENU|IT_STRING, NULL, "3D Card Options...", &OP_OpenGLOptionsDef, 20},
#endif
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON) || defined (HAVE_SDL)
@ -2769,11 +2770,11 @@ void M_Init(void)
quitmsg[QUIT3MSG5] = M_GetText("You'll be back to play soon, though...\n......right?\n\n(Press 'Y' to quit)");
quitmsg[QUIT3MSG6] = M_GetText("Aww, is Egg Rock Zone too\ndifficult for you?\n\n(Press 'Y' to quit)");
#ifdef HWRENDER
/*#ifdef HWRENDER
// Permanently hide some options based on render mode
if (rendermode == render_soft)
OP_VideoOptionsMenu[1].status = IT_DISABLED;
#endif
#endif*/
#ifndef NONET
CV_RegisterVar(&cv_serversort);

View File

@ -1342,6 +1342,7 @@ void R_RenderPlayerView(player_t *player)
#ifdef HWRENDER
void R_InitHardwareMode(void)
{
HWR_AddCommands();
if (gamestate == GS_LEVEL)
{
HWR_SetupLevel();
@ -1432,7 +1433,7 @@ void R_RegisterEngineStuff(void)
#endif
#ifdef HWRENDER
if (rendermode != render_soft && rendermode != render_none)
if (rendermode == render_opengl)
HWR_AddCommands();
#endif
}

View File

@ -139,6 +139,7 @@ static SDL_bool borderlesswindow = SDL_FALSE;
// SDL2 vars
SDL_Window *window;
SDL_Renderer *renderer;
static int renderflags;
static SDL_Texture *texture;
static SDL_bool havefocus = SDL_TRUE;
static const char *fallback_resolution_name = "Fallback";
@ -1260,11 +1261,6 @@ void VID_PrepareModeList(void)
#endif
}
// SOMETIME IN
// THE FUTURE
// WHEN I ACTUALLY RENDER
// THIS FRAME
static int renderflags;
static SDL_bool Impl_CreateContext(int flags)
{
// Renderer-specific stuff
@ -1308,13 +1304,6 @@ void VID_CheckRenderer(void)
{
rendermode = setrenderneeded;
Impl_CreateContext(renderflags);
if (rendermode == render_soft)
{
#ifdef HWRENDER
HWR_FreeTextureCache();
#endif
SCR_SetDrawFuncs();
}
}
SDLSetMode(vid.width, vid.height, USE_FULLSCREEN);
@ -1327,6 +1316,10 @@ void VID_CheckRenderer(void)
bufSurface = NULL;
}
Impl_VideoSetupBuffer();
#ifdef HWRENDER
HWR_FreeTextureCache();
#endif
SCR_SetDrawFuncs();
}
else if (rendermode == render_opengl)
{
@ -1386,10 +1379,10 @@ static SDL_bool Impl_CreateWindow(SDL_bool fullscreen)
if (borderlesswindow)
flags |= SDL_WINDOW_BORDERLESS;
#ifdef HWRENDER
if (rendermode == render_opengl)
//#ifdef HWRENDER
//if (rendermode == render_opengl)
flags |= SDL_WINDOW_OPENGL;
#endif
//#endif
// Create a window
window = SDL_CreateWindow("SRB2 "VERSIONSTRING, SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,

View File

@ -60,6 +60,7 @@
#define PU_HWRPATCHINFO_UNLOCKED 103
void Z_Init(void);
#define Z_FreeTag(tag) Z_FreeTags(tag, tag)
void Z_FreeTags(INT32 lowtag, INT32 hightag);
void Z_CheckMemCleanup(void);
void Z_CheckHeap(INT32 i);