Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision

Target

Select target project
  • STJr/SRB2
  • Sryder/SRB2
  • wolfy852/SRB2
  • Alpha2244/SRB2
  • Inuyasha/SRB2
  • yoshibot/SRB2
  • TehRealSalt/SRB2
  • PrisimaTF/SRB2
  • Hatninja/SRB2
  • SteelT/SRB2
  • james/SRB2
  • ShaderWraith/SRB2
  • SinnamonLat/SRB2
  • mazmazz_/SRB2
  • filpAM/SRB2
  • chaoloveicemdboy/SRB2
  • Whooa21/SRB2
  • Machturne/SRB2
  • Golden/SRB2
  • Tatsuru/SRB2
  • Snu/SRB2
  • Zwip-Zwap_Zapony/SRB2
  • fickleheart/SRB2
  • alphaRexJames/SRB2
  • JJK/SRB2
  • diskpoppy/SRB2
  • Hannu_Hanhi/SRB2
  • ZipperQR/SRB2
  • kays/SRB2
  • spherallic/SRB2
  • Zippy_Zolton/SRB2
  • namiishere/SRB2
  • Ors/SRB2
  • SMS_Alfredo/SRB2
  • sonic_edge/SRB2
  • lavla/SRB2
  • ashi/SRB2
  • X.organic/SRB2
  • Fafabis/SRB2
  • Meziu/SRB2
  • v-rob/SRB2
  • tertu/SRB2
  • bitten2up/SRB2
  • flarn2006/SRB2
  • Krabs/SRB2
  • clairebun/SRB2
  • Lactozilla/SRB2
  • thehackstack/SRB2
  • Spice/SRB2
  • win8linux/SRB2
  • JohnFrostFox/SRB2
  • talktoneon726/SRB2
  • Wane/SRB2
  • Lamibe/SRB2
  • spectrumuk2/srb-2
  • nerdyminer18/srb-2
  • 256nil/SRB2
  • ARJr/SRB2
  • Alam/SRB2
  • Zenya/srb-2-marathon-demos
  • Acelite/srb-2-archivedmodifications
  • MIDIMan/SRB2
  • Lach/SRB2
  • Frostiikin/bounce-tweaks
  • Jaden/SRB2
  • Tyron/SRB2
  • Astronight/SRB2
  • Mari0shi06/SRB2
  • aiire/SRB2
  • Galactice/SRB2
  • srb2-ports/srb2-dreamcast
  • sdasdas/SRB2
  • chreas/srb-2-vr
  • StarManiaKG/the-story-of-sinically-rocketing-and-botching-the-2nd
  • LoganAir/SRB2
  • NepDisk/srb-2
  • alufolie91/SRB2
  • Felicia.iso/SRB2
  • twi/SRB2
  • BarrelsOFun/SRB2
  • Speed2411/SRB2
  • Leather_Realms/SRB2
  • Ayemar/SRB2
  • Acelite/SRB2
  • VladDoc/SRB2
  • kaldrum/model-features
  • strawberryfox417/SRB2
  • Lugent/SRB2
  • Rem/SRB2
  • Refrag/SRB2
  • Henry_3230/srb-3230
  • TehPuertoRicanSpartan2/tprs-srb2
  • Leminn/srb-2-marathon-stuff
  • chromaticpipe2/SRB2
  • MiguelGustavo15/SRB2
  • Maru/srb-2-tests
  • SilicDev/SRB2
  • UnmatchedBracket/SRB2
  • HybridDog/SRB2
  • xordspar0/SRB2
  • jsjhbewfhh/SRB2
  • Fancy2209/SRB2
  • Lorsoen/SRB2
  • shindoukin/SRB2
  • GamerOfDays/SRB2
  • Craftyawesome/SRB2
  • tenshi-tensai-tennoji/SRB2
  • Scarfdudebalder/SRB2
  • luigi-budd/srb-2-fix-interplag-lockon
  • mskluesner/SRB2
  • johnpetersa19/SRB2
  • Pheazant/SRB2
  • chromaticpipe2/srb2classic
  • romoney5/SRB2
  • PAS/SRB2Classic
  • BlueStaggo/SRB2
  • Jisk/srb-2-beef-jerky
