X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=r_sky.c;h=6d3af0be8fb771abd1772b96f4d82a9413004880;hb=5ac525ad06f9775fb38b1f8ad475dbccb9202d8f;hp=a205234ac759cc0154241a6cf5dabf022ba7fff9;hpb=dc18f6c95faaa755790bbd4a57cdc01d0da35191;p=xonotic%2Fdarkplaces.git diff --git a/r_sky.c b/r_sky.c index a205234a..6d3af0be 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_SAVE, "r_sky", "1", "enables sky rendering (black otherwise)"}; -cvar_t r_skyscroll1 = {CVAR_SAVE, "r_skyscroll1", "1", "speed at which upper clouds layer scrolls in quake sky"}; -cvar_t r_skyscroll2 = {CVAR_SAVE, "r_skyscroll2", "2", "speed at which lower clouds layer scrolls in quake sky"}; -cvar_t r_sky_scissor = {0, "r_sky_scissor", "1", "limit rendering of sky to approximately the area of the sky surfaces"}; +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"}; int skyrenderlater; int skyrendermasked; int skyscissor[4]; @@ -86,7 +86,7 @@ static void R_UnloadSkyBox(void) { if (skyboxskinframe[i]) { - // TODO: make a R_SkinFrame_Purge for single skins... + R_SkinFrame_PurgeSkinFrame(skyboxskinframe[i]); c++; } skyboxskinframe[i] = NULL; @@ -163,9 +163,9 @@ int R_SetSkyBox(const char *sky) } // LadyHavoc: added LoadSky console command -static void LoadSky_f (void) +static void LoadSky_f(cmd_state_t *cmd) { - switch (Cmd_Argc()) + switch (Cmd_Argc(cmd)) { case 1: if (skyname[0]) @@ -174,7 +174,7 @@ static void LoadSky_f (void) Con_Print("no skybox has been set\n"); break; case 2: - if (R_SetSkyBox(Cmd_Argv(1))) + if (R_SetSkyBox(Cmd_Argv(cmd, 1))) { if (skyname[0]) Con_Printf("skybox set to %s\n", skyname); @@ -182,7 +182,7 @@ static void LoadSky_f (void) Con_Print("skybox disabled\n"); } else - Con_Printf("failed to load skybox %s\n", Cmd_Argv(1)); + Con_Errorf("failed to load skybox %s\n", Cmd_Argv(cmd, 1)); break; default: Con_Print("usage: loadsky skyname\n"); @@ -432,7 +432,7 @@ void R_Sky(void) //GL_Clear(GL_DEPTH_BUFFER_BIT); } */ - GL_Scissor(0, 0, vid.width, vid.height); + GL_Scissor(0, 0, r_fb.screentexturewidth, r_fb.screentextureheight); } //=============================================================== @@ -440,7 +440,7 @@ void R_Sky(void) void R_ResetSkyBox(void) { R_UnloadSkyBox(); - skyname[0] = 0; + memset(skyname,0,MAX_QPATH); R_LoadSkyBox(); } @@ -463,7 +463,7 @@ static void r_sky_newmap(void) void R_Sky_Init(void) { - Cmd_AddCommand ("loadsky", &LoadSky_f, "load a skybox by basename (for example loadsky mtnsun_ loads mtnsun_ft.tga and so on)"); + Cmd_AddCommand(&cmd_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);