Skip to content

Commit

Permalink
r__sector_detect refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
v2v3v4 committed Sep 29, 2024
1 parent 5fda3b7 commit 1d4c50c
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 71 deletions.
12 changes: 9 additions & 3 deletions src/Layers/xrRender/r__sector_detect.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
#include "stdafx.h"
#if USE_DX11
#if (RENDER==R_R4)
#include "r4.h"
#else
#endif
#if (RENDER==R_R2)
#include "r2.h"
#endif
#if (RENDER==R_R1)
#include "FStaticRender.h"
#endif

int CRender::translateSector(IRender_Sector* pSector)
{
Expand All @@ -28,7 +32,7 @@ IRender_Sector* CRender::detectSector(const Fvector& P)
{
IRender_Sector* S = nullptr;
Fvector dir;
Sectors_xrc.ray_options (CDB::OPT_ONLYNEAREST);
Sectors_xrc.ray_options (CDB::OPT_ONLYFIRST|CDB::OPT_ONLYNEAREST);

dir.set (0,-1,0);
S = detectSector(P,dir);
Expand All @@ -42,6 +46,8 @@ IRender_Sector* CRender::detectSector(const Fvector& P)

IRender_Sector* CRender::detectSector(const Fvector& P, Fvector& dir)
{
if(SectorsCount()==1)
return pOutdoorSector;
// Portals model
int id1 = -1;
float range1 = 500.f;
Expand Down
1 change: 0 additions & 1 deletion src/Layers/xrRenderPC_R1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ list(FILTER XRR1_SRC_FILES EXCLUDE REGEX "../xrRender/light_smapvis.cpp")
list(FILTER XRR1_SRC_FILES EXCLUDE REGEX "../xrRender/light_smapvis.h")
list(FILTER XRR1_SRC_FILES EXCLUDE REGEX "../xrRender/light_vis.cpp")
list(FILTER XRR1_SRC_FILES EXCLUDE REGEX "../xrRender/lights_render.cpp")
list(FILTER XRR1_SRC_FILES EXCLUDE REGEX "../xrRender/r__sector_detect.cpp")
list(FILTER XRR1_SRC_FILES EXCLUDE REGEX "../xrRender/r__blenders.cpp")
list(FILTER XRR1_SRC_FILES EXCLUDE REGEX "../xrRender/R_calculate.cpp")
list(FILTER XRR1_SRC_FILES EXCLUDE REGEX "../xrRender/r__types.h")
Expand Down
3 changes: 3 additions & 0 deletions src/Layers/xrRenderPC_R1/FStaticRender.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ class CRender : public R_dsgraph_structure
virtual IRender_Sector* getSector (int id);
virtual IRenderVisual* getVisual (int id);
virtual IRender_Sector* detectSector (const Fvector& P);
IRender_Sector* detectSector (const Fvector& P, Fvector& D);
xr_vector<IRender_Sector*> detectSectors_sphere (CSector* sector, const Fvector& b_center, const Fvector& b_dim);
xr_vector<IRender_Sector*> detectSectors_frustum (CSector* sector, CFrustum* _frustum);
int translateSector (IRender_Sector* pSector);
virtual IRender_Target* getTarget ();
virtual SurfaceParams getSurface(const char* nameTexture) override;
Expand Down
67 changes: 0 additions & 67 deletions src/Layers/xrRenderPC_R1/FStaticRender_DetectSector.cpp

This file was deleted.

0 comments on commit 1d4c50c

Please sign in to comment.