117 results
Select Git revision
Show changes
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "d_main.h" #include "d_main.h"
#include "d_clisrv.h" #include "d_clisrv.h"
#include "f_finale.h" #include "f_finale.h"
#include "y_inter.h" // usebuffer
#include "i_sound.h" // closed captions #include "i_sound.h" // closed captions
#include "s_sound.h" // ditto #include "s_sound.h" // ditto
#include "g_game.h" // ditto #include "g_game.h" // ditto
...@@ -63,7 +64,6 @@ consvar_t cv_scr_height = {"scr_height", "800", CV_SAVE, CV_Unsigned, NULL, 0, N ...@@ -63,7 +64,6 @@ consvar_t cv_scr_height = {"scr_height", "800", CV_SAVE, CV_Unsigned, NULL, 0, N
consvar_t cv_scr_depth = {"scr_depth", "16 bits", CV_SAVE, scr_depth_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_scr_depth = {"scr_depth", "16 bits", CV_SAVE, scr_depth_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_renderview = {"renderview", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_renderview = {"renderview", "On", 0, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
static void SCR_ActuallyChangeRenderer(void);
CV_PossibleValue_t cv_renderer_t[] = { CV_PossibleValue_t cv_renderer_t[] = {
{1, "Software"}, {1, "Software"},
#ifdef HWRENDER #ifdef HWRENDER
...@@ -71,7 +71,7 @@ CV_PossibleValue_t cv_renderer_t[] = { ...@@ -71,7 +71,7 @@ CV_PossibleValue_t cv_renderer_t[] = {
#endif #endif
{0, NULL} {0, NULL}
}; };
consvar_t cv_renderer = {"renderer", "Software", CV_SAVE|CV_NOLUA|CV_CALL, cv_renderer_t, SCR_ChangeRenderer, 0, NULL, NULL, 0, 0, NULL}; consvar_t cv_renderer = {"renderer", "Software", CV_SAVE|CV_NOLUA|CV_CALL, cv_renderer_t, SCR_SetTargetRenderer, 0, NULL, NULL, 0, 0, NULL};
static void SCR_ChangeFullscreen(void); static void SCR_ChangeFullscreen(void);
...@@ -81,7 +81,6 @@ consvar_t cv_fullscreen = {"fullscreen", "Yes", CV_SAVE|CV_CALL, CV_YesNo, SCR_C ...@@ -81,7 +81,6 @@ consvar_t cv_fullscreen = {"fullscreen", "Yes", CV_SAVE|CV_CALL, CV_YesNo, SCR_C
// SCREEN VARIABLES // SCREEN VARIABLES
// ========================================================================= // =========================================================================
INT32 scr_bpp; // current video mode bytes per pixel
UINT8 *scr_borderpatch; // flat used to fill the reduced view borders set at ST_Init() UINT8 *scr_borderpatch; // flat used to fill the reduced view borders set at ST_Init()
// ========================================================================= // =========================================================================
...@@ -202,14 +201,15 @@ void SCR_SetMode(void) ...@@ -202,14 +201,15 @@ void SCR_SetMode(void)
// Lactozilla: Renderer switching // Lactozilla: Renderer switching
if (setrenderneeded) if (setrenderneeded)
{ {
Z_PreparePatchFlush(); // stop recording movies (APNG only)
needpatchflush = true; if (setrenderneeded && (moviemode == MM_APNG))
needpatchrecache = true; M_StopMovie();
VID_CheckRenderer(); VID_CheckRenderer();
if (!setmodeneeded) vid.recalc = 1;
VID_SetMode(vid.modenum);
} }
// Set the video mode in the video interface.
if (setmodeneeded) if (setmodeneeded)
VID_SetMode(--setmodeneeded); VID_SetMode(--setmodeneeded);
...@@ -279,34 +279,9 @@ void SCR_Startup(void) ...@@ -279,34 +279,9 @@ void SCR_Startup(void)
vid.modenum = 0; vid.modenum = 0;
vid.dupx = vid.width / BASEVIDWIDTH;
vid.dupy = vid.height / BASEVIDHEIGHT;
vid.dupx = vid.dupy = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
vid.fdupx = FixedDiv(vid.width*FRACUNIT, BASEVIDWIDTH*FRACUNIT);
vid.fdupy = FixedDiv(vid.height*FRACUNIT, BASEVIDHEIGHT*FRACUNIT);
#ifdef HWRENDER
if (rendermode != render_opengl && rendermode != render_none) // This was just placing it incorrectly at non aspect correct resolutions in opengl
#endif
vid.fdupx = vid.fdupy = (vid.fdupx < vid.fdupy ? vid.fdupx : vid.fdupy);
vid.meddupx = (UINT8)(vid.dupx >> 1) + 1;
vid.meddupy = (UINT8)(vid.dupy >> 1) + 1;
#ifdef HWRENDER
vid.fmeddupx = vid.meddupx*FRACUNIT;
vid.fmeddupy = vid.meddupy*FRACUNIT;
#endif
vid.smalldupx = (UINT8)(vid.dupx / 3) + 1;
vid.smalldupy = (UINT8)(vid.dupy / 3) + 1;
#ifdef HWRENDER
vid.fsmalldupx = vid.smalldupx*FRACUNIT;
vid.fsmalldupy = vid.smalldupy*FRACUNIT;
#endif
vid.baseratio = FRACUNIT;
V_Init(); V_Init();
V_Recalc();
CV_RegisterVar(&cv_ticrate); CV_RegisterVar(&cv_ticrate);
CV_RegisterVar(&cv_constextsize); CV_RegisterVar(&cv_constextsize);
...@@ -320,41 +295,7 @@ void SCR_Recalc(void) ...@@ -320,41 +295,7 @@ void SCR_Recalc(void)
if (dedicated) if (dedicated)
return; return;
// bytes per pixel quick access V_Recalc();
scr_bpp = vid.bpp;
// scale 1,2,3 times in x and y the patches for the menus and overlays...
// calculated once and for all, used by routines in v_video.c
vid.dupx = vid.width / BASEVIDWIDTH;
vid.dupy = vid.height / BASEVIDHEIGHT;
vid.dupx = vid.dupy = (vid.dupx < vid.dupy ? vid.dupx : vid.dupy);
vid.fdupx = FixedDiv(vid.width*FRACUNIT, BASEVIDWIDTH*FRACUNIT);
vid.fdupy = FixedDiv(vid.height*FRACUNIT, BASEVIDHEIGHT*FRACUNIT);
#ifdef HWRENDER
//if (rendermode != render_opengl && rendermode != render_none) // This was just placing it incorrectly at non aspect correct resolutions in opengl
// 13/11/18:
// The above is no longer necessary, since we want OpenGL to be just like software now
// -- Monster Iestyn
#endif
vid.fdupx = vid.fdupy = (vid.fdupx < vid.fdupy ? vid.fdupx : vid.fdupy);
//vid.baseratio = FixedDiv(vid.height << FRACBITS, BASEVIDHEIGHT << FRACBITS);
vid.baseratio = FRACUNIT;
vid.meddupx = (UINT8)(vid.dupx >> 1) + 1;
vid.meddupy = (UINT8)(vid.dupy >> 1) + 1;
#ifdef HWRENDER
vid.fmeddupx = vid.meddupx*FRACUNIT;
vid.fmeddupy = vid.meddupy*FRACUNIT;
#endif
vid.smalldupx = (UINT8)(vid.dupx / 3) + 1;
vid.smalldupy = (UINT8)(vid.dupy / 3) + 1;
#ifdef HWRENDER
vid.fsmalldupx = vid.smalldupx*FRACUNIT;
vid.fsmalldupy = vid.smalldupy*FRACUNIT;
#endif
// toggle off (then back on) the automap because some screensize-dependent values will // toggle off (then back on) the automap because some screensize-dependent values will
// be calculated next time the automap is activated. // be calculated next time the automap is activated.
...@@ -369,11 +310,17 @@ void SCR_Recalc(void) ...@@ -369,11 +310,17 @@ void SCR_Recalc(void)
// scr_viewsize doesn't change, neither detailLevel, but the pixels // scr_viewsize doesn't change, neither detailLevel, but the pixels
// per screenblock is different now, since we've changed resolution. // per screenblock is different now, since we've changed resolution.
R_SetViewSize(); //just set setsizeneeded true now .. R_ViewSizeChanged(); //just set setsizeneeded true now ..
// vid.recalc lasts only for the next refresh... // vid.recalc lasts only for the next refresh...
con_recalc = true; con_recalc = true;
am_recalc = true; am_recalc = true;
#ifdef HWRENDER
// Shoot! The screen texture was flushed!
if ((rendermode == render_opengl) && (gamestate == GS_INTERMISSION))
usebuffer = false;
#endif
} }
// Check for screen cmd-line parms: to force a resolution. // Check for screen cmd-line parms: to force a resolution.
...@@ -411,7 +358,19 @@ void SCR_CheckDefaultMode(void) ...@@ -411,7 +358,19 @@ void SCR_CheckDefaultMode(void)
setmodeneeded = VID_GetModeForSize(cv_scr_width.value, cv_scr_height.value) + 1; setmodeneeded = VID_GetModeForSize(cv_scr_width.value, cv_scr_height.value) + 1;
} }
SCR_ActuallyChangeRenderer(); if (cv_renderer.value != (signed)rendermode)
{
if (chosenrendermode == render_none) // nothing set at command line
SCR_ChangeRenderer();
else
{
// Set cv_renderer to the current render mode
CV_StealthSetValue(&cv_renderer, rendermode);
#ifdef HWRENDER
CV_StealthSetValue(&cv_newrenderer, rendermode);
#endif
}
}
} }
// sets the modenum as the new default video mode to be saved in the config file // sets the modenum as the new default video mode to be saved in the config file
...@@ -427,81 +386,42 @@ void SCR_SetDefaultMode(void) ...@@ -427,81 +386,42 @@ void SCR_SetDefaultMode(void)
void SCR_ChangeFullscreen(void) void SCR_ChangeFullscreen(void)
{ {
#ifdef DIRECTFULLSCREEN #ifdef DIRECTFULLSCREEN
// allow_fullscreen is set by VID_PrepareModeList // allow_fullscreen is used to prevent switching to fullscreen during startup
// it is used to prevent switching to fullscreen during startup
if (!allow_fullscreen) if (!allow_fullscreen)
return; return;
if (graphics_started) if (graphics_started)
{
VID_PrepareModeList();
setmodeneeded = VID_GetModeForSize(vid.width, vid.height) + 1; setmodeneeded = VID_GetModeForSize(vid.width, vid.height) + 1;
}
return;
#endif #endif
} }
static int target_renderer = 0; void SCR_SetTargetRenderer(void)
{
if (!con_refresh)
SCR_ChangeRenderer();
}
void SCR_ActuallyChangeRenderer(void) void SCR_ChangeRenderer(void)
{ {
setrenderneeded = target_renderer; if ((signed)rendermode == cv_renderer.value)
return;
#ifdef HWRENDER #ifdef HWRENDER
// Well, it didn't even load anyway. // Check if OpenGL loaded successfully (or wasn't disabled) before switching to it.
if ((vid_opengl_state == -1) && (setrenderneeded == render_opengl)) if ((vid.glstate == VID_GL_LIBRARY_ERROR)
&& (cv_renderer.value == render_opengl))
{ {
if (M_CheckParm("-nogl")) if (M_CheckParm("-nogl"))
CONS_Alert(CONS_ERROR, "OpenGL rendering was disabled!\n"); CONS_Alert(CONS_ERROR, "OpenGL rendering was disabled!\n");
else else
CONS_Alert(CONS_ERROR, "OpenGL never loaded\n"); CONS_Alert(CONS_ERROR, "OpenGL never loaded\n");
setrenderneeded = 0;
return; return;
} }
#endif #endif
// setting the same renderer twice WILL crash your game, so let's not, please // Set the new render mode
if (rendermode == setrenderneeded) setrenderneeded = cv_renderer.value;
setrenderneeded = 0; con_refresh = false;
}
// Lactozilla: Renderer switching
void SCR_ChangeRenderer(void)
{
setrenderneeded = 0;
if (con_startup)
{
target_renderer = cv_renderer.value;
#ifdef HWRENDER
if (M_CheckParm("-opengl") && (vid_opengl_state == 1))
target_renderer = rendermode = render_opengl;
else
#endif
if (M_CheckParm("-software"))
target_renderer = rendermode = render_soft;
// set cv_renderer back
SCR_ChangeRendererCVars(rendermode);
return;
}
if (cv_renderer.value == 1)
target_renderer = render_soft;
else if (cv_renderer.value == 2)
target_renderer = render_opengl;
SCR_ActuallyChangeRenderer();
}
void SCR_ChangeRendererCVars(INT32 mode)
{
// set cv_renderer back
if (mode == render_soft)
CV_StealthSetValue(&cv_renderer, 1);
else if (mode == render_opengl)
CV_StealthSetValue(&cv_renderer, 2);
#ifdef HWRENDER
CV_StealthSetValue(&cv_newrenderer, cv_renderer.value);
#endif
} }
boolean SCR_IsAspectCorrect(INT32 width, INT32 height) boolean SCR_IsAspectCorrect(INT32 width, INT32 height)
......
This diff is collapsed.
...@@ -283,6 +283,8 @@ ...@@ -283,6 +283,8 @@
<ClInclude Include="..\r_main.h" /> <ClInclude Include="..\r_main.h" />
<ClInclude Include="..\r_plane.h" /> <ClInclude Include="..\r_plane.h" />
<ClInclude Include="..\r_patch.h" /> <ClInclude Include="..\r_patch.h" />
<ClInclude Include="..\r_rotsprite.h" />
<ClInclude Include="..\r_patchtrees.h" />
<ClInclude Include="..\r_portal.h" /> <ClInclude Include="..\r_portal.h" />
<ClInclude Include="..\r_segs.h" /> <ClInclude Include="..\r_segs.h" />
<ClInclude Include="..\r_skins.h" /> <ClInclude Include="..\r_skins.h" />
...@@ -447,7 +449,8 @@ ...@@ -447,7 +449,8 @@
</ClCompile> </ClCompile>
<ClCompile Include="..\r_main.c" /> <ClCompile Include="..\r_main.c" />
<ClCompile Include="..\r_plane.c" /> <ClCompile Include="..\r_plane.c" />
<ClCompile Include="..\r_patch.c" /> <ClCompile Include="..\r_patch.c" />
<ClCompile Include="..\r_rotsprite.c" />
<ClCompile Include="..\r_portal.c" /> <ClCompile Include="..\r_portal.c" />
<ClCompile Include="..\r_segs.c" /> <ClCompile Include="..\r_segs.c" />
<ClCompile Include="..\r_skins.c" /> <ClCompile Include="..\r_skins.c" />
......
...@@ -474,6 +474,12 @@ ...@@ -474,6 +474,12 @@
<ClInclude Include="..\r_patch.h"> <ClInclude Include="..\r_patch.h">
<Filter>R_Rend</Filter> <Filter>R_Rend</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="..\r_rotsprite.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\r_patchtrees.h">
<Filter>R_Rend</Filter>
</ClInclude>
<ClInclude Include="..\r_portal.h"> <ClInclude Include="..\r_portal.h">
<Filter>R_Rend</Filter> <Filter>R_Rend</Filter>
</ClInclude> </ClInclude>
...@@ -946,6 +952,9 @@ ...@@ -946,6 +952,9 @@
<ClCompile Include="..\r_patch.c"> <ClCompile Include="..\r_patch.c">
<Filter>R_Rend</Filter> <Filter>R_Rend</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="..\r_rotsprite.c">
<Filter>R_Rend</Filter>
</ClCompile>
<ClCompile Include="..\r_portal.c"> <ClCompile Include="..\r_portal.c">
<Filter>R_Rend</Filter> <Filter>R_Rend</Filter>
</ClCompile> </ClCompile>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
...@@ -142,12 +142,5 @@ size_t Z_TagsUsage(INT32 lowtag, INT32 hightag); ...@@ -142,12 +142,5 @@ size_t Z_TagsUsage(INT32 lowtag, INT32 hightag);
// Miscellaneous functions // Miscellaneous functions
// //
char *Z_StrDup(const char *in); char *Z_StrDup(const char *in);
#define Z_Unlock(p) (void)p // TODO: remove this now that NDS code has been removed
// For renderer switching
extern boolean needpatchflush;
extern boolean needpatchrecache;
void Z_FlushCachedPatches(void);
void Z_PreparePatchFlush(void);
#endif #endif