Restructure repository to include all source folders

Move git root from Client/ to src/ to track all source code:
- Client: Game client source (moved to Client/Client/)
- Server: Game server source
- GameTools: Development tools
- CryptoSource: Encryption utilities
- database: Database scripts
- Script: Game scripts
- rylCoder_16.02.2008_src: Legacy coder tools
- GMFont, Game: Additional resources

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-11-29 20:17:20 +09:00
parent 5d3cd64a25
commit dd97ddec92
11602 changed files with 1446576 additions and 0 deletions

View File

@@ -0,0 +1,165 @@
// AmbienceList.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "AmbienceList.h"
#include <AmbienceStruct.h>
#include <SectorSoundMap.h>
#include <SectorDefine.h>
#include <SceneManager.h>
#include "WorldCreatorView.h"
#include "MainFrm.h"
#include <matrix.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CAmbienceList dialog
extern float CharToFloat( const char * szStr );
CAmbienceList::CAmbienceList(CWnd* pParent /*=NULL*/)
: CDialog(CAmbienceList::IDD, pParent)
{
//{{AFX_DATA_INIT(CAmbienceList)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CAmbienceList::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAmbienceList)
DDX_Control(pDX, IDC_LIST, m_List);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAmbienceList, CDialog)
//{{AFX_MSG_MAP(CAmbienceList)
ON_NOTIFY(NM_DBLCLK, IDC_LIST, OnDblclkList)
ON_NOTIFY(LVN_KEYDOWN, IDC_LIST, OnKeydownList)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAmbienceList message handlers
extern const char * FloatToChar( float fvalue );
BOOL CAmbienceList::OnInitDialog()
{
CDialog::OnInitDialog();
DWORD dwStyle;
dwStyle = m_List.SendMessage(LVM_GETEXTENDEDLISTVIEWSTYLE, 0 ,0);
dwStyle |= LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES;
m_List.SendMessage( LVM_SETEXTENDEDLISTVIEWSTYLE, 0,dwStyle );
m_List.InsertColumn( 0, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", LVCFMT_LEFT, 50 );
m_List.InsertColumn( 1, "x", LVCFMT_LEFT, 100 );
m_List.InsertColumn( 2, "y", LVCFMT_LEFT, 100 );
m_List.InsertColumn( 3, "z", LVCFMT_LEFT, 100 );
m_List.InsertColumn( 4, "<EFBFBD>ּҰŸ<EFBFBD>", LVCFMT_LEFT, 100 );
m_List.InsertColumn( 5, "<EFBFBD>ִ<EFBFBD><EFBFBD>Ÿ<EFBFBD>", LVCFMT_LEFT, 100 );
UpdateList();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CAmbienceList::UpdateList()
{
m_List.DeleteAllItems();
CSectorSoundMap & soundMap = CSectorSoundMap::GetInstance();
int nItem = 0;
for( int sX = 0; sX < 30; sX++ )
{
for( int sY = 0; sY < 30; sY++ )
{
int nAmbiences = soundMap.GetAmbienceCount( sX, sY );
for( int i = 0; i < nAmbiences; i++ )
{
SAmbience * pAmb = soundMap.GetAmbience( sX, sY, i );
CString SectorPos;
SectorPos.Format( "%d,%d", int( pAmb->m_fPosX / SECTORSIZE ), int( pAmb->m_fPosZ / SECTORSIZE ) );
m_List.InsertItem( nItem, SectorPos );
m_List.SetItemText( nItem, 1, FloatToChar( pAmb->m_fPosX ) );
m_List.SetItemText( nItem, 2, FloatToChar( pAmb->m_fPosY ) );
m_List.SetItemText( nItem, 3, FloatToChar( pAmb->m_fPosZ ) );
m_List.SetItemText( nItem, 4, FloatToChar( pAmb->m_fMinDistance ) );
m_List.SetItemText( nItem, 5, FloatToChar( pAmb->m_fMaxDistance ) );
nItem++;
}
}
}
}
void CAmbienceList::OnDblclkList(NMHDR* pNMHDR, LRESULT* pResult)
{
int curSel = m_List.GetNextItem(-1,LVNI_SELECTED);
if( curSel >= 0 )
{
float x = CharToFloat( m_List.GetItemText( curSel, 1 ) );
float y = CharToFloat( m_List.GetItemText( curSel, 2 ) );
float z = CharToFloat( m_List.GetItemText( curSel, 3 ) );
matrix *ViewPos=CSceneManager::GetCamera()->GetMatPosition();
ViewPos->_41 = x;
ViewPos->_42 = y + 500.0f;
ViewPos->_43 = z;
CMainFrame *mf=(CMainFrame*)AfxGetApp()->m_pMainWnd;
CWorldCreatorView *av=(CWorldCreatorView *)mf->GetActiveView();
av->m_SceneManager->UpdateScene(0.0f);
}
OnOK();
*pResult = 0;
}
void CAmbienceList::OnKeydownList(NMHDR* pNMHDR, LRESULT* pResult)
{
LV_KEYDOWN* pLVKeyDow = (LV_KEYDOWN*)pNMHDR;
if( pLVKeyDow->wVKey == VK_DELETE )
{
int curSel = m_List.GetNextItem(-1,LVNI_SELECTED);
if( curSel >= 0 )
{
float x = CharToFloat( m_List.GetItemText( curSel, 1 ) );
float y = CharToFloat( m_List.GetItemText( curSel, 2 ) );
float z = CharToFloat( m_List.GetItemText( curSel, 3 ) );
CSectorSoundMap & soundMap = CSectorSoundMap::GetInstance();
long objID = soundMap.DeleteAmbience( x, y, z );
UpdateList();
CMainFrame *mf=(CMainFrame*)AfxGetApp()->m_pMainWnd;
CWorldCreatorView *av=(CWorldCreatorView *)mf->GetActiveView();
if( objID != -1 )
{
av->m_SceneManager->m_MapStorage.DelMeshMap( x, y, z, objID );
av->m_SceneManager->m_HeightField.GenerateSectorSceneObjects( x/SECTORSIZE, z/SECTORSIZE );
}
}
}
*pResult = 0;
}

View File

@@ -0,0 +1,49 @@
#if !defined(AFX_AMBIENCELIST_H__0A0DF2B9_A10F_4E43_8321_A48FB19068B6__INCLUDED_)
#define AFX_AMBIENCELIST_H__0A0DF2B9_A10F_4E43_8321_A48FB19068B6__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// AmbienceList.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CAmbienceList dialog
class CAmbienceList : public CDialog
{
// Construction
public:
CAmbienceList(CWnd* pParent = NULL); // standard constructor
void UpdateList();
// Dialog Data
//{{AFX_DATA(CAmbienceList)
enum { IDD = IDD_DIALOG_AMBIENCELIST };
CListCtrl m_List;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAmbienceList)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CAmbienceList)
virtual BOOL OnInitDialog();
afx_msg void OnDblclkList(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnKeydownList(NMHDR* pNMHDR, LRESULT* pResult);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_AMBIENCELIST_H__0A0DF2B9_A10F_4E43_8321_A48FB19068B6__INCLUDED_)

View File

@@ -0,0 +1,247 @@
// CharEffect.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "CharEffect.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CCharEffect dialog
CCharEffect::CCharEffect(CWnd* pParent /*=NULL*/)
: CDialog(CCharEffect::IDD, pParent)
{
//{{AFX_DATA_INIT(CCharEffect)
m_strEsfName = _T("");
m_fWRot = 0.0f;
m_fXPos = 0.0f;
m_fXRot = 0.0f;
m_fYPos = 0.0f;
m_fYRot = 0.0f;
m_fZPos = 0.0f;
m_fZRot = 0.0f;
m_strPivotName = _T("");
m_iPosUpdate = 1;
m_iRotUpdate = 1;
//}}AFX_DATA_INIT
}
void CCharEffect::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCharEffect)
DDX_Text(pDX, IDC_ESF, m_strEsfName);
DDX_Text(pDX, IDC_WROT, m_fWRot);
DDX_Text(pDX, IDC_XPOS, m_fXPos);
DDX_Text(pDX, IDC_XROT, m_fXRot);
DDX_Text(pDX, IDC_YPOS, m_fYPos);
DDX_Text(pDX, IDC_YROT, m_fYRot);
DDX_Text(pDX, IDC_ZPOS, m_fZPos);
DDX_Text(pDX, IDC_ZROT, m_fZRot);
DDX_Text(pDX, IDC_PIVOTNAME, m_strPivotName);
DDX_Radio(pDX, IDC_RADIO1, m_iPosUpdate);
DDX_Radio(pDX, IDC_RADIO3, m_iRotUpdate);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCharEffect, CDialog)
//{{AFX_MSG_MAP(CCharEffect)
ON_BN_CLICKED(IDC_ESFSEARCH, OnEsfsearch)
ON_BN_CLICKED(IDC_AUTO, OnAuto)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCharEffect message handlers
void CCharEffect::OnEsfsearch()
{
// TODO: Add your control notification handler code here
char str[] = "Esf <20><><EFBFBD><EFBFBD>(*.esf) |*.esf| <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(*.*)|*.*||";
CString strFilter = str;
CFileDialog filedia(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.DoModal();
m_strEsfName = filedia.GetFileName();
UpdateData(FALSE);
}
void CCharEffect::OnOK()
{
// TODO: Add extra validation here
UpdateData(TRUE);
if(m_strEsfName.GetLength() <= 1 && m_strPivotName.GetLength() <= 1)
{
MessageBox("<EFBFBD>Է<EFBFBD><EFBFBD><EFBFBD> <20>߸<EFBFBD><DFB8>Ǿ<EFBFBD><C7BE><EFBFBD><EFBFBD>ϴ<EFBFBD>.");
return;
}
PushCharEffectToEsf();
MessageBox("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
CDialog::OnOK();
}
void CCharEffect::OnCancel()
{
// TODO: Add extra cleanup here
CDialog::OnCancel();
}
void CCharEffect::PushCharEffectToEsf()
{
char strBuffer[80][256];
int i;
memset(strBuffer,0,sizeof(char) * 256 * 80);
FILE *fp = fopen(m_strEsfName.LockBuffer(),"rt");
int iReadCount = 0;
while(!feof(fp))
{
fgets(strBuffer[iReadCount++],256,fp);
}
fclose(fp);
fp = fopen(m_strEsfName.LockBuffer(),"wt");
if( fp == NULL)
{
MessageBox("File <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>");
return;
}
for(i = 0; i < iReadCount; i++)
{
char tmpBuf[256];
strcpy(tmpBuf,strBuffer[i]);
char *token = strtok(tmpBuf,"\n\t ");
if(token != NULL)
{
if(!strcmp(token,"FIN:"))
continue;
if(!strcmp(token,"CHARACTER:"))
continue;
}
fputs(strBuffer[i],fp);
}
fprintf(fp,"\nCHARACTER: %s [ %f %f %f ] [ %f %f %f %f ] %d %d\n", m_strPivotName.LockBuffer(),m_fXPos,m_fYPos,m_fZPos,
m_fXRot,m_fYRot,m_fZRot,m_fWRot,m_iPosUpdate,m_iRotUpdate);
fprintf(fp,"FIN:\n");
fclose(fp);
}
void CCharEffect::OnAuto()
{
// TODO: Add your control notification handler code here
// <20>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD> Ŭ<><C5AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E5BFA1> Data <20>о<EFBFBD><D0BE><EFBFBD>.
BOOL bActiveClipBoard = IsClipboardFormatAvailable (CF_TEXT) ;
if(bActiveClipBoard)
{
OpenClipboard ();
GLOBALHANDLE hGlobal = GetClipboardData (CF_TEXT) ;
if(hGlobal == NULL)
{
MessageBox("ClipBoard<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.");
m_fXPos = m_fYPos = m_fZPos = m_fXRot = m_fYRot = m_fZRot = m_fWRot = 0.0f;
UpdateData(FALSE);
return;
}
char *pClipText = (char *) malloc(GlobalSize (hGlobal));
char *pGlobal;
pGlobal = (char *)GlobalLock (hGlobal) ;
if(pGlobal == NULL)
{
MessageBox("ClipBoard<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.");
m_fXPos = m_fYPos = m_fZPos = m_fXRot = m_fYRot = m_fZRot = m_fWRot = 0.0f;
UpdateData(FALSE);
return;
}
strcpy (pClipText, pGlobal) ;
GlobalUnlock (hGlobal) ;
CloseClipboard () ;
char *token = strtok(pClipText,"\n\t ");
if(token == NULL)
{
MessageBox("ClipBoard<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.");
m_fXPos = m_fYPos = m_fZPos = m_fXRot = m_fYRot = m_fZRot = m_fWRot = 0.0f;
UpdateData(FALSE);
return;
}
m_fXPos = atof(token);
token = strtok(NULL,"\n\t ");
if(token == NULL)
{
MessageBox("ClipBoard<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.");
m_fXPos = m_fYPos = m_fZPos = m_fXRot = m_fYRot = m_fZRot = m_fWRot = 0.0f;
UpdateData(FALSE);
return;
}
m_fYPos = atof(token);
token = strtok(NULL,"\n\t ");
if(token == NULL)
{
MessageBox("ClipBoard<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.");
m_fXPos = m_fYPos = m_fZPos = m_fXRot = m_fYRot = m_fZRot = m_fWRot = 0.0f;
UpdateData(FALSE);
return;
}
m_fZPos = atof(token);
token = strtok(NULL,"\n\t ");
if(token == NULL)
{
MessageBox("ClipBoard<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.");
m_fXPos = m_fYPos = m_fZPos = m_fXRot = m_fYRot = m_fZRot = m_fWRot = 0.0f;
UpdateData(FALSE);
return;
}
m_fXRot = atof(token);
token = strtok(NULL,"\n\t ");
if(token == NULL)
{
MessageBox("ClipBoard<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.");
m_fXPos = m_fYPos = m_fZPos = m_fXRot = m_fYRot = m_fZRot = m_fWRot = 0.0f;
UpdateData(FALSE);
return;
}
m_fYRot = atof(token);
token = strtok(NULL,"\n\t ");
if(token == NULL)
{
MessageBox("ClipBoard<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.");
m_fXPos = m_fYPos = m_fZPos = m_fXRot = m_fYRot = m_fZRot = m_fWRot = 0.0f;
UpdateData(FALSE);
return;
}
m_fZRot = atof(token);
token = strtok(NULL,"\n\t ");
if(token == NULL)
{
MessageBox("ClipBoard<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.");
m_fXPos = m_fYPos = m_fZPos = m_fXRot = m_fYRot = m_fZRot = m_fWRot = 0.0f;
UpdateData(FALSE);
return;
}
m_fWRot = atof(token);
free(pClipText);
UpdateData(FALSE);
}
else
{
m_fXPos = m_fYPos = m_fZPos = m_fXRot = m_fYRot = m_fZRot = m_fWRot = 0.0f;
UpdateData(FALSE);
MessageBox("ClipBoard<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.");
}
//
}

View File

@@ -0,0 +1,60 @@
#if !defined(AFX_CHAREFFECT_H__39BDBBA2_E3DD_45BE_9FAB_C978B948F54F__INCLUDED_)
#define AFX_CHAREFFECT_H__39BDBBA2_E3DD_45BE_9FAB_C978B948F54F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// CharEffect.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CCharEffect dialog
class CCharEffect : public CDialog
{
// Construction
public:
CCharEffect(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CCharEffect)
enum { IDD = IDD_CHAREFF };
CString m_strEsfName;
float m_fWRot;
float m_fXPos;
float m_fXRot;
float m_fYPos;
float m_fYRot;
float m_fZPos;
float m_fZRot;
CString m_strPivotName;
int m_iPosUpdate;
int m_iRotUpdate;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCharEffect)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CCharEffect)
afx_msg void OnEsfsearch();
virtual void OnOK();
virtual void OnCancel();
afx_msg void OnAuto();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
void PushCharEffectToEsf();
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CHAREFFECT_H__39BDBBA2_E3DD_45BE_9FAB_C978B948F54F__INCLUDED_)

View File

@@ -0,0 +1,285 @@
// ColourPicker.cpp : implementation file
//
//
// ColourPicker is a drop-in colour picker control. Check out the
// header file or the accompanying HTML doc file for details.
//
// Written by Chris Maunder (Chris.Maunder@cbr.clw.csiro.au)
// Extended by Alexander Bischofberger (bischofb@informatik.tu-muenchen.de)
// Copyright (c) 1998.
//
// This code may be used in compiled form in any way you desire. This
// file may be redistributed unmodified by any means PROVIDING it is
// not sold for profit without the authors written consent, and
// providing that this notice and the authors name is included. If
// the source code in this file is used in any commercial application
// then a simple email would be nice.
//
// This file is provided "as is" with no expressed or implied warranty.
// The author accepts no liability if it causes any damage to your
// computer, causes your pet cat to fall ill, increases baldness or
// makes you car start emitting strange noises when you start it up.
//
// Expect bugs.
//
// Please use and enjoy. Please let me know of any bugs/mods/improvements
// that you have found/implemented and I will fix/incorporate them into this
// file.
//
// Updated 16 May 1998
#include "stdafx.h"
#include "ColourPopup.h"
#include "ColourPicker.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
void AFXAPI DDX_ColourPicker(CDataExchange *pDX, int nIDC, COLORREF& crColour)
{
HWND hWndCtrl = pDX->PrepareCtrl(nIDC);
ASSERT (hWndCtrl != NULL);
CColourPicker* pColourPicker = (CColourPicker*) CWnd::FromHandle(hWndCtrl);
if (pDX->m_bSaveAndValidate)
{
crColour = pColourPicker->GetColour();
}
else // initializing
{
pColourPicker->SetColour(crColour);
}
}
/////////////////////////////////////////////////////////////////////////////
// CColourPicker
CColourPicker::CColourPicker()
{
SetBkColour(GetSysColor(COLOR_3DFACE));
SetTextColour(GetSysColor(COLOR_BTNTEXT));
m_bTrackSelection = FALSE;
m_nSelectionMode = CP_MODE_BK;
m_bActive = FALSE;
}
CColourPicker::~CColourPicker()
{
}
IMPLEMENT_DYNCREATE(CColourPicker, CButton)
BEGIN_MESSAGE_MAP(CColourPicker, CButton)
//{{AFX_MSG_MAP(CColourPicker)
ON_CONTROL_REFLECT_EX(BN_CLICKED, OnClicked)
ON_WM_CREATE()
//}}AFX_MSG_MAP
ON_MESSAGE(CPN_SELENDOK, OnSelEndOK)
ON_MESSAGE(CPN_SELENDCANCEL, OnSelEndCancel)
ON_MESSAGE(CPN_SELCHANGE, OnSelChange)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CColourPicker message handlers
LONG CColourPicker::OnSelEndOK(UINT lParam, LONG wParam)
{
COLORREF crNewColour = (COLORREF) lParam;
m_bActive = FALSE;
SetColour(crNewColour);
CWnd *pParent = GetParent();
if (pParent) {
pParent->SendMessage(CPN_CLOSEUP, lParam, (WPARAM) GetDlgCtrlID());
pParent->SendMessage(CPN_SELENDOK, lParam, (WPARAM) GetDlgCtrlID());
}
if (crNewColour != GetColour())
if (pParent) pParent->SendMessage(CPN_SELCHANGE, lParam, (WPARAM) GetDlgCtrlID());
return TRUE;
}
LONG CColourPicker::OnSelEndCancel(UINT lParam, LONG wParam)
{
m_bActive = FALSE;
SetColour((COLORREF) lParam);
CWnd *pParent = GetParent();
if (pParent) {
pParent->SendMessage(CPN_CLOSEUP, lParam, (WPARAM) GetDlgCtrlID());
pParent->SendMessage(CPN_SELENDCANCEL, lParam, (WPARAM) GetDlgCtrlID());
}
return TRUE;
}
LONG CColourPicker::OnSelChange(UINT lParam, LONG wParam)
{
if (m_bTrackSelection) SetColour((COLORREF) lParam);
CWnd *pParent = GetParent();
if (pParent) pParent->SendMessage(CPN_SELCHANGE, lParam, (WPARAM) GetDlgCtrlID());
return TRUE;
}
int CColourPicker::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CButton::OnCreate(lpCreateStruct) == -1)
return -1;
SetWindowSize(); // resize appropriately
return 0;
}
// On mouse click, create and show a CColourPopup window for colour selection
BOOL CColourPicker::OnClicked()
{
m_bActive = TRUE;
CRect rect;
GetWindowRect(rect);
new CColourPopup(CPoint(rect.left, rect.bottom), GetColour(), this, 10,
_T("More..."));
CWnd *pParent = GetParent();
if (pParent)
pParent->SendMessage(CPN_DROPDOWN, (LPARAM)GetColour(), (WPARAM) GetDlgCtrlID());
// Docs say I should return FALSE to stop the parent also getting the message.
// HA! What a joke.
return TRUE;
}
void CColourPicker::DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct)
{
ASSERT(lpDrawItemStruct);
CDC* pDC = CDC::FromHandle(lpDrawItemStruct->hDC);
CRect rect = lpDrawItemStruct->rcItem;
UINT state = lpDrawItemStruct->itemState;
DWORD dwStyle = GetStyle();
CString m_strText;
if(m_crColourBk & 0xff000000)
{
m_crColourBk-=0xff000000;
}
CSize Margins(::GetSystemMetrics(SM_CXEDGE), ::GetSystemMetrics(SM_CYEDGE));
// Draw arrow
if (m_bActive) state |= ODS_SELECTED;
pDC->DrawFrameControl(&m_ArrowRect, DFC_SCROLL, DFCS_SCROLLDOWN |
((state & ODS_SELECTED) ? DFCS_PUSHED : 0) |
((state & ODS_DISABLED) ? DFCS_INACTIVE : 0));
pDC->DrawEdge(rect, EDGE_SUNKEN, BF_RECT);
// Must reduce the size of the "client" area of the button due to edge thickness.
rect.DeflateRect(Margins.cx, Margins.cy);
// Fill remaining area with colour
rect.right -= m_ArrowRect.Width();
CBrush brush((state & ODS_DISABLED)? ::GetSysColor(COLOR_3DFACE) : m_crColourBk);
CBrush* pOldBrush = (CBrush*) pDC->SelectObject(&brush);
pDC->SelectStockObject(NULL_PEN);
pDC->Rectangle(rect);
pDC->SelectObject(pOldBrush);
// Draw the window text (if any)
GetWindowText(m_strText);
if (m_strText.GetLength())
{
pDC->SetBkMode(TRANSPARENT);
if (state & ODS_DISABLED)
{
rect.OffsetRect(1,1);
pDC->SetTextColor(::GetSysColor(COLOR_3DHILIGHT));
pDC->DrawText(m_strText, rect, DT_CENTER|DT_SINGLELINE|DT_VCENTER);
rect.OffsetRect(-1,-1);
pDC->SetTextColor(::GetSysColor(COLOR_3DSHADOW));
pDC->DrawText(m_strText, rect, DT_CENTER|DT_SINGLELINE|DT_VCENTER);
}
else
{
pDC->SetTextColor(m_crColourText);
pDC->DrawText(m_strText, rect, DT_CENTER|DT_SINGLELINE|DT_VCENTER);
}
}
// Draw focus rect
if (state & ODS_FOCUS)
{
rect.DeflateRect(1,1);
pDC->DrawFocusRect(rect);
}
}
/////////////////////////////////////////////////////////////////////////////
// CColourPicker overrides
void CColourPicker::PreSubclassWindow()
{
ModifyStyle(0, BS_OWNERDRAW); // Make it owner drawn
CButton::PreSubclassWindow();
SetWindowSize(); // resize appropriately
}
/////////////////////////////////////////////////////////////////////////////
// CColourPicker attributes
void CColourPicker::SetBkColour(COLORREF crColourBk)
{
m_crColourBk = crColourBk;
if (IsWindow(m_hWnd)) RedrawWindow();
}
void CColourPicker::SetTextColour(COLORREF crColourText)
{
m_crColourText = crColourText;
if (IsWindow(m_hWnd)) RedrawWindow();
}
/////////////////////////////////////////////////////////////////////////////
// CColourPicker implementation
void CColourPicker::SetWindowSize()
{
// Get size dimensions of edges
CSize MarginSize(::GetSystemMetrics(SM_CXEDGE), ::GetSystemMetrics(SM_CYEDGE));
// Get size of dropdown arrow
int nArrowWidth = max(::GetSystemMetrics(SM_CXHTHUMB), 5*MarginSize.cx);
int nArrowHeight = max(::GetSystemMetrics(SM_CYVTHUMB), 5*MarginSize.cy);
CSize ArrowSize(max(nArrowWidth, nArrowHeight), max(nArrowWidth, nArrowHeight));
//ArrowSize = CSize(40,40); // for testing
// Get window size
CRect rect;
GetWindowRect(rect);
CWnd* pParent = GetParent();
if (pParent)
pParent->ScreenToClient(rect);
// Set window size at least as wide as 2 arrows, and as high as arrow + margins
int nWidth = max(rect.Width(), 2*ArrowSize.cx + 2*MarginSize.cx);
MoveWindow(rect.left, rect.top, nWidth, ArrowSize.cy+2*MarginSize.cy, TRUE);
// Get the new coords of this window
GetWindowRect(rect);
ScreenToClient(rect);
// Get the rect where the arrow goes, and convert to client coords.
m_ArrowRect.SetRect(rect.right - ArrowSize.cx - MarginSize.cx,
rect.top + MarginSize.cy, rect.right - MarginSize.cx,
rect.bottom - MarginSize.cy);
}

View File

@@ -0,0 +1,110 @@
#if !defined(AFX_COLOURPICKER_H__D0B75901_9830_11D1_9C0F_00A0243D1382__INCLUDED_)
#define AFX_COLOURPICKER_H__D0B75901_9830_11D1_9C0F_00A0243D1382__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// ColourPicker.h : header file
//
// Written by Chris Maunder (Chris.Maunder@cbr.clw.csiro.au)
// Extended by Alexander Bischofberger (bischofb@informatik.tu-muenchen.de)
// Copyright (c) 1998.
//
// This code may be used in compiled form in any way you desire. This
// file may be redistributed unmodified by any means PROVIDING it is
// not sold for profit without the authors written consent, and
// providing that this notice and the authors name is included. If
// the source code in this file is used in any commercial application
// then a simple email would be nice.
//
// This file is provided "as is" with no expressed or implied warranty.
// The author accepts no liability if it causes any damage whatsoever.
// It's free - so you get what you pay for.
#include "ColourPopup.h"
/////////////////////////////////////////////////////////////////////////////
// CColourPicker window
void AFXAPI DDX_ColourPicker(CDataExchange *pDX, int nIDC, COLORREF& crColour);
/////////////////////////////////////////////////////////////////////////////
// CColourPicker window
#define CP_MODE_TEXT 1 // edit text colour
#define CP_MODE_BK 2 // edit background colour (default)
class CColourPicker : public CButton
{
// Construction
public:
CColourPicker();
DECLARE_DYNCREATE(CColourPicker);
// Attributes
public:
void SetBkColour(COLORREF crColourBk);
COLORREF GetBkColour() { return m_crColourBk; }
void SetTextColour(COLORREF crColourText);
COLORREF GetTextColour() { return m_crColourText;}
void SetTrackSelection(BOOL bTracking = TRUE) { m_bTrackSelection = bTracking; }
BOOL GetTrackSelection() { return m_bTrackSelection; }
void SetSelectionMode(UINT nMode) { m_nSelectionMode = nMode; }
UINT GetSelectionMode() { return m_nSelectionMode; };
COLORREF GetColour() { return (m_nSelectionMode == CP_MODE_TEXT)?
GetTextColour(): GetBkColour(); }
void SetColour(COLORREF crColour)
{ (m_nSelectionMode == CP_MODE_TEXT)?
SetTextColour(crColour): SetBkColour(crColour); }
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CColourPicker)
public:
virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct);
protected:
virtual void PreSubclassWindow();
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CColourPicker();
protected:
void SetWindowSize();
// protected attributes
protected:
BOOL m_bActive, // Is the dropdown active?
m_bTrackSelection; // track colour changes?
COLORREF m_crColourBk;
COLORREF m_crColourText;
UINT m_nSelectionMode;
CRect m_ArrowRect;
// Generated message map functions
protected:
//{{AFX_MSG(CColourPicker)
afx_msg BOOL OnClicked();
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
afx_msg LONG OnSelEndOK(UINT lParam, LONG wParam);
afx_msg LONG OnSelEndCancel(UINT lParam, LONG wParam);
afx_msg LONG OnSelChange(UINT lParam, LONG wParam);
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_COLOURPICKER_H__D0B75901_9830_11D1_9C0F_00A0243D1382__INCLUDED_)

View File

@@ -0,0 +1,643 @@
// ColourPopup.cpp : implementation file
//
// Written by Chris Maunder (Chris.Maunder@cbr.clw.csiro.au)
// Extended by Alexander Bischofberger (bischofb@informatik.tu-muenchen.de)
// Copyright (c) 1998.
//
// ColourPopup is a helper class for the colour picker control
// CColourPicker. Check out the header file or the accompanying
// HTML doc file for details.
//
// This code may be used in compiled form in any way you desire. This
// file may be redistributed unmodified by any means PROVIDING it is
// not sold for profit without the authors written consent, and
// providing that this notice and the authors name is included.
//
// This file is provided "as is" with no expressed or implied warranty.
// The author accepts no liability if it causes any damage to you or your
// computer whatsoever. It's free, so don't hassle me about it.
//
// Expect bugs.
//
// Please use and enjoy. Please let me know of any bugs/mods/improvements
// that you have found/implemented and I will fix/incorporate them into this
// file.
#include "stdafx.h"
#include <math.h>
#include "ColourPicker.h"
#include "ColourPopup.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#define TEXT_BOX_VALUE -2 // Sorry about this hack...
#define MAX_COLOURS 100
ColourTableEntry CColourPopup::m_crColours[] =
{
{ RGB(0x00, 0x00, 0x00), _T("Black") },
{ RGB(0xA5, 0x2A, 0x00), _T("Brown") },
{ RGB(0x00, 0x40, 0x40), _T("Dark Olive Green") },
{ RGB(0x00, 0x55, 0x00), _T("Dark Green") },
{ RGB(0x00, 0x00, 0x5E), _T("Dark Teal") },
{ RGB(0x00, 0x00, 0x8B), _T("Dark blue") },
{ RGB(0x4B, 0x00, 0x82), _T("Indigo") },
{ RGB(0x28, 0x28, 0x28), _T("Dark grey") },
{ RGB(0x8B, 0x00, 0x00), _T("Dark red") },
{ RGB(0xFF, 0x68, 0x20), _T("Orange") },
{ RGB(0x8B, 0x8B, 0x00), _T("Dark yellow") },
{ RGB(0x00, 0x93, 0x00), _T("Green") },
{ RGB(0x38, 0x8E, 0x8E), _T("Teal") },
{ RGB(0x00, 0x00, 0xFF), _T("Blue") },
{ RGB(0x7B, 0x7B, 0xC0), _T("Blue-grey") },
{ RGB(0x66, 0x66, 0x66), _T("Grey - 40") },
{ RGB(0xFF, 0x00, 0x00), _T("Red") },
{ RGB(0xFF, 0xAD, 0x5B), _T("Light orange") },
{ RGB(0x32, 0xCD, 0x32), _T("Lime") },
{ RGB(0x3C, 0xB3, 0x71), _T("Sea green") },
{ RGB(0x7F, 0xFF, 0xD4), _T("Aqua") },
{ RGB(0x7D, 0x9E, 0xC0), _T("Light blue") },
{ RGB(0x80, 0x00, 0x80), _T("Violet") },
{ RGB(0x7F, 0x7F, 0x7F), _T("Grey - 50") },
{ RGB(0xFF, 0xC0, 0xCB), _T("Pink") },
{ RGB(0xFF, 0xD7, 0x00), _T("Gold") },
{ RGB(0xFF, 0xFF, 0x00), _T("Yellow") },
{ RGB(0x00, 0xFF, 0x00), _T("Bright green") },
{ RGB(0x40, 0xE0, 0xD0), _T("Turquoise") },
{ RGB(0xC0, 0xFF, 0xFF), _T("Skyblue") },
{ RGB(0x48, 0x00, 0x48), _T("Plum") },
{ RGB(0xC0, 0xC0, 0xC0), _T("Light grey") },
{ RGB(0xFF, 0xE4, 0xE1), _T("Rose") },
{ RGB(0xD2, 0xB4, 0x8C), _T("Tan") },
{ RGB(0xFF, 0xFF, 0xE0), _T("Light yellow") },
{ RGB(0x98, 0xFB, 0x98), _T("Pale green ") },
{ RGB(0xAF, 0xEE, 0xEE), _T("Pale turquoise") },
{ RGB(0x68, 0x83, 0x8B), _T("Pale blue") },
{ RGB(0xE6, 0xE6, 0xFA), _T("Lavender") },
{ RGB(0xFF, 0xFF, 0xFF), _T("White") }
};
/////////////////////////////////////////////////////////////////////////////
// CColourPopup
CColourPopup::CColourPopup()
{
Initialise();
}
CColourPopup::CColourPopup(CPoint p, COLORREF crColour, CWnd* pParentWnd, UINT nID,
LPCTSTR szCustomText /* = NULL */)
{
Initialise();
m_crColour = m_crInitialColour = crColour;
if (szCustomText != NULL)
{
m_bShowCustom = TRUE;
m_strCustomText = szCustomText;
} else
m_bShowCustom = FALSE;
m_pParent = pParentWnd;
CColourPopup::Create(p, crColour, pParentWnd, nID, szCustomText);
}
void CColourPopup::Initialise()
{
m_nNumColours = sizeof(m_crColours)/sizeof(ColourTableEntry);
ASSERT(m_nNumColours <= MAX_COLOURS);
if (m_nNumColours > MAX_COLOURS)
m_nNumColours = MAX_COLOURS;
m_nNumColumns = 0;
m_nNumRows = 0;
m_nBoxSize = 18;
m_nMargin = ::GetSystemMetrics(SM_CXEDGE);
m_nCurrentRow = -1;
m_nCurrentCol = -1;
m_nChosenColourRow = -1;
m_nChosenColourCol = -1;
m_strCustomText = _T("More...");
m_bShowCustom = TRUE;
m_pParent = NULL;
m_crColour = m_crInitialColour = RGB(0,0,0);
// Idiot check: Make sure the colour square is at least 5 x 5;
if (m_nBoxSize - 2*m_nMargin - 2 < 5) m_nBoxSize = 5 + 2*m_nMargin + 2;
// Create the font
NONCLIENTMETRICS ncm;
ncm.cbSize = sizeof(NONCLIENTMETRICS);
VERIFY(SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(NONCLIENTMETRICS), &ncm, 0));
m_Font.CreateFontIndirect(&(ncm.lfMessageFont));
// Create the palette
struct {
LOGPALETTE LogPalette;
PALETTEENTRY PalEntry[MAX_COLOURS];
} pal;
LOGPALETTE* pLogPalette = (LOGPALETTE*) &pal;
pLogPalette->palVersion = 0x300;
pLogPalette->palNumEntries = m_nNumColours;
for (int i = 0; i < m_nNumColours; i++)
{
pLogPalette->palPalEntry[i].peRed = GetRValue(m_crColours[i].crColour);
pLogPalette->palPalEntry[i].peGreen = GetGValue(m_crColours[i].crColour);
pLogPalette->palPalEntry[i].peBlue = GetBValue(m_crColours[i].crColour);
pLogPalette->palPalEntry[i].peFlags = 0;
}
m_Palette.CreatePalette(pLogPalette);
}
CColourPopup::~CColourPopup()
{
m_Font.DeleteObject();
m_Palette.DeleteObject();
}
BOOL CColourPopup::Create(CPoint p, COLORREF crColour, CWnd* pParentWnd, UINT nID,
LPCTSTR szCustomText /* = NULL */)
{
ASSERT(pParentWnd && ::IsWindow(pParentWnd->GetSafeHwnd()));
ASSERT(pParentWnd->IsKindOf(RUNTIME_CLASS(CColourPicker)));
m_pParent = pParentWnd;
m_crColour = m_crInitialColour = crColour;
// Get the class name and create the window
CString szClassName = AfxRegisterWndClass(CS_CLASSDC|CS_SAVEBITS|CS_HREDRAW|CS_VREDRAW,
0, (HBRUSH)GetStockObject(LTGRAY_BRUSH),0);
if (!CWnd::CreateEx(0, szClassName, _T(""), WS_VISIBLE|WS_POPUP,
p.x, p.y, 100, 100, // size updated soon
pParentWnd->GetSafeHwnd(), 0, NULL))
return FALSE;
// Store the Custom text
if (szCustomText != NULL)
m_strCustomText = szCustomText;
// Set the window size
SetWindowSize();
// Create the tooltips
CreateToolTips();
// Find which cell (if any) corresponds to the initial colour
FindCellFromColour(crColour);
// Capture all mouse events for the life of this window
SetCapture();
return TRUE;
}
BEGIN_MESSAGE_MAP(CColourPopup, CWnd)
//{{AFX_MSG_MAP(CColourPopup)
ON_WM_NCDESTROY()
ON_WM_LBUTTONUP()
ON_WM_PAINT()
ON_WM_MOUSEMOVE()
ON_WM_KEYDOWN()
ON_WM_QUERYNEWPALETTE()
ON_WM_PALETTECHANGED()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CColourPopup message handlers
// For tooltips
BOOL CColourPopup::PreTranslateMessage(MSG* pMsg)
{
m_ToolTip.RelayEvent(pMsg);
return CWnd::PreTranslateMessage(pMsg);
}
// If an arrow key is pressed, then move the selection
void CColourPopup::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
int row = m_nCurrentRow,
col = m_nCurrentCol;
if (nChar == VK_DOWN)
{
if (row < 0) { row = 0; col = 0; }
else if (row < m_nNumRows-1) row++;
else { row = TEXT_BOX_VALUE; col = TEXT_BOX_VALUE; }
ChangeSelection(row, col);
}
if (nChar == VK_UP)
{
if (row < 0) { row = m_nNumRows-1; col = 0; }
else if (row > 0) row--;
else { row = TEXT_BOX_VALUE; col = TEXT_BOX_VALUE; }
ChangeSelection(row, col);
}
if (nChar == VK_RIGHT)
{
if (col < 0) { row = 0; col = 0; }
else if (col < m_nNumColumns-1) col++;
else col = 0;
ChangeSelection(row, col);
}
if (nChar == VK_LEFT)
{
if (col < 0) { row = m_nNumRows-1; col = m_nNumColumns-1; }
else if (col > 0) col--;
else col = m_nNumColumns-1;
ChangeSelection(row, col);
}
if (nChar == VK_ESCAPE)
{
m_crColour = m_crInitialColour;
EndSelection(CPN_SELENDCANCEL);
return;
}
if (nChar == VK_RETURN)
{
EndSelection(CPN_SELENDOK);
return;
}
CWnd::OnKeyDown(nChar, nRepCnt, nFlags);
}
// auto-deletion
void CColourPopup::OnNcDestroy()
{
CWnd::OnNcDestroy();
delete this;
}
void CColourPopup::OnPaint()
{
CPaintDC dc(this); // device context for painting
// Draw colour cells
for (int row = 0; row < m_nNumRows; row++)
for (int col = 0; col < m_nNumColumns; col++)
DrawCell(&dc, row, col);
// Draw custom text
if (m_bShowCustom)
DrawCell(&dc, TEXT_BOX_VALUE, TEXT_BOX_VALUE);
// Draw raised window edge (ex-window style WS_EX_WINDOWEDGE is sposed to do this,
// but for some reason isn't
CRect rect;
GetClientRect(rect);
dc.DrawEdge(rect, EDGE_RAISED, BF_RECT);
}
void CColourPopup::OnMouseMove(UINT nFlags, CPoint point)
{
int row, col;
// Translate points to be relative raised window edge
point.x -= m_nMargin;
point.y -= m_nMargin;
// First check we aren't in text box
if (m_bShowCustom && m_TextRect.PtInRect(point))
row = col = TEXT_BOX_VALUE; // Special value meaning Text Box (hack!)
else
{
// Take into account text box
if (m_bShowCustom)
point.y -= m_TextRect.Height();
// Get the row and column
row = point.y / m_nBoxSize,
col = point.x / m_nBoxSize;
// In range? If not, default and exit
if (row < 0 || row >= m_nNumRows ||
col < 0 || col >= m_nNumColumns)
{
CWnd::OnMouseMove(nFlags, point);
return;
}
}
// OK - we have the row and column of the current selection (may be TEXT_BOX_VALUE)
// Has the row/col selection changed? If yes, then redraw old and new cells.
if (row != m_nCurrentRow || col != m_nCurrentCol)
{
ChangeSelection(row, col);
}
CWnd::OnMouseMove(nFlags, point);
}
// End selection on LButtonUp
void CColourPopup::OnLButtonUp(UINT nFlags, CPoint point)
{
CWnd::OnLButtonUp(nFlags, point);
DWORD pos = GetMessagePos();
point = CPoint(LOWORD(pos), HIWORD(pos));
if (m_WindowRect.PtInRect(point))
EndSelection(CPN_SELENDOK);
else
EndSelection(CPN_SELENDCANCEL);
}
/////////////////////////////////////////////////////////////////////////////
// CColourPopup implementation
void CColourPopup::FindCellFromColour(COLORREF crColour)
{
for (int row = 0; row < m_nNumRows; row++)
for (int col = 0; col < m_nNumColumns; col++)
{
if (GetColour(row, col) == crColour)
{
m_nChosenColourRow = row;
m_nChosenColourCol = col;
return;
}
}
m_nChosenColourRow = TEXT_BOX_VALUE;
m_nChosenColourCol = TEXT_BOX_VALUE;
}
// Gets the dimensions of the colour cell given by (row,col)
BOOL CColourPopup::GetCellRect(int row, int col, const LPRECT& rect)
{
if (row < 0 || row >= m_nNumRows || col < 0 || col >= m_nNumColumns)
return FALSE;
rect->left = col*m_nBoxSize + m_nMargin;
rect->top = row*m_nBoxSize + m_nMargin;
// Move everything down if we are displaying text
if (m_bShowCustom)
rect->top += (m_nMargin + m_TextRect.Height());
rect->right = rect->left + m_nBoxSize;
rect->bottom = rect->top + m_nBoxSize;
return TRUE;
}
// Works out an appropriate size and position of this window
void CColourPopup::SetWindowSize()
{
CSize TextSize;
// If we are showing a custom text area, get the font and text size.
if (m_bShowCustom)
{
// Get the size of the custom text
CClientDC dc(this);
CFont* pOldFont = (CFont*) dc.SelectObject(&m_Font);
TextSize = dc.GetTextExtent(m_strCustomText) + CSize(2*m_nMargin,2*m_nMargin);
dc.SelectObject(pOldFont);
// Add even more space to draw the horizontal line
TextSize.cy += 2*m_nMargin + 2;
}
// Get the number of columns and rows
//m_nNumColumns = (int) sqrt((double)m_nNumColours); // for a square window (yuk)
m_nNumColumns = 8;
m_nNumRows = m_nNumColours / m_nNumColumns;
if (m_nNumColours % m_nNumColumns) m_nNumRows++;
// Get the current window position, and set the new size
CRect rect;
GetWindowRect(rect);
m_WindowRect.SetRect(rect.left, rect.top,
rect.left + m_nNumColumns*m_nBoxSize + 2*m_nMargin,
rect.top + m_nNumRows*m_nBoxSize + 2*m_nMargin);
// if custom text, then expand window if necessary, and set text width as
// window width
if (m_bShowCustom)
{
m_WindowRect.bottom += (m_nMargin + TextSize.cy);
if (TextSize.cx > m_WindowRect.Width())
m_WindowRect.right = m_WindowRect.left + TextSize.cx;
TextSize.cx = m_WindowRect.Width()-2*m_nMargin;
// Work out the text area
m_TextRect.SetRect(m_nMargin, m_nMargin,
m_nMargin+TextSize.cx, m_nMargin+TextSize.cy);
}
// Need to check it'll fit on screen: Too far right?
CSize ScreenSize(::GetSystemMetrics(SM_CXSCREEN), ::GetSystemMetrics(SM_CYSCREEN));
if (m_WindowRect.right > ScreenSize.cx)
m_WindowRect.OffsetRect(-(m_WindowRect.right - ScreenSize.cx), 0);
// Too far left?
if (m_WindowRect.left < 0)
m_WindowRect.OffsetRect( -m_WindowRect.left, 0);
// Bottom falling out of screen?
if (m_WindowRect.bottom > ScreenSize.cy)
{
CRect ParentRect;
m_pParent->GetWindowRect(ParentRect);
m_WindowRect.OffsetRect(0, -(ParentRect.Height() + m_WindowRect.Height()));
}
// Set the window size and position
MoveWindow(m_WindowRect, TRUE);
}
void CColourPopup::CreateToolTips()
{
// Create the tool tip
if (!m_ToolTip.Create(this)) return;
// Add a tool for each cell
for (int row = 0; row < m_nNumRows; row++)
for (int col = 0; col < m_nNumColumns; col++)
{
CRect rect;
if (!GetCellRect(row, col, rect)) continue;
m_ToolTip.AddTool(this, GetColourName(row, col), rect, 1);
}
}
void CColourPopup::ChangeSelection(int row, int col)
{
CClientDC dc(this); // device context for drawing
if ((m_nCurrentRow >= 0 && m_nCurrentRow < m_nNumRows &&
m_nCurrentCol >= 0 && m_nCurrentCol < m_nNumColumns) ||
(m_nCurrentCol == TEXT_BOX_VALUE && m_nCurrentCol == TEXT_BOX_VALUE))
{
// Set Current selection as invalid and redraw old selection (this way
// the old selection will be drawn unselected)
int OldRow = m_nCurrentRow, OldCol = m_nCurrentCol;
m_nCurrentRow = m_nCurrentCol = -1;
DrawCell(&dc, OldRow, OldCol);
}
// Set the current selection as row/col and draw (it will be drawn selected)
m_nCurrentRow = row; m_nCurrentCol = col;
DrawCell(&dc, m_nCurrentRow, m_nCurrentCol);
// Store the current colour
if (m_nCurrentRow == TEXT_BOX_VALUE && m_nCurrentCol == TEXT_BOX_VALUE)
m_pParent->SendMessage(CPN_SELCHANGE, (WPARAM) m_crInitialColour, 0);
else
{
m_crColour = GetColour(m_nCurrentRow, m_nCurrentCol);
m_pParent->SendMessage(CPN_SELCHANGE, (WPARAM) m_crColour, 0);
}
}
void CColourPopup::EndSelection(int nMessage)
{
ReleaseCapture();
// If custom text selected, perform a custom colour selection
if (nMessage != CPN_SELENDCANCEL &&
m_nCurrentCol == TEXT_BOX_VALUE && m_nCurrentRow == TEXT_BOX_VALUE)
{
CColorDialog dlg(m_crInitialColour, CC_FULLOPEN | CC_ANYCOLOR, this);
if (dlg.DoModal() == IDOK)
m_crColour = dlg.GetColor();
else
m_crColour = m_crInitialColour;
}
if (nMessage == CPN_SELENDCANCEL)
m_crColour = m_crInitialColour;
m_pParent->SendMessage(nMessage, (WPARAM) m_crColour, 0);
DestroyWindow();
}
void CColourPopup::DrawCell(CDC* pDC, int row, int col)
{
// This is a special hack for the text box
if (m_bShowCustom && row == TEXT_BOX_VALUE && row == TEXT_BOX_VALUE)
{
// The extent of the actual text button
CRect TextButtonRect = m_TextRect;
TextButtonRect.bottom -= (2*m_nMargin+2);
// Fill background
//if ( (m_nChosenColourRow == row && m_nChosenColourCol == col)
// && !(m_nCurrentRow == row && m_nCurrentCol == col) )
// pDC->FillSolidRect(m_TextRect, ::GetSysColor(COLOR_3DHILIGHT));
//else
pDC->FillSolidRect(m_TextRect, ::GetSysColor(COLOR_3DFACE));
// Draw button
//if (m_nChosenColourRow == row && m_nChosenColourCol == col)
// pDC->DrawEdge(TextButtonRect, EDGE_SUNKEN, BF_RECT);
//else
if (m_nCurrentRow == row && m_nCurrentCol == col)
pDC->DrawEdge(TextButtonRect, EDGE_RAISED, BF_RECT);
// Draw custom text
CFont *pOldFont = (CFont*) pDC->SelectObject(&m_Font);
pDC->DrawText(m_strCustomText, TextButtonRect, DT_CENTER | DT_VCENTER | DT_SINGLELINE);
pDC->SelectObject(pOldFont);
// Draw horizontal line
pDC->FillSolidRect(m_TextRect.left+2*m_nMargin, m_TextRect.bottom-m_nMargin-2,
m_TextRect.Width()-4*m_nMargin, 1, ::GetSysColor(COLOR_3DSHADOW));
pDC->FillSolidRect(m_TextRect.left+2*m_nMargin, m_TextRect.bottom-m_nMargin-1,
m_TextRect.Width()-4*m_nMargin, 1, ::GetSysColor(COLOR_3DHILIGHT));
return;
}
// row/col in range?
ASSERT(row >= 0 && row < m_nNumRows);
ASSERT(col >= 0 && col < m_nNumColumns);
// Select and realize the palette
CPalette* pOldPalette;
if (pDC->GetDeviceCaps(RASTERCAPS) & RC_PALETTE)
{
pOldPalette = pDC->SelectPalette(&m_Palette, FALSE);
pDC->RealizePalette();
}
CRect rect;
if (!GetCellRect(row, col, rect)) return;
// fill background
if ( (m_nChosenColourRow == row && m_nChosenColourCol == col)
&& !(m_nCurrentRow == row && m_nCurrentCol == col) )
pDC->FillSolidRect(rect, ::GetSysColor(COLOR_3DHILIGHT));
else
pDC->FillSolidRect(rect, ::GetSysColor(COLOR_3DFACE));
// Draw button
if (m_nChosenColourRow == row && m_nChosenColourCol == col)
pDC->DrawEdge(rect, EDGE_SUNKEN, BF_RECT);
else if (m_nCurrentRow == row && m_nCurrentCol == col)
pDC->DrawEdge(rect, EDGE_RAISED, BF_RECT);
// Draw raised edge if selected
if (m_nCurrentRow == row && m_nCurrentCol == col)
pDC->DrawEdge(rect, EDGE_RAISED, BF_RECT);
CBrush brush(PALETTERGB(GetRValue(GetColour(row, col)),
GetGValue(GetColour(row, col)),
GetBValue(GetColour(row, col)) ));
CPen pen;
pen.CreatePen(PS_SOLID, 1, ::GetSysColor(COLOR_3DSHADOW));
CBrush* pOldBrush = (CBrush*) pDC->SelectObject(&brush);
CPen* pOldPen = (CPen*) pDC->SelectObject(&pen);
// Draw the cell colour
rect.DeflateRect(m_nMargin+1, m_nMargin+1);
pDC->Rectangle(rect);
// restore DC and cleanup
pDC->SelectObject(pOldBrush);
pDC->SelectObject(pOldPen);
brush.DeleteObject();
pen.DeleteObject();
if (pDC->GetDeviceCaps(RASTERCAPS) & RC_PALETTE)
pDC->SelectPalette(pOldPalette, FALSE);
}
BOOL CColourPopup::OnQueryNewPalette()
{
Invalidate();
return CWnd::OnQueryNewPalette();
}
void CColourPopup::OnPaletteChanged(CWnd* pFocusWnd)
{
CWnd::OnPaletteChanged(pFocusWnd);
if (pFocusWnd->GetSafeHwnd() != GetSafeHwnd())
Invalidate();
}

View File

@@ -0,0 +1,120 @@
#if !defined(AFX_COLOURPOPUP_H__D0B75902_9830_11D1_9C0F_00A0243D1382__INCLUDED_)
#define AFX_COLOURPOPUP_H__D0B75902_9830_11D1_9C0F_00A0243D1382__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// ColourPopup.h : header file
//
// Written by Chris Maunder (Chris.Maunder@cbr.clw.csiro.au)
// Extended by Alexander Bischofberger (bischofb@informatik.tu-muenchen.de)
// Copyright (c) 1998.
//
// This code may be used in compiled form in any way you desire. This
// file may be redistributed unmodified by any means PROVIDING it is
// not sold for profit without the authors written consent, and
// providing that this notice and the authors name is included. If
// the source code in this file is used in any commercial application
// then a simple email would be nice.
//
// This file is provided "as is" with no expressed or implied warranty.
// The author accepts no liability if it causes any damage whatsoever.
// It's free - so you get what you pay for.
// CColourPopup messages
#define CPN_SELCHANGE WM_USER + 1001 // Colour Picker Selection change
#define CPN_DROPDOWN WM_USER + 1002 // Colour Picker drop down
#define CPN_CLOSEUP WM_USER + 1003 // Colour Picker close up
#define CPN_SELENDOK WM_USER + 1004 // Colour Picker end OK
#define CPN_SELENDCANCEL WM_USER + 1005 // Colour Picker end (cancelled)
// forward declaration
class CColourPicker;
// To hold the colours and their names
typedef struct {
COLORREF crColour;
TCHAR *szName;
} ColourTableEntry;
/////////////////////////////////////////////////////////////////////////////
// CColourPopup window
class CColourPopup : public CWnd
{
// Construction
public:
CColourPopup();
CColourPopup(CPoint p, COLORREF crColour, CWnd* pParentWnd, UINT nID,
LPCTSTR szCustomText = NULL);
void Initialise();
// Attributes
public:
// Operations
public:
BOOL Create(CPoint p, COLORREF crColour, CWnd* pParentWnd, UINT nID,
LPCTSTR szCustomText = NULL);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CColourPopup)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CColourPopup();
protected:
BOOL GetCellRect(int row, int col, const LPRECT& rect);
void FindCellFromColour(COLORREF crColour);
void SetWindowSize();
void CreateToolTips();
void ChangeSelection(int row, int col);
void EndSelection(int nMessage);
void DrawCell(CDC* pDC, int row, int col);
COLORREF GetColour(int row, int col) { return m_crColours[row*m_nNumColumns + col].crColour; }
LPCTSTR GetColourName(int row, int col) { return m_crColours[row*m_nNumColumns + col].szName; }
// protected attributes
protected:
static ColourTableEntry m_crColours[];
int m_nNumColours;
int m_nNumColumns, m_nNumRows;
int m_nBoxSize, m_nMargin;
int m_nCurrentRow, m_nCurrentCol;
int m_nChosenColourRow, m_nChosenColourCol;
BOOL m_bShowCustom;
CString m_strCustomText;
CRect m_TextRect, m_WindowRect;
CFont m_Font;
CPalette m_Palette;
COLORREF m_crInitialColour, m_crColour;
CToolTipCtrl m_ToolTip;
CWnd* m_pParent;
// Generated message map functions
protected:
//{{AFX_MSG(CColourPopup)
afx_msg void OnNcDestroy();
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnPaint();
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg BOOL OnQueryNewPalette();
afx_msg void OnPaletteChanged(CWnd* pFocusWnd);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_COLOURPOPUP_H__D0B75902_9830_11D1_9C0F_00A0243D1382__INCLUDED_)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,88 @@
#if !defined(AFX_DDS_CONTAINER_H__781D7CA3_A3C7_4108_849B_DABC2D14A0E1__INCLUDED_)
#define AFX_DDS_CONTAINER_H__781D7CA3_A3C7_4108_849B_DABC2D14A0E1__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Dds_container.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDds_container dialog
class CDds_container : public CDialog
{
// Construction
public:
void ConvertTGA2DDS(char *strFolder);
void ConvertBump(char *strFolder);
void AutoHeaderCreate(CString strSrc);
void AutoTGAConvertTexture(char *strPath);
void TextureHeaderRestore(char *strPath);
void TextureHeaderFix(char *strPath);
void AutoConvertTexture(CString strSrc,CString strTar,bool bSmall=true,bool bHeader=true);
CDds_container(CWnd* pParent = NULL); // standard constructor
void Compress();
void Mipmap();
bool MapInfoFileLoad(char *strPath);
void ConvertR3S(CString strSrcPath,CString strDestPath);
long m_dwWidth;
long m_dwHeight;
long m_numMips;
HRESULT BltAllLevels(D3DCUBEMAP_FACES FaceType, LPDIRECT3DBASETEXTURE8 ptexSrc,
LPDIRECT3DBASETEXTURE8 ptexDest);
HRESULT ChangeFormat(LPDIRECT3DBASETEXTURE8 ptexCur, D3DFORMAT fmtTo,
LPDIRECT3DBASETEXTURE8* pptexNew);
LPDIRECT3DBASETEXTURE8 base;
LPDIRECT3DBASETEXTURE8 ptexNew;
// Dialog Data
//{{AFX_DATA(CDds_container)
enum { IDD = IDD_DDS };
CEdit m_econtrol;
CString m_Edit;
int m_Radio;
int m_Radio2;
int m_Radio3;
BOOL m_bDivTexture;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDds_container)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDds_container)
afx_msg void OnButton1();
afx_msg void OnChangeEdit();
virtual void OnOK();
afx_msg void OnButtonConvertlowhardware();
afx_msg void OnEsf();
afx_msg void OnButtonTotaltextureconvert();
afx_msg void OnButton2();
afx_msg void OnButton3();
afx_msg void OnButtonDds2tga();
afx_msg void OnButtonBumpgenerate();
afx_msg void OnButtonTga2dds();
afx_msg void OnMapinfoconv();
afx_msg void OnDdsheader();
afx_msg void OnButtonesfinfo();
afx_msg void OnButtonConvertmesh();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DDS_CONTAINER_H__781D7CA3_A3C7_4108_849B_DABC2D14A0E1__INCLUDED_)

View File

@@ -0,0 +1,92 @@
// DialogBarEx.cpp : implementation file
//
#include "stdafx.h"
//#include "DialogbarDemo.h"
#include "DialogBarEx.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDialogBarEx
/*
Class written by Sharad Kelkar drssk@ad1.vsnl.net.in
This is freeware without any kind of restriction on usage
and distribution.
*/
#define WM_INITDIALOGBAR WM_USER + 1
BEGIN_MESSAGE_MAP(CDialogBarEx, CDialogBar)
//{{AFX_MSG_MAP(CDialogBarEx)
ON_MESSAGE(WM_INITDIALOGBAR , InitDialogBarHandler )
ON_WM_CREATE()
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
CDialogBarEx::CDialogBarEx()
{
}
CDialogBarEx::~CDialogBarEx()
{
}
// Note from Sharad Kelkar
// We have manualy added entry ON_MESSAGE(WM_INITDIALOGBAR , InitDialogBarHandler)
// as there is not automatic help from Class Wizard
/////////////////////////////////////////////////////////////////////////////
// CDialogBarEx message handlers
int CDialogBarEx::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialogBar::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
// ---------
// We post WM_INITDIALOGBAR message here to dialog bar
PostMessage(WM_INITDIALOGBAR , 0 , 0 );
return 0;
}
LRESULT CDialogBarEx::InitDialogBarHandler(WPARAM wParam, LPARAM lParam)
{
UpdateData(FALSE);
OnInitDialogBar() ;
return S_OK;
}
// Notes from Sharad Kelkar
// OnInitDialogBar is Just empty function it is
// expected to be overriden from derived class
void CDialogBarEx::OnInitDialogBar()
{
// TODO
// Add your custom initialization code here.
}
void CDialogBarEx::OnDestroy()
{
Destory();
CDialogBar::OnDestroy();
// TODO: Add your message handler code here
}
void CDialogBarEx::Destory()
{
}

View File

@@ -0,0 +1,61 @@
#if !defined(AFX_DIALOGBAREX_H__D614B256_C5EC_11D2_B8C5_B41E04C10000__INCLUDED_)
#define AFX_DIALOGBAREX_H__D614B256_C5EC_11D2_B8C5_B41E04C10000__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// DialogBarEx.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDialogBarEx window
/*
Class written by Sharad Kelkar drssk@ad1.vsnl.net.in
This is freeware without any kind of restriction on usage
and distribution.
*/
class CDialogBarEx : public CDialogBar
{
// Construction
public:
CDialogBarEx();
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDialogBarEx)
//}}AFX_VIRTUAL
// Implementation
public:
virtual void Destory();
virtual void OnInitDialogBar();
virtual ~CDialogBarEx();
// Generated message map functions
// Note from Sharad Kelkar
// We have manually added entry afx_msg InitDialogBarHandler
// as it was not done automatically by Class Wizard
protected:
//{{AFX_MSG(CDialogBarEx)
afx_msg LRESULT InitDialogBarHandler( WPARAM wParam, LPARAM lParam );
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnDestroy();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DIALOGBAREX_H__D614B256_C5EC_11D2_B8C5_B41E04C10000__INCLUDED_)

View File

@@ -0,0 +1,59 @@
// DialogCharacterLodDist.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DialogCharacterLodDist.h"
#include "BaseDataDefine.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDialogCharacterLodDist dialog
CDialogCharacterLodDist::CDialogCharacterLodDist(CWnd* pParent /*=NULL*/)
: CDialog(CDialogCharacterLodDist::IDD, pParent)
{
//{{AFX_DATA_INIT(CDialogCharacterLodDist)
m_fLodLevel0 = fCHARACTERLODLEVELDIST[0];
m_fLodLevel1 = fCHARACTERLODLEVELDIST[1];
m_fLodLevel2 = fCHARACTERLODLEVELDIST[2];
//}}AFX_DATA_INIT
}
void CDialogCharacterLodDist::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDialogCharacterLodDist)
DDX_Text(pDX, IDC_LODLEVEL0, m_fLodLevel0);
DDX_Text(pDX, IDC_LODLEVEL1, m_fLodLevel1);
DDX_Text(pDX, IDC_LODLEVEL2, m_fLodLevel2);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDialogCharacterLodDist, CDialog)
//{{AFX_MSG_MAP(CDialogCharacterLodDist)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDialogCharacterLodDist message handlers
void CDialogCharacterLodDist::OnOK()
{
// TODO: Add extra validation here
UpdateData(TRUE);
fCHARACTERLODLEVELDIST[0] = m_fLodLevel0;
fCHARACTERLODLEVELDIST[1] = m_fLodLevel1;
fCHARACTERLODLEVELDIST[2] = m_fLodLevel2;
// CDialog::OnOK();
}

View File

@@ -0,0 +1,48 @@
#if !defined(AFX_DIALOGCHARACTERLODDIST_H__17DAB7C1_CC3A_41D3_A1BB_0C89E123B682__INCLUDED_)
#define AFX_DIALOGCHARACTERLODDIST_H__17DAB7C1_CC3A_41D3_A1BB_0C89E123B682__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DialogCharacterLodDist.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDialogCharacterLodDist dialog
class CDialogCharacterLodDist : public CDialog
{
// Construction
public:
CDialogCharacterLodDist(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDialogCharacterLodDist)
enum { IDD = IDD_DIALOG_CHARACTERLOD };
float m_fLodLevel0;
float m_fLodLevel1;
float m_fLodLevel2;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDialogCharacterLodDist)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDialogCharacterLodDist)
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DIALOGCHARACTERLODDIST_H__17DAB7C1_CC3A_41D3_A1BB_0C89E123B682__INCLUDED_)

View File

@@ -0,0 +1,116 @@
// DlgBoid.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgBoid.h"
#include "SceneManager.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgBoid dialog
CDlgBoid::CDlgBoid(CWnd* pParent /*=NULL*/)
: CDialog(CDlgBoid::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgBoid)
m_fAngle = 0.0f;
m_fFraction = 0.0f;
m_fRadius = 0.0f;
m_fRatio = 0.0f;
m_fSpeed = 0.0f;
m_nBoid = 0;
//}}AFX_DATA_INIT
}
void CDlgBoid::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgBoid)
DDX_Text(pDX, IDC_EDIT_ANGLE, m_fAngle);
DDX_Text(pDX, IDC_EDIT_FRACTION, m_fFraction);
DDX_Text(pDX, IDC_EDIT_RADIUS, m_fRadius);
DDX_Text(pDX, IDC_EDIT_RATIO, m_fRatio);
DDX_Text(pDX, IDC_EDIT_SPEED, m_fSpeed);
DDX_Text(pDX, IDC_EDIT_OBJECTCOUNT, m_nBoid);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgBoid, CDialog)
//{{AFX_MSG_MAP(CDlgBoid)
ON_BN_CLICKED(IDC_BUTTON_BUFFERFLY, OnButtonBufferfly)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgBoid message handlers
BOOL CDlgBoid::OnInitDialog()
{
CDialog::OnInitDialog();
/* m_fAngle=CSceneManager::m_Boid.m_AngleTweak;
m_fFraction=CSceneManager::m_Boid.m_CollisionFraction;
m_fRadius=CSceneManager::m_Boid.m_InfluenceRadius;
m_fRatio=CSceneManager::m_Boid.m_PitchToSpeedRatio;
m_fSpeed=CSceneManager::m_Boid.m_NormalSpeed;
*/
UpdateData(FALSE);
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgBoid::OnOK()
{
// TODO: Add extra validation here
UpdateData();
/* CSceneManager::m_Boid.DeleteBoid();
CSceneManager::m_Boid.Create(m_nBoid,0);
CSceneManager::m_Boid.m_AngleTweak=m_fAngle;
CSceneManager::m_Boid.m_CollisionFraction=m_fFraction;
CSceneManager::m_Boid.m_InfluenceRadius=m_fRadius;
CSceneManager::m_Boid.m_PitchToSpeedRatio=m_fRatio;
CSceneManager::m_Boid.m_NormalSpeed=m_fSpeed;
CSceneManager::m_Boid.m_InfluenceRadiusSquared=
CSceneManager::m_Boid.m_InfluenceRadius*CSceneManager::m_Boid.m_InfluenceRadius;
CSceneManager::m_Boid.m_InvCollisionFraction=1.0f/(1.0f-CSceneManager::m_Boid.m_CollisionFraction);
for(int i=0;i<CSceneManager::m_Boid.m_nBoids;i++)
{
CSceneManager::m_Boid.m_pBoids[i].m_vecLoc=vector3(i+10,i+10+150,i+10);
CSceneManager::m_Boid.m_pBoids[i].m_vecDir=vector3(1.0f,0.0f,0.0f);
CSceneManager::m_Boid.m_pBoids[i].m_fYaw=0.0f;
CSceneManager::m_Boid.m_pBoids[i].m_fPitch=0.0f;
CSceneManager::m_Boid.m_pBoids[i].m_fRoll=0.0f;
CSceneManager::m_Boid.m_pBoids[i].m_fDYaw=0.0f;
CSceneManager::m_Boid.m_pBoids[i].m_fSpeed=0.1f;
}
*/
CDialog::OnOK();
}
void CDlgBoid::OnButtonBufferfly()
{
// TODO: Add your control notification handler code here
m_fRadius=200.0f;
m_fFraction=0.5f;
m_fSpeed=0.4f;
m_fAngle=0.001f;
m_fRatio=10.0f;
m_nBoid=10;
UpdateData(FALSE);
}

View File

@@ -0,0 +1,53 @@
#if !defined(AFX_DLGBOID_H__B6415799_4CDA_474D_98E5_1353358212F7__INCLUDED_)
#define AFX_DLGBOID_H__B6415799_4CDA_474D_98E5_1353358212F7__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgBoid.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgBoid dialog
class CDlgBoid : public CDialog
{
// Construction
public:
CDlgBoid(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgBoid)
enum { IDD = IDD_DIALOG_BOID };
float m_fAngle;
float m_fFraction;
float m_fRadius;
float m_fRatio;
float m_fSpeed;
int m_nBoid;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgBoid)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgBoid)
virtual BOOL OnInitDialog();
virtual void OnOK();
afx_msg void OnButtonBufferfly();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGBOID_H__B6415799_4CDA_474D_98E5_1353358212F7__INCLUDED_)

View File

@@ -0,0 +1,379 @@
// DlgCamera.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgCamera.h"
#include "SceneManager.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgCamera dialog
CDlgCamera::CDlgCamera(CWnd* pParent /*=NULL*/)
: CDialog(CDlgCamera::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgCamera)
m_Timer = 0;
m_fCameraPosX = 0.0f;
m_fCameraPosY = 0.0f;
m_fCameraPosZ = 0.0f;
m_fCameraTargetX = 0.0f;
m_fCameraTargetY = 0.0f;
m_isPlay = FALSE;
m_isRewind = FALSE;
m_fCameraTargetZ = 0.0f;
m_SelectTime = 0;
m_fTotalTime = 0.0f;
//}}AFX_DATA_INIT
m_CameraList=NULL;
}
void CDlgCamera::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgCamera)
DDX_Control(pDX, IDC_LIST_CAMERANODE, m_CameraNodeList);
DDX_Slider(pDX, IDC_SLIDER_TIMER, m_Timer);
DDX_Text(pDX, IDC_EDIT_CAMERAPOSX, m_fCameraPosX);
DDX_Text(pDX, IDC_EDIT_CAMERAPOSY, m_fCameraPosY);
DDX_Text(pDX, IDC_EDIT_CAMERAPOSZ, m_fCameraPosZ);
DDX_Text(pDX, IDC_EDIT_CAMERATARX, m_fCameraTargetX);
DDX_Text(pDX, IDC_EDIT_CAMERATARY, m_fCameraTargetY);
DDX_Check(pDX, IDC_CHECK_PLAY, m_isPlay);
DDX_Check(pDX, IDC_CHECK_REWIND, m_isRewind);
DDX_Text(pDX, IDC_EDIT_CAMERATARZ, m_fCameraTargetZ);
DDX_Text(pDX, IDC_EDIT_SELECTIME, m_SelectTime);
DDX_Text(pDX, IDC_EDIT_TOTALTIME, m_fTotalTime);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgCamera, CDialog)
//{{AFX_MSG_MAP(CDlgCamera)
ON_NOTIFY(NM_RELEASEDCAPTURE, IDC_SLIDER_TIMER, OnReleasedcaptureSliderTimer)
ON_BN_CLICKED(IDC_CHECK_PLAY, OnCheckPlay)
ON_BN_CLICKED(IDC_CHECK_REWIND, OnCheckRewind)
ON_BN_CLICKED(IDC_BUTTON_RECORD, OnButtonRecord)
ON_LBN_DBLCLK(IDC_LIST_CAMERANODE, OnDblclkListCameranode)
ON_BN_CLICKED(IDC_BUTTON_SUBFRAME, OnButtonSubframe)
ON_BN_CLICKED(IDC_BUTTON_ADDFRAME, OnButtonAddframe)
ON_BN_CLICKED(IDC_BUTTON_NODEDELETE, OnButtonNodedelete)
ON_BN_CLICKED(IDC_BUTTON_NODELOAD, OnButtonNodeload)
ON_BN_CLICKED(IDC_BUTTON_NODESAVE, OnButtonNodesave)
ON_EN_CHANGE(IDC_EDIT_TOTALTIME, OnChangeEditTotaltime)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgCamera message handlers
void CDlgCamera::OnReleasedcaptureSliderTimer(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
UpdateData();
m_SelectTime=m_Timer;
UpdateData(FALSE);
*pResult = 0;
}
void CDlgCamera::OnCheckPlay()
{
// TODO: Add your control notification handler code here
UpdateData();
if(m_fTotalTime<= 0.01f)
{
return;
}
CSceneManager::GetCamera()->StartPlay();
}
void CDlgCamera::OnCheckRewind()
{
// TODO: Add your control notification handler code here
UpdateData();
}
void CDlgCamera::OnButtonRecord()
{
if(m_CameraList==NULL)
m_CameraList=CSceneManager::GetCamera()->GetCameraList();
// TODO: Add your control notification handler code here
UpdateData();
m_SelectTime=m_Timer;
D3DXQUATERNION qt;
D3DXQuaternionRotationYawPitchRoll(&qt,CSceneManager::GetCamera()->GetRotationY(),
CSceneManager::GetCamera()->GetRotationX(),
CSceneManager::GetCamera()->GetRotationZ());
vector3 vecCameraPos=*(CSceneManager::GetCamera()->GetPosition());
quaternion qAngle;
qAngle.x=qt.x;
qAngle.y=qt.y;
qAngle.z=qt.z;
qAngle.w=qt.w;
m_fCameraPosX=vecCameraPos.x;
m_fCameraPosY=vecCameraPos.y;
m_fCameraPosZ=vecCameraPos.z;
CViewCamera::CameraNode AddNode;
AddNode.m_vecPos=vecCameraPos;
AddNode.m_Time=m_Timer;
AddNode.m_qAngle=qAngle;
if(m_CameraList->num==0)
{
m_CameraList->Add(AddNode);
}
else
{
bool isAlreadyWrite=false;
for(int cNode=0;cNode< m_CameraList->num;cNode++)
{
if((*m_CameraList)[cNode].m_Time==m_Timer)
{
(*m_CameraList)[cNode]=AddNode;
isAlreadyWrite=true;
break;
}
}
if(isAlreadyWrite==false)
{
for(cNode=1;cNode< m_CameraList->num;cNode++)
{
if( (*m_CameraList)[cNode].m_Time < m_Timer &&
m_Timer < (*m_CameraList)[cNode].m_Time )
{
m_CameraList->Insert(AddNode,cNode);
isAlreadyWrite=true;
break;
}
}
}
if(isAlreadyWrite==false)
{
m_CameraList->Add(AddNode);
}
}
UpdateList();
/*
D3DXQuaternionRotationYawPitchRoll(
D3DXQUATERNION* pOut,
FLOAT Yaw,y
FLOAT Pitch,x
FLOAT Rollz
);
*/
/*
vector3 vecCameraPos=*(CSceneManager::GetCamera()->GetPosition());
matrix matCameraPos=*(CSceneManager::GetCamera()->GetMatPosition());
matrix matToward,matUp;
matToward.Translation(vector3(0.0f,0.0f,1.0f));
matUp.Translation(vector3(0.0f,1.0f,0.0f));
m_fCameraPosX=matCameraPos._41;
m_fCameraPosY=matCameraPos._42;
m_fCameraPosZ=matCameraPos._43;
matToward=matToward*matCameraPos;
matUp=matUp*matCameraPos;
vector3 vecNowPos,vecTowardPos,vecUpPos;
vecNowPos=matCameraPos.GetLoc();
vecTowardPos=matToward.GetLoc();
vecTowardPos=vecTowardPos-vecNowPos;
vecUpPos=matUp.GetLoc();
vecUpPos=vecUpPos-vecNowPos;
CViewCamera::CameraNode AddNode;
AddNode.m_vecPos=vecNowPos;
//AddNode.m_vecTarget=vecNowPos+vecTowardPos;
vecTowardPos.Normalize();
AddNode.m_vecTarget=vecTowardPos;
vecUpPos.Normalize();
AddNode.m_vecUp=vecUpPos;
AddNode.m_Time=m_Timer;
if(m_CameraList->num==0)
{
m_CameraList->Add(AddNode);
}
else
{
bool isAlreadyWrite=false;
for(int cNode=0;cNode< m_CameraList->num;cNode++)
{
if((*m_CameraList)[cNode].m_Time==m_Timer)
{
(*m_CameraList)[cNode]=AddNode;
isAlreadyWrite=true;
break;
}
}
if(isAlreadyWrite==false)
{
for(cNode=1;cNode< m_CameraList->num;cNode++)
{
if( (*m_CameraList)[cNode].m_Time < m_Timer &&
m_Timer < (*m_CameraList)[cNode].m_Time )
{
m_CameraList->Insert(AddNode,cNode);
isAlreadyWrite=true;
break;
}
}
}
if(isAlreadyWrite==false)
{
m_CameraList->Add(AddNode);
}
}
UpdateList();
//CSceneManager::GetCamera()->AddCameraNode(vecNowPos,vecNowPos+vecTowardPos,vector3(0.0f,1.0f,0.0f),0.0f);
/*
D3DXMatrixTranslation(&matT, vecT.x, vecT.y, vecT.z);
D3DXMatrixMultiply(matPosition, &matT, matPosition);
m_fCameraPosX=vecCameraPos.x;
m_fCameraPosY=vecCameraPos.y;
m_fCameraPosZ=vecCameraPos.z;
*/
UpdateData(FALSE);
}
BOOL CDlgCamera::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgCamera::UpdateList()
{
if(m_CameraList==NULL)
m_CameraList=CSceneManager::GetCamera()->GetCameraList();
int nNode=m_CameraNodeList.GetCount();
for(int cNode=0;cNode<nNode;cNode++)
{
m_CameraNodeList.DeleteString(0);
}
CString strNode;
for(cNode=0;cNode<m_CameraList->num;cNode++)
{
strNode.Format("%d",(*m_CameraList)[cNode].m_Time);
m_CameraNodeList.AddString(strNode);
}
UpdateData(FALSE);
}
void CDlgCamera::OnDblclkListCameranode()
{
if(m_CameraList->num==0)
return;
int CurSel=m_CameraNodeList.GetCurSel();
m_fCameraPosX=(*m_CameraList)[CurSel].m_vecPos.x;
m_fCameraPosY=(*m_CameraList)[CurSel].m_vecPos.y;
m_fCameraPosZ=(*m_CameraList)[CurSel].m_vecPos.z;
m_Timer=(*m_CameraList)[CurSel].m_Time;
m_SelectTime=m_Timer;
UpdateData(FALSE);
// TODO: Add your control notification handler code here
}
void CDlgCamera::OnButtonSubframe()
{
// TODO: Add your control notification handler code here
UpdateData();
m_Timer--;
if(m_Timer<0)
m_Timer=0;
m_SelectTime=m_Timer;
UpdateData(FALSE);
}
void CDlgCamera::OnButtonAddframe()
{
// TODO: Add your control notification handler code here
UpdateData();
m_Timer++;
if(m_Timer>100)
m_Timer=100;
UpdateData(FALSE);
}
void CDlgCamera::OnButtonNodedelete()
{
// TODO: Add your control notification handler code here
m_CameraList->num=0;
UpdateList();
}
void CDlgCamera::OnButtonNodeload()
{
// TODO: Add your control notification handler code here
CString strFilter = "ZallA 3D CameraAnimation Files (*.ZCA)|*.ZCA|All Files (*.*)|*.*||";
CFileDialog filedia(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.DoModal();
CString strFilename=filedia.GetFileName();
if(strFilename!="")
{
CSceneManager::GetCamera()->Load(strFilename.LockBuffer());
}
m_fTotalTime=CSceneManager::GetCamera()->GetTotalAniTime();
UpdateList();
UpdateData(FALSE);
}
void CDlgCamera::OnButtonNodesave()
{
// TODO: Add your control notification handler code here
CString strFilter = "ZallA 3D CameraAnimation Files (*.ZCA)|*.ZCA|All Files (*.*)|*.*||";
CFileDialog filedia(FALSE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.DoModal();
CString strFilename=filedia.GetFileName();
if(strFilename!="")
{
CSceneManager::GetCamera()->Save(strFilename.LockBuffer());
}
}
void CDlgCamera::OnChangeEditTotaltime()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData();
CSceneManager::GetCamera()->SetTotalAniTime(m_fTotalTime);
}
BOOL CDlgCamera::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_ESCAPE)
{
CSceneManager::GetCamera()->LoadViewMatrix();
CSceneManager::m_ViewerMode=0;
OnOK();
}
return CDialog::PreTranslateMessage(pMsg);
}

View File

@@ -0,0 +1,72 @@
#if !defined(AFX_DLGCAMERA_H__CA58FED3_C052_4709_B92F_2E587327E774__INCLUDED_)
#define AFX_DLGCAMERA_H__CA58FED3_C052_4709_B92F_2E587327E774__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgCamera.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgCamera dialog
class CDlgCamera : public CDialog
{
// Construction
public:
void UpdateList();
CDlgCamera(CWnd* pParent = NULL); // standard constructor
List<CViewCamera::CameraNode> *m_CameraList;
// Dialog Data
//{{AFX_DATA(CDlgCamera)
enum { IDD = IDD_DIALOG_CAMERA };
CListBox m_CameraNodeList;
int m_Timer;
float m_fCameraPosX;
float m_fCameraPosY;
float m_fCameraPosZ;
float m_fCameraTargetX;
float m_fCameraTargetY;
BOOL m_isPlay;
BOOL m_isRewind;
float m_fCameraTargetZ;
long m_SelectTime;
float m_fTotalTime;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgCamera)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgCamera)
afx_msg void OnReleasedcaptureSliderTimer(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnCheckPlay();
afx_msg void OnCheckRewind();
afx_msg void OnButtonRecord();
virtual BOOL OnInitDialog();
afx_msg void OnDblclkListCameranode();
afx_msg void OnButtonSubframe();
afx_msg void OnButtonAddframe();
afx_msg void OnButtonNodedelete();
afx_msg void OnButtonNodeload();
afx_msg void OnButtonNodesave();
afx_msg void OnChangeEditTotaltime();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGCAMERA_H__CA58FED3_C052_4709_B92F_2E587327E774__INCLUDED_)

View File

@@ -0,0 +1,71 @@
// DlgCameraSet.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgCameraSet.h"
#include "WorldCreatorView.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgCameraSet dialog
CDlgCameraSet::CDlgCameraSet(CWnd* pParent /*=NULL*/)
: CDialog(CDlgCameraSet::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgCameraSet)
m_fPosX = 0.0f;
m_fPosY = 0.0f;
m_fPosZ = 0.0f;
m_fLookX = 0.0f;
m_fLookY = 0.0f;
m_fLookZ = 0.0f;
//}}AFX_DATA_INIT
}
void CDlgCameraSet::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgCameraSet)
DDX_Text(pDX, IDC_EDIT1, m_fPosX);
DDX_Text(pDX, IDC_EDIT2, m_fPosY);
DDX_Text(pDX, IDC_EDIT4, m_fPosZ);
DDX_Text(pDX, IDC_EDIT5, m_fLookX);
DDX_Text(pDX, IDC_EDIT6, m_fLookY);
DDX_Text(pDX, IDC_EDIT7, m_fLookZ);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgCameraSet, CDialog)
//{{AFX_MSG_MAP(CDlgCameraSet)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgCameraSet message handlers
void CDlgCameraSet::OnOK()
{
// TODO: Add extra validation here
UpdateData();
CMainFrame *mf=(CMainFrame*)AfxGetApp()->m_pMainWnd;
CWorldCreatorView* av=(CWorldCreatorView*)mf->GetActiveView();
vector3 vecUp = vector3(0.0f,1.0f,0.0f);
//vector3 vecLook = vector3(m_fLookX,m_fLookY,m_fLookZ);
vector3 vecPos = vector3(m_fPosX,m_fPosY,m_fPosZ);
vector3 vecLook = vector3(m_fPosX,m_fPosY,m_fPosZ + 1.0f);
av->m_SceneManager->m_ViewCamera->LookAt(vecPos,vecLook,vecUp);
CDialog::OnOK();
}

View File

@@ -0,0 +1,51 @@
#if !defined(AFX_DLGCAMERASET_H__EC353164_A9BA_4957_909E_D40DA1AC380C__INCLUDED_)
#define AFX_DLGCAMERASET_H__EC353164_A9BA_4957_909E_D40DA1AC380C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgCameraSet.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgCameraSet dialog
class CDlgCameraSet : public CDialog
{
// Construction
public:
CDlgCameraSet(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgCameraSet)
enum { IDD = IDD_DIALOG_CAMERASET };
float m_fPosX;
float m_fPosY;
float m_fPosZ;
float m_fLookX;
float m_fLookY;
float m_fLookZ;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgCameraSet)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgCameraSet)
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGCAMERASET_H__EC353164_A9BA_4957_909E_D40DA1AC380C__INCLUDED_)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,83 @@
#if !defined(AFX_DLGCHARACTERCREATE_H__AD1FAC28_F233_4503_8D23_9B6CE26A017B__INCLUDED_)
#define AFX_DLGCHARACTERCREATE_H__AD1FAC28_F233_4503_8D23_9B6CE26A017B__INCLUDED_
#include "Z3DGeneralChrModel.h"
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgCharacterCreate.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgCharacterCreate dialog
class CDlgCharacterCreate : public CDialog
{
// Construction
public:
CDlgCharacterCreate(CWnd* pParent = NULL); // standard constructor
CZ3DGeneralChrModel *m_Monster;
// Dialog Data
//{{AFX_DATA(CDlgCharacterCreate)
enum { IDD = IDD_DIALOG_CHARACTEROUTPIT };
CListBox m_TempList;
CComboBox m_SimpleSelectList;
CComboBox m_MonPivot;
CComboBox m_WeaponType;
CComboBox m_WeaponList;
CComboBox m_ShieldList;
CComboBox m_HeadList;
CComboBox m_HandList;
CComboBox m_FootList;
CComboBox m_Body2List;
CComboBox m_Body1List;
CComboBox m_Body0List;
CString m_MonName;
CString m_MonEsf;
int m_Sex;
UINT m_nFocusCharacter;
BOOL m_AkanValue;
CString m_strNormalTex;
float m_fBumpScale;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgCharacterCreate)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgCharacterCreate)
virtual BOOL OnInitDialog();
virtual void OnOK();
afx_msg void OnButtonRandom();
afx_msg void OnMonsearch();
afx_msg void OnMonaddeffect();
afx_msg void OnMonEsfsearch();
afx_msg void OnChangeEditFocus();
afx_msg void OnEditchangeComboSimpleselect();
afx_msg void OnSelchangeComboSimpleselect();
afx_msg void OnButton4();
afx_msg void OnButton1();
afx_msg void OnNormalinput();
afx_msg void OnButton2();
afx_msg void OnReload();
afx_msg void OnAkan();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGCHARACTERCREATE_H__AD1FAC28_F233_4503_8D23_9B6CE26A017B__INCLUDED_)

View File

@@ -0,0 +1,78 @@
// DlgCharacterEffect.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgCharacterEffect.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgCharacterEffect dialog
CDlgCharacterEffect::CDlgCharacterEffect(CWnd* pParent /*=NULL*/)
: CDialog(CDlgCharacterEffect::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgCharacterEffect)
//}}AFX_DATA_INIT
}
void CDlgCharacterEffect::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgCharacterEffect)
DDX_Control(pDX, IDC_LIST_EFFECTFILELIST, m_EffectList);
DDX_Control(pDX, IDC_COMBO_ACTIONNAME, m_ActionList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgCharacterEffect, CDialog)
//{{AFX_MSG_MAP(CDlgCharacterEffect)
ON_LBN_DBLCLK(IDC_LIST_EFFECTFILELIST, OnDblclkListEffectfilelist)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgCharacterEffect message handlers
BOOL CDlgCharacterEffect::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
char strPath[256];
GetCurrentDirectory(256,strPath);
sprintf(strPath,"%s\\Effect\\",strPath);
char strPathAll[256];
sprintf(strPathAll,"%s*.eff",strPath);
WIN32_FIND_DATA wfd = {0};
HANDLE hFind = FindFirstFile(strPathAll, &wfd);
if(INVALID_HANDLE_VALUE == hFind)
return TRUE;
CString strFilePathname;
while(1)
{
m_EffectList.AddString(wfd.cFileName);
if(FindNextFile(hFind, &wfd)==FALSE)
break;
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgCharacterEffect::OnDblclkListEffectfilelist()
{
// TODO: Add your control notification handler code here
}

View File

@@ -0,0 +1,48 @@
#if !defined(AFX_DLGCHARACTEREFFECT_H__3587FF23_29AC_4E38_9BF9_66C7ADF2D9DF__INCLUDED_)
#define AFX_DLGCHARACTEREFFECT_H__3587FF23_29AC_4E38_9BF9_66C7ADF2D9DF__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgCharacterEffect.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgCharacterEffect dialog
class CDlgCharacterEffect : public CDialog
{
// Construction
public:
CDlgCharacterEffect(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgCharacterEffect)
enum { IDD = IDD_DIALOG_CHARACTEREFFECT };
CListBox m_EffectList;
CComboBox m_ActionList;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgCharacterEffect)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgCharacterEffect)
virtual BOOL OnInitDialog();
afx_msg void OnDblclkListEffectfilelist();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGCHARACTEREFFECT_H__3587FF23_29AC_4E38_9BF9_66C7ADF2D9DF__INCLUDED_)

View File

@@ -0,0 +1,113 @@
// DlgChrOutfit.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgChrOutfit.h"
#include "misc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgChrOutfit dialog
CDlgChrOutfit::CDlgChrOutfit(CWnd* pParent /*=NULL*/)
: CDialog(CDlgChrOutfit::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgChrOutfit)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_pSheetChrOutfitSlot = NULL;
}
void CDlgChrOutfit::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgChrOutfit)
DDX_Control(pDX, IDC_LISTSTATICSLOT, m_ctrlStaticSlotStatus);
DDX_Control(pDX, IDC_LISTOUTFITSLOT, m_ctrlOutfitSlotStatus);
DDX_Control(pDX, IDC_LISTATTACHMENTSLOT, m_ctrlAttachmentSlotStatus);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgChrOutfit, CDialog)
//{{AFX_MSG_MAP(CDlgChrOutfit)
ON_WM_CLOSE()
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgChrOutfit message handlers
void CDlgChrOutfit::OnClose()
{
// TODO: Add your message handler code here and/or call default
// Alt + F4 <20><><EFBFBD><EFBFBD> <20><>ȿȭ
//CDialog::OnClose();
}
BOOL CDlgChrOutfit::Create(CWnd* pParentWnd)
{
// TODO: Add your specialized code here and/or call the base class
return CDialog::Create(IDD, pParentWnd);
}
BOOL CDlgChrOutfit::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_pSheetChrOutfitSlot = new CSheetChrOutfitSlot( "ChrOutfitSlot" );
m_pSheetChrOutfitSlot->EnableStackedTabs( FALSE );
m_pSheetChrOutfitSlot->Create( this, WS_CHILD | WS_VISIBLE );
m_pSheetChrOutfitSlot->ModifyStyleEx(0,WS_EX_CONTROLPARENT);
m_pSheetChrOutfitSlot->ModifyStyle(0,WS_TABSTOP);
m_pSheetChrOutfitSlot->MoveWindow( 270, 5, 250, 340 );
//m_pSheetChrOutfitSlot->SetWindowPos( NULL, 155, 7, 145, 218, SWP_NOZORDER | SWP_NOMOVE );
CTabCtrl * pTabCtrl = m_pSheetChrOutfitSlot->GetTabControl();
pTabCtrl->SetWindowPos( NULL, 0,0,245,340, SWP_NOZORDER | SWP_NOMOVE );
DWORD dwExtStyle;
dwExtStyle = m_ctrlStaticSlotStatus.GetExtendedStyle();
dwExtStyle |= LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES;
m_ctrlStaticSlotStatus.SetExtendedStyle( dwExtStyle );
m_ctrlStaticSlotStatus.InsertColumn( 0, "Slot", LVCFMT_LEFT, 100 );
m_ctrlStaticSlotStatus.InsertColumn( 1, "Set", LVCFMT_LEFT, 140 );
dwExtStyle = m_ctrlOutfitSlotStatus.GetExtendedStyle();
dwExtStyle |= LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES;
m_ctrlOutfitSlotStatus.SetExtendedStyle( dwExtStyle );
m_ctrlOutfitSlotStatus.InsertColumn( 0, "Slot", LVCFMT_LEFT, 100 );
m_ctrlOutfitSlotStatus.InsertColumn( 1, "Set", LVCFMT_LEFT, 140 );
dwExtStyle = m_ctrlAttachmentSlotStatus.GetExtendedStyle();
dwExtStyle |= LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES;
m_ctrlAttachmentSlotStatus.SetExtendedStyle( dwExtStyle );
m_ctrlAttachmentSlotStatus.InsertColumn( 0, "Slot", LVCFMT_LEFT, 100 );
m_ctrlAttachmentSlotStatus.InsertColumn( 1, "Set", LVCFMT_LEFT, 140 );
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgChrOutfit::OnDestroy()
{
CDialog::OnDestroy();
// TODO: Add your message handler code here
SAFE_DELETE( m_pSheetChrOutfitSlot );
}

View File

@@ -0,0 +1,56 @@
#if !defined(AFX_DLGCHROUTFIT_H__E55AA129_A64A_4831_AB3E_20A812845AEE__INCLUDED_)
#define AFX_DLGCHROUTFIT_H__E55AA129_A64A_4831_AB3E_20A812845AEE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgChrOutfit.h : header file
//
#include "SheetChrOutfitSlot.h"
/////////////////////////////////////////////////////////////////////////////
// CDlgChrOutfit dialog
class CDlgChrOutfit : public CDialog
{
// Construction
public:
CSheetChrOutfitSlot* m_pSheetChrOutfitSlot;
CDlgChrOutfit(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgChrOutfit)
enum { IDD = IDD_DIALOG_CHROUTFIT };
CListCtrl m_ctrlStaticSlotStatus;
CListCtrl m_ctrlOutfitSlotStatus;
CListCtrl m_ctrlAttachmentSlotStatus;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgChrOutfit)
public:
virtual BOOL Create(CWnd* pParentWnd);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgChrOutfit)
afx_msg void OnClose();
virtual BOOL OnInitDialog();
afx_msg void OnDestroy();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGCHROUTFIT_H__E55AA129_A64A_4831_AB3E_20A812845AEE__INCLUDED_)

View File

@@ -0,0 +1,48 @@
// DlgConvertTexture.cpp : implementation file
//
#include "stdafx.h"
#include "WorldCreator.h"
#include "DlgConvertTexture.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgConvertTexture dialog
CDlgConvertTexture::CDlgConvertTexture(CWnd* pParent /*=NULL*/)
: CDialog(CDlgConvertTexture::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgConvertTexture)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDlgConvertTexture::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgConvertTexture)
DDX_Control(pDX, IDC_LIST_CONVERTTEXTUREFILELIST, m_filelist);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgConvertTexture, CDialog)
//{{AFX_MSG_MAP(CDlgConvertTexture)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgConvertTexture message handlers
void CDlgConvertTexture::OnOK()
{
// TODO: Add extra validation here
CDialog::OnOK();
}

View File

@@ -0,0 +1,46 @@
#if !defined(AFX_DLGCONVERTTEXTURE_H__4A6794D4_3870_40AF_BD0B_F3E565FB65DB__INCLUDED_)
#define AFX_DLGCONVERTTEXTURE_H__4A6794D4_3870_40AF_BD0B_F3E565FB65DB__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgConvertTexture.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgConvertTexture dialog
class CDlgConvertTexture : public CDialog
{
// Construction
public:
CDlgConvertTexture(CWnd* pParent = NULL); // standard constructor
CString m_strPath;
// Dialog Data
//{{AFX_DATA(CDlgConvertTexture)
enum { IDD = IDD_DIALOG_TEXTURECONVERT };
CListBox m_filelist;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgConvertTexture)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgConvertTexture)
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGCONVERTTEXTURE_H__4A6794D4_3870_40AF_BD0B_F3E565FB65DB__INCLUDED_)

View File

@@ -0,0 +1,176 @@
// DlgDefaultAttachmentProperty.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgDefaultAttachmentProperty.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgDefaultAttachmentProperty dialog
CDlgDefaultAttachmentProperty::CDlgDefaultAttachmentProperty(CWnd* pParent /*=NULL*/)
: CDialog(CDlgDefaultAttachmentProperty::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgDefaultAttachmentProperty)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_rpGCMDS = NULL;
}
void CDlgDefaultAttachmentProperty::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgDefaultAttachmentProperty)
DDX_Control(pDX, IDC_COMBO_ATTACHMENTSLOT, m_ctrlAttachmentSlot);
DDX_Control(pDX, IDC_COMBO_ATTACHMENT, m_ctrlAttachmentList);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgDefaultAttachmentProperty, CDialog)
//{{AFX_MSG_MAP(CDlgDefaultAttachmentProperty)
ON_WM_CLOSE()
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgDefaultAttachmentProperty message handlers
void CDlgDefaultAttachmentProperty::SetupDialog( CZ3DGCMDS* pGCMDS, const char* szSlotName, const char* szAttachmentName )
{
m_rpGCMDS = pGCMDS;
m_strSlotName= szSlotName;
m_strAttachmentName = szAttachmentName;
m_tokAttachmentSelected = g_TokAttachmentName.GetTOK(szAttachmentName);
m_tokSlotSelected = g_TokSlotName.GetTOK(szSlotName);
}
void CDlgDefaultAttachmentProperty::SetupDialog( CZ3DGCMDS* pGCMDS, int nIdx )
{
m_rpGCMDS = pGCMDS;
if( NULL == m_rpGCMDS )
{
return;
}
std::vector<Z3DTOK_SLOT_ATTACHMENT>* pvec;
m_rpGCMDS->RetrieveDefaultAttachmentList(pvec);
if( NULL == pvec )
{
return;
}
if( nIdx < pvec->size() )
{
m_strSlotName = g_TokSlotName.GetString( (*pvec)[nIdx].tokSlot );
m_strAttachmentName = g_TokAttachmentName.GetString( (*pvec)[nIdx].tokAttachment );
m_tokSlotSelected = (*pvec)[nIdx].tokSlot;
m_tokAttachmentSelected = (*pvec)[nIdx].tokAttachment;
}
else
{
m_strSlotName = "";
m_strAttachmentName = "";
m_tokSlotSelected = NULL_TOK;
m_tokAttachmentSelected = NULL_TOK;
}
}
void CDlgDefaultAttachmentProperty::InitDlgCtrls()
{
if( NULL == m_rpGCMDS )
{
return;
}
std::vector<Z3DTOK>* pVecSlot;
m_rpGCMDS->RetrieveAttachmentSlot( pVecSlot );
m_ctrlAttachmentSlot.ResetContent();
for( int i = 0; i < pVecSlot->size(); ++i )
{
m_ctrlAttachmentSlot.InsertString( -1,
g_TokSlotName.GetString( (*pVecSlot)[i] ) );
}
m_ctrlAttachmentSlot.SetCurSel( m_ctrlAttachmentSlot.FindStringExact(-1, m_strSlotName) );
std::map<Z3DTOK, Z3DATTACHMENTINFO*>* pMapAttachmentList;
std::map<Z3DTOK, Z3DATTACHMENTINFO*>::iterator itAttachment;
m_rpGCMDS->RetrieveAttachmentList( pMapAttachmentList );
m_ctrlAttachmentList.ResetContent();
for( itAttachment = pMapAttachmentList->begin(); itAttachment != pMapAttachmentList->end(); ++itAttachment )
{
m_ctrlAttachmentList.InsertString( -1, g_TokAttachmentName.GetString(itAttachment->first) );
}
m_ctrlAttachmentList.SetCurSel( m_ctrlAttachmentList.FindStringExact(-1, m_strAttachmentName) );
}
BOOL CDlgDefaultAttachmentProperty::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
InitDlgCtrls();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgDefaultAttachmentProperty::OnClose()
{
// TODO: Add your message handler code here and/or call default
CString str;
m_ctrlAttachmentSlot.GetLBText( m_ctrlAttachmentSlot.GetCurSel() , str );
m_tokSlotSelected = g_TokSlotName.GetTOK( str );
m_ctrlAttachmentList.GetLBText( m_ctrlAttachmentList.GetCurSel(), str );
m_tokAttachmentSelected = g_TokAttachmentName.GetTOK( str );
CDialog::OnClose();
}
void CDlgDefaultAttachmentProperty::OnDestroy()
{
CDialog::OnDestroy();
// TODO: Add your message handler code here
CString str;
int nCurSel = m_ctrlAttachmentSlot.GetCurSel();
if( -1 == nCurSel )
{
m_tokSlotSelected = NULL_TOK;
}
else
{
m_ctrlAttachmentSlot.GetLBText( nCurSel, str );
m_tokSlotSelected = g_TokSlotName.GetTOK( str );
}
nCurSel = m_ctrlAttachmentList.GetCurSel();
if( -1 == nCurSel )
{
m_tokAttachmentSelected = NULL_TOK;
}
else
{
m_ctrlAttachmentList.GetLBText( nCurSel, str );
m_tokAttachmentSelected = g_TokAttachmentName.GetTOK( str );
}
}

View File

@@ -0,0 +1,75 @@
#if !defined(AFX_DLGDEFAULTATTACHMENTPROPERTY_H__DE8FF455_CA4A_4F80_AE80_A0F94F14A37A__INCLUDED_)
#define AFX_DLGDEFAULTATTACHMENTPROPERTY_H__DE8FF455_CA4A_4F80_AE80_A0F94F14A37A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgDefaultAttachmentProperty.h : header file
//
#include "Z3DGeneralChrModel.h"
/////////////////////////////////////////////////////////////////////////////
// CDlgDefaultAttachmentProperty dialog
class CDlgDefaultAttachmentProperty : public CDialog
{
// Construction
public:
CDlgDefaultAttachmentProperty(CWnd* pParent = NULL); // standard constructor
void SetupDialog( CZ3DGCMDS* pGCMDS, const char* szSlotName, const char* szAttachmentName );
void SetupDialog( CZ3DGCMDS* pGCMDS, int nIdx );
Z3DTOK GetSelectedAttachmentSlot()
{
return m_tokSlotSelected;
}
Z3DTOK GetSelectedAttachment()
{
return m_tokAttachmentSelected;
}
// Dialog Data
//{{AFX_DATA(CDlgDefaultAttachmentProperty)
enum { IDD = IDD_DIALOG_DEFAULTATTACHMENT };
CComboBox m_ctrlAttachmentSlot;
CComboBox m_ctrlAttachmentList;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgDefaultAttachmentProperty)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgDefaultAttachmentProperty)
virtual BOOL OnInitDialog();
afx_msg void OnClose();
afx_msg void OnDestroy();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
CString m_strSlotName;
CString m_strAttachmentName;
CZ3DGCMDS* m_rpGCMDS;
Z3DTOK m_tokSlotSelected;
Z3DTOK m_tokAttachmentSelected;
void InitDlgCtrls();
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGDEFAULTATTACHMENTPROPERTY_H__DE8FF455_CA4A_4F80_AE80_A0F94F14A37A__INCLUDED_)

View File

@@ -0,0 +1,98 @@
// DlgDuenAObject.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgDuenAObject.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgDuenAObject dialog
CDlgDuenAObject::CDlgDuenAObject(CWnd* pParent /*=NULL*/)
: CDialog(CDlgDuenAObject::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgDuenAObject)
m_fDelay = 0.0f;
m_iLeaf = 0;
m_iLoopNum = 0;
m_strObject = _T("");
m_strPosition = _T("");
//}}AFX_DATA_INIT
}
void CDlgDuenAObject::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgDuenAObject)
DDX_Text(pDX, IDC_DELAYEDIT, m_fDelay);
DDX_Text(pDX, IDC_LEAFEDIT, m_iLeaf);
DDX_Text(pDX, IDC_LOOPNUMEDIT, m_iLoopNum);
DDX_Text(pDX, IDC_OBJECTEDIT, m_strObject);
DDX_Text(pDX, IDC_POSEDIT, m_strPosition);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgDuenAObject, CDialog)
//{{AFX_MSG_MAP(CDlgDuenAObject)
ON_BN_CLICKED(IDC_FILESEARCH, OnFilesearch)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgDuenAObject message handlers
void CDlgDuenAObject::OnOK()
{
// TODO: Add extra validation here
UpdateData(TRUE);
CDialog::OnOK();
}
void CDlgDuenAObject::OnFilesearch()
{
// TODO: Add your control notification handler code here
char str[] = "Gem <20><><EFBFBD><EFBFBD>(*.Gem) |*.Gem| <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(*.*)|*.*||";
CString strFilter = str;
CFileDialog filedia(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.DoModal();
m_strObject = filedia.GetFileName();
UpdateData(FALSE);
}
BOOL CDlgDuenAObject::OnInitDialog()
{
CDialog::OnInitDialog();
UpdateData(TRUE);
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
/*
void CDlgDuenAObject::OnPicking()
{
// TODO: Add your control notification handler code here
m_bPick = (m_bPick == TRUE) ? FALSE : TRUE;
CMainFrame *mf=(CMainFrame*)AfxGetApp()->m_pMainWnd;
if(m_bPick == TRUE)
{
mf->m_PickMode = 96;
}
else
{
mf->m_PickMode = -1;
}
}
*/

View File

@@ -0,0 +1,52 @@
#if !defined(AFX_DLGDUENAOBJECT_H__4946991A_068E_4362_A0E7_BA7EA071918F__INCLUDED_)
#define AFX_DLGDUENAOBJECT_H__4946991A_068E_4362_A0E7_BA7EA071918F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgDuenAObject.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgDuenAObject dialog
class CDlgDuenAObject : public CDialog
{
// Construction
public:
CDlgDuenAObject(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgDuenAObject)
enum { IDD = IDD_DIALOG_DUENAOBJECT };
float m_fDelay;
int m_iLeaf;
int m_iLoopNum;
CString m_strObject;
CString m_strPosition;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgDuenAObject)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgDuenAObject)
virtual void OnOK();
afx_msg void OnFilesearch();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGDUENAOBJECT_H__4946991A_068E_4362_A0E7_BA7EA071918F__INCLUDED_)

View File

@@ -0,0 +1,79 @@
// DlgDuenEffect.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgDuenEffect.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgDuenEffect dialog
CDlgDuenEffect::CDlgDuenEffect(CWnd* pParent /*=NULL*/)
: CDialog(CDlgDuenEffect::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgDuenEffect)
m_strEffectName = _T("");
m_iLeafIndex = 0;
m_strPosition = _T("");
m_fDelay = 0.0f;
//}}AFX_DATA_INIT
}
void CDlgDuenEffect::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgDuenEffect)
DDX_Text(pDX, IDC_EFFECTEDIT, m_strEffectName);
DDX_Text(pDX, IDC_LEAFEDIT, m_iLeafIndex);
DDX_Text(pDX, IDC_POSEDIT, m_strPosition);
DDX_Text(pDX, IDC_DELAYEDIT, m_fDelay);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgDuenEffect, CDialog)
//{{AFX_MSG_MAP(CDlgDuenEffect)
ON_BN_CLICKED(IDC_FILESEARCH, OnFilesearch)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgDuenEffect message handlers
void CDlgDuenEffect::OnFilesearch()
{
// TODO: Add your control notification handler code here
char str[] = "Esf <20><><EFBFBD><EFBFBD>(*.Esf) |*.Esf| <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(*.*)|*.*||";
CString strFilter = str;
CFileDialog filedia(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.DoModal();
m_strEffectName = filedia.GetFileName();
UpdateData(FALSE);
}
void CDlgDuenEffect::OnOK()
{
// TODO: Add extra validation here
UpdateData(TRUE);
CDialog::OnOK();
}
BOOL CDlgDuenEffect::OnInitDialog()
{
CDialog::OnInitDialog();
//UpdateData(TRUE);
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

View File

@@ -0,0 +1,51 @@
#if !defined(AFX_DLGDUENEFFECT_H__AF901E37_9EC8_4C05_A1C8_2AB9F3975FAB__INCLUDED_)
#define AFX_DLGDUENEFFECT_H__AF901E37_9EC8_4C05_A1C8_2AB9F3975FAB__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgDuenEffect.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgDuenEffect dialog
class CDlgDuenEffect : public CDialog
{
// Construction
public:
CDlgDuenEffect(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgDuenEffect)
enum { IDD = IDD_DIALOG_DUENEFFECT };
CString m_strEffectName;
int m_iLeafIndex;
CString m_strPosition;
float m_fDelay;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgDuenEffect)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgDuenEffect)
afx_msg void OnFilesearch();
virtual void OnOK();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGDUENEFFECT_H__AF901E37_9EC8_4C05_A1C8_2AB9F3975FAB__INCLUDED_)

View File

@@ -0,0 +1,70 @@
// DlgDuenLight.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgDuenLight.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgDuenLight dialog
CDlgDuenLight::CDlgDuenLight(CWnd* pParent /*=NULL*/)
: CDialog(CDlgDuenLight::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgDuenLight)
m_uiBlue = 0;
m_uiGreen = 0;
m_iLeaf = 0;
m_strPos = _T("");
m_fRange = 0.0f;
m_uiRed = 0;
//}}AFX_DATA_INIT
}
void CDlgDuenLight::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgDuenLight)
DDX_Text(pDX, IDC_BLUE, m_uiBlue);
DDX_Text(pDX, IDC_GREEN, m_uiGreen);
DDX_Text(pDX, IDC_LEAFEDIT, m_iLeaf);
DDX_Text(pDX, IDC_POSEDIT, m_strPos);
DDX_Text(pDX, IDC_RANGE, m_fRange);
DDX_Text(pDX, IDC_RED, m_uiRed);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgDuenLight, CDialog)
//{{AFX_MSG_MAP(CDlgDuenLight)
ON_BN_CLICKED(IDOK2, OnOk2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgDuenLight message handlers
BOOL CDlgDuenLight::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgDuenLight::OnOk2()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
CDialog::OnOK();
}

View File

@@ -0,0 +1,52 @@
#if !defined(AFX_DLGDUENLIGHT_H__EDDB9178_D1DF_4105_A47D_AB4F405A347C__INCLUDED_)
#define AFX_DLGDUENLIGHT_H__EDDB9178_D1DF_4105_A47D_AB4F405A347C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgDuenLight.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgDuenLight dialog
class CDlgDuenLight : public CDialog
{
// Construction
public:
CDlgDuenLight(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgDuenLight)
enum { IDD = IDD_DIALOG_DUENLIGHT };
UINT m_uiBlue;
UINT m_uiGreen;
int m_iLeaf;
CString m_strPos;
float m_fRange;
UINT m_uiRed;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgDuenLight)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgDuenLight)
virtual BOOL OnInitDialog();
afx_msg void OnOk2();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGDUENLIGHT_H__EDDB9178_D1DF_4105_A47D_AB4F405A347C__INCLUDED_)

View File

@@ -0,0 +1,186 @@
// DlgDuengunTrigger.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "SceneManager.h"
#include "DlgDuengunTrigger.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgDuengunTrigger dialog
CDlgDuengunTrigger::CDlgDuengunTrigger(CWnd* pParent /*=NULL*/)
: CDialog(CDlgDuengunTrigger::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgDuengunTrigger)
m_strEditDuengunName = _T("");
m_bViewLeafBox = TRUE;
m_fScale = 0.0f;
//}}AFX_DATA_INIT
m_pTriggerSheet = NULL;
m_pParent = NULL;
}
void CDlgDuengunTrigger::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgDuengunTrigger)
DDX_Text(pDX, IDC_EDITNAME, m_strEditDuengunName);
DDX_Check(pDX, IDC_LEAFBOX, m_bViewLeafBox);
DDX_Text(pDX, IDC_BSPSCALE, m_fScale);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgDuengunTrigger, CDialog)
//{{AFX_MSG_MAP(CDlgDuengunTrigger)
ON_BN_CLICKED(IDC_SAVE, OnSave)
ON_BN_CLICKED(IDC_INITBUTTON, OnInitbutton)
ON_WM_DESTROY()
ON_WM_CLOSE()
ON_BN_CLICKED(IDC_BSPIN, OnBspin)
ON_BN_CLICKED(IDC_BSPOUT, OnBspout)
ON_BN_CLICKED(IDC_LEAFBOX, OnLeafbox)
ON_BN_CLICKED(IDC_BSPSCALEIN, OnBspscalein)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgDuengunTrigger message handlers
void CDlgDuengunTrigger::OnSave()
{
// TODO: Add your control notification handler code here
RBspScene *pScene = CSceneManager::m_RBspSceneManager.SearchBspScene(m_strEditDuengunName.LockBuffer());
if(pScene != NULL)
{
char *strBseName = m_strEditDuengunName.LockBuffer();
char *pChr = strrchr(strBseName,'.');
*pChr = '.'; pChr++;
*pChr = 'b'; pChr++;
*pChr = 's'; pChr++;
*pChr = 'e';
pScene->SaveBseFile(strBseName);
MessageBox("Bse File Save Success");
}
}
void CDlgDuengunTrigger::OnInitbutton()
{
// TODO: Add your control notification handler code here
}
BOOL CDlgDuengunTrigger::OnInitDialog()
{
m_pTriggerSheet = new CSheetDuengunTrigger("<EFBFBD><EFBFBD><EFBFBD><EFBFBD> Ʈ<><C6AE><EFBFBD><EFBFBD>");
m_pTriggerSheet->EnableStackedTabs(FALSE);
m_pTriggerSheet->Create(this,WS_CHILD | WS_VISIBLE );
m_pTriggerSheet->ModifyStyleEx(0,WS_EX_CONTROLPARENT);
m_pTriggerSheet->ModifyStyle(0,WS_TABSTOP);
m_pTriggerSheet->MoveWindow( 8, 70, 512, 268 );
CTabCtrl * pTabCtrl = m_pTriggerSheet->GetTabControl();
pTabCtrl->SetWindowPos( NULL, 0,0,505,258, SWP_NOZORDER | SWP_NOMOVE );
// TODO: Add extra initialization here
CDialog::OnInitDialog();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgDuengunTrigger::OnDestroy()
{
CDialog::OnDestroy();
if(m_pTriggerSheet != NULL)
{
delete m_pTriggerSheet;
m_pTriggerSheet = NULL;
}
// TODO: Add your message handler code here
}
BOOL CDlgDuengunTrigger::Create(CWnd* pParentWnd)
{
// TODO: Add your specialized code here and/or call the base class
m_pParent = pParentWnd;
return CDialog::Create(IDD, pParentWnd);
}
void CDlgDuengunTrigger::SetBspFile(char *strBse)
{
m_strEditDuengunName.Format("%s",strBse);
RBspScene *pScene = CSceneManager::m_RBspSceneManager.SearchBspScene(m_strEditDuengunName.LockBuffer());
if(pScene != NULL)
{
m_fScale = pScene->m_vecScale.x;
}
UpdateData(FALSE);
m_pTriggerSheet->SetActivePage(0);
// cycle through all page to activate(create) each page
}
void CDlgDuengunTrigger::OnClose()
{
// TODO: Add your message handler code here and/or call default
if(m_pParent != NULL)
m_pParent->SendMessage( WM_CHILD_CLOSE, (WPARAM)this );
CDialog::OnClose();
}
void CDlgDuengunTrigger::OnBspin()
{
// TODO: Add your control notification handler code here
CSceneManager::m_RBspSceneManager.SelectBspScene(m_strEditDuengunName.LockBuffer());
}
void CDlgDuengunTrigger::OnBspout()
{
// TODO: Add your control notification handler code here
CSceneManager::m_RBspSceneManager.BspSceneOut();
}
void CDlgDuengunTrigger::OnLeafbox()
{
// TODO: Add your control notification handler code here
m_bViewLeafBox = (m_bViewLeafBox == TRUE) ? FALSE : TRUE;
UpdateData(FALSE);
CSceneManager::m_RBspSceneManager.ToggleViewLeafBox();
}
void CDlgDuengunTrigger::OnBspscalein()
{
// TODO: Add your control notification handler code here
/* UpdateData(TRUE);
RBspScene *pScene = CSceneManager::m_RBspSceneManager.SearchBspScene(m_strEditDuengunName.LockBuffer());
if(pScene != NULL)
{
pScene->SetBspScaleLoaded(m_fScale,m_fScale,m_fScale);
}*/
}

View File

@@ -0,0 +1,65 @@
#if !defined(AFX_DLGDUENGUNTRIGGER_H__280F4790_6410_46E1_AA34_18B52BD034FE__INCLUDED_)
#define AFX_DLGDUENGUNTRIGGER_H__280F4790_6410_46E1_AA34_18B52BD034FE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgDuengunTrigger.h : header file
//
#include "SheetDuengunTrigger.h"
#define WM_CHILD_CLOSE (WM_USER+0x777)
/////////////////////////////////////////////////////////////////////////////
// CDlgDuengunTrigger dialog
class CDlgDuengunTrigger : public CDialog
{
// Construction
public:
CDlgDuengunTrigger(CWnd* pParent = NULL); // standard constructor
CSheetDuengunTrigger *m_pTriggerSheet;
CWnd *m_pParent;
void SetBspFile(char *strBse);
// Dialog Data
//{{AFX_DATA(CDlgDuengunTrigger)
enum { IDD = IDD_DUENGUNTRIGGER };
CString m_strEditDuengunName;
BOOL m_bViewLeafBox;
float m_fScale;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgDuengunTrigger)
public:
virtual BOOL Create(CWnd* pParentWnd);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgDuengunTrigger)
afx_msg void OnSave();
afx_msg void OnInitbutton();
virtual BOOL OnInitDialog();
afx_msg void OnDestroy();
afx_msg void OnClose();
afx_msg void OnBspin();
afx_msg void OnBspout();
afx_msg void OnLeafbox();
afx_msg void OnBspscalein();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGDUENGUNTRIGGER_H__280F4790_6410_46E1_AA34_18B52BD034FE__INCLUDED_)

View File

@@ -0,0 +1,177 @@
// DlgEditGCMDS.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgEditGCMDS.h"
#include "misc.h"
#include "BaseDataDefine.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgEditGCMDS dialog
CDlgEditGCMDS::CDlgEditGCMDS(CWnd* pParent /*=NULL*/)
: CDialog(CDlgEditGCMDS::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgEditGCMDS)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_pSheetEditGCMDS = NULL;
m_rpGCMDS = NULL;
m_pRealParent = NULL;
}
void CDlgEditGCMDS::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgEditGCMDS)
DDX_Control(pDX, IDC_EDIT_GCMDSFILENAME, m_ctrlGCMDSFileName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgEditGCMDS, CDialog)
//{{AFX_MSG_MAP(CDlgEditGCMDS)
ON_WM_DESTROY()
ON_WM_CLOSE()
ON_BN_CLICKED(IDC_BUTTON_SAVE, OnButtonSave)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgEditGCMDS message handlers
BOOL CDlgEditGCMDS::Create(CWnd* pParentWnd)
{
// TODO: Add your specialized code here and/or call the base class
m_pRealParent = pParentWnd;
return CDialog::Create(IDD, pParentWnd);
}
void CDlgEditGCMDS::SetGCMDSFile(const char *szFilename)
{
CZ3DGCMDS* rpGCMDS = CZ3DGeneralChrModel::_GetGCMDSByName( szFilename );
if( NULL == rpGCMDS )
{
return;
}
m_rpGCMDS = rpGCMDS;
m_ctrlGCMDSFileName.SetWindowText( szFilename );
// cycle through all page to activate(create) each page
// <20><> <20><><EFBFBD>̾<EFBFBD><CCBE>α<EFBFBD> <20><><EFBFBD><EFBFBD> refresh <20>κ<EFBFBD>
m_pSheetEditGCMDS->SetActivePage( 0 );
CPageGCMDSProperty* pGCMDSProperty = (CPageGCMDSProperty*)m_pSheetEditGCMDS->GetPage(0);
pGCMDSProperty->UpdateDataByGCMDS( rpGCMDS );
m_pSheetEditGCMDS->SetActivePage( 1 );
CPageGCMDSSlots* pGCMDSlots = (CPageGCMDSSlots*)m_pSheetEditGCMDS->GetPage(1);
pGCMDSlots->UpdateDataByGCMDS( rpGCMDS );
m_pSheetEditGCMDS->SetActivePage( 2 );
CPageGCMDSMotionSheet* pGCMDSMotionSheet = (CPageGCMDSMotionSheet*)m_pSheetEditGCMDS->GetPage(2);
pGCMDSMotionSheet->UpdateDataByGCMDS( rpGCMDS );
m_pSheetEditGCMDS->SetActivePage( 3 );
CPageGCMDSOutfitSet* pGCMDSOutfitSet = (CPageGCMDSOutfitSet*)m_pSheetEditGCMDS->GetPage(3);
pGCMDSOutfitSet->UpdateDataByGCMDS( rpGCMDS );
m_pSheetEditGCMDS->SetActivePage( 4 );
CPageGCMDSAttachmentSet* pGCDSAttachmentSet = (CPageGCMDSAttachmentSet*)m_pSheetEditGCMDS->GetPage(4);
pGCDSAttachmentSet->UpdateDataByGCMDS( rpGCMDS );
m_pSheetEditGCMDS->SetActivePage( 5 );
CPageGCMDSEffectInfo* pGCMDSEffectInfo = (CPageGCMDSEffectInfo*)m_pSheetEditGCMDS->GetPage(5);
pGCMDSEffectInfo->UpdateDataByGCMDS( rpGCMDS );
m_pSheetEditGCMDS->SetActivePage( 0 );
}
void CDlgEditGCMDS::EndEditGCMDS()
{
CPageGCMDSOutfitSet* pGCMDSOutfitSet = (CPageGCMDSOutfitSet*)m_pSheetEditGCMDS->GetPage(3);
pGCMDSOutfitSet->Save();
CPageGCMDSAttachmentSet* pGCMDSAttachmentSet = (CPageGCMDSAttachmentSet*)m_pSheetEditGCMDS->GetPage(4);
pGCMDSAttachmentSet->Save();
}
BOOL CDlgEditGCMDS::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
m_pSheetEditGCMDS = new CSheetEditGCMDS( "GCMDS <20><><EFBFBD><EFBFBD>" );
m_pSheetEditGCMDS->EnableStackedTabs( FALSE );
m_pSheetEditGCMDS->Create( this, WS_CHILD | WS_VISIBLE );
m_pSheetEditGCMDS->ModifyStyleEx(0,WS_EX_CONTROLPARENT);
m_pSheetEditGCMDS->ModifyStyle(0,WS_TABSTOP);
m_pSheetEditGCMDS->MoveWindow( 8, 32, 512, 284 );
CTabCtrl * pTabCtrl = m_pSheetEditGCMDS->GetTabControl();
pTabCtrl->SetWindowPos( NULL, 0,0,505,268, SWP_NOZORDER | SWP_NOMOVE );
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgEditGCMDS::OnDestroy()
{
CDialog::OnDestroy();
// TODO: Add your message handler code here
SAFE_DELETE( m_pSheetEditGCMDS );
}
void CDlgEditGCMDS::OnClose()
{
// TODO: Add your message handler code here and/or call default
EndEditGCMDS();
if( m_pRealParent )
{
m_pRealParent->SendMessage( WM_CHILD_CLOSE, (WPARAM)this );
}
CDialog::OnClose();
}
void CDlgEditGCMDS::OnButtonSave()
{
// TODO: Add your control notification handler code here
if( NULL == m_rpGCMDS )
{
return;
}
if( NULL == m_rpGCMDS->GetFileName() )
{
MessageBox( "<EFBFBD><EFBFBD> GCMDS<44><53><EFBFBD><EFBFBD><EFBFBD>Դϴ<D4B4>.", "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", MB_ICONERROR|MB_OK );
}
CString strTemp = m_rpGCMDS->GetFileName();
if( m_rpGCMDS->Save( NULL, CHARACTERDATAPATH ) )
{
strTemp += " <20><><EFBFBD><EFBFBD> <20>Ϸ<EFBFBD>";
MessageBox( strTemp, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", MB_ICONINFORMATION|MB_OK );
}
else
{
strTemp += " <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>";
MessageBox( strTemp, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>", MB_ICONERROR|MB_OK );
}
}

View File

@@ -0,0 +1,63 @@
#if !defined(AFX_DLGEDITGCMDS_H__0ED17E64_35A5_4944_B8DC_2B58EDC58528__INCLUDED_)
#define AFX_DLGEDITGCMDS_H__0ED17E64_35A5_4944_B8DC_2B58EDC58528__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgEditGCMDS.h : header file
//
#include "SheetEditGCMDS.h"
#include "Z3DGeneralChrModel.h"
/////////////////////////////////////////////////////////////////////////////
// CDlgEditGCMDS dialog
class CDlgEditGCMDS : public CDialog
{
// Construction
public:
void SetGCMDSFile( const char* szFilename );
void EndEditGCMDS();
CDlgEditGCMDS(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgEditGCMDS)
enum { IDD = IDD_DIALOG_EDITGCMDS };
CEdit m_ctrlGCMDSFileName;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgEditGCMDS)
public:
virtual BOOL Create(CWnd* pParentWnd);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
CSheetEditGCMDS* m_pSheetEditGCMDS;
CZ3DGCMDS* m_rpGCMDS;
CWnd* m_pRealParent; // safe owner window<6F><77> <20>ƴ<EFBFBD> <20><>¥(?) parent window
// Generated message map functions
//{{AFX_MSG(CDlgEditGCMDS)
virtual BOOL OnInitDialog();
afx_msg void OnDestroy();
afx_msg void OnClose();
afx_msg void OnButtonSave();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGEDITGCMDS_H__0ED17E64_35A5_4944_B8DC_2B58EDC58528__INCLUDED_)

View File

@@ -0,0 +1,67 @@
// DlgEditName.cpp : implementation file
//
#include "stdafx.h"
#include "WorldCreator.h"
#include "DlgEditName.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgEditName dialog
CDlgEditName::CDlgEditName(CWnd* pParent /*=NULL*/)
: CDialog(CDlgEditName::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgEditName)
m_EditName = _T("");
m_fScale = 4.0f;
m_FixEventNum = 0;
//}}AFX_DATA_INIT
}
void CDlgEditName::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgEditName)
DDX_Text(pDX, IDC_EDIT_EDITNAME, m_EditName);
DDX_Text(pDX, IDC_BSPSCALE, m_fScale);
DDX_Text(pDX, IDC_EDIT1, m_FixEventNum);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgEditName, CDialog)
//{{AFX_MSG_MAP(CDlgEditName)
ON_BN_CLICKED(IDC_SEARCHFILE, OnSearchfile)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgEditName message handlers
void CDlgEditName::OnSearchfile()
{
// TODO: Add your control notification handler code here
char str[] = "Bsp <20><><EFBFBD><EFBFBD>(*.bsp) |*.bsp| Bse <20><><EFBFBD><EFBFBD>(*.bse)|*.bse| <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(*.*)|*.*||";
CString strFilter = str;
CFileDialog filedia(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.DoModal();
m_EditName = filedia.GetFileName();
UpdateData(FALSE);
}
void CDlgEditName::OnOK()
{
// TODO: Add extra validation here
UpdateData(TRUE);
CDialog::OnOK();
}

View File

@@ -0,0 +1,49 @@
#if !defined(AFX_DLGEDITNAME_H__3F6DD44A_D6D8_4C1B_A227_5AED27EAA8CC__INCLUDED_)
#define AFX_DLGEDITNAME_H__3F6DD44A_D6D8_4C1B_A227_5AED27EAA8CC__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgEditName.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgEditName dialog
class CDlgEditName : public CDialog
{
// Construction
public:
CDlgEditName(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgEditName)
enum { IDD = IDD_DIALOG_EDITNAME };
CString m_EditName;
float m_fScale;
int m_FixEventNum;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgEditName)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgEditName)
afx_msg void OnSearchfile();
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGEDITNAME_H__3F6DD44A_D6D8_4C1B_A227_5AED27EAA8CC__INCLUDED_)

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,123 @@
#if !defined(AFX_DLGEDITTERRAIN_H__D46BB131_88A5_4AD4_A686_8140310030CB__INCLUDED_)
#define AFX_DLGEDITTERRAIN_H__D46BB131_88A5_4AD4_A686_8140310030CB__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgEditTerrain.h : header file
//
#include <SectorScene.h>
/////////////////////////////////////////////////////////////////////////////
// CDlgEditTerrain dialog
class CDlgEditTerrain : public CDialog
{
// Construction
public:
void ShowWalkPossible();
void InitSmoothBuffer();
void MouseEditSmooth(vector3 vecStart,vector3 vecDir);
void SelectMustDivideVertex(vector3 vecStart,vector3 vecDir);
void RecurFindVertex(List<int> &DivideList,int vx,int vy,int leftX,int leftY,int rightX,int rightY,int apexX,int apexY,int node);
void SetMustDivideVertex(int vx,int vy);
void MakeRoad(vector3 vecStart,vector3 vecDir);
void SetMakeRoadStartVertex(vector3 vecStart,vector3 vecDir);
void MouseEdit(vector3 vecStart,vector3 vecDir);
void SectorEdgeAttach();
void EndAndSave();
void MouseEdit(float fPx,float fPy,float fPz);
void InitForEditTerrrain();
CDlgEditTerrain(CWnd* pParent = NULL); // standard constructor
CSectorScene *m_SelectSectorScene;
CSectorScene *m_SelectNeighborScene[8];
BOOL m_isSelectSceneEdit;
BOOL m_isSelectNeighborEdit[8];
float m_fAddHeight;
float m_fRange;
float m_fSmoothHeight[((SECTORSX*3)-2)*((SECTORSY*3)-2)];
vector3 m_vecMakeRoadStart;
int *m_CurrentVariance;
List<int> m_LeftDivideList,m_RightDivideList;
// Dialog Data
//{{AFX_DATA(CDlgEditTerrain)
enum { IDD = IDD_DIALOG_EDITTERRAIN };
float m_fHeight;
float m_fMaxHeight;
float m_fMinHeight;
BOOL m_isAddHeight;
BOOL m_isSubHeight;
BOOL m_isAdd1;
BOOL m_isAdd2;
BOOL m_isRange1;
BOOL m_isRange2;
BOOL m_isRange3;
BOOL m_isRange4;
float m_fSelectedHeigth;
BOOL m_isSmallSmooth;
float m_fEndHeight;
float m_fStartHeight;
BOOL m_isMakeRoad;
float m_fRoadWidth;
BOOL m_isMustDivide;
BOOL m_isRange5;
BOOL m_isRange6;
float m_fAllAddHeight;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgEditTerrain)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
public:
// Generated message map functions
//{{AFX_MSG(CDlgEditTerrain)
afx_msg void OnCheckAddheight();
afx_msg void OnCheckSubheight();
virtual BOOL OnInitDialog();
afx_msg void OnButtonTerrainfastup();
afx_msg void OnButtonHeightslowup();
afx_msg void OnButtonHeightfastdown();
afx_msg void OnButtonHeightslowdown();
afx_msg void OnChangeEditMaxheight();
afx_msg void OnChangeEditMinheight();
afx_msg void OnButtonTerrainadjust();
afx_msg void OnCheckAddheightvalue1();
afx_msg void OnCheckAddheightvalue2();
afx_msg void OnCheckEditrange1();
afx_msg void OnCheckEditrange2();
afx_msg void OnCheckEditrange3();
afx_msg void OnCheckEditrange4();
afx_msg void OnButtonTerrainsmooth();
afx_msg void OnButtonSectoredgeattach();
afx_msg void OnCheckSmallsmooth();
afx_msg void OnUpdateEditStartheight();
afx_msg void OnUpdateEditEndheight();
afx_msg void OnCheckMakeroad();
afx_msg void OnUpdateEditRoadwidth();
afx_msg void OnCheckMustdivide();
afx_msg void OnCheckEditrange5();
afx_msg void OnCheckEditrange6();
afx_msg void OnButtonAllheightfix();
afx_msg void OnButtonHeightfix();
protected:
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGEDITTERRAIN_H__D46BB131_88A5_4AD4_A686_8140310030CB__INCLUDED_)

View File

@@ -0,0 +1,415 @@
// DlgEffect.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgEffect.h"
#include "MainFrm.h"
#include "WorldCreatorView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgEffect dialog
CDlgEffect::CDlgEffect(CWnd* pParent /*=NULL*/)
: CDialog(CDlgEffect::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgEffect)
m_FadeIn = 0.0f;
m_FadeOut = 0.0f;
m_FadeInSpeed = 0.0f;
m_A1 = 0.0f;
m_A2 = 0.0f;
m_A3 = 0.0f;
m_A4 = 0.0f;
m_B1 = 0.0f;
m_B2 = 0.0f;
m_B3 = 0.0f;
m_B4 = 0.0f;
m_G1 = 0.0f;
m_G2 = 0.0f;
m_G3 = 0.0f;
m_G4 = 0.0f;
m_Gx = 0.0f;
m_Gy = 0.0f;
m_Gz = 0.0f;
m_ImX = 0.0f;
m_ImY = 0.0f;
m_ImZ = 0.0f;
m_R1 = 0.0f;
m_R2 = 0.0f;
m_R3 = 0.0f;
m_R4 = 0.0f;
m_Rad = 0.0f;
m_ParNum = 0;
m_Size = 0.0;
m_Center = 0.0;
m_switch = FALSE;
m_SwitchRad = 0.0;
m_Vot = 0.0;
m_Loop = FALSE;
m_Fix = FALSE;
m_RandAni = FALSE;
m_RandMax = 0.0;
m_RandMin = 0.0;
m_EffName = _T("");
m_BoidName = _T("");
m_BoidNum = 0;
m_BoidSpeed = 0.0f;
m_BoidRange = 0.0f;
m_WavePointNum = 0;
m_WaveLayerUpNum = 0;
m_WaveLayerDownNum = 0;
m_WaveSpeed = 0.0f;
m_WaveHigh = 0.0f;
m_BoidRange2 = 0.0f;
m_BoidRange3 = 0.0f;
m_BoidVot = 0.0f;
m_BoidAct = -1;
m_WaterHeight = 20;
m_WaterWHeight = 0.0f;
m_WaterQuadSize = 10.0f;
m_WaterChop = -8.0f;
m_WaterWWidth = 20;
m_BoidLimitHeight = 0.0f;
m_bObjectCulling = FALSE;
m_BoidKind = -1;
//}}AFX_DATA_INIT
}
void CDlgEffect::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgEffect)
DDX_Control(pDX, IDC_CHECK_EFFECTADD, m_CheckEffect);
DDX_Control(pDX, IDC_LIST_EFFECTMETHOD, m_Effect);
DDX_Text(pDX, IDC_FADEIN, m_FadeIn);
DDV_MinMaxFloat(pDX, m_FadeIn, 0.f, 1.f);
DDX_Text(pDX, IDC_FADEOUT, m_FadeOut);
DDX_Text(pDX, IDC_FADEINSPEED, m_FadeInSpeed);
DDX_Text(pDX, IDC_A1, m_A1);
DDX_Text(pDX, IDC_A2, m_A2);
DDX_Text(pDX, IDC_A3, m_A3);
DDX_Text(pDX, IDC_A4, m_A4);
DDX_Text(pDX, IDC_B1, m_B1);
DDX_Text(pDX, IDC_B2, m_B2);
DDX_Text(pDX, IDC_B3, m_B3);
DDX_Text(pDX, IDC_B4, m_B4);
DDX_Text(pDX, IDC_G1, m_G1);
DDX_Text(pDX, IDC_G2, m_G2);
DDX_Text(pDX, IDC_G3, m_G3);
DDX_Text(pDX, IDC_G4, m_G4);
DDX_Text(pDX, IDC_GX, m_Gx);
DDX_Text(pDX, IDC_GY, m_Gy);
DDX_Text(pDX, IDC_GZ, m_Gz);
DDX_Text(pDX, IDC_IMPRESSX, m_ImX);
DDX_Text(pDX, IDC_IMPRESSY, m_ImY);
DDX_Text(pDX, IDC_IMPRESSZ, m_ImZ);
DDX_Text(pDX, IDC_R1, m_R1);
DDX_Text(pDX, IDC_R2, m_R2);
DDX_Text(pDX, IDC_R3, m_R3);
DDX_Text(pDX, IDC_R4, m_R4);
DDX_Text(pDX, IDC_RAD, m_Rad);
DDX_Text(pDX, IDC_PARNUM, m_ParNum);
DDX_Text(pDX, IDC_PARSIZE, m_Size);
DDX_Text(pDX, IDC_CENTER, m_Center);
DDX_Check(pDX, IDC_SWITCH, m_switch);
DDX_Text(pDX, IDC_SWITCHRAD, m_SwitchRad);
DDX_Text(pDX, IDC_VOT, m_Vot);
DDX_Check(pDX, IDC_LOOP, m_Loop);
DDX_Check(pDX, IDC_FIX, m_Fix);
DDX_Check(pDX, IDC_RANDANI, m_RandAni);
DDX_Text(pDX, IDC_RANDMAX, m_RandMax);
DDX_Text(pDX, IDC_RANDMIN, m_RandMin);
DDX_Text(pDX, IDC_EFFNAME, m_EffName);
DDX_Text(pDX, IDC_BOIDNAME, m_BoidName);
DDX_Text(pDX, IDC_BOIDNUM, m_BoidNum);
DDX_Text(pDX, IDC_BOIDSPEED, m_BoidSpeed);
DDX_Text(pDX, IDC_BOIDRANGE, m_BoidRange);
DDX_Text(pDX, IDC_WAVENUM, m_WavePointNum);
DDX_Text(pDX, IDC_WAVEUP, m_WaveLayerUpNum);
DDX_Text(pDX, IDC_WAVEDOWN, m_WaveLayerDownNum);
DDX_Text(pDX, IDC_WAVESPEED, m_WaveSpeed);
DDX_Text(pDX, IDC_WAVEHIGH, m_WaveHigh);
DDX_Text(pDX, IDC_BOIDRANGE2, m_BoidRange2);
DDX_Text(pDX, IDC_BOIDRANGE3, m_BoidRange3);
DDX_Text(pDX, IDC_BOIDVOT, m_BoidVot);
DDX_Radio(pDX, IDC_RADIO1, m_BoidAct);
DDX_Text(pDX, IDC_WATERWHEIGHT, m_WaterHeight);
DDX_Text(pDX, IDC_WATERWDEFAULT, m_WaterWHeight);
DDX_Text(pDX, IDC_WATERQUADSIZE, m_WaterQuadSize);
DDX_Text(pDX, IDC_WATERCHOP, m_WaterChop);
DDX_Text(pDX, IDC_WATERWWIDTH, m_WaterWWidth);
DDX_Text(pDX, IDC_LIMITHEIGHT, m_BoidLimitHeight);
DDX_Check(pDX, IDC_MESHOBJECT, m_bObjectCulling);
DDX_Radio(pDX, IDC_RADIO3, m_BoidKind);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgEffect, CDialog)
//{{AFX_MSG_MAP(CDlgEffect)
ON_LBN_DBLCLK(IDC_LIST_EFFECTMETHOD, OnDblclkListEffectmethod)
ON_BN_CLICKED(IDC_CHECK_EFFECTADD, OnCheckEffectadd)
ON_LBN_SELCHANGE(IDC_LIST_EFFECTMETHOD, OnSelchangeListEffectmethod)
ON_BN_CLICKED(IDC_EFFGET, OnEffget)
ON_BN_CLICKED(IDC_WAVECREAT, OnWavecreat)
ON_BN_CLICKED(IDC_WAVEPOINTCLICK, OnWavepointclick)
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgEffect message handlers
BOOL CDlgEffect::OnInitDialog()
{
CDialog::OnInitDialog();
CString strEffectName;
strEffectName="Vol-Fog";
m_Effect.AddString(strEffectName);
strEffectName="Boid";
m_Effect.AddString(strEffectName);
strEffectName="Mesh-ani";
m_Effect.AddString(strEffectName);
strEffectName="<EFBFBD>ĵ<EFBFBD>";
m_Effect.AddString(strEffectName);
strEffectName="<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>";
m_Effect.AddString(strEffectName);
m_A1 = 255;
m_A2 = 255;
m_A3 = 255;
m_A4 = 255;
m_B1 = 255;
m_B2 = 255;
m_B3 = 255;
m_B4 = 255;
m_R1 = 255;
m_R2 = 255;
m_R3 = 255;
m_R4 = 255;
m_G1 = 255;
m_G2 = 255;
m_G3 = 255;
m_G4 = 255;
m_ImX = 1.0;
m_ImY = 0.0;
m_ImZ = 1.0;
m_Loop = true;
m_FadeIn = 1.0;
m_FadeOut = 0.0;
m_FadeInSpeed = 3.0;
m_ParNum = 10;
m_Size = 500;
m_Center = 1000;
m_BoidNum = 10;
m_BoidRange = 2000.0f;
m_BoidSpeed = 3.0f;
m_WaveLayerDownNum = 0;
m_WaveLayerUpNum = 0;
m_WavePointNum = 0;
m_WaveSpeed = 1.0f;
UpdateData(FALSE);
return TRUE;
}
void CDlgEffect::OnDblclkListEffectmethod()
{
long EffectKind = m_Effect.GetCurSel();
m_Select = EffectKind;
CMainFrame *mf=(CMainFrame*)AfxGetApp()->m_pMainWnd;
CWorldCreatorView *av=(CWorldCreatorView *)mf->GetActiveView();
av->m_MouseInterface=100+m_Select;
// TODO: Add your control notification handler code here
}
void CDlgEffect::OnCheckEffectadd()
{
UpdateData(TRUE);
CMainFrame *mf=(CMainFrame*)AfxGetApp()->m_pMainWnd;
CWorldCreatorView *av=(CWorldCreatorView *)mf->GetActiveView();
av->m_LandscapeEffectValue.m_A1 = m_A1 / 255.0f;
av->m_LandscapeEffectValue.m_A2 = m_A2 / 255.0f;
av->m_LandscapeEffectValue.m_A3 = m_A3 / 255.0f;
av->m_LandscapeEffectValue.m_A4 = m_A4 / 255.0f;
av->m_LandscapeEffectValue.m_B1 = m_B1 / 255.0f;
av->m_LandscapeEffectValue.m_B2 = m_B2 / 255.0f;
av->m_LandscapeEffectValue.m_B3 = m_B3 / 255.0f;
av->m_LandscapeEffectValue.m_B4 = m_B4 / 255.0f;
av->m_LandscapeEffectValue.m_R1 = m_R1 / 255.0f;
av->m_LandscapeEffectValue.m_R2 = m_R2 / 255.0f;
av->m_LandscapeEffectValue.m_R3 = m_R3 / 255.0f;
av->m_LandscapeEffectValue.m_R4 = m_R4 / 255.0f;
av->m_LandscapeEffectValue.m_G1 = m_G1 / 255.0f;
av->m_LandscapeEffectValue.m_G2 = m_G2 / 255.0f;
av->m_LandscapeEffectValue.m_G3 = m_G3 / 255.0f;
av->m_LandscapeEffectValue.m_G4 = m_G4 / 255.0f;
av->m_LandscapeEffectValue.m_Center = m_Center;
av->m_LandscapeEffectValue.m_Num = m_ParNum;
av->m_LandscapeEffectValue.m_FadeIn = m_FadeIn;
av->m_LandscapeEffectValue.m_FadeInSpeed = m_FadeInSpeed;
av->m_LandscapeEffectValue.m_FadeOut = m_FadeOut;
av->m_LandscapeEffectValue.m_Gx = m_Gx;
av->m_LandscapeEffectValue.m_Gy = m_Gy;
av->m_LandscapeEffectValue.m_Gz = m_Gz;
av->m_LandscapeEffectValue.m_ImX = m_ImX;
av->m_LandscapeEffectValue.m_ImY = m_ImY;
av->m_LandscapeEffectValue.m_ImZ = m_ImZ;
av->m_LandscapeEffectValue.m_Rad = m_Rad;
av->m_LandscapeEffectValue.m_Size = m_Size;
//<2F>޽<EFBFBD>
av->m_LandscapeEffectValue.m_switch = (m_switch) ? 1 : 0;
av->m_LandscapeEffectValue.m_switchRad = m_SwitchRad;
av->m_LandscapeEffectValue.m_Vot = m_Vot;
av->m_LandscapeEffectValue.m_loop = (m_Loop) ? 1 : 0;
av->m_LandscapeEffectValue.m_Fix = (m_Fix) ? 1 : 0;
av->m_LandscapeEffectValue.m_RandAni = (m_RandAni) ? 1 : 0;
av->m_LandscapeEffectValue.m_RandMax = m_RandMax;
av->m_LandscapeEffectValue.m_RandMin = m_RandMin;
av->m_LandscapeEffectValue.m_EffName = m_EffName;
av->m_LandscapeEffectValue.m_ObjectCulling = (m_bObjectCulling) ? 1 : 0;
// boid
av->m_LandscapeEffectValue.m_BoidNum = m_BoidNum;
av->m_LandscapeEffectValue.m_BoidRange = m_BoidRange;
av->m_LandscapeEffectValue.m_BoidRange2 = m_BoidRange2;
av->m_LandscapeEffectValue.m_BoidRange3 = m_BoidRange3;
av->m_LandscapeEffectValue.m_BoidLimitHeight = m_BoidLimitHeight;
av->m_LandscapeEffectValue.m_BoidKind = m_BoidKind;
av->m_LandscapeEffectValue.m_BoidSpeed = m_BoidSpeed;
av->m_LandscapeEffectValue.m_BoidVot = m_BoidVot;
av->m_LandscapeEffectValue.m_BoidName = m_BoidName;
av->m_LandscapeEffectValue.m_BoidAct = m_BoidAct;
// water space
av->m_LandscapeEffectValue.m_WaterHeight = m_WaterHeight;
av->m_LandscapeEffectValue.m_WaterWidth = m_WaterWWidth;
// limit height
av->m_LandscapeEffectValue.m_WaterWHeight = m_WaterWHeight;
av->m_LandscapeEffectValue.m_WaterWQuadSize = m_WaterQuadSize;
av->m_LandscapeEffectValue.m_WaterWChop = m_WaterChop;
/*
static int click = 0;
// TODO: Add your control notification handler code here
long EffectKind = m_Effect.GetCurSel();
if(click == 1) {
m_CheckEffect.SetCheck(0);
CMainFrame *mf=(CMainFrame*)AfxGetApp()->m_pMainWnd;
CWorldCreatorView *av=(CWorldCreatorView *)mf->GetActiveView();
av->m_MouseInterface=-1;
}
else {
m_CheckEffect.SetCheck(1);
m_Select = EffectKind;
CMainFrame *mf=(CMainFrame*)AfxGetApp()->m_pMainWnd;
CWorldCreatorView *av=(CWorldCreatorView *)mf->GetActiveView();
av->m_MouseInterface=70+m_Select;
}
click = m_CheckEffect.GetCheck();
*/
}
void CDlgEffect::OnSelchangeListEffectmethod()
{
// TODO: Add your control notification handler code here
long EffectKind = m_Effect.GetCurSel();
m_Select = EffectKind;
CMainFrame *mf=(CMainFrame*)AfxGetApp()->m_pMainWnd;
CWorldCreatorView *av=(CWorldCreatorView *)mf->GetActiveView();
av->m_MouseInterface=100+m_Select;
}
void CDlgEffect::OnCancel()
{
// TODO: Add extra cleanup here
CMainFrame *mf=(CMainFrame*)AfxGetApp()->m_pMainWnd;
CWorldCreatorView *av=(CWorldCreatorView *)mf->GetActiveView();
av->m_MouseInterface=-1;
CDialog::OnCancel();
}
void CDlgEffect::OnEffget()
{
// TODO: Add your control notification handler code here
CString strFilter = "Effect Files (*.eff)|*.eff|All Files (*.*)|*.*||";
CFileDialog filedia(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.DoModal();
m_EffName=filedia.GetFileName();
UpdateData(false);
}
void CDlgEffect::OnWavecreat()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
CMainFrame *mf=(CMainFrame*)AfxGetApp()->m_pMainWnd;
CWorldCreatorView *av=(CWorldCreatorView *)mf->GetActiveView();
av->m_LandscapeEffectValue.m_UpLayerNum = m_WaveLayerUpNum;
av->m_LandscapeEffectValue.m_DownLayerNum = m_WaveLayerDownNum;
av->m_LandscapeEffectValue.m_WaveCreate = true;
}
void CDlgEffect::OnWavepointclick()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
CMainFrame *mf=(CMainFrame*)AfxGetApp()->m_pMainWnd;
CWorldCreatorView *av=(CWorldCreatorView *)mf->GetActiveView();
av->m_LandscapeEffectValue.m_WaveCreate = false;
av->m_LandscapeEffectValue.m_WavePointNum = 0;
av->m_LandscapeEffectValue.m_WaveHigh = m_WaveHigh;
}
void CDlgEffect::OnButton1()
{
// TODO: Add your control notification handler code here
UpdateData(TRUE);
char str[] = "GEM <20><><EFBFBD><EFBFBD>(*.Gem) |*.gem| <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(*.*)|*.*||";
CString strFilter = str;
CString t_name;
CFileDialog filedia(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.DoModal();
m_BoidName = filedia.GetFileName();
UpdateData(FALSE);
}

View File

@@ -0,0 +1,119 @@
#if !defined(AFX_DLGEFFECT_H__10AA460E_2E6E_485F_932F_EC7CE1725853__INCLUDED_)
#define AFX_DLGEFFECT_H__10AA460E_2E6E_485F_932F_EC7CE1725853__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgEffect.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgEffect dialog
class CDlgEffect : public CDialog
{
// Construction
public:
long m_Select;
CDlgEffect(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgEffect)
enum { IDD = IDD_DIALOG_EFFECTMAP };
CButton m_CheckEffect;
CListBox m_Effect;
float m_FadeIn;
float m_FadeOut;
float m_FadeInSpeed;
float m_A1;
float m_A2;
float m_A3;
float m_A4;
float m_B1;
float m_B2;
float m_B3;
float m_B4;
float m_G1;
float m_G2;
float m_G3;
float m_G4;
float m_Gx;
float m_Gy;
float m_Gz;
float m_ImX;
float m_ImY;
float m_ImZ;
float m_R1;
float m_R2;
float m_R3;
float m_R4;
float m_Rad;
int m_ParNum;
double m_Size;
double m_Center;
BOOL m_switch;
double m_SwitchRad;
double m_Vot;
BOOL m_Loop;
BOOL m_Fix;
BOOL m_RandAni;
double m_RandMax;
double m_RandMin;
CString m_EffName;
CString m_BoidName;
int m_BoidNum;
float m_BoidSpeed;
float m_BoidRange;
int m_WavePointNum;
int m_WaveLayerUpNum;
int m_WaveLayerDownNum;
float m_WaveSpeed;
float m_WaveHigh;
float m_BoidRange2;
float m_BoidRange3;
float m_BoidVot;
int m_BoidAct;
int m_WaterHeight;
float m_WaterWHeight;
float m_WaterQuadSize;
float m_WaterChop;
int m_WaterWWidth;
float m_BoidLimitHeight;
BOOL m_bObjectCulling;
int m_BoidKind;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgEffect)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgEffect)
virtual BOOL OnInitDialog();
afx_msg void OnDblclkListEffectmethod();
afx_msg void OnCheckEffectadd();
afx_msg void OnSelchangeListEffectmethod();
virtual void OnCancel();
afx_msg void OnEffget();
afx_msg void OnWavecreat();
afx_msg void OnWavepointclick();
afx_msg void OnButton1();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGEFFECT_H__10AA460E_2E6E_485F_932F_EC7CE1725853__INCLUDED_)

View File

@@ -0,0 +1,80 @@
// DlgEffectLoad.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgEffectLoad.h"
#include "BaseDataDefine.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgEffectLoad dialog
CDlgEffectLoad::CDlgEffectLoad(CWnd* pParent /*=NULL*/)
: CDialog(CDlgEffectLoad::IDD, pParent)
{
m_bEffectLoad = TRUE;
//{{AFX_DATA_INIT(CDlgEffectLoad)
m_name = _T("");
//}}AFX_DATA_INIT
}
void CDlgEffectLoad::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgEffectLoad)
DDX_Control(pDX, IDC_OK, m_ok);
DDX_Control(pDX, IDC_CANCLE, m_cancle);
DDX_Control(pDX, IDC_BUTTON1, m_load);
DDX_Text(pDX, IDC_EDIT1, m_name);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgEffectLoad, CDialog)
//{{AFX_MSG_MAP(CDlgEffectLoad)
ON_BN_CLICKED(IDC_BUTTON1, OnEffectLoad)
ON_EN_CHANGE(IDC_EDIT1, OnChangeEffectName)
ON_COMMAND(MENU_EFFECT_LOAD, OnEffectLoad)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgEffectLoad message handlers
void CDlgEffectLoad::OnEffectLoad()
{
// TODO: Add your control notification handler code here
//UpdateData();
CString strFilter = EFFFILE;
CFileDialog filedia(TRUE,EFFECTSCRIPTPATH,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.m_ofn.lpstrInitialDir = EFFECTSCRIPTPATH;
filedia.DoModal();
CString filename=filedia.GetFileName();
if(filename!="")
{
m_EffectFileName=filename;
m_bEffectLoad = false;
}
}
void CDlgEffectLoad::OnChangeEffectName()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
}

View File

@@ -0,0 +1,52 @@
#if !defined(AFX_DLGEFFECTLOAD_H__2363E672_1957_465E_B800_6F81D9AE904F__INCLUDED_)
#define AFX_DLGEFFECTLOAD_H__2363E672_1957_465E_B800_6F81D9AE904F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgEffectLoad.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgEffectLoad dialog
class CDlgEffectLoad : public CDialog
{
// Construction
public:
CString m_EffectFileName;
BOOL m_bEffectLoad;
CDlgEffectLoad(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgEffectLoad)
enum { IDD = IDD_DIALOG_EFFECTLOAD };
CButton m_ok;
CButton m_cancle;
CButton m_load;
CString m_name;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgEffectLoad)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgEffectLoad)
afx_msg void OnEffectLoad();
afx_msg void OnChangeEffectName();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGEFFECTLOAD_H__2363E672_1957_465E_B800_6F81D9AE904F__INCLUDED_)

View File

@@ -0,0 +1,50 @@
// DlgEventKeyframeSlider.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgEventKeyframeSlider.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgEventKeyframeSlider dialog
CDlgEventKeyframeSlider::CDlgEventKeyframeSlider(CWnd* pParent /*=NULL*/)
: CDialog(CDlgEventKeyframeSlider::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgEventKeyframeSlider)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDlgEventKeyframeSlider::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgEventKeyframeSlider)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgEventKeyframeSlider, CDialog)
//{{AFX_MSG_MAP(CDlgEventKeyframeSlider)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgEventKeyframeSlider message handlers
BOOL CDlgEventKeyframeSlider::Create(CWnd* pParentWnd)
{
// TODO: Add your specialized code here and/or call the base class
return CDialog::Create(IDD, pParentWnd);
}

View File

@@ -0,0 +1,48 @@
#if !defined(AFX_DLGEVENTKEYFRAMESLIDER_H__46360938_9AFA_40DE_BE78_284727929FBA__INCLUDED_)
#define AFX_DLGEVENTKEYFRAMESLIDER_H__46360938_9AFA_40DE_BE78_284727929FBA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgEventKeyframeSlider.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgEventKeyframeSlider dialog
class CDlgEventKeyframeSlider : public CDialog
{
// Construction
public:
CDlgEventKeyframeSlider(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgEventKeyframeSlider)
enum { IDD = IDD_DIALOG_EVENTKEYFRAMESLIDER };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgEventKeyframeSlider)
public:
virtual BOOL Create(CWnd* pParentWnd);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgEventKeyframeSlider)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGEVENTKEYFRAMESLIDER_H__46360938_9AFA_40DE_BE78_284727929FBA__INCLUDED_)

View File

@@ -0,0 +1,62 @@
// DlgGrass.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgGrass.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgGrass dialog
CDlgGrass::CDlgGrass(CWnd* pParent /*=NULL*/)
: CDialog(CDlgGrass::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgGrass)
m_bAddGrass = FALSE;
m_bDelGrass = FALSE;
//}}AFX_DATA_INIT
}
void CDlgGrass::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgGrass)
DDX_Check(pDX, IDC_CHECK_ADDGRASS, m_bAddGrass);
DDX_Check(pDX, IDC_CHECK_DELGRASS, m_bDelGrass);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgGrass, CDialog)
//{{AFX_MSG_MAP(CDlgGrass)
ON_BN_CLICKED(IDC_CHECK_ADDGRASS, OnCheckAddgrass)
ON_BN_CLICKED(IDC_CHECK_DELGRASS, OnCheckDelgrass)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgGrass message handlers
void CDlgGrass::OnCheckAddgrass()
{
// TODO: Add your control notification handler code here
m_bAddGrass=TRUE;
m_bDelGrass=FALSE;
UpdateData(FALSE);
}
void CDlgGrass::OnCheckDelgrass()
{
// TODO: Add your control notification handler code here
m_bAddGrass=FALSE;
m_bDelGrass=TRUE;
UpdateData(FALSE);
}

View File

@@ -0,0 +1,48 @@
#if !defined(AFX_DLGGRASS_H__51707136_33EE_489D_9799_3D8D5AFD2137__INCLUDED_)
#define AFX_DLGGRASS_H__51707136_33EE_489D_9799_3D8D5AFD2137__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgGrass.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgGrass dialog
class CDlgGrass : public CDialog
{
// Construction
public:
CDlgGrass(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgGrass)
enum { IDD = IDD_DIALOG_GRASS };
BOOL m_bAddGrass;
BOOL m_bDelGrass;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgGrass)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgGrass)
afx_msg void OnCheckAddgrass();
afx_msg void OnCheckDelgrass();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGGRASS_H__51707136_33EE_489D_9799_3D8D5AFD2137__INCLUDED_)

View File

@@ -0,0 +1,177 @@
// DlgHouseLoad.cpp : implementation file
//
#include "stdafx.h"
#include "WorldCreator.h"
#include "DlgHouseLoad.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgHouseLoad dialog
CDlgHouseLoad::CDlgHouseLoad(CWnd* pParent /*=NULL*/)
: CDialog(CDlgHouseLoad::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgHouseLoad)
m_bInname = FALSE;
m_bMedname = FALSE;
m_bOutname = FALSE;
m_HouseName = _T("");
m_bBSP = FALSE;
//}}AFX_DATA_INIT
}
void CDlgHouseLoad::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgHouseLoad)
DDX_Check(pDX, IDC_CHECK_INNAME, m_bInname);
DDX_Check(pDX, IDC_CHECK_MEDNAME, m_bMedname);
DDX_Check(pDX, IDC_CHECK_OUTNAME, m_bOutname);
DDX_Text(pDX, IDC_EDIT_HOUSENAME, m_HouseName);
DDX_Check(pDX, IDC_CHECK_BSPNAME, m_bBSP);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgHouseLoad, CDialog)
//{{AFX_MSG_MAP(CDlgHouseLoad)
ON_BN_CLICKED(IDC_CHECK_OUTNAME, OnCheckOutname)
ON_BN_CLICKED(IDC_CHECK_MEDNAME, OnCheckMedname)
ON_BN_CLICKED(IDC_CHECK_INNAME, OnCheckInname)
ON_EN_CHANGE(IDC_EDIT_HOUSENAME, OnChangeEditHousename)
ON_BN_CLICKED(IDC_CHECK_BSPNAME, OnCheckBspname)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgHouseLoad message handlers
void CDlgHouseLoad::OnCheckOutname()
{
// TODO: Add your control notification handler code here
UpdateData();
CWnd* forrename=GetDlgItem(IDC_CHECK_OUTNAME);
if(m_bOutname)
{
CString strFilter = R3SFILE;
CFileDialog filedia(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.m_ofn.lpstrInitialDir=HOUSEOBJECTPATH;
filedia.DoModal();
CString filename=filedia.GetFileName();
if(filename!="")
{
forrename->SetWindowText(filename.LockBuffer());
m_strOutname=filename;
}
else
{
m_bOutname=FALSE;
}
}
else
{
forrename->SetWindowText("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
UpdateData(FALSE);
}
void CDlgHouseLoad::OnCheckMedname()
{
// TODO: Add your control notification handler code here
UpdateData();
CWnd* forrename=GetDlgItem(IDC_CHECK_MEDNAME);
if(m_bMedname)
{
CString strFilter = R3SFILE;
CFileDialog filedia(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.m_ofn.lpstrInitialDir=HOUSEOBJECTPATH;
filedia.DoModal();
CString filename=filedia.GetFileName();
if(filename!="")
{
forrename->SetWindowText(filename.LockBuffer());
m_strMedname=filename;
}
else
{
m_bMedname=FALSE;
}
}
else
{
forrename->SetWindowText("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
UpdateData(FALSE);
}
void CDlgHouseLoad::OnCheckInname()
{
// TODO: Add your control notification handler code here
UpdateData();
CWnd* forrename=GetDlgItem(IDC_CHECK_INNAME);
if(m_bInname)
{
CString strFilter = R3SFILE;
CFileDialog filedia(TRUE,HOUSEOBJECTPATH,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.m_ofn.lpstrInitialDir=HOUSEOBJECTPATH;
filedia.DoModal();
CString filename=filedia.GetFileName();
if(filename!="")
{
forrename->SetWindowText(filename.LockBuffer());
m_strInname=filename;
}
else
{
m_bInname=FALSE;
}
}
else
{
forrename->SetWindowText("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
UpdateData(FALSE);
}
void CDlgHouseLoad::OnChangeEditHousename()
{
UpdateData();
}
void CDlgHouseLoad::OnCheckBspname()
{
// TODO: Add your control notification handler code here
UpdateData();
CWnd* forrename=GetDlgItem(IDC_CHECK_BSPNAME);
if(m_bBSP)
{
CString strFilter = BSPFILE;
CFileDialog filedia(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.m_ofn.lpstrInitialDir=HOUSEOBJECTPATH;
filedia.DoModal();
CString filename=filedia.GetFileName();
if(filename!="")
{
forrename->SetWindowText(filename.LockBuffer());
m_strBSPName=filename;
}
else
{
m_bBSP=FALSE;
}
}
else
{
forrename->SetWindowText("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
UpdateData(FALSE);
}

View File

@@ -0,0 +1,56 @@
#if !defined(AFX_DLGHOUSELOAD_H__831D134F_20B3_4EF9_B132_82901B541D94__INCLUDED_)
#define AFX_DLGHOUSELOAD_H__831D134F_20B3_4EF9_B132_82901B541D94__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgHouseLoad.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgHouseLoad dialog
#include <BaseDataDefine.h>
class CDlgHouseLoad : public CDialog
{
// Construction
public:
CDlgHouseLoad(CWnd* pParent = NULL); // standard constructor
CString m_strInname,m_strOutname,m_strMedname,m_strBSPName;
// Dialog Data
//{{AFX_DATA(CDlgHouseLoad)
enum { IDD = IDD_DIALOG_HOUSELOAD };
BOOL m_bInname;
BOOL m_bMedname;
BOOL m_bOutname;
CString m_HouseName;
BOOL m_bBSP;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgHouseLoad)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgHouseLoad)
afx_msg void OnCheckOutname();
afx_msg void OnCheckMedname();
afx_msg void OnCheckInname();
afx_msg void OnChangeEditHousename();
afx_msg void OnCheckBspname();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGHOUSELOAD_H__831D134F_20B3_4EF9_B132_82901B541D94__INCLUDED_)

View File

@@ -0,0 +1,171 @@
// DlgLightLoad.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgLightLoad.h"
#include "SceneManager.h"
#include ".\dlglightload.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgLightLoad dialog
CDlgLightLoad::CDlgLightLoad(CWnd* pParent /*=NULL*/)
: CDialog(CDlgLightLoad::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgLightLoad)
m_bObjectName = FALSE;
m_strLightname = _T("");
m_fLightRange = 0.0f;
m_bExtLight = TRUE;
m_iLightSamples = 10;
m_iShadowSamples = 10;
m_ShadowFactors = 0.995f;
m_iAmbient = 16;
m_strEffect = _T("");
m_fExpose = 0.01f;
//}}AFX_DATA_INIT
m_cLightColor=0xffffffff;
m_bEditMode=false;
}
void CDlgLightLoad::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgLightLoad)
DDX_Control(pDX, IDC_CRL_LIGHTCOLOR, m_LightColor);
DDX_Check(pDX, IDC_CHECK_OBJECTFILENAME, m_bObjectName);
DDX_Text(pDX, IDC_EDIT_LIGHTNAME, m_strLightname);
DDX_Text(pDX, IDC_EDIT_LIGHTRANGE, m_fLightRange);
DDX_Check(pDX, IDC_CHECKEXT, m_bExtLight);
DDX_Text(pDX, IDC_LIGHTSAMPLES, m_iLightSamples);
DDX_Text(pDX, IDC_SHADOWSAMPLES, m_iShadowSamples);
DDX_Text(pDX, IDC_SHADOWFACTOR, m_ShadowFactors);
DDX_Text(pDX, IDC_AMBIENT, m_iAmbient);
DDX_Text(pDX, IDC_EDIT1, m_strEffect);
DDX_Text(pDX, IDC_EXPOSE, m_fExpose);
//}}AFX_DATA_MAP
DDX_ColourPicker(pDX, IDC_CRL_LIGHTCOLOR, m_cLightColor);
}
BEGIN_MESSAGE_MAP(CDlgLightLoad, CDialog)
//{{AFX_MSG_MAP(CDlgLightLoad)
ON_BN_CLICKED(IDC_CHECK_OBJECTFILENAME, OnCheckObjectfilename)
ON_BN_CLICKED(IDC_CHECKEXT, OnCheckext)
ON_BN_CLICKED(IDC_ESFBUTTON, OnEsfbutton)
//}}AFX_MSG_MAP
ON_EN_CHANGE(IDC_LIGHTSAMPLES, OnEnChangeLightsamples)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgLightLoad message handlers
void CDlgLightLoad::OnCheckObjectfilename()
{
// TODO: Add your control notification handler code here
UpdateData();
CWnd* forrename=GetDlgItem(IDC_CHECK_OBJECTFILENAME);
if(m_bObjectName)
{
CString strFilter = R3SFILE;
CFileDialog filedia(TRUE,LIGHTOBJECTPATH,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.m_ofn.lpstrInitialDir=LIGHTOBJECTPATH;
filedia.DoModal();
CString filename=filedia.GetFileName();
if(filename!="")
{
forrename->SetWindowText(filename.LockBuffer());
m_strObjectFilename=filename;
}
else
{
m_bObjectName=FALSE;
}
}
else
{
forrename->SetWindowText("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
UpdateData(FALSE);
}
void CDlgLightLoad::OnOK()
{
// TODO: Add extra validation here
UpdateData(TRUE);
if(m_bExtLight == FALSE)
{
if(m_bEditMode)
{
if(m_fLightRange==0.0f)
AfxMessageBox("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0.0m <20>Դϴ<D4B4>.");
else
{
vector3 vecAddLightPos=CSceneManager::m_pBspScene->m_HouseObject->m_pBspObject->m_EditLightList[CSceneManager::m_pBspScene->m_HouseObject->m_pBspObject->m_SelectLight].m_vecLightPos;
CSceneManager::m_pBspScene->m_HouseObject->m_pBspObject->DeleteLight();
color AddColor;
AddColor.a=0xff;
AddColor.r=GetRValue(m_cLightColor);
AddColor.g=GetGValue(m_cLightColor);
AddColor.b=GetBValue(m_cLightColor);
CSceneManager::m_pBspScene->m_HouseObject->m_pBspObject->AddLight(vecAddLightPos,m_fLightRange,AddColor);
CSceneManager::m_pBspScene->m_HouseObject->m_pBspObject->m_SelectLight=CSceneManager::m_pBspScene->m_HouseObject->m_pBspObject->m_EditLightList.num-1;
}
return;
}
if(m_strObjectFilename=="")
{
AfxMessageBox("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD≯<EFBFBD><CCB8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC><EFBFBD>");
return;
}
if(m_fLightRange==0.0f)
{
AfxMessageBox("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0.0m <20>Դϴ<D4B4>.");
return;
}
if(m_strLightname=="")
{
m_strLightname=m_strObjectFilename;
}
}
CDialog::OnOK();
}
void CDlgLightLoad::OnCheckext()
{
// TODO: Add your control notification handler code here
m_bExtLight = (m_bExtLight == TRUE) ? FALSE : TRUE;
UpdateData(FALSE);
}
void CDlgLightLoad::OnEsfbutton()
{
// TODO: Add your control notification handler code here
char str[] = "Esf <20><><EFBFBD><EFBFBD>(*.Esf) |*.Esf| <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(*.*)|*.*||";
CString strFilter = str;
CFileDialog filedia(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.DoModal();
m_strEffect = filedia.GetFileName();
UpdateData(FALSE);
}
void CDlgLightLoad::OnEnChangeLightsamples()
{
// TODO: RICHEDIT <20><>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD>
// CDialog::<3A><><EFBFBD><EFBFBD>ũ<EFBFBD><C5A9> OR <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ENM_CHANGE <20>÷<EFBFBD><C3B7>׸<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>Ͽ<EFBFBD>
// CRichEditCtrl().SetEventMask()<29><> ȣ<><C8A3><EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD> OnInitDialog() <20>Լ<EFBFBD><D4BC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
// <20><> <20>˸<EFBFBD><CBB8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʽ<EFBFBD><CABD>ϴ<EFBFBD>.
// TODO: <20><><EFBFBD><20><>Ʈ<EFBFBD><C6AE> <20>˸<EFBFBD> ó<><C3B3><EFBFBD><EFBFBD> <20>ڵ带 <20>߰<EFBFBD><DFB0>մϴ<D5B4>.
}

View File

@@ -0,0 +1,65 @@
#if !defined(AFX_DLGLIGHTLOAD_H__96D1D15E_0ECB_48B6_A18C_0570CD4F1705__INCLUDED_)
#define AFX_DLGLIGHTLOAD_H__96D1D15E_0ECB_48B6_A18C_0570CD4F1705__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgLightLoad.h : header file
//
#include "ColourPicker.h"
#include <BaseDataDefine.h>
/////////////////////////////////////////////////////////////////////////////
// CDlgLightLoad dialog
class CDlgLightLoad : public CDialog
{
// Construction
public:
CDlgLightLoad(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgLightLoad)
enum { IDD = IDD_DIALOG_LIGHTLOAD };
CColourPicker m_LightColor;
BOOL m_bObjectName;
CString m_strLightname;
float m_fLightRange;
BOOL m_bExtLight;
int m_iLightSamples;
int m_iShadowSamples;
float m_ShadowFactors;
int m_iAmbient;
CString m_strEffect;
float m_fExpose;
//}}AFX_DATA
COLORREF m_cLightColor;
CString m_strObjectFilename;
bool m_bEditMode;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgLightLoad)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgLightLoad)
afx_msg void OnCheckObjectfilename();
virtual void OnOK();
afx_msg void OnCheckext();
afx_msg void OnEsfbutton();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnEnChangeLightsamples();
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGLIGHTLOAD_H__96D1D15E_0ECB_48B6_A18C_0570CD4F1705__INCLUDED_)

View File

@@ -0,0 +1,69 @@
// DlgLightmap.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgLightmap.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgLightmap dialog
CDlgLightmap::CDlgLightmap(CWnd* pParent /*=NULL*/)
: CDialog(CDlgLightmap::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgLightmap)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDlgLightmap::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgLightmap)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgLightmap, CDialog)
//{{AFX_MSG_MAP(CDlgLightmap)
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgLightmap message handlers
void CDlgLightmap::Show()
{
SetWindowPos(&wndTopMost,m_StartDlgX,m_StartDlgY,0,0,SWP_NOSIZE|SWP_SHOWWINDOW);
}
void CDlgLightmap::Hide()
{
ShowWindow(SW_HIDE);
}
void CDlgLightmap::OnTimer(UINT nIDEvent)
{
// TODO: Add your message handler code here and/or call default
switch(nIDEvent)
{
case TIMER_SHOWLIGHTMAP:
break;
case TIMER_HIDELIGHTMAP:
break;
}
CDialog::OnTimer(nIDEvent);
}

View File

@@ -0,0 +1,55 @@
#if !defined(AFX_DLGLIGHTMAP_H__13F58355_08E9_45B3_9CE8_2463A1672DF1__INCLUDED_)
#define AFX_DLGLIGHTMAP_H__13F58355_08E9_45B3_9CE8_2463A1672DF1__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgLightmap.h : header file
//
#define TIMER_SHOWLIGHTMAP 1001
#define TIMER_HIDELIGHTMAP 1002
/////////////////////////////////////////////////////////////////////////////
// CDlgLightmap dialog
class CDlgLightmap : public CDialog
{
// Construction
public:
int m_StartDlgX,m_StartDlgY;
void SetStartDlg(int Dlgx,int Dlgy)
{
m_StartDlgX=Dlgx;
m_StartDlgY=Dlgy;
};
void Hide();
void Show();
CDlgLightmap(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgLightmap)
enum { IDD = IDD_DIALOG_MAKELIGHTMAP };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgLightmap)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgLightmap)
afx_msg void OnTimer(UINT nIDEvent);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGLIGHTMAP_H__13F58355_08E9_45B3_9CE8_2463A1672DF1__INCLUDED_)

View File

@@ -0,0 +1,229 @@
// DlgLightmapInfo.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgLightmapInfo.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgLightmapInfo dialog
CDlgLightmapInfo::CDlgLightmapInfo(CWnd* pParent /*=NULL*/)
: CDialog(CDlgLightmapInfo::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgLightmapInfo)
m_bDirectionLight = TRUE;
m_bGlobalShadow = FALSE;
m_bPointLight = TRUE;
m_bSkyLight = TRUE;
m_fDirectionLightRandValue = 0.1f;
m_iDirectionSampleCount = 10;
m_iSkySampleCount = 50;
m_fExposeValue = 0.0f;
m_fGlobalRandValue = 4.0f;
m_iGlobalSampleCount = 30;
m_fPointRandValue = 4.0f;
m_iPointSampleCount = 4;
m_bStart = false;
m_cSkyLightColor = 0xffFBD1BD;
m_cDirectionColor = 0xffffffff;
m_cAmbientColor = 0xff505050;
//}}AFX_DATA_INIT
m_iSelectedState = 0;
}
void CDlgLightmapInfo::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgLightmapInfo)
DDX_Control(pDX, IDC_LIST1, m_CtlListBox);
DDX_Control(pDX, IDC_BUTTON_SKYLIGHTCOLOR, m_SkyLightColor);
DDX_Control(pDX, IDC_BUTTON_DIRECTIONCOLOR, m_DirectionColor);
DDX_Control(pDX, IDC_BUTTON_AMBIENTCOLOR, m_AmbientColor);
DDX_ColourPicker(pDX, IDC_BUTTON_SKYLIGHTCOLOR, m_cSkyLightColor);
DDX_ColourPicker(pDX, IDC_BUTTON_DIRECTIONCOLOR, m_cDirectionColor);
DDX_ColourPicker(pDX, IDC_BUTTON_AMBIENTCOLOR, m_cAmbientColor);
DDX_Check(pDX, IDC_CHECK_DIRECTION, m_bDirectionLight);
DDX_Check(pDX, IDC_CHECK_GLOBALSHADOW, m_bGlobalShadow);
DDX_Check(pDX, IDC_CHECK_POINTLIGHT, m_bPointLight);
DDX_Check(pDX, IDC_CHECK_SKYLIGHT, m_bSkyLight);
DDX_Text(pDX, IDC_DIRECTIONRANDVALUE, m_fDirectionLightRandValue);
DDX_Text(pDX, IDC_DIRECTIONSAMPLECOUNT, m_iDirectionSampleCount);
DDX_Text(pDX, IDC_SKYSAMPLECOUNT, m_iSkySampleCount);
DDX_Text(pDX, IDC_EXPOSEVALUE, m_fExposeValue);
DDX_Text(pDX, IDC_GLOBALRANDVALUE, m_fGlobalRandValue);
DDX_Text(pDX, IDC_GLOBALSAMPLECOUNT, m_iGlobalSampleCount);
DDX_Text(pDX, IDC_POINTRANDVALUE, m_fPointRandValue);
DDX_Text(pDX, IDC_POINTSAMPLECOUNT, m_iPointSampleCount);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgLightmapInfo, CDialog)
//{{AFX_MSG_MAP(CDlgLightmapInfo)
ON_LBN_SELCHANGE(IDC_LIST1, OnSelchangeList1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgLightmapInfo message handlers
void CDlgLightmapInfo::OnOK()
{
// TODO: Add extra validation here
UpdateData();
BackupState(m_iSelectedState);
char strPath[256];
GetCurrentDirectory(256,strPath);
sprintf(strPath,"%s\\WorldCreatorLightmapInfo.dat",strPath);
FILE *fp = fopen(strPath,"wb+");
if(fp)
{
fwrite(m_State,sizeof(CLightmapInfoState)*10,1,fp);
fclose(fp);
}
m_bStart = true;
CDialog::OnOK();
}
void CDlgLightmapInfo::OnCancel()
{
// TODO: Add extra cleanup here
m_bStart = false;
char strPath[256];
GetCurrentDirectory(256,strPath);
sprintf(strPath,"%s\\WorldCreatorLightmapInfo.dat",strPath);
BackupState(m_iSelectedState);
FILE *fp = fopen(strPath,"wb+");
if(fp)
{
fwrite(m_State,sizeof(CLightmapInfoState)*10,1,fp);
fclose(fp);
}
CDialog::OnCancel();
}
/*
int CDlgLightmapInfo::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialog::OnCreate(lpCreateStruct) == -1)
return -1;
// TODO: Add your specialized creation code here
return 0;
}
BOOL CDlgLightmapInfo::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
return CDialog::Create(IDD, pParentWnd);
}
*/
void CDlgLightmapInfo::BackupState(int iState)
{
m_State[iState].m_bDirectionLight = m_bDirectionLight;
m_State[iState].m_bGlobalShadow = m_bGlobalShadow;
m_State[iState].m_bPointLight = m_bPointLight;
m_State[iState].m_bSkyLight = m_bSkyLight;
m_State[iState].m_cAmbientColor = m_cAmbientColor;
m_State[iState].m_cDirectionColor = m_cDirectionColor;
m_State[iState].m_cSkyLightColor = m_cSkyLightColor;
m_State[iState].m_fDirectionLightRandValue = m_fDirectionLightRandValue;
m_State[iState].m_fExposeValue = m_fExposeValue;
m_State[iState].m_fGlobalRandValue = m_fGlobalRandValue;
m_State[iState].m_fPointRandValue = m_fPointRandValue;
m_State[iState].m_iDirectionSampleCount = m_iDirectionSampleCount;
m_State[iState].m_iGlobalSampleCount = m_iGlobalSampleCount;
m_State[iState].m_iPointSampleCount = m_iPointSampleCount;
m_State[iState].m_iSkySampleCount = m_iSkySampleCount;
}
void CDlgLightmapInfo::SetState()
{
m_bDirectionLight = m_State[m_iSelectedState].m_bDirectionLight;
m_bGlobalShadow = m_State[m_iSelectedState].m_bGlobalShadow;
m_bPointLight = m_State[m_iSelectedState].m_bPointLight;
m_bSkyLight = m_State[m_iSelectedState].m_bSkyLight;
m_fDirectionLightRandValue = m_State[m_iSelectedState].m_fDirectionLightRandValue;
m_iDirectionSampleCount = m_State[m_iSelectedState].m_iDirectionSampleCount;
m_iSkySampleCount = m_State[m_iSelectedState].m_iSkySampleCount;
m_fExposeValue = m_State[m_iSelectedState].m_fExposeValue;
m_fGlobalRandValue = m_State[m_iSelectedState].m_fGlobalRandValue;
m_iGlobalSampleCount = m_State[m_iSelectedState].m_iGlobalSampleCount;
m_fPointRandValue = m_State[m_iSelectedState].m_fPointRandValue;
m_iPointSampleCount = m_State[m_iSelectedState].m_iPointSampleCount;
m_cSkyLightColor = m_State[m_iSelectedState].m_cSkyLightColor;
m_cDirectionColor = m_State[m_iSelectedState].m_cDirectionColor;
m_cAmbientColor = m_State[m_iSelectedState].m_cAmbientColor;
UpdateData(FALSE);
}
BOOL CDlgLightmapInfo::OnInitDialog()
{
CDialog::OnInitDialog();
char strPath[256];
GetCurrentDirectory(256,strPath);
sprintf(strPath,"%s\\WorldCreatorLightmapInfo.dat",strPath);
FILE *fp = fopen(strPath,"rb");
if(fp)
{
fread(m_State,sizeof(CLightmapInfoState)*10,1,fp);
fclose(fp);
}
// TODO: Add extra initialization here
char strList[256];
for(int i = 0; i < MAXLIST; i++ )
{
sprintf(strList,"State %d",i);
m_CtlListBox.AddString(strList);
}
m_iSelectedState = 0;
m_CtlListBox.SetCurSel(m_iSelectedState);
SetState();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgLightmapInfo::OnSelchangeList1()
{
// TODO: Add your control notification handler code here
UpdateData();
BackupState(m_iSelectedState);
m_iSelectedState = m_CtlListBox.GetCurSel();
SetState();
}

View File

@@ -0,0 +1,115 @@
#if !defined(AFX_DLGLIGHTMAPINFO_H__9B40ACD3_BC8D_4A1D_A7EA_A6796AAAE088__INCLUDED_)
#define AFX_DLGLIGHTMAPINFO_H__9B40ACD3_BC8D_4A1D_A7EA_A6796AAAE088__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgLightmapInfo.h : header file
//
#include "ColourPicker.h"
#define MAXLIST 10
/////////////////////////////////////////////////////////////////////////////
// CDlgLightmapInfo dialog
class CLightmapInfoState
{
public:
COLORREF m_cSkyLightColor;
COLORREF m_cDirectionColor;
COLORREF m_cAmbientColor;
BOOL m_bDirectionLight;
BOOL m_bGlobalShadow;
BOOL m_bPointLight;
BOOL m_bSkyLight;
float m_fDirectionLightRandValue;
int m_iDirectionSampleCount;
int m_iSkySampleCount;
float m_fExposeValue;
float m_fGlobalRandValue;
int m_iGlobalSampleCount;
float m_fPointRandValue;
int m_iPointSampleCount;
CLightmapInfoState()
{
m_bDirectionLight = TRUE;
m_bGlobalShadow = FALSE;
m_bPointLight = TRUE;
m_bSkyLight = TRUE;
m_fDirectionLightRandValue = 0.1f;
m_iDirectionSampleCount = 10;
m_iSkySampleCount = 50;
m_fExposeValue = 0.0f;
m_fGlobalRandValue = 4.0f;
m_iGlobalSampleCount = 30;
m_fPointRandValue = 4.0f;
m_iPointSampleCount = 4;
m_cSkyLightColor = 0xffFBD1BD;
m_cDirectionColor = 0xffffffff;
m_cAmbientColor = 0xff505050;
}
};
class CDlgLightmapInfo : public CDialog
{
// Construction
public:
bool m_bStart;
CDlgLightmapInfo(CWnd* pParent = NULL); // standard constructor
void SetState();
void BackupState(int iState);
// Dialog Data
//{{AFX_DATA(CDlgLightmapInfo)
enum { IDD = IDD_DIALOG_LIGHTMAP };
CListBox m_CtlListBox;
CColourPicker m_SkyLightColor;
CColourPicker m_DirectionColor;
CColourPicker m_AmbientColor;
COLORREF m_cSkyLightColor;
COLORREF m_cDirectionColor;
COLORREF m_cAmbientColor;
BOOL m_bDirectionLight;
BOOL m_bGlobalShadow;
BOOL m_bPointLight;
BOOL m_bSkyLight;
float m_fDirectionLightRandValue;
int m_iDirectionSampleCount;
int m_iSkySampleCount;
float m_fExposeValue;
float m_fGlobalRandValue;
int m_iGlobalSampleCount;
float m_fPointRandValue;
int m_iPointSampleCount;
//}}AFX_DATA
int m_iSelectedState;
CLightmapInfoState m_State[MAXLIST];
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgLightmapInfo)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgLightmapInfo)
virtual void OnOK();
virtual void OnCancel();
virtual BOOL OnInitDialog();
afx_msg void OnSelchangeList1();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGLIGHTMAPINFO_H__9B40ACD3_BC8D_4A1D_A7EA_A6796AAAE088__INCLUDED_)

View File

@@ -0,0 +1,161 @@
// DlgMakeFall.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgMakeFall.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgMakeFall dialog
CDlgMakeFall::CDlgMakeFall(CWnd* pParent /*=NULL*/)
: CDialog(CDlgMakeFall::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgMakeFall)
m_fFallAddX = 0.0f;
m_fFallHeight = 0.0f;
m_fFallLeft = 0.0f;
m_fFallPosX = 0.0f;
m_fFallPosY = 0.0f;
m_fFallRight = 0.0f;
m_fFallRot = 0.0f;
m_WaterFallAlpha = 0;
//}}AFX_DATA_INIT
}
void CDlgMakeFall::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgMakeFall)
DDX_Control(pDX, IDC_LIST_WATERFALL, m_WaterFallList);
DDX_Text(pDX, IDC_EDIT_FALLADDX, m_fFallAddX);
DDX_Text(pDX, IDC_EDIT_FALLHEIGHT, m_fFallHeight);
DDX_Text(pDX, IDC_EDIT_FALLLEFT, m_fFallLeft);
DDX_Text(pDX, IDC_EDIT_FALLPOSX, m_fFallPosX);
DDX_Text(pDX, IDC_EDIT_FALLPOSY, m_fFallPosY);
DDX_Text(pDX, IDC_EDIT_FALLRIGHT, m_fFallRight);
DDX_Text(pDX, IDC_EDIT_FALLROT, m_fFallRot);
DDX_Text(pDX, IDC_EDIT_WATERFALLALPHA, m_WaterFallAlpha);
DDX_Control(pDX, IDC_COLOR_WATERFALL, m_WaterFallColor);
DDV_MinMaxLong(pDX, m_WaterFallAlpha, 0, 255);
//}}AFX_DATA_MAP
DDX_ColourPicker(pDX, IDC_COLOR_WATERFALL, m_cWaterFallColor);
}
BEGIN_MESSAGE_MAP(CDlgMakeFall, CDialog)
//{{AFX_MSG_MAP(CDlgMakeFall)
ON_BN_CLICKED(IDC_BUTTON_FALLADD, OnButtonFalladd)
ON_BN_CLICKED(IDC_BUTTON_FALLEDIT, OnButtonFalledit)
ON_LBN_DBLCLK(IDC_LIST_WATERFALL, OnDblclkListWaterfall)
ON_EN_UPDATE(IDC_EDIT_FALLPOSX, OnUpdateEditFallposx)
ON_EN_UPDATE(IDC_EDIT_FALLPOSY, OnUpdateEditFallposy)
ON_EN_UPDATE(IDC_EDIT_FALLROT, OnUpdateEditFallrot)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgMakeFall message handlers
void CDlgMakeFall::OnButtonFalladd()
{
// TODO: Add your control notification handler code here
UpdateData();
m_FallAddXList.Add(m_fFallAddX);
m_FallLeftList.Add(m_fFallLeft);
m_FallRightList.Add(m_fFallRight);
m_FallHeightList.Add(m_fFallHeight);
color AddColor;
AddColor.r=GetRValue(m_cWaterFallColor);
AddColor.g=GetGValue(m_cWaterFallColor);
AddColor.b=GetBValue(m_cWaterFallColor);
AddColor.a=m_WaterFallAlpha;
m_FallColorList.Add(AddColor);
CString strAdd;
strAdd.Format(" %d WaterFall List",m_WaterFallList.GetCount());
m_WaterFallList.AddString(strAdd);
}
void CDlgMakeFall::OnButtonFalledit()
{
// TODO: Add your control notification handler code here
UpdateData();
int Sel=m_WaterFallList.GetCurSel();
if(Sel==-1)
return;
m_FallAddXList[Sel]=(m_fFallAddX);
m_FallLeftList[Sel]=(m_fFallLeft);
m_FallRightList[Sel]=(m_fFallRight);
m_FallHeightList[Sel]=(m_fFallHeight);
color AddColor;
AddColor.r=GetRValue(m_cWaterFallColor);
AddColor.g=GetGValue(m_cWaterFallColor);
AddColor.b=GetBValue(m_cWaterFallColor);
AddColor.a=m_WaterFallAlpha;
m_FallColorList[Sel]=AddColor;
}
void CDlgMakeFall::OnDblclkListWaterfall()
{
// TODO: Add your control notification handler code here
int Sel=m_WaterFallList.GetCurSel();
if(Sel==-1)
return;
m_fFallAddX=m_FallAddXList[Sel];
m_fFallLeft=m_FallLeftList[Sel];
m_fFallRight=m_FallRightList[Sel];
m_fFallHeight=m_FallHeightList[Sel];
m_cWaterFallColor=RGB(m_FallColorList[Sel].r,m_FallColorList[Sel].g,m_FallColorList[Sel].b);
m_WaterFallAlpha=m_FallColorList[Sel].a;
UpdateData(FALSE);
}
void CDlgMakeFall::OnUpdateEditFallposx()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function to send the EM_SETEVENTMASK message to the control
// with the ENM_UPDATE flag ORed into the lParam mask.
// TODO: Add your control notification handler code here
UpdateData();
}
void CDlgMakeFall::OnUpdateEditFallposy()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function to send the EM_SETEVENTMASK message to the control
// with the ENM_UPDATE flag ORed into the lParam mask.
// TODO: Add your control notification handler code here
UpdateData();
}
void CDlgMakeFall::OnUpdateEditFallrot()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function to send the EM_SETEVENTMASK message to the control
// with the ENM_UPDATE flag ORed into the lParam mask.
// TODO: Add your control notification handler code here
UpdateData();
}

View File

@@ -0,0 +1,66 @@
#if !defined(AFX_DLGMAKEFALL_H__30BE9EC4_0CE2_4F43_912C_7D418DE23565__INCLUDED_)
#define AFX_DLGMAKEFALL_H__30BE9EC4_0CE2_4F43_912C_7D418DE23565__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgMakeFall.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgMakeFall dialog
#include "ColourPicker.h"
class CDlgMakeFall : public CDialog
{
// Construction
public:
CDlgMakeFall(CWnd* pParent = NULL); // standard constructor
List<float> m_FallAddXList;
List<float> m_FallLeftList;
List<float> m_FallRightList;
List<float> m_FallHeightList;
List<color> m_FallColorList;
// Dialog Data
//{{AFX_DATA(CDlgMakeFall)
enum { IDD = IDD_DIALOG_WATERFALL };
CListBox m_WaterFallList;
float m_fFallAddX;
float m_fFallHeight;
float m_fFallLeft;
float m_fFallPosX;
float m_fFallPosY;
float m_fFallRight;
float m_fFallRot;
long m_WaterFallAlpha;
CColourPicker m_WaterFallColor;
//}}AFX_DATA
COLORREF m_cWaterFallColor;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgMakeFall)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgMakeFall)
afx_msg void OnButtonFalladd();
afx_msg void OnButtonFalledit();
afx_msg void OnDblclkListWaterfall();
afx_msg void OnUpdateEditFallposx();
afx_msg void OnUpdateEditFallposy();
afx_msg void OnUpdateEditFallrot();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGMAKEFALL_H__30BE9EC4_0CE2_4F43_912C_7D418DE23565__INCLUDED_)

View File

@@ -0,0 +1,190 @@
// DlgMakePlant.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgMakePlant.h"
#include "MainFrm.h"
#include "WorldCreatorView.h"
#include "RenderOption.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgMakePlant dialog
CDlgMakePlant::CDlgMakePlant(CWnd* pParent /*=NULL*/)
: CDialog(CDlgMakePlant::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgMakePlant)
m_isAdd = FALSE;
m_isDel = FALSE;
m_fTreeRange = 0.0f;
m_fTreeRate = 0.0f;
//}}AFX_DATA_INIT
}
void CDlgMakePlant::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgMakePlant)
DDX_Control(pDX, IDC_LIST_DRAWTREE, m_DrawTreeList);
DDX_Control(pDX, IDC_LIST_TREE, m_TreeList);
DDX_Check(pDX, IDC_CHECK_TREEADD, m_isAdd);
DDX_Check(pDX, IDC_CHECK_TREEDEL, m_isDel);
DDX_Text(pDX, IDC_EDIT_TREERANGE, m_fTreeRange);
DDV_MinMaxFloat(pDX, m_fTreeRange, 0.f, 30000.f);
DDX_Text(pDX, IDC_EDIT_TREERATE, m_fTreeRate);
DDV_MinMaxFloat(pDX, m_fTreeRate, 0.f, 1.f);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgMakePlant, CDialog)
//{{AFX_MSG_MAP(CDlgMakePlant)
ON_BN_CLICKED(IDC_CHECK_TREEADD, OnCheckTreeadd)
ON_BN_CLICKED(IDC_CHECK_TREEDEL, OnCheckTreedel)
ON_LBN_DBLCLK(IDC_LIST_TREE, OnDblclkListTree)
ON_LBN_DBLCLK(IDC_LIST_DRAWTREE, OnDblclkListDrawtree)
ON_EN_CHANGE(IDC_EDIT_TREERANGE, OnChangeEditTreerange)
ON_EN_CHANGE(IDC_EDIT_TREERATE, OnChangeEditTreerate)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgMakePlant message handlers
BOOL CDlgMakePlant::OnInitDialog()
{
CDialog::OnInitDialog();
m_isAdd=TRUE;
CString strAddTree;
//
char strPath[256];
GetCurrentDirectory(256,strPath);
char strTree[256] = {0};
if(!strcmp(CRenderOption::m_strBaseGraphicsDataPath,"Default"))
sprintf(strTree,"%s\\Objects\\NatureObject\\TreeInfo.txt",strPath);
else {
sprintf(strTree,"%s\\Objects\\NatureObject\\TreeInfo",strPath);
strcat(strTree,"_");
strcat(strTree,CRenderOption::m_strBaseGraphicsDataPath);
strcat(strTree,".txt");
}
FILE *fp=fopen(strTree,"r");
//
//FILE *fp=fopen("C:\\MP-Project\\Objects\\NatureObject\\TreeInfo.txt","r");
if(fp)
{
for(int i=0;i<MAX_TREEKIND;i++)
{
char strTreeName[256];
fscanf(fp,"%s",strTreeName);
m_TreeList.AddString(strTreeName);
}
}
else
{
for(int i=0;i<MAX_TREEKIND;i++)
{
strAddTree.Format("<EFBFBD><EFBFBD><EFBFBD><EFBFBD> %d",i);
m_TreeList.AddString(strAddTree);
}
}
m_fTreeRange=500.0f;
m_fTreeRate=0.7f;
UpdateData(FALSE);
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgMakePlant::OnCheckTreeadd()
{
// TODO: Add your control notification handler code here
UpdateData();
if(m_isAdd)
{
CMainFrame *mf=(CMainFrame*)AfxGetApp()->m_pMainWnd;
CWorldCreatorView *av=(CWorldCreatorView *)mf->GetActiveView();
av->m_MouseInterface=50;
m_isDel=FALSE;
}
UpdateData(FALSE);
}
void CDlgMakePlant::OnCheckTreedel()
{
// TODO: Add your control notification handler code here
UpdateData();
if(m_isDel)
{
CMainFrame *mf=(CMainFrame*)AfxGetApp()->m_pMainWnd;
CWorldCreatorView *av=(CWorldCreatorView *)mf->GetActiveView();
av->m_MouseInterface=51;
m_isAdd=FALSE;
}
UpdateData(FALSE);
}
void CDlgMakePlant::OnOK()
{
// TODO: Add extra validation here
CMainFrame *mf=(CMainFrame*)AfxGetApp()->m_pMainWnd;
CWorldCreatorView *av=(CWorldCreatorView *)mf->GetActiveView();
av->m_MouseInterface=-1;
CDialog::OnOK();
}
void CDlgMakePlant::OnDblclkListTree()
{
// TODO: Add your control notification handler code here
long TreeKind=m_TreeList.GetCurSel();
CString strAddTree;
strAddTree.Format("%d",TreeKind);
m_DrawTreeList.AddString(strAddTree);
}
void CDlgMakePlant::OnDblclkListDrawtree()
{
// TODO: Add your control notification handler code here
long TreeKind=m_DrawTreeList.GetCurSel();
m_DrawTreeList.DeleteString(TreeKind);
}
void CDlgMakePlant::OnChangeEditTreerange()
{
UpdateData();
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
}
void CDlgMakePlant::OnChangeEditTreerate()
{
UpdateData();
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
}

View File

@@ -0,0 +1,60 @@
#if !defined(AFX_DLGMAKEPLANT_H__7DEC34C9_868E_4E9B_A706_AFC72BD14EE2__INCLUDED_)
#define AFX_DLGMAKEPLANT_H__7DEC34C9_868E_4E9B_A706_AFC72BD14EE2__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgMakePlant.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgMakePlant dialog
#include "SectorDefine.h"
class CDlgMakePlant : public CDialog
{
// Construction
public:
CDlgMakePlant(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgMakePlant)
enum { IDD = IDD_DIALOG_EDITPLANT };
CListBox m_DrawTreeList;
CListBox m_TreeList;
BOOL m_isAdd;
BOOL m_isDel;
float m_fTreeRange;
float m_fTreeRate;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgMakePlant)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgMakePlant)
virtual BOOL OnInitDialog();
afx_msg void OnCheckTreeadd();
afx_msg void OnCheckTreedel();
virtual void OnOK();
afx_msg void OnDblclkListTree();
afx_msg void OnDblclkListDrawtree();
afx_msg void OnChangeEditTreerange();
afx_msg void OnChangeEditTreerate();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGMAKEPLANT_H__7DEC34C9_868E_4E9B_A706_AFC72BD14EE2__INCLUDED_)

View File

@@ -0,0 +1,200 @@
// DlgMakeWater.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgMakeWater.h"
#include "MainFrm.h"
#include "WorldCreatorView.h"
#include "SectorDefine.h"
#include ".\dlgmakewater.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgMakeWater dialog
CDlgMakeWater::CDlgMakeWater(CWnd* pParent /*=NULL*/)
: CDialog(CDlgMakeWater::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgMakeWater)
m_fWaterHeight = 0.0f;
m_fWaterPosX = 0.0f;
m_fWaterPosY = 0.0f;
m_fWaterSizeX = 0.0f;
m_fWaterSizeY = 0.0f;
m_bWaterRelection = FALSE;
m_AlphaWater = 0;
//}}AFX_DATA_INIT
}
void CDlgMakeWater::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgMakeWater)
DDX_Text(pDX, IDC_EDIT_WATERHEIGHT, m_fWaterHeight);
DDX_Text(pDX, IDC_EDIT_WATERPOSX, m_fWaterPosX);
DDX_Text(pDX, IDC_EDIT_WATERPOSY, m_fWaterPosY);
DDX_Text(pDX, IDC_EDIT_WATERSIZEX, m_fWaterSizeX);
DDX_Text(pDX, IDC_EDIT_WATERSIZEY, m_fWaterSizeY);
DDX_Check(pDX, IDC_CHECK_WATERRELECTION, m_bWaterRelection);
DDX_Control(pDX, IDC_COLOR_WATER, m_WaterColor);
DDX_Text(pDX, IDC_EDIT_WATERALPHA, m_AlphaWater);
DDV_MinMaxUInt(pDX, m_AlphaWater, 0, 255);
//}}AFX_DATA_MAP
DDX_ColourPicker(pDX, IDC_COLOR_WATER, m_cWaterColor);
}
BEGIN_MESSAGE_MAP(CDlgMakeWater, CDialog)
//{{AFX_MSG_MAP(CDlgMakeWater)
ON_BN_CLICKED(IDC_BUTTON_WATERRESET, OnButtonWaterreset)
ON_EN_CHANGE(IDC_EDIT_WATERHEIGHT, OnChangeEditWaterheight)
ON_EN_CHANGE(IDC_EDIT_WATERPOSX, OnChangeEditWaterposx)
ON_EN_CHANGE(IDC_EDIT_WATERPOSY, OnChangeEditWaterposy)
ON_EN_CHANGE(IDC_EDIT_WATERSIZEX, OnChangeEditWatersizex)
ON_EN_CHANGE(IDC_EDIT_WATERSIZEY, OnChangeEditWatersizey)
ON_BN_CLICKED(IDC_CHECK_WATERRELECTION, OnCheckWaterrelection)
ON_EN_CHANGE(IDC_EDIT_WATERALPHA, OnChangeEditWateralpha)
//}}AFX_MSG_MAP
ON_BN_CLICKED(IDOK, OnBnClickedOk)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgMakeWater message handlers
BOOL CDlgMakeWater::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
switch(pMsg->message)
{
case WM_KEYDOWN:
if(pMsg->wParam==VK_ESCAPE || pMsg->wParam==VK_RETURN)
return 0L;
}
return CDialog::PreTranslateMessage(pMsg);
}
BOOL CDlgMakeWater::OnInitDialog()
{
CDialog::OnInitDialog();
m_fWaterSizeX=SECTORSIZE;
m_fWaterSizeY=SECTORSIZE;
m_fWaterPosX=0.0f;
m_fWaterPosY=0.0f;
m_fWaterHeight=3000.0f;
UpdateData(FALSE);
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgMakeWater::OnOK()
{
// TODO: Add extra validation here
CMainFrame *mf=(CMainFrame*)AfxGetApp()->m_pMainWnd;
CWorldCreatorView *av=(CWorldCreatorView *)mf->GetActiveView();
av->m_MouseInterface=-1;
CDialog::OnOK();
}
void CDlgMakeWater::OnButtonWaterreset()
{
// TODO: Add your control notification handler code here
m_fWaterSizeX=SECTORSIZE;
m_fWaterSizeY=SECTORSIZE;
m_fWaterPosX=0.0f;
m_fWaterPosY=0.0f;
m_fWaterHeight=3000.0f;
UpdateData(FALSE);
}
void CDlgMakeWater::OnChangeEditWaterheight()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData();
}
void CDlgMakeWater::OnChangeEditWaterposx()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData();
}
void CDlgMakeWater::OnChangeEditWaterposy()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData();
}
void CDlgMakeWater::OnChangeEditWatersizex()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData();
}
void CDlgMakeWater::OnChangeEditWatersizey()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData();
}
void CDlgMakeWater::OnCheckWaterrelection()
{
// TODO: Add your control notification handler code here
UpdateData();
}
void CDlgMakeWater::OnChangeEditWateralpha()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData();
}
void CDlgMakeWater::OnBnClickedOk()
{
// TODO: <20><><EFBFBD><20><>Ʈ<EFBFBD><C6AE> <20>˸<EFBFBD> ó<><C3B3><EFBFBD><EFBFBD> <20>ڵ带 <20>߰<EFBFBD><DFB0>մϴ<D5B4>.
OnOK();
}

View File

@@ -0,0 +1,67 @@
#if !defined(AFX_DLGMAKEWATER_H__1D1028CD_DD9C_4E82_AD18_63185087932F__INCLUDED_)
#define AFX_DLGMAKEWATER_H__1D1028CD_DD9C_4E82_AD18_63185087932F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgMakeWater.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgMakeWater dialog
#include "ColourPicker.h"
class CDlgMakeWater : public CDialog
{
// Construction
public:
CDlgMakeWater(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgMakeWater)
enum { IDD = IDD_DIALOG_WATER };
float m_fWaterHeight;
float m_fWaterPosX;
float m_fWaterPosY;
float m_fWaterSizeX;
float m_fWaterSizeY;
BOOL m_bWaterRelection;
CColourPicker m_WaterColor;
UINT m_AlphaWater;
//}}AFX_DATA
COLORREF m_cWaterColor;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgMakeWater)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgMakeWater)
virtual BOOL OnInitDialog();
virtual void OnOK();
afx_msg void OnButtonWaterreset();
afx_msg void OnChangeEditWaterheight();
afx_msg void OnChangeEditWaterposx();
afx_msg void OnChangeEditWaterposy();
afx_msg void OnChangeEditWatersizex();
afx_msg void OnChangeEditWatersizey();
afx_msg void OnCheckWaterrelection();
afx_msg void OnChangeEditWateralpha();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedOk();
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGMAKEWATER_H__1D1028CD_DD9C_4E82_AD18_63185087932F__INCLUDED_)

View File

@@ -0,0 +1,504 @@
// DlgMapFileInfo.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgMapFileInfo.h"
#include "BaseDataDefine.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgMapFileInfo dialog
CDlgMapFileInfo::CDlgMapFileInfo(CWnd* pParent /*=NULL*/)
: CDialog(CDlgMapFileInfo::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgMapFileInfo)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDlgMapFileInfo::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgMapFileInfo)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgMapFileInfo, CDialog)
//{{AFX_MSG_MAP(CDlgMapFileInfo)
ON_BN_CLICKED(IDC_BUTTON_DELFILE, OnButtonDelfile)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgMapFileInfo message handlers
void CDlgMapFileInfo::OnButtonDelfile()
{
// TODO: Add your control notification handler code here
char strPath[256];
GetCurrentDirectory(256,strPath);
sprintf(strPath,"%s\\Zone_01.z3s",strPath);
FindUsedFileList(strPath);
}
void CDlgMapFileInfo::FindUsedFileList(char *strFilename)
{
FILE *fp=fopen(strFilename,"rb");
if(fp==NULL)
return;
char strRead[256];
fread(strRead,sizeof(char)*256,1,fp);
long ReadTemp;
fread(&ReadTemp,sizeof(long),1,fp);
fread(&ReadTemp,sizeof(long),1,fp);
fread(&ReadTemp,sizeof(long),1,fp);
fread(&ReadTemp,sizeof(long),1,fp);
int cSavedHeightData=0;
fread(&cSavedHeightData,sizeof(int),1,fp);
for(int cHeightData=0;cHeightData<cSavedHeightData;cHeightData++)
{
int ReadIndex;
float ReadHeight[SECTORSX*SECTORSY];
fread(&ReadIndex,sizeof(int),1,fp);
fread(&ReadIndex,sizeof(int),1,fp);
fread(ReadHeight,sizeof(float)*SECTORSX*SECTORSY,1,fp);
}
int cSavedWaterData=0;
fread(&cSavedWaterData,sizeof(int),1,fp);
for(int cWaterData=0;cWaterData<cSavedWaterData;cWaterData++)
{
int ReadIndex;
float fReadPos;
bool bReadBool;
color cRead;
fread(&ReadIndex,sizeof(int),1,fp);
fread(&ReadIndex,sizeof(int),1,fp);
fread(&fReadPos,sizeof(float),1,fp);
fread(&fReadPos,sizeof(float),1,fp);
fread(&fReadPos,sizeof(float),1,fp);
fread(&fReadPos,sizeof(float),1,fp);
fread(&fReadPos,sizeof(float),1,fp);
fread(&bReadBool,sizeof(bool),1,fp);
fread(&cRead,sizeof(color),1,fp);
}
int cSavedWideData=0;
fread(&cSavedWideData,sizeof(int),1,fp);
for(int cWideData=0;cWideData<cSavedWideData;cWideData++)
{
int ReadIndex;
char ReadName[256];
fread(&ReadIndex,sizeof(int),1,fp);
fread(&ReadIndex,sizeof(int),1,fp);
fread(ReadName,sizeof(char)*256,1,fp);//<2F><><EFBFBD><EFBFBD>
CString strUsedFilename;
strUsedFilename.Format("%s\\%s",WIDETEXTUREPATH,ReadName);
m_UsedTextureFileList.AddUnique(strUsedFilename);
}
int cSavedFallData=0;
fread(&cSavedFallData,sizeof(int),1,fp);
for(int cFallData=0;cFallData<cSavedFallData;cFallData++)
{
int ReadIndex;
int fReadPos;
fread(&ReadIndex,sizeof(int),1,fp);
fread(&ReadIndex,sizeof(int),1,fp);
fread(&fReadPos,sizeof(float),1,fp);
fread(&fReadPos,sizeof(float),1,fp);
fread(&fReadPos,sizeof(float),1,fp);
int cSavedFallList;
fread(&cSavedFallList,sizeof(int),1,fp);
for(int cFallList=0;cFallList<cSavedFallList;cFallList++)
{
float ReadFallData;
color ReadFallColor;
fread(&ReadFallData,sizeof(float),1,fp);
fread(&ReadFallData,sizeof(float),1,fp);
fread(&ReadFallData,sizeof(float),1,fp);
fread(&ReadFallData,sizeof(float),1,fp);
fread(&ReadFallColor,sizeof(color),1,fp);
}
}
int cSavedHouseData=0;
fread(&cSavedHouseData,sizeof(int),1,fp);
for(int cHouseData=0;cHouseData<cSavedHouseData;cHouseData++)
{
int ReadIndex;
int fReadPos;
fread(&ReadIndex,sizeof(int),1,fp);
fread(&ReadIndex,sizeof(int),1,fp);
int cSavedHouseList=0;
fread(&cSavedHouseList,sizeof(int),1,fp);
for(int cHouseList=0;cHouseList<cSavedHouseList;cHouseList++)
{
int ReadHouseID;
char ReadHouseName[256];
matrix ReadHouseTM;
fread(&ReadHouseTM,sizeof(matrix),1,fp);
fread(&ReadHouseID,sizeof(int),1,fp);
fread(ReadHouseName,sizeof(char)*256,1,fp);
CString strUsedFilename;
strUsedFilename.Format("%s%s",HOUSEOBJECTPATH,ReadHouseName);
m_UsedR3SFileList.AddUnique(strUsedFilename);
CString strLightmapFile;
strLightmapFile.Format("%s\\%s",LIGHTMAPTEXTUREPATH,ReadHouseName);
int nPos=strLightmapFile.Find(".",0);
strLightmapFile=strLightmapFile.Left(nPos);
strLightmapFile+=".dds";
FILE *fpLightmap=fopen(strLightmapFile.LockBuffer(),"r");
if(fpLightmap)
{
m_UsedTextureFileList.AddUnique(strLightmapFile);
fclose(fpLightmap);
}
CString strLodUsedFile;
strLodUsedFile=strUsedFilename;
nPos=strLodUsedFile.Find(".",0);
strLodUsedFile=strLodUsedFile.Left(nPos);
strLodUsedFile+="_lod.r3s";
FILE *fpLod=fopen(strLodUsedFile.LockBuffer(),"r");
if(fpLod)
{
m_UsedR3SFileList.AddUnique(strLodUsedFile);
fclose(fpLod);
}
else
{
}
fread(ReadHouseName,sizeof(char)*256,1,fp);
if(strcmp(ReadHouseName,"")!=0)
{
strUsedFilename.Format("%s%s",HOUSEOBJECTPATH,ReadHouseName);
m_UsedR3SFileList.AddUnique(strUsedFilename);
}
fread(ReadHouseName,sizeof(char)*256,1,fp);
if(strcmp(ReadHouseName,"")!=0)
{
strUsedFilename.Format("%s%s",HOUSEOBJECTPATH,ReadHouseName);
m_UsedR3SFileList.AddUnique(strUsedFilename);
}
}
}
int cSavedInHouseData=0;
fread(&cSavedInHouseData,sizeof(int),1,fp);
for(int cInHouseData=0;cInHouseData<cSavedInHouseData;cInHouseData++)
{
char ReadHouseName[256];
fread(ReadHouseName,sizeof(char)*256,1,fp);
fread(ReadHouseName,sizeof(char)*256,1,fp);
fread(ReadHouseName,sizeof(char)*256,1,fp);
int cSavedObject,cSavedLight;
fread(&cSavedObject,sizeof(int),1,fp);
for(int cObject=0;cObject<cSavedObject;cObject++)
{
matrix ReadObjectTM;
bool ReadAlpha,ReadLight;
long ReadObjectID;
char ReadObjectName[256];
fread(ReadObjectName,sizeof(char)*256,1,fp);
CString strUsedFilename;
strUsedFilename.Format("%s%s",OBJECTPATH,ReadObjectName);
m_UsedR3SFileList.AddUnique(strUsedFilename);
fread(&ReadObjectID,sizeof(long),1,fp);
fread(&ReadObjectTM,sizeof(matrix),1,fp);
fread(&ReadAlpha,sizeof(bool),1,fp);
fread(&ReadLight,sizeof(bool),1,fp);
}
fread(&cSavedLight,sizeof(int),1,fp);
for(int cLight=0;cLight<cSavedLight;cLight++)
{
matrix ReadLightTM;
float ReadLightRange;
color ReadLightColor;
long ReadLightID;
char ReadLightName[256];
fread(ReadLightName,sizeof(char)*256,1,fp);
CString strUsedFilename;
strUsedFilename.Format("%s%s",OBJECTPATH,ReadLightName);
m_UsedR3SFileList.AddUnique(strUsedFilename);
fread(&ReadLightID,sizeof(long),1,fp);
fread(&ReadLightTM,sizeof(matrix),1,fp);
fread(&ReadLightRange,sizeof(float),1,fp);
fread(&ReadLightColor,sizeof(color),1,fp);
}
}
int cSavedPlantData=0;
fread(&cSavedPlantData,sizeof(int),1,fp);
for(int cPlantData=0;cPlantData<cSavedPlantData;cPlantData++)
{
int Index;
fread(&Index,sizeof(int),1,fp);
fread(&Index,sizeof(int),1,fp);
int cSavedSubPlant;
int ReadKind;
unsigned char ReadPosX,ReadPosZ;
fread(&cSavedSubPlant,sizeof(int),1,fp);
for(int cSubPlant=0;cSubPlant<cSavedSubPlant;cSubPlant++)
{
fread(&ReadKind,sizeof(unsigned char),1,fp);
fread(&ReadPosX,sizeof(unsigned char),1,fp);
fread(&ReadPosZ,sizeof(unsigned char),1,fp);
}
}
int cSavedMeshData=0;
fread(&cSavedMeshData,sizeof(int),1,fp);
for(int cMeshData=0;cMeshData<cSavedMeshData;cMeshData++)
{
int Index;
fread(&Index,sizeof(int),1,fp);
fread(&Index,sizeof(int),1,fp);
int cSavedObject=0;
fread(&cSavedObject,sizeof(int),1,fp);
int ReadObjectSceneID;
matrix ReadMatrixTM;
bool ReadAlpha,ReadLight;
for(int cObject=0;cObject<cSavedObject;cObject++)
{
fread(&ReadObjectSceneID,sizeof(long),1,fp);
char ReadObjectName[256];
fread(ReadObjectName,sizeof(char)*256,1,fp);
CString strUsedFilename;
strUsedFilename.Format("%s%s",OBJECTPATH,ReadObjectName);
m_UsedR3SFileList.AddUnique(strUsedFilename);
fread(&ReadMatrixTM,sizeof(matrix),1,fp);
fread(&ReadAlpha,sizeof(bool),1,fp);
fread(&ReadLight,sizeof(bool),1,fp);
}
}
fclose(fp);
char strPath[256];
GetCurrentDirectory(256,strPath);
char strFileName[256];
sprintf(strFileName,"%s\\Objects\\NatureObject\\NormalTree1.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
sprintf(strFileName,"%s\\Objects\\NatureObject\\NormalTree2.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
sprintf(strFileName,"%s\\Objects\\NatureObject\\NormalTree3.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
sprintf(strFileName,"%s\\Objects\\NatureObject\\NormalTree4.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
sprintf(strFileName,"%s\\Objects\\NatureObject\\NormalTree5.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
sprintf(strFileName,"%s\\Objects\\NatureObject\\NormalTree6.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
sprintf(strFileName,"%s\\Objects\\NatureObject\\NormalTree7.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
sprintf(strFileName,"%s\\Objects\\NatureObject\\NormalTree8.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
sprintf(strFileName,"%s\\Objects\\NatureObject\\NormalTree9.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
sprintf(strFileName,"%s\\Objects\\NatureObject\\NormalTree10.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
sprintf(strFileName,"%s\\Objects\\NatureObject\\NormalTree11.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
sprintf(strFileName,"%s\\Objects\\NatureObject\\NormalTree12.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
sprintf(strFileName,"%s\\Objects\\NatureObject\\NormalTree13.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
sprintf(strFileName,"%s\\Objects\\NatureObject\\NormalTree14.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
sprintf(strFileName,"%s\\Objects\\NatureObject\\NormalTree15.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
sprintf(strFileName,"%s\\Objects\\NatureObject\\NormalTree16.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
sprintf(strFileName,"%s\\Objects\\NatureObject\\grass_group01.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
sprintf(strFileName,"%s\\Objects\\NatureObject\\grass_group02.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
sprintf(strFileName,"%s\\Objects\\NatureObject\\grass01.R3S",strPath);
m_UsedR3SFileList.AddUnique(strFileName);
MakeObjectUsedTextureFileList();
DeleteFile();
}
void CDlgMapFileInfo::MakeObjectUsedTextureFileList()
{
/*
char ORIGINALTEXUTREINTERFACEPATH[256]="c:\\MP-Project\\RawTexture\\Interface";
char ORIGINALTEXUTRELIGHTMAPPATH[256]="c:\\MP-Project\\RawTexture\\Lightmap";
char ORIGINALTEXUTRENATUREPATH[256]="c:\\MP-Project\\RawTexture\\NatureObject";
char ORIGINALTEXTUREOBJECTPATH[256]="c:\\MP-Project\\RawTexture\\Object";
char ORIGINALTEXTURETERRAINPATH[256]="c:\\MP-Project\\RawTexture\\Terrain";
char ORIGINALTEXTUREWIDEPATH[256]="c:\\MP-Project\\RawTexture\\WideTexture";
char ORIGINALTEXTUREFXPATH[256]="c:\\MP-Project\\Texture\\FX";
/*
char TERRAINTEXTUREPATH[256]="c:\\MP-project\\Texture\\Terrain";
char OBJECTTEXTUREPATH[256]="c:\\MP-Project\\Texture\\Object";
char NATURETEXTUREPATH[256]="c:\\MP-project\\Texture\\NatureObject";
char WIDETEXTUREPATH[256]="C:\\MP-Project\\Texture\\WideTexture";
char INTERFACETEXTUREPATH[256]="c:\\MP-Project\\Texture\\Interface";
char FXTEXTUREPATH[256]="c:\\MP-Project\\Texture\\FX";
char BSPTEXTUREPATH[256]="c:\\MP-Project\\Texture\\BSP";
DeleteFile
*/
for(int i=0;i<m_UsedR3SFileList.num;i++)
{
FILE *fp=fopen(m_UsedR3SFileList[i].LockBuffer(),"rb");
int nObject,nMat,nTextureSize;
fread(&nObject,sizeof(float),1,fp);
fread(&nMat,sizeof(float),1,fp);
fread(&nTextureSize,sizeof(float),1,fp);
char strTextureName[256];
for(int cTexture=0;cTexture<nMat;cTexture++)
{
fread(strTextureName,sizeof(char)*256,1,fp);
if(strcmp(strTextureName,"")==0)
continue;
CString strFilename;
strFilename.Format("%s\\%s",OBJECTTEXTUREPATH,strTextureName);
int nPos=strFilename.Find(".",0);
strFilename=strFilename.Left(nPos);
strFilename+=".dds";
m_UsedTextureFileList.AddUnique(strFilename);
}
fclose(fp);
}
}
void CDlgMapFileInfo::DeleteFile()
{
List<CString> FileList;
List<CString> TextureList;
WIN32_FIND_DATA wfd = {0};
char strPath[256];
GetCurrentDirectory(256,strPath);
char filename[256];
sprintf(filename,"%s\\Objects\\House\\*.*",strPath);
HANDLE hFind = FindFirstFile(filename, &wfd);
if(INVALID_HANDLE_VALUE == hFind)
return;
CString strFilePathname;
while(1)
{
strFilePathname.Format("%s%s",filename,wfd.cFileName);
FileList.Add(strFilePathname);
if(FindNextFile(hFind, &wfd)==FALSE)
break;
}
sprintf(filename,"%s\\Objects\\Object\\*.*",strPath);
hFind = FindFirstFile(filename, &wfd);
while(1)
{
strFilePathname.Format("%s%s",filename,wfd.cFileName);
FileList.Add(strFilePathname);
if(FindNextFile(hFind, &wfd)==FALSE)
break;
}
sprintf(filename,"%s\\Texture\\WideTexture\\*.*",strPath);
hFind = FindFirstFile(filename, &wfd);
while(1)
{
strFilePathname.Format("%s%s",filename,wfd.cFileName);
FileList.Add(strFilePathname);
if(FindNextFile(hFind, &wfd)==FALSE)
break;
}
sprintf(filename,"%s\\Texture\\Lightmap\\*.*",strPath);
hFind = FindFirstFile(filename, &wfd);
while(1)
{
strFilePathname.Format("%s%s",filename,wfd.cFileName);
FileList.Add(strFilePathname);
if(FindNextFile(hFind, &wfd)==FALSE)
break;
}
sprintf(filename,"%s\\Texture\\Object\\*.*",strPath);
hFind = FindFirstFile(filename, &wfd);
while(1)
{
strFilePathname.Format("%s%s",filename,wfd.cFileName);
FileList.Add(strFilePathname);
if(FindNextFile(hFind, &wfd)==FALSE)
break;
}
for(int i=0;i<FileList.num;i++)
FileList[i].MakeLower();
for(i=0;i<m_UsedR3SFileList.num;i++)
m_UsedR3SFileList[i].MakeLower();
for(i=0;i<m_UsedTextureFileList.num;i++)
m_UsedTextureFileList[i].MakeLower();
int cDel=0;
int c=0;
for(i=0;i<FileList.num;i++)
{
bool bFound=false;
for(int cObject=0;cObject<m_UsedR3SFileList.num && !bFound;cObject++)
{
if(m_UsedR3SFileList[cObject]==FileList[i])
{
bFound=true;
}
}
for(int cTexture=0;cTexture<m_UsedTextureFileList.num && !bFound;cTexture++)
{
if(m_UsedTextureFileList[cTexture]==FileList[i])
bFound=true;
}
if(!bFound)
{
remove(FileList[i].LockBuffer());
}
else
{
}
}
}

View File

@@ -0,0 +1,52 @@
#if !defined(AFX_DLGMAPFILEINFO_H__BE307347_AD3E_4A3F_82B1_D4F781C8116C__INCLUDED_)
#define AFX_DLGMAPFILEINFO_H__BE307347_AD3E_4A3F_82B1_D4F781C8116C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgMapFileInfo.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgMapFileInfo dialog
#include "List.h"
#include "SectorHeightMap.h"
class CDlgMapFileInfo : public CDialog
{
// Construction
public:
void DeleteFile();
void MakeObjectUsedTextureFileList();
void FindUsedFileList(char *strFilename);
CDlgMapFileInfo(CWnd* pParent = NULL); // standard constructor
List<CString> m_UsedTextureFileList;
List<CString> m_UsedR3SFileList;
// Dialog Data
//{{AFX_DATA(CDlgMapFileInfo)
enum { IDD = IDD_DIALOG_GARBEGEDEL };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgMapFileInfo)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgMapFileInfo)
afx_msg void OnButtonDelfile();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGMAPFILEINFO_H__BE307347_AD3E_4A3F_82B1_D4F781C8116C__INCLUDED_)

View File

@@ -0,0 +1,43 @@
// DlgNPC.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgNPC.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgNPC dialog
CDlgNPC::CDlgNPC(CWnd* pParent /*=NULL*/)
: CDialog(CDlgNPC::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgNPC)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDlgNPC::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgNPC)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgNPC, CDialog)
//{{AFX_MSG_MAP(CDlgNPC)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgNPC message handlers

View File

@@ -0,0 +1,46 @@
#if !defined(AFX_DLGNPC_H__3B8AF496_1893_4BA7_903E_EF4340DC1A44__INCLUDED_)
#define AFX_DLGNPC_H__3B8AF496_1893_4BA7_903E_EF4340DC1A44__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgNPC.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgNPC dialog
class CDlgNPC : public CDialog
{
// Construction
public:
CDlgNPC(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgNPC)
enum { IDD = IDD_DIALOG_ACTOR };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgNPC)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgNPC)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGNPC_H__3B8AF496_1893_4BA7_903E_EF4340DC1A44__INCLUDED_)

View File

@@ -0,0 +1,95 @@
// DlgObjectLoad.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgObjectLoad.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgObjectLoad dialog
CDlgObjectLoad::CDlgObjectLoad(CWnd* pParent /*=NULL*/)
: CDialog(CDlgObjectLoad::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgObjectLoad)
m_bObjectLoad = FALSE;
m_strObjectName = _T("");
m_isAlpha = FALSE;
m_isLight = FALSE;
//}}AFX_DATA_INIT
}
void CDlgObjectLoad::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgObjectLoad)
DDX_Check(pDX, IDC_CHECK_OBJECTFILENAME, m_bObjectLoad);
DDX_Text(pDX, IDC_EDIT_OBJECTNAME, m_strObjectName);
DDX_Check(pDX, IDC_CHECK_ALPHA, m_isAlpha);
DDX_Check(pDX, IDC_CHECK_LIGHT, m_isLight);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgObjectLoad, CDialog)
//{{AFX_MSG_MAP(CDlgObjectLoad)
ON_BN_CLICKED(IDC_CHECK_OBJECTFILENAME, OnCheckObjectfilename)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgObjectLoad message handlers
void CDlgObjectLoad::OnCheckObjectfilename()
{
// TODO: Add your control notification handler code here
UpdateData();
CWnd* forrename=GetDlgItem(IDC_CHECK_OBJECTFILENAME);
if(m_bObjectLoad)
{
CString strFilter = R3SFILE;
CFileDialog filedia(TRUE,LIGHTOBJECTPATH,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.m_ofn.lpstrInitialDir = OBJECTPATH;
filedia.DoModal();
CString filename=filedia.GetFileName();
if(filename!="")
{
forrename->SetWindowText(filename.LockBuffer());
m_strObjectFilename=filename;
}
else
{
m_bObjectLoad=FALSE;
}
}
else
{
forrename->SetWindowText("<EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
}
UpdateData(FALSE);
}
void CDlgObjectLoad::OnOK()
{
// TODO: Add extra validation here
UpdateData();
if(m_strObjectFilename=="")
{
AfxMessageBox("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ <20><><EFBFBD><EFBFBD><EFBFBD≯<EFBFBD><CCB8><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><CFBC><EFBFBD>");
return;
}
if(m_strObjectName=="")
{
m_strObjectName=m_strObjectFilename;
}
UpdateData(FALSE);
CDialog::OnOK();
}

View File

@@ -0,0 +1,53 @@
#if !defined(AFX_DLGOBJECTLOAD_H__8E098AAC_59C6_460A_AEBA_C7C04151BE90__INCLUDED_)
#define AFX_DLGOBJECTLOAD_H__8E098AAC_59C6_460A_AEBA_C7C04151BE90__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgObjectLoad.h : header file
//
#include "BaseDataDefine.h"
/////////////////////////////////////////////////////////////////////////////
// CDlgObjectLoad dialog
class CDlgObjectLoad : public CDialog
{
// Construction
public:
CDlgObjectLoad(CWnd* pParent = NULL); // standard constructor
CString m_strObjectFilename;
// Dialog Data
//{{AFX_DATA(CDlgObjectLoad)
enum { IDD = IDD_DIALOG_OBJECTLOAD };
BOOL m_bObjectLoad;
CString m_strObjectName;
BOOL m_isAlpha;
BOOL m_isLight;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgObjectLoad)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgObjectLoad)
afx_msg void OnCheckObjectfilename();
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGOBJECTLOAD_H__8E098AAC_59C6_460A_AEBA_C7C04151BE90__INCLUDED_)

View File

@@ -0,0 +1,64 @@
// DlgOutfitSlot.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgOutfitSlot.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgOutfitSlot dialog
CDlgOutfitSlot::CDlgOutfitSlot(CWnd* pParent /*=NULL*/)
: CDialog(CDlgOutfitSlot::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgOutfitSlot)
m_nLayerCount = -1;
m_strOutfitSlotName = _T("");
//}}AFX_DATA_INIT
}
void CDlgOutfitSlot::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgOutfitSlot)
DDX_CBIndex(pDX, IDC_COMBO_OUTFISTSLOTLAYERCOUNT, m_nLayerCount);
DDX_Text(pDX, IDC_EDIT_OUTFITSLOTNAME, m_strOutfitSlotName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgOutfitSlot, CDialog)
//{{AFX_MSG_MAP(CDlgOutfitSlot)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgOutfitSlot message handlers
void CDlgOutfitSlot::SetupDialog( const char* szOutfitSlotName, int nLayerCount )
{
if( NULL == szOutfitSlotName )
{
m_strOutfitSlotName = "";
}
else
{
m_strOutfitSlotName = szOutfitSlotName;
}
m_nLayerCount = nLayerCount-1;
}
void CDlgOutfitSlot::SetupDialog( Z3DTOK tokOutfitSlotName, int nLayerCount )
{
SetupDialog( g_TokSlotName.GetString(tokOutfitSlotName), nLayerCount );
}

View File

@@ -0,0 +1,53 @@
#if !defined(AFX_DLGOUTFITSLOT_H__A09F665D_BDFA_480B_BF10_D42B4C4FBA06__INCLUDED_)
#define AFX_DLGOUTFITSLOT_H__A09F665D_BDFA_480B_BF10_D42B4C4FBA06__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgOutfitSlot.h : header file
//
#include "Z3DGeneralChrModel.h"
/////////////////////////////////////////////////////////////////////////////
// CDlgOutfitSlot dialog
class CDlgOutfitSlot : public CDialog
{
// Construction
public:
CDlgOutfitSlot(CWnd* pParent = NULL); // standard constructor
void SetupDialog( const char* szOutfitSlotName, int nLayerCount );
void SetupDialog( Z3DTOK tokOutfitSlotName, int nLayerCount );
// Dialog Data
//{{AFX_DATA(CDlgOutfitSlot)
enum { IDD = IDD_DIALOG_OUTFITSLOT };
int m_nLayerCount;
CString m_strOutfitSlotName;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgOutfitSlot)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgOutfitSlot)
// NOTE: the ClassWizard will add member functions here
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGOUTFITSLOT_H__A09F665D_BDFA_480B_BF10_D42B4C4FBA06__INCLUDED_)

View File

@@ -0,0 +1,75 @@
// DlgSectorMove.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgSectorMove.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgSectorMove dialog
CDlgSectorMove::CDlgSectorMove(CWnd* pParent /*=NULL*/)
: CDialog(CDlgSectorMove::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgSectorMove)
m_ToMoveX = 0;
m_ToMoveY = 0;
//}}AFX_DATA_INIT
}
void CDlgSectorMove::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgSectorMove)
DDX_Text(pDX, IDC_EDIT_MOVEX, m_ToMoveX);
DDX_Text(pDX, IDC_EDIT_MOVEY, m_ToMoveY);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgSectorMove, CDialog)
//{{AFX_MSG_MAP(CDlgSectorMove)
ON_EN_CHANGE(IDC_EDIT_MOVEX, OnChangeEditMovex)
ON_EN_CHANGE(IDC_EDIT_MOVEY, OnChangeEditMovey)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgSectorMove message handlers
void CDlgSectorMove::OnOK()
{
// TODO: Add extra validation here
CDialog::OnOK();
}
void CDlgSectorMove::OnChangeEditMovex()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData();
}
void CDlgSectorMove::OnChangeEditMovey()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
UpdateData();
}

View File

@@ -0,0 +1,49 @@
#if !defined(AFX_DLGSECTORMOVE_H__C3ED7B7E_58DD_4EA7_B846_82AB4B4F48F6__INCLUDED_)
#define AFX_DLGSECTORMOVE_H__C3ED7B7E_58DD_4EA7_B846_82AB4B4F48F6__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgSectorMove.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgSectorMove dialog
class CDlgSectorMove : public CDialog
{
// Construction
public:
CDlgSectorMove(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgSectorMove)
enum { IDD = IDD_DIALOG_SECTORMOVE };
long m_ToMoveX;
long m_ToMoveY;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgSectorMove)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgSectorMove)
virtual void OnOK();
afx_msg void OnChangeEditMovex();
afx_msg void OnChangeEditMovey();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGSECTORMOVE_H__C3ED7B7E_58DD_4EA7_B846_82AB4B4F48F6__INCLUDED_)

View File

@@ -0,0 +1,90 @@
// DlgSkelpart.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgSkelpart.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgSkelpart dialog
CDlgSkelpart::CDlgSkelpart(CWnd* pParent /*=NULL*/)
: CDialog(CDlgSkelpart::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgSkelpart)
m_nSkelpartIndex = -1;
m_strSkelpartName = _T("");
//}}AFX_DATA_INIT
m_rpGCMDS = NULL;
}
void CDlgSkelpart::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgSkelpart)
DDX_CBIndex(pDX, IDC_COMBO_SKELPARTINDEX, m_nSkelpartIndex);
DDX_Text(pDX, IDC_EDIT_SKELPARTNAME, m_strSkelpartName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgSkelpart, CDialog)
//{{AFX_MSG_MAP(CDlgSkelpart)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgSkelpart message handlers
void CDlgSkelpart::SetupDialog( const char* szSkelpartName, CZ3DGCMDS* pGCMDS, int nIndex )
{
if( NULL == pGCMDS )
{
return;
}
if( NULL == szSkelpartName )
{
m_strSkelpartName = "";
}
else
{
m_strSkelpartName = szSkelpartName;
}
m_rpGCMDS = pGCMDS;
m_nSkelpartIndex = nIndex;
}
BOOL CDlgSkelpart::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
if( m_rpGCMDS )
{
CWnd* pCtrlSkelpartIndex = GetDlgItem( IDC_COMBO_SKELPARTINDEX );
pCtrlSkelpartIndex->SendMessage( CB_RESETCONTENT, 0, 0 );
for( int i = 0; i < m_rpGCMDS->GetSkeletonCount(); ++i )
{
CString strTemp;
strTemp.Format( "%d, %s", i, m_rpGCMDS->GetSkeletonName(i) );
pCtrlSkelpartIndex->SendMessage( CB_INSERTSTRING, -1, (LPARAM)((LPCTSTR)strTemp) );
}
UpdateData( FALSE );
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

View File

@@ -0,0 +1,54 @@
#if !defined(AFX_DLGSKELPART_H__30437EAE_4ECD_4C1F_BBEB_EE5D9CB6A830__INCLUDED_)
#define AFX_DLGSKELPART_H__30437EAE_4ECD_4C1F_BBEB_EE5D9CB6A830__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgSkelpart.h : header file
//
#include "Z3DGCMDS.h"
/////////////////////////////////////////////////////////////////////////////
// CDlgSkelpart dialog
class CDlgSkelpart : public CDialog
{
// Construction
public:
CDlgSkelpart(CWnd* pParent = NULL); // standard constructor
void SetupDialog( const char* szSkelpartName, CZ3DGCMDS* pGCMDS, int nIndex );
// Dialog Data
//{{AFX_DATA(CDlgSkelpart)
enum { IDD = IDD_DIALOG_SKELPART };
int m_nSkelpartIndex;
CString m_strSkelpartName;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgSkelpart)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgSkelpart)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
CZ3DGCMDS* m_rpGCMDS;
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGSKELPART_H__30437EAE_4ECD_4C1F_BBEB_EE5D9CB6A830__INCLUDED_)

View File

@@ -0,0 +1,76 @@
// DlgSoundLoad.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgSoundLoad.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgSoundLoad dialog
CDlgSoundLoad::CDlgSoundLoad(CWnd* pParent /*=NULL*/)
: CDialog(CDlgSoundLoad::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgSoundLoad)
m_fMaxRange = 0.0f;
m_fMinRange = 0.0f;
//}}AFX_DATA_INIT
m_bFilename=false;
}
void CDlgSoundLoad::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgSoundLoad)
DDX_Text(pDX, IDC_EDIT_SOUNDMAXRANGE, m_fMaxRange);
DDX_Text(pDX, IDC_EDIT_SOUNDMINRANGE, m_fMinRange);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgSoundLoad, CDialog)
//{{AFX_MSG_MAP(CDlgSoundLoad)
ON_BN_CLICKED(IDC_CHECK_SOUNDNAME, OnCheckSoundname)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgSoundLoad message handlers
void CDlgSoundLoad::OnCheckSoundname()
{
// TODO: Add your control notification handler code here
UpdateData();
CWnd* forrename=GetDlgItem(IDC_CHECK_SOUNDNAME);
CString strFilter = SOUNDFILE;
CFileDialog filedia(TRUE,"",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.DoModal();
CString filename=filedia.GetFileName();
if(filename!="")
{
forrename->SetWindowText(filename.LockBuffer());
m_strSoundName=filename;
}
UpdateData(FALSE);
}
void CDlgSoundLoad::OnUpdateEditSoundrange()
{
UpdateData();
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function to send the EM_SETEVENTMASK message to the control
// with the ENM_UPDATE flag ORed into the lParam mask.
// TODO: Add your control notification handler code here
}

View File

@@ -0,0 +1,49 @@
#if !defined(AFX_DLGSOUNDLOAD_H__2EB278F5_B67E_4735_80C2_6763A0A20B82__INCLUDED_)
#define AFX_DLGSOUNDLOAD_H__2EB278F5_B67E_4735_80C2_6763A0A20B82__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgSoundLoad.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgSoundLoad dialog
class CDlgSoundLoad : public CDialog
{
// Construction
public:
CDlgSoundLoad(CWnd* pParent = NULL); // standard constructor
CString m_strSoundName;
bool m_bFilename;
// Dialog Data
//{{AFX_DATA(CDlgSoundLoad)
enum { IDD = IDD_DIALOG_SOUNDLOAD };
float m_fMaxRange;
float m_fMinRange;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgSoundLoad)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgSoundLoad)
afx_msg void OnCheckSoundname();
afx_msg void OnUpdateEditSoundrange();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGSOUNDLOAD_H__2EB278F5_B67E_4735_80C2_6763A0A20B82__INCLUDED_)

View File

@@ -0,0 +1,263 @@
// DlgStart.cpp : implementation file
//
#include "stdafx.h"
#include "WorldCreator.h"
#include "DlgStart.h"
#include "RenderOption.h"
#include "BaseDataDefine.h"
#include <EnumD3D.h>
#include ".\dlgstart.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgStart dialog
CDlgStart::CDlgStart(CWnd* pParent /*=NULL*/)
: CDialog(CDlgStart::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgStart)
m_bBuildingLightmap = TRUE;
m_bBSPLightmap = FALSE;
m_bBSPTerrainRendering = FALSE;
m_CharacterBuildingLighting = TRUE;
m_bCharacterLigting = TRUE;
m_bCharacterShadow = FALSE;
m_bCharacterSpecular = FALSE;
m_bFullSceneGlare = FALSE;
m_bGrassRendering = TRUE;
m_bMultiDetailTexture = TRUE;
m_bRangeGrass = FALSE;
m_bSpecularGlare = FALSE;
m_bTreeAnimation = TRUE;
m_bWaterBumpEnv = FALSE;
m_nGrassRange = 0;
m_nTerrainLSizeX = 0;
m_nTerrainLSizeY = 0;
m_nTextureSkipLevel = 0;
m_CharacterBuildingShadow = TRUE;
m_bAllObjectBump = FALSE;
m_bGF3OPTION = FALSE;
m_bRain = FALSE;
m_bWaterBump = FALSE;
m_bFullSceneEffect = FALSE;
//}}AFX_DATA_INIT
m_nSelectDevice=1;
}
void CDlgStart::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgStart)
DDX_Control(pDX, IDC_COMBOZONE, m_ZoneSelect);
DDX_Control(pDX, IDC_COMBO_ADAPTER, m_adapter);
DDX_Control(pDX, IDC_COMBO_DEVICE, m_device);
DDX_Check(pDX, IDC_CHECK_BLDLIGHTMAP_OPTION, m_bBuildingLightmap);
DDX_Check(pDX, IDC_CHECK_BSPLIGHTMAP_OPTION, m_bBSPLightmap);
DDX_Check(pDX, IDC_CHECK_BSPTERRAIN_OPTION, m_bBSPTerrainRendering);
DDX_Check(pDX, IDC_CHECK_CHRBLDLIGHT_OPTION, m_CharacterBuildingLighting);
DDX_Check(pDX, IDC_CHECK_CHRLIGHTING_OPTION, m_bCharacterLigting);
DDX_Check(pDX, IDC_CHECK_CHRSHADOW_OPTION, m_bCharacterShadow);
DDX_Check(pDX, IDC_CHECK_CHRSPECULAR_OPTION, m_bCharacterSpecular);
DDX_Check(pDX, IDC_CHECK_GLARE_OPTION, m_bFullSceneGlare);
DDX_Check(pDX, IDC_CHECK_GRASS_OPTION, m_bGrassRendering);
DDX_Check(pDX, IDC_CHECK_MULTIDETAIL_OPTION, m_bMultiDetailTexture);
DDX_Check(pDX, IDC_CHECK_RANGEGRASS_OPTION, m_bRangeGrass);
DDX_Check(pDX, IDC_CHECK_SPECULARGLARE_OPTION, m_bSpecularGlare);
DDX_Check(pDX, IDC_CHECK_TREEANI_OPTION, m_bTreeAnimation);
DDX_Check(pDX, IDC_CHECK_WATERBUMPENV_OPTION, m_bWaterBumpEnv);
DDX_Text(pDX, IDC_EDIT_GRASSRANGE, m_nGrassRange);
DDX_Text(pDX, IDC_EDIT_LSIZEX, m_nTerrainLSizeX);
DDX_Text(pDX, IDC_EDIT_LSIZEY, m_nTerrainLSizeY);
DDX_Text(pDX, IDC_EDIT_TEXTURESKIPLEVEL, m_nTextureSkipLevel);
DDX_Check(pDX, IDC_CHECK_CHRINBLDSHADOW_OPTION, m_CharacterBuildingShadow);
DDX_Check(pDX, IDC_CHECK_PerPixelLight, m_bAllObjectBump);
DDX_Check(pDX, IDC_CHECK_GF3OPTION, m_bGF3OPTION);
DDX_Check(pDX, IDC_RAIN, m_bRain);
DDX_Check(pDX, IDC_WATER, m_bWaterBump);
DDX_Check(pDX, IDC_FULLSCENEEFFECT, m_bFullSceneEffect);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgStart, CDialog)
//{{AFX_MSG_MAP(CDlgStart)
ON_CBN_SELCHANGE(IDC_COMBO_DEVICE, OnSelchangeComboDevice)
ON_EN_CHANGE(IDC_EDIT_TEXTURESKIPLEVEL, OnChangeEditTextureskiplevel)
ON_BN_CLICKED(IDC_CHECK_GF3OPTION, OnCheckGf3option)
//}}AFX_MSG_MAP
ON_BN_CLICKED(IDC_RAIN, OnBnClickedRain)
ON_BN_CLICKED(IDC_CHECK_PerPixelLight, OnBnClickedCheckPerpixellight)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgStart message handlers
BOOL CDlgStart::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
CEnumD3D::Enum();
/*
m_device.AddString();
CEnumD3D::m_Adapters[0].d3dAdapterIdentifier
*/
m_adapter.AddString(CEnumD3D::m_Adapters[0].d3dAdapterIdentifier.Description);
m_device.AddString(CEnumD3D::m_Adapters[0].devices[0].strDesc);
m_device.AddString(CEnumD3D::m_Adapters[0].devices[1].strDesc);
SetZoneList();
/*
for(int i=0;i<CEnumD3D::m_deviceinfo.num;i++)
{
m_device.AddString(CEnumD3D::m_deviceinfo[i]->strDesc);
}
*/
m_adapter.SetCurSel(0);
m_device.SetCurSel(0);
m_ZoneSelect.SetCurSel(0);
//m_ZoneValue = 0;
UpdateData(false);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgStart::SetZoneList() {
char buf[50] = {0};
char path[256];
GetCurrentDirectory(256,path);
sprintf(path,"%s\\ZoneList.dat",path);
FILE *fp;
fp = fopen(path,"rt");
if(fp) {
while(!feof(fp)) {
memset(buf,0,sizeof(char) * 50);
fscanf(fp,"%s",buf);
m_ZoneSelect.AddString(buf);
}
fclose(fp);
}
else {
MessageBox(path,"Error",MB_OK);
m_ZoneSelect.AddString("Default");
}
GetCurrentDirectory(256,path);
sprintf(path,"%s\\CHRPATH.dat",path);
fp = fopen(path,"rt");
if(fp) {
fscanf(fp,"%s",WORLDCHRDIFF);
fscanf(fp,"%s",WORLDCHRBUM);
fscanf(fp,"%s",WORLDCHRENV);
fclose(fp);
}
}
void CDlgStart::OnSelchangeComboDevice()
{
UpdateData();
m_nSelectDevice=m_device.GetCurSel();
// TODO: Add your control notification handler code here
}
void CDlgStart::OnOK()
{
// TODO: Add extra validation here
UpdateData();
CRenderOption::m_AllObjectBump=m_bAllObjectBump;
CRenderOption::m_CharacterPerPixelLighting=m_bCharacterLigting;
CRenderOption::m_CharacterPerPixelSpecularLighting=m_bCharacterSpecular;
CRenderOption::m_BuildingLightmap=m_bBuildingLightmap;
CRenderOption::m_FullSceneGlare=m_bFullSceneGlare;
CRenderOption::m_FullSceneSpecularGlare=m_bSpecularGlare;
CRenderOption::m_RangeGrassRender=m_bRangeGrass;
CRenderOption::m_WaterBumpEnvRendering=m_bWaterBumpEnv;
CRenderOption::m_GrassRendering=m_bGrassRendering;
CRenderOption::m_TerrainMultiDetalTexture=m_bMultiDetailTexture;
CRenderOption::m_CharacterProjectShadowTerrain=m_CharacterBuildingShadow;
CRenderOption::m_CharacterProjectShadowBuilding=m_CharacterBuildingShadow;
CRenderOption::m_CharacterSelfShadow=m_bCharacterShadow;
CRenderOption::m_bRain = (bool)m_bRain;
CRenderOption::m_bWaterBump = m_bWaterBump;
CRenderOption::m_bFullSceneEffect = (bool)m_bFullSceneEffect;
char strZoneString[7] = {0};
int k = m_ZoneSelect.GetCurSel();
if(k == 0) //default
strcpy(CRenderOption::m_strBaseGraphicsDataPath,"");
else {
sprintf(strZoneString,"Zone%d",k);
strcpy(CRenderOption::m_strBaseGraphicsDataPath,strZoneString);
}
CDialog::OnOK();
}
void CDlgStart::OnChangeEditTextureskiplevel()
{
UpdateData();
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDialog::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
}
void CDlgStart::OnCheckGf3option()
{
// TODO: Add your control notification handler code here
UpdateData();
if(m_bGF3OPTION)
{
m_bCharacterLigting = TRUE;
m_bCharacterSpecular = TRUE;
m_bFullSceneGlare = TRUE;
m_bRangeGrass = TRUE;
m_bSpecularGlare = TRUE;
m_bWaterBumpEnv = TRUE;
m_bAllObjectBump = TRUE;
m_bCharacterShadow = TRUE;
}
else
{
m_bCharacterLigting = FALSE;
m_bCharacterSpecular = FALSE;
m_bFullSceneGlare = FALSE;
m_bRangeGrass = FALSE;
m_bSpecularGlare = FALSE;
m_bWaterBumpEnv = FALSE;
m_bAllObjectBump = FALSE;
m_bCharacterShadow = FALSE;
}
UpdateData(FALSE);
}
void CDlgStart::OnBnClickedRain()
{
// TODO: <20><><EFBFBD><20><>Ʈ<EFBFBD><C6AE> <20>˸<EFBFBD> ó<><C3B3><EFBFBD><EFBFBD> <20>ڵ带 <20>߰<EFBFBD><DFB0>մϴ<D5B4>.
}
void CDlgStart::OnBnClickedCheckPerpixellight()
{
// TODO: <20><><EFBFBD><20><>Ʈ<EFBFBD><C6AE> <20>˸<EFBFBD> ó<><C3B3><EFBFBD><EFBFBD> <20>ڵ带 <20>߰<EFBFBD><DFB0>մϴ<D5B4>.
}

View File

@@ -0,0 +1,83 @@
#if !defined(AFX_DLGSTART_H__FBA6FF68_CBAA_47A4_AD99_E157CB468FE5__INCLUDED_)
#define AFX_DLGSTART_H__FBA6FF68_CBAA_47A4_AD99_E157CB468FE5__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgStart.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgStart dialog
class CDlgStart : public CDialog
{
long m_nSelectDevice;
// Construction
public:
CDlgStart(CWnd* pParent = NULL); // standard constructor
long GetSelectDevice(){return m_nSelectDevice;};
// Dialog Data
//{{AFX_DATA(CDlgStart)
enum { IDD = IDD_DIALOG_START };
CComboBox m_ZoneSelect;
CComboBox m_adapter;
CComboBox m_device;
BOOL m_bBuildingLightmap;
BOOL m_bBSPLightmap;
BOOL m_bBSPTerrainRendering;
BOOL m_CharacterBuildingLighting;
BOOL m_bCharacterLigting;
BOOL m_bCharacterShadow;
BOOL m_bCharacterSpecular;
BOOL m_bFullSceneGlare;
BOOL m_bGrassRendering;
BOOL m_bMultiDetailTexture;
BOOL m_bRangeGrass;
BOOL m_bSpecularGlare;
BOOL m_bTreeAnimation;
BOOL m_bWaterBumpEnv;
UINT m_nGrassRange;
UINT m_nTerrainLSizeX;
UINT m_nTerrainLSizeY;
UINT m_nTextureSkipLevel;
BOOL m_CharacterBuildingShadow;
BOOL m_bAllObjectBump;
BOOL m_bGF3OPTION;
BOOL m_bRain;
BOOL m_bWaterBump;
BOOL m_bFullSceneEffect;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgStart)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
void SetZoneList();
// Generated message map functions
//{{AFX_MSG(CDlgStart)
virtual BOOL OnInitDialog();
afx_msg void OnSelchangeComboDevice();
virtual void OnOK();
afx_msg void OnChangeEditTextureskiplevel();
afx_msg void OnCheckGf3option();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnBnClickedRain();
afx_msg void OnBnClickedCheckPerpixellight();
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGSTART_H__FBA6FF68_CBAA_47A4_AD99_E157CB468FE5__INCLUDED_)

View File

@@ -0,0 +1,56 @@
// DlgTriggerPoint.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgTriggerPoint.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgTriggerPoint dialog
CDlgTriggerPoint::CDlgTriggerPoint(CWnd* pParent /*=NULL*/)
: CDialog(CDlgTriggerPoint::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgTriggerPoint)
m_xPos = 0.0f;
m_yPos = 0.0f;
m_zPos = 0.0f;
//}}AFX_DATA_INIT
}
void CDlgTriggerPoint::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgTriggerPoint)
DDX_Text(pDX, IDC_EDIT_XPOS, m_xPos);
DDX_Text(pDX, IDC_EDIT_YPOS, m_yPos);
DDX_Text(pDX, IDC_EDIT_ZPOS, m_zPos);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgTriggerPoint, CDialog)
//{{AFX_MSG_MAP(CDlgTriggerPoint)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgTriggerPoint message handlers
BOOL CDlgTriggerPoint::OnInitDialog()
{
CDialog::OnInitDialog();
UpdateData( FALSE );
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

View File

@@ -0,0 +1,48 @@
#if !defined(AFX_DLGTRIGGERPOINT_H__EFC17DE4_F59C_405E_AEA1_3116C73810E8__INCLUDED_)
#define AFX_DLGTRIGGERPOINT_H__EFC17DE4_F59C_405E_AEA1_3116C73810E8__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgTriggerPoint.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgTriggerPoint dialog
class CDlgTriggerPoint : public CDialog
{
// Construction
public:
CDlgTriggerPoint(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgTriggerPoint)
enum { IDD = IDD_PROPERTY_TRIGGERPOINT };
float m_xPos;
float m_yPos;
float m_zPos;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgTriggerPoint)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgTriggerPoint)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGTRIGGERPOINT_H__EFC17DE4_F59C_405E_AEA1_3116C73810E8__INCLUDED_)

View File

@@ -0,0 +1,155 @@
// DlgTriggerProperty.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgTriggerProperty.h"
#include <BaseDataDefine.h>
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//
const char * strEventMusicPlay = "Play Music";
const char * strEventMusicPlayOnce = "Play Music Once";
const char * strEventShowMessage = "Show Message";
const char * strEventShowEffect = "Show Effect";
/////////////////////////////////////////////////////////////////////////////
// CDlgTriggerProperty dialog
CDlgTriggerProperty::CDlgTriggerProperty(CWnd* pParent /*=NULL*/)
: CDialog(CDlgTriggerProperty::IDD, pParent)
, m_iCurSel( 0 )
, m_iEventType( -1 )
{
//{{AFX_DATA_INIT(CDlgTriggerProperty)
m_strEventArg = _T("");
//}}AFX_DATA_INIT
}
void CDlgTriggerProperty::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgTriggerProperty)
DDX_Control(pDX, IDC_COMBO_EVENTTYPE, m_EventType);
DDX_Text(pDX, IDC_EDIT_EVENTARG, m_strEventArg);
//}}AFX_DATA_MAP
}
int CDlgTriggerProperty::EventType()
{
int curSel = m_EventType.GetCurSel();
if( curSel == CB_ERR )
return -1;
CString str;
m_EventType.GetLBText( curSel, str );
if( str == strEventMusicPlay )
{
return 0;
}
else if( str == strEventShowMessage )
{
return 1;
}
else if( str == strEventMusicPlayOnce )
{
return 2;
}
else if( str == strEventShowEffect )
{
return 3;
}
else
return -1;
}
void CDlgTriggerProperty::SetEventType( int eventType )
{
m_iCurSel = eventType;
}
BEGIN_MESSAGE_MAP(CDlgTriggerProperty, CDialog)
//{{AFX_MSG_MAP(CDlgTriggerProperty)
ON_BN_CLICKED(IDC_BUTTON_BROWSE, OnButtonBrowse)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgTriggerProperty message handlers
void CDlgTriggerProperty::ConfirmSoundDirectory( CString & strFilename, CString & strFilenameSrc )
{
char szPathName[256], szSoundFilePath[256];
strcpy( szPathName, strFilenameSrc );
strlwr( szPathName );
strcpy( szSoundFilePath, SOUNDFILEPATH );
strlwr( szSoundFilePath );
char * pFinded = strstr( szPathName, szSoundFilePath );
if( pFinded == NULL )
{
char szMsg[256];
sprintf( szMsg, "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ȭ<><C8AD><EFBFBD><EFBFBD> %s<><73> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B8AE> <20>־<EFBFBD><D6BE>߸<EFBFBD> <20>մϴ<D5B4>.", szSoundFilePath );
MessageBox( szMsg );
}
else
{
pFinded += strlen( szSoundFilePath );
strFilename = pFinded;
}
}
void CDlgTriggerProperty::OnButtonBrowse()
{
const char * filter = "All Files (*.*)|*.*|Effect Script Files (*.esf)|*.esf|Wave Files (*.wav)|*.wav|OGG Files (*.ogg)|*.ogg||";
CFileDialog FileDlg( TRUE, "*.*", NULL, OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, filter, this );
FileDlg.m_ofn.lpstrInitialDir = SOUNDFILEPATH;
if( FileDlg.DoModal() == IDOK )
{
CString ext = FileDlg.GetFileExt();
ext.MakeLower();
if( ext == "wav" || ext == "ogg" )
ConfirmSoundDirectory( m_strEventArg, FileDlg.GetPathName() );
else
m_strEventArg = FileDlg.GetFileName();
UpdateData( FALSE );
}
}
BOOL CDlgTriggerProperty::OnInitDialog()
{
CDialog::OnInitDialog();
m_EventType.AddString( strEventMusicPlay );
m_EventType.AddString( strEventShowMessage );
m_EventType.AddString( strEventMusicPlayOnce );
m_EventType.AddString( strEventShowEffect );
m_EventType.SetCurSel( m_iCurSel );
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgTriggerProperty::OnOK()
{
m_iEventType = EventType();
CDialog::OnOK();
}

View File

@@ -0,0 +1,60 @@
#if !defined(AFX_DLGTRIGGERPROPERTY_H__DEE2F4C9_D2E7_4CA8_A9E9_29E42EBA72B5__INCLUDED_)
#define AFX_DLGTRIGGERPROPERTY_H__DEE2F4C9_D2E7_4CA8_A9E9_29E42EBA72B5__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgTriggerProperty.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgTriggerProperty dialog
class CDlgTriggerProperty : public CDialog
{
void ConfirmSoundDirectory( CString &, CString & );
protected:
int m_iCurSel;
int m_iEventType;
protected:
int EventType();
// Construction
public:
CDlgTriggerProperty(CWnd* pParent = NULL); // standard constructor
int GetEventType() { return m_iEventType; }
void SetEventType( int );
// Dialog Data
//{{AFX_DATA(CDlgTriggerProperty)
enum { IDD = IDD_DIALOG_TRIGGERPROPERTY };
CComboBox m_EventType;
CString m_strEventArg;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgTriggerProperty)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgTriggerProperty)
afx_msg void OnButtonBrowse();
virtual BOOL OnInitDialog();
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGTRIGGERPROPERTY_H__DEE2F4C9_D2E7_4CA8_A9E9_29E42EBA72B5__INCLUDED_)

View File

@@ -0,0 +1,49 @@
// DlgVertexOT.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgVertexOT.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgVertexOT dialog
CDlgVertexOT::CDlgVertexOT(CWnd* pParent /*=NULL*/)
: CDialog(CDlgVertexOT::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgVertexOT)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDlgVertexOT::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgVertexOT)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgVertexOT, CDialog)
//{{AFX_MSG_MAP(CDlgVertexOT)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgVertexOT message handlers
void CDlgVertexOT::OnOK()
{
// TODO: Add extra validation here
CDialog::OnOK();
}

View File

@@ -0,0 +1,46 @@
#if !defined(AFX_DLGVERTEXOT_H__355A6C2B_524B_49FA_9FD2_2DEFB96DBAA3__INCLUDED_)
#define AFX_DLGVERTEXOT_H__355A6C2B_524B_49FA_9FD2_2DEFB96DBAA3__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgVertexOT.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgVertexOT dialog
class CDlgVertexOT : public CDialog
{
// Construction
public:
CDlgVertexOT(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgVertexOT)
enum { IDD = IDD_DIALOG_VERTEXOPTIMIZE };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgVertexOT)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgVertexOT)
virtual void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGVERTEXOT_H__355A6C2B_524B_49FA_9FD2_2DEFB96DBAA3__INCLUDED_)

View File

@@ -0,0 +1,598 @@
// DlgWeatherColor.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgWeatherColor.h"
#include "SceneManager.h"
#include "MainFrm.h"
#include "WorldCreatorView.h"
#include ".\dlgweathercolor.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgWeatherColor dialog
CDlgWeatherColor::CDlgWeatherColor(CWnd* pParent /*=NULL*/)
: CDialog(CDlgWeatherColor::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgWeatherColor)
m_fFlareSize = 0.0f;
m_fFogEnd = 0.0f;
m_fFogStart = 0.0f;
m_fSkyFogEnd = 0.0f;
m_fSunPos = 0.0f;
m_fSunSize = 0.0f;
m_fGlowSize = 0.0f;
m_fLightRange = 0.0f;
m_fLightRange = 1000.0f;
m_fGlowSize = 800.0f;
//}}AFX_DATA_INIT
}
void CDlgWeatherColor::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgWeatherColor)
DDX_Control(pDX, IDC_COLOR_CHARACTER, m_CharacterNightColor);
DDX_Control(pDX, IDC_COLOR_FURGRASS, m_FurGrassColor);
DDX_Control(pDX, IDC_COLOR_WATER, m_WaterColor);
DDX_Control(pDX, IDC_COLOR_TERRAINCOLOR, m_TerrainColor);
DDX_Control(pDX, IDC_COLOR_SPECULARREFLRECTIONRATE, m_SpecularReflectionRate);
DDX_Control(pDX, IDC_COLOR_GRASSAMBIENT, m_GrassColor);
DDX_Control(pDX, IDC_COLOR_GLARESKYUPPER, m_GlareSkyUpper);
DDX_Control(pDX, IDC_COLOR_GLARESKYLOWER, m_ClareSkyLowerColor);
DDX_Control(pDX, IDC_COLOR_CHARACTERAMBIENT, m_CharacterAmbientColor);
DDX_Control(pDX, IDC_COLOR_CHARACTERLIGHT, m_CharacterLightColor);
DDX_Control(pDX, IDC_COLOR_DETAILFIX, m_DetailFixColor);
DDX_Control(pDX, IDC_LIST_WEATHERTIMELIST, m_WeatherList);
DDX_Control(pDX, IDC_COLOR_SKYNEIGHBOR, m_SkyNeighborColor);
DDX_Control(pDX, IDC_COLOR_SKYCENTER, m_SkyCenterColor);
DDX_Control(pDX, IDC_COLOR_FOGCOLOR, m_FogColor);
DDX_Control(pDX, IDC_COLOR_LIGHTCOLOR, m_LightColor);
DDX_Control(pDX, IDC_COLOR_AMBIENTCOLOR, m_AmbientColor);
DDX_Control(pDX, IDC_COLOR_FOGLAYER1, m_CloudColor1);
DDX_Control(pDX, IDC_COLOR_FOGLAYER2, m_CloudColor2);
DDX_Control(pDX, IDC_COLOR_FOGLAYER3, m_CloudColor3);
DDX_Control(pDX, IDC_COLOR_FLARECOLOR, m_FlareColor);
DDX_Control(pDX, IDC_COLOR_OBJECTAMBIENT, m_ObjectAmbient);
DDX_Control(pDX, IDC_COLOR_CHARACTER,m_CharacterNightColor);
DDX_Text(pDX, IDC_EDIT_FLARESIZE, m_fFlareSize);
DDX_Text(pDX, IDC_EDIT_FOGEND, m_fFogEnd);
DDX_Text(pDX, IDC_EDIT_FOGSTART, m_fFogStart);
DDX_Text(pDX, IDC_EDIT_SKYFOGEND, m_fSkyFogEnd);
DDX_Text(pDX, IDC_EDIT_SUNPOS, m_fSunPos);
DDX_Text(pDX, IDC_EDIT_SUNSIZE, m_fSunSize);
DDX_Text(pDX, IDC_GLOWSIZE, m_fGlowSize);
DDX_Text(pDX, IDC_LIGHTSIZE, m_fLightRange);
//}}AFX_DATA_MAP
DDX_ColourPicker(pDX, IDC_COLOR_SKYNEIGHBOR, m_cSkyNeighborColor);
DDX_ColourPicker(pDX, IDC_COLOR_SKYCENTER, m_cSkyCenterColor);
DDX_ColourPicker(pDX, IDC_COLOR_FOGCOLOR, m_cFogColor);
DDX_ColourPicker(pDX, IDC_COLOR_LIGHTCOLOR, m_cLightColor);
DDX_ColourPicker(pDX, IDC_COLOR_AMBIENTCOLOR, m_cAmbientColor);
DDX_ColourPicker(pDX, IDC_COLOR_FOGLAYER1, m_cCloudColor1);
DDX_ColourPicker(pDX, IDC_COLOR_FOGLAYER2, m_cCloudColor2);
DDX_ColourPicker(pDX, IDC_COLOR_FOGLAYER3, m_cCloudColor3);
DDX_ColourPicker(pDX, IDC_COLOR_FLARECOLOR, m_cFlareColor);
DDX_ColourPicker(pDX, IDC_COLOR_OBJECTAMBIENT, m_cObjectAmbient);
DDX_ColourPicker(pDX, IDC_COLOR_DETAILFIX, m_cDetailFixColor);
DDX_ColourPicker(pDX,IDC_COLOR_SPECULARREFLRECTIONRATE, m_cSpecularReflectionRate);
DDX_ColourPicker(pDX,IDC_COLOR_GRASSAMBIENT, m_cGrass);
DDX_ColourPicker(pDX,IDC_COLOR_GLARESKYUPPER, m_cGlareSkyUpper);
DDX_ColourPicker(pDX,IDC_COLOR_GLARESKYLOWER, m_cClareSkyLower);
DDX_ColourPicker(pDX,IDC_COLOR_CHARACTERAMBIENT, m_cCharacterAmbient);
DDX_ColourPicker(pDX,IDC_COLOR_CHARACTERLIGHT, m_cCharacterLight);
DDX_ColourPicker(pDX,IDC_COLOR_TERRAINCOLOR,m_cTerrainColor);
DDX_ColourPicker(pDX,IDC_COLOR_FURGRASS,m_cFurGrassColor);
DDX_ColourPicker(pDX,IDC_COLOR_CHARACTER,m_cCharacterNColor);
}
BEGIN_MESSAGE_MAP(CDlgWeatherColor, CDialog)
//{{AFX_MSG_MAP(CDlgWeatherColor)
ON_LBN_DBLCLK(IDC_LIST_WEATHERTIMELIST, OnDblclkListWeathertimelist)
ON_BN_CLICKED(IDC_BUTTON_WEATHERCOLORSAVE, OnButtonWeathercolorsave)
ON_BN_CLICKED(IDC_BUTTON_WEATHERFILESAVE, OnButtonWeatherfilesave)
ON_WM_KEYDOWN()
//}}AFX_MSG_MAP
ON_LBN_SELCHANGE(IDC_LIST_WEATHERTIMELIST, OnLbnSelchangeListWeathertimelist)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgWeatherColor message handlers
BOOL CDlgWeatherColor::OnInitDialog()
{
CDialog::OnInitDialog();
for(int i=0;i<24;i++)
{
CString strTime;
strTime.Format("%d<><64>",i);
m_WeatherList.AddString(strTime);
}
m_WeatherList.AddString("<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>");
OnDblclkListWeathertimelist();
// TODO: Add extra initialization here
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CDlgWeatherColor::OnDblclkListWeathertimelist()
{
// TODO: Add your control notification handler code here
int SelCur=m_WeatherList.GetCurSel();
if(SelCur==-1)
{
SelCur=0;
m_WeatherList.SetCurSel(0);
}
if(CSceneManager::m_WeatherManager.m_bSubTable)
{
int iSub = CSceneManager::m_WeatherManager.m_iSubCurrentIndex;
m_cSkyNeighborColor=RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SkyNeighborColor[SelCur].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SkyNeighborColor[SelCur].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SkyNeighborColor[SelCur].b);
m_cSkyCenterColor=RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SkyCenterColor[SelCur].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SkyCenterColor[SelCur].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SkyCenterColor[SelCur].b);
m_cFogColor=RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogColor[SelCur].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogColor[SelCur].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogColor[SelCur].b);
m_cLightColor=RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_LightColor[SelCur].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_LightColor[SelCur].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_LightColor[SelCur].b);
m_cAmbientColor=RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_AmbientColor[SelCur].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_AmbientColor[SelCur].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_AmbientColor[SelCur].b);
m_cCloudColor1=RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogLayer[SelCur][0].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogLayer[SelCur][0].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogLayer[SelCur][0].b);
m_cCloudColor2=RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogLayer[SelCur][1].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogLayer[SelCur][1].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogLayer[SelCur][1].b);
m_cCloudColor3=RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogLayer[SelCur][2].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogLayer[SelCur][2].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogLayer[SelCur][2].b);
m_cObjectAmbient=RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_ObjectAmbientColor[SelCur].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_ObjectAmbientColor[SelCur].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_ObjectAmbientColor[SelCur].b);
m_fFogStart=CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogRangeNear[SelCur];
m_fFogEnd=CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogRangeFar[SelCur];
m_fSkyFogEnd=CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SkyFogFar[SelCur];
m_fSunPos=CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SunPosition[SelCur];
m_cDetailFixColor = RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_DetailFixColor[SelCur].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_DetailFixColor[SelCur].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_DetailFixColor[SelCur].b);
m_cSpecularReflectionRate=RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SpecularReflectionRate[SelCur].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SpecularReflectionRate[SelCur].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SpecularReflectionRate[SelCur].b);
m_cGrass=RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_GrassColor[SelCur].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_GrassColor[SelCur].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_GrassColor[SelCur].b);
m_cGlareSkyUpper=RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_GlareSkyUpper[SelCur].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_GlareSkyUpper[SelCur].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_GlareSkyUpper[SelCur].b);
m_cClareSkyLower=RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_GlareSkyLower[SelCur].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_GlareSkyLower[SelCur].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_GlareSkyLower[SelCur].b);
m_cCharacterAmbient=RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_CharacterAmbient[SelCur].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_CharacterAmbient[SelCur].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_CharacterAmbient[SelCur].b);
m_cCharacterLight=RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_CharacterLight[SelCur].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_CharacterLight[SelCur].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_CharacterLight[SelCur].b);
m_cTerrainColor=RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_TerrainColor[SelCur].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_TerrainColor[SelCur].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_TerrainColor[SelCur].b);
m_cWaterColor=RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_WaterColor[SelCur].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_WaterColor[SelCur].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_WaterColor[SelCur].b);
m_cFurGrassColor=RGB(CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FurGrassColor[SelCur].r,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FurGrassColor[SelCur].g,
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FurGrassColor[SelCur].b);
}
else
{
m_cSkyNeighborColor=RGB(CSceneManager::m_WeatherManager.m_SkyNeighborColor[SelCur].r,
CSceneManager::m_WeatherManager.m_SkyNeighborColor[SelCur].g,
CSceneManager::m_WeatherManager.m_SkyNeighborColor[SelCur].b);
m_cSkyCenterColor=RGB(CSceneManager::m_WeatherManager.m_SkyCenterColor[SelCur].r,
CSceneManager::m_WeatherManager.m_SkyCenterColor[SelCur].g,
CSceneManager::m_WeatherManager.m_SkyCenterColor[SelCur].b);
m_cFogColor=RGB(CSceneManager::m_WeatherManager.m_FogColor[SelCur].r,
CSceneManager::m_WeatherManager.m_FogColor[SelCur].g,
CSceneManager::m_WeatherManager.m_FogColor[SelCur].b);
m_cLightColor=RGB(CSceneManager::m_WeatherManager.m_LightColor[SelCur].r,
CSceneManager::m_WeatherManager.m_LightColor[SelCur].g,
CSceneManager::m_WeatherManager.m_LightColor[SelCur].b);
m_cAmbientColor=RGB(CSceneManager::m_WeatherManager.m_AmbientColor[SelCur].r,
CSceneManager::m_WeatherManager.m_AmbientColor[SelCur].g,
CSceneManager::m_WeatherManager.m_AmbientColor[SelCur].b);
m_cCloudColor1=RGB(CSceneManager::m_WeatherManager.m_FogLayer[SelCur][0].r,
CSceneManager::m_WeatherManager.m_FogLayer[SelCur][0].g,
CSceneManager::m_WeatherManager.m_FogLayer[SelCur][0].b);
m_cCloudColor2=RGB(CSceneManager::m_WeatherManager.m_FogLayer[SelCur][1].r,
CSceneManager::m_WeatherManager.m_FogLayer[SelCur][1].g,
CSceneManager::m_WeatherManager.m_FogLayer[SelCur][1].b);
m_cCloudColor3=RGB(CSceneManager::m_WeatherManager.m_FogLayer[SelCur][2].r,
CSceneManager::m_WeatherManager.m_FogLayer[SelCur][2].g,
CSceneManager::m_WeatherManager.m_FogLayer[SelCur][2].b);
m_cObjectAmbient=RGB(CSceneManager::m_WeatherManager.m_ObjectAmbientColor[SelCur].r,
CSceneManager::m_WeatherManager.m_ObjectAmbientColor[SelCur].g,
CSceneManager::m_WeatherManager.m_ObjectAmbientColor[SelCur].b);
m_fFogStart=CSceneManager::m_WeatherManager.m_FogRangeNear[SelCur];
m_fFogEnd=CSceneManager::m_WeatherManager.m_FogRangeFar[SelCur];
m_fSkyFogEnd=CSceneManager::m_WeatherManager.m_SkyFogFar[SelCur];
m_fSunPos=CSceneManager::m_WeatherManager.m_SunPosition[SelCur];
m_cDetailFixColor = RGB(CSceneManager::m_WeatherManager.m_DetailFixColor[SelCur].r,
CSceneManager::m_WeatherManager.m_DetailFixColor[SelCur].g,
CSceneManager::m_WeatherManager.m_DetailFixColor[SelCur].b);
m_cSpecularReflectionRate=RGB(CSceneManager::m_WeatherManager.m_SpecularReflectionRate[SelCur].r,
CSceneManager::m_WeatherManager.m_SpecularReflectionRate[SelCur].g,
CSceneManager::m_WeatherManager.m_SpecularReflectionRate[SelCur].b);
m_cGrass=RGB(CSceneManager::m_WeatherManager.m_GrassColor[SelCur].r,
CSceneManager::m_WeatherManager.m_GrassColor[SelCur].g,
CSceneManager::m_WeatherManager.m_GrassColor[SelCur].b);
m_cGlareSkyUpper=RGB(CSceneManager::m_WeatherManager.m_GlareSkyUpper[SelCur].r,
CSceneManager::m_WeatherManager.m_GlareSkyUpper[SelCur].g,
CSceneManager::m_WeatherManager.m_GlareSkyUpper[SelCur].b);
m_cClareSkyLower=RGB(CSceneManager::m_WeatherManager.m_GlareSkyLower[SelCur].r,
CSceneManager::m_WeatherManager.m_GlareSkyLower[SelCur].g,
CSceneManager::m_WeatherManager.m_GlareSkyLower[SelCur].b);
m_cCharacterAmbient=RGB(CSceneManager::m_WeatherManager.m_CharacterAmbient[SelCur].r,
CSceneManager::m_WeatherManager.m_CharacterAmbient[SelCur].g,
CSceneManager::m_WeatherManager.m_CharacterAmbient[SelCur].b);
m_cCharacterLight=RGB(CSceneManager::m_WeatherManager.m_CharacterLight[SelCur].r,
CSceneManager::m_WeatherManager.m_CharacterLight[SelCur].g,
CSceneManager::m_WeatherManager.m_CharacterLight[SelCur].b);
m_cTerrainColor=RGB(CSceneManager::m_WeatherManager.m_TerrainColor[SelCur].r,
CSceneManager::m_WeatherManager.m_TerrainColor[SelCur].g,
CSceneManager::m_WeatherManager.m_TerrainColor[SelCur].b);
m_cWaterColor=RGB(CSceneManager::m_WeatherManager.m_WaterColor[SelCur].r,
CSceneManager::m_WeatherManager.m_WaterColor[SelCur].g,
CSceneManager::m_WeatherManager.m_WaterColor[SelCur].b);
m_cFurGrassColor=RGB(CSceneManager::m_WeatherManager.m_FurGrassColor[SelCur].r,
CSceneManager::m_WeatherManager.m_FurGrassColor[SelCur].g,
CSceneManager::m_WeatherManager.m_FurGrassColor[SelCur].b);
}
m_fGlowSize = CSceneManager::m_fGlowPlaneRange;
m_fLightRange = CSceneManager::m_CharacterLight.Range;
m_cCharacterNColor = RGB(CSceneManager::m_CharacterLight.Diffuse.r * 255.0f,
CSceneManager::m_CharacterLight.Diffuse.g * 255.0f,
CSceneManager::m_CharacterLight.Diffuse.b * 255.0f);
/*
m_cDetailFixColor=RGB(CSectorScene::m_TerrainDetailFixColor.r,
CSectorScene::m_TerrainDetailFixColor.g,CSectorScene::m_TerrainDetailFixColor.b);
*/
CSceneManager::SetWeatherTime((float)SelCur);
CSceneManager::m_WeatherManager.SetWeather((float)SelCur,BaseGraphicsLayer::GetDevice());
CSceneManager::m_WeatherManager.m_CustomWaterColor=false;
if(SelCur==24)
CSceneManager::m_WeatherManager.m_CustomWaterColor=true;
else
CSceneManager::m_WeatherManager.m_CustomWaterColor=false;
CMainFrame *mf=(CMainFrame*)AfxGetApp()->m_pMainWnd;
if(mf)
((CWorldCreatorView*)mf->GetActiveView())->Render();
UpdateData(FALSE);
}
void CDlgWeatherColor::OnOK()
{
// TODO: Add extra validation here
CDialog::OnOK();
}
void CDlgWeatherColor::OnButtonWeathercolorsave()
{
// TODO: Add your control notification handler code here
UpdateData();
int SelCur=m_WeatherList.GetCurSel();
if(SelCur==-1)
return;
if(CSceneManager::m_WeatherManager.m_bSubTable)
{
int iSub = CSceneManager::m_WeatherManager.m_iSubCurrentIndex;
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SkyNeighborColor[SelCur].r=GetRValue(m_cSkyNeighborColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SkyNeighborColor[SelCur].g=GetGValue(m_cSkyNeighborColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SkyNeighborColor[SelCur].b=GetBValue(m_cSkyNeighborColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SkyCenterColor[SelCur].r=GetRValue(m_cSkyCenterColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SkyCenterColor[SelCur].g=GetGValue(m_cSkyCenterColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SkyCenterColor[SelCur].b=GetBValue(m_cSkyCenterColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogColor[SelCur].r=GetRValue(m_cFogColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogColor[SelCur].g=GetGValue(m_cFogColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogColor[SelCur].b=GetBValue(m_cFogColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_LightColor[SelCur].r=GetRValue(m_cLightColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_LightColor[SelCur].g=GetGValue(m_cLightColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_LightColor[SelCur].b=GetBValue(m_cLightColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_AmbientColor[SelCur].r=GetRValue(m_cAmbientColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_AmbientColor[SelCur].g=GetGValue(m_cAmbientColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_AmbientColor[SelCur].b=GetBValue(m_cAmbientColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogLayer[SelCur][0].r=GetRValue(m_cCloudColor1);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogLayer[SelCur][0].g=GetGValue(m_cCloudColor1);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogLayer[SelCur][0].b=GetBValue(m_cCloudColor1);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogLayer[SelCur][1].r=GetRValue(m_cCloudColor2);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogLayer[SelCur][1].g=GetGValue(m_cCloudColor2);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogLayer[SelCur][1].b=GetBValue(m_cCloudColor2);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogLayer[SelCur][2].r=GetRValue(m_cCloudColor3);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogLayer[SelCur][2].g=GetGValue(m_cCloudColor3);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogLayer[SelCur][2].b=GetBValue(m_cCloudColor3);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_ObjectAmbientColor[SelCur].r=GetRValue(m_cObjectAmbient);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_ObjectAmbientColor[SelCur].g=GetGValue(m_cObjectAmbient);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_ObjectAmbientColor[SelCur].b=GetBValue(m_cObjectAmbient);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogRangeNear[SelCur]=m_fFogStart;
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FogRangeFar[SelCur]=m_fFogEnd;
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SkyFogFar[SelCur]=m_fSkyFogEnd;
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SunPosition[SelCur]=m_fSunPos;
/*CSectorScene::m_TerrainDetailFixColor.r=GetRValue(m_cDetailFixColor);
CSectorScene::m_TerrainDetailFixColor.g=GetGValue(m_cDetailFixColor);
CSectorScene::m_TerrainDetailFixColor.b=GetBValue(m_cDetailFixColor);
*/
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_DetailFixColor[SelCur].r = GetRValue(m_cDetailFixColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_DetailFixColor[SelCur].g = GetGValue(m_cDetailFixColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_DetailFixColor[SelCur].b = GetBValue(m_cDetailFixColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SpecularReflectionRate[SelCur].r=GetRValue(m_cSpecularReflectionRate);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SpecularReflectionRate[SelCur].g=GetGValue(m_cSpecularReflectionRate);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_SpecularReflectionRate[SelCur].b=GetBValue(m_cSpecularReflectionRate);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_GrassColor[SelCur].r=GetRValue(m_cGrass);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_GrassColor[SelCur].g=GetGValue(m_cGrass);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_GrassColor[SelCur].b=GetBValue(m_cGrass);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_GlareSkyUpper[SelCur].r=GetRValue(m_cGlareSkyUpper);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_GlareSkyUpper[SelCur].g=GetGValue(m_cGlareSkyUpper);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_GlareSkyUpper[SelCur].b=GetBValue(m_cGlareSkyUpper);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_GlareSkyLower[SelCur].r=GetRValue(m_cClareSkyLower);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_GlareSkyLower[SelCur].g=GetGValue(m_cClareSkyLower);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_GlareSkyLower[SelCur].b=GetBValue(m_cClareSkyLower);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_CharacterAmbient[SelCur].r=GetRValue(m_cCharacterAmbient);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_CharacterAmbient[SelCur].g=GetGValue(m_cCharacterAmbient);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_CharacterAmbient[SelCur].b=GetBValue(m_cCharacterAmbient);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_CharacterLight[SelCur].r=GetRValue(m_cCharacterLight);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_CharacterLight[SelCur].g=GetGValue(m_cCharacterLight);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_CharacterLight[SelCur].b=GetBValue(m_cCharacterLight);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_TerrainColor[SelCur].r=GetRValue(m_cTerrainColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_TerrainColor[SelCur].g=GetGValue(m_cTerrainColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_TerrainColor[SelCur].b=GetBValue(m_cTerrainColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_WaterColor[SelCur].r=GetRValue(m_cWaterColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_WaterColor[SelCur].g=GetGValue(m_cWaterColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_WaterColor[SelCur].b=GetBValue(m_cWaterColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FurGrassColor[SelCur].r=GetRValue(m_cFurGrassColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FurGrassColor[SelCur].g=GetGValue(m_cFurGrassColor);
CSceneManager::m_WeatherManager.m_pSubWeatherTable[iSub].m_FurGrassColor[SelCur].b=GetBValue(m_cFurGrassColor);
}
else
{
CSceneManager::m_WeatherManager.m_SkyNeighborColor[SelCur].r=GetRValue(m_cSkyNeighborColor);
CSceneManager::m_WeatherManager.m_SkyNeighborColor[SelCur].g=GetGValue(m_cSkyNeighborColor);
CSceneManager::m_WeatherManager.m_SkyNeighborColor[SelCur].b=GetBValue(m_cSkyNeighborColor);
CSceneManager::m_WeatherManager.m_SkyCenterColor[SelCur].r=GetRValue(m_cSkyCenterColor);
CSceneManager::m_WeatherManager.m_SkyCenterColor[SelCur].g=GetGValue(m_cSkyCenterColor);
CSceneManager::m_WeatherManager.m_SkyCenterColor[SelCur].b=GetBValue(m_cSkyCenterColor);
CSceneManager::m_WeatherManager.m_FogColor[SelCur].r=GetRValue(m_cFogColor);
CSceneManager::m_WeatherManager.m_FogColor[SelCur].g=GetGValue(m_cFogColor);
CSceneManager::m_WeatherManager.m_FogColor[SelCur].b=GetBValue(m_cFogColor);
CSceneManager::m_WeatherManager.m_LightColor[SelCur].r=GetRValue(m_cLightColor);
CSceneManager::m_WeatherManager.m_LightColor[SelCur].g=GetGValue(m_cLightColor);
CSceneManager::m_WeatherManager.m_LightColor[SelCur].b=GetBValue(m_cLightColor);
CSceneManager::m_WeatherManager.m_AmbientColor[SelCur].r=GetRValue(m_cAmbientColor);
CSceneManager::m_WeatherManager.m_AmbientColor[SelCur].g=GetGValue(m_cAmbientColor);
CSceneManager::m_WeatherManager.m_AmbientColor[SelCur].b=GetBValue(m_cAmbientColor);
CSceneManager::m_WeatherManager.m_FogLayer[SelCur][0].r=GetRValue(m_cCloudColor1);
CSceneManager::m_WeatherManager.m_FogLayer[SelCur][0].g=GetGValue(m_cCloudColor1);
CSceneManager::m_WeatherManager.m_FogLayer[SelCur][0].b=GetBValue(m_cCloudColor1);
CSceneManager::m_WeatherManager.m_FogLayer[SelCur][1].r=GetRValue(m_cCloudColor2);
CSceneManager::m_WeatherManager.m_FogLayer[SelCur][1].g=GetGValue(m_cCloudColor2);
CSceneManager::m_WeatherManager.m_FogLayer[SelCur][1].b=GetBValue(m_cCloudColor2);
CSceneManager::m_WeatherManager.m_FogLayer[SelCur][2].r=GetRValue(m_cCloudColor3);
CSceneManager::m_WeatherManager.m_FogLayer[SelCur][2].g=GetGValue(m_cCloudColor3);
CSceneManager::m_WeatherManager.m_FogLayer[SelCur][2].b=GetBValue(m_cCloudColor3);
CSceneManager::m_WeatherManager.m_ObjectAmbientColor[SelCur].r=GetRValue(m_cObjectAmbient);
CSceneManager::m_WeatherManager.m_ObjectAmbientColor[SelCur].g=GetGValue(m_cObjectAmbient);
CSceneManager::m_WeatherManager.m_ObjectAmbientColor[SelCur].b=GetBValue(m_cObjectAmbient);
CSceneManager::m_WeatherManager.m_FogRangeNear[SelCur]=m_fFogStart;
CSceneManager::m_WeatherManager.m_FogRangeFar[SelCur]=m_fFogEnd;
CSceneManager::m_WeatherManager.m_SkyFogFar[SelCur]=m_fSkyFogEnd;
CSceneManager::m_WeatherManager.m_SunPosition[SelCur]=m_fSunPos;
/*CSectorScene::m_TerrainDetailFixColor.r=GetRValue(m_cDetailFixColor);
CSectorScene::m_TerrainDetailFixColor.g=GetGValue(m_cDetailFixColor);
CSectorScene::m_TerrainDetailFixColor.b=GetBValue(m_cDetailFixColor);
*/
CSceneManager::m_WeatherManager.m_DetailFixColor[SelCur].r = GetRValue(m_cDetailFixColor);
CSceneManager::m_WeatherManager.m_DetailFixColor[SelCur].g = GetGValue(m_cDetailFixColor);
CSceneManager::m_WeatherManager.m_DetailFixColor[SelCur].b = GetBValue(m_cDetailFixColor);
CSceneManager::m_WeatherManager.m_SpecularReflectionRate[SelCur].r=GetRValue(m_cSpecularReflectionRate);
CSceneManager::m_WeatherManager.m_SpecularReflectionRate[SelCur].g=GetGValue(m_cSpecularReflectionRate);
CSceneManager::m_WeatherManager.m_SpecularReflectionRate[SelCur].b=GetBValue(m_cSpecularReflectionRate);
CSceneManager::m_WeatherManager.m_GrassColor[SelCur].r=GetRValue(m_cGrass);
CSceneManager::m_WeatherManager.m_GrassColor[SelCur].g=GetGValue(m_cGrass);
CSceneManager::m_WeatherManager.m_GrassColor[SelCur].b=GetBValue(m_cGrass);
CSceneManager::m_WeatherManager.m_GlareSkyUpper[SelCur].r=GetRValue(m_cGlareSkyUpper);
CSceneManager::m_WeatherManager.m_GlareSkyUpper[SelCur].g=GetGValue(m_cGlareSkyUpper);
CSceneManager::m_WeatherManager.m_GlareSkyUpper[SelCur].b=GetBValue(m_cGlareSkyUpper);
CSceneManager::m_WeatherManager.m_GlareSkyLower[SelCur].r=GetRValue(m_cClareSkyLower);
CSceneManager::m_WeatherManager.m_GlareSkyLower[SelCur].g=GetGValue(m_cClareSkyLower);
CSceneManager::m_WeatherManager.m_GlareSkyLower[SelCur].b=GetBValue(m_cClareSkyLower);
CSceneManager::m_WeatherManager.m_CharacterAmbient[SelCur].r=GetRValue(m_cCharacterAmbient);
CSceneManager::m_WeatherManager.m_CharacterAmbient[SelCur].g=GetGValue(m_cCharacterAmbient);
CSceneManager::m_WeatherManager.m_CharacterAmbient[SelCur].b=GetBValue(m_cCharacterAmbient);
CSceneManager::m_WeatherManager.m_CharacterLight[SelCur].r=GetRValue(m_cCharacterLight);
CSceneManager::m_WeatherManager.m_CharacterLight[SelCur].g=GetGValue(m_cCharacterLight);
CSceneManager::m_WeatherManager.m_CharacterLight[SelCur].b=GetBValue(m_cCharacterLight);
CSceneManager::m_WeatherManager.m_TerrainColor[SelCur].r=GetRValue(m_cTerrainColor);
CSceneManager::m_WeatherManager.m_TerrainColor[SelCur].g=GetGValue(m_cTerrainColor);
CSceneManager::m_WeatherManager.m_TerrainColor[SelCur].b=GetBValue(m_cTerrainColor);
CSceneManager::m_WeatherManager.m_WaterColor[SelCur].r=GetRValue(m_cWaterColor);
CSceneManager::m_WeatherManager.m_WaterColor[SelCur].g=GetGValue(m_cWaterColor);
CSceneManager::m_WeatherManager.m_WaterColor[SelCur].b=GetBValue(m_cWaterColor);
CSceneManager::m_WeatherManager.m_FurGrassColor[SelCur].r=GetRValue(m_cFurGrassColor);
CSceneManager::m_WeatherManager.m_FurGrassColor[SelCur].g=GetGValue(m_cFurGrassColor);
CSceneManager::m_WeatherManager.m_FurGrassColor[SelCur].b=GetBValue(m_cFurGrassColor);
}
// <20><><EFBFBD><EFBFBD> light setting
CSceneManager::m_CharacterLight.Diffuse.r = GetRValue(m_cCharacterNColor) / 255.0f;
CSceneManager::m_CharacterLight.Diffuse.g = GetGValue(m_cCharacterNColor) / 255.0f;
CSceneManager::m_CharacterLight.Diffuse.b = GetBValue(m_cCharacterNColor) / 255.0f;
CSceneManager::m_CharacterLight.Range = m_fLightRange;
CSceneManager::m_fGlowPlaneRange = m_fGlowSize;
}
void CDlgWeatherColor::OnButtonWeatherfilesave()
{
// TODO: Add your control notification handler code here
if(CSceneManager::m_WeatherManager.m_bSubTable)
{
int iSub = CSceneManager::m_WeatherManager.m_iSubCurrentIndex;
CSceneManager::m_WeatherManager.SaveSub();
}
else
CSceneManager::m_WeatherManager.Save();
}
void CDlgWeatherColor::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// TODO: Add your message handler code here and/or call default
if(nChar==VK_RETURN)
{
CMainFrame *mf=(CMainFrame*)AfxGetApp()->m_pMainWnd;
if(mf)
((CWorldCreatorView*)mf->GetActiveView())->Render();
}
CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
}
void CDlgWeatherColor::OnLbnSelchangeListWeathertimelist()
{
// TODO: <20><><EFBFBD><20><>Ʈ<EFBFBD><C6AE> <20>˸<EFBFBD> ó<><C3B3><EFBFBD><EFBFBD> <20>ڵ带 <20>߰<EFBFBD><DFB0>մϴ<D5B4>.
}

View File

@@ -0,0 +1,108 @@
#if !defined(AFX_DLGWEATHERCOLOR_H__928FD89F_C7A4_4FA7_A18A_3E8343557A91__INCLUDED_)
#define AFX_DLGWEATHERCOLOR_H__928FD89F_C7A4_4FA7_A18A_3E8343557A91__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgWeatherColor.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgWeatherColor dialog
#include "ColourPicker.h"
class CDlgWeatherColor : public CDialog
{
// Construction
public:
CDlgWeatherColor(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgWeatherColor)
enum { IDD = IDD_DIALOG_WEATHER };
CColourPicker m_CharacterNightColor;
CColourPicker m_FurGrassColor;
CColourPicker m_WaterColor;
CColourPicker m_TerrainColor;
CColourPicker m_SpecularReflectionRate;
CColourPicker m_GrassColor;
CColourPicker m_GlareSkyUpper;
CColourPicker m_ClareSkyLowerColor;
CColourPicker m_CharacterAmbientColor;
CColourPicker m_CharacterLightColor;
CColourPicker m_DetailFixColor;
CListBox m_WeatherList;
CColourPicker m_SkyNeighborColor;
CColourPicker m_SkyCenterColor;
CColourPicker m_FogColor;
CColourPicker m_LightColor;
CColourPicker m_AmbientColor;
CColourPicker m_CloudColor1;
CColourPicker m_CloudColor2;
CColourPicker m_CloudColor3;
CColourPicker m_SunColor;
CColourPicker m_FlareColor;
CColourPicker m_ObjectAmbient;
float m_fFlareSize;
float m_fFogEnd;
float m_fFogStart;
float m_fSkyFogEnd;
float m_fSunPos;
float m_fSunSize;
COLORREF m_cDetailFixColor;
COLORREF m_cSkyNeighborColor;
COLORREF m_cSkyCenterColor;
COLORREF m_cFogColor;
COLORREF m_cLightColor;
COLORREF m_cAmbientColor;
COLORREF m_cCloudColor1;
COLORREF m_cCloudColor2;
COLORREF m_cCloudColor3;
COLORREF m_cSunColor;
COLORREF m_cFlareColor;
COLORREF m_cObjectAmbient;
COLORREF m_cSpecularReflectionRate;
COLORREF m_cGrass;
COLORREF m_cGlareSkyUpper;
COLORREF m_cClareSkyLower;
COLORREF m_cCharacterAmbient;
COLORREF m_cCharacterLight;
COLORREF m_cTerrainColor;
COLORREF m_cWaterColor;
COLORREF m_cFurGrassColor;
COLORREF m_cCharacterNColor;
float m_fGlowSize;
float m_fLightRange;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgWeatherColor)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgWeatherColor)
virtual BOOL OnInitDialog();
afx_msg void OnDblclkListWeathertimelist();
virtual void OnOK();
afx_msg void OnButtonWeathercolorsave();
afx_msg void OnButtonWeatherfilesave();
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
afx_msg void OnLbnSelchangeListWeathertimelist();
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGWEATHERCOLOR_H__928FD89F_C7A4_4FA7_A18A_3E8343557A91__INCLUDED_)

View File

@@ -0,0 +1,211 @@
// DlgWideLoad.cpp : implementation file
//
#include "stdafx.h"
#include "worldcreator.h"
#include "DlgWideLoad.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CDlgWideLoad dialog
CDlgWideLoad::CDlgWideLoad(CWnd* pParent /*=NULL*/)
: CDialog(CDlgWideLoad::IDD, pParent)
{
//{{AFX_DATA_INIT(CDlgWideLoad)
m_isWideLoaded = FALSE;
m_strWideName = _T("");
m_isWideLoaded1 = FALSE;
m_isWideLoaded2 = FALSE;
m_isDetailLoaded = FALSE;
m_isDetailLoaded1 = FALSE;
m_isDetailLoaded2 = FALSE;
//}}AFX_DATA_INIT
}
void CDlgWideLoad::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDlgWideLoad)
DDX_Check(pDX, IDC_CHECK_WIDETEXTURELOAD, m_isWideLoaded);
DDX_Text(pDX, IDC_EDIT_WIDETEXTURENAME, m_strWideName);
DDX_Check(pDX, IDC_CHECK_WIDETEXTURELOAD1, m_isWideLoaded1);
DDX_Check(pDX, IDC_CHECK_WIDETEXTURELOAD2, m_isWideLoaded2);
DDX_Check(pDX, IDC_CHECK_DETAILTEXTURELOAD, m_isDetailLoaded);
DDX_Check(pDX, IDC_CHECK_DETAILTEXTURELOAD1, m_isDetailLoaded1);
DDX_Check(pDX, IDC_CHECK_DETAILTEXTURELOAD2, m_isDetailLoaded2);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDlgWideLoad, CDialog)
//{{AFX_MSG_MAP(CDlgWideLoad)
ON_BN_CLICKED(IDC_CHECK_WIDETEXTURELOAD, OnCheckWidetextureload)
ON_EN_UPDATE(IDC_EDIT_WIDETEXTURENAME, OnUpdateEditWidetexturename)
ON_BN_CLICKED(IDC_CHECK_DETAILTEXTURELOAD, OnCheckDetailtextureload)
ON_BN_CLICKED(IDC_CHECK_WIDETEXTURELOAD1, OnCheckWidetextureload1)
ON_BN_CLICKED(IDC_CHECK_DETAILTEXTURELOAD1, OnCheckDetailtextureload1)
ON_BN_CLICKED(IDC_CHECK_WIDETEXTURELOAD2, OnCheckWidetextureload2)
ON_BN_CLICKED(IDC_CHECK_DETAILTEXTURELOAD2, OnCheckDetailtextureload2)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDlgWideLoad message handlers
void CDlgWideLoad::OnCheckWidetextureload()
{
// TODO: Add your control notification handler code here
UpdateData();
if(m_isWideLoaded)
{
CString strFilter = DDSFILE;
CFileDialog filedia(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.DoModal();
if(filedia.GetFileName()=="")
m_isWideLoaded=FALSE;
m_strWideTextureName[0]=filedia.GetFileName();
CWnd *forname=GetDlgItem(IDC_CHECK_WIDETEXTURELOAD);
forname->SetWindowText(m_strWideTextureName[0]);
}
else
{
m_strWideTextureName[0]="";
CWnd *forname=GetDlgItem(IDC_CHECK_WIDETEXTURELOAD);
forname->SetWindowText("<EFBFBD><EFBFBD><EFBFBD>þȵ<EFBFBD>");
}
UpdateData(FALSE);
}
void CDlgWideLoad::OnUpdateEditWidetexturename()
{
// TODO: Add your control notification handler code here
UpdateData();
}
void CDlgWideLoad::OnCheckDetailtextureload()
{
// TODO: Add your control notification handler code here
UpdateData();
if(m_isDetailLoaded)
{
CString strFilter = DDSFILE;
CFileDialog filedia(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.DoModal();
if(filedia.GetFileName()=="")
m_isDetailLoaded=FALSE;
m_strDetailTextureName[0]=filedia.GetFileName();
CWnd *forname=GetDlgItem(IDC_CHECK_DETAILTEXTURELOAD);
forname->SetWindowText(m_strDetailTextureName[0]);
}
else
{
m_strDetailTextureName[0]="";
CWnd *forname=GetDlgItem(IDC_CHECK_DETAILTEXTURELOAD);
forname->SetWindowText("<EFBFBD><EFBFBD><EFBFBD>þȵ<EFBFBD>");
}
UpdateData(FALSE);
}
void CDlgWideLoad::OnCheckWidetextureload1()
{
// TODO: Add your control notification handler code here
UpdateData();
if(m_isWideLoaded1)
{
CString strFilter = DDSFILE;
CFileDialog filedia(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.DoModal();
if(filedia.GetFileName()=="")
m_isWideLoaded1=FALSE;
m_strWideTextureName[1]=filedia.GetFileName();
CWnd *forname=GetDlgItem(IDC_CHECK_WIDETEXTURELOAD1);
forname->SetWindowText(m_strWideTextureName[1]);
}
else
{
m_strWideTextureName[1]="";
CWnd *forname=GetDlgItem(IDC_CHECK_WIDETEXTURELOAD1);
forname->SetWindowText("<EFBFBD><EFBFBD><EFBFBD>þȵ<EFBFBD>");
}
UpdateData(FALSE);
}
void CDlgWideLoad::OnCheckDetailtextureload1()
{
// TODO: Add your control notification handler code here
UpdateData();
if(m_isDetailLoaded1)
{
CString strFilter = DDSFILE;
CFileDialog filedia(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.DoModal();
if(filedia.GetFileName()=="")
m_isDetailLoaded1=FALSE;
m_strDetailTextureName[1]=filedia.GetFileName();
CWnd *forname=GetDlgItem(IDC_CHECK_DETAILTEXTURELOAD1);
forname->SetWindowText(m_strDetailTextureName[1]);
}
else
{
m_strWideTextureName[1]="";
CWnd *forname=GetDlgItem(IDC_CHECK_DETAILTEXTURELOAD1);
forname->SetWindowText("<EFBFBD><EFBFBD><EFBFBD>þȵ<EFBFBD>");
}
UpdateData(FALSE);
}
void CDlgWideLoad::OnCheckWidetextureload2()
{
// TODO: Add your control notification handler code here
UpdateData();
if(m_isWideLoaded2)
{
CString strFilter = DDSFILE;
CFileDialog filedia(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.DoModal();
if(filedia.GetFileName()=="")
m_isWideLoaded2=FALSE;
m_strWideTextureName[2]=filedia.GetFileName();
CWnd *forname=GetDlgItem(IDC_CHECK_WIDETEXTURELOAD2);
forname->SetWindowText(m_strWideTextureName[2]);
}
else
{
m_strWideTextureName[2]="";
CWnd *forname=GetDlgItem(IDC_CHECK_WIDETEXTURELOAD2);
forname->SetWindowText("<EFBFBD><EFBFBD><EFBFBD>þȵ<EFBFBD>");
}
UpdateData(FALSE);
}
void CDlgWideLoad::OnCheckDetailtextureload2()
{
// TODO: Add your control notification handler code here
UpdateData();
if(m_isDetailLoaded2)
{
CString strFilter = DDSFILE;
CFileDialog filedia(TRUE,NULL,NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,strFilter,this);
filedia.DoModal();
if(filedia.GetFileName()=="")
m_isDetailLoaded2=FALSE;
m_strDetailTextureName[2]=filedia.GetFileName();
CWnd *forname=GetDlgItem(IDC_CHECK_DETAILTEXTURELOAD2);
forname->SetWindowText(m_strDetailTextureName[2]);
}
else
{
m_strWideTextureName[2]="";
CWnd *forname=GetDlgItem(IDC_CHECK_DETAILTEXTURELOAD2);
forname->SetWindowText("<EFBFBD><EFBFBD><EFBFBD>þȵ<EFBFBD>");
}
UpdateData(FALSE);
}

View File

@@ -0,0 +1,60 @@
#if !defined(AFX_DLGWIDELOAD_H__93B8A564_9675_49F7_B3AD_37BFC9CFD96D__INCLUDED_)
#define AFX_DLGWIDELOAD_H__93B8A564_9675_49F7_B3AD_37BFC9CFD96D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// DlgWideLoad.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDlgWideLoad dialog
class CDlgWideLoad : public CDialog
{
// Construction
public:
CDlgWideLoad(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CDlgWideLoad)
enum { IDD = IDD_DIALOG_WIDETEXTURELOAD };
BOOL m_isWideLoaded;
CString m_strWideName;
BOOL m_isWideLoaded1;
BOOL m_isWideLoaded2;
BOOL m_isDetailLoaded;
BOOL m_isDetailLoaded1;
BOOL m_isDetailLoaded2;
//}}AFX_DATA
CString m_strWideTextureName[3];
CString m_strDetailTextureName[3];
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDlgWideLoad)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDlgWideLoad)
afx_msg void OnCheckWidetextureload();
afx_msg void OnUpdateEditWidetexturename();
afx_msg void OnCheckDetailtextureload();
afx_msg void OnCheckWidetextureload1();
afx_msg void OnCheckDetailtextureload1();
afx_msg void OnCheckWidetextureload2();
afx_msg void OnCheckDetailtextureload2();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DLGWIDELOAD_H__93B8A564_9675_49F7_B3AD_37BFC9CFD96D__INCLUDED_)

View File

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
[2003-4-16 15:34:55] <20><><EFBFBD><EFBFBD>Ʈ <20><>ũ<EFBFBD><C5A9><EFBFBD><EFBFBD> <20>޸<EFBFBD><DEB8><EFBFBD> Ǯ<><C7AE><EFBFBD><EFBFBD> 2<><32><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʾҽ<CABE><D2BD>ϴ<EFBFBD>. <20>α׷<CEB1> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
[2003-4-16 15:36:2] <20><><EFBFBD><EFBFBD>Ʈ <20><>ũ<EFBFBD><C5A9><EFBFBD><EFBFBD> <20>޸<EFBFBD><DEB8><EFBFBD> Ǯ<><C7AE><EFBFBD><EFBFBD> 4<><34><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʾҽ<CABE><D2BD>ϴ<EFBFBD>. <20>α׷<CEB1> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.

View File

@@ -0,0 +1,70 @@
// FrameTimer.cpp: implementation of the CFrameTimer class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "FrameTimer.h"
List<float> CFrameTimer::m_fUpdateTimeList;
List<float> CFrameTimer::m_fTimeRemainList;
List<float> CFrameTimer::m_fPerSecondUpdateList;
DWORD CFrameTimer::m_dwTickTime;
DWORD CFrameTimer::m_dwLastUpdateTime;
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
CFrameTimer::CFrameTimer()
{
m_dwTickTime=-1;
}
CFrameTimer::~CFrameTimer()
{
}
void CFrameTimer::Create()
{
}
void CFrameTimer::UpdateTime()
{
if(m_dwTickTime==-1)
{
m_dwTickTime=GetTickCount();
m_dwLastUpdateTime=m_dwTickTime;
}
DWORD dwOldTickTime=m_dwTickTime;
m_dwTickTime=GetTickCount();
DWORD dwIntervalPreTime=m_dwTickTime-dwOldTickTime;
for(int i=0;i<m_fUpdateTimeList.num;i++)
{
m_fUpdateTimeList[i]=(float)dwIntervalPreTime/(1000.0f/m_fPerSecondUpdateList[i]);
m_fUpdateTimeList[i]+=m_fTimeRemainList[i];
m_fTimeRemainList[i]=m_fUpdateTimeList[i]-(int)m_fUpdateTimeList[i];
}
/*
float fUpdateFrameRate=(float)(m_dwTickTime-dwOldTickTime)/(1000.0f/35.0f);
return fUpdateFrameRate;
*/
}
int CFrameTimer::Regist(float fPerSecondUpdate)
{
m_fUpdateTimeList.Add(0.0f);
m_fTimeRemainList.Add(0.0f);
m_fPerSecondUpdateList.Add(fPerSecondUpdate);
return m_fUpdateTimeList.num-1;
}
float CFrameTimer::GetUpdateTimer(int nTimer)
{
//return 0.0f;
return m_fUpdateTimeList[nTimer];
}

View File

@@ -0,0 +1,31 @@
// FrameTimer.h: interface for the CFrameTimer class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_FRAMETIMER_H__6C017430_DEBB_4372_B200_70D57C02B061__INCLUDED_)
#define AFX_FRAMETIMER_H__6C017430_DEBB_4372_B200_70D57C02B061__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <d3d8.h>
#include "List.h"
class CFrameTimer
{
public:
static float GetUpdateTimer(int nTimer);
static int Regist(float fPerSecondUpdate);
static void UpdateTime();
static List<float> m_fUpdateTimeList;
static List<float> m_fTimeRemainList;
static List<float> m_fPerSecondUpdateList;
static DWORD m_dwTickTime;
static DWORD m_dwLastUpdateTime;
static void Create();
CFrameTimer();
virtual ~CFrameTimer();
};
#endif // !defined(AFX_FRAMETIMER_H__6C017430_DEBB_4372_B200_70D57C02B061__INCLUDED_)

View File

@@ -0,0 +1,166 @@
cds_test.GCMDS
mon_agu.GCMDS
MON_Amphibian.GCMDS
MON_Amphibian_sorcerer.GCMDS
mon_ancientgolem.GCMDS
MON_AncientGuard_warrior.GCMDS
mon_a_zombie.GCMDS
mon_barick.GCMDS
MON_Bat.GCMDS
MON_Bear.GCMDS
MON_Beholder.GCMDS
MON_Bronji.GCMDS
mon_bullent.GCMDS
MON_Bulte.GCMDS
MON_Carrion.GCMDS
mon_ceratops.GCMDS
MON_Chulpawn.GCMDS
mon_clinzer.GCMDS
mon_cramos.GCMDS
mon_curumin.GCMDS
mon_dante.GCMDS
MON_Daramji.GCMDS
MON_DarkWarrior.GCMDS
MON_Dark_defender.GCMDS
MON_Dark_mage.GCMDS
MON_Dark_warrior.GCMDS
MON_Eloyee.GCMDS
MON_Eloyee_mage.GCMDS
MON_Field.GCMDS
MON_Frincle.GCMDS
mon_fungus.GCMDS
mon_fungus01.GCMDS
mon_fungus02.GCMDS
mon_gavial.GCMDS
mon_globus.GCMDS
MON_Goblin.GCMDS
MON_GoblinWarrior.GCMDS
MON_Goblin_mage.GCMDS
MON_Goblin_warrior.GCMDS
MON_Golem.GCMDS
MON_golemking.GCMDS
mon_gorep.GCMDS
MON_Gorgon.GCMDS
MON_Gorgon_Female.GCMDS
mon_head.GCMDS
MON_HiddenEye.GCMDS
MON_HiddenEye_mage.GCMDS
mon_iguanodon.GCMDS
MON_Kobold_mage.GCMDS
mon_korkebine.GCMDS
MON_Labstar.GCMDS
MON_Lizardman.GCMDS
MON_LizardmanLeader.GCMDS
MON_Lizardman_mage.GCMDS
MON_Lizardman_warrior.GCMDS
mon_makin.GCMDS
mon_makin02.GCMDS
MON_Medusa.GCMDS
mon_mimic.GCMDS
MON_NightWolf.GCMDS
MON_NightWolf_attacker.GCMDS
mon_nonut.GCMDS
mon_nymbus.GCMDS
MON_omurten.GCMDS
MON_Orc.GCMDS
MON_Orc_defender.GCMDS
MON_Orc_mage.GCMDS
mon_ostrisaur.GCMDS
MON_Pawnpawn.GCMDS
mon_prebic.GCMDS
mon_prebic02.GCMDS
mon_pulkhan.GCMDS
mon_pulkhan02.GCMDS
mon_queen.GCMDS
mon_queen02.GCMDS
mon_querf.GCMDS
mon_rhinoman.GCMDS
mon_rich.GCMDS
mon_rockturtle.GCMDS
mon_scorpion.GCMDS
MON_Seaman.GCMDS
MON_Seaman_mage.GCMDS
MON_Seaman_warrior.GCMDS
mon_shogen_master_black.GCMDS
mon_shogen_master_red.GCMDS
MON_Skeleton.GCMDS
MON_SkeletonWarrior.GCMDS
MON_Skeleton_warrior.GCMDS
MON_Skullbat.GCMDS
mon_slephi.GCMDS
mon_sloter.GCMDS
mon_specter.GCMDS
MON_Spider.GCMDS
mon_spis.GCMDS
MON_SsangNom.GCMDS
mon_tirider.GCMDS
mon_titano.GCMDS
MON_Titug.GCMDS
mon_tizer.GCMDS
mon_tower.GCMDS
mon_tren.GCMDS
mon_trenber.GCMDS
MON_Tribal_shaman.GCMDS
MON_Tribal_warrior.GCMDS
MON_Troll.GCMDS
MON_Troll_mage.GCMDS
MON_Troll_warrior.GCMDS
mon_un.GCMDS
mon_unmon.GCMDS
mon_venom.GCMDS
mon_vicrocodile.GCMDS
MON_Wolf.GCMDS
mon_wolfgirl.GCMDS
MON_Wolf_attacker.GCMDS
MON_Yang.GCMDS
mon_york.GCMDS
MON_YoungBear.GCMDS
MON_Zombie.GCMDS
MON_ZombieDog.GCMDS
NPC_A_blacksmith.GCMDS
NPC_A_blacksmith2.GCMDS
NPC_A_black_market.GCMDS
NPC_A_boy.GCMDS
NPC_A_boy_b.GCMDS
NPC_A_combat_t.GCMDS
NPC_A_defense.GCMDS
NPC_A_depositary.GCMDS
NPC_A_guardian_soldier.GCMDS
NPC_A_guide_a.GCMDS
NPC_A_guide_b.GCMDS
NPC_A_iguano.GCMDS
NPC_A_officiator_t.GCMDS
NPC_A_ostri.GCMDS
NPC_A_teleport.GCMDS
NPC_A_weapon.GCMDS
NPC_Donkey.GCMDS
NPC_H_blacksmith.GCMDS
NPC_H_black_market.GCMDS
NPC_H_depositary.GCMDS
NPC_H_teleport.GCMDS
NPC_M01.GCMDS
NPC_M02.GCMDS
NPC_M03.GCMDS
NPC_M04.GCMDS
NPC_M05.GCMDS
NPC_M06.GCMDS
NPC_M07.GCMDS
NPC_M08.GCMDS
NPC_M09.GCMDS
NPC_M10.GCMDS
NPC_M11.GCMDS
NPC_M12.GCMDS
NPC_M13.GCMDS
NPC_M14.GCMDS
NPC_M15.GCMDS
NPC_M16.GCMDS
NPC_W01.GCMDS
NPC_W02.GCMDS
NPC_W03.GCMDS
NPC_W04.GCMDS
NPC_W05.GCMDS
NPC_W06.GCMDS
PC_Akhan_A.GCMDS
PC_Akhan_B.GCMDS
PC_MAN.GCMDS
PC_WOMAN.GCMDS

View File

@@ -0,0 +1,732 @@
// GridListCtrl.cpp : implementation file
//
#include "stdafx.h"
#include "GridListCtrl.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGridListCtrl
CGridListCtrl::CGridListCtrl()
{
m_CurSubItem = -1;
m_pListEdit =NULL;
}
CGridListCtrl::~CGridListCtrl()
{
if( m_pListEdit)
{
delete m_pListEdit;
}
}
BEGIN_MESSAGE_MAP(CGridListCtrl, CListCtrl)
//{{AFX_MSG_MAP(CGridListCtrl)
ON_WM_LBUTTONDOWN()
ON_WM_HSCROLL()
ON_WM_VSCROLL()
ON_NOTIFY_REFLECT(LVN_BEGINLABELEDIT, OnBeginlabeledit)
ON_NOTIFY_REFLECT(LVN_ENDLABELEDIT, OnEndlabeledit)
//}}AFX_MSG_MAP
ON_NOTIFY_REFLECT(NM_CUSTOMDRAW, OnCustomDraw)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGridListCtrl message handlers
BOOL CGridListCtrl::PrepareControl(WORD wStyle)
{
m_wStyle = wStyle;
ASSERT( m_hWnd );
DWORD dwStyle = GetWindowLong(m_hWnd, GWL_STYLE);
dwStyle &= ~(LVS_TYPEMASK);
dwStyle &= ~(LVS_EDITLABELS);
// Make sure we have report view and send edit label messages.
SetWindowLong( m_hWnd, GWL_STYLE, dwStyle | LVS_REPORT );
// Enable the full row selection and the drag drop of headers.
DWORD styles = LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP ;
// Use macro since this is new and not in MFC.
ListView_SetExtendedListViewStyleEx(m_hWnd, styles, styles );
return TRUE;
}
void CGridListCtrl::OnLButtonDown(UINT nFlags, CPoint point)
{
LVHITTESTINFO ht;
ht.pt = point;
// Test for which subitem was clicked.
// Use macro since this is new and not in MFC.
int rval = ListView_SubItemHitTest( m_hWnd, &ht );
// Store the old column number and set the new column value.
int oldsubitem = m_CurSubItem;
m_CurSubItem = IndexToOrder( ht.iSubItem );
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
// Make the column fully visible.
// We have to take into account that the columns may be reordered
MakeColumnVisible( Header_OrderToIndex( pHeader->m_hWnd, m_CurSubItem ) );
// Store old state of the item.
int state = GetItemState( ht.iItem, LVIS_FOCUSED );
// Call default left button click is here just before we might bail.
// Also updates the state of the item.
CListCtrl::OnLButtonDown(nFlags, point);
NMLISTVIEW nmlv;
nmlv.hdr.code = LVN_COLUMNCLICK;
nmlv.hdr.hwndFrom = GetSafeHwnd();
nmlv.hdr.idFrom = (UINT)(::GetMenu( GetSafeHwnd() ));
nmlv.iItem = ht.iItem;
nmlv.iSubItem = ht.iSubItem;
nmlv.uNewState = 0;
nmlv.uOldState = 0;
nmlv.uChanged = 0;
GetParent()->SendMessage( WM_NOTIFY, (WPARAM)0, (LPARAM)(&nmlv) );
// Bail if the state from before was not focused or the
// user has not already clicked on this cell.
if( !state
|| m_CurSubItem == -1
|| oldsubitem != m_CurSubItem )
{
RedrawItems( rval, rval );
return;
}
int doedit = 0;
// If we are in column 0 make sure that the user clicked on
// the item label.
if( 0 == ht.iSubItem )
{
if( ht.flags & LVHT_ONITEMLABEL ) doedit = 1;
}
else
{
doedit = 1;
}
if( !doedit ) return;
// check if focused column has editable attribute
if( GLCT_NORMAL == GetColumnType(ht.iSubItem) )
{
return;
}
// Send Notification to parent of ListView ctrl
CString str;
str = GetItemText( ht.iItem, ht.iSubItem );
LV_DISPINFO dispinfo;
dispinfo.hdr.hwndFrom = m_hWnd;
dispinfo.hdr.idFrom = GetDlgCtrlID();
dispinfo.hdr.code = LVN_BEGINLABELEDIT;
dispinfo.item.mask = LVIF_TEXT;
dispinfo.item.iItem = ht.iItem;
dispinfo.item.iSubItem = ht.iSubItem;
dispinfo.item.pszText = (LPTSTR)((LPCTSTR)str);
dispinfo.item.cchTextMax = str.GetLength();
GetParent()->SendMessage( WM_NOTIFY, GetDlgCtrlID(),
(LPARAM)&dispinfo );
}
BOOL CGridListCtrl::PositionControl( CWnd * pWnd, int iItem, int iSubItem )
{
ASSERT( pWnd && pWnd->m_hWnd );
ASSERT( iItem >= 0 );
// Make sure that the item is visible
if( !EnsureVisible( iItem, TRUE ) ) return NULL;
// Make sure that nCol is valid
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
int nColumnCount = pHeader->GetItemCount();
ASSERT( iSubItem >= 0 && iSubItem < nColumnCount );
if( iSubItem >= nColumnCount ||
// We have to take into account that the header may be reordered
GetColumnWidth(Header_OrderToIndex( pHeader->m_hWnd,iSubItem)) < 5 )
{
return 0;
}
// Get the header order array to sum the column widths up to the selected cell.
int *orderarray = new int[ nColumnCount ];
Header_GetOrderArray( pHeader->m_hWnd, nColumnCount, orderarray );
int offset = 0;
int i;
for( i = 0; orderarray[i] != iSubItem; i++ )
offset += GetColumnWidth( orderarray[i] );
int colwidth = GetColumnWidth( iSubItem );
delete[] orderarray;
CRect rect;
GetItemRect( iItem, &rect, LVIR_BOUNDS );
// Scroll if we need to expose the column
CRect rcClient;
GetClientRect( &rcClient );
if( offset + rect.left < 0 || offset + colwidth + rect.left > rcClient.right )
{
CSize size;
size.cx = offset + rect.left;
size.cy = 0;
Scroll( size );
rect.left -= size.cx;
}
rect.left += offset+4;
rect.right = rect.left + colwidth - 3 ;
// The right end of the control should not go past the edge
// of the grid control.
if( rect.right > rcClient.right)
rect.right = rcClient.right;
pWnd->MoveWindow( &rect );
return 1;
}
void CGridListCtrl::OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult)
{
// This function is called by the control in different
// stages during the control drawing process.
NMLVCUSTOMDRAW *pCD = (NMLVCUSTOMDRAW*)pNMHDR;
// By default set the return value to do the default behavior.
*pResult = 0;
switch( pCD->nmcd.dwDrawStage )
{
case CDDS_PREPAINT: // First stage (for the whole control)
// Tell the control we want to receive drawing messages
// for drawing items.
*pResult = CDRF_NOTIFYITEMDRAW;
// The next stage is handled in the default:
break;
case CDDS_ITEMPREPAINT | CDDS_SUBITEM: // Stage three (called for each subitem of the focused item)
{
// We don't want to draw anything here, but we need to respond
// of DODEFAULT will be the next stage.
// Tell the control we want to handle drawing after the subitem
// is drawn.
*pResult = CDRF_NOTIFYSUBITEMDRAW | CDRF_NOTIFYPOSTPAINT;
}
break;
case CDDS_ITEMPOSTPAINT | CDDS_SUBITEM: // Stage four (called for each subitem of the focused item)
{
// We do the drawing here (well maybe).
// This is actually after the control has done its drawing
// on the subitem. Since drawing a cell is near instantaneous
// the user won't notice.
int subitem = pCD->iSubItem;
// Only do our own drawing if this subitem has focus at the item level.
if( (pCD->nmcd.uItemState & CDIS_FOCUS) )
{
// If this subitem is the subitem with the current focus,
// draw it. Otherwise let the control draw it.
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
// We have to take into account the possibility that the
// columns may be reordered.
if( subitem == Header_OrderToIndex( pHeader->m_hWnd, m_CurSubItem ) )
{
// POSTERASE
CDC* pDC = CDC::FromHandle(pCD->nmcd.hdc);
// Calculate the offset of the text from the right and left of the cell.
int offset = pDC->GetTextExtent(_T(" "), 1 ).cx*2;
// The rect for the cell gives correct left and right values.
CRect rect = pCD->nmcd.rc;
CRect bounds;
GetItemRect( pCD->nmcd.dwItemSpec, &bounds, LVIR_BOUNDS );
// Get the top and bottom from the item itself.
rect.top = bounds.top;
rect.bottom = bounds.bottom;
// Adjust rectangle for horizontal scroll and first column label
{
if( subitem == 0 )
{
CRect lrect;
GetItemRect( pCD->nmcd.dwItemSpec, &lrect, LVIR_LABEL );
rect.left = lrect.left;
rect.right = lrect.right;
}
else
{
rect.right += bounds.left;
rect.left += bounds.left;
}
}
// Clear the background with button face color
pDC->FillRect(rect, &CBrush(::GetSysColor(COLOR_HIGHLIGHT)));
// Draw column focus box
rect.DeflateRect( 1, 1 );
pDC->FrameRect(rect, &CBrush(::GetSysColor(COLOR_BTNTEXT)));
// Draw text
CString str;
str = GetItemText( pCD->nmcd.dwItemSpec, pCD->iSubItem );
rect.DeflateRect( 4, 1, 0, 0 );
pDC->SetTextColor( ::GetSysColor(COLOR_HIGHLIGHTTEXT) );
pDC->DrawText( str, rect,
DT_SINGLELINE|DT_NOPREFIX|DT_LEFT|DT_VCENTER|DT_END_ELLIPSIS);
// Tell the control that we handled the drawing for this subitem.*/
*pResult = CDRF_SKIPDEFAULT;
}
}
}
break;
default: // Stage two handled here. (called for each item)
if( !(pCD->nmcd.uItemState & CDIS_FOCUS) )
{
// If this item does not have focus, let the
// control draw the whole item.
*pResult = CDRF_DODEFAULT;
}
else
{
// If this item has focus, tell the control we want
// to handle subitem drawing.
*pResult = CDRF_NOTIFYSUBITEMDRAW;
}
break;
}
}
void CGridListCtrl::MakeColumnVisible(int nCol)
{
if( nCol < 0 )
return;
// Get the order array to total the column offset.
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
int colcount = pHeader->GetItemCount();
ASSERT( nCol < colcount );
int *orderarray = new int[ colcount ];
Header_GetOrderArray( pHeader->m_hWnd, colcount, orderarray );
// Get the column offset
int offset = 0;
for( int i = 0; orderarray[i] != nCol; i++ )
offset += GetColumnWidth( orderarray[i] );
int colwidth = GetColumnWidth( nCol );
delete[] orderarray;
CRect rect;
GetItemRect( 0, &rect, LVIR_BOUNDS );
// Now scroll if we need to expose the column
CRect rcClient;
GetClientRect( &rcClient );
if( offset + rect.left < 0 || offset + colwidth + rect.left > rcClient.right )
{
CSize size;
size.cx = offset + rect.left;
size.cy = 0;
Scroll( size );
rect.left -= size.cx;
}
}
BOOL CGridListCtrl::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_KEYDOWN)
{
// Handle the keystrokes for the left and right keys
// to move the cell selection left and right.
// Handle F2 to commence edit mode from the keyboard.
// Only handle these if the grid control has the focus.
// (Messages also come through here for the edit control
// and we don't want them.
if( this == GetFocus() )
{
switch( pMsg->wParam )
{
case VK_LEFT:
{
// Decrement the order number.
m_CurSubItem--;
if( m_CurSubItem < -1 )
{
// This indicates that the whole row is selected and F2 means nothing.
m_CurSubItem = -1;
}
else
{
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
// Make the column visible.
// We have to take into account that the header
// may be reordered.
MakeColumnVisible( Header_OrderToIndex( pHeader->m_hWnd, m_CurSubItem ) );
// Invalidate the item.
int iItem = GetNextItem( -1, LVNI_FOCUSED );
if( iItem != -1 )
{
CRect rcBounds;
GetItemRect(iItem, rcBounds, LVIR_BOUNDS);
InvalidateRect( &rcBounds );
}
}
}
return TRUE;
case VK_RIGHT:
{
// Increment the order number.
m_CurSubItem++;
CHeaderCtrl* pHeader = (CHeaderCtrl*) GetDlgItem(0);
int nColumnCount = pHeader->GetItemCount();
// Don't go beyond the last column.
if( m_CurSubItem > nColumnCount -1 )
{
m_CurSubItem = nColumnCount-1;
}
else
{
// We have to take into account that the header
// may be reordered.
MakeColumnVisible( Header_OrderToIndex( pHeader->m_hWnd, m_CurSubItem ) );
int iItem = GetNextItem( -1, LVNI_FOCUSED );
// Invalidate the item.
if( iItem != -1 )
{
CRect rcBounds;
GetItemRect(iItem, rcBounds, LVIR_BOUNDS);
InvalidateRect( &rcBounds );
}
}
}
return TRUE;
case VK_F2: // Enter nondestructive edit mode.
{
int iItem = GetNextItem( -1, LVNI_FOCUSED );
if( m_CurSubItem != -1 && iItem != -1 &&
GLCT_EDIT == GetColumnType(m_CurSubItem) )
{
// Send Notification to parent of ListView ctrl
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
CString str;
// We have to take into account that the header
// may be reordered.
str = GetItemText( iItem, Header_OrderToIndex( pHeader->m_hWnd, m_CurSubItem ) );
LV_DISPINFO dispinfo;
dispinfo.hdr.hwndFrom = m_hWnd;
dispinfo.hdr.idFrom = GetDlgCtrlID();
dispinfo.hdr.code = LVN_BEGINLABELEDIT;
dispinfo.item.mask = LVIF_TEXT;
dispinfo.item.iItem = iItem;
// We have to take into account that the header
// may be reordered.
dispinfo.item.iSubItem = Header_OrderToIndex( pHeader->m_hWnd, m_CurSubItem );
dispinfo.item.pszText = (LPTSTR)((LPCTSTR)str);
dispinfo.item.cchTextMax = str.GetLength();
// Send message to the parent that we are ready to edit.
GetParent()->SendMessage( WM_NOTIFY, GetDlgCtrlID(),
(LPARAM)&dispinfo );
}
}
break;
default:
break;
}
}
}
return CListCtrl::PreTranslateMessage(pMsg);
}
int CGridListCtrl::IndexToOrder( int iIndex )
{
// Since the control only provide the OrderToIndex macro,
// we have to provide the IndexToOrder. This translates
// a column index value to a column order value.
int nRet = -1;
CHeaderCtrl* pHeader = (CHeaderCtrl*)GetDlgItem(0);
int colcount = pHeader->GetItemCount();
int *orderarray = new int[ colcount ];
Header_GetOrderArray( pHeader->m_hWnd, colcount, orderarray );
int i;
for( i=0; i<colcount; i++ )
{
if( orderarray[i] == iIndex )
{
nRet = i;
break;
}
}
delete[] orderarray;
return nRet;
}
void CGridListCtrl::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
if( GetFocus() != this ) SetFocus();
CListCtrl::OnHScroll(nSBCode, nPos, pScrollBar);
}
void CGridListCtrl::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
if( GetFocus() != this ) SetFocus();
CListCtrl::OnVScroll(nSBCode, nPos, pScrollBar);
}
void CGridListCtrl::OnBeginlabeledit(NMHDR* pNMHDR, LRESULT* pResult)
{
LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR;
// TODO: Add your control notification handler code here
CString str = pDispInfo->item.pszText;
int item = pDispInfo->item.iItem;
int subitem = pDispInfo->item.iSubItem;
// Construct and create the custom multiline edit control.
// We could just as well have used a combobox, checkbox,
// rich text control, etc.
m_pListEdit = new CInPlaceEdit( item, subitem, str );
// Start with a small rectangle. We'll change it later.
CRect rect( 0,0,1,1 );
DWORD dwStyle = ES_LEFT;
dwStyle |= WS_BORDER|WS_CHILD|WS_VISIBLE;//|ES_MULTILINE|ES_AUTOVSCROLL;
m_pListEdit->Create( dwStyle, rect, this, 103 );
// Have the Grid position and size the custom edit control
this->PositionControl( m_pListEdit, item, subitem );
// Have the edit box size itself to its content.
m_pListEdit->CalculateSize();
// Return TRUE so that the list control will hnadle NOT edit label itself.
*pResult = 1;
}
void CGridListCtrl::OnEndlabeledit(NMHDR* pNMHDR, LRESULT* pResult)
{
LV_DISPINFO* pDispInfo = (LV_DISPINFO*)pNMHDR;
// TODO: Add your control notification handler code here
int item = pDispInfo->item.iItem;
int subitem = pDispInfo->item.iSubItem;
// This is coming from the grid list control notification.
if( m_pListEdit )
{
CString str;
if( pDispInfo->item.pszText )
{
this->SetItemText( item, subitem, pDispInfo->item.pszText );
}
delete m_pListEdit;
m_pListEdit = 0;
}
*pResult = 0;
}
void CGridListCtrl::SetColumnType( int nCol, GLC_COLUMNTYPE columnType )
{
if( nCol < 100 )
{
m_aColumnType[nCol] = columnType;
}
}
GLC_COLUMNTYPE CGridListCtrl::GetColumnType( int nCol )
{
if( nCol < 100 )
{
return m_aColumnType[nCol];
}
return GLCT_EDIT;
}
/////////////////////////////////////////////////////////////////////////////
// CInPlaceEdit
CInPlaceEdit::CInPlaceEdit(int iItem, int iSubItem, CString sInitText)
:m_sInitText( sInitText )
{
m_iItem = iItem;
m_iSubItem = iSubItem;
m_bESC = FALSE;
}
CInPlaceEdit::~CInPlaceEdit()
{
}
BEGIN_MESSAGE_MAP(CInPlaceEdit, CEdit)
//{{AFX_MSG_MAP(CInPlaceEdit)
ON_WM_KILLFOCUS()
ON_WM_CHAR()
ON_WM_CREATE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CInPlaceEdit message handlers
BOOL CInPlaceEdit::PreTranslateMessage(MSG* pMsg)
{
if( pMsg->message == WM_KEYDOWN )
{
SHORT sKey = GetKeyState( VK_CONTROL);
if(pMsg->wParam == VK_RETURN
|| pMsg->wParam == VK_DELETE
|| pMsg->wParam == VK_ESCAPE
|| sKey
)
{
::TranslateMessage(pMsg);
/* Strange but true:
If the edit control has ES_MULTILINE and ESC
is pressed the parent is destroyed if the
message is dispatched. In this
case the parent is the list control. */
if( !(GetStyle() & ES_MULTILINE) || pMsg->wParam != VK_ESCAPE )
{
::DispatchMessage(pMsg);
}
return TRUE; // DO NOT process further
}
}
return CEdit::PreTranslateMessage(pMsg);
}
void CInPlaceEdit::OnKillFocus(CWnd* pNewWnd)
{
CEdit::OnKillFocus(pNewWnd);
CString str;
GetWindowText(str);
// Send Notification to parent of ListView ctrl
LV_DISPINFO dispinfo;
dispinfo.hdr.hwndFrom = GetParent()->m_hWnd;
dispinfo.hdr.idFrom = GetDlgCtrlID();
dispinfo.hdr.code = LVN_ENDLABELEDIT;
dispinfo.item.mask = LVIF_TEXT;
dispinfo.item.iItem = m_iItem;
dispinfo.item.iSubItem = m_iSubItem;
dispinfo.item.pszText = m_bESC ? NULL : LPTSTR((LPCTSTR)str);
dispinfo.item.cchTextMax = m_bESC ? 0 : str.GetLength();
GetParent()->GetParent()->SendMessage( WM_NOTIFY, GetParent()->GetDlgCtrlID(),
(LPARAM)&dispinfo );
}
void CInPlaceEdit::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
if( nChar == VK_ESCAPE || nChar == VK_RETURN)
{
if( nChar == VK_ESCAPE )
m_bESC = TRUE;
GetParent()->SetFocus();
return;
}
CEdit::OnChar(nChar, nRepCnt, nFlags);
// Resize edit control if needed
CalculateSize();
}
int CInPlaceEdit::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CEdit::OnCreate(lpCreateStruct) == -1)
return -1;
// Set the proper font
CFont* font = GetParent()->GetFont();
SetFont(font);
SetWindowText( m_sInitText );
SetFocus();
CalculateSize();
SetSel( 0, -1 );
return 0;
}
void CInPlaceEdit::CalculateSize()
{
// Get text extent
CString str;
GetWindowText( str );
CWindowDC dc(this);
CFont *pFont = GetParent()->GetFont();
CFont *pFontDC = dc.SelectObject( pFont );
CSize size;
// Get client rect
CRect rect, parentrect;
GetClientRect( &rect );
GetParent()->GetClientRect( &parentrect );
// Transform rect to parent coordinates
ClientToScreen( &rect );
GetParent()->ScreenToClient( &rect );
if( !(GetStyle() & ES_MULTILINE ) )
{
size = dc.GetTextExtent( str );
dc.SelectObject( pFontDC );
size.cx += 5; // add some extra buffer
}
else
{
CRect thinrect( rect ); // To measure the skinniest text box
CRect widerect( rect ); // To measure the wides text box
widerect.right = parentrect.right;
// Use the shortest of the two box sizes.
int thinheight = dc.DrawText( str, &thinrect, DT_CALCRECT|DT_NOPREFIX|DT_LEFT|DT_EXPANDTABS|DT_WORDBREAK );
int wideheight = dc.DrawText( str, &widerect, DT_CALCRECT|DT_NOPREFIX|DT_LEFT|DT_EXPANDTABS|DT_WORDBREAK );
if( thinheight >= wideheight )
{
size.cy = wideheight + 5;
size.cx = widerect.right - widerect.left + 5;
}
else
{
size.cy = thinheight + 5;
size.cx = thinrect.right - thinrect.left + 5;
}
}
// Check whether control needs to be resized
// and whether there is space to grow
int changed = 0;
if( size.cx > rect.Width() )
{
if( size.cx + rect.left < parentrect.right-2 )
rect.right = rect.left + size.cx;
else
rect.right = parentrect.right-2;
changed = 1;
}
if( size.cy > rect.Height() )
{
if( size.cy + rect.top < parentrect.bottom-2 )
rect.bottom = rect.top + size.cy;
else
{
rect.bottom = parentrect.bottom-2;
ShowScrollBar( SB_VERT );
}
changed = 1;
}
// If the size became larger rposition the window.
if( changed )
MoveWindow( &rect );
}

View File

@@ -0,0 +1,119 @@
#if !defined(AFX_GRIDLISTCTRL_H__92CA5999_9434_11D1_88D5_444553540000__INCLUDED_)
#define AFX_GRIDLISTCTRL_H__92CA5999_9434_11D1_88D5_444553540000__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// GridListCtrl.h : header file
//
enum GLC_COLUMNTYPE
{
GLCT_EDIT, GLCT_NORMAL
};
/////////////////////////////////////////////////////////////////////////////
// CInPlaceEdit window
class CInPlaceEdit : public CEdit
{
// Construction
public:
CInPlaceEdit(int iItem, int iSubItem, CString sInitText);
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CInPlaceEdit)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CInPlaceEdit();
void CalculateSize();
// Generated message map functions
protected:
//{{AFX_MSG(CInPlaceEdit)
afx_msg void OnKillFocus(CWnd* pNewWnd);
afx_msg void OnChar(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
int m_iItem;
int m_iSubItem;
CString m_sInitText;
BOOL m_bESC; // To indicate whether ESC key was pressed
};
/////////////////////////////////////////////////////////////////////////////
// CGridListCtrl window
class CGridListCtrl : public CListCtrl
{
// Construction
public:
CGridListCtrl();
// Attributes
public:
// The current subitem or column number which is order based.
int m_CurSubItem;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGridListCtrl)
public:
virtual BOOL PreTranslateMessage(MSG* pMsg);
//}}AFX_VIRTUAL
// Implementation
public:
void SetColumnType( int nCol, GLC_COLUMNTYPE columnType );
GLC_COLUMNTYPE GetColumnType( int nCol );
void MakeColumnVisible(int nCol);
BOOL PositionControl( CWnd * pWnd, int iItem, int iSubItem );
BOOL PrepareControl(WORD wParseStyle);
virtual ~CGridListCtrl();
// Generated message map functions
protected:
//{{AFX_MSG(CGridListCtrl)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnBeginlabeledit(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnEndlabeledit(NMHDR* pNMHDR, LRESULT* pResult);
//}}AFX_MSG
afx_msg void OnCustomDraw(NMHDR* pNMHDR, LRESULT* pResult);
WORD m_wStyle;
DECLARE_MESSAGE_MAP()
private:
int IndexToOrder( int iIndex );
CInPlaceEdit* m_pListEdit;
GLC_COLUMNTYPE m_aColumnType[100];
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GRIDLISTCTRL_H__92CA5999_9434_11D1_88D5_444553540000__INCLUDED_)

Some files were not shown because too many files have changed in this diff Show More