的笔记

随时随地编辑

读读武侠

I.渲染属性

const CHAR CRenderSystem::sz32BitTexturesVar[]                = "View_ColorQuality"//"yszl";//颜色质量,比特数(16/32位)
const CHAR CRenderSystem::szDefaultTextureFilteringVar[]    = "View_TextureFiltering";//"cy";        //采样(高/中/低)
const CHAR CRenderSystem::szLightmapQualityVar[]            = "View_LightmapQuality";//"dxyy";    //地形阴影(高/低/无)
const CHAR CRenderSystem::szAnimationQualityVar[]            = "View_ObjectMove";//"wtdh";    //静态物体动画(开/关)
const CHAR CRenderSystem::szPostFilterEnabledVar[]            = "View_FullScreenLight";//"qpfg";    //全屏泛光效果(开/关)
const CHAR CRenderSystem::szFSAAVar[]                        = "View_Fanhunjiao";//"fhj";    //反混角(1/2/4)
const CHAR CRenderSystem::szShadowTechniqueVar[]            = "View_HumanLightmap";//"rwyy";    //人物阴影(开/关)
const CHAR CRenderSystem::szvsyncVar[]                        = "View_Aplomb";//"cztb";    //垂直同步(开/关)

II.登陆逻辑

加载场景(CRenderSystem::Scene_Load)
------>加载当前场景
           ------>清理静态几何体
           ------>清理硬件缓存  
           ------>清理PASS MAP
          ------>加载场景
                     ------>ExpatParser解析SCENE文件
                     ------>加载地形
------>销毁不使用资源
------>设置lightmap
------>设置环境特效
------>推场景事件GE_SCENE_TRANSED(将进入场景事件推入入CEventSystem::m_mapEventIndex_AsID)
------>设置传送点(从DBC数据库中读出当前场景名作为关键字的场景信息中的传送点)

创建Player对象(绑定相关Plaer属性、设置位置,绑定服务器信息、绑定相机)
推Plaer事件GE_PLAYER_ENTER_WORLD
推角色选择事件(GE_GAMELOGIN_CLOSE_SELECT_CHARACTOR)
推背景界面事件(GE_GAMELOGIN_CLOSE_BACK_GROUND)

转入游戏主循环状态机(CGameProcedure::s_pProcMain)

call statck
 1WXClient.exe!CGamePro_Enter::EnterScene
 2WXClient.exe!Packets::GCEnterSceneHandler::Execute
 3WXClient.exe!Packets::GCEnterScene::Execute
 4WXClient.exe!CNetManager::executePacket_CPP_Exception
 5WXClient.exe!CNetManager::executePacket_Gen_Exception
 6WXClient.exe!CNetManager::ProcessInputStream
 7WXClient.exe!CNetManager::ProcessCommands
 8WXClient.exe!CNetManager::WaitPacket
 9WXClient.exe!CNetManager::TickGameEnterProcedure
10WXClient.exe!CNetManager::Tick
11WXClient.exe!CGameProcedure::Tick
12WXClient.exe!CGamePro_Enter::Tick
13WXClient.exe!CGameProcedure::TickActive
14WXClient.exe!CGameProcedure::MainLoop

最坏帧率控制
VOID CRenderSystem::RenderFrame(VOID)
{
    
if(!Ogre::Root::getSingletonPtr())
    
{
        TDThrow(
"Ogre::Root = 0");
    }


    
const UINT MAX_RENDER_INTER_TIME = 2000;

    
static UINT s_nLastRenderTime = 0;
    UINT s_nTimeNow 
= g_pTimeSystem->GetTimeNow();

    
if(g_pTimeSystem->CalSubTime(s_nLastRenderTime, s_nTimeNow) > MAX_RENDER_INTER_TIME)
    
{
        Ogre::Root::getSingleton().clearEventTimes();
        s_nLastRenderTime 
= s_nTimeNow;
        
return;
    }

    s_nLastRenderTime 
= s_nTimeNow;
    
    Ogre::Root::getSingleton().renderOneFrame();
}
当主循环暂停后(例如调试中断),返回后避免逻辑异常。到底是避免神马异常呢?

OGRE\武侠交流群:46060118

posted on 2011-07-01 11:17 的笔记 阅读(330) 评论(0)  编辑 收藏 引用


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理