diff options
| author | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:31:46 -0800 |
|---|---|---|
| committer | Jørgen P. Tjernø <[email protected]> | 2013-12-02 19:46:31 -0800 |
| commit | f56bb35301836e56582a575a75864392a0177875 (patch) | |
| tree | de61ddd39de3e7df52759711950b4c288592f0dc /sp/src/utils/qc_eyes | |
| parent | Mark some more files as text. (diff) | |
| download | source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.tar.xz source-sdk-2013-f56bb35301836e56582a575a75864392a0177875.zip | |
Fix line endings. WHAMMY.
Diffstat (limited to 'sp/src/utils/qc_eyes')
| -rw-r--r-- | sp/src/utils/qc_eyes/QC_Eyes.cpp | 146 | ||||
| -rw-r--r-- | sp/src/utils/qc_eyes/QC_Eyes.h | 100 | ||||
| -rw-r--r-- | sp/src/utils/qc_eyes/QC_EyesDlg.cpp | 1410 | ||||
| -rw-r--r-- | sp/src/utils/qc_eyes/QC_EyesDlg.h | 268 | ||||
| -rw-r--r-- | sp/src/utils/qc_eyes/StdAfx.cpp | 18 | ||||
| -rw-r--r-- | sp/src/utils/qc_eyes/StdAfx.h | 56 | ||||
| -rw-r--r-- | sp/src/utils/qc_eyes/qc_eyes.vpc | 134 | ||||
| -rw-r--r-- | sp/src/utils/qc_eyes/resource.h | 156 |
8 files changed, 1144 insertions, 1144 deletions
diff --git a/sp/src/utils/qc_eyes/QC_Eyes.cpp b/sp/src/utils/qc_eyes/QC_Eyes.cpp index d62fe124..179391df 100644 --- a/sp/src/utils/qc_eyes/QC_Eyes.cpp +++ b/sp/src/utils/qc_eyes/QC_Eyes.cpp @@ -1,73 +1,73 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-// QC_Eyes.cpp : Defines the class behaviors for the application.
-//
-
-#include "stdafx.h"
-#include "QC_Eyes.h"
-#include "QC_EyesDlg.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CQC_EyesApp
-
-BEGIN_MESSAGE_MAP(CQC_EyesApp, CWinApp)
- //{{AFX_MSG_MAP(CQC_EyesApp)
- // NOTE - the ClassWizard will add and remove mapping macros here.
- // DO NOT EDIT what you see in these blocks of generated code!
- //}}AFX_MSG
- ON_COMMAND(ID_HELP, CWinApp::OnHelp)
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CQC_EyesApp construction
-
-CQC_EyesApp::CQC_EyesApp()
-{
- // TODO: add construction code here,
- // Place all significant initialization in InitInstance
-}
-
-/////////////////////////////////////////////////////////////////////////////
-// The one and only CQC_EyesApp object
-
-CQC_EyesApp theApp;
-
-/////////////////////////////////////////////////////////////////////////////
-// CQC_EyesApp initialization
-
-BOOL CQC_EyesApp::InitInstance()
-{
- AfxEnableControlContainer();
-
- // Standard initialization
- // If you are not using these features and wish to reduce the size
- // of your final executable, you should remove from the following
- // the specific initialization routines you do not need.
-
-#ifdef _AFXDLL
- Enable3dControls(); // Call this when using MFC in a shared DLL
-#endif
-
- CQC_EyesDlg dlg;
- m_pMainWnd = &dlg;
- INT_PTR nResponse = dlg.DoModal();
- if (nResponse == IDOK)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with OK
- }
- else if (nResponse == IDCANCEL)
- {
- // TODO: Place code here to handle when the dialog is
- // dismissed with Cancel
- }
-
- // Since the dialog has been closed, return FALSE so that we exit the
- // application, rather than start the application's message pump.
- return FALSE;
-}
+//========= Copyright Valve Corporation, All rights reserved. ============// +// QC_Eyes.cpp : Defines the class behaviors for the application. +// + +#include "stdafx.h" +#include "QC_Eyes.h" +#include "QC_EyesDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CQC_EyesApp + +BEGIN_MESSAGE_MAP(CQC_EyesApp, CWinApp) + //{{AFX_MSG_MAP(CQC_EyesApp) + // NOTE - the ClassWizard will add and remove mapping macros here. + // DO NOT EDIT what you see in these blocks of generated code! + //}}AFX_MSG + ON_COMMAND(ID_HELP, CWinApp::OnHelp) +END_MESSAGE_MAP() + +///////////////////////////////////////////////////////////////////////////// +// CQC_EyesApp construction + +CQC_EyesApp::CQC_EyesApp() +{ + // TODO: add construction code here, + // Place all significant initialization in InitInstance +} + +///////////////////////////////////////////////////////////////////////////// +// The one and only CQC_EyesApp object + +CQC_EyesApp theApp; + +///////////////////////////////////////////////////////////////////////////// +// CQC_EyesApp initialization + +BOOL CQC_EyesApp::InitInstance() +{ + AfxEnableControlContainer(); + + // Standard initialization + // If you are not using these features and wish to reduce the size + // of your final executable, you should remove from the following + // the specific initialization routines you do not need. + +#ifdef _AFXDLL + Enable3dControls(); // Call this when using MFC in a shared DLL +#endif + + CQC_EyesDlg dlg; + m_pMainWnd = &dlg; + INT_PTR nResponse = dlg.DoModal(); + if (nResponse == IDOK) + { + // TODO: Place code here to handle when the dialog is + // dismissed with OK + } + else if (nResponse == IDCANCEL) + { + // TODO: Place code here to handle when the dialog is + // dismissed with Cancel + } + + // Since the dialog has been closed, return FALSE so that we exit the + // application, rather than start the application's message pump. + return FALSE; +} diff --git a/sp/src/utils/qc_eyes/QC_Eyes.h b/sp/src/utils/qc_eyes/QC_Eyes.h index 240cb3d1..e1068d65 100644 --- a/sp/src/utils/qc_eyes/QC_Eyes.h +++ b/sp/src/utils/qc_eyes/QC_Eyes.h @@ -1,50 +1,50 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-// QC_Eyes.h : main header file for the QC_EYES application
-//
-
-#if !defined(AFX_QC_EYES_H__398BAF8D_D3C0_4326_BEF0_5129884EE1A3__INCLUDED_)
-#define AFX_QC_EYES_H__398BAF8D_D3C0_4326_BEF0_5129884EE1A3__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#ifndef __AFXWIN_H__
- #error include 'stdafx.h' before including this file for PCH
-#endif
-
-#include "resource.h" // main symbols
-
-/////////////////////////////////////////////////////////////////////////////
-// CQC_EyesApp:
-// See QC_Eyes.cpp for the implementation of this class
-//
-
-class CQC_EyesApp : public CWinApp
-{
-public:
- CQC_EyesApp();
-
-// Overrides
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CQC_EyesApp)
- public:
- virtual BOOL InitInstance();
- //}}AFX_VIRTUAL
-
-// Implementation
-
- //{{AFX_MSG(CQC_EyesApp)
- // NOTE - the ClassWizard will add and remove member functions here.
- // DO NOT EDIT what you see in these blocks of generated code !
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-
-/////////////////////////////////////////////////////////////////////////////
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_QC_EYES_H__398BAF8D_D3C0_4326_BEF0_5129884EE1A3__INCLUDED_)
+//========= Copyright Valve Corporation, All rights reserved. ============// +// QC_Eyes.h : main header file for the QC_EYES application +// + +#if !defined(AFX_QC_EYES_H__398BAF8D_D3C0_4326_BEF0_5129884EE1A3__INCLUDED_) +#define AFX_QC_EYES_H__398BAF8D_D3C0_4326_BEF0_5129884EE1A3__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#ifndef __AFXWIN_H__ + #error include 'stdafx.h' before including this file for PCH +#endif + +#include "resource.h" // main symbols + +///////////////////////////////////////////////////////////////////////////// +// CQC_EyesApp: +// See QC_Eyes.cpp for the implementation of this class +// + +class CQC_EyesApp : public CWinApp +{ +public: + CQC_EyesApp(); + +// Overrides + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CQC_EyesApp) + public: + virtual BOOL InitInstance(); + //}}AFX_VIRTUAL + +// Implementation + + //{{AFX_MSG(CQC_EyesApp) + // NOTE - the ClassWizard will add and remove member functions here. + // DO NOT EDIT what you see in these blocks of generated code ! + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + + +///////////////////////////////////////////////////////////////////////////// + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_QC_EYES_H__398BAF8D_D3C0_4326_BEF0_5129884EE1A3__INCLUDED_) diff --git a/sp/src/utils/qc_eyes/QC_EyesDlg.cpp b/sp/src/utils/qc_eyes/QC_EyesDlg.cpp index 863e556a..d76d916a 100644 --- a/sp/src/utils/qc_eyes/QC_EyesDlg.cpp +++ b/sp/src/utils/qc_eyes/QC_EyesDlg.cpp @@ -1,705 +1,705 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-// QC_EyesDlg.cpp : implementation file
-//
-
-#include "stdafx.h"
-#include <math.h>
-#include "QC_Eyes.h"
-#include "QC_EyesDlg.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CQC_EyesDlg dialog
-
-CQC_EyesDlg::CQC_EyesDlg(CWnd* pParent /*=NULL*/)
- : CDialog(CQC_EyesDlg::IDD, pParent)
-{
- //{{AFX_DATA_INIT(CQC_EyesDlg)
- // NOTE: the ClassWizard will add member initialization here
- //}}AFX_DATA_INIT
- // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
- m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
- m_pBitmapHead = NULL;
-}
-
-void CQC_EyesDlg::DoDataExchange(CDataExchange* pDX)
-{
- CDialog::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CQC_EyesDlg)
- DDX_Control(pDX, IDC_LEFT_LID_CONTROL, m_IndependentLeftLidControl);
- DDX_Control(pDX, IDC_PICTURES, m_PictureControl);
- //}}AFX_DATA_MAP
-}
-
-BEGIN_MESSAGE_MAP(CQC_EyesDlg, CDialog)
- //{{AFX_MSG_MAP(CQC_EyesDlg)
- ON_WM_PAINT()
- ON_WM_QUERYDRAGICON()
- ON_BN_CLICKED(IDC_CREATE_QC_TEXT, OnCreateQcText)
- ON_BN_CLICKED(IDC_IRIS_COLOR_BROWN, OnIrisColorBrown)
- ON_BN_CLICKED(IDC_IRIS_COLOR_GREEN, OnIrisColorGreen)
- ON_BN_CLICKED(IDC_IRIS_COLOR_BLUE, OnIrisColorBlue)
- ON_BN_CLICKED(IDC_EYE_COLOR_DARK, OnEyeColorDark)
- ON_BN_CLICKED(IDC_EYE_COLOR_LIGHT, OnEyeColorLight)
- ON_EN_SETFOCUS(IDC_RIGHT_EYE_X, OnSetfocusRightEyeX)
- ON_EN_SETFOCUS(IDC_RIGHT_EYE_Y, OnSetfocusRightEyeY)
- ON_EN_SETFOCUS(IDC_RIGHT_EYE_Z, OnSetfocusRightEyeZ)
- ON_EN_SETFOCUS(IDC_LEFT_EYE_X, OnSetfocusLeftEyeX)
- ON_EN_SETFOCUS(IDC_LEFT_EYE_Y, OnSetfocusLeftEyeY)
- ON_EN_SETFOCUS(IDC_LEFT_EYE_Z, OnSetfocusLeftEyeZ)
- ON_EN_SETFOCUS(IDC_UPPER_LID_LOWERED, OnSetfocusUpperLidLowered)
- ON_EN_SETFOCUS(IDC_UPPER_LID_NEUTRAL, OnSetfocusUpperLidNeutral)
- ON_EN_SETFOCUS(IDC_UPPER_LID_RAISED, OnSetfocusUpperLidRaised)
- ON_EN_SETFOCUS(IDC_LOWER_LID_LOWERED, OnSetfocusLowerLidLowered)
- ON_EN_SETFOCUS(IDC_LOWER_LID_NEUTRAL, OnSetfocusLowerLidNeutral)
- ON_EN_SETFOCUS(IDC_LOWER_LID_RAISED, OnSetfocusLowerLidRaised)
- ON_BN_CLICKED(IDC_COPY_TEXT_TO_CLIPBOARD, OnCopyTextToClipboard)
- ON_BN_CLICKED(IDC_DEFAULT_CONTROLS, OnDefaultControls)
- ON_BN_CLICKED(IDC_ADVANCED_CONTROLS, OnAdvancedControls)
- ON_BN_CLICKED(IDC_LEFT_LID_CONTROL, OnLeftLidControl)
- //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-void CQC_EyesDlg::AddText( const char *pFormat, ... )
-{
- char tempMsg[4096];
- va_list marker;
- va_start( marker, pFormat );
- _vsnprintf( tempMsg, sizeof( tempMsg ), pFormat, marker );
- tempMsg[ ARRAYSIZE(tempMsg) - 1 ] = 0;
- va_end( marker );
-
- size_t nCharsInBuf = strlen( m_Buf );
- size_t nCharsInMsg = strlen( tempMsg );
-
- if ( nCharsInBuf + nCharsInMsg + 1 > m_BufSize )
- {
- m_BufSize = nCharsInBuf + nCharsInMsg + 4096;
- char *newbuf = new char[m_BufSize];
- memcpy( newbuf, m_Buf, nCharsInBuf + 1 );
- delete [] m_Buf;
- m_Buf = newbuf;
- }
-
- strcat( m_Buf, tempMsg );
-}
-
-
-void SendToEditControl( HWND hEditControl, const char *pText )
-{
- LRESULT nLen = SendMessage( hEditControl, EM_GETLIMITTEXT, 0, 0 );
- SendMessage( hEditControl, EM_SETSEL, nLen, nLen );
- SendMessage( hEditControl, EM_REPLACESEL, FALSE, (LPARAM)pText );
-}
-
-
-void FormatAndSendToEditControl( void *hWnd, const char *pText )
-{
- HWND hEditControl = (HWND)hWnd;
-
- // Translate \n to \r\n.
- char outMsg[1024];
- const char *pIn = pText;
- char *pOut = outMsg;
- while ( *pIn )
- {
- if ( *pIn == '\n' )
- {
- *pOut = '\r';
- pOut++;
- }
- *pOut = *pIn;
-
- ++pIn;
- ++pOut;
-
- if ( pOut - outMsg >= 1020 )
- {
- *pOut = 0;
- SendToEditControl( hEditControl, outMsg );
- pOut = outMsg;
- }
- }
- *pOut = 0;
- SendToEditControl( hEditControl, outMsg );
-}
-
-
-HBITMAP CQC_EyesDlg::GetCachedBitmap( UINT id )
-{
- for ( CBitmapRef *pCur=m_pBitmapHead; pCur; pCur=pCur->m_pNext )
- {
- if ( pCur->m_iResource == id )
- return pCur->m_hBitmap;
- }
-
- CBitmapRef *pNew = new CBitmapRef;
- pNew->m_iResource = id;
- pNew->m_hBitmap = ::LoadBitmap( AfxGetInstanceHandle(), MAKEINTRESOURCE(id) );
- pNew->m_pNext = m_pBitmapHead;
- m_pBitmapHead = pNew;
-
- return pNew->m_hBitmap;
-}
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CQC_EyesDlg message handlers
-
-BOOL CQC_EyesDlg::OnInitDialog()
-{
- CDialog::OnInitDialog();
-
- // Set the icon for this dialog. The framework does this automatically
- // when the application's main window is not a dialog
- SetIcon(m_hIcon, TRUE); // Set big icon
- SetIcon(m_hIcon, FALSE); // Set small icon
-
- // TODO: Add extra initialization here
- GetDlgItem( IDC_REFERENCE_FILENAME )->SetWindowText( "filename_reference" );
- GetDlgItem( IDC_EXPRESSIONS_FILENAME )->SetWindowText( "filename_expressions" );
- GetDlgItem( IDC_MODEL_FILENAME )->SetWindowText( "filename_model" );
- GetDlgItem( IDC_IRIS_SIZE )->SetWindowText( "0.63" );
- GetDlgItem( IDC_EYEBALL_SIZE )->SetWindowText( "1.0" );
-
- ::SendMessage( ::GetDlgItem( m_hWnd, IDC_Y_AXIS_UP ), BM_SETCHECK, BST_CHECKED, 0 );
- ::SendMessage( ::GetDlgItem( m_hWnd, IDC_DEFAULT_CONTROLS ), BM_SETCHECK, BST_CHECKED, 0 );
- ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_BROWN ), BM_SETCHECK, BST_CHECKED, 0 );
- ::SendMessage( ::GetDlgItem( m_hWnd, IDC_EYE_COLOR_LIGHT ), BM_SETCHECK, BST_CHECKED, 0 );
-
- m_hOutputText = ::GetDlgItem( m_hWnd, IDC_OUTPUT_TEXT );
-
- m_PictureControl.SetBitmap( GetCachedBitmap( IDB_EYE_DEFAULT ) );
- OnDefaultControls(); // Hide the advanced controls.
-
- return TRUE; // return TRUE unless you set the focus to a control
-}
-
-// If you add a minimize button to your dialog, you will need the code below
-// to draw the icon. For MFC applications using the document/view model,
-// this is automatically done for you by the framework.
-
-void CQC_EyesDlg::OnPaint()
-{
- if (IsIconic())
- {
- CPaintDC dc(this); // device context for painting
-
- SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
-
- // Center icon in client rectangle
- int cxIcon = GetSystemMetrics(SM_CXICON);
- int cyIcon = GetSystemMetrics(SM_CYICON);
- CRect rect;
- GetClientRect(&rect);
- int x = (rect.Width() - cxIcon + 1) / 2;
- int y = (rect.Height() - cyIcon + 1) / 2;
-
- // Draw the icon
- dc.DrawIcon(x, y, m_hIcon);
- }
- else
- {
- CDialog::OnPaint();
- }
-}
-
-// The system calls this to obtain the cursor to display while the user drags
-// the minimized window.
-HCURSOR CQC_EyesDlg::OnQueryDragIcon()
-{
- return (HCURSOR) m_hIcon;
-}
-
-
-void HandleYAxisUp( float &yVal, float &zVal )
-{
- float flTemp = yVal;
- yVal = -zVal;
- zVal = flTemp;
-}
-
-
-float CQC_EyesDlg::GetDlgItemFloat( UINT id )
-{
- char text[4096];
- GetDlgItemText( id, text, sizeof( text ) );
- return (float)atof( text );
-}
-
-
-bool CQC_EyesDlg::IsOptionChecked( UINT option )
-{
- return (::SendMessage( ::GetDlgItem( m_hWnd, option ), BM_GETCHECK, 0, 0 ) == BST_CHECKED);
-}
-
-
-void CQC_EyesDlg::GetDialogParams( CDialogParams &p )
-{
- p.m_flLeftEye[0] = GetDlgItemFloat( IDC_LEFT_EYE_X );
- p.m_flLeftEye[1] = GetDlgItemFloat( IDC_LEFT_EYE_Y );
- p.m_flLeftEye[2] = GetDlgItemFloat( IDC_LEFT_EYE_Z );
-
- p.m_flRightEye[0] = GetDlgItemFloat( IDC_RIGHT_EYE_X );
- p.m_flRightEye[1] = GetDlgItemFloat( IDC_RIGHT_EYE_Y );
- p.m_flRightEye[2] = GetDlgItemFloat( IDC_RIGHT_EYE_Z );
-
- bool bYAxisUp = IsOptionChecked( IDC_Y_AXIS_UP );
- if ( bYAxisUp )
- {
- HandleYAxisUp( p.m_flLeftEye[1], p.m_flLeftEye[2] );
- HandleYAxisUp( p.m_flRightEye[1], p.m_flRightEye[2] );
- }
-
- GetDlgItemText( IDC_REFERENCE_FILENAME, p.m_ReferenceFilename, sizeof( p.m_ReferenceFilename ) );
- GetDlgItemText( IDC_EXPRESSIONS_FILENAME, p.m_ExpressionsFilename, sizeof( p.m_ExpressionsFilename ) );
- GetDlgItemText( IDC_MODEL_FILENAME, p.m_ModelFilename, sizeof( p.m_ModelFilename ) );
-
- p.m_flIrisSize = GetDlgItemFloat( IDC_IRIS_SIZE );
- p.m_flEyeballSize = GetDlgItemFloat( IDC_EYEBALL_SIZE );
-
- p.m_flRightUpperLidRaised = GetDlgItemFloat( IDC_UPPER_LID_RAISED );
- p.m_flRightUpperLidNeutral = GetDlgItemFloat( IDC_UPPER_LID_NEUTRAL );
- p.m_flRightUpperLidLowered = GetDlgItemFloat( IDC_UPPER_LID_LOWERED );
-
- p.m_flRightLowerLidRaised = GetDlgItemFloat( IDC_LOWER_LID_RAISED );
- p.m_flRightLowerLidNeutral = GetDlgItemFloat( IDC_LOWER_LID_NEUTRAL );
- p.m_flRightLowerLidLowered = GetDlgItemFloat( IDC_LOWER_LID_LOWERED );
-
- if ( IsIndependentLeftLidControlEnabled() )
- {
- p.m_flLeftUpperLidRaised = GetDlgItemFloat( IDC_UPPER_LEFT_LID_RAISED );
- p.m_flLeftUpperLidNeutral = GetDlgItemFloat( IDC_UPPER_LEFT_LID_NEUTRAL );
- p.m_flLeftUpperLidLowered = GetDlgItemFloat( IDC_UPPER_LEFT_LID_LOWERED );
-
- p.m_flLeftLowerLidRaised = GetDlgItemFloat( IDC_LOWER_LEFT_LID_RAISED );
- p.m_flLeftLowerLidNeutral = GetDlgItemFloat( IDC_LOWER_LEFT_LID_NEUTRAL );
- p.m_flLeftLowerLidLowered = GetDlgItemFloat( IDC_LOWER_LEFT_LID_LOWERED );
- }
- else
- {
- // Left lids follow the right lids.
- p.m_flLeftUpperLidRaised = p.m_flRightUpperLidRaised;
- p.m_flLeftUpperLidNeutral = p.m_flRightUpperLidNeutral;
- p.m_flLeftUpperLidLowered = p.m_flRightUpperLidLowered;
-
- p.m_flLeftLowerLidRaised = p.m_flRightLowerLidRaised;
- p.m_flLeftLowerLidNeutral = p.m_flRightLowerLidNeutral;
- p.m_flLeftLowerLidLowered = p.m_flRightLowerLidLowered;
- }
-
- // Figure out the eyeball prefix.
- if ( IsOptionChecked( IDC_EYE_COLOR_LIGHT ) )
- strcpy( p.m_EyeballPrefix, "eyeball" );
- else
- strcpy( p.m_EyeballPrefix, "dark_eyeball" );
-
- // Figure out the pupil prefix.
- if ( IsOptionChecked( IDC_IRIS_COLOR_BROWN ) )
- strcpy( p.m_PupilPrefix, "pupil" );
- else if ( IsOptionChecked( IDC_IRIS_COLOR_GREEN ) )
- strcpy( p.m_PupilPrefix, "grn_pupil" );
- else
- strcpy( p.m_PupilPrefix, "bl_pupil" );
-}
-
-
-void CQC_EyesDlg::GenerateQCText()
-{
- CDialogParams p;
- GetDialogParams( p );
-
-
- m_BufSize = 16 * 1024;
- m_Buf = new char[m_BufSize];
- m_Buf[0] = 0;
-
- AddText( "//start eye/face data\n" );
- AddText( "$eyeposition 0 0 70\n\n" );
-
- AddText( "//head controllers\n" );
- AddText( "$attachment \"eyes\" \"ValveBiped.Bip01_Head1\" %.2f %.2f %.2f absolute\n",
- p.m_flLeftEye[0] - ((fabs( p.m_flRightEye[0] ) + p.m_flLeftEye[0]) * 0.5),
- (p.m_flLeftEye[1] + p.m_flRightEye[1]) * 0.5,
- (p.m_flLeftEye[2] + p.m_flRightEye[2]) * 0.5 );
-
- AddText( "$attachment \"mouth\" \"ValveBiped.Bip01_Head1\" 0.80 -5.80 -0.15 rotate 0 -80 -90\n\n" );
-
- AddText( "$model %s \"%s.smd\" {\n",
- p.m_ModelFilename, p.m_ReferenceFilename );
-
- AddText( "\teyeball righteye \"ValveBiped.Bip01_Head1\" %.2f %.2f %.2f \"%s_r\" %.2f 4 \"%s_r\" %.2f\n",
- p.m_flRightEye[0],
- p.m_flRightEye[1],
- p.m_flRightEye[2],
- p.m_EyeballPrefix,
- p.m_flEyeballSize,
- p.m_PupilPrefix,
- p.m_flIrisSize );
-
- AddText( "\teyeball lefteye \"ValveBiped.Bip01_Head1\" %.2f %.2f %.2f \"%s_l\" %.2f -4 \"%s_l\" %.2f\n\n",
- p.m_flLeftEye[0],
- p.m_flLeftEye[1],
- p.m_flLeftEye[2],
- p.m_EyeballPrefix,
- p.m_flEyeballSize,
- p.m_PupilPrefix,
- p.m_flIrisSize );
-
- AddText( "\teyelid upper_right \"%s\" lowerer 1 %.2f neutral 0 %.2f raiser 2 %.2f split 0.1 eyeball righteye\n",
- p.m_ExpressionsFilename,
- p.m_flRightUpperLidLowered - p.m_flRightEye[2],
- p.m_flRightUpperLidNeutral - p.m_flRightEye[2],
- p.m_flRightUpperLidRaised - p.m_flRightEye[2] );
-
- AddText( "\teyelid lower_right \"%s\" lowerer 3 %.2f neutral 0 %.2f raiser 4 %.2f split 0.1 eyeball righteye\n",
- p.m_ExpressionsFilename,
- p.m_flRightLowerLidLowered - p.m_flRightEye[2],
- p.m_flRightLowerLidNeutral - p.m_flRightEye[2],
- p.m_flRightLowerLidRaised - p.m_flRightEye[2] );
-
- AddText( "\teyelid upper_left \"%s\" lowerer 1 %.2f neutral 0 %.2f raiser 2 %.2f split -0.1 eyeball lefteye\n",
- p.m_ExpressionsFilename,
- p.m_flLeftUpperLidLowered - p.m_flLeftEye[2],
- p.m_flLeftUpperLidNeutral - p.m_flLeftEye[2],
- p.m_flLeftUpperLidRaised - p.m_flLeftEye[2] );
-
- AddText( "\teyelid lower_left \"%s\" lowerer 3 %.2f neutral 0 %.2f raiser 4 %.2f split -0.1 eyeball lefteye\n\n",
- p.m_ExpressionsFilename,
- p.m_flLeftLowerLidLowered - p.m_flLeftEye[2],
- p.m_flLeftLowerLidNeutral - p.m_flLeftEye[2],
- p.m_flLeftLowerLidRaised - p.m_flLeftEye[2] );
-
- AddText( "\tmouth 0 \"mouth\" \"ValveBiped.Bip01_Head1\" 0 1 0 // mouth illumination\n" );
- AddText( "\tflexfile \"%s\" {\n", p.m_ExpressionsFilename );
- AddText( "\t\t$include \"../standardflex_xsi.qci\"\n" );
- AddText( "\t}\n" );
- AddText( "\t$include \"../facerules_xsi.qci\"\n" );
- AddText( "\t$include \"../bodyrules_xsi.qci\"\n" );
- AddText( "}\n" );
- AddText( "//end eye/face data\n" );
-}
-
-
-bool CQC_EyesDlg::CheckNumericInputs()
-{
- struct
- {
- const char *pControlName;
- UINT controlID;
- }
- controls[] =
- {
- {"Right Eye X", IDC_RIGHT_EYE_X},
- {"Right Eye Y", IDC_RIGHT_EYE_Y},
- {"Right Eye Z", IDC_RIGHT_EYE_Z},
-
- {"Left Eye X", IDC_LEFT_EYE_X},
- {"Left Eye Y", IDC_LEFT_EYE_Y},
- {"Left Eye Z", IDC_LEFT_EYE_Z},
-
- {"Upper Lid Raised", IDC_UPPER_LID_RAISED},
- {"Upper Lid Neutral", IDC_UPPER_LID_NEUTRAL},
- {"Upper Lid Lowered", IDC_UPPER_LID_LOWERED},
-
- {"Lower Lid Raised", IDC_LOWER_LID_RAISED},
- {"Lower Lid Neutral", IDC_LOWER_LID_NEUTRAL},
- {"Lower Lid Lowered", IDC_LOWER_LID_LOWERED},
-
- {"Upper Left Lid Raised", IDC_UPPER_LEFT_LID_RAISED},
- {"Upper Left Lid Neutral", IDC_UPPER_LEFT_LID_NEUTRAL},
- {"Upper Left Lid Lowered", IDC_UPPER_LEFT_LID_LOWERED},
-
- {"Lower Left Lid Raised", IDC_LOWER_LEFT_LID_RAISED},
- {"Lower Left Lid Neutral", IDC_LOWER_LEFT_LID_NEUTRAL},
- {"Lower Left Lid Lowered", IDC_LOWER_LEFT_LID_LOWERED},
-
- {"Iris Size", IDC_IRIS_SIZE},
- {"Eyeball Size", IDC_EYEBALL_SIZE}
- };
-
- for ( int i=0; i < sizeof( controls ) / sizeof( controls[0] ); i++ )
- {
- char text[512];
- GetDlgItem( controls[i].controlID )->GetWindowText( text, sizeof( text ) );
-
- for ( int z=0; z < (int)strlen( text ); z++ )
- {
- if ( text[z] < '0' || text[z] > '9' )
- {
- if ( text[z] != '.' && text[z] != '-' )
- {
- char errMsg[512];
- _snprintf( errMsg, sizeof( errMsg ), "The '%s' control must have a numeric value.", controls[i].pControlName );
- AfxMessageBox( errMsg, MB_OK );
- return false;
- }
- }
- }
- }
-
- return true;
-}
-
-
-void CQC_EyesDlg::OnCreateQcText()
-{
- if ( !CheckNumericInputs() )
- return;
-
- GenerateQCText();
-
- // Clear the edit control.
- LRESULT nLen = ::SendMessage( m_hOutputText, EM_GETLIMITTEXT, 0, 0 );
- ::SendMessage( m_hOutputText, EM_SETSEL, 0, nLen );
- ::SendMessage( m_hOutputText, EM_REPLACESEL, FALSE, (LPARAM)"" );
-
- FormatAndSendToEditControl( m_hOutputText, m_Buf );
-
- delete [] m_Buf;
-}
-
-void CQC_EyesDlg::OnIrisColorBrown()
-{
- ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_BROWN ), BM_SETCHECK, BST_CHECKED, 0 );
- ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_GREEN ), BM_SETCHECK, BST_UNCHECKED, 0 );
- ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_BLUE ), BM_SETCHECK, BST_UNCHECKED, 0 );
- SetupBitmapLabel( IDB_EYE_DEFAULT, "" );
-}
-
-void CQC_EyesDlg::OnIrisColorGreen()
-{
- ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_BROWN ), BM_SETCHECK, BST_UNCHECKED, 0 );
- ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_GREEN ), BM_SETCHECK, BST_CHECKED, 0 );
- ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_BLUE ), BM_SETCHECK, BST_UNCHECKED, 0 );
- SetupBitmapLabel( IDB_EYE_DEFAULT, "" );
-}
-
-void CQC_EyesDlg::OnIrisColorBlue()
-{
- ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_BROWN ), BM_SETCHECK, BST_UNCHECKED, 0 );
- ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_GREEN ), BM_SETCHECK, BST_UNCHECKED, 0 );
- ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_BLUE ), BM_SETCHECK, BST_CHECKED, 0 );
- SetupBitmapLabel( IDB_EYE_DEFAULT, "" );
-}
-
-void CQC_EyesDlg::OnEyeColorDark()
-{
- ::SendMessage( ::GetDlgItem( m_hWnd, IDC_EYE_COLOR_LIGHT ), BM_SETCHECK, BST_UNCHECKED, 0 );
- ::SendMessage( ::GetDlgItem( m_hWnd, IDC_EYE_COLOR_DARK ), BM_SETCHECK, BST_CHECKED, 0 );
- SetupBitmapLabel( IDB_EYE_DEFAULT, "" );
-}
-
-void CQC_EyesDlg::OnEyeColorLight()
-{
- ::SendMessage( ::GetDlgItem( m_hWnd, IDC_EYE_COLOR_LIGHT ), BM_SETCHECK, BST_CHECKED, 0 );
- ::SendMessage( ::GetDlgItem( m_hWnd, IDC_EYE_COLOR_DARK ), BM_SETCHECK, BST_UNCHECKED, 0 );
- SetupBitmapLabel( IDB_EYE_DEFAULT, "" );
-}
-
-void CQC_EyesDlg::SetupBitmapLabel( UINT iBitmapResourceID, const char *pString, ... )
-{
- char msg[4096];
- va_list marker;
- va_start( marker, pString );
- _vsnprintf( msg, sizeof( msg ), pString, marker );
- msg[ ARRAYSIZE(msg) - 1 ] = 0;
- va_end( marker );
-
- m_PictureControl.SetBitmap( GetCachedBitmap( iBitmapResourceID ) );
- GetDlgItem( IDC_PICTURE_LABEL )->SetWindowText( msg );
-}
-
-void CQC_EyesDlg::OnSetfocusRightEyeX()
-{
- SetupBitmapLabel( IDB_EYE_XY_R, "Enter the X position of the center vertex of the right eye" );
-}
-
-void CQC_EyesDlg::OnSetfocusRightEyeY()
-{
- SetupBitmapLabel( IsOptionChecked( IDC_Y_AXIS_UP ) ? IDB_EYE_XY_R : IDB_EYE_Z_R, "Enter the Y position of the center vertex of the right eye" );
-}
-
-void CQC_EyesDlg::OnSetfocusRightEyeZ()
-{
- SetupBitmapLabel( IsOptionChecked( IDC_Y_AXIS_UP ) ? IDB_EYE_Z_R : IDB_EYE_XY_R, "Enter the Z position of the center vertex of the right eye" );
-}
-
-void CQC_EyesDlg::OnSetfocusLeftEyeX()
-{
- SetupBitmapLabel( IDB_EYE_XY_L, "Enter the X position of the center vertex of the right eye" );
-}
-
-void CQC_EyesDlg::OnSetfocusLeftEyeY()
-{
- SetupBitmapLabel( IsOptionChecked( IDC_Y_AXIS_UP ) ? IDB_EYE_XY_L : IDB_EYE_Z_L, "Enter the Y position of the center vertex of the right eye" );
-}
-
-void CQC_EyesDlg::OnSetfocusLeftEyeZ()
-{
- SetupBitmapLabel( IsOptionChecked( IDC_Y_AXIS_UP ) ? IDB_EYE_Z_L : IDB_EYE_XY_L, "Enter the Z position of the center vertex of the right eye" );
-}
-
-void CQC_EyesDlg::OnSetfocusUpperLidLowered()
-{
- const char *pCoord = IsOptionChecked( IDC_Y_AXIS_UP ) ? "Y" : "Z";
- SetupBitmapLabel( IDB_EYE_UPPER_LO, "At Frame 1, enter the %s position of the center vertex of the right upper eye lid", pCoord );
-}
-
-void CQC_EyesDlg::OnSetfocusUpperLidNeutral()
-{
- const char *pCoord = IsOptionChecked( IDC_Y_AXIS_UP ) ? "Y" : "Z";
- SetupBitmapLabel( IDB_EYE_UPPER_MID, "At Frame 0, enter the %s position of the center vertex of the right upper eye lid", pCoord );
-}
-
-void CQC_EyesDlg::OnSetfocusUpperLidRaised()
-{
- const char *pCoord = IsOptionChecked( IDC_Y_AXIS_UP ) ? "Y" : "Z";
- SetupBitmapLabel( IDB_EYE_UPPER_HI, "At Frame 2, enter the %s position of the center vertex of the right upper eye lid", pCoord );
-}
-
-
-void CQC_EyesDlg::OnSetfocusLowerLidLowered()
-{
- const char *pCoord = IsOptionChecked( IDC_Y_AXIS_UP ) ? "Y" : "Z";
- SetupBitmapLabel( IDB_EYE_LOWER_LO, "At Frame 3, enter the %s position of the center vertex of the right lower eye lid", pCoord );
-}
-
-void CQC_EyesDlg::OnSetfocusLowerLidNeutral()
-{
- const char *pCoord = IsOptionChecked( IDC_Y_AXIS_UP ) ? "Y" : "Z";
- SetupBitmapLabel( IDB_EYE_LOWER_MID, "At Frame 0, enter the %s position of the center vertex of the right lower eye lid", pCoord );
-}
-
-void CQC_EyesDlg::OnSetfocusLowerLidRaised()
-{
- const char *pCoord = IsOptionChecked( IDC_Y_AXIS_UP ) ? "Y" : "Z";
- SetupBitmapLabel( IDB_EYE_LOWER_HI, "At Frame 4, enter the %s position of the center vertex of the right lower eye lid", pCoord );
-}
-
-void CQC_EyesDlg::OnCopyTextToClipboard()
-{
- if ( !CheckNumericInputs() )
- return;
-
- GenerateQCText();
-
- if ( !OpenClipboard() )
- return;
-
- size_t textLen = strlen( m_Buf );
- HANDLE hmem = GlobalAlloc( GMEM_MOVEABLE | GMEM_DDESHARE, textLen + 1 );
- if ( hmem )
- {
- void *ptr = GlobalLock( hmem );
- if ( ptr )
- {
- memcpy( ptr, m_Buf, textLen+1 );
- GlobalUnlock( hmem );
-
- SetClipboardData( CF_TEXT, hmem );
- }
- }
-
- CloseClipboard();
-
- delete [] m_Buf;
-}
-
-
-int g_AdvancedControls[] =
-{
- IDC_EYE_DETAIL_CONTROL_FRAME,
- IDC_IRIS_SIZE,
- IDC_IRIS_SIZE_LABEL,
- IDC_EYEBALL_SIZE,
- IDC_EYEBALL_SIZE_LABEL,
- IDC_LEFT_LID_CONTROL
-};
-#define NUM_ADVANCED_CONTROLS ( sizeof( g_AdvancedControls ) / sizeof( g_AdvancedControls[0] ) )
-
-int g_LeftLidPositionControls[] =
-{
- IDC_UPPER_LEFT_LID_PANEL,
- IDC_UPPER_LEFT_LID_RAISED,
- IDC_UPPER_LEFT_LID_RAISED_LABEL,
- IDC_UPPER_LEFT_LID_NEUTRAL,
- IDC_UPPER_LEFT_LID_NEUTRAL_LABEL,
- IDC_UPPER_LEFT_LID_LOWERED,
- IDC_UPPER_LEFT_LID_LOWERED_LABEL,
- IDC_LOWER_LEFT_LID_PANEL,
- IDC_LOWER_LEFT_LID_RAISED,
- IDC_LOWER_LEFT_LID_RAISED_LABEL,
- IDC_LOWER_LEFT_LID_NEUTRAL,
- IDC_LOWER_LEFT_LID_NEUTRAL_LABEL,
- IDC_LOWER_LEFT_LID_LOWERED,
- IDC_LOWER_LEFT_LID_LOWERED_LABEL
-};
-#define NUM_LEFT_LID_POSITION_CONTROLS ( sizeof( g_LeftLidPositionControls ) / sizeof( g_LeftLidPositionControls[0] ) )
-
-
-void CQC_EyesDlg::OnDefaultControls()
-{
- GetDlgItem( IDC_PICTURES )->ShowWindow( SW_SHOW );
-
- // Hide all the advanced controls.
- for ( int i=0; i < NUM_ADVANCED_CONTROLS; i++ )
- {
- GetDlgItem( g_AdvancedControls[i] )->ShowWindow( SW_HIDE );
- }
-
- for ( int i=0; i < NUM_LEFT_LID_POSITION_CONTROLS; i++ )
- {
- GetDlgItem( g_LeftLidPositionControls[i] )->ShowWindow( SW_HIDE );
- }
-
-}
-
-void CQC_EyesDlg::OnAdvancedControls()
-{
- GetDlgItem( IDC_PICTURES )->ShowWindow( SW_HIDE );
-
- // Show the advanced controls.
- for ( int i=0; i < NUM_ADVANCED_CONTROLS; i++ )
- {
- GetDlgItem( g_AdvancedControls[i] )->ShowWindow( SW_SHOW );
- GetDlgItem( g_AdvancedControls[i] )->InvalidateRect( NULL );
- }
-
- if ( IsIndependentLeftLidControlEnabled() )
- {
- OnLeftLidControl();
- }
-}
-
-
-bool CQC_EyesDlg::IsIndependentLeftLidControlEnabled()
-{
- return m_IndependentLeftLidControl.GetCheck() == 1;
-}
-
-void CQC_EyesDlg::OnLeftLidControl()
-{
- if ( IsIndependentLeftLidControlEnabled() )
- {
- for ( int i=0; i < NUM_LEFT_LID_POSITION_CONTROLS; i++ )
- {
- GetDlgItem( g_LeftLidPositionControls[i] )->ShowWindow( SW_SHOW );
- GetDlgItem( g_LeftLidPositionControls[i] )->InvalidateRect( NULL );
- }
- }
- else
- {
- for ( int i=0; i < NUM_LEFT_LID_POSITION_CONTROLS; i++ )
- {
- GetDlgItem( g_LeftLidPositionControls[i] )->ShowWindow( SW_HIDE );
- GetDlgItem( g_LeftLidPositionControls[i] )->InvalidateRect( NULL );
- }
- }
-}
+//========= Copyright Valve Corporation, All rights reserved. ============// +// QC_EyesDlg.cpp : implementation file +// + +#include "stdafx.h" +#include <math.h> +#include "QC_Eyes.h" +#include "QC_EyesDlg.h" + +#ifdef _DEBUG +#define new DEBUG_NEW +#undef THIS_FILE +static char THIS_FILE[] = __FILE__; +#endif + +///////////////////////////////////////////////////////////////////////////// +// CQC_EyesDlg dialog + +CQC_EyesDlg::CQC_EyesDlg(CWnd* pParent /*=NULL*/) + : CDialog(CQC_EyesDlg::IDD, pParent) +{ + //{{AFX_DATA_INIT(CQC_EyesDlg) + // NOTE: the ClassWizard will add member initialization here + //}}AFX_DATA_INIT + // Note that LoadIcon does not require a subsequent DestroyIcon in Win32 + m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME); + m_pBitmapHead = NULL; +} + +void CQC_EyesDlg::DoDataExchange(CDataExchange* pDX) +{ + CDialog::DoDataExchange(pDX); + //{{AFX_DATA_MAP(CQC_EyesDlg) + DDX_Control(pDX, IDC_LEFT_LID_CONTROL, m_IndependentLeftLidControl); + DDX_Control(pDX, IDC_PICTURES, m_PictureControl); + //}}AFX_DATA_MAP +} + +BEGIN_MESSAGE_MAP(CQC_EyesDlg, CDialog) + //{{AFX_MSG_MAP(CQC_EyesDlg) + ON_WM_PAINT() + ON_WM_QUERYDRAGICON() + ON_BN_CLICKED(IDC_CREATE_QC_TEXT, OnCreateQcText) + ON_BN_CLICKED(IDC_IRIS_COLOR_BROWN, OnIrisColorBrown) + ON_BN_CLICKED(IDC_IRIS_COLOR_GREEN, OnIrisColorGreen) + ON_BN_CLICKED(IDC_IRIS_COLOR_BLUE, OnIrisColorBlue) + ON_BN_CLICKED(IDC_EYE_COLOR_DARK, OnEyeColorDark) + ON_BN_CLICKED(IDC_EYE_COLOR_LIGHT, OnEyeColorLight) + ON_EN_SETFOCUS(IDC_RIGHT_EYE_X, OnSetfocusRightEyeX) + ON_EN_SETFOCUS(IDC_RIGHT_EYE_Y, OnSetfocusRightEyeY) + ON_EN_SETFOCUS(IDC_RIGHT_EYE_Z, OnSetfocusRightEyeZ) + ON_EN_SETFOCUS(IDC_LEFT_EYE_X, OnSetfocusLeftEyeX) + ON_EN_SETFOCUS(IDC_LEFT_EYE_Y, OnSetfocusLeftEyeY) + ON_EN_SETFOCUS(IDC_LEFT_EYE_Z, OnSetfocusLeftEyeZ) + ON_EN_SETFOCUS(IDC_UPPER_LID_LOWERED, OnSetfocusUpperLidLowered) + ON_EN_SETFOCUS(IDC_UPPER_LID_NEUTRAL, OnSetfocusUpperLidNeutral) + ON_EN_SETFOCUS(IDC_UPPER_LID_RAISED, OnSetfocusUpperLidRaised) + ON_EN_SETFOCUS(IDC_LOWER_LID_LOWERED, OnSetfocusLowerLidLowered) + ON_EN_SETFOCUS(IDC_LOWER_LID_NEUTRAL, OnSetfocusLowerLidNeutral) + ON_EN_SETFOCUS(IDC_LOWER_LID_RAISED, OnSetfocusLowerLidRaised) + ON_BN_CLICKED(IDC_COPY_TEXT_TO_CLIPBOARD, OnCopyTextToClipboard) + ON_BN_CLICKED(IDC_DEFAULT_CONTROLS, OnDefaultControls) + ON_BN_CLICKED(IDC_ADVANCED_CONTROLS, OnAdvancedControls) + ON_BN_CLICKED(IDC_LEFT_LID_CONTROL, OnLeftLidControl) + //}}AFX_MSG_MAP +END_MESSAGE_MAP() + + +void CQC_EyesDlg::AddText( const char *pFormat, ... ) +{ + char tempMsg[4096]; + va_list marker; + va_start( marker, pFormat ); + _vsnprintf( tempMsg, sizeof( tempMsg ), pFormat, marker ); + tempMsg[ ARRAYSIZE(tempMsg) - 1 ] = 0; + va_end( marker ); + + size_t nCharsInBuf = strlen( m_Buf ); + size_t nCharsInMsg = strlen( tempMsg ); + + if ( nCharsInBuf + nCharsInMsg + 1 > m_BufSize ) + { + m_BufSize = nCharsInBuf + nCharsInMsg + 4096; + char *newbuf = new char[m_BufSize]; + memcpy( newbuf, m_Buf, nCharsInBuf + 1 ); + delete [] m_Buf; + m_Buf = newbuf; + } + + strcat( m_Buf, tempMsg ); +} + + +void SendToEditControl( HWND hEditControl, const char *pText ) +{ + LRESULT nLen = SendMessage( hEditControl, EM_GETLIMITTEXT, 0, 0 ); + SendMessage( hEditControl, EM_SETSEL, nLen, nLen ); + SendMessage( hEditControl, EM_REPLACESEL, FALSE, (LPARAM)pText ); +} + + +void FormatAndSendToEditControl( void *hWnd, const char *pText ) +{ + HWND hEditControl = (HWND)hWnd; + + // Translate \n to \r\n. + char outMsg[1024]; + const char *pIn = pText; + char *pOut = outMsg; + while ( *pIn ) + { + if ( *pIn == '\n' ) + { + *pOut = '\r'; + pOut++; + } + *pOut = *pIn; + + ++pIn; + ++pOut; + + if ( pOut - outMsg >= 1020 ) + { + *pOut = 0; + SendToEditControl( hEditControl, outMsg ); + pOut = outMsg; + } + } + *pOut = 0; + SendToEditControl( hEditControl, outMsg ); +} + + +HBITMAP CQC_EyesDlg::GetCachedBitmap( UINT id ) +{ + for ( CBitmapRef *pCur=m_pBitmapHead; pCur; pCur=pCur->m_pNext ) + { + if ( pCur->m_iResource == id ) + return pCur->m_hBitmap; + } + + CBitmapRef *pNew = new CBitmapRef; + pNew->m_iResource = id; + pNew->m_hBitmap = ::LoadBitmap( AfxGetInstanceHandle(), MAKEINTRESOURCE(id) ); + pNew->m_pNext = m_pBitmapHead; + m_pBitmapHead = pNew; + + return pNew->m_hBitmap; +} + + +///////////////////////////////////////////////////////////////////////////// +// CQC_EyesDlg message handlers + +BOOL CQC_EyesDlg::OnInitDialog() +{ + CDialog::OnInitDialog(); + + // Set the icon for this dialog. The framework does this automatically + // when the application's main window is not a dialog + SetIcon(m_hIcon, TRUE); // Set big icon + SetIcon(m_hIcon, FALSE); // Set small icon + + // TODO: Add extra initialization here + GetDlgItem( IDC_REFERENCE_FILENAME )->SetWindowText( "filename_reference" ); + GetDlgItem( IDC_EXPRESSIONS_FILENAME )->SetWindowText( "filename_expressions" ); + GetDlgItem( IDC_MODEL_FILENAME )->SetWindowText( "filename_model" ); + GetDlgItem( IDC_IRIS_SIZE )->SetWindowText( "0.63" ); + GetDlgItem( IDC_EYEBALL_SIZE )->SetWindowText( "1.0" ); + + ::SendMessage( ::GetDlgItem( m_hWnd, IDC_Y_AXIS_UP ), BM_SETCHECK, BST_CHECKED, 0 ); + ::SendMessage( ::GetDlgItem( m_hWnd, IDC_DEFAULT_CONTROLS ), BM_SETCHECK, BST_CHECKED, 0 ); + ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_BROWN ), BM_SETCHECK, BST_CHECKED, 0 ); + ::SendMessage( ::GetDlgItem( m_hWnd, IDC_EYE_COLOR_LIGHT ), BM_SETCHECK, BST_CHECKED, 0 ); + + m_hOutputText = ::GetDlgItem( m_hWnd, IDC_OUTPUT_TEXT ); + + m_PictureControl.SetBitmap( GetCachedBitmap( IDB_EYE_DEFAULT ) ); + OnDefaultControls(); // Hide the advanced controls. + + return TRUE; // return TRUE unless you set the focus to a control +} + +// If you add a minimize button to your dialog, you will need the code below +// to draw the icon. For MFC applications using the document/view model, +// this is automatically done for you by the framework. + +void CQC_EyesDlg::OnPaint() +{ + if (IsIconic()) + { + CPaintDC dc(this); // device context for painting + + SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0); + + // Center icon in client rectangle + int cxIcon = GetSystemMetrics(SM_CXICON); + int cyIcon = GetSystemMetrics(SM_CYICON); + CRect rect; + GetClientRect(&rect); + int x = (rect.Width() - cxIcon + 1) / 2; + int y = (rect.Height() - cyIcon + 1) / 2; + + // Draw the icon + dc.DrawIcon(x, y, m_hIcon); + } + else + { + CDialog::OnPaint(); + } +} + +// The system calls this to obtain the cursor to display while the user drags +// the minimized window. +HCURSOR CQC_EyesDlg::OnQueryDragIcon() +{ + return (HCURSOR) m_hIcon; +} + + +void HandleYAxisUp( float &yVal, float &zVal ) +{ + float flTemp = yVal; + yVal = -zVal; + zVal = flTemp; +} + + +float CQC_EyesDlg::GetDlgItemFloat( UINT id ) +{ + char text[4096]; + GetDlgItemText( id, text, sizeof( text ) ); + return (float)atof( text ); +} + + +bool CQC_EyesDlg::IsOptionChecked( UINT option ) +{ + return (::SendMessage( ::GetDlgItem( m_hWnd, option ), BM_GETCHECK, 0, 0 ) == BST_CHECKED); +} + + +void CQC_EyesDlg::GetDialogParams( CDialogParams &p ) +{ + p.m_flLeftEye[0] = GetDlgItemFloat( IDC_LEFT_EYE_X ); + p.m_flLeftEye[1] = GetDlgItemFloat( IDC_LEFT_EYE_Y ); + p.m_flLeftEye[2] = GetDlgItemFloat( IDC_LEFT_EYE_Z ); + + p.m_flRightEye[0] = GetDlgItemFloat( IDC_RIGHT_EYE_X ); + p.m_flRightEye[1] = GetDlgItemFloat( IDC_RIGHT_EYE_Y ); + p.m_flRightEye[2] = GetDlgItemFloat( IDC_RIGHT_EYE_Z ); + + bool bYAxisUp = IsOptionChecked( IDC_Y_AXIS_UP ); + if ( bYAxisUp ) + { + HandleYAxisUp( p.m_flLeftEye[1], p.m_flLeftEye[2] ); + HandleYAxisUp( p.m_flRightEye[1], p.m_flRightEye[2] ); + } + + GetDlgItemText( IDC_REFERENCE_FILENAME, p.m_ReferenceFilename, sizeof( p.m_ReferenceFilename ) ); + GetDlgItemText( IDC_EXPRESSIONS_FILENAME, p.m_ExpressionsFilename, sizeof( p.m_ExpressionsFilename ) ); + GetDlgItemText( IDC_MODEL_FILENAME, p.m_ModelFilename, sizeof( p.m_ModelFilename ) ); + + p.m_flIrisSize = GetDlgItemFloat( IDC_IRIS_SIZE ); + p.m_flEyeballSize = GetDlgItemFloat( IDC_EYEBALL_SIZE ); + + p.m_flRightUpperLidRaised = GetDlgItemFloat( IDC_UPPER_LID_RAISED ); + p.m_flRightUpperLidNeutral = GetDlgItemFloat( IDC_UPPER_LID_NEUTRAL ); + p.m_flRightUpperLidLowered = GetDlgItemFloat( IDC_UPPER_LID_LOWERED ); + + p.m_flRightLowerLidRaised = GetDlgItemFloat( IDC_LOWER_LID_RAISED ); + p.m_flRightLowerLidNeutral = GetDlgItemFloat( IDC_LOWER_LID_NEUTRAL ); + p.m_flRightLowerLidLowered = GetDlgItemFloat( IDC_LOWER_LID_LOWERED ); + + if ( IsIndependentLeftLidControlEnabled() ) + { + p.m_flLeftUpperLidRaised = GetDlgItemFloat( IDC_UPPER_LEFT_LID_RAISED ); + p.m_flLeftUpperLidNeutral = GetDlgItemFloat( IDC_UPPER_LEFT_LID_NEUTRAL ); + p.m_flLeftUpperLidLowered = GetDlgItemFloat( IDC_UPPER_LEFT_LID_LOWERED ); + + p.m_flLeftLowerLidRaised = GetDlgItemFloat( IDC_LOWER_LEFT_LID_RAISED ); + p.m_flLeftLowerLidNeutral = GetDlgItemFloat( IDC_LOWER_LEFT_LID_NEUTRAL ); + p.m_flLeftLowerLidLowered = GetDlgItemFloat( IDC_LOWER_LEFT_LID_LOWERED ); + } + else + { + // Left lids follow the right lids. + p.m_flLeftUpperLidRaised = p.m_flRightUpperLidRaised; + p.m_flLeftUpperLidNeutral = p.m_flRightUpperLidNeutral; + p.m_flLeftUpperLidLowered = p.m_flRightUpperLidLowered; + + p.m_flLeftLowerLidRaised = p.m_flRightLowerLidRaised; + p.m_flLeftLowerLidNeutral = p.m_flRightLowerLidNeutral; + p.m_flLeftLowerLidLowered = p.m_flRightLowerLidLowered; + } + + // Figure out the eyeball prefix. + if ( IsOptionChecked( IDC_EYE_COLOR_LIGHT ) ) + strcpy( p.m_EyeballPrefix, "eyeball" ); + else + strcpy( p.m_EyeballPrefix, "dark_eyeball" ); + + // Figure out the pupil prefix. + if ( IsOptionChecked( IDC_IRIS_COLOR_BROWN ) ) + strcpy( p.m_PupilPrefix, "pupil" ); + else if ( IsOptionChecked( IDC_IRIS_COLOR_GREEN ) ) + strcpy( p.m_PupilPrefix, "grn_pupil" ); + else + strcpy( p.m_PupilPrefix, "bl_pupil" ); +} + + +void CQC_EyesDlg::GenerateQCText() +{ + CDialogParams p; + GetDialogParams( p ); + + + m_BufSize = 16 * 1024; + m_Buf = new char[m_BufSize]; + m_Buf[0] = 0; + + AddText( "//start eye/face data\n" ); + AddText( "$eyeposition 0 0 70\n\n" ); + + AddText( "//head controllers\n" ); + AddText( "$attachment \"eyes\" \"ValveBiped.Bip01_Head1\" %.2f %.2f %.2f absolute\n", + p.m_flLeftEye[0] - ((fabs( p.m_flRightEye[0] ) + p.m_flLeftEye[0]) * 0.5), + (p.m_flLeftEye[1] + p.m_flRightEye[1]) * 0.5, + (p.m_flLeftEye[2] + p.m_flRightEye[2]) * 0.5 ); + + AddText( "$attachment \"mouth\" \"ValveBiped.Bip01_Head1\" 0.80 -5.80 -0.15 rotate 0 -80 -90\n\n" ); + + AddText( "$model %s \"%s.smd\" {\n", + p.m_ModelFilename, p.m_ReferenceFilename ); + + AddText( "\teyeball righteye \"ValveBiped.Bip01_Head1\" %.2f %.2f %.2f \"%s_r\" %.2f 4 \"%s_r\" %.2f\n", + p.m_flRightEye[0], + p.m_flRightEye[1], + p.m_flRightEye[2], + p.m_EyeballPrefix, + p.m_flEyeballSize, + p.m_PupilPrefix, + p.m_flIrisSize ); + + AddText( "\teyeball lefteye \"ValveBiped.Bip01_Head1\" %.2f %.2f %.2f \"%s_l\" %.2f -4 \"%s_l\" %.2f\n\n", + p.m_flLeftEye[0], + p.m_flLeftEye[1], + p.m_flLeftEye[2], + p.m_EyeballPrefix, + p.m_flEyeballSize, + p.m_PupilPrefix, + p.m_flIrisSize ); + + AddText( "\teyelid upper_right \"%s\" lowerer 1 %.2f neutral 0 %.2f raiser 2 %.2f split 0.1 eyeball righteye\n", + p.m_ExpressionsFilename, + p.m_flRightUpperLidLowered - p.m_flRightEye[2], + p.m_flRightUpperLidNeutral - p.m_flRightEye[2], + p.m_flRightUpperLidRaised - p.m_flRightEye[2] ); + + AddText( "\teyelid lower_right \"%s\" lowerer 3 %.2f neutral 0 %.2f raiser 4 %.2f split 0.1 eyeball righteye\n", + p.m_ExpressionsFilename, + p.m_flRightLowerLidLowered - p.m_flRightEye[2], + p.m_flRightLowerLidNeutral - p.m_flRightEye[2], + p.m_flRightLowerLidRaised - p.m_flRightEye[2] ); + + AddText( "\teyelid upper_left \"%s\" lowerer 1 %.2f neutral 0 %.2f raiser 2 %.2f split -0.1 eyeball lefteye\n", + p.m_ExpressionsFilename, + p.m_flLeftUpperLidLowered - p.m_flLeftEye[2], + p.m_flLeftUpperLidNeutral - p.m_flLeftEye[2], + p.m_flLeftUpperLidRaised - p.m_flLeftEye[2] ); + + AddText( "\teyelid lower_left \"%s\" lowerer 3 %.2f neutral 0 %.2f raiser 4 %.2f split -0.1 eyeball lefteye\n\n", + p.m_ExpressionsFilename, + p.m_flLeftLowerLidLowered - p.m_flLeftEye[2], + p.m_flLeftLowerLidNeutral - p.m_flLeftEye[2], + p.m_flLeftLowerLidRaised - p.m_flLeftEye[2] ); + + AddText( "\tmouth 0 \"mouth\" \"ValveBiped.Bip01_Head1\" 0 1 0 // mouth illumination\n" ); + AddText( "\tflexfile \"%s\" {\n", p.m_ExpressionsFilename ); + AddText( "\t\t$include \"../standardflex_xsi.qci\"\n" ); + AddText( "\t}\n" ); + AddText( "\t$include \"../facerules_xsi.qci\"\n" ); + AddText( "\t$include \"../bodyrules_xsi.qci\"\n" ); + AddText( "}\n" ); + AddText( "//end eye/face data\n" ); +} + + +bool CQC_EyesDlg::CheckNumericInputs() +{ + struct + { + const char *pControlName; + UINT controlID; + } + controls[] = + { + {"Right Eye X", IDC_RIGHT_EYE_X}, + {"Right Eye Y", IDC_RIGHT_EYE_Y}, + {"Right Eye Z", IDC_RIGHT_EYE_Z}, + + {"Left Eye X", IDC_LEFT_EYE_X}, + {"Left Eye Y", IDC_LEFT_EYE_Y}, + {"Left Eye Z", IDC_LEFT_EYE_Z}, + + {"Upper Lid Raised", IDC_UPPER_LID_RAISED}, + {"Upper Lid Neutral", IDC_UPPER_LID_NEUTRAL}, + {"Upper Lid Lowered", IDC_UPPER_LID_LOWERED}, + + {"Lower Lid Raised", IDC_LOWER_LID_RAISED}, + {"Lower Lid Neutral", IDC_LOWER_LID_NEUTRAL}, + {"Lower Lid Lowered", IDC_LOWER_LID_LOWERED}, + + {"Upper Left Lid Raised", IDC_UPPER_LEFT_LID_RAISED}, + {"Upper Left Lid Neutral", IDC_UPPER_LEFT_LID_NEUTRAL}, + {"Upper Left Lid Lowered", IDC_UPPER_LEFT_LID_LOWERED}, + + {"Lower Left Lid Raised", IDC_LOWER_LEFT_LID_RAISED}, + {"Lower Left Lid Neutral", IDC_LOWER_LEFT_LID_NEUTRAL}, + {"Lower Left Lid Lowered", IDC_LOWER_LEFT_LID_LOWERED}, + + {"Iris Size", IDC_IRIS_SIZE}, + {"Eyeball Size", IDC_EYEBALL_SIZE} + }; + + for ( int i=0; i < sizeof( controls ) / sizeof( controls[0] ); i++ ) + { + char text[512]; + GetDlgItem( controls[i].controlID )->GetWindowText( text, sizeof( text ) ); + + for ( int z=0; z < (int)strlen( text ); z++ ) + { + if ( text[z] < '0' || text[z] > '9' ) + { + if ( text[z] != '.' && text[z] != '-' ) + { + char errMsg[512]; + _snprintf( errMsg, sizeof( errMsg ), "The '%s' control must have a numeric value.", controls[i].pControlName ); + AfxMessageBox( errMsg, MB_OK ); + return false; + } + } + } + } + + return true; +} + + +void CQC_EyesDlg::OnCreateQcText() +{ + if ( !CheckNumericInputs() ) + return; + + GenerateQCText(); + + // Clear the edit control. + LRESULT nLen = ::SendMessage( m_hOutputText, EM_GETLIMITTEXT, 0, 0 ); + ::SendMessage( m_hOutputText, EM_SETSEL, 0, nLen ); + ::SendMessage( m_hOutputText, EM_REPLACESEL, FALSE, (LPARAM)"" ); + + FormatAndSendToEditControl( m_hOutputText, m_Buf ); + + delete [] m_Buf; +} + +void CQC_EyesDlg::OnIrisColorBrown() +{ + ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_BROWN ), BM_SETCHECK, BST_CHECKED, 0 ); + ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_GREEN ), BM_SETCHECK, BST_UNCHECKED, 0 ); + ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_BLUE ), BM_SETCHECK, BST_UNCHECKED, 0 ); + SetupBitmapLabel( IDB_EYE_DEFAULT, "" ); +} + +void CQC_EyesDlg::OnIrisColorGreen() +{ + ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_BROWN ), BM_SETCHECK, BST_UNCHECKED, 0 ); + ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_GREEN ), BM_SETCHECK, BST_CHECKED, 0 ); + ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_BLUE ), BM_SETCHECK, BST_UNCHECKED, 0 ); + SetupBitmapLabel( IDB_EYE_DEFAULT, "" ); +} + +void CQC_EyesDlg::OnIrisColorBlue() +{ + ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_BROWN ), BM_SETCHECK, BST_UNCHECKED, 0 ); + ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_GREEN ), BM_SETCHECK, BST_UNCHECKED, 0 ); + ::SendMessage( ::GetDlgItem( m_hWnd, IDC_IRIS_COLOR_BLUE ), BM_SETCHECK, BST_CHECKED, 0 ); + SetupBitmapLabel( IDB_EYE_DEFAULT, "" ); +} + +void CQC_EyesDlg::OnEyeColorDark() +{ + ::SendMessage( ::GetDlgItem( m_hWnd, IDC_EYE_COLOR_LIGHT ), BM_SETCHECK, BST_UNCHECKED, 0 ); + ::SendMessage( ::GetDlgItem( m_hWnd, IDC_EYE_COLOR_DARK ), BM_SETCHECK, BST_CHECKED, 0 ); + SetupBitmapLabel( IDB_EYE_DEFAULT, "" ); +} + +void CQC_EyesDlg::OnEyeColorLight() +{ + ::SendMessage( ::GetDlgItem( m_hWnd, IDC_EYE_COLOR_LIGHT ), BM_SETCHECK, BST_CHECKED, 0 ); + ::SendMessage( ::GetDlgItem( m_hWnd, IDC_EYE_COLOR_DARK ), BM_SETCHECK, BST_UNCHECKED, 0 ); + SetupBitmapLabel( IDB_EYE_DEFAULT, "" ); +} + +void CQC_EyesDlg::SetupBitmapLabel( UINT iBitmapResourceID, const char *pString, ... ) +{ + char msg[4096]; + va_list marker; + va_start( marker, pString ); + _vsnprintf( msg, sizeof( msg ), pString, marker ); + msg[ ARRAYSIZE(msg) - 1 ] = 0; + va_end( marker ); + + m_PictureControl.SetBitmap( GetCachedBitmap( iBitmapResourceID ) ); + GetDlgItem( IDC_PICTURE_LABEL )->SetWindowText( msg ); +} + +void CQC_EyesDlg::OnSetfocusRightEyeX() +{ + SetupBitmapLabel( IDB_EYE_XY_R, "Enter the X position of the center vertex of the right eye" ); +} + +void CQC_EyesDlg::OnSetfocusRightEyeY() +{ + SetupBitmapLabel( IsOptionChecked( IDC_Y_AXIS_UP ) ? IDB_EYE_XY_R : IDB_EYE_Z_R, "Enter the Y position of the center vertex of the right eye" ); +} + +void CQC_EyesDlg::OnSetfocusRightEyeZ() +{ + SetupBitmapLabel( IsOptionChecked( IDC_Y_AXIS_UP ) ? IDB_EYE_Z_R : IDB_EYE_XY_R, "Enter the Z position of the center vertex of the right eye" ); +} + +void CQC_EyesDlg::OnSetfocusLeftEyeX() +{ + SetupBitmapLabel( IDB_EYE_XY_L, "Enter the X position of the center vertex of the right eye" ); +} + +void CQC_EyesDlg::OnSetfocusLeftEyeY() +{ + SetupBitmapLabel( IsOptionChecked( IDC_Y_AXIS_UP ) ? IDB_EYE_XY_L : IDB_EYE_Z_L, "Enter the Y position of the center vertex of the right eye" ); +} + +void CQC_EyesDlg::OnSetfocusLeftEyeZ() +{ + SetupBitmapLabel( IsOptionChecked( IDC_Y_AXIS_UP ) ? IDB_EYE_Z_L : IDB_EYE_XY_L, "Enter the Z position of the center vertex of the right eye" ); +} + +void CQC_EyesDlg::OnSetfocusUpperLidLowered() +{ + const char *pCoord = IsOptionChecked( IDC_Y_AXIS_UP ) ? "Y" : "Z"; + SetupBitmapLabel( IDB_EYE_UPPER_LO, "At Frame 1, enter the %s position of the center vertex of the right upper eye lid", pCoord ); +} + +void CQC_EyesDlg::OnSetfocusUpperLidNeutral() +{ + const char *pCoord = IsOptionChecked( IDC_Y_AXIS_UP ) ? "Y" : "Z"; + SetupBitmapLabel( IDB_EYE_UPPER_MID, "At Frame 0, enter the %s position of the center vertex of the right upper eye lid", pCoord ); +} + +void CQC_EyesDlg::OnSetfocusUpperLidRaised() +{ + const char *pCoord = IsOptionChecked( IDC_Y_AXIS_UP ) ? "Y" : "Z"; + SetupBitmapLabel( IDB_EYE_UPPER_HI, "At Frame 2, enter the %s position of the center vertex of the right upper eye lid", pCoord ); +} + + +void CQC_EyesDlg::OnSetfocusLowerLidLowered() +{ + const char *pCoord = IsOptionChecked( IDC_Y_AXIS_UP ) ? "Y" : "Z"; + SetupBitmapLabel( IDB_EYE_LOWER_LO, "At Frame 3, enter the %s position of the center vertex of the right lower eye lid", pCoord ); +} + +void CQC_EyesDlg::OnSetfocusLowerLidNeutral() +{ + const char *pCoord = IsOptionChecked( IDC_Y_AXIS_UP ) ? "Y" : "Z"; + SetupBitmapLabel( IDB_EYE_LOWER_MID, "At Frame 0, enter the %s position of the center vertex of the right lower eye lid", pCoord ); +} + +void CQC_EyesDlg::OnSetfocusLowerLidRaised() +{ + const char *pCoord = IsOptionChecked( IDC_Y_AXIS_UP ) ? "Y" : "Z"; + SetupBitmapLabel( IDB_EYE_LOWER_HI, "At Frame 4, enter the %s position of the center vertex of the right lower eye lid", pCoord ); +} + +void CQC_EyesDlg::OnCopyTextToClipboard() +{ + if ( !CheckNumericInputs() ) + return; + + GenerateQCText(); + + if ( !OpenClipboard() ) + return; + + size_t textLen = strlen( m_Buf ); + HANDLE hmem = GlobalAlloc( GMEM_MOVEABLE | GMEM_DDESHARE, textLen + 1 ); + if ( hmem ) + { + void *ptr = GlobalLock( hmem ); + if ( ptr ) + { + memcpy( ptr, m_Buf, textLen+1 ); + GlobalUnlock( hmem ); + + SetClipboardData( CF_TEXT, hmem ); + } + } + + CloseClipboard(); + + delete [] m_Buf; +} + + +int g_AdvancedControls[] = +{ + IDC_EYE_DETAIL_CONTROL_FRAME, + IDC_IRIS_SIZE, + IDC_IRIS_SIZE_LABEL, + IDC_EYEBALL_SIZE, + IDC_EYEBALL_SIZE_LABEL, + IDC_LEFT_LID_CONTROL +}; +#define NUM_ADVANCED_CONTROLS ( sizeof( g_AdvancedControls ) / sizeof( g_AdvancedControls[0] ) ) + +int g_LeftLidPositionControls[] = +{ + IDC_UPPER_LEFT_LID_PANEL, + IDC_UPPER_LEFT_LID_RAISED, + IDC_UPPER_LEFT_LID_RAISED_LABEL, + IDC_UPPER_LEFT_LID_NEUTRAL, + IDC_UPPER_LEFT_LID_NEUTRAL_LABEL, + IDC_UPPER_LEFT_LID_LOWERED, + IDC_UPPER_LEFT_LID_LOWERED_LABEL, + IDC_LOWER_LEFT_LID_PANEL, + IDC_LOWER_LEFT_LID_RAISED, + IDC_LOWER_LEFT_LID_RAISED_LABEL, + IDC_LOWER_LEFT_LID_NEUTRAL, + IDC_LOWER_LEFT_LID_NEUTRAL_LABEL, + IDC_LOWER_LEFT_LID_LOWERED, + IDC_LOWER_LEFT_LID_LOWERED_LABEL +}; +#define NUM_LEFT_LID_POSITION_CONTROLS ( sizeof( g_LeftLidPositionControls ) / sizeof( g_LeftLidPositionControls[0] ) ) + + +void CQC_EyesDlg::OnDefaultControls() +{ + GetDlgItem( IDC_PICTURES )->ShowWindow( SW_SHOW ); + + // Hide all the advanced controls. + for ( int i=0; i < NUM_ADVANCED_CONTROLS; i++ ) + { + GetDlgItem( g_AdvancedControls[i] )->ShowWindow( SW_HIDE ); + } + + for ( int i=0; i < NUM_LEFT_LID_POSITION_CONTROLS; i++ ) + { + GetDlgItem( g_LeftLidPositionControls[i] )->ShowWindow( SW_HIDE ); + } + +} + +void CQC_EyesDlg::OnAdvancedControls() +{ + GetDlgItem( IDC_PICTURES )->ShowWindow( SW_HIDE ); + + // Show the advanced controls. + for ( int i=0; i < NUM_ADVANCED_CONTROLS; i++ ) + { + GetDlgItem( g_AdvancedControls[i] )->ShowWindow( SW_SHOW ); + GetDlgItem( g_AdvancedControls[i] )->InvalidateRect( NULL ); + } + + if ( IsIndependentLeftLidControlEnabled() ) + { + OnLeftLidControl(); + } +} + + +bool CQC_EyesDlg::IsIndependentLeftLidControlEnabled() +{ + return m_IndependentLeftLidControl.GetCheck() == 1; +} + +void CQC_EyesDlg::OnLeftLidControl() +{ + if ( IsIndependentLeftLidControlEnabled() ) + { + for ( int i=0; i < NUM_LEFT_LID_POSITION_CONTROLS; i++ ) + { + GetDlgItem( g_LeftLidPositionControls[i] )->ShowWindow( SW_SHOW ); + GetDlgItem( g_LeftLidPositionControls[i] )->InvalidateRect( NULL ); + } + } + else + { + for ( int i=0; i < NUM_LEFT_LID_POSITION_CONTROLS; i++ ) + { + GetDlgItem( g_LeftLidPositionControls[i] )->ShowWindow( SW_HIDE ); + GetDlgItem( g_LeftLidPositionControls[i] )->InvalidateRect( NULL ); + } + } +} diff --git a/sp/src/utils/qc_eyes/QC_EyesDlg.h b/sp/src/utils/qc_eyes/QC_EyesDlg.h index 62b42b1a..754e9ec5 100644 --- a/sp/src/utils/qc_eyes/QC_EyesDlg.h +++ b/sp/src/utils/qc_eyes/QC_EyesDlg.h @@ -1,134 +1,134 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-// QC_EyesDlg.h : header file
-//
-
-#if !defined(AFX_QC_EYESDLG_H__9130E22D_05ED_4851_960C_38D90DA94967__INCLUDED_)
-#define AFX_QC_EYESDLG_H__9130E22D_05ED_4851_960C_38D90DA94967__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-class CDialogParams
-{
-public:
- float m_flLeftEye[3];
- float m_flRightEye[3];
-
- float m_flIrisSize;
- float m_flEyeballSize;
-
- float m_flLeftUpperLidRaised;
- float m_flLeftUpperLidNeutral;
- float m_flLeftUpperLidLowered;
-
- float m_flLeftLowerLidRaised;
- float m_flLeftLowerLidNeutral;
- float m_flLeftLowerLidLowered;
-
- float m_flRightUpperLidRaised;
- float m_flRightUpperLidNeutral;
- float m_flRightUpperLidLowered;
-
- float m_flRightLowerLidRaised;
- float m_flRightLowerLidNeutral;
- float m_flRightLowerLidLowered;
-
- char m_ReferenceFilename[1024];
- char m_ExpressionsFilename[1024];
- char m_ModelFilename[1024];
-
- char m_EyeballPrefix[1024]; // eyeball_ or dark_eyeball_
- char m_PupilPrefix[1024]; // pupil_ or grn_pupil_ or bl_pupil_
-};
-
-/////////////////////////////////////////////////////////////////////////////
-// CQC_EyesDlg dialog
-
-class CQC_EyesDlg : public CDialog
-{
-// Construction
-public:
- CQC_EyesDlg(CWnd* pParent = NULL); // standard constructor
-
-// Dialog Data
- //{{AFX_DATA(CQC_EyesDlg)
- enum { IDD = IDD_QC_EYES_DIALOG };
- CButton m_IndependentLeftLidControl;
- CStatic m_PictureControl;
- //}}AFX_DATA
-
- // ClassWizard generated virtual function overrides
- //{{AFX_VIRTUAL(CQC_EyesDlg)
- protected:
- virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
- //}}AFX_VIRTUAL
-
-// Implementation
-protected:
- HICON m_hIcon;
-
- void GenerateQCText();
- void AddText( const char *pFormat, ... );
- bool IsOptionChecked( UINT option );
- float GetDlgItemFloat( UINT id );
- void GetDialogParams( CDialogParams &p );
- void SetupBitmapLabel( UINT iBitmapResourceID, const char *pString, ... );
-
- HWND m_hOutputText;
-
-
- // Cached list of bitmaps.
- class CBitmapRef
- {
- public:
- UINT m_iResource;
- HBITMAP m_hBitmap;
- CBitmapRef *m_pNext;
- };
- CBitmapRef *m_pBitmapHead;
- HBITMAP GetCachedBitmap( UINT id );
-
-
- size_t m_BufSize;
- char *m_Buf;
- bool IsIndependentLeftLidControlEnabled();
-
- bool CheckNumericInputs();
-
-
- // Generated message map functions
- //{{AFX_MSG(CQC_EyesDlg)
- virtual BOOL OnInitDialog();
- afx_msg void OnPaint();
- afx_msg HCURSOR OnQueryDragIcon();
- afx_msg void OnCreateQcText();
- afx_msg void OnIrisColorBrown();
- afx_msg void OnIrisColorGreen();
- afx_msg void OnIrisColorBlue();
- afx_msg void OnEyeColorDark();
- afx_msg void OnEyeColorLight();
- afx_msg void OnSetfocusRightEyeX();
- afx_msg void OnSetfocusRightEyeY();
- afx_msg void OnSetfocusRightEyeZ();
- afx_msg void OnSetfocusLeftEyeX();
- afx_msg void OnSetfocusLeftEyeY();
- afx_msg void OnSetfocusLeftEyeZ();
- afx_msg void OnSetfocusUpperLidLowered();
- afx_msg void OnSetfocusUpperLidNeutral();
- afx_msg void OnSetfocusUpperLidRaised();
- afx_msg void OnSetfocusLowerLidLowered();
- afx_msg void OnSetfocusLowerLidNeutral();
- afx_msg void OnSetfocusLowerLidRaised();
- afx_msg void OnCopyTextToClipboard();
- afx_msg void OnDefaultControls();
- afx_msg void OnAdvancedControls();
- afx_msg void OnLeftLidControl();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
-};
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_QC_EYESDLG_H__9130E22D_05ED_4851_960C_38D90DA94967__INCLUDED_)
+//========= Copyright Valve Corporation, All rights reserved. ============// +// QC_EyesDlg.h : header file +// + +#if !defined(AFX_QC_EYESDLG_H__9130E22D_05ED_4851_960C_38D90DA94967__INCLUDED_) +#define AFX_QC_EYESDLG_H__9130E22D_05ED_4851_960C_38D90DA94967__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +class CDialogParams +{ +public: + float m_flLeftEye[3]; + float m_flRightEye[3]; + + float m_flIrisSize; + float m_flEyeballSize; + + float m_flLeftUpperLidRaised; + float m_flLeftUpperLidNeutral; + float m_flLeftUpperLidLowered; + + float m_flLeftLowerLidRaised; + float m_flLeftLowerLidNeutral; + float m_flLeftLowerLidLowered; + + float m_flRightUpperLidRaised; + float m_flRightUpperLidNeutral; + float m_flRightUpperLidLowered; + + float m_flRightLowerLidRaised; + float m_flRightLowerLidNeutral; + float m_flRightLowerLidLowered; + + char m_ReferenceFilename[1024]; + char m_ExpressionsFilename[1024]; + char m_ModelFilename[1024]; + + char m_EyeballPrefix[1024]; // eyeball_ or dark_eyeball_ + char m_PupilPrefix[1024]; // pupil_ or grn_pupil_ or bl_pupil_ +}; + +///////////////////////////////////////////////////////////////////////////// +// CQC_EyesDlg dialog + +class CQC_EyesDlg : public CDialog +{ +// Construction +public: + CQC_EyesDlg(CWnd* pParent = NULL); // standard constructor + +// Dialog Data + //{{AFX_DATA(CQC_EyesDlg) + enum { IDD = IDD_QC_EYES_DIALOG }; + CButton m_IndependentLeftLidControl; + CStatic m_PictureControl; + //}}AFX_DATA + + // ClassWizard generated virtual function overrides + //{{AFX_VIRTUAL(CQC_EyesDlg) + protected: + virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support + //}}AFX_VIRTUAL + +// Implementation +protected: + HICON m_hIcon; + + void GenerateQCText(); + void AddText( const char *pFormat, ... ); + bool IsOptionChecked( UINT option ); + float GetDlgItemFloat( UINT id ); + void GetDialogParams( CDialogParams &p ); + void SetupBitmapLabel( UINT iBitmapResourceID, const char *pString, ... ); + + HWND m_hOutputText; + + + // Cached list of bitmaps. + class CBitmapRef + { + public: + UINT m_iResource; + HBITMAP m_hBitmap; + CBitmapRef *m_pNext; + }; + CBitmapRef *m_pBitmapHead; + HBITMAP GetCachedBitmap( UINT id ); + + + size_t m_BufSize; + char *m_Buf; + bool IsIndependentLeftLidControlEnabled(); + + bool CheckNumericInputs(); + + + // Generated message map functions + //{{AFX_MSG(CQC_EyesDlg) + virtual BOOL OnInitDialog(); + afx_msg void OnPaint(); + afx_msg HCURSOR OnQueryDragIcon(); + afx_msg void OnCreateQcText(); + afx_msg void OnIrisColorBrown(); + afx_msg void OnIrisColorGreen(); + afx_msg void OnIrisColorBlue(); + afx_msg void OnEyeColorDark(); + afx_msg void OnEyeColorLight(); + afx_msg void OnSetfocusRightEyeX(); + afx_msg void OnSetfocusRightEyeY(); + afx_msg void OnSetfocusRightEyeZ(); + afx_msg void OnSetfocusLeftEyeX(); + afx_msg void OnSetfocusLeftEyeY(); + afx_msg void OnSetfocusLeftEyeZ(); + afx_msg void OnSetfocusUpperLidLowered(); + afx_msg void OnSetfocusUpperLidNeutral(); + afx_msg void OnSetfocusUpperLidRaised(); + afx_msg void OnSetfocusLowerLidLowered(); + afx_msg void OnSetfocusLowerLidNeutral(); + afx_msg void OnSetfocusLowerLidRaised(); + afx_msg void OnCopyTextToClipboard(); + afx_msg void OnDefaultControls(); + afx_msg void OnAdvancedControls(); + afx_msg void OnLeftLidControl(); + //}}AFX_MSG + DECLARE_MESSAGE_MAP() +}; + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_QC_EYESDLG_H__9130E22D_05ED_4851_960C_38D90DA94967__INCLUDED_) diff --git a/sp/src/utils/qc_eyes/StdAfx.cpp b/sp/src/utils/qc_eyes/StdAfx.cpp index 8fdb97ce..8ffd6415 100644 --- a/sp/src/utils/qc_eyes/StdAfx.cpp +++ b/sp/src/utils/qc_eyes/StdAfx.cpp @@ -1,9 +1,9 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-// stdafx.cpp : source file that includes just the standard includes
-// QC_Eyes.pch will be the pre-compiled header
-// stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
-
-
+//========= Copyright Valve Corporation, All rights reserved. ============// +// stdafx.cpp : source file that includes just the standard includes +// QC_Eyes.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + + + diff --git a/sp/src/utils/qc_eyes/StdAfx.h b/sp/src/utils/qc_eyes/StdAfx.h index c65813d7..55723a60 100644 --- a/sp/src/utils/qc_eyes/StdAfx.h +++ b/sp/src/utils/qc_eyes/StdAfx.h @@ -1,28 +1,28 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-// stdafx.h : include file for standard system include files,
-// or project specific include files that are used frequently, but
-// are changed infrequently
-//
-
-#if !defined(AFX_STDAFX_H__88FA48B3_A92C_49CA_8A82_50D120A84756__INCLUDED_)
-#define AFX_STDAFX_H__88FA48B3_A92C_49CA_8A82_50D120A84756__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
-
-#include <afxwin.h> // MFC core and standard components
-#include <afxext.h> // MFC extensions
-#include <afxdisp.h> // MFC Automation classes
-#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
-#ifndef _AFX_NO_AFXCMN_SUPPORT
-#include <afxcmn.h> // MFC support for Windows Common Controls
-#endif // _AFX_NO_AFXCMN_SUPPORT
-
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_STDAFX_H__88FA48B3_A92C_49CA_8A82_50D120A84756__INCLUDED_)
+//========= Copyright Valve Corporation, All rights reserved. ============// +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#if !defined(AFX_STDAFX_H__88FA48B3_A92C_49CA_8A82_50D120A84756__INCLUDED_) +#define AFX_STDAFX_H__88FA48B3_A92C_49CA_8A82_50D120A84756__INCLUDED_ + +#if _MSC_VER > 1000 +#pragma once +#endif // _MSC_VER > 1000 + +#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers + +#include <afxwin.h> // MFC core and standard components +#include <afxext.h> // MFC extensions +#include <afxdisp.h> // MFC Automation classes +#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls +#ifndef _AFX_NO_AFXCMN_SUPPORT +#include <afxcmn.h> // MFC support for Windows Common Controls +#endif // _AFX_NO_AFXCMN_SUPPORT + + +//{{AFX_INSERT_LOCATION}} +// Microsoft Visual C++ will insert additional declarations immediately before the previous line. + +#endif // !defined(AFX_STDAFX_H__88FA48B3_A92C_49CA_8A82_50D120A84756__INCLUDED_) diff --git a/sp/src/utils/qc_eyes/qc_eyes.vpc b/sp/src/utils/qc_eyes/qc_eyes.vpc index 54b35528..ee3b4e39 100644 --- a/sp/src/utils/qc_eyes/qc_eyes.vpc +++ b/sp/src/utils/qc_eyes/qc_eyes.vpc @@ -1,67 +1,67 @@ -//-----------------------------------------------------------------------------
-// QC_EYES.VPC
-//
-// Project Script
-//-----------------------------------------------------------------------------
-
-$Macro SRCDIR "..\.."
-$Macro OUTBINDIR "$SRCDIR\..\game\bin"
-
-$Include "$SRCDIR\vpc_scripts\source_exe_base.vpc"
-
-$Configuration
-{
- $Compiler
- {
- $Create/UsePrecompiledHeader "Use Precompiled Header (/Yu)"
- $PrecompiledHeaderFile "Debug/QC_Eyes.pch"
- $EnableC++Exceptions "Yes (/EHsc)"
- }
-}
-
-$Project "QC_Eyes"
-{
- $Folder "Source Files"
- {
- -$File "$SRCDIR\public\tier0\memoverride.cpp"
-
- $File "QC_Eyes.cpp"
- $File "QC_Eyes.rc"
- $File "QC_EyesDlg.cpp"
- $File "StdAfx.cpp"
- {
- $Configuration
- {
- $Compiler
- {
- $Create/UsePrecompiledHeader "Create Precompiled Header (/Yc)"
- }
- }
- }
- }
-
- $Folder "Header Files"
- {
- $File "QC_Eyes.h"
- $File "QC_EyesDlg.h"
- $File "Resource.h"
- $File "StdAfx.h"
- }
-
- $Folder "Resources"
- {
- $File "res\eye_default.bmp"
- $File "res\eye_lower_hi.bmp"
- $File "res\eye_lower_lo.bmp"
- $File "res\eye_lower_mid.bmp"
- $File "res\eye_upper_hi.bmp"
- $File "res\eye_upper_lo.bmp"
- $File "res\eye_upper_mid.bmp"
- $File "res\eye_XY_L.bmp"
- $File "res\eye_XY_R.bmp"
- $File "res\eye_Z_L.bmp"
- $File "res\eye_Z_R.bmp"
- $File "res\QC_Eyes.ico"
- $File "res\QC_Eyes.rc2"
- }
-}
+//----------------------------------------------------------------------------- +// QC_EYES.VPC +// +// Project Script +//----------------------------------------------------------------------------- + +$Macro SRCDIR "..\.." +$Macro OUTBINDIR "$SRCDIR\..\game\bin" + +$Include "$SRCDIR\vpc_scripts\source_exe_base.vpc" + +$Configuration +{ + $Compiler + { + $Create/UsePrecompiledHeader "Use Precompiled Header (/Yu)" + $PrecompiledHeaderFile "Debug/QC_Eyes.pch" + $EnableC++Exceptions "Yes (/EHsc)" + } +} + +$Project "QC_Eyes" +{ + $Folder "Source Files" + { + -$File "$SRCDIR\public\tier0\memoverride.cpp" + + $File "QC_Eyes.cpp" + $File "QC_Eyes.rc" + $File "QC_EyesDlg.cpp" + $File "StdAfx.cpp" + { + $Configuration + { + $Compiler + { + $Create/UsePrecompiledHeader "Create Precompiled Header (/Yc)" + } + } + } + } + + $Folder "Header Files" + { + $File "QC_Eyes.h" + $File "QC_EyesDlg.h" + $File "Resource.h" + $File "StdAfx.h" + } + + $Folder "Resources" + { + $File "res\eye_default.bmp" + $File "res\eye_lower_hi.bmp" + $File "res\eye_lower_lo.bmp" + $File "res\eye_lower_mid.bmp" + $File "res\eye_upper_hi.bmp" + $File "res\eye_upper_lo.bmp" + $File "res\eye_upper_mid.bmp" + $File "res\eye_XY_L.bmp" + $File "res\eye_XY_R.bmp" + $File "res\eye_Z_L.bmp" + $File "res\eye_Z_R.bmp" + $File "res\QC_Eyes.ico" + $File "res\QC_Eyes.rc2" + } +} diff --git a/sp/src/utils/qc_eyes/resource.h b/sp/src/utils/qc_eyes/resource.h index d16935a9..e963ea22 100644 --- a/sp/src/utils/qc_eyes/resource.h +++ b/sp/src/utils/qc_eyes/resource.h @@ -1,78 +1,78 @@ -//========= Copyright Valve Corporation, All rights reserved. ============//
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by QC_Eyes.rc
-//
-#define IDD_QC_EYES_DIALOG 102
-#define IDR_MAINFRAME 128
-#define IDB_EYE_DEFAULT 150
-#define IDB_EYE_LOWER_HI 151
-#define IDB_EYE_LOWER_LO 152
-#define IDB_EYE_LOWER_MID 153
-#define IDB_EYE_UPPER_HI 154
-#define IDB_EYE_UPPER_LO 155
-#define IDB_EYE_UPPER_MID 156
-#define IDB_EYE_XY_L 157
-#define IDB_EYE_XY_R 158
-#define IDB_EYE_Z_L 159
-#define IDB_EYE_Z_R 160
-#define IDC_REFERENCE_FILENAME 1000
-#define IDC_EXPRESSIONS_FILENAME 1001
-#define IDC_MODEL_FILENAME 1002
-#define IDC_RIGHT_EYE_X 1003
-#define IDC_RIGHT_EYE_Y 1004
-#define IDC_RIGHT_EYE_Z 1005
-#define IDC_LEFT_EYE_X 1006
-#define IDC_LEFT_EYE_Y 1007
-#define IDC_LEFT_EYE_Z 1008
-#define IDC_Y_AXIS_UP 1009
-#define IDC_Z_AXIS_UP 1010
-#define IDC_DEFAULT_CONTROLS 1011
-#define IDC_ADVANCED_CONTROLS 1012
-#define IDC_UPPER_LID_RAISED 1013
-#define IDC_OUTPUT_TEXT 1014
-#define IDC_UPPER_LEFT_LID_RAISED 1015
-#define IDC_UPPER_LID_LOWERED 1016
-#define IDC_UPPER_LID_NEUTRAL 1017
-#define IDC_LOWER_LID_RAISED 1018
-#define IDC_LOWER_LID_LOWERED 1019
-#define IDC_LOWER_LID_NEUTRAL 1020
-#define IDC_IRIS_COLOR_GREEN 1021
-#define IDC_IRIS_COLOR_BLUE 1022
-#define IDC_IRIS_COLOR_BROWN 1023
-#define IDC_EYE_COLOR_LIGHT 1024
-#define IDC_EYE_COLOR_DARK 1025
-#define IDC_IRIS_SIZE 1026
-#define IDC_CREATE_QC_TEXT 1027
-#define IDC_EYEBALL_SIZE 1028
-#define IDC_COPY_TEXT_TO_CLIPBOARD 1029
-#define IDC_PICTURES 1030
-#define IDC_PICTURE_LABEL 1031
-#define IDC_LEFT_LID_CONTROL 1032
-#define IDC_UPPER_LEFT_LID_NEUTRAL 1033
-#define IDC_UPPER_LEFT_LID_LOWERED 1034
-#define IDC_LOWER_LEFT_LID_RAISED 1035
-#define IDC_LOWER_LEFT_LID_NEUTRAL 1036
-#define IDC_LOWER_LEFT_LID_LOWERED 1037
-#define IDC_EYE_DETAIL_CONTROL_FRAME 1038
-#define IDC_IRIS_SIZE_LABEL 1039
-#define IDC_EYEBALL_SIZE_LABEL 1040
-#define IDC_UPPER_LEFT_LID_PANEL 1041
-#define IDC_UPPER_LEFT_LID_RAISED_LABEL 1042
-#define IDC_UPPER_LEFT_LID_NEUTRAL_LABEL 1043
-#define IDC_UPPER_LEFT_LID_LOWERED_LABEL 1044
-#define IDC_LOWER_LEFT_LID_PANEL 1045
-#define IDC_LOWER_LEFT_LID_RAISED_LABEL 1046
-#define IDC_LOWER_LEFT_LID_NEUTRAL_LABEL 1047
-#define IDC_LOWER_LEFT_LID_LOWERED_LABEL 1048
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 130
-#define _APS_NEXT_COMMAND_VALUE 32771
-#define _APS_NEXT_CONTROL_VALUE 1049
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
+//========= Copyright Valve Corporation, All rights reserved. ============// +//{{NO_DEPENDENCIES}} +// Microsoft Developer Studio generated include file. +// Used by QC_Eyes.rc +// +#define IDD_QC_EYES_DIALOG 102 +#define IDR_MAINFRAME 128 +#define IDB_EYE_DEFAULT 150 +#define IDB_EYE_LOWER_HI 151 +#define IDB_EYE_LOWER_LO 152 +#define IDB_EYE_LOWER_MID 153 +#define IDB_EYE_UPPER_HI 154 +#define IDB_EYE_UPPER_LO 155 +#define IDB_EYE_UPPER_MID 156 +#define IDB_EYE_XY_L 157 +#define IDB_EYE_XY_R 158 +#define IDB_EYE_Z_L 159 +#define IDB_EYE_Z_R 160 +#define IDC_REFERENCE_FILENAME 1000 +#define IDC_EXPRESSIONS_FILENAME 1001 +#define IDC_MODEL_FILENAME 1002 +#define IDC_RIGHT_EYE_X 1003 +#define IDC_RIGHT_EYE_Y 1004 +#define IDC_RIGHT_EYE_Z 1005 +#define IDC_LEFT_EYE_X 1006 +#define IDC_LEFT_EYE_Y 1007 +#define IDC_LEFT_EYE_Z 1008 +#define IDC_Y_AXIS_UP 1009 +#define IDC_Z_AXIS_UP 1010 +#define IDC_DEFAULT_CONTROLS 1011 +#define IDC_ADVANCED_CONTROLS 1012 +#define IDC_UPPER_LID_RAISED 1013 +#define IDC_OUTPUT_TEXT 1014 +#define IDC_UPPER_LEFT_LID_RAISED 1015 +#define IDC_UPPER_LID_LOWERED 1016 +#define IDC_UPPER_LID_NEUTRAL 1017 +#define IDC_LOWER_LID_RAISED 1018 +#define IDC_LOWER_LID_LOWERED 1019 +#define IDC_LOWER_LID_NEUTRAL 1020 +#define IDC_IRIS_COLOR_GREEN 1021 +#define IDC_IRIS_COLOR_BLUE 1022 +#define IDC_IRIS_COLOR_BROWN 1023 +#define IDC_EYE_COLOR_LIGHT 1024 +#define IDC_EYE_COLOR_DARK 1025 +#define IDC_IRIS_SIZE 1026 +#define IDC_CREATE_QC_TEXT 1027 +#define IDC_EYEBALL_SIZE 1028 +#define IDC_COPY_TEXT_TO_CLIPBOARD 1029 +#define IDC_PICTURES 1030 +#define IDC_PICTURE_LABEL 1031 +#define IDC_LEFT_LID_CONTROL 1032 +#define IDC_UPPER_LEFT_LID_NEUTRAL 1033 +#define IDC_UPPER_LEFT_LID_LOWERED 1034 +#define IDC_LOWER_LEFT_LID_RAISED 1035 +#define IDC_LOWER_LEFT_LID_NEUTRAL 1036 +#define IDC_LOWER_LEFT_LID_LOWERED 1037 +#define IDC_EYE_DETAIL_CONTROL_FRAME 1038 +#define IDC_IRIS_SIZE_LABEL 1039 +#define IDC_EYEBALL_SIZE_LABEL 1040 +#define IDC_UPPER_LEFT_LID_PANEL 1041 +#define IDC_UPPER_LEFT_LID_RAISED_LABEL 1042 +#define IDC_UPPER_LEFT_LID_NEUTRAL_LABEL 1043 +#define IDC_UPPER_LEFT_LID_LOWERED_LABEL 1044 +#define IDC_LOWER_LEFT_LID_PANEL 1045 +#define IDC_LOWER_LEFT_LID_RAISED_LABEL 1046 +#define IDC_LOWER_LEFT_LID_NEUTRAL_LABEL 1047 +#define IDC_LOWER_LEFT_LID_LOWERED_LABEL 1048 + +// Next default values for new objects +// +#ifdef APSTUDIO_INVOKED +#ifndef APSTUDIO_READONLY_SYMBOLS +#define _APS_NEXT_RESOURCE_VALUE 130 +#define _APS_NEXT_COMMAND_VALUE 32771 +#define _APS_NEXT_CONTROL_VALUE 1049 +#define _APS_NEXT_SYMED_VALUE 101 +#endif +#endif |