Exemple #1
0
//----------------------------------------------------
void TUI::IR_OnMouseMove(int x, int y){
	if (!m_bReady) return;
    bool bRayUpdated = false;

	if (!EDevice.m_Camera.Process(m_ShiftState,x,y)){
        if( m_MouseCaptured || m_MouseMultiClickCaptured ){
            if( Tools->HiddenMode() ){
				m_DeltaCpH.set(x,y);
                if( m_DeltaCpH.x || m_DeltaCpH.y ){
                	Tools->MouseMove(m_ShiftState);
                }
            }else{
                IR_GetMousePosReal(EDevice.m_hRenderWnd, m_CurrentCp);
                EDevice.m_Camera.MouseRayFromPoint(m_CurrentRStart,m_CurrentRDir,m_CurrentCp);
                Tools->MouseMove(m_ShiftState);
            }
		    RedrawScene();
            bRayUpdated = true;
        }
    }
    if (!bRayUpdated){
		IR_GetMousePosReal(EDevice.m_hRenderWnd, m_CurrentCp);
        EDevice.m_Camera.MouseRayFromPoint(m_CurrentRStart,m_CurrentRDir,m_CurrentCp);
    }
    // Out cursor pos
    OutUICursorPos	();
}
Exemple #2
0
void TUI::MousePress(TShiftState Shift, int X, int Y)
{
	if (!m_bReady) return;
    if (m_MouseCaptured) return;

    bMouseInUse = true;

    m_ShiftState = Shift;

    // camera activate
    if(!EDevice.m_Camera.MoveStart(m_ShiftState)){
    	if (Tools->Pick(Shift)) return;
        if( !m_MouseCaptured ){
            if( Tools->HiddenMode() ){
				IR_GetMousePosScreen(m_StartCpH);
                m_DeltaCpH.set(0,0);
            }else{
                IR_GetMousePosReal(EDevice.m_hRenderWnd, m_CurrentCp);
                m_StartCp = m_CurrentCp;
                EDevice.m_Camera.MouseRayFromPoint(m_CurrentRStart, m_CurrentRDir, m_CurrentCp );
            }

            if(Tools->MouseStart(m_ShiftState)){
                if(Tools->HiddenMode()) ShowCursor( FALSE );
                m_MouseCaptured = true;
            }
        }
    }
    RedrawScene();
}
Exemple #3
0
void TUI::MouseRelease(TShiftState Shift, int X, int Y)
{
	if (!m_bReady) return;

    m_ShiftState = Shift;

    if( EDevice.m_Camera.IsMoving() ){
        if (EDevice.m_Camera.MoveEnd(m_ShiftState)) bMouseInUse = false;
    }else{
	    bMouseInUse = false;
        if( m_MouseCaptured ){
            if( !Tools->HiddenMode() ){
                IR_GetMousePosReal(EDevice.m_hRenderWnd, m_CurrentCp);
                EDevice.m_Camera.MouseRayFromPoint(m_CurrentRStart,m_CurrentRDir,m_CurrentCp );
            }
            if( Tools->MouseEnd(m_ShiftState) ){
                if( Tools->HiddenMode() ){
                    SetCursorPos(m_StartCpH.x,m_StartCpH.y);
                    ShowCursor( TRUE );
                }
                m_MouseCaptured = false;
            }
        }
    }
    // update tools (change action)
    Tools->OnFrame	();
    RedrawScene		();
}
Exemple #4
0
void TickRender()
{
	PROFILE_FUNCTION;

#if BUILD_DEV
	++g_DEBUGTickRenderCount;
#endif

	RedrawScene();

	ASCIISurface::ABlit( *g_MenuSurface, *g_BackBufferSurface );
	g_Renderer->Draw( *g_BackBufferSurface );
}