X-Git-Url: https://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=r_sky.c;h=7fd1463dbc7239c60c998ea3124db9ca861234a5;hp=84b916e5575971d59af297666641ac4fba759c31;hb=HEAD;hpb=745f52947afd0a413187753cae8459fbc8f9d81d diff --git a/r_sky.c b/r_sky.c index 84b916e5..67ece728 100644 --- a/r_sky.c +++ b/r_sky.c @@ -3,10 +3,10 @@ #include "image.h" // FIXME: fix skybox after vid_restart -cvar_t r_sky = {CVAR_CLIENT | CVAR_SAVE, "r_sky", "1", "enables sky rendering (black otherwise)"}; -cvar_t r_skyscroll1 = {CVAR_CLIENT | CVAR_SAVE, "r_skyscroll1", "1", "speed at which upper clouds layer scrolls in quake sky"}; -cvar_t r_skyscroll2 = {CVAR_CLIENT | CVAR_SAVE, "r_skyscroll2", "2", "speed at which lower clouds layer scrolls in quake sky"}; -cvar_t r_sky_scissor = {CVAR_CLIENT, "r_sky_scissor", "1", "limit rendering of sky to approximately the area of the sky surfaces"}; +cvar_t r_sky = {CF_CLIENT | CF_ARCHIVE, "r_sky", "1", "enables sky rendering (black otherwise)"}; +cvar_t r_skyscroll1 = {CF_CLIENT | CF_ARCHIVE, "r_skyscroll1", "1", "speed at which upper clouds layer scrolls in quake sky"}; +cvar_t r_skyscroll2 = {CF_CLIENT | CF_ARCHIVE, "r_skyscroll2", "2", "speed at which lower clouds layer scrolls in quake sky"}; +cvar_t r_sky_scissor = {CF_CLIENT, "r_sky_scissor", "1", "limit rendering of sky to approximately the area of the sky surfaces"}; int skyrenderlater; int skyrendermasked; int skyscissor[4]; @@ -21,7 +21,7 @@ static matrix4x4_t skyinversematrix; typedef struct suffixinfo_s { const char *suffix; - qboolean flipx, flipy, flipdiagonal; + qbool flipx, flipy, flipdiagonal; } suffixinfo_t; static const suffixinfo_t suffix[3][6] = @@ -157,7 +157,7 @@ int R_SetSkyBox(const char *sky) return false; } - strlcpy(skyname, sky, sizeof(skyname)); + dp_strlcpy(skyname, sky, sizeof(skyname)); return R_LoadSkyBox(); } @@ -182,7 +182,7 @@ static void LoadSky_f(cmd_state_t *cmd) Con_Print("skybox disabled\n"); } else - Con_Printf("failed to load skybox %s\n", Cmd_Argv(cmd, 1)); + Con_Printf(CON_ERROR "failed to load skybox %s\n", Cmd_Argv(cmd, 1)); break; default: Con_Print("usage: loadsky skyname\n"); @@ -376,7 +376,7 @@ static void skyspherecalc(void) static void R_SkySphere(void) { double speedscale; - static qboolean skysphereinitialized = false; + static qbool skysphereinitialized = false; matrix4x4_t scroll1matrix, scroll2matrix; if (!skysphereinitialized) { @@ -432,7 +432,7 @@ void R_Sky(void) //GL_Clear(GL_DEPTH_BUFFER_BIT); } */ - GL_Scissor(0, 0, vid.width, vid.height); + GL_Scissor(r_refdef.view.viewport.x, r_refdef.view.viewport.y, r_refdef.view.viewport.width, r_refdef.view.viewport.height); } //=============================================================== @@ -463,7 +463,7 @@ static void r_sky_newmap(void) void R_Sky_Init(void) { - Cmd_AddCommand(&cmd_client, "loadsky", &LoadSky_f, "load a skybox by basename (for example loadsky mtnsun_ loads mtnsun_ft.tga and so on)"); + Cmd_AddCommand(CF_CLIENT, "loadsky", &LoadSky_f, "load a skybox by basename (for example loadsky mtnsun_ loads mtnsun_ft.tga and so on)"); Cvar_RegisterVariable (&r_sky); Cvar_RegisterVariable (&r_skyscroll1); Cvar_RegisterVariable (&r_skyscroll2);