Beispiel #1
0
void gCamera::MouseMove(SDL_MouseMotionEvent& mouse)
{
	if ( mouse.state & SDL_BUTTON_LMASK )
	{
		UpdateUV(mouse.xrel/400.0f, mouse.yrel/400.0f);
	}
}
void KSceneSFXEditorBillboardPage::UpdateSpecifiedUI()
{
    GET_SFX_EDITOR();
    int nSelect = m_comboBillboard.GetCurSel();
    KG_PROCESS_ERROR(nSelect != -1);

    IEKG3DSFX *pSFX = NULL;
    pScene->GetSFX(&pSFX);
    IEKG3DSFXBillboard *pBillboard = NULL;
    pSFX->GetBillboard(nSelect, &pBillboard);
    ASSERT(pBillboard);
    int nFrame = pFrame->GetKeysFrame()->m_Slider.GetCurPos();

    if (m_radioWidth.GetCheck())
        UpdateBillboardWidth(pBillboard, nFrame);
    else if (m_radioHeight.GetCheck())
        UpdateBillboardHeight(pBillboard, nFrame);
    else if (m_radioColor.GetCheck())
        UpdateBillboardColor(pBillboard, nFrame);
    else if (m_radioTextureFrameIndex.GetCheck())
        UpdateTextureFrameIndex1(pBillboard, nFrame);
    else if (m_radioTexture2FrameIndex.GetCheck())
        UpdateTextureFrameIndex2(pBillboard, nFrame);
    else if (m_radioRotationAnimation.GetCheck())
        UpdateRotation(pBillboard, nFrame);
    else if (m_radioUVOffset.GetCheck())
        UpdateUV(pBillboard, nFrame);
Exit0:
    return;
}
void KSceneSFXEditorBillboardPage::OnEnSetfocusEditUOffset()
{
    // TODO: Add your control notification handler code here
    GET_SFX_EDITOR();
    GET_BILLBOARD();

    CheckRadioButton(IDC_RADIO_BILLBOARD_COLOR, IDC_RADIO_UV_OFFSET, IDC_RADIO_UV_OFFSET);
    OnBnClickedRadioUvOffset();

    int nFrame = pFrame->GetKeysFrame()->m_Slider.GetCurPos();
    UpdateUV(pBillboard, nFrame);
}
void KSceneSFXEditorBillboardPage::UpdateBillboardUI()
{
    GET_SFX_EDITOR();

    int nSelect = m_comboBillboard.GetCurSel();
    if (nSelect == CB_ERR)
    {
        m_editBillboardName.EnableWindow(FALSE);
        m_checkSpecialAdjustAxis.EnableWindow(FALSE);
        m_comboBlendMode.EnableWindow(FALSE);
        m_comboType.EnableWindow(FALSE);
        m_radioWidth.EnableWindow(FALSE);
        m_editWidth.EnableWindow(FALSE);
        m_radioHeight.EnableWindow(FALSE);
        m_editHeight.EnableWindow(FALSE);
        m_radioColor.EnableWindow(FALSE);
        m_picColor.EnableWindow(FALSE);
        m_radioTextureFrameIndex.EnableWindow(FALSE);
        m_editTextureFrameIndex.EnableWindow(FALSE);
        m_radioTexture2FrameIndex.EnableWindow(FALSE);
        m_editTexture2FrameIndex.EnableWindow(FALSE);
        m_checkRotationAnimation.EnableWindow(FALSE);
        m_radioRotationAnimation.EnableWindow(FALSE);
        m_editRotationAnimation.EnableWindow(FALSE);
        m_radioUVOffset.EnableWindow(FALSE);
        m_editOffsetU.EnableWindow(FALSE);
        m_editOffsetV.EnableWindow(FALSE);
        m_editTextureName.EnableWindow(FALSE);
        m_editTexture2Name.EnableWindow(FALSE);
        m_buttonBrowseTextureName.EnableWindow(FALSE);
        m_buttonBrowseTexture2Name.EnableWindow(FALSE);
        m_editTextureCut.EnableWindow(FALSE);
        m_editTexture2Cut.EnableWindow(FALSE);
        return;
    }
    else
    {
        m_editBillboardName.EnableWindow();
        m_checkSpecialAdjustAxis.EnableWindow();
        m_comboBlendMode.EnableWindow();
        m_comboType.EnableWindow();
        m_radioWidth.EnableWindow();
        m_editWidth.EnableWindow();
        m_radioHeight.EnableWindow();
        m_editHeight.EnableWindow();
        m_radioColor.EnableWindow();
        m_picColor.EnableWindow();
        m_radioTextureFrameIndex.EnableWindow();
        m_editTextureFrameIndex.EnableWindow();
        m_radioTexture2FrameIndex.EnableWindow();
        m_editTexture2FrameIndex.EnableWindow();
        m_checkRotationAnimation.EnableWindow();
        m_radioRotationAnimation.EnableWindow();
        m_editRotationAnimation.EnableWindow();
        m_radioUVOffset.EnableWindow();
        m_editOffsetU.EnableWindow();
        m_editOffsetV.EnableWindow();
        m_editTextureName.EnableWindow();
        m_editTexture2Name.EnableWindow();
        m_buttonBrowseTextureName.EnableWindow();
        m_buttonBrowseTexture2Name.EnableWindow();
        m_editTextureCut.EnableWindow();
        m_editTexture2Cut.EnableWindow();
    }

    IEKG3DSFX *pSFX = NULL;
    pScene->GetSFX(&pSFX);
    IEKG3DSFXBillboard *pBillboard = NULL;
    pSFX->GetBillboard(nSelect, &pBillboard);
    ASSERT(pBillboard);
    int nFrame = pFrame->GetKeysFrame()->m_Slider.GetCurPos();

    UpdateBlendMode(pBillboard);
    UpdateBillboardName(pScene, nSelect);
    UpdateBillboardColor(pBillboard, nFrame);
    UpdateBillboardWidth(pBillboard, nFrame);
    UpdateBillboardHeight(pBillboard, nFrame);
    UpdateTextureFrameIndex1(pBillboard, nFrame);
    UpdateTextureFrameIndex2(pBillboard, nFrame);
    UpdateRotation(pBillboard, nFrame);
    UpdateUV(pBillboard, nFrame);
    UpdateTextureName1(pBillboard);
    UpdateTextureName2(pBillboard);
    UpdateTextureCut1(pBillboard);
    UpdateTextureCut2(pBillboard);
    UpdateType(pBillboard);
}