- backported GZDoom extensions to renderer interface.

SVN r3266 (trunk)
This commit is contained in:
Christoph Oelckers 2011-07-07 21:43:49 +00:00
parent 85bd2e02c9
commit 55bb4afac8
3 changed files with 14 additions and 8 deletions

View file

@ -46,9 +46,7 @@
#include "c_dispatch.h" #include "c_dispatch.h"
#include "sc_man.h" #include "sc_man.h"
#include "g_level.h" #include "g_level.h"
#ifdef GLSUPPORT #include "r_renderer.h"
#include "gl/gl_functions.h"
#endif
//========================================================================== //==========================================================================
// //
@ -186,9 +184,7 @@ void FS_EmulateCmd(char * string)
{ {
sc.MustGetNumber(); sc.MustGetNumber();
// Using this disables most MAPINFO fog options! // Using this disables most MAPINFO fog options!
#ifdef GLSUPPORT Renderer->SetFogParams(sc.Number*70/400, 0xff000000, 0, 0);
gl_SetFogParams(sc.Number*70/400, 0xff000000, 0, 0);
#endif
} }
else if (sc.Compare("gr_fogcolor")) else if (sc.Compare("gr_fogcolor"))
{ {

View file

@ -66,6 +66,7 @@
#include "md5.h" #include "md5.h"
#include "compatibility.h" #include "compatibility.h"
#include "po_man.h" #include "po_man.h"
#include "r_renderer.h"
#include "r_data/colormaps.h" #include "r_data/colormaps.h"
#include "fragglescript/t_fs.h" #include "fragglescript/t_fs.h"
@ -3273,6 +3274,7 @@ extern polyblock_t **PolyBlockMap;
void P_FreeLevelData () void P_FreeLevelData ()
{ {
Renderer->CleanLevelData();
FPolyObj::ClearAllSubsectorLinks(); // can't be done as part of the polyobj deletion process. FPolyObj::ClearAllSubsectorLinks(); // can't be done as part of the polyobj deletion process.
SN_StopAllSequences (); SN_StopAllSequences ();
DThinker::DestroyAllThinkers (); DThinker::DestroyAllThinkers ();
@ -3445,7 +3447,8 @@ void P_SetupLevel (char *lumpname, int position)
bool buildmap; bool buildmap;
// This is motivated as follows: // This is motivated as follows:
bool RequireGLNodes = am_textured;
bool RequireGLNodes = Renderer->RequireGLNodes() || am_textured;
for (i = 0; i < (int)countof(times); ++i) for (i = 0; i < (int)countof(times); ++i)
{ {
@ -3756,7 +3759,7 @@ void P_SetupLevel (char *lumpname, int position)
bool BuildGLNodes; bool BuildGLNodes;
if (ForceNodeBuild) if (ForceNodeBuild)
{ {
BuildGLNodes = am_textured || multiplayer || demoplayback || demorecording || genglnodes; BuildGLNodes = Renderer->RequireGLNodes() || am_textured || multiplayer || demoplayback || demorecording || genglnodes;
startTime = I_FPSTime (); startTime = I_FPSTime ();
TArray<FNodeBuilder::FPolyStart> polyspots, anchors; TArray<FNodeBuilder::FPolyStart> polyspots, anchors;
@ -3900,6 +3903,9 @@ void P_SetupLevel (char *lumpname, int position)
// set up world state // set up world state
P_SpawnSpecials (); P_SpawnSpecials ();
// This must be done BEFORE the PolyObj Spawn!!!
Renderer->PreprocessLevel();
times[16].Clock(); times[16].Clock();
if (reloop) P_LoopSidedefs (false); if (reloop) P_LoopSidedefs (false);
PO_Init (); // Initialize the polyobjs PO_Init (); // Initialize the polyobjs

View file

@ -60,6 +60,10 @@ struct FRenderer
virtual void CopyStackedViewParameters() {} virtual void CopyStackedViewParameters() {}
virtual void RenderTextureView (FCanvasTexture *tex, AActor *viewpoint, int fov) = 0; virtual void RenderTextureView (FCanvasTexture *tex, AActor *viewpoint, int fov) = 0;
virtual sector_t *FakeFlat(sector_t *sec, sector_t *tempsec, int *floorlightlevel, int *ceilinglightlevel, bool back) = 0; virtual sector_t *FakeFlat(sector_t *sec, sector_t *tempsec, int *floorlightlevel, int *ceilinglightlevel, bool back) = 0;
virtual void SetFogParams(int _fogdensity, PalEntry _outsidefogcolor, int _outsidefogdensity, int _skyfog) {}
virtual void PreprocessLevel() {}
virtual void CleanLevelData() {}
virtual bool RequireGLNodes() { return false; }
}; };