MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / SetFog

Method SetFog

LuaSTGPlus/AppFrame.cpp:631–662  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

629}
630
631void AppFrame::SetFog(float start, float end, fcyColor color)
632{
633 if (m_Graph2D->IsInRender())
634 m_Graph2D->Flush();
635
636 // 从f2dRenderDevice中取出D3D设备
637 IDirect3DDevice9* pDev = (IDirect3DDevice9*)m_pRenderDev->GetHandle();
638
639 if (start != end)
640 {
641 pDev->SetRenderState(D3DRS_FOGENABLE, TRUE);
642 pDev->SetRenderState(D3DRS_FOGCOLOR, color.argb);
643 if (start == -1.0f)
644 {
645 pDev->SetRenderState(D3DRS_FOGTABLEMODE, D3DFOG_EXP);
646 pDev->SetRenderState(D3DRS_FOGDENSITY, *(DWORD *)(&end));
647 }
648 else if (start == -2.0f)
649 {
650 pDev->SetRenderState(D3DRS_FOGTABLEMODE, D3DFOG_EXP2);
651 pDev->SetRenderState(D3DRS_FOGDENSITY, *(DWORD *)(&end));
652 }
653 else
654 {
655 pDev->SetRenderState(D3DRS_FOGTABLEMODE, D3DFOG_LINEAR);
656 pDev->SetRenderState(D3DRS_FOGSTART, *(DWORD *)(&start));
657 pDev->SetRenderState(D3DRS_FOGEND, *(DWORD *)(&end));
658 }
659 }
660 else
661 pDev->SetRenderState(D3DRS_FOGENABLE, FALSE);
662}
663
664bool AppFrame::RenderText(ResFont* p, wchar_t* strBuf, fcyRect rect, fcyVec2 scale, ResFont::FontAlignHorizontal halign, ResFont::FontAlignVertical valign, bool bWordBreak)LNOEXCEPT
665{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected