Rearrange code little bit

This commit is contained in:
Denis Pauk 2020-01-26 23:30:54 +02:00 committed by Yamagi
parent e48a7f61c6
commit 400562cd2e
2 changed files with 23 additions and 26 deletions

View file

@ -220,8 +220,6 @@ void R_ClearSkyBox (void);
void R_DrawSkyBox (void);
void R_MarkLights (dlight_t *light, int bit, mnode_t *node);
void COM_StripExtension (char *in, char *out);
void Draw_GetPicSize (int *w, int *h, char *name);
void Draw_PicScaled (int x, int y, char *name, float scale);
void Draw_StretchPic (int x, int y, int w, int h, char *name);
@ -231,10 +229,7 @@ void Draw_Fill (int x, int y, int w, int h, int c);
void Draw_FadeScreen (void);
void Draw_StretchRaw (int x, int y, int w, int h, int cols, int rows, byte *data);
void R_BeginFrame( float camera_separation );
void R_EndFrame( void );
void R_EndWorldRenderpass( void );
void R_SetPalette ( const unsigned char *palette);
void Vk_ResampleTexture (unsigned *in, int inwidth, int inheight, unsigned *out, int outwidth, int outheight);

View file

@ -1214,13 +1214,6 @@ qboolean R_Init( void )
}
ri.Vid_MenuInit();
// window is ready, initialize Vulkan now
if (!QVk_Init(window))
{
R_Printf(PRINT_ALL, "%s() - could not initialize Vulkan!\n", __func__);
return false;
}
R_Printf(PRINT_ALL, "Successfully initialized Vulkan!\n");
// print device information during startup
Vk_Strings_f();
@ -1242,6 +1235,10 @@ qboolean R_Init( void )
*/
static void R_ShutdownContext( void )
{
// Shutdown Vulkan subsystem
QVk_Shutdown();
window = NULL;
}
@ -1264,19 +1261,15 @@ void R_Shutdown (void)
Mod_FreeAll();
Vk_ShutdownImages();
// Shutdown Vulkan subsystem
QVk_Shutdown();
// shut down OS specific Vulkan stuff (in our case: window)
R_ShutdownContext();
}
/*
=====================
R_BeginFrame
RE_BeginFrame
=====================
*/
void R_BeginFrame( float camera_separation )
static void
RE_BeginFrame( float camera_separation )
{
// world has not rendered yet
world_rendered = false;
@ -1327,22 +1320,24 @@ void R_BeginFrame( float camera_separation )
/*
=====================
R_EndFrame
RE_EndFrame
=====================
*/
void R_EndFrame( void )
static void
RE_EndFrame( void )
{
QVk_EndFrame(false);
}
/*
=============
R_SetPalette
RE_SetPalette
=============
*/
unsigned r_rawpalette[256];
void R_SetPalette ( const unsigned char *palette)
static void
RE_SetPalette (const unsigned char *palette)
{
int i;
@ -1496,6 +1491,13 @@ R_InitContext(void *win)
snprintf(title, sizeof(title), "Yamagi Quake II %s - Vulkan Render", YQ2VERSION);
SDL_SetWindowTitle(window, title);
// window is ready, initialize Vulkan now
if (!QVk_Init(window))
{
R_Printf(PRINT_ALL, "%s() - could not initialize Vulkan!\n", __func__);
return false;
}
return true;
}
@ -1571,9 +1573,9 @@ GetRefAPI(refimport_t imp)
refexport.ShutdownContext = R_ShutdownContext;
refexport.PrepareForWindow = R_PrepareForWindow;
refexport.SetPalette = R_SetPalette;
refexport.BeginFrame = R_BeginFrame;
refexport.EndFrame = R_EndFrame;
refexport.SetPalette = RE_SetPalette;
refexport.BeginFrame = RE_BeginFrame;
refexport.EndFrame = RE_EndFrame;
Swap_Init ();