Move git root from Client/ to src/ to track all source code: - Client: Game client source (moved to Client/Client/) - Server: Game server source - GameTools: Development tools - CryptoSource: Encryption utilities - database: Database scripts - Script: Game scripts - rylCoder_16.02.2008_src: Legacy coder tools - GMFont, Game: Additional resources 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
361 lines
12 KiB
C++
361 lines
12 KiB
C++
// SceneManager.h: interface for the CSceneManager class.
|
|
//
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
#if !defined(AFX_SCENEMANAGER_H__CCA3E492_5F66_478A_9BD4_891A99FEB846__INCLUDED_)
|
|
#define AFX_SCENEMANAGER_H__CCA3E492_5F66_478A_9BD4_891A99FEB846__INCLUDED_
|
|
|
|
#if _MSC_VER > 1000
|
|
#pragma once
|
|
#endif // _MSC_VER > 1000
|
|
|
|
#pragma warning( disable : 4786 )
|
|
|
|
#include <ViewCamera.h>
|
|
#include "HeightFieldScene.h"
|
|
#include "MeshObjectContainer.h"
|
|
#include "HouseObjectContainer.h"
|
|
#include "WeatherManager.h"
|
|
#include "LightContainer.h"
|
|
#include "ObjectScene.h"
|
|
#include "ObjectContainer.h"
|
|
#include "CollisionDetection.h"
|
|
#include "RenderTexture.h"
|
|
#include "Z3DGeneralChrModel.h"
|
|
#include "OctreeContainer.h"
|
|
#include "CharacterLightShadowManager.h"
|
|
#include "InitValue.h"
|
|
//#include "Particle.h"
|
|
//#include "ParticleManager.h"
|
|
#include "StateLog.h"
|
|
#include "InstanceObjectManager.h"
|
|
#include "BspScene.h"
|
|
#include "snowfall.h"
|
|
|
|
#include "GrassScene.h"
|
|
|
|
#include "RenderTargetTexture.h"
|
|
#include "RenderEnvTexture.h"
|
|
|
|
#include "ShadowMap.h"
|
|
#include "BoidScene.h"
|
|
#include "X3DEffectManager.h"
|
|
#include "SectorEffectMap.h" // Added by ClassView
|
|
#include "RenderTextureMipmap.h"
|
|
#include "GlareTexture.h"
|
|
#include "RenderOption.h"
|
|
|
|
#include "LightEffectManager.h"
|
|
//////////////////BSPÃß°¡
|
|
#include "RBspSceneManager.h"
|
|
#include "ShaderManager.h"
|
|
#include "WBWaterNormalTexGenerator.h"
|
|
#include "EffectCasher.h"
|
|
|
|
#include "GlareManager.h"
|
|
#include "ResourceLoader.h"
|
|
#include "CaldronHouseCacheMgr.h"
|
|
|
|
class WBEnvPlaneTex;
|
|
class CRainParticle;
|
|
class CChristmasParticle;
|
|
class CChristmasParticleManager;
|
|
class CFullSceneEffect;
|
|
class CSceneManager
|
|
{
|
|
|
|
|
|
static LPDIRECT3DDEVICE8 m_pd3dDevice;
|
|
CSceneNode *m_pSceneNodeRoot;
|
|
|
|
CGrassScene m_GrassScene;
|
|
static float m_fChrCameraInter;
|
|
static float m_fWeatherTime;
|
|
static float m_fWeatherTimeAdder;
|
|
CRenderTextureMipmap m_GlareTexture;
|
|
CRenderTextureMipmap m_FullSceneTexture;
|
|
CRenderTextureMipmap m_SpecularGlareTexture;
|
|
CRenderTexture m_GlareCompositeTexture;
|
|
//
|
|
////
|
|
|
|
LPDIRECT3DSURFACE8 m_pTempRenderSurface;
|
|
LPDIRECT3DSURFACE8 m_pTempRenderZBuffer;
|
|
|
|
bool m_FullSceneAnti;
|
|
int m_ScreenSize;
|
|
|
|
public:
|
|
CRainParticle *m_pRainParticle;
|
|
CChristmasParticle *m_pChristmasParticle;
|
|
CChristmasParticleManager *m_pChristmasParticleManager;
|
|
bool m_bChristmas;
|
|
|
|
static CGlareManager *m_GlareManager;
|
|
static bool m_bEnv;
|
|
|
|
static void SetCharacterDataNode(CCharacterLightShadowManager::CCharacterDataNode SetNode);
|
|
static CCharacterLightShadowManager::CCharacterDataNode GetCharacterDataNode(CZ3DGeneralChrModel *pChrmodel);
|
|
static void CharacterCollisionDetectType(CZ3DGeneralChrModel *pChrmodel, int nType);
|
|
void SetMapSize(vector3 vecMinSize,vector3 vecMaxSize);
|
|
void ResetTerrain();
|
|
static void CharacterGravityAble(CZ3DGeneralChrModel *pChrmodel, bool bGravityAble);
|
|
static void CharacterCollisionAble(CZ3DGeneralChrModel *pChrmodel,bool bCollisionDetectionAble);
|
|
static CZ3DGeneralChrModel* PickingCharacter(int MouseX,int MouseY);
|
|
static void CharacterFirstAccelate(CZ3DGeneralChrModel *pChrmodel,bool bFirstAccelate);
|
|
void SetSceneManagerPath(char *strSceneManagerPath);
|
|
static char m_SceneManagerPath[256];
|
|
void BaseGraphicsDataUnload();
|
|
void BaseGraphicsDataLoad(char *strZoneName);
|
|
static color m_FullSceneFade;
|
|
static CollisionType GetCharacterCollisionType(CZ3DGeneralChrModel *pChrmodel);
|
|
static vector3 PickMousePos(int nMx,int nMy);
|
|
static CLightEffectManager m_LightEffectManager;
|
|
////////////////BSPÃß°¡
|
|
static RBspSceneManager m_RBspSceneManager; // Bsp Scene Manager
|
|
static bool m_bRBspSceneIn; // Bsp ³»ºÎ¿¡ µé¾î¿Í ÀÖ´ÂÁö Flag
|
|
|
|
static WBWaterNormalTexGenerator *m_pWaterTexGenerator;
|
|
|
|
CGlareTexture m_SmoothGlareTexture;
|
|
void RenderSpecularGlareTexture();
|
|
class CGlareNode
|
|
{
|
|
public:
|
|
CMeshObject *m_pMeshObject;
|
|
matrix m_matPosition;
|
|
bool m_bCubeEnv;
|
|
};
|
|
static List<CGlareNode> m_GlareList;
|
|
static CTexture m_ChracterEnvTexture;
|
|
static LPDIRECT3DCUBETEXTURE8 m_LightCubeTexture;
|
|
|
|
static CRenderEnvTexture m_DiffuseLightCubeTexture;
|
|
static CRenderEnvTexture m_SpecularLightTexture;
|
|
|
|
static CRenderTexture m_SpGlareTexture;
|
|
static void AddGlareNode(CGlareNode AddNode)
|
|
{
|
|
m_GlareList.Add(AddNode);
|
|
};
|
|
|
|
void RenderFullSceneAnti();
|
|
void RenderFullSceneGlare();
|
|
void RenderFullSceneTextureEnd();
|
|
void RenderFullSceneTextureBegin();
|
|
void RenderGlareTexture();
|
|
static void CharacterRandomPos(CZ3DGeneralChrModel *pChrmodel,int nTimer, vector3 vecRand);
|
|
vector3 GetCharacterMovementVector(CZ3DGeneralChrModel *pChrmodel);
|
|
static void CharacterMovementVector(CZ3DGeneralChrModel *pChrmodel, vector3 vecMove,float fAccelate=0.0f);
|
|
static void DeleteEffect(CX3DEffect *);
|
|
static CSectorEffectMap* m_Effect_Map;
|
|
|
|
static CSectorEffectMap *m_PickEffect;
|
|
static BOOL m_bPickEffect;
|
|
static int m_EffectNum;
|
|
static BOOL EffectIsLive(XEFFECT hEffect);
|
|
static void DeleteEffect(XEFFECT hEffect);
|
|
static XEFFECT AddEffect(CX3DEffect *lpNewEffect);
|
|
|
|
static CEffScript *AddEffectScript (CEffScript *lpnewScript);
|
|
static void AddInterfaceScript (CEffScript *lpnewScript);
|
|
|
|
static void AddWorldEffect(CEffScript *lpnewScript);
|
|
static void DeleteAllEffect();
|
|
static void DeleteAllWorldEffect();
|
|
static CX3DEffectManager m_EffectManager;
|
|
|
|
static void MeshObjectReload(CMeshObject *pMesh);
|
|
static void PickingObjectReload();
|
|
static List<vector3> m_vecBspConvertList;
|
|
static List<CHouseObjectScene*> m_pBspConvertList;
|
|
static List<vector3> m_vecFieldConvertList;
|
|
static CHouseObjectScene *m_pBspScene;
|
|
// static CBoidScene m_Boid;
|
|
static void AddChrLight(CZ3DGeneralChrModel *pChrmodel,vector3 vecPos,DWORD dwColor,float fLens,DWORD dwTime);
|
|
|
|
static float GetWeatherTime(){return m_fWeatherTime;};
|
|
static void SetWeatherTime(float fWeatherTime){m_fWeatherTime=fWeatherTime;};
|
|
static float GetWeatherTimeAdder(){return m_fWeatherTimeAdder;};
|
|
static void SetWeatherTimeAdder(float fWeatherTimeAdder){m_fWeatherTimeAdder=fWeatherTimeAdder;};
|
|
static void AddDelayTimer(CZ3DGeneralChrModel *pChr,int nDelay);
|
|
static int GetCharacterEvent(CZ3DGeneralChrModel *pChrmodel,DWORD Event);
|
|
void AllObjectCalcLens();
|
|
CMapStorage m_MapStorage;
|
|
|
|
void LoadMap(char *strFilename);
|
|
static void CharacterHeightFix();
|
|
static void CharacterSoundPlay(CZ3DGeneralChrModel* pChrmodel,char *strSoundFile);
|
|
vector3 PickPointTerrain();
|
|
static float GetCameraInter(){return m_fChrCameraInter;};
|
|
static void SetCameraInter(float fInter){m_fChrCameraInter=fInter;};
|
|
static vector3 GetCharacterPos(int nCount);
|
|
static POINT GetChacterScreenPos(int nCount);
|
|
static int GetCharacterCount();
|
|
CSectorScene* PickTerrain();
|
|
static CTexture m_NsTexture;
|
|
static bool m_bEditor;
|
|
|
|
static void SetAllInstanceObjectColor(color Color);
|
|
static void SetIntanceObjectColor(int ID,color Color);
|
|
static int MouseOnCheckInstanceObject(int px,int py);
|
|
static void DeleteInstanceObject(int InstanceObjectID);
|
|
static int AddInstanceObject(char *strObjectName,vector3 vecPos);
|
|
|
|
// ÆÄƼŬ
|
|
//static CParticleSequence* AddParticle(vector3 vecPos,vector3 vecTarget);
|
|
// static CParticleManager m_ParticleManager;
|
|
//ij¸¯ÅÍ
|
|
static CCharacterLightShadowManager m_CharacterManager;
|
|
static CZ3DGeneralChrModel* AddCharacter( const char* szGCMDSName, const char* szFaceType, const char* szHairStyle );
|
|
static void DeleteCharacter(CZ3DGeneralChrModel* pDelChr);
|
|
static CollisionType CharacterCollisionType(CZ3DGeneralChrModel* pFindCharacter){return m_CharacterManager.CharacterCollisionType(pFindCharacter);};
|
|
static float m_fRemainFrame;
|
|
static CViewCamera *m_ViewCamera;
|
|
// ÇöÀç ¾ó¸¶³ª ÂïÈ÷³Ä?
|
|
static long m_cRenderVertex;
|
|
static long m_cRenderPolygon;
|
|
static long m_cRenderSector;
|
|
static long m_cRenderPrimitive;
|
|
|
|
static long m_cRenderSectorPoly;
|
|
static long m_cRenderSectorVertex;
|
|
|
|
//
|
|
static bool m_isCollisionDetection;
|
|
static int m_ViewerMode;
|
|
static CCollisionDetection m_CollisionDetection;
|
|
|
|
static WBEnvPlaneTex *m_pEnvPlaneTex;
|
|
|
|
void DeleteAllData();
|
|
CSectorScene* PickTerrain(float fXp,float fYp,float fZp);
|
|
static void CalculateOctree();
|
|
static void CalculateLightmap(int LightmapMode);
|
|
|
|
//Picking Object Instance//
|
|
static long m_bIsPickObjectMoving;
|
|
static bool m_bPickFix;
|
|
static CHouseObjectScene *m_PickHouseScene;
|
|
static CLightObjectScene *m_PickLightScene;
|
|
static CSectorLandscapeEffectMap *m_PickLandscape;
|
|
static CObjectScene *m_PickObjectScene;
|
|
static matrix m_matUndo;
|
|
static vector3 m_vecPickRayStart,m_vecPickRayDir;
|
|
static void PickMakeRay(int dx,int dy,int ScreenX,int ScreenY);
|
|
|
|
void PickLandscapeEffect(float fMx,float fMy,float fMz,int PickMode);
|
|
void PickLandscapeEffectMove(float fMx,float fMy,float fMz,float fAngle,float fAddy,int MoveMode=0);
|
|
void DeletePickingLandscapeEffect();
|
|
|
|
void PickEffect(float fMx,float fMy,float fMz);
|
|
void UnPickEffect();
|
|
|
|
void PickSectorEffect(int b);
|
|
void PickEffect2(int b);
|
|
|
|
void PickEffectMove(float fMx,float fMy,float fMz,float fAngle,float fAddy,int MoveMode=0);
|
|
void PickEffectRot(float x,float y,float z,int MoveMode = 0);
|
|
void DeletePickEffect();
|
|
// BSP Ãß°¡
|
|
void PickBspMove(float fMx,float fMy,float fMz,float fAngle,float fAddy,int MoveMode=0);
|
|
vector3 GetPickBspCenter();
|
|
void PickRBspObject(float x,float y,float z,int iPickValue);
|
|
void PickRBspObjectMove(float fMx,float fMy,float fMz,float fAngle,float fAddy,int iValue,int MoveMode=0);
|
|
void UnPickRBspScene();
|
|
|
|
|
|
void PickObject(float fPx,float fPy,float fPz,int PickMode);
|
|
void PickObjectMove(float fMx,float fMy,float fMz,float fAngle,float fAddy,int MoveMode=0);
|
|
void DeletePickingObject();
|
|
void Undo();
|
|
void UnPicking();
|
|
// return true À̸é Ãæµ¹
|
|
static bool CheckRayCollision(const D3DXVECTOR3 &vecPos1,const D3DXVECTOR3 &vecPos2);
|
|
|
|
void PickNextObject(int iOrder,int PickMode);
|
|
|
|
static void MakeUndoData();
|
|
// LOD Setting Data//
|
|
static int m_isTessellate;
|
|
//
|
|
// Detail Data//
|
|
static long m_DetailCharShadow,m_DetailMapShadow,m_DetailBuildShadow;
|
|
static long m_DetailTerrain,m_DetailChrMesh,m_DetailViewRange;
|
|
static long m_DetailWaterReflection,m_DetailLensflare,m_DetailTreeDetail;
|
|
//
|
|
|
|
static CHeightFieldScene m_HeightField;
|
|
|
|
bool m_bSnowFall;
|
|
static CSnowFall m_SnowFall; // Å©¸®½º¸¶½º ´« ³»¸®±â
|
|
static CMeshObjectContainer m_MeshObjectContainer;
|
|
static CHouseObjectContainer m_HouseObjectContainer;
|
|
static CLightContainer m_LightObjectContainer;
|
|
static CObjectContainer m_ObjectContainer;
|
|
static COctreeContainer m_OctreeContainer;
|
|
static CWeatherManager m_WeatherManager;
|
|
static CInstanceObjectManager m_InstanceObjectManager;
|
|
|
|
static CViewCamera* GetCamera(){return m_ViewCamera;};
|
|
static SetCamera(CViewCamera* pCamera){m_ViewCamera=pCamera;};
|
|
|
|
void UpdateScene(float fUpdateFrame);
|
|
void MouseMove(int dx,int dy);
|
|
|
|
void Render();
|
|
void Create();
|
|
void Create(CInitValue initValue,char *strPath);
|
|
CSceneManager();
|
|
virtual ~CSceneManager();
|
|
|
|
static void SetInView(bool bView) { m_bInView = bView; }
|
|
static bool GetInView() { return m_bInView;}
|
|
|
|
static void SetInViewHouseScene(CHouseObjectScene *pHouseScene) { m_pInViewHouseScene = pHouseScene;}
|
|
static CHouseObjectScene *GetInViewHouseScene() { return m_pInViewHouseScene; }
|
|
|
|
static LPDIRECT3DDEVICE8 GetDevice(){return m_pd3dDevice;};
|
|
static void SetDevice(LPDIRECT3DDEVICE8 pd3dDevice){m_pd3dDevice=pd3dDevice;};
|
|
|
|
static CSectorLight *m_pPickSectorLight;
|
|
static bool m_bRenderSectorLight;
|
|
|
|
static bool m_bCharacterLight;
|
|
static D3DLIGHT8 m_CharacterLight; // ¹ã¿ë character light
|
|
static float m_fGlowPlaneRange; // ¹ã¿ë glow Texture size
|
|
static bool m_bCharacterLightOp; // option ó¸®
|
|
|
|
static bool m_bSectorLightFactor;
|
|
static DWORD m_dwSectorLightFactor;
|
|
|
|
static CRenderOption::ZoneInfo m_ZoneInfoData;
|
|
static CShaderManager m_ShaderManager;
|
|
static CTexture *m_pBlackGlare;
|
|
static CEffectCasher *m_pEsfCasher;
|
|
static CFullSceneEffect *m_pFullSceneEffect;
|
|
CFullSceneEffect *m_pFullsceneEffect2;
|
|
|
|
static D3DXVECTOR3 m_vecLifeColor;
|
|
static bool m_bSceneNodeCulling;
|
|
static bool m_bMinimapGenerate;
|
|
static CSectorScene *m_pPickSector;
|
|
void RenderInCubemap();
|
|
static D3DXMATRIX GetCubeMatrix(int i,vector3 &vecDir);
|
|
|
|
static IDirect3DCubeTexture8* m_pWorldCubemap;
|
|
static ID3DXRenderToEnvMap* m_pRenderEnvMap;
|
|
static bool m_bInView; // true À϶§ ³»ºÎ ¾À
|
|
static CHouseObjectScene *m_pInViewHouseScene;
|
|
|
|
// static Caldron::Base::CResourceLoader *m_pResourceLoader;
|
|
// static CCaldronHouseCacheMgr *m_pCaldronHouseCacheMgr;
|
|
|
|
|
|
///
|
|
|
|
|
|
};
|
|
|
|
#endif // !defined(AFX_SCENEMANAGER_H__CCA3E492_5F66_478A_9BD4_891A99FEB846__INCLUDED_)
|