merging gsoc2012-achievements

--HG--
branch : gsoc2012-achievements
hg/feature/gsoc2013-dfighter
sfb 12 years ago
parent d39db0a4fd
commit 050835b535

@ -1,230 +1,230 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// PageBgFades.cpp : implementation file
//
#include "std_sound_plugin.h"
#include "georges_plugin_sound.h"
#include "nel/misc/types_nl.h"
#include "sound_dialog.h"
#include "sound_plugin.h"
#include "nel/sound/u_audio_mixer.h"
#include "PageBgFades.h"
using namespace std;
uint FILTER_NAMES[] =
{
IDC_FILTER_NAME_00,
IDC_FILTER_NAME_01,
IDC_FILTER_NAME_02,
IDC_FILTER_NAME_03,
IDC_FILTER_NAME_04,
IDC_FILTER_NAME_05,
IDC_FILTER_NAME_06,
IDC_FILTER_NAME_07,
IDC_FILTER_NAME_08,
IDC_FILTER_NAME_09,
IDC_FILTER_NAME_10,
IDC_FILTER_NAME_11,
IDC_FILTER_NAME_12,
IDC_FILTER_NAME_13,
IDC_FILTER_NAME_14,
IDC_FILTER_NAME_15,
IDC_FILTER_NAME_16,
IDC_FILTER_NAME_17,
IDC_FILTER_NAME_18,
IDC_FILTER_NAME_19,
IDC_FILTER_NAME_20,
IDC_FILTER_NAME_21,
IDC_FILTER_NAME_22,
IDC_FILTER_NAME_23,
IDC_FILTER_NAME_24,
IDC_FILTER_NAME_25,
IDC_FILTER_NAME_26,
IDC_FILTER_NAME_27,
IDC_FILTER_NAME_28,
IDC_FILTER_NAME_29,
IDC_FILTER_NAME_30,
IDC_FILTER_NAME_31
};
uint FILTER_FADE_IN[] =
{
IDC_FADE_IN_00,
IDC_FADE_IN_01,
IDC_FADE_IN_02,
IDC_FADE_IN_03,
IDC_FADE_IN_04,
IDC_FADE_IN_05,
IDC_FADE_IN_06,
IDC_FADE_IN_07,
IDC_FADE_IN_08,
IDC_FADE_IN_09,
IDC_FADE_IN_10,
IDC_FADE_IN_11,
IDC_FADE_IN_12,
IDC_FADE_IN_13,
IDC_FADE_IN_14,
IDC_FADE_IN_15,
IDC_FADE_IN_16,
IDC_FADE_IN_17,
IDC_FADE_IN_18,
IDC_FADE_IN_19,
IDC_FADE_IN_20,
IDC_FADE_IN_21,
IDC_FADE_IN_22,
IDC_FADE_IN_23,
IDC_FADE_IN_24,
IDC_FADE_IN_25,
IDC_FADE_IN_26,
IDC_FADE_IN_27,
IDC_FADE_IN_28,
IDC_FADE_IN_29,
IDC_FADE_IN_30,
IDC_FADE_IN_31
};
uint FILTER_FADE_OUT[] =
{
IDC_FADE_OUT_00,
IDC_FADE_OUT_01,
IDC_FADE_OUT_02,
IDC_FADE_OUT_03,
IDC_FADE_OUT_04,
IDC_FADE_OUT_05,
IDC_FADE_OUT_06,
IDC_FADE_OUT_07,
IDC_FADE_OUT_08,
IDC_FADE_OUT_09,
IDC_FADE_OUT_10,
IDC_FADE_OUT_11,
IDC_FADE_OUT_12,
IDC_FADE_OUT_13,
IDC_FADE_OUT_14,
IDC_FADE_OUT_15,
IDC_FADE_OUT_16,
IDC_FADE_OUT_17,
IDC_FADE_OUT_18,
IDC_FADE_OUT_19,
IDC_FADE_OUT_20,
IDC_FADE_OUT_21,
IDC_FADE_OUT_22,
IDC_FADE_OUT_23,
IDC_FADE_OUT_24,
IDC_FADE_OUT_25,
IDC_FADE_OUT_26,
IDC_FADE_OUT_27,
IDC_FADE_OUT_28,
IDC_FADE_OUT_29,
IDC_FADE_OUT_30,
IDC_FADE_OUT_31,
};
map<uint, uint> FILTER_FADE_IN_IDX;
map<uint, uint> FILTER_FADE_OUT_IDX;
/////////////////////////////////////////////////////////////////////////////
// CPageBgFades property page
#undef new
IMPLEMENT_DYNCREATE(CPageBgFades, CPageBase)
#define new NL_NEW
CPageBgFades::CPageBgFades(NLGEORGES::CSoundDialog *soundDialog)
: CPageBase(soundDialog, CPageBgFades::IDD)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
//{{AFX_DATA_INIT(CPageBgFades)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
for (uint i=0; i<32; ++i)
{
FILTER_FADE_IN_IDX.insert(make_pair(FILTER_FADE_IN[i], i));
FILTER_FADE_OUT_IDX.insert(make_pair(FILTER_FADE_OUT[i], i));
}
}
CPageBgFades::~CPageBgFades()
{
}
void CPageBgFades::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPageBgFades)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPageBgFades, CPropertyPage)
//{{AFX_MSG_MAP(CPageBgFades)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPageBgFades message handlers
BOOL CPageBgFades::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// initialize the filter names and fade value
for (uint i =0; i<32; ++i)
{
char tmp[128];
GetDlgItem(FILTER_NAMES[i])->SetWindowText(SoundDialog->EnvNames[i].Name.c_str());
sprintf(tmp, "%u", SoundDialog->FilterFades.FadeIns[i]);
GetDlgItem(FILTER_FADE_IN[i])->SetWindowText(tmp);
sprintf(tmp, "%u", SoundDialog->FilterFades.FadeOuts[i]);
GetDlgItem(FILTER_FADE_OUT[i])->SetWindowText(tmp);
}
SoundDialog->getSoundPlugin()->getMixer()->setBackgroundFilterFades(SoundDialog->FilterFades);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
BOOL CPageBgFades::OnCommand(WPARAM wParam, LPARAM lParam)
{
if (lParam != 0 && HIWORD(wParam) == EN_CHANGE)
{
int id = ::GetDlgCtrlID(HWND(lParam));
char tmp[1024];
if (FILTER_FADE_IN_IDX.find(id) != FILTER_FADE_IN_IDX.end())
{
// this is a fade in value modified !
GetDlgItem(id)->GetWindowText(tmp, 1024);
SoundDialog->FilterFades.FadeIns[FILTER_FADE_IN_IDX[id]] = atoi(tmp);
SoundDialog->getSoundPlugin()->getMixer()->setBackgroundFilterFades(SoundDialog->FilterFades);
}
else if (FILTER_FADE_OUT_IDX.find(id) != FILTER_FADE_OUT_IDX.end())
{
// this is a fade in value modified !
GetDlgItem(id)->GetWindowText(tmp, 1024);
SoundDialog->FilterFades.FadeOuts[FILTER_FADE_OUT_IDX[id]] = atoi(tmp);
SoundDialog->getSoundPlugin()->getMixer()->setBackgroundFilterFades(SoundDialog->FilterFades);
}
}
return CPropertyPage::OnCommand(wParam, lParam);
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// PageBgFades.cpp : implementation file
//
#include "std_sound_plugin.h"
#include "georges_plugin_sound.h"
#include "nel/misc/types_nl.h"
#include "sound_dialog.h"
#include "sound_plugin.h"
#include "nel/sound/u_audio_mixer.h"
#include "PageBgFades.h"
using namespace std;
uint FILTER_NAMES[] =
{
IDC_FILTER_NAME_00,
IDC_FILTER_NAME_01,
IDC_FILTER_NAME_02,
IDC_FILTER_NAME_03,
IDC_FILTER_NAME_04,
IDC_FILTER_NAME_05,
IDC_FILTER_NAME_06,
IDC_FILTER_NAME_07,
IDC_FILTER_NAME_08,
IDC_FILTER_NAME_09,
IDC_FILTER_NAME_10,
IDC_FILTER_NAME_11,
IDC_FILTER_NAME_12,
IDC_FILTER_NAME_13,
IDC_FILTER_NAME_14,
IDC_FILTER_NAME_15,
IDC_FILTER_NAME_16,
IDC_FILTER_NAME_17,
IDC_FILTER_NAME_18,
IDC_FILTER_NAME_19,
IDC_FILTER_NAME_20,
IDC_FILTER_NAME_21,
IDC_FILTER_NAME_22,
IDC_FILTER_NAME_23,
IDC_FILTER_NAME_24,
IDC_FILTER_NAME_25,
IDC_FILTER_NAME_26,
IDC_FILTER_NAME_27,
IDC_FILTER_NAME_28,
IDC_FILTER_NAME_29,
IDC_FILTER_NAME_30,
IDC_FILTER_NAME_31
};
uint FILTER_FADE_IN[] =
{
IDC_FADE_IN_00,
IDC_FADE_IN_01,
IDC_FADE_IN_02,
IDC_FADE_IN_03,
IDC_FADE_IN_04,
IDC_FADE_IN_05,
IDC_FADE_IN_06,
IDC_FADE_IN_07,
IDC_FADE_IN_08,
IDC_FADE_IN_09,
IDC_FADE_IN_10,
IDC_FADE_IN_11,
IDC_FADE_IN_12,
IDC_FADE_IN_13,
IDC_FADE_IN_14,
IDC_FADE_IN_15,
IDC_FADE_IN_16,
IDC_FADE_IN_17,
IDC_FADE_IN_18,
IDC_FADE_IN_19,
IDC_FADE_IN_20,
IDC_FADE_IN_21,
IDC_FADE_IN_22,
IDC_FADE_IN_23,
IDC_FADE_IN_24,
IDC_FADE_IN_25,
IDC_FADE_IN_26,
IDC_FADE_IN_27,
IDC_FADE_IN_28,
IDC_FADE_IN_29,
IDC_FADE_IN_30,
IDC_FADE_IN_31
};
uint FILTER_FADE_OUT[] =
{
IDC_FADE_OUT_00,
IDC_FADE_OUT_01,
IDC_FADE_OUT_02,
IDC_FADE_OUT_03,
IDC_FADE_OUT_04,
IDC_FADE_OUT_05,
IDC_FADE_OUT_06,
IDC_FADE_OUT_07,
IDC_FADE_OUT_08,
IDC_FADE_OUT_09,
IDC_FADE_OUT_10,
IDC_FADE_OUT_11,
IDC_FADE_OUT_12,
IDC_FADE_OUT_13,
IDC_FADE_OUT_14,
IDC_FADE_OUT_15,
IDC_FADE_OUT_16,
IDC_FADE_OUT_17,
IDC_FADE_OUT_18,
IDC_FADE_OUT_19,
IDC_FADE_OUT_20,
IDC_FADE_OUT_21,
IDC_FADE_OUT_22,
IDC_FADE_OUT_23,
IDC_FADE_OUT_24,
IDC_FADE_OUT_25,
IDC_FADE_OUT_26,
IDC_FADE_OUT_27,
IDC_FADE_OUT_28,
IDC_FADE_OUT_29,
IDC_FADE_OUT_30,
IDC_FADE_OUT_31,
};
map<uint, uint> FILTER_FADE_IN_IDX;
map<uint, uint> FILTER_FADE_OUT_IDX;
/////////////////////////////////////////////////////////////////////////////
// CPageBgFades property page
#undef new
IMPLEMENT_DYNCREATE(CPageBgFades, CPageBase)
#define new NL_NEW
CPageBgFades::CPageBgFades(NLGEORGES::CSoundDialog *soundDialog)
: CPageBase(soundDialog, CPageBgFades::IDD)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
//{{AFX_DATA_INIT(CPageBgFades)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
for (uint i=0; i<32; ++i)
{
FILTER_FADE_IN_IDX.insert(make_pair(FILTER_FADE_IN[i], i));
FILTER_FADE_OUT_IDX.insert(make_pair(FILTER_FADE_OUT[i], i));
}
}
CPageBgFades::~CPageBgFades()
{
}
void CPageBgFades::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPageBgFades)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPageBgFades, CPropertyPage)
//{{AFX_MSG_MAP(CPageBgFades)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPageBgFades message handlers
BOOL CPageBgFades::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// initialize the filter names and fade value
for (uint i =0; i<32; ++i)
{
char tmp[128];
GetDlgItem(FILTER_NAMES[i])->SetWindowText(SoundDialog->EnvNames[i].Name.c_str());
sprintf(tmp, "%u", SoundDialog->FilterFades.FadeIns[i]);
GetDlgItem(FILTER_FADE_IN[i])->SetWindowText(tmp);
sprintf(tmp, "%u", SoundDialog->FilterFades.FadeOuts[i]);
GetDlgItem(FILTER_FADE_OUT[i])->SetWindowText(tmp);
}
SoundDialog->getSoundPlugin()->getMixer()->setBackgroundFilterFades(SoundDialog->FilterFades);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
BOOL CPageBgFades::OnCommand(WPARAM wParam, LPARAM lParam)
{
if (lParam != 0 && HIWORD(wParam) == EN_CHANGE)
{
int id = ::GetDlgCtrlID(HWND(lParam));
char tmp[1024];
if (FILTER_FADE_IN_IDX.find(id) != FILTER_FADE_IN_IDX.end())
{
// this is a fade in value modified !
GetDlgItem(id)->GetWindowText(tmp, 1024);
SoundDialog->FilterFades.FadeIns[FILTER_FADE_IN_IDX[id]] = atoi(tmp);
SoundDialog->getSoundPlugin()->getMixer()->setBackgroundFilterFades(SoundDialog->FilterFades);
}
else if (FILTER_FADE_OUT_IDX.find(id) != FILTER_FADE_OUT_IDX.end())
{
// this is a fade in value modified !
GetDlgItem(id)->GetWindowText(tmp, 1024);
SoundDialog->FilterFades.FadeOuts[FILTER_FADE_OUT_IDX[id]] = atoi(tmp);
SoundDialog->getSoundPlugin()->getMixer()->setBackgroundFilterFades(SoundDialog->FilterFades);
}
}
return CPropertyPage::OnCommand(wParam, lParam);
}

@ -1,69 +1,69 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_PAGEBGFADES_H__AED887E2_E8D1_4BDB_B180_B6ADF8C44D58__INCLUDED_)
#define AFX_PAGEBGFADES_H__AED887E2_E8D1_4BDB_B180_B6ADF8C44D58__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PageBgFades.h : header file
//
#include "PageBase.h"
/////////////////////////////////////////////////////////////////////////////
// CPageBgFades dialog
class CPageBgFades : public CPageBase
{
DECLARE_DYNCREATE(CPageBgFades)
// Construction
public:
CPageBgFades() {}
CPageBgFades(NLGEORGES::CSoundDialog *soundDialog);
~CPageBgFades();
// Dialog Data
//{{AFX_DATA(CPageBgFades)
enum { IDD = IDD_PAGE_BG_FADES };
// NOTE - ClassWizard will add data members here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CPageBgFades)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CPageBgFades)
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_PAGEBGFADES_H__AED887E2_E8D1_4BDB_B180_B6ADF8C44D58__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_PAGEBGFADES_H__AED887E2_E8D1_4BDB_B180_B6ADF8C44D58__INCLUDED_)
#define AFX_PAGEBGFADES_H__AED887E2_E8D1_4BDB_B180_B6ADF8C44D58__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PageBgFades.h : header file
//
#include "PageBase.h"
/////////////////////////////////////////////////////////////////////////////
// CPageBgFades dialog
class CPageBgFades : public CPageBase
{
DECLARE_DYNCREATE(CPageBgFades)
// Construction
public:
CPageBgFades() {}
CPageBgFades(NLGEORGES::CSoundDialog *soundDialog);
~CPageBgFades();
// Dialog Data
//{{AFX_DATA(CPageBgFades)
enum { IDD = IDD_PAGE_BG_FADES };
// NOTE - ClassWizard will add data members here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CPageBgFades)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CPageBgFades)
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_PAGEBGFADES_H__AED887E2_E8D1_4BDB_B180_B6ADF8C44D58__INCLUDED_)

@ -1,434 +1,434 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// PageBgFlags.cpp : implementation file
//
#include "std_sound_plugin.h"
#include "nel/misc/types_nl.h"
#include "georges_plugin_sound.h"
#include "nel/georges/u_form_elm.h"
#include "sound_document_plugin.h"
#include "nel/sound/u_audio_mixer.h"
#include "PageBgFlags.h"
using namespace std;
// controls id arrays
uint FILTER_EDIT[] =
{
IDC_FILTER_00,
IDC_FILTER_01,
IDC_FILTER_02,
IDC_FILTER_03,
IDC_FILTER_04,
IDC_FILTER_05,
IDC_FILTER_06,
IDC_FILTER_07,
IDC_FILTER_08,
IDC_FILTER_09,
IDC_FILTER_10,
IDC_FILTER_11,
IDC_FILTER_12,
IDC_FILTER_13,
IDC_FILTER_14,
IDC_FILTER_15,
IDC_FILTER_16,
IDC_FILTER_17,
IDC_FILTER_18,
IDC_FILTER_19,
IDC_FILTER_20,
IDC_FILTER_21,
IDC_FILTER_22,
IDC_FILTER_23,
IDC_FILTER_24,
IDC_FILTER_25,
IDC_FILTER_26,
IDC_FILTER_27,
IDC_FILTER_28,
IDC_FILTER_29,
IDC_FILTER_30,
IDC_FILTER_31
};
uint FILTER_EDIT_NAME[] =
{
IDC_FILTER_NAME_00,
IDC_FILTER_NAME_01,
IDC_FILTER_NAME_02,
IDC_FILTER_NAME_03,
IDC_FILTER_NAME_04,
IDC_FILTER_NAME_05,
IDC_FILTER_NAME_06,
IDC_FILTER_NAME_07,
IDC_FILTER_NAME_08,
IDC_FILTER_NAME_09,
IDC_FILTER_NAME_10,
IDC_FILTER_NAME_11,
IDC_FILTER_NAME_12,
IDC_FILTER_NAME_13,
IDC_FILTER_NAME_14,
IDC_FILTER_NAME_15,
IDC_FILTER_NAME_16,
IDC_FILTER_NAME_17,
IDC_FILTER_NAME_18,
IDC_FILTER_NAME_19,
IDC_FILTER_NAME_20,
IDC_FILTER_NAME_21,
IDC_FILTER_NAME_22,
IDC_FILTER_NAME_23,
IDC_FILTER_NAME_24,
IDC_FILTER_NAME_25,
IDC_FILTER_NAME_26,
IDC_FILTER_NAME_27,
IDC_FILTER_NAME_28,
IDC_FILTER_NAME_29,
IDC_FILTER_NAME_30,
IDC_FILTER_NAME_31
};
uint FILTER_SIM[] =
{
IDC_ENV_FLAG_00,
IDC_ENV_FLAG_01,
IDC_ENV_FLAG_02,
IDC_ENV_FLAG_03,
IDC_ENV_FLAG_04,
IDC_ENV_FLAG_05,
IDC_ENV_FLAG_06,
IDC_ENV_FLAG_07,
IDC_ENV_FLAG_08,
IDC_ENV_FLAG_09,
IDC_ENV_FLAG_10,
IDC_ENV_FLAG_11,
IDC_ENV_FLAG_12,
IDC_ENV_FLAG_13,
IDC_ENV_FLAG_14,
IDC_ENV_FLAG_15,
IDC_ENV_FLAG_16,
IDC_ENV_FLAG_17,
IDC_ENV_FLAG_18,
IDC_ENV_FLAG_19,
IDC_ENV_FLAG_20,
IDC_ENV_FLAG_21,
IDC_ENV_FLAG_22,
IDC_ENV_FLAG_23,
IDC_ENV_FLAG_24,
IDC_ENV_FLAG_25,
IDC_ENV_FLAG_26,
IDC_ENV_FLAG_27,
IDC_ENV_FLAG_28,
IDC_ENV_FLAG_29,
IDC_ENV_FLAG_30,
IDC_ENV_FLAG_31,
};
uint FILTER_SIM_NAME[] =
{
IDC_ENV_NAME_00,
IDC_ENV_NAME_01,
IDC_ENV_NAME_02,
IDC_ENV_NAME_03,
IDC_ENV_NAME_04,
IDC_ENV_NAME_05,
IDC_ENV_NAME_06,
IDC_ENV_NAME_07,
IDC_ENV_NAME_08,
IDC_ENV_NAME_09,
IDC_ENV_NAME_10,
IDC_ENV_NAME_11,
IDC_ENV_NAME_12,
IDC_ENV_NAME_13,
IDC_ENV_NAME_14,
IDC_ENV_NAME_15,
IDC_ENV_NAME_16,
IDC_ENV_NAME_17,
IDC_ENV_NAME_18,
IDC_ENV_NAME_19,
IDC_ENV_NAME_20,
IDC_ENV_NAME_21,
IDC_ENV_NAME_22,
IDC_ENV_NAME_23,
IDC_ENV_NAME_24,
IDC_ENV_NAME_25,
IDC_ENV_NAME_26,
IDC_ENV_NAME_27,
IDC_ENV_NAME_28,
IDC_ENV_NAME_29,
IDC_ENV_NAME_30,
IDC_ENV_NAME_31,
};
std::map<uint, uint> FILTER_SIM_IDX;
std::map<uint, uint> FILTER_EDIT_IDX;
/////////////////////////////////////////////////////////////////////////////
// CPageBgFlags property page
#undef new
IMPLEMENT_DYNCREATE(CPageBgFlags, CPageBase)
#define new NL_NEW
CPageBgFlags::CPageBgFlags(NLGEORGES::CSoundDialog *soundDialog)
: CPageBase(soundDialog, CPageBgFlags::IDD),
_recurse(false)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
//{{AFX_DATA_INIT(CPageBgFlags)
_SubSoundName = _T("");
//}}AFX_DATA_INIT
for (uint i=0; i<32; ++i)
{
FILTER_EDIT_IDX.insert(make_pair(FILTER_EDIT[i], i));
FILTER_SIM_IDX.insert(make_pair(FILTER_SIM[i], i));
}
}
CPageBgFlags::~CPageBgFlags()
{
}
void CPageBgFlags::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPageBgFlags)
DDX_Text(pDX, IDC_SUB_SOUND_NAME, _SubSoundName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPageBgFlags, CPropertyPage)
//{{AFX_MSG_MAP(CPageBgFlags)
ON_BN_CLICKED(IDC_BTN_EDIT_ALL_ON, OnBtnEditAllOn)
ON_BN_CLICKED(IDC_BTN_EDIT_ALL_OFF, OnBtnEditAllOff)
ON_BN_CLICKED(IDC_BTN_ENV_ALL_OFF, OnBtnEnvAllOff)
ON_BN_CLICKED(IDC_BTN_ENV_ALL_ON, OnBtnEnvAllOn)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPageBgFlags message handlers
BOOL CPageBgFlags::OnCommand(WPARAM wParam, LPARAM lParam)
{
_recurse = true;
if (lParam != 0)
{
int id = ::GetDlgCtrlID(HWND(lParam));
// command come from a control
if (FILTER_EDIT_IDX.find(id) != FILTER_EDIT_IDX.end())
{
bool state = static_cast<CButton*>(GetDlgItem(id))->GetCheck() == 1;
nldebug("Setting filter %u of sound %u to %s", FILTER_EDIT_IDX[id], _Index, state ? "true" : "false");
// here, we don't use the updateData method coz it's too slow for only one value
char path[1024];
sprintf(path, ".SoundType.Sounds[%u].Filter%02u", _Index, FILTER_EDIT_IDX[id]);
SoundDialog->getSoundPlugin()->getActiveDocument()->setValue(state ? "true" : "false", path);
SoundDialog->getSoundPlugin()->getActiveDocument()->refreshView();
}
else if (FILTER_SIM_IDX.find(id) != FILTER_SIM_IDX.end())
{
// bool state = (static_cast<CButton*>(GetDlgItem(id))->GetState() & 0x0003) != 0;
// nldebug("Setting simul filter %u to %s", FILTER_SIM_IDX[id] , state ? "true" : "false");
updateData(false);
}
}
_recurse = false;
return CPropertyPage::OnCommand(wParam, lParam);
}
void CPageBgFlags::OnBtnEditAllOn()
{
for (uint i=0; i<32; ++i)
{
static_cast<CButton*>(GetDlgItem(FILTER_EDIT[i]))->SetCheck(TRUE);
}
updateData(true);
}
void CPageBgFlags::OnBtnEditAllOff()
{
for (uint i=0; i<32; ++i)
{
static_cast<CButton*>(GetDlgItem(FILTER_EDIT[i]))->SetCheck(FALSE);
}
updateData(true);
}
void CPageBgFlags::OnBtnEnvAllOn()
{
for (uint i=0; i<32; ++i)
{
static_cast<CButton*>(GetDlgItem(FILTER_SIM[i]))->SetCheck(TRUE);
}
updateData(false);
}
void CPageBgFlags::OnBtnEnvAllOff()
{
for (uint i=0; i<32; ++i)
{
static_cast<CButton*>(GetDlgItem(FILTER_SIM[i]))->SetCheck(FALSE);
}
updateData(false);
}
void CPageBgFlags::onDocChanged()
{
// the document have been modified, update the dialog
NLGEORGES::IEditDocument *pdoc = SoundDialog->getSoundPlugin()->getActiveDocument();
bool valid = false;
if (_recurse)
return;
if (pdoc != NULL)
{
string type, dfnName;
NLGEORGES::UFormElm *psoundType;
pdoc->getForm()->getRootNode().getNodeByName(&psoundType, ".SoundType");
if (psoundType != NULL)
{
psoundType->getDfnName(dfnName);
if (dfnName == "background_sound.dfn")
{
// set the filter flags according to active node
bool val;
string activeNode;
pdoc->getActiveNode(activeNode);
if (activeNode.find(".SoundType.Sounds") != string::npos)
{
// extract the root path on the sheet.
string::size_type p = activeNode.find(".SoundType.Sounds");
while (p < activeNode.size() && activeNode[p] != '[')
p++;
if (p < activeNode.size())
{
// skip the open [
p++;
string index;
while (isdigit(activeNode[p]))
index += char(activeNode[p++]);
// extract the index value
_Index = atoi(index.c_str());
// skip the closing ]
p++;
string sheetRoot = activeNode.substr(0, p);
string soundName;
// pdoc->getForm()->getRootNode().getValueByName(soundName, (sheetRoot+".Sound").c_str());
// _SoundFilterPane.SetWindowText((string("Edit Sound Filters ")+soundName).c_str());
for (uint i=0; i<32; ++i)
{
char tmp[128];
sprintf(tmp, "%02u", i);
pdoc->getForm()->getRootNode().getValueByName(val, (sheetRoot+".Filter"+tmp).c_str());
GetDlgItem(FILTER_EDIT[i])->EnableWindow(TRUE);
static_cast<CButton*>(GetDlgItem(FILTER_EDIT[i]))->SetCheck(val ? 1 : 0);
}
// set the name of the sub sound
string s;
pdoc->getForm()->getRootNode().getValueByName(s, (sheetRoot+".Sound").c_str());
_SubSoundName = s.c_str();
UpdateData(FALSE);
GetDlgItem(IDC_SUB_SOUND_NAME)->EnableWindow(TRUE);
valid = true;
}
}
}
}
}
if (!valid)
{
for (uint i=0; i<32; ++i)
{
GetDlgItem(FILTER_EDIT[i])->EnableWindow(FALSE);
}
GetDlgItem(IDC_SUB_SOUND_NAME)->EnableWindow(FALSE);
_Index = -1;
}
}
void CPageBgFlags::updateData(bool updateEditFilter)
{
_recurse = true;
// update the filter flags and simulation status
if (_Index != -1 && updateEditFilter)
{
// filter edition is valid, update them
for (uint i=0; i<32; ++i)
{
bool state = static_cast<CButton*>(GetDlgItem(FILTER_EDIT[i]))->GetCheck() == 1;
char path[1024];
sprintf(path, ".SoundType.Sounds[%u].Filter%02u", _Index, i);
SoundDialog->getSoundPlugin()->getActiveDocument()->setValue(state ? "true" : "false", path);
}
SoundDialog->getSoundPlugin()->getActiveDocument()->refreshView();
}
// simulation filters
NLSOUND::UAudioMixer::TBackgroundFlags flags;
for (uint i=0; i<32; ++i)
{
flags.Flags[i] = static_cast<CButton*>(GetDlgItem(FILTER_SIM[i]))->GetCheck() == 1;
}
SoundDialog->getSoundPlugin()->getMixer()->setBackgroundFlags(flags);
_recurse = false;
}
BOOL CPageBgFlags::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// update filter labels and state
const NLSOUND::UAudioMixer::TBackgroundFlags &flag = SoundDialog->getSoundPlugin()->getMixer()->getBackgroundFlags();
for (uint i=0; i<32; ++i)
{
GetDlgItem(FILTER_EDIT_NAME[i])->SetWindowText(SoundDialog->EnvNames[i].Name.c_str());
GetDlgItem(FILTER_SIM_NAME[i])->SetWindowText(SoundDialog->EnvNames[i].ShortName.c_str());
static_cast<CButton*>(GetDlgItem(FILTER_SIM[i]))->SetCheck(flag.Flags[i] ? 1 : 0);
}
// force an update of the dialog state
onDocChanged();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// PageBgFlags.cpp : implementation file
//
#include "std_sound_plugin.h"
#include "nel/misc/types_nl.h"
#include "georges_plugin_sound.h"
#include "nel/georges/u_form_elm.h"
#include "sound_document_plugin.h"
#include "nel/sound/u_audio_mixer.h"
#include "PageBgFlags.h"
using namespace std;
// controls id arrays
uint FILTER_EDIT[] =
{
IDC_FILTER_00,
IDC_FILTER_01,
IDC_FILTER_02,
IDC_FILTER_03,
IDC_FILTER_04,
IDC_FILTER_05,
IDC_FILTER_06,
IDC_FILTER_07,
IDC_FILTER_08,
IDC_FILTER_09,
IDC_FILTER_10,
IDC_FILTER_11,
IDC_FILTER_12,
IDC_FILTER_13,
IDC_FILTER_14,
IDC_FILTER_15,
IDC_FILTER_16,
IDC_FILTER_17,
IDC_FILTER_18,
IDC_FILTER_19,
IDC_FILTER_20,
IDC_FILTER_21,
IDC_FILTER_22,
IDC_FILTER_23,
IDC_FILTER_24,
IDC_FILTER_25,
IDC_FILTER_26,
IDC_FILTER_27,
IDC_FILTER_28,
IDC_FILTER_29,
IDC_FILTER_30,
IDC_FILTER_31
};
uint FILTER_EDIT_NAME[] =
{
IDC_FILTER_NAME_00,
IDC_FILTER_NAME_01,
IDC_FILTER_NAME_02,
IDC_FILTER_NAME_03,
IDC_FILTER_NAME_04,
IDC_FILTER_NAME_05,
IDC_FILTER_NAME_06,
IDC_FILTER_NAME_07,
IDC_FILTER_NAME_08,
IDC_FILTER_NAME_09,
IDC_FILTER_NAME_10,
IDC_FILTER_NAME_11,
IDC_FILTER_NAME_12,
IDC_FILTER_NAME_13,
IDC_FILTER_NAME_14,
IDC_FILTER_NAME_15,
IDC_FILTER_NAME_16,
IDC_FILTER_NAME_17,
IDC_FILTER_NAME_18,
IDC_FILTER_NAME_19,
IDC_FILTER_NAME_20,
IDC_FILTER_NAME_21,
IDC_FILTER_NAME_22,
IDC_FILTER_NAME_23,
IDC_FILTER_NAME_24,
IDC_FILTER_NAME_25,
IDC_FILTER_NAME_26,
IDC_FILTER_NAME_27,
IDC_FILTER_NAME_28,
IDC_FILTER_NAME_29,
IDC_FILTER_NAME_30,
IDC_FILTER_NAME_31
};
uint FILTER_SIM[] =
{
IDC_ENV_FLAG_00,
IDC_ENV_FLAG_01,
IDC_ENV_FLAG_02,
IDC_ENV_FLAG_03,
IDC_ENV_FLAG_04,
IDC_ENV_FLAG_05,
IDC_ENV_FLAG_06,
IDC_ENV_FLAG_07,
IDC_ENV_FLAG_08,
IDC_ENV_FLAG_09,
IDC_ENV_FLAG_10,
IDC_ENV_FLAG_11,
IDC_ENV_FLAG_12,
IDC_ENV_FLAG_13,
IDC_ENV_FLAG_14,
IDC_ENV_FLAG_15,
IDC_ENV_FLAG_16,
IDC_ENV_FLAG_17,
IDC_ENV_FLAG_18,
IDC_ENV_FLAG_19,
IDC_ENV_FLAG_20,
IDC_ENV_FLAG_21,
IDC_ENV_FLAG_22,
IDC_ENV_FLAG_23,
IDC_ENV_FLAG_24,
IDC_ENV_FLAG_25,
IDC_ENV_FLAG_26,
IDC_ENV_FLAG_27,
IDC_ENV_FLAG_28,
IDC_ENV_FLAG_29,
IDC_ENV_FLAG_30,
IDC_ENV_FLAG_31,
};
uint FILTER_SIM_NAME[] =
{
IDC_ENV_NAME_00,
IDC_ENV_NAME_01,
IDC_ENV_NAME_02,
IDC_ENV_NAME_03,
IDC_ENV_NAME_04,
IDC_ENV_NAME_05,
IDC_ENV_NAME_06,
IDC_ENV_NAME_07,
IDC_ENV_NAME_08,
IDC_ENV_NAME_09,
IDC_ENV_NAME_10,
IDC_ENV_NAME_11,
IDC_ENV_NAME_12,
IDC_ENV_NAME_13,
IDC_ENV_NAME_14,
IDC_ENV_NAME_15,
IDC_ENV_NAME_16,
IDC_ENV_NAME_17,
IDC_ENV_NAME_18,
IDC_ENV_NAME_19,
IDC_ENV_NAME_20,
IDC_ENV_NAME_21,
IDC_ENV_NAME_22,
IDC_ENV_NAME_23,
IDC_ENV_NAME_24,
IDC_ENV_NAME_25,
IDC_ENV_NAME_26,
IDC_ENV_NAME_27,
IDC_ENV_NAME_28,
IDC_ENV_NAME_29,
IDC_ENV_NAME_30,
IDC_ENV_NAME_31,
};
std::map<uint, uint> FILTER_SIM_IDX;
std::map<uint, uint> FILTER_EDIT_IDX;
/////////////////////////////////////////////////////////////////////////////
// CPageBgFlags property page
#undef new
IMPLEMENT_DYNCREATE(CPageBgFlags, CPageBase)
#define new NL_NEW
CPageBgFlags::CPageBgFlags(NLGEORGES::CSoundDialog *soundDialog)
: CPageBase(soundDialog, CPageBgFlags::IDD),
_recurse(false)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
//{{AFX_DATA_INIT(CPageBgFlags)
_SubSoundName = _T("");
//}}AFX_DATA_INIT
for (uint i=0; i<32; ++i)
{
FILTER_EDIT_IDX.insert(make_pair(FILTER_EDIT[i], i));
FILTER_SIM_IDX.insert(make_pair(FILTER_SIM[i], i));
}
}
CPageBgFlags::~CPageBgFlags()
{
}
void CPageBgFlags::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPageBgFlags)
DDX_Text(pDX, IDC_SUB_SOUND_NAME, _SubSoundName);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPageBgFlags, CPropertyPage)
//{{AFX_MSG_MAP(CPageBgFlags)
ON_BN_CLICKED(IDC_BTN_EDIT_ALL_ON, OnBtnEditAllOn)
ON_BN_CLICKED(IDC_BTN_EDIT_ALL_OFF, OnBtnEditAllOff)
ON_BN_CLICKED(IDC_BTN_ENV_ALL_OFF, OnBtnEnvAllOff)
ON_BN_CLICKED(IDC_BTN_ENV_ALL_ON, OnBtnEnvAllOn)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPageBgFlags message handlers
BOOL CPageBgFlags::OnCommand(WPARAM wParam, LPARAM lParam)
{
_recurse = true;
if (lParam != 0)
{
int id = ::GetDlgCtrlID(HWND(lParam));
// command come from a control
if (FILTER_EDIT_IDX.find(id) != FILTER_EDIT_IDX.end())
{
bool state = static_cast<CButton*>(GetDlgItem(id))->GetCheck() == 1;
nldebug("Setting filter %u of sound %u to %s", FILTER_EDIT_IDX[id], _Index, state ? "true" : "false");
// here, we don't use the updateData method coz it's too slow for only one value
char path[1024];
sprintf(path, ".SoundType.Sounds[%u].Filter%02u", _Index, FILTER_EDIT_IDX[id]);
SoundDialog->getSoundPlugin()->getActiveDocument()->setValue(state ? "true" : "false", path);
SoundDialog->getSoundPlugin()->getActiveDocument()->refreshView();
}
else if (FILTER_SIM_IDX.find(id) != FILTER_SIM_IDX.end())
{
// bool state = (static_cast<CButton*>(GetDlgItem(id))->GetState() & 0x0003) != 0;
// nldebug("Setting simul filter %u to %s", FILTER_SIM_IDX[id] , state ? "true" : "false");
updateData(false);
}
}
_recurse = false;
return CPropertyPage::OnCommand(wParam, lParam);
}
void CPageBgFlags::OnBtnEditAllOn()
{
for (uint i=0; i<32; ++i)
{
static_cast<CButton*>(GetDlgItem(FILTER_EDIT[i]))->SetCheck(TRUE);
}
updateData(true);
}
void CPageBgFlags::OnBtnEditAllOff()
{
for (uint i=0; i<32; ++i)
{
static_cast<CButton*>(GetDlgItem(FILTER_EDIT[i]))->SetCheck(FALSE);
}
updateData(true);
}
void CPageBgFlags::OnBtnEnvAllOn()
{
for (uint i=0; i<32; ++i)
{
static_cast<CButton*>(GetDlgItem(FILTER_SIM[i]))->SetCheck(TRUE);
}
updateData(false);
}
void CPageBgFlags::OnBtnEnvAllOff()
{
for (uint i=0; i<32; ++i)
{
static_cast<CButton*>(GetDlgItem(FILTER_SIM[i]))->SetCheck(FALSE);
}
updateData(false);
}
void CPageBgFlags::onDocChanged()
{
// the document have been modified, update the dialog
NLGEORGES::IEditDocument *pdoc = SoundDialog->getSoundPlugin()->getActiveDocument();
bool valid = false;
if (_recurse)
return;
if (pdoc != NULL)
{
string type, dfnName;
NLGEORGES::UFormElm *psoundType;
pdoc->getForm()->getRootNode().getNodeByName(&psoundType, ".SoundType");
if (psoundType != NULL)
{
psoundType->getDfnName(dfnName);
if (dfnName == "background_sound.dfn")
{
// set the filter flags according to active node
bool val;
string activeNode;
pdoc->getActiveNode(activeNode);
if (activeNode.find(".SoundType.Sounds") != string::npos)
{
// extract the root path on the sheet.
string::size_type p = activeNode.find(".SoundType.Sounds");
while (p < activeNode.size() && activeNode[p] != '[')
p++;
if (p < activeNode.size())
{
// skip the open [
p++;
string index;
while (isdigit(activeNode[p]))
index += char(activeNode[p++]);
// extract the index value
_Index = atoi(index.c_str());
// skip the closing ]
p++;
string sheetRoot = activeNode.substr(0, p);
string soundName;
// pdoc->getForm()->getRootNode().getValueByName(soundName, (sheetRoot+".Sound").c_str());
// _SoundFilterPane.SetWindowText((string("Edit Sound Filters ")+soundName).c_str());
for (uint i=0; i<32; ++i)
{
char tmp[128];
sprintf(tmp, "%02u", i);
pdoc->getForm()->getRootNode().getValueByName(val, (sheetRoot+".Filter"+tmp).c_str());
GetDlgItem(FILTER_EDIT[i])->EnableWindow(TRUE);
static_cast<CButton*>(GetDlgItem(FILTER_EDIT[i]))->SetCheck(val ? 1 : 0);
}
// set the name of the sub sound
string s;
pdoc->getForm()->getRootNode().getValueByName(s, (sheetRoot+".Sound").c_str());
_SubSoundName = s.c_str();
UpdateData(FALSE);
GetDlgItem(IDC_SUB_SOUND_NAME)->EnableWindow(TRUE);
valid = true;
}
}
}
}
}
if (!valid)
{
for (uint i=0; i<32; ++i)
{
GetDlgItem(FILTER_EDIT[i])->EnableWindow(FALSE);
}
GetDlgItem(IDC_SUB_SOUND_NAME)->EnableWindow(FALSE);
_Index = -1;
}
}
void CPageBgFlags::updateData(bool updateEditFilter)
{
_recurse = true;
// update the filter flags and simulation status
if (_Index != -1 && updateEditFilter)
{
// filter edition is valid, update them
for (uint i=0; i<32; ++i)
{
bool state = static_cast<CButton*>(GetDlgItem(FILTER_EDIT[i]))->GetCheck() == 1;
char path[1024];
sprintf(path, ".SoundType.Sounds[%u].Filter%02u", _Index, i);
SoundDialog->getSoundPlugin()->getActiveDocument()->setValue(state ? "true" : "false", path);
}
SoundDialog->getSoundPlugin()->getActiveDocument()->refreshView();
}
// simulation filters
NLSOUND::UAudioMixer::TBackgroundFlags flags;
for (uint i=0; i<32; ++i)
{
flags.Flags[i] = static_cast<CButton*>(GetDlgItem(FILTER_SIM[i]))->GetCheck() == 1;
}
SoundDialog->getSoundPlugin()->getMixer()->setBackgroundFlags(flags);
_recurse = false;
}
BOOL CPageBgFlags::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// update filter labels and state
const NLSOUND::UAudioMixer::TBackgroundFlags &flag = SoundDialog->getSoundPlugin()->getMixer()->getBackgroundFlags();
for (uint i=0; i<32; ++i)
{
GetDlgItem(FILTER_EDIT_NAME[i])->SetWindowText(SoundDialog->EnvNames[i].Name.c_str());
GetDlgItem(FILTER_SIM_NAME[i])->SetWindowText(SoundDialog->EnvNames[i].ShortName.c_str());
static_cast<CButton*>(GetDlgItem(FILTER_SIM[i]))->SetCheck(flag.Flags[i] ? 1 : 0);
}
// force an update of the dialog state
onDocChanged();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

@ -1,85 +1,85 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_PAGEBGFLAGS_H__302480C3_66F1_460C_BC59_B468ACBD55B2__INCLUDED_)
#define AFX_PAGEBGFLAGS_H__302480C3_66F1_460C_BC59_B468ACBD55B2__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PageBgFlags.h : header file
//
#include "nel/misc/types_nl.h"
#include "PageBase.h"
/////////////////////////////////////////////////////////////////////////////
// CPageBgFlags dialog
class CPageBgFlags : public CPageBase
{
DECLARE_DYNCREATE(CPageBgFlags)
// called by the master dialog when doc change
void onDocChanged();
// called by this dialog when data must be updated
void updateData(bool updateEditFilter);
/// Index of the current edited sound the the background
sint _Index;
/// Flag to block updating will modifying
bool _recurse;
// Construction
public:
CPageBgFlags() {}
CPageBgFlags(NLGEORGES::CSoundDialog *soundDialog);
~CPageBgFlags();
// Dialog Data
//{{AFX_DATA(CPageBgFlags)
enum { IDD = IDD_PAGE_BG_FLAGS };
CString _SubSoundName;
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CPageBgFlags)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CPageBgFlags)
afx_msg void OnBtnEditAllOn();
afx_msg void OnBtnEditAllOff();
afx_msg void OnBtnEnvAllOff();
afx_msg void OnBtnEnvAllOn();
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_PAGEBGFLAGS_H__302480C3_66F1_460C_BC59_B468ACBD55B2__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_PAGEBGFLAGS_H__302480C3_66F1_460C_BC59_B468ACBD55B2__INCLUDED_)
#define AFX_PAGEBGFLAGS_H__302480C3_66F1_460C_BC59_B468ACBD55B2__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PageBgFlags.h : header file
//
#include "nel/misc/types_nl.h"
#include "PageBase.h"
/////////////////////////////////////////////////////////////////////////////
// CPageBgFlags dialog
class CPageBgFlags : public CPageBase
{
DECLARE_DYNCREATE(CPageBgFlags)
// called by the master dialog when doc change
void onDocChanged();
// called by this dialog when data must be updated
void updateData(bool updateEditFilter);
/// Index of the current edited sound the the background
sint _Index;
/// Flag to block updating will modifying
bool _recurse;
// Construction
public:
CPageBgFlags() {}
CPageBgFlags(NLGEORGES::CSoundDialog *soundDialog);
~CPageBgFlags();
// Dialog Data
//{{AFX_DATA(CPageBgFlags)
enum { IDD = IDD_PAGE_BG_FLAGS };
CString _SubSoundName;
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CPageBgFlags)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CPageBgFlags)
afx_msg void OnBtnEditAllOn();
afx_msg void OnBtnEditAllOff();
afx_msg void OnBtnEnvAllOff();
afx_msg void OnBtnEnvAllOn();
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_PAGEBGFLAGS_H__302480C3_66F1_460C_BC59_B468ACBD55B2__INCLUDED_)

@ -1,170 +1,170 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// PageComplex.cpp : implementation file
//
#include "std_sound_plugin.h"
#include "sound_document_plugin.h"
#include <string>
#include "PageComplex.h"
using namespace std;
/////////////////////////////////////////////////////////////////////////////
// CPageComplex property page
#undef new
IMPLEMENT_DYNCREATE(CPageComplex, CPageBase)
#define new NL_NEW
CPageComplex::CPageComplex(NLGEORGES::CSoundDialog *soundDialog) : CPageBase(soundDialog, CPageComplex::IDD)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
//{{AFX_DATA_INIT(CPageComplex)
_SequenceSize = 0;
_MaxDelay = 0;
_MinDelay = 0;
//}}AFX_DATA_INIT
}
CPageComplex::~CPageComplex()
{
}
void CPageComplex::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPageComplex)
DDX_Control(pDX, IDC_BTN_RANDOM_SOUND, _BtnRandomSound);
DDX_Control(pDX, IDC_BTN_RANDOM_DELAY, _BtnRandomDelay);
DDX_Text(pDX, IDC_EDIT_SEQ_SIZE, _SequenceSize);
DDX_Text(pDX, IDC_EDIT_MAX_DELAY, _MaxDelay);
DDX_Text(pDX, IDC_EDIT_MIN_DELAY, _MinDelay);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPageComplex, CPropertyPage)
//{{AFX_MSG_MAP(CPageComplex)
ON_BN_CLICKED(IDC_BTN_RANDOM_DELAY, OnBtnRandomDelay)
ON_BN_CLICKED(IDC_BTN_RANDOM_SOUND, OnBtnRandomSound)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPageComplex message handlers
void CPageComplex::OnBtnRandomDelay()
{
UpdateData(TRUE);
nldebug("Random sound : size = %u, min = %u, max = %u", _SequenceSize, _MinDelay, _MaxDelay);
if (_MinDelay < 0)
{
_MinDelay = 0;
UpdateData(FALSE);
}
if (_MaxDelay < _MinDelay)
{
_MaxDelay = _MinDelay+1;
UpdateData(FALSE);
}
NLGEORGES::IEditDocument *pdoc = SoundDialog->getSoundPlugin()->getActiveDocument();
if (pdoc != NULL)
{
// create a delay list.
string seq;
for (sint i=0; i<_SequenceSize; ++i)
{
char tmp[200];
sprintf(tmp, "%u", _MinDelay + rand()%((_MaxDelay+1)-_MinDelay));
seq += string(tmp)+";";
}
pdoc->setValue(seq.c_str(), ".SoundType.DelaySeq");
pdoc->refreshView();
}
}
void CPageComplex::OnBtnRandomSound()
{
UpdateData(TRUE);
nldebug("Random sound : size = %u, min = %u, max = %u", _SequenceSize, _MinDelay, _MaxDelay);
NLGEORGES::IEditDocument *pdoc = SoundDialog->getSoundPlugin()->getActiveDocument();
if (pdoc != NULL)
{
// create a sound list.
NLGEORGES::UFormElm *psoundsArray;
pdoc->getForm()->getRootNode().getNodeByName(&psoundsArray, ".SoundType.SoundList");
if (psoundsArray != NULL)
{
uint size;
psoundsArray->getArraySize(size);
string seq;
for (sint i=0; i<_SequenceSize; ++i)
{
char tmp[200];
sprintf(tmp, "%u", rand()%size);
seq += string(tmp)+";";
}
pdoc->setValue(seq.c_str(), ".SoundType.SoundSeq");
pdoc->refreshView();
}
}
}
void CPageComplex::onDocChanged()
{
// the document have been modified, update the dialog
NLGEORGES::IEditDocument *pdoc = SoundDialog->getSoundPlugin()->getActiveDocument();
bool valid = false;
if (pdoc != NULL)
{
string type, dfnName;
NLGEORGES::UFormElm *psoundType;
pdoc->getForm()->getRootNode().getNodeByName(&psoundType, ".SoundType");
if (psoundType != NULL)
{
psoundType->getDfnName(dfnName);
if (dfnName == "complex_sound.dfn")
{
_BtnRandomDelay.EnableWindow(TRUE);
_BtnRandomSound.EnableWindow(TRUE);
valid = true;
}
}
}
if (!valid)
{
_BtnRandomDelay.EnableWindow(FALSE);
_BtnRandomSound.EnableWindow(FALSE);
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// PageComplex.cpp : implementation file
//
#include "std_sound_plugin.h"
#include "sound_document_plugin.h"
#include <string>
#include "PageComplex.h"
using namespace std;
/////////////////////////////////////////////////////////////////////////////
// CPageComplex property page
#undef new
IMPLEMENT_DYNCREATE(CPageComplex, CPageBase)
#define new NL_NEW
CPageComplex::CPageComplex(NLGEORGES::CSoundDialog *soundDialog) : CPageBase(soundDialog, CPageComplex::IDD)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
//{{AFX_DATA_INIT(CPageComplex)
_SequenceSize = 0;
_MaxDelay = 0;
_MinDelay = 0;
//}}AFX_DATA_INIT
}
CPageComplex::~CPageComplex()
{
}
void CPageComplex::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPageComplex)
DDX_Control(pDX, IDC_BTN_RANDOM_SOUND, _BtnRandomSound);
DDX_Control(pDX, IDC_BTN_RANDOM_DELAY, _BtnRandomDelay);
DDX_Text(pDX, IDC_EDIT_SEQ_SIZE, _SequenceSize);
DDX_Text(pDX, IDC_EDIT_MAX_DELAY, _MaxDelay);
DDX_Text(pDX, IDC_EDIT_MIN_DELAY, _MinDelay);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPageComplex, CPropertyPage)
//{{AFX_MSG_MAP(CPageComplex)
ON_BN_CLICKED(IDC_BTN_RANDOM_DELAY, OnBtnRandomDelay)
ON_BN_CLICKED(IDC_BTN_RANDOM_SOUND, OnBtnRandomSound)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPageComplex message handlers
void CPageComplex::OnBtnRandomDelay()
{
UpdateData(TRUE);
nldebug("Random sound : size = %u, min = %u, max = %u", _SequenceSize, _MinDelay, _MaxDelay);
if (_MinDelay < 0)
{
_MinDelay = 0;
UpdateData(FALSE);
}
if (_MaxDelay < _MinDelay)
{
_MaxDelay = _MinDelay+1;
UpdateData(FALSE);
}
NLGEORGES::IEditDocument *pdoc = SoundDialog->getSoundPlugin()->getActiveDocument();
if (pdoc != NULL)
{
// create a delay list.
string seq;
for (sint i=0; i<_SequenceSize; ++i)
{
char tmp[200];
sprintf(tmp, "%u", _MinDelay + rand()%((_MaxDelay+1)-_MinDelay));
seq += string(tmp)+";";
}
pdoc->setValue(seq.c_str(), ".SoundType.DelaySeq");
pdoc->refreshView();
}
}
void CPageComplex::OnBtnRandomSound()
{
UpdateData(TRUE);
nldebug("Random sound : size = %u, min = %u, max = %u", _SequenceSize, _MinDelay, _MaxDelay);
NLGEORGES::IEditDocument *pdoc = SoundDialog->getSoundPlugin()->getActiveDocument();
if (pdoc != NULL)
{
// create a sound list.
NLGEORGES::UFormElm *psoundsArray;
pdoc->getForm()->getRootNode().getNodeByName(&psoundsArray, ".SoundType.SoundList");
if (psoundsArray != NULL)
{
uint size;
psoundsArray->getArraySize(size);
string seq;
for (sint i=0; i<_SequenceSize; ++i)
{
char tmp[200];
sprintf(tmp, "%u", rand()%size);
seq += string(tmp)+";";
}
pdoc->setValue(seq.c_str(), ".SoundType.SoundSeq");
pdoc->refreshView();
}
}
}
void CPageComplex::onDocChanged()
{
// the document have been modified, update the dialog
NLGEORGES::IEditDocument *pdoc = SoundDialog->getSoundPlugin()->getActiveDocument();
bool valid = false;
if (pdoc != NULL)
{
string type, dfnName;
NLGEORGES::UFormElm *psoundType;
pdoc->getForm()->getRootNode().getNodeByName(&psoundType, ".SoundType");
if (psoundType != NULL)
{
psoundType->getDfnName(dfnName);
if (dfnName == "complex_sound.dfn")
{
_BtnRandomDelay.EnableWindow(TRUE);
_BtnRandomSound.EnableWindow(TRUE);
valid = true;
}
}
}
if (!valid)
{
_BtnRandomDelay.EnableWindow(FALSE);
_BtnRandomSound.EnableWindow(FALSE);
}
}

@ -1,74 +1,74 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_PAGECOMPLEX_H__6EB5AE57_5E13_4028_9985_04EF86FB7AE6__INCLUDED_)
#define AFX_PAGECOMPLEX_H__6EB5AE57_5E13_4028_9985_04EF86FB7AE6__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PageComplex.h : header file
//
#include "PageBase.h"
/////////////////////////////////////////////////////////////////////////////
// CPageComplex dialog
class CPageComplex : public CPageBase
{
DECLARE_DYNCREATE(CPageComplex)
void onDocChanged();
// Construction
public:
CPageComplex(){}
CPageComplex(NLGEORGES::CSoundDialog *soundDialog);
~CPageComplex();
// Dialog Data
//{{AFX_DATA(CPageComplex)
enum { IDD = IDD_PAGE_COMPLEX };
CButton _BtnRandomSound;
CButton _BtnRandomDelay;
int _SequenceSize;
int _MaxDelay;
int _MinDelay;
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CPageComplex)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CPageComplex)
afx_msg void OnBtnRandomDelay();
afx_msg void OnBtnRandomSound();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PAGECOMPLEX_H__6EB5AE57_5E13_4028_9985_04EF86FB7AE6__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_PAGECOMPLEX_H__6EB5AE57_5E13_4028_9985_04EF86FB7AE6__INCLUDED_)
#define AFX_PAGECOMPLEX_H__6EB5AE57_5E13_4028_9985_04EF86FB7AE6__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PageComplex.h : header file
//
#include "PageBase.h"
/////////////////////////////////////////////////////////////////////////////
// CPageComplex dialog
class CPageComplex : public CPageBase
{
DECLARE_DYNCREATE(CPageComplex)
void onDocChanged();
// Construction
public:
CPageComplex(){}
CPageComplex(NLGEORGES::CSoundDialog *soundDialog);
~CPageComplex();
// Dialog Data
//{{AFX_DATA(CPageComplex)
enum { IDD = IDD_PAGE_COMPLEX };
CButton _BtnRandomSound;
CButton _BtnRandomDelay;
int _SequenceSize;
int _MaxDelay;
int _MinDelay;
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CPageComplex)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CPageComplex)
afx_msg void OnBtnRandomDelay();
afx_msg void OnBtnRandomSound();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PAGECOMPLEX_H__6EB5AE57_5E13_4028_9985_04EF86FB7AE6__INCLUDED_)

@ -1,105 +1,105 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// PageComtext.cpp : implementation file
//
#include "std_sound_plugin.h"
#include "georges_plugin_sound.h"
#include <map>
#include "PageComtext.h"
using namespace std;
uint EDIT_ARG_ID [] =
{
IDC_EDIT_ARG_0,
IDC_EDIT_ARG_1,
IDC_EDIT_ARG_2,
IDC_EDIT_ARG_3,
IDC_EDIT_ARG_4,
IDC_EDIT_ARG_5,
IDC_EDIT_ARG_6,
IDC_EDIT_ARG_7,
IDC_EDIT_ARG_8,
IDC_EDIT_ARG_9
};
map<uint, uint> EDIT_ARG_IDX;
/////////////////////////////////////////////////////////////////////////////
// CPageComtext property page
#undef new
IMPLEMENT_DYNCREATE(CPageComtext, CPageBase)
#define new NL_NEW
CPageComtext::CPageComtext(NLGEORGES::CSoundDialog *soundDialog) : CPageBase(soundDialog, CPageComtext::IDD)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
//{{AFX_DATA_INIT(CPageComtext)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
for (uint i =0; i<10; ++i)
{
EDIT_ARG_IDX.insert(make_pair(EDIT_ARG_ID[i], i));
// init the context sound vars
SoundContext.Args[i] = 0;
}
}
CPageComtext::~CPageComtext()
{
}
void CPageComtext::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPageComtext)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPageComtext, CPropertyPage)
//{{AFX_MSG_MAP(CPageComtext)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPageComtext message handlers
BOOL CPageComtext::OnCommand(WPARAM wParam, LPARAM lParam)
{
if (lParam != 0 && HIWORD(wParam) == EN_CHANGE)
{
int id = ::GetDlgCtrlID(HWND(lParam));
// command come from a control
if (EDIT_ARG_IDX.find(id) != EDIT_ARG_IDX.end())
{
// need to update the var.
char tmp[1024];
GetDlgItem(id)->GetWindowText(tmp, 1024);
SoundContext.Args[EDIT_ARG_IDX[id]] = atoi(tmp);
}
}
return CPropertyPage::OnCommand(wParam, lParam);
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// PageComtext.cpp : implementation file
//
#include "std_sound_plugin.h"
#include "georges_plugin_sound.h"
#include <map>
#include "PageComtext.h"
using namespace std;
uint EDIT_ARG_ID [] =
{
IDC_EDIT_ARG_0,
IDC_EDIT_ARG_1,
IDC_EDIT_ARG_2,
IDC_EDIT_ARG_3,
IDC_EDIT_ARG_4,
IDC_EDIT_ARG_5,
IDC_EDIT_ARG_6,
IDC_EDIT_ARG_7,
IDC_EDIT_ARG_8,
IDC_EDIT_ARG_9
};
map<uint, uint> EDIT_ARG_IDX;
/////////////////////////////////////////////////////////////////////////////
// CPageComtext property page
#undef new
IMPLEMENT_DYNCREATE(CPageComtext, CPageBase)
#define new NL_NEW
CPageComtext::CPageComtext(NLGEORGES::CSoundDialog *soundDialog) : CPageBase(soundDialog, CPageComtext::IDD)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
//{{AFX_DATA_INIT(CPageComtext)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
for (uint i =0; i<10; ++i)
{
EDIT_ARG_IDX.insert(make_pair(EDIT_ARG_ID[i], i));
// init the context sound vars
SoundContext.Args[i] = 0;
}
}
CPageComtext::~CPageComtext()
{
}
void CPageComtext::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPageComtext)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPageComtext, CPropertyPage)
//{{AFX_MSG_MAP(CPageComtext)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPageComtext message handlers
BOOL CPageComtext::OnCommand(WPARAM wParam, LPARAM lParam)
{
if (lParam != 0 && HIWORD(wParam) == EN_CHANGE)
{
int id = ::GetDlgCtrlID(HWND(lParam));
// command come from a control
if (EDIT_ARG_IDX.find(id) != EDIT_ARG_IDX.end())
{
// need to update the var.
char tmp[1024];
GetDlgItem(id)->GetWindowText(tmp, 1024);
SoundContext.Args[EDIT_ARG_IDX[id]] = atoi(tmp);
}
}
return CPropertyPage::OnCommand(wParam, lParam);
}

@ -1,73 +1,73 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_PAGECOMTEXT_H__C904D249_575F_460D_9E6B_F3D814B65873__INCLUDED_)
#define AFX_PAGECOMTEXT_H__C904D249_575F_460D_9E6B_F3D814B65873__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PageComtext.h : header file
//
#include "nel/sound/u_audio_mixer.h"
#include "PageBase.h"
/////////////////////////////////////////////////////////////////////////////
// CPageComtext dialog
class CPageComtext : public CPageBase
{
DECLARE_DYNCREATE(CPageComtext)
// Construction
public:
CPageComtext(){}
CPageComtext(NLGEORGES::CSoundDialog *soundDialog);
~CPageComtext();
/// The current sound context.
NLSOUND::CSoundContext SoundContext;
// Dialog Data
//{{AFX_DATA(CPageComtext)
enum { IDD = IDD_PAGE_CONTEXT };
// NOTE - ClassWizard will add data members here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CPageComtext)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CPageComtext)
// 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_PAGECOMTEXT_H__C904D249_575F_460D_9E6B_F3D814B65873__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_PAGECOMTEXT_H__C904D249_575F_460D_9E6B_F3D814B65873__INCLUDED_)
#define AFX_PAGECOMTEXT_H__C904D249_575F_460D_9E6B_F3D814B65873__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PageComtext.h : header file
//
#include "nel/sound/u_audio_mixer.h"
#include "PageBase.h"
/////////////////////////////////////////////////////////////////////////////
// CPageComtext dialog
class CPageComtext : public CPageBase
{
DECLARE_DYNCREATE(CPageComtext)
// Construction
public:
CPageComtext(){}
CPageComtext(NLGEORGES::CSoundDialog *soundDialog);
~CPageComtext();
/// The current sound context.
NLSOUND::CSoundContext SoundContext;
// Dialog Data
//{{AFX_DATA(CPageComtext)
enum { IDD = IDD_PAGE_CONTEXT };
// NOTE - ClassWizard will add data members here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CPageComtext)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CPageComtext)
// 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_PAGECOMTEXT_H__C904D249_575F_460D_9E6B_F3D814B65873__INCLUDED_)

@ -1,134 +1,134 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// PagePosition.cpp : implementation file
//
#include "std_sound_plugin.h"
#include "georges_plugin_sound.h"
#include "listener_view.h"
#include "sound_dialog.h"
#include "nel/georges/u_form_elm.h"
#include "sound_document_plugin.h"
#include "nel/sound/u_audio_mixer.h"
#include "nel/sound/sound.h"
#include "nel/sound/simple_sound.h"
#include "PagePosition.h"
using namespace std;
/////////////////////////////////////////////////////////////////////////////
// CPagePosition property page
#undef new
IMPLEMENT_DYNCREATE(CPagePosition, CPageBase)
#define new NL_NEW
CPagePosition::CPagePosition(NLGEORGES::CSoundDialog *soundDialog) : CPageBase(soundDialog, CPagePosition::IDD)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
//{{AFX_DATA_INIT(CPagePosition)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
CPagePosition::~CPagePosition()
{
}
void CPagePosition::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPagePosition)
DDX_Control(pDX, IDC_PSEUDO_PICTURE, _Picture);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPagePosition, CPropertyPage)
//{{AFX_MSG_MAP(CPagePosition)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPagePosition message handlers
BOOL CPagePosition::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// TODO: Add extra initialization here
// insert the listener position view inside the pseudo picture control.
WINDOWPLACEMENT place;
_Picture.GetWindowPlacement(&place);
#undef new
_ListenerView = new NLGEORGES::CListenerView();
#define new NL_NEW
_ListenerView->init(SoundDialog->getSoundPlugin(), CRect(place.rcNormalPosition), this);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CPagePosition::onDocChanged()
{
/* // the document have been modified, update the dialog
NLGEORGES::IEditDocument *pdoc = SoundDialog->getSoundPlugin()->getActiveDocument();
*/
bool valid = false;
/*
if (pdoc != NULL)
{
string type, dfnName;
pdoc->getForm()->getRootNode().getDfnName(dfnName);
if (dfnName == "sound.dfn")
{
*/ NLSOUND::CSound *sound = SoundDialog->getSoundPlugin()->getSound();
if (sound != 0)
{
// the sound is available !
float minDist = 1.0f;
_ListenerView->setAngles(uint32(180 * sound->getConeInnerAngle() / NLMISC::Pi), uint32(180 * sound->getConeOuterAngle() / NLMISC::Pi));
if (sound->getSoundType() == NLSOUND::CSound::SOUND_SIMPLE)
{
_ListenerView->setAlpha(static_cast<NLSOUND::CSimpleSound*>(sound)->getAlpha());
_ListenerView->setShowAlpha(true);
minDist = static_cast<NLSOUND::CSimpleSound*>(sound)->getMinDistance();
}
else
_ListenerView->setShowAlpha(false);
_ListenerView->setMinMaxDistances(minDist, sound->getMaxDistance());
_ListenerView->setActive(true);
valid = true;
}
/* }
}
*/
if (!valid)
{
// not a sound file
_ListenerView->setActive(false);
}
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// PagePosition.cpp : implementation file
//
#include "std_sound_plugin.h"
#include "georges_plugin_sound.h"
#include "listener_view.h"
#include "sound_dialog.h"
#include "nel/georges/u_form_elm.h"
#include "sound_document_plugin.h"
#include "nel/sound/u_audio_mixer.h"
#include "nel/sound/sound.h"
#include "nel/sound/simple_sound.h"
#include "PagePosition.h"
using namespace std;
/////////////////////////////////////////////////////////////////////////////
// CPagePosition property page
#undef new
IMPLEMENT_DYNCREATE(CPagePosition, CPageBase)
#define new NL_NEW
CPagePosition::CPagePosition(NLGEORGES::CSoundDialog *soundDialog) : CPageBase(soundDialog, CPagePosition::IDD)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
//{{AFX_DATA_INIT(CPagePosition)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
CPagePosition::~CPagePosition()
{
}
void CPagePosition::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPagePosition)
DDX_Control(pDX, IDC_PSEUDO_PICTURE, _Picture);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPagePosition, CPropertyPage)
//{{AFX_MSG_MAP(CPagePosition)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPagePosition message handlers
BOOL CPagePosition::OnInitDialog()
{
CPropertyPage::OnInitDialog();
// TODO: Add extra initialization here
// insert the listener position view inside the pseudo picture control.
WINDOWPLACEMENT place;
_Picture.GetWindowPlacement(&place);
#undef new
_ListenerView = new NLGEORGES::CListenerView();
#define new NL_NEW
_ListenerView->init(SoundDialog->getSoundPlugin(), CRect(place.rcNormalPosition), this);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CPagePosition::onDocChanged()
{
/* // the document have been modified, update the dialog
NLGEORGES::IEditDocument *pdoc = SoundDialog->getSoundPlugin()->getActiveDocument();
*/
bool valid = false;
/*
if (pdoc != NULL)
{
string type, dfnName;
pdoc->getForm()->getRootNode().getDfnName(dfnName);
if (dfnName == "sound.dfn")
{
*/ NLSOUND::CSound *sound = SoundDialog->getSoundPlugin()->getSound();
if (sound != 0)
{
// the sound is available !
float minDist = 1.0f;
_ListenerView->setAngles(uint32(180 * sound->getConeInnerAngle() / NLMISC::Pi), uint32(180 * sound->getConeOuterAngle() / NLMISC::Pi));
if (sound->getSoundType() == NLSOUND::CSound::SOUND_SIMPLE)
{
_ListenerView->setAlpha(static_cast<NLSOUND::CSimpleSound*>(sound)->getAlpha());
_ListenerView->setShowAlpha(true);
minDist = static_cast<NLSOUND::CSimpleSound*>(sound)->getMinDistance();
}
else
_ListenerView->setShowAlpha(false);
_ListenerView->setMinMaxDistances(minDist, sound->getMaxDistance());
_ListenerView->setActive(true);
valid = true;
}
/* }
}
*/
if (!valid)
{
// not a sound file
_ListenerView->setActive(false);
}
}

@ -1,77 +1,77 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_PAGEPOSITION_H__234F9FB4_3803_4973_BC3D_8D398A9C438A__INCLUDED_)
#define AFX_PAGEPOSITION_H__234F9FB4_3803_4973_BC3D_8D398A9C438A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PagePosition.h : header file
//
#include "PageBase.h"
namespace NLGEORGES
{
class CListenerView;
}
/////////////////////////////////////////////////////////////////////////////
// CPagePosition dialog
class CPagePosition : public CPageBase
{
DECLARE_DYNCREATE(CPagePosition)
void onDocChanged();
// Construction
public:
CPagePosition(){}
CPagePosition(NLGEORGES::CSoundDialog *soundDialog);
~CPagePosition();
// Dialog Data
//{{AFX_DATA(CPagePosition)
enum { IDD = IDD_PAGE_POSITION };
CStatic _Picture;
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CPagePosition)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CPagePosition)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
NLGEORGES::CListenerView *_ListenerView;
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PAGEPOSITION_H__234F9FB4_3803_4973_BC3D_8D398A9C438A__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_PAGEPOSITION_H__234F9FB4_3803_4973_BC3D_8D398A9C438A__INCLUDED_)
#define AFX_PAGEPOSITION_H__234F9FB4_3803_4973_BC3D_8D398A9C438A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PagePosition.h : header file
//
#include "PageBase.h"
namespace NLGEORGES
{
class CListenerView;
}
/////////////////////////////////////////////////////////////////////////////
// CPagePosition dialog
class CPagePosition : public CPageBase
{
DECLARE_DYNCREATE(CPagePosition)
void onDocChanged();
// Construction
public:
CPagePosition(){}
CPagePosition(NLGEORGES::CSoundDialog *soundDialog);
~CPagePosition();
// Dialog Data
//{{AFX_DATA(CPagePosition)
enum { IDD = IDD_PAGE_POSITION };
CStatic _Picture;
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CPagePosition)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CPagePosition)
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
NLGEORGES::CListenerView *_ListenerView;
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_PAGEPOSITION_H__234F9FB4_3803_4973_BC3D_8D398A9C438A__INCLUDED_)

@ -1,135 +1,135 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// PageSimple.cpp : implementation file
//
#include "std_sound_plugin.h"
#include "georges_plugin_sound.h"
#include "georges_plugin_sound.h"
#include "nel/georges/u_form_elm.h"
#include "sound_document_plugin.h"
#include <string>
#include "PageSimple.h"
using namespace std;
/////////////////////////////////////////////////////////////////////////////
// CPageSimple property page
#undef new
IMPLEMENT_DYNCREATE(CPageSimple, CPageBase)
#define new NL_NEW
CPageSimple::CPageSimple(NLGEORGES::CSoundDialog *soundDialog) : CPageBase(soundDialog, CPageSimple::IDD)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
//{{AFX_DATA_INIT(CPageSimple)
_AudioFormat = _T("");
_Filename = _T("");
_Filesize = _T("");
//}}AFX_DATA_INIT
}
CPageSimple::~CPageSimple()
{
}
void CPageSimple::onDocChanged()
{
// the document have been modified, update the dialog
NLGEORGES::IEditDocument *pdoc = SoundDialog->getSoundPlugin()->getActiveDocument();
bool valid = false;
if (pdoc != NULL)
{
string type, dfnName;
NLGEORGES::UFormElm *psoundType;
pdoc->getForm()->getRootNode().getNodeByName(&psoundType, ".SoundType");
if (psoundType != NULL)
{
psoundType->getDfnName(dfnName);
if (dfnName == "simple_sound.dfn")
{
uint sampleRate, sampleSize, channels, size;
string filename;
char s[256];
psoundType->getValueByName(filename, "Filename");
if (SoundDialog->getFileInfo(filename, sampleRate, sampleSize, channels, size))
{
/* if (channels > 1)
{
::MessageBox(NULL, "3D sounds accept only mono files", _Name.c_str(), MB_OK);
}
*/
// _Name = _Name.c_str());
// SetWindowText((_Name.empty()) ? "Sound plugin" : _Name.c_str());
_Filename = filename.c_str();
_snprintf(s, 256, "%s / %d bits / %d Hz", (channels == 1)? "mono" : "stereo", sampleSize, sampleRate);
_AudioFormat = s;
_snprintf(s, 256, "%d kb", size / 1024);
_Filesize = s;
UpdateData(FALSE);
valid = true;
}
}
}
}
if (!valid)
{
// This is not a valid simple sound...
_AudioFormat = "";
_Filename = "";
_Filesize = "";
UpdateData(FALSE);
}
}
void CPageSimple::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPageSimple)
DDX_Control(pDX, IDC_FILESIZE, _FilesizeCtrl);
DDX_Control(pDX, IDC_FILENAME, _FilenameCtrl);
DDX_Control(pDX, IDC_AUDIOFORMAT, _AudioFormatCtrl);
DDX_Text(pDX, IDC_AUDIOFORMAT, _AudioFormat);
DDX_Text(pDX, IDC_FILENAME, _Filename);
DDX_Text(pDX, IDC_FILESIZE, _Filesize);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPageSimple, CPropertyPage)
//{{AFX_MSG_MAP(CPageSimple)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPageSimple message handlers
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// PageSimple.cpp : implementation file
//
#include "std_sound_plugin.h"
#include "georges_plugin_sound.h"
#include "georges_plugin_sound.h"
#include "nel/georges/u_form_elm.h"
#include "sound_document_plugin.h"
#include <string>
#include "PageSimple.h"
using namespace std;
/////////////////////////////////////////////////////////////////////////////
// CPageSimple property page
#undef new
IMPLEMENT_DYNCREATE(CPageSimple, CPageBase)
#define new NL_NEW
CPageSimple::CPageSimple(NLGEORGES::CSoundDialog *soundDialog) : CPageBase(soundDialog, CPageSimple::IDD)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
//{{AFX_DATA_INIT(CPageSimple)
_AudioFormat = _T("");
_Filename = _T("");
_Filesize = _T("");
//}}AFX_DATA_INIT
}
CPageSimple::~CPageSimple()
{
}
void CPageSimple::onDocChanged()
{
// the document have been modified, update the dialog
NLGEORGES::IEditDocument *pdoc = SoundDialog->getSoundPlugin()->getActiveDocument();
bool valid = false;
if (pdoc != NULL)
{
string type, dfnName;
NLGEORGES::UFormElm *psoundType;
pdoc->getForm()->getRootNode().getNodeByName(&psoundType, ".SoundType");
if (psoundType != NULL)
{
psoundType->getDfnName(dfnName);
if (dfnName == "simple_sound.dfn")
{
uint sampleRate, sampleSize, channels, size;
string filename;
char s[256];
psoundType->getValueByName(filename, "Filename");
if (SoundDialog->getFileInfo(filename, sampleRate, sampleSize, channels, size))
{
/* if (channels > 1)
{
::MessageBox(NULL, "3D sounds accept only mono files", _Name.c_str(), MB_OK);
}
*/
// _Name = _Name.c_str());
// SetWindowText((_Name.empty()) ? "Sound plugin" : _Name.c_str());
_Filename = filename.c_str();
_snprintf(s, 256, "%s / %d bits / %d Hz", (channels == 1)? "mono" : "stereo", sampleSize, sampleRate);
_AudioFormat = s;
_snprintf(s, 256, "%d kb", size / 1024);
_Filesize = s;
UpdateData(FALSE);
valid = true;
}
}
}
}
if (!valid)
{
// This is not a valid simple sound...
_AudioFormat = "";
_Filename = "";
_Filesize = "";
UpdateData(FALSE);
}
}
void CPageSimple::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CPageSimple)
DDX_Control(pDX, IDC_FILESIZE, _FilesizeCtrl);
DDX_Control(pDX, IDC_FILENAME, _FilenameCtrl);
DDX_Control(pDX, IDC_AUDIOFORMAT, _AudioFormatCtrl);
DDX_Text(pDX, IDC_AUDIOFORMAT, _AudioFormat);
DDX_Text(pDX, IDC_FILENAME, _Filename);
DDX_Text(pDX, IDC_FILESIZE, _Filesize);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CPageSimple, CPropertyPage)
//{{AFX_MSG_MAP(CPageSimple)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CPageSimple message handlers

@ -1,75 +1,75 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_PAGESIMPLE_H__21AC2079_9B99_4F63_AFC8_4DFF4930E31D__INCLUDED_)
#define AFX_PAGESIMPLE_H__21AC2079_9B99_4F63_AFC8_4DFF4930E31D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PageSimple.h : header file
//
#include "PageBase.h"
/////////////////////////////////////////////////////////////////////////////
// CPageSimple dialog
class CPageSimple : public CPageBase
{
DECLARE_DYNCREATE(CPageSimple)
void onDocChanged();
// Construction
public:
CPageSimple() {}
CPageSimple(NLGEORGES::CSoundDialog *soundDialog);
~CPageSimple();
// Dialog Data
//{{AFX_DATA(CPageSimple)
enum { IDD = IDD_PAGE_SIMPLE };
CStatic _FilesizeCtrl;
CStatic _FilenameCtrl;
CStatic _AudioFormatCtrl;
CString _AudioFormat;
CString _Filename;
CString _Filesize;
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CPageSimple)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CPageSimple)
// 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_PAGESIMPLE_H__21AC2079_9B99_4F63_AFC8_4DFF4930E31D__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_PAGESIMPLE_H__21AC2079_9B99_4F63_AFC8_4DFF4930E31D__INCLUDED_)
#define AFX_PAGESIMPLE_H__21AC2079_9B99_4F63_AFC8_4DFF4930E31D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// PageSimple.h : header file
//
#include "PageBase.h"
/////////////////////////////////////////////////////////////////////////////
// CPageSimple dialog
class CPageSimple : public CPageBase
{
DECLARE_DYNCREATE(CPageSimple)
void onDocChanged();
// Construction
public:
CPageSimple() {}
CPageSimple(NLGEORGES::CSoundDialog *soundDialog);
~CPageSimple();
// Dialog Data
//{{AFX_DATA(CPageSimple)
enum { IDD = IDD_PAGE_SIMPLE };
CStatic _FilesizeCtrl;
CStatic _FilenameCtrl;
CStatic _AudioFormatCtrl;
CString _AudioFormat;
CString _Filename;
CString _Filesize;
//}}AFX_DATA
// Overrides
// ClassWizard generate virtual function overrides
//{{AFX_VIRTUAL(CPageSimple)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CPageSimple)
// 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_PAGESIMPLE_H__21AC2079_9B99_4F63_AFC8_4DFF4930E31D__INCLUDED_)

@ -1,63 +1,63 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// georges_plugin_test.cpp : Defines the initialization routines for the DLL.
//
#include "std_sound_plugin.h"
#include "georges_plugin_sound.h"
#include "sound_plugin.h"
using namespace NLGEORGES;
using namespace std;
// ***************************************************************************
NLMISC::CLibraryContext *LibContext = NULL;
__declspec( dllexport ) IEditPlugin *IGeorgesEditGetInterface (int version, NLGEORGES::IEdit *globalInterface, NLMISC::INelContext &nelContext)
{
// init the library nel context
if (LibContext == NULL)
{
LibContext = new NLMISC::CLibraryContext(nelContext);
}
AFX_MANAGE_STATE(AfxGetStaticModuleState());
// Same version ?
if (version == NLGEORGES_PLUGIN_INTERFACE_VERSION)
{
try
{
return new CSoundPlugin(globalInterface);
}
catch (std::exception &e)
{
string reason = e.what();
MessageBox (NULL, reason.c_str(), "Sound plugin", MB_OK);
return NULL;
}
}
else
{
MessageBox (NULL, "Plugin version invalid.", "Sound plugin for georges editor", MB_OK|MB_ICONEXCLAMATION);
return NULL;
}
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// georges_plugin_test.cpp : Defines the initialization routines for the DLL.
//
#include "std_sound_plugin.h"
#include "georges_plugin_sound.h"
#include "sound_plugin.h"
using namespace NLGEORGES;
using namespace std;
// ***************************************************************************
NLMISC::CLibraryContext *LibContext = NULL;
__declspec( dllexport ) IEditPlugin *IGeorgesEditGetInterface (int version, NLGEORGES::IEdit *globalInterface, NLMISC::INelContext &nelContext)
{
// init the library nel context
if (LibContext == NULL)
{
LibContext = new NLMISC::CLibraryContext(nelContext);
}
AFX_MANAGE_STATE(AfxGetStaticModuleState());
// Same version ?
if (version == NLGEORGES_PLUGIN_INTERFACE_VERSION)
{
try
{
return new CSoundPlugin(globalInterface);
}
catch (std::exception &e)
{
string reason = e.what();
MessageBox (NULL, reason.c_str(), "Sound plugin", MB_OK);
return NULL;
}
}
else
{
MessageBox (NULL, "Plugin version invalid.", "Sound plugin for georges editor", MB_OK|MB_ICONEXCLAMATION);
return NULL;
}
}

@ -1,25 +1,25 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// georges_plugin_test.h : main header file for the GEORGES_PLUGIN_TEST DLL
//
#if !defined(AFX_GEORGES_PLUGIN_TEST_H__17C63138_6057_4288_99B4_D1158EE798CA__INCLUDED_)
#define AFX_GEORGES_PLUGIN_TEST_H__17C63138_6057_4288_99B4_D1158EE798CA__INCLUDED_
#endif // !defined(AFX_GEORGES_PLUGIN_TEST_H__17C63138_6057_4288_99B4_D1158EE798CA__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// georges_plugin_test.h : main header file for the GEORGES_PLUGIN_TEST DLL
//
#if !defined(AFX_GEORGES_PLUGIN_TEST_H__17C63138_6057_4288_99B4_D1158EE798CA__INCLUDED_)
#define AFX_GEORGES_PLUGIN_TEST_H__17C63138_6057_4288_99B4_D1158EE798CA__INCLUDED_
#endif // !defined(AFX_GEORGES_PLUGIN_TEST_H__17C63138_6057_4288_99B4_D1158EE798CA__INCLUDED_)

@ -1,315 +1,315 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "listener_view.h"
#include "sound_document_plugin.h"
#include "nel/misc/debug.h"
#include "nel/misc/path.h"
#include "nel/misc/vector.h"
#include <mmsystem.h>
#include <math.h>
using namespace std;
using namespace NLMISC;
namespace NLGEORGES
{
#undef new
IMPLEMENT_DYNCREATE(CListenerView, CView)
#define new NL_NEW
BEGIN_MESSAGE_MAP(CListenerView, CView)
//{{AFX_MSG_MAP(CListenerView)
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_MOUSEMOVE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
bool CListenerView::_Registered = false;
CString CListenerView::_WndClass;
uint CListenerView::_WndId = 0;
CFont CListenerView::_Font;
CBrush CListenerView::_InnerBrush;
CBrush CListenerView::_OuterBrush;
CBrush CListenerView::_ListenerBrush;
CPen CListenerView::_VolumeCurve;
// ***************************************************************************
bool CListenerView::registerClass()
{
if (_Registered)
{
return true;
}
try
{
LPCTSTR className = AfxRegisterWndClass(CS_VREDRAW | CS_HREDRAW, ::LoadCursor(NULL, IDC_ARROW), (HBRUSH) ::GetStockObject(WHITE_BRUSH));
_WndClass = className;
}
catch (CResourceException* e)
{
AfxMessageBox("Couldn't register class! (Already registered?)");
e->Delete();
return false;
}
_OuterBrush.CreateSolidBrush(RGB(255, 0, 0));
_InnerBrush.CreateSolidBrush(RGB(0, 255, 0));
_ListenerBrush.CreateSolidBrush(RGB(0, 0, 0));
_VolumeCurve.CreatePen(PS_SOLID, 1, RGB(255, 0, 128));
_Font.CreateFont(14, 0, 0, 0, FW_NORMAL, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, "Arial");
return true;
}
// ***************************************************************************
void CListenerView::init(CSoundPlugin* plugin, CRect& rect, CWnd* parent)
{
registerClass();
_Plugin = plugin;
_Listener.SetRect(-1, -1, -1, -1);
_Cones.SetRect(0, 0, 0, 0);
_OuterAngle = 360;
_InnerAngle = 360;
if (!Create((LPCTSTR) _WndClass, "Listener", WS_CHILD | WS_VISIBLE, rect, parent, ++_WndId))
{
throw exception("failed to create the listener view");
}
EnableWindow ();
ShowWindow(SW_SHOW);
}
// ***************************************************************************
void CListenerView::OnLButtonDown(UINT nFlags, CPoint point)
{
if (_Listener.PtInRect(point))
{
_DragOrigine = point;
_ListenerOrigine = _Listener.CenterPoint();
_Dragging = true;
}
}
// ***************************************************************************
void CListenerView::OnLButtonUp(UINT nFlags, CPoint point)
{
if (_Dragging)
{
_Dragging = false;
}
}
// ***************************************************************************
void CListenerView::OnMouseMove(UINT nFlags, CPoint point)
{
if (_Dragging)
{
CVector pos;
CPoint center = _ListenerOrigine + point - _DragOrigine;
CRect updateRect = _Listener;
_Listener.SetRect(center.x - 5, center.y - 5, center.x + 5, center.y + 5);
//updateRect |= _Listener;
//InvalidateRect(&updateRect);
Invalidate();
center = _Cones.CenterPoint();
CPoint listener = _Listener.CenterPoint();
CRect rect;
GetClientRect(&rect);
uint fullHeight = rect.bottom - center.y;
uint fullWidth = rect.right - center.x;
_X = _MaxDist * (listener.x - center.x) / fullHeight;
_Y = (_MaxDist * (listener.y - center.y) / fullHeight);
pos.set(_X, _Y, 0.0f);
//nldebug("position=(%.2f, %.2f)", _X, _Y);
_Plugin->setListenerPos(pos);
_Plugin->setListenerOrientation(CVector(0,1,0), CVector(0,0,1));
}
}
// ***************************************************************************
void CListenerView::OnDraw(CDC* dc)
{
CRect rect;
GetClientRect(&rect);
dc->Rectangle(rect);
// Initialize the position of the rectangle on the first call to draw
if (_Listener.top < 0)
{
CPoint c = rect.CenterPoint();
_Listener.SetRect(c.x - 5, rect.top + 25, c.x + 5, rect.top + 35);
_Cones.SetRect(c.x - 20, rect.top + 10, c.x + 20, rect.top + 50);
}
if (_Activated)
{
CPoint center = _Cones.CenterPoint();
CBrush *oldBrush = dc->SelectObject(&_OuterBrush);
double angle = NLMISC::Pi * (360.0 - _OuterAngle) / 2.0 / 180.0;
dc->Pie(_Cones,
CPoint((int) (center.x - 10.0 * sin(angle)), (int) (center.y - 10.0 * cos(angle))),
CPoint((int) (center.x + 10.0 * sin(angle)), (int) (center.y - 10.0 * cos(angle))));
dc->SelectObject(&_InnerBrush);
angle = NLMISC::Pi * (360.0 - _InnerAngle) / 2.0 / 180.0;
dc->Pie(_Cones,
CPoint((int) (center.x - 15.0 * sin(angle)), (int) (center.y - 15.0 * cos(angle))),
CPoint((int) (center.x + 15.0 * sin(angle)), (int) (center.y - 15.0 * cos(angle))));
dc->SelectObject(&_ListenerBrush);
//dc->Ellipse(_Listener);
CPoint pts[4];
pts[0].x = _Listener.left;
pts[0].y = _Listener.bottom;
pts[1].x = _Listener.right;
pts[1].y = _Listener.bottom;
pts[2].x = (_Listener.left + _Listener.right) / 2;
pts[2].y = _Listener.top;
pts[3].x = _Listener.left;
pts[3].y = _Listener.bottom;
dc->Polygon(pts, 4);
dc->SelectObject(oldBrush);
char s[256];
_snprintf(s, 256, "%.1f, %.1f", _X, _Y);
CFont* oldFont = dc->SelectObject(&_Font);
dc->DrawText(s, rect, DT_VCENTER | DT_SINGLELINE | DT_CENTER);
dc->SelectObject(oldFont);
CPen* oldPen = dc->SelectObject(&_VolumeCurve);
// Draw the volume curve
CPoint c = _Cones.CenterPoint();
uint fullHeight = rect.bottom - c.y;
uint fullWidth = rect.right - c.x;
// Draw the min distance
uint minDistHeight = (uint)(((float) fullHeight * _MinDist) / _MaxDist);
CPoint p = c;
dc->MoveTo(p);
p.y += minDistHeight;
dc->LineTo(p);
if (_ShowAlpha)
{
// calculate the curve in 10 intervals
double dx = (_MaxDist - _MinDist) / 100.0;
double x = _MinDist;
for (uint i = 0; i < 101; i++)
{
double y;
// linearly descending volume on a dB scale
double db1 = -100.0 * (x - _MinDist) / (_MaxDist - _MinDist);
if (_Alpha == 0.0)
{
y = db1;
}
else if (_Alpha > 0.0)
{
double amp2 = 0.0001 + 0.9999 * (_MaxDist - x) / (_MaxDist - _MinDist); // linear amp between 0.00001 and 1.0
double db2 = 20. * log10(amp2);
y = ((1.0 - _Alpha) * db1 + _Alpha * db2);
}
else if (_Alpha < 0.0)
{
double amp3 = _MinDist / x; // linear amplitude is 1/distance
double db3 = 20.0 * log10(amp3);
y = ((1.0 + _Alpha) * db1 - _Alpha * db3);
}
clamp(y, -100, 0);
p.x = c.x + (uint)(fullWidth * (y / -100.0));
p.y = c.y + (uint)(fullHeight * (x / _MaxDist));
dc->LineTo(p);
x += dx;
}
}
dc->SelectObject(oldPen);
}
}
#ifdef _DEBUG
// ***************************************************************************
void CListenerView::AssertValid() const
{
CView::AssertValid();
}
// ***************************************************************************
void CListenerView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
} // namespace NLGEORGES
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "listener_view.h"
#include "sound_document_plugin.h"
#include "nel/misc/debug.h"
#include "nel/misc/path.h"
#include "nel/misc/vector.h"
#include <mmsystem.h>
#include <math.h>
using namespace std;
using namespace NLMISC;
namespace NLGEORGES
{
#undef new
IMPLEMENT_DYNCREATE(CListenerView, CView)
#define new NL_NEW
BEGIN_MESSAGE_MAP(CListenerView, CView)
//{{AFX_MSG_MAP(CListenerView)
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_MOUSEMOVE()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
bool CListenerView::_Registered = false;
CString CListenerView::_WndClass;
uint CListenerView::_WndId = 0;
CFont CListenerView::_Font;
CBrush CListenerView::_InnerBrush;
CBrush CListenerView::_OuterBrush;
CBrush CListenerView::_ListenerBrush;
CPen CListenerView::_VolumeCurve;
// ***************************************************************************
bool CListenerView::registerClass()
{
if (_Registered)
{
return true;
}
try
{
LPCTSTR className = AfxRegisterWndClass(CS_VREDRAW | CS_HREDRAW, ::LoadCursor(NULL, IDC_ARROW), (HBRUSH) ::GetStockObject(WHITE_BRUSH));
_WndClass = className;
}
catch (CResourceException* e)
{
AfxMessageBox("Couldn't register class! (Already registered?)");
e->Delete();
return false;
}
_OuterBrush.CreateSolidBrush(RGB(255, 0, 0));
_InnerBrush.CreateSolidBrush(RGB(0, 255, 0));
_ListenerBrush.CreateSolidBrush(RGB(0, 0, 0));
_VolumeCurve.CreatePen(PS_SOLID, 1, RGB(255, 0, 128));
_Font.CreateFont(14, 0, 0, 0, FW_NORMAL, FALSE, FALSE, 0, ANSI_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS, "Arial");
return true;
}
// ***************************************************************************
void CListenerView::init(CSoundPlugin* plugin, CRect& rect, CWnd* parent)
{
registerClass();
_Plugin = plugin;
_Listener.SetRect(-1, -1, -1, -1);
_Cones.SetRect(0, 0, 0, 0);
_OuterAngle = 360;
_InnerAngle = 360;
if (!Create((LPCTSTR) _WndClass, "Listener", WS_CHILD | WS_VISIBLE, rect, parent, ++_WndId))
{
throw exception("failed to create the listener view");
}
EnableWindow ();
ShowWindow(SW_SHOW);
}
// ***************************************************************************
void CListenerView::OnLButtonDown(UINT nFlags, CPoint point)
{
if (_Listener.PtInRect(point))
{
_DragOrigine = point;
_ListenerOrigine = _Listener.CenterPoint();
_Dragging = true;
}
}
// ***************************************************************************
void CListenerView::OnLButtonUp(UINT nFlags, CPoint point)
{
if (_Dragging)
{
_Dragging = false;
}
}
// ***************************************************************************
void CListenerView::OnMouseMove(UINT nFlags, CPoint point)
{
if (_Dragging)
{
CVector pos;
CPoint center = _ListenerOrigine + point - _DragOrigine;
CRect updateRect = _Listener;
_Listener.SetRect(center.x - 5, center.y - 5, center.x + 5, center.y + 5);
//updateRect |= _Listener;
//InvalidateRect(&updateRect);
Invalidate();
center = _Cones.CenterPoint();
CPoint listener = _Listener.CenterPoint();
CRect rect;
GetClientRect(&rect);
uint fullHeight = rect.bottom - center.y;
uint fullWidth = rect.right - center.x;
_X = _MaxDist * (listener.x - center.x) / fullHeight;
_Y = (_MaxDist * (listener.y - center.y) / fullHeight);
pos.set(_X, _Y, 0.0f);
//nldebug("position=(%.2f, %.2f)", _X, _Y);
_Plugin->setListenerPos(pos);
_Plugin->setListenerOrientation(CVector(0,1,0), CVector(0,0,1));
}
}
// ***************************************************************************
void CListenerView::OnDraw(CDC* dc)
{
CRect rect;
GetClientRect(&rect);
dc->Rectangle(rect);
// Initialize the position of the rectangle on the first call to draw
if (_Listener.top < 0)
{
CPoint c = rect.CenterPoint();
_Listener.SetRect(c.x - 5, rect.top + 25, c.x + 5, rect.top + 35);
_Cones.SetRect(c.x - 20, rect.top + 10, c.x + 20, rect.top + 50);
}
if (_Activated)
{
CPoint center = _Cones.CenterPoint();
CBrush *oldBrush = dc->SelectObject(&_OuterBrush);
double angle = NLMISC::Pi * (360.0 - _OuterAngle) / 2.0 / 180.0;
dc->Pie(_Cones,
CPoint((int) (center.x - 10.0 * sin(angle)), (int) (center.y - 10.0 * cos(angle))),
CPoint((int) (center.x + 10.0 * sin(angle)), (int) (center.y - 10.0 * cos(angle))));
dc->SelectObject(&_InnerBrush);
angle = NLMISC::Pi * (360.0 - _InnerAngle) / 2.0 / 180.0;
dc->Pie(_Cones,
CPoint((int) (center.x - 15.0 * sin(angle)), (int) (center.y - 15.0 * cos(angle))),
CPoint((int) (center.x + 15.0 * sin(angle)), (int) (center.y - 15.0 * cos(angle))));
dc->SelectObject(&_ListenerBrush);
//dc->Ellipse(_Listener);
CPoint pts[4];
pts[0].x = _Listener.left;
pts[0].y = _Listener.bottom;
pts[1].x = _Listener.right;
pts[1].y = _Listener.bottom;
pts[2].x = (_Listener.left + _Listener.right) / 2;
pts[2].y = _Listener.top;
pts[3].x = _Listener.left;
pts[3].y = _Listener.bottom;
dc->Polygon(pts, 4);
dc->SelectObject(oldBrush);
char s[256];
_snprintf(s, 256, "%.1f, %.1f", _X, _Y);
CFont* oldFont = dc->SelectObject(&_Font);
dc->DrawText(s, rect, DT_VCENTER | DT_SINGLELINE | DT_CENTER);
dc->SelectObject(oldFont);
CPen* oldPen = dc->SelectObject(&_VolumeCurve);
// Draw the volume curve
CPoint c = _Cones.CenterPoint();
uint fullHeight = rect.bottom - c.y;
uint fullWidth = rect.right - c.x;
// Draw the min distance
uint minDistHeight = (uint)(((float) fullHeight * _MinDist) / _MaxDist);
CPoint p = c;
dc->MoveTo(p);
p.y += minDistHeight;
dc->LineTo(p);
if (_ShowAlpha)
{
// calculate the curve in 10 intervals
double dx = (_MaxDist - _MinDist) / 100.0;
double x = _MinDist;
for (uint i = 0; i < 101; i++)
{
double y;
// linearly descending volume on a dB scale
double db1 = -100.0 * (x - _MinDist) / (_MaxDist - _MinDist);
if (_Alpha == 0.0)
{
y = db1;
}
else if (_Alpha > 0.0)
{
double amp2 = 0.0001 + 0.9999 * (_MaxDist - x) / (_MaxDist - _MinDist); // linear amp between 0.00001 and 1.0
double db2 = 20. * log10(amp2);
y = ((1.0 - _Alpha) * db1 + _Alpha * db2);
}
else if (_Alpha < 0.0)
{
double amp3 = _MinDist / x; // linear amplitude is 1/distance
double db3 = 20.0 * log10(amp3);
y = ((1.0 + _Alpha) * db1 - _Alpha * db3);
}
clamp(y, -100, 0);
p.x = c.x + (uint)(fullWidth * (y / -100.0));
p.y = c.y + (uint)(fullHeight * (x / _MaxDist));
dc->LineTo(p);
x += dx;
}
}
dc->SelectObject(oldPen);
}
}
#ifdef _DEBUG
// ***************************************************************************
void CListenerView::AssertValid() const
{
CView::AssertValid();
}
// ***************************************************************************
void CListenerView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
} // namespace NLGEORGES

@ -1,113 +1,113 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef _NLGEORGES_LISTENER_VIEW_H
#define _NLGEORGES_LISTENER_VIEW_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "std_sound_plugin.h"
#include "../georges_dll/plugin_interface.h"
namespace NLGEORGES
{
class CSoundPlugin;
class CListenerView : public CView
{
public:
CListenerView() : CView(), _Dragging(false), _Activated(false), _X(0), _Y(0) {}
virtual ~CListenerView() {};
void init(CSoundPlugin* plugin, CRect& rect, CWnd* parent);
void setAngles(uint32 inner, uint32 outer) { _InnerAngle = inner; _OuterAngle = outer; Invalidate(); }
void setActive(bool active) { _Activated = active; Invalidate(); }
void setShowAlpha(bool showAlpha) { _ShowAlpha = showAlpha; Invalidate(); }
void setAlpha(double alpha) { _Alpha = alpha; Invalidate(); }
void setMinMaxDistances(float mindist, float maxdist) { _MinDist = mindist; _MaxDist = maxdist; Invalidate(); }
protected:
static bool registerClass();
static bool _Registered;
static CString _WndClass;
static uint _WndId;
static CFont _Font;
static CBrush _InnerBrush;
static CBrush _OuterBrush;
static CBrush _ListenerBrush;
static CPen _VolumeCurve;
CSoundPlugin *_Plugin;
CRect _Listener;
CRect _Cones;
uint32 _InnerAngle;
uint32 _OuterAngle;
bool _Dragging;
CPoint _DragOrigine;
CPoint _ListenerOrigine;
bool _Activated;
bool _ShowAlpha;
float _X;
float _Y;
float _MinDist;
float _MaxDist;
double _Alpha;
// MFC crap
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CListenerView)
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
//}}AFX_VIRTUAL
// Implementation
protected:
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
DECLARE_DYNCREATE(CListenerView)
// Generated message map functions
//{{AFX_MSG(CListenerView)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
} // namespace NLGEORGES
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // _NLGEORGES_LISTENER_VIEW_H
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef _NLGEORGES_LISTENER_VIEW_H
#define _NLGEORGES_LISTENER_VIEW_H
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "std_sound_plugin.h"
#include "../georges_dll/plugin_interface.h"
namespace NLGEORGES
{
class CSoundPlugin;
class CListenerView : public CView
{
public:
CListenerView() : CView(), _Dragging(false), _Activated(false), _X(0), _Y(0) {}
virtual ~CListenerView() {};
void init(CSoundPlugin* plugin, CRect& rect, CWnd* parent);
void setAngles(uint32 inner, uint32 outer) { _InnerAngle = inner; _OuterAngle = outer; Invalidate(); }
void setActive(bool active) { _Activated = active; Invalidate(); }
void setShowAlpha(bool showAlpha) { _ShowAlpha = showAlpha; Invalidate(); }
void setAlpha(double alpha) { _Alpha = alpha; Invalidate(); }
void setMinMaxDistances(float mindist, float maxdist) { _MinDist = mindist; _MaxDist = maxdist; Invalidate(); }
protected:
static bool registerClass();
static bool _Registered;
static CString _WndClass;
static uint _WndId;
static CFont _Font;
static CBrush _InnerBrush;
static CBrush _OuterBrush;
static CBrush _ListenerBrush;
static CPen _VolumeCurve;
CSoundPlugin *_Plugin;
CRect _Listener;
CRect _Cones;
uint32 _InnerAngle;
uint32 _OuterAngle;
bool _Dragging;
CPoint _DragOrigine;
CPoint _ListenerOrigine;
bool _Activated;
bool _ShowAlpha;
float _X;
float _Y;
float _MinDist;
float _MaxDist;
double _Alpha;
// MFC crap
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CListenerView)
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
//}}AFX_VIRTUAL
// Implementation
protected:
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
DECLARE_DYNCREATE(CListenerView)
// Generated message map functions
//{{AFX_MSG(CListenerView)
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
} // namespace NLGEORGES
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // _NLGEORGES_LISTENER_VIEW_H

@ -1,54 +1,54 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// LoadingDialog.cpp : implementation file
//
#include "std_sound_plugin.h"
#include "georges_plugin_sound.h"
#include "loading_dialog.h"
/////////////////////////////////////////////////////////////////////////////
// CLoadingDialog dialog
CLoadingDialog::CLoadingDialog(CWnd* pParent /*=NULL*/)
: CDialog(CLoadingDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CLoadingDialog)
Message = _T("");
//}}AFX_DATA_INIT
}
void CLoadingDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLoadingDialog)
DDX_Text(pDX, IDC_STATIC_MESSAGE, Message);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CLoadingDialog, CDialog)
//{{AFX_MSG_MAP(CLoadingDialog)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLoadingDialog message handlers
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// LoadingDialog.cpp : implementation file
//
#include "std_sound_plugin.h"
#include "georges_plugin_sound.h"
#include "loading_dialog.h"
/////////////////////////////////////////////////////////////////////////////
// CLoadingDialog dialog
CLoadingDialog::CLoadingDialog(CWnd* pParent /*=NULL*/)
: CDialog(CLoadingDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CLoadingDialog)
Message = _T("");
//}}AFX_DATA_INIT
}
void CLoadingDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CLoadingDialog)
DDX_Text(pDX, IDC_STATIC_MESSAGE, Message);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CLoadingDialog, CDialog)
//{{AFX_MSG_MAP(CLoadingDialog)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLoadingDialog message handlers

@ -1,62 +1,62 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_LOADINGDIALOG_H__0E1DE2CA_958F_4A0D_BE90_9264F6DB6F5C__INCLUDED_)
#define AFX_LOADINGDIALOG_H__0E1DE2CA_958F_4A0D_BE90_9264F6DB6F5C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// LoadingDialog.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CLoadingDialog dialog
class CLoadingDialog : public CDialog
{
// Construction
public:
CLoadingDialog(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CLoadingDialog)
enum { IDD = IDD_DIALOG_LOADING };
CString Message;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CLoadingDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CLoadingDialog)
// 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_LOADINGDIALOG_H__0E1DE2CA_958F_4A0D_BE90_9264F6DB6F5C__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_LOADINGDIALOG_H__0E1DE2CA_958F_4A0D_BE90_9264F6DB6F5C__INCLUDED_)
#define AFX_LOADINGDIALOG_H__0E1DE2CA_958F_4A0D_BE90_9264F6DB6F5C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// LoadingDialog.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CLoadingDialog dialog
class CLoadingDialog : public CDialog
{
// Construction
public:
CLoadingDialog(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CLoadingDialog)
enum { IDD = IDD_DIALOG_LOADING };
CString Message;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CLoadingDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CLoadingDialog)
// 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_LOADINGDIALOG_H__0E1DE2CA_958F_4A0D_BE90_9264F6DB6F5C__INCLUDED_)

@ -1,295 +1,295 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by georges_plugin_sound.rc
//
#define IDC_MESSAGE 1000
#define IDD_TEST_GLOBAL 1001
#define IDD_TEST_LOCAL 1002
#define IDC_FILEINFO 1003
#define IDC_FILENAME 1004
#define IDC_FILEFORMAT 1005
#define IDC_SOUNDFORMAT 1006
#define IDC_NAME 1007
#define IDB_START 1008
#define IDC_CONTROL 1009
#define IDB_STOP 1010
#define IDC_NEW 1011
#define IDC_FORMAT_LABEL 1012
#define IDC_SIZE_LABEL 1013
#define IDB_DESACTIVATED 1014
#define IDC_FILE_LABEL 1015
#define IDD_PAGE_CONTEXT 1015
#define IDC_AUDIOFORMAT 1016
#define IDD_PAGE_COMPLEX 1016
#define IDB_NEW 1017
#define IDD_PAGE_POSITION 1017
#define IDC_FILESIZE 1018
#define IDD_PAGE_SIMPLE 1018
#define IDC_NAME_LABEL 1019
#define IDD_PAGE_BG_FADES 1019
#define IDC_TIME 1020
#define IDD_DIALOG_LOADING 1021
#define IDC_DURATION 1022
#define IDD_CONTEXT_SOUND_PARAM 1023
#define IDC_DIVIDER 1024
#define IDB_CONTEXT 1025
#define IDD_DIALOG_BG_FLAGS_2 1026
#define IDD_PAGE_BG_FLAGS 1026
#define IDC_SPIN1 1027
#define IDC_ZOOM 1028
#define IDC_EDIT_SEQ_SIZE 1029
#define IDC_SPIN2 1030
#define IDC_BTN_RANDOM_SOUND 1031
#define IDC_SPIN3 1032
#define IDC_EDIT_MIN_DELAY 1033
#define IDC_SPIN4 1034
#define IDC_EDIT_MAX_DELAY 1035
#define IDC_SPIN5 1036
#define IDC_BTN_RANDOM_DELAY 1037
#define IDC_SPIN6 1038
#define IDC_FILTER_00 1039
#define IDC_SPIN7 1040
#define IDC_FILTER_16 1040
#define IDC_FILTER_01 1041
#define IDC_SPIN8 1042
#define IDC_FILTER_17 1042
#define IDC_FILTER_02 1043
#define IDC_SPIN9 1044
#define IDC_FILTER_18 1044
#define IDC_FILTER_03 1045
#define IDC_SPIN10 1046
#define IDC_FILTER_19 1046
#define IDC_FILTER_04 1047
#define IDC_FILTER_20 1048
#define IDC_FILTER_05 1049
#define IDC_FILTER_06 1050
#define IDC_FILTER_07 1051
#define IDC_FILTER_08 1052
#define IDC_FILTER_09 1053
#define IDC_FILTER_10 1054
#define IDC_FILTER_11 1055
#define IDC_FILTER_12 1056
#define IDC_FILTER_13 1057
#define IDC_FILTER_14 1058
#define IDC_FILTER_15 1059
#define IDC_ENV_FLAG_00 1060
#define IDC_ENV_FLAG_01 1061
#define IDC_ENV_FLAG_02 1062
#define IDC_ENV_FLAG_03 1063
#define IDC_ENV_FLAG_04 1064
#define IDC_ENV_FLAG_05 1065
#define IDC_ENV_FLAG_06 1066
#define IDC_ENV_FLAG_07 1067
#define IDC_ENV_FLAG_08 1068
#define IDC_ENV_FLAG_09 1069
#define IDC_ENV_FLAG_10 1070
#define IDC_ENV_FLAG_11 1071
#define IDC_ENV_FLAG_12 1072
#define IDC_ENV_FLAG_13 1073
#define IDC_ENV_FLAG_14 1074
#define IDC_ENV_FLAG_15 1075
#define IDC_FILTER_NAME_00 1076
#define IDC_FILTER_NAME_01 1077
#define IDC_STATIC_MESSAGE 1078
#define IDC_FILTER_21 1078
#define IDC_FILTER_NAME_02 1079
#define IDC_BUTTON_RELOAD_SAMPLES 1080
#define IDC_FILTER_22 1080
#define IDC_FILTER_NAME_03 1081
#define IDC_FILTER_NAME_04 1082
#define IDC_FILTER_NAME_05 1083
#define IDC_FILTER_NAME_06 1084
#define IDC_BUTTON_RELOAD_SOUND_BANKS 1085
#define IDC_FILTER_23 1085
#define IDC_FILTER_NAME_07 1086
#define IDC_FILTER_NAME_08 1087
#define IDC_FILTER_NAME_09 1088
#define IDC_FILTER_NAME_10 1089
#define IDC_FILTER_NAME_11 1090
#define IDC_FILTER_NAME_12 1091
#define IDC_FILTER_NAME_13 1092
#define IDC_FILTER_NAME_14 1093
#define IDC_FILTER_NAME_15 1094
#define IDC_ENV_NAME_00 1095
#define IDC_ENV_NAME_01 1096
#define IDC_ENV_NAME_02 1097
#define IDC_ENV_NAME_03 1098
#define IDC_ENV_NAME_04 1099
#define IDC_ENV_NAME_05 1100
#define IDC_ENV_NAME_06 1101
#define IDC_ENV_NAME_07 1102
#define IDC_ENV_NAME_08 1103
#define IDC_ENV_NAME_09 1104
#define IDC_ENV_NAME_10 1105
#define IDC_ENV_NAME_11 1106
#define IDC_ENV_NAME_12 1107
#define IDC_ENV_NAME_13 1108
#define IDC_ENV_NAME_14 1109
#define IDC_ENV_NAME_15 1110
#define IDC_EDIT_ARG_6 1110
#define IDC_STATIC_SOUND_FILTER 1111
#define IDC_FILTER_24 1111
#define IDC_EDIT_ARG_0 1112
#define IDC_FILTER_25 1112
#define IDC_EDIT_ARG_1 1113
#define IDC_FILTER_26 1113
#define IDC_CHECK_CONTEXT_ARG 1114
#define IDC_FILTER_27 1114
#define IDC_EDIT_ARG_2 1115
#define IDC_FILTER_28 1115
#define IDC_TAB1 1116
#define IDC_FILTER_29 1116
#define IDC_EDIT_ARG_3 1117
#define IDC_FILTER_30 1117
#define IDC_EDIT_ARG_4 1118
#define IDC_FILTER_31 1118
#define IDC_EDIT_ARG_5 1119
#define IDC_FILTER_NAME_16 1119
#define IDC_FILTER_NAME_17 1120
#define IDC_EDIT_ARG_7 1121
#define IDC_FILTER_NAME_18 1121
#define IDC_EDIT_ARG_8 1122
#define IDC_FILTER_NAME_19 1122
#define IDC_EDIT_ARG_9 1123
#define IDC_FILTER_NAME_20 1123
#define IDC_FILTER_NAME_21 1124
#define IDC_FILTER_NAME_22 1125
#define IDC_FILTER_NAME_23 1126
#define IDC_FILTER_NAME_24 1127
#define IDC_FILTER_NAME_25 1128
#define IDC_FILTER_NAME_26 1129
#define IDC_FILTER_NAME_27 1130
#define IDC_FILTER_NAME_28 1131
#define IDC_FILTER_NAME_29 1132
#define IDC_FILTER_NAME_30 1133
#define IDC_FILTER_NAME_31 1134
#define IDC_ENV_FLAG_16 1135
#define IDC_ENV_FLAG_17 1136
#define IDC_ENV_FLAG_18 1137
#define IDC_ENV_FLAG_19 1138
#define IDC_ENV_FLAG_20 1139
#define IDC_ENV_FLAG_21 1140
#define IDC_ENV_FLAG_22 1141
#define IDC_ENV_FLAG_23 1142
#define IDC_ENV_FLAG_24 1143
#define IDC_ENV_FLAG_25 1144
#define IDC_ENV_FLAG_26 1145
#define IDC_ENV_FLAG_27 1146
#define IDC_ENV_FLAG_28 1147
#define IDC_ENV_FLAG_29 1148
#define IDC_ENV_FLAG_30 1149
#define IDC_ENV_FLAG_31 1150
#define IDC_ENV_NAME_16 1151
#define IDC_ENV_NAME_17 1152
#define IDC_ENV_NAME_18 1153
#define IDC_ENV_NAME_19 1154
#define IDC_ENV_NAME_20 1155
#define IDC_ENV_NAME_21 1156
#define IDC_ENV_NAME_22 1157
#define IDC_ENV_NAME_23 1158
#define IDC_ENV_NAME_24 1159
#define IDC_ENV_NAME_25 1160
#define IDC_ENV_NAME_26 1161
#define IDC_ENV_NAME_27 1162
#define IDC_ENV_NAME_28 1163
#define IDC_ENV_NAME_29 1164
#define IDC_ENV_NAME_30 1165
#define IDC_ENV_NAME_31 1166
#define IDC_BTN_EDIT_ALL_ON 1167
#define IDC_BTN_EDIT_ALL_OFF 1168
#define IDC_BTN_ENV_ALL_ON 1169
#define IDC_BTN_ENV_ALL_OFF 1170
#define IDC_SHEET_POS 1170
#define IDC_FADE_IN_00 1171
#define IDC_FADE_OUT_00 1172
#define IDC_FADE_IN_08 1173
#define IDC_FADE_OUT_08 1174
#define IDC_FADE_IN_16 1175
#define IDC_FADE_OUT_16 1176
#define IDC_FADE_IN_01 1177
#define IDC_FADE_OUT_01 1178
#define IDC_FADE_IN_17 1179
#define IDC_FADE_OUT_17 1180
#define IDC_FADE_IN_02 1181
#define IDC_FADE_OUT_02 1182
#define IDC_FADE_IN_18 1183
#define IDC_FADE_OUT_18 1184
#define IDC_FADE_IN_03 1185
#define IDC_FADE_OUT_03 1186
#define IDC_FADE_IN_19 1187
#define IDC_FADE_OUT_19 1188
#define IDC_FADE_IN_04 1189
#define IDC_FADE_OUT_04 1190
#define IDC_FADE_IN_20 1191
#define IDC_FADE_OUT_20 1192
#define IDC_FADE_IN_05 1193
#define IDC_FADE_OUT_05 1194
#define IDC_FADE_IN_21 1195
#define IDC_FADE_OUT_21 1196
#define IDC_FADE_IN_06 1197
#define IDC_FADE_OUT_06 1198
#define IDC_FADE_IN_22 1199
#define IDC_FADE_OUT_22 1200
#define IDC_FADE_IN_07 1201
#define IDC_FADE_OUT_07 1202
#define IDC_FADE_IN_23 1203
#define IDC_FADE_OUT_23 1204
#define IDC_FADE_IN_24 1205
#define IDC_FADE_OUT_24 1206
#define IDC_FADE_IN_09 1207
#define IDC_FADE_OUT_09 1208
#define IDC_FADE_IN_25 1209
#define IDC_FADE_OUT_25 1210
#define IDC_FADE_IN_10 1211
#define IDC_FADE_OUT_10 1212
#define IDC_FADE_IN_26 1213
#define IDC_FADE_OUT_26 1214
#define IDC_FADE_IN_11 1215
#define IDC_FADE_OUT_11 1216
#define IDC_FADE_IN_27 1217
#define IDC_FADE_OUT_27 1218
#define IDC_FADE_IN_12 1219
#define IDC_FADE_OUT_12 1220
#define IDC_FADE_IN_28 1221
#define IDC_FADE_OUT_28 1222
#define IDC_FADE_IN_13 1223
#define IDC_FADE_OUT_13 1224
#define IDC_FADE_IN_29 1225
#define IDC_FADE_OUT_29 1226
#define IDC_FADE_IN_14 1227
#define IDC_FADE_OUT_14 1228
#define IDC_FADE_IN_30 1229
#define IDC_FADE_OUT_30 1230
#define IDC_FADE_IN_15 1231
#define IDC_FADE_OUT_15 1232
#define IDC_FADE_IN_31 1233
#define IDC_FADE_OUT_31 1234
#define IDC_PSEUDO_PICTURE 1244
#define IDC_SUB_SOUND_NAME 1245
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 1021
#define _APS_NEXT_COMMAND_VALUE 32773
#define _APS_NEXT_CONTROL_VALUE 1246
#define _APS_NEXT_SYMED_VALUE 1000
#endif
#endif
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by georges_plugin_sound.rc
//
#define IDC_MESSAGE 1000
#define IDD_TEST_GLOBAL 1001
#define IDD_TEST_LOCAL 1002
#define IDC_FILEINFO 1003
#define IDC_FILENAME 1004
#define IDC_FILEFORMAT 1005
#define IDC_SOUNDFORMAT 1006
#define IDC_NAME 1007
#define IDB_START 1008
#define IDC_CONTROL 1009
#define IDB_STOP 1010
#define IDC_NEW 1011
#define IDC_FORMAT_LABEL 1012
#define IDC_SIZE_LABEL 1013
#define IDB_DESACTIVATED 1014
#define IDC_FILE_LABEL 1015
#define IDD_PAGE_CONTEXT 1015
#define IDC_AUDIOFORMAT 1016
#define IDD_PAGE_COMPLEX 1016
#define IDB_NEW 1017
#define IDD_PAGE_POSITION 1017
#define IDC_FILESIZE 1018
#define IDD_PAGE_SIMPLE 1018
#define IDC_NAME_LABEL 1019
#define IDD_PAGE_BG_FADES 1019
#define IDC_TIME 1020
#define IDD_DIALOG_LOADING 1021
#define IDC_DURATION 1022
#define IDD_CONTEXT_SOUND_PARAM 1023
#define IDC_DIVIDER 1024
#define IDB_CONTEXT 1025
#define IDD_DIALOG_BG_FLAGS_2 1026
#define IDD_PAGE_BG_FLAGS 1026
#define IDC_SPIN1 1027
#define IDC_ZOOM 1028
#define IDC_EDIT_SEQ_SIZE 1029
#define IDC_SPIN2 1030
#define IDC_BTN_RANDOM_SOUND 1031
#define IDC_SPIN3 1032
#define IDC_EDIT_MIN_DELAY 1033
#define IDC_SPIN4 1034
#define IDC_EDIT_MAX_DELAY 1035
#define IDC_SPIN5 1036
#define IDC_BTN_RANDOM_DELAY 1037
#define IDC_SPIN6 1038
#define IDC_FILTER_00 1039
#define IDC_SPIN7 1040
#define IDC_FILTER_16 1040
#define IDC_FILTER_01 1041
#define IDC_SPIN8 1042
#define IDC_FILTER_17 1042
#define IDC_FILTER_02 1043
#define IDC_SPIN9 1044
#define IDC_FILTER_18 1044
#define IDC_FILTER_03 1045
#define IDC_SPIN10 1046
#define IDC_FILTER_19 1046
#define IDC_FILTER_04 1047
#define IDC_FILTER_20 1048
#define IDC_FILTER_05 1049
#define IDC_FILTER_06 1050
#define IDC_FILTER_07 1051
#define IDC_FILTER_08 1052
#define IDC_FILTER_09 1053
#define IDC_FILTER_10 1054
#define IDC_FILTER_11 1055
#define IDC_FILTER_12 1056
#define IDC_FILTER_13 1057
#define IDC_FILTER_14 1058
#define IDC_FILTER_15 1059
#define IDC_ENV_FLAG_00 1060
#define IDC_ENV_FLAG_01 1061
#define IDC_ENV_FLAG_02 1062
#define IDC_ENV_FLAG_03 1063
#define IDC_ENV_FLAG_04 1064
#define IDC_ENV_FLAG_05 1065
#define IDC_ENV_FLAG_06 1066
#define IDC_ENV_FLAG_07 1067
#define IDC_ENV_FLAG_08 1068
#define IDC_ENV_FLAG_09 1069
#define IDC_ENV_FLAG_10 1070
#define IDC_ENV_FLAG_11 1071
#define IDC_ENV_FLAG_12 1072
#define IDC_ENV_FLAG_13 1073
#define IDC_ENV_FLAG_14 1074
#define IDC_ENV_FLAG_15 1075
#define IDC_FILTER_NAME_00 1076
#define IDC_FILTER_NAME_01 1077
#define IDC_STATIC_MESSAGE 1078
#define IDC_FILTER_21 1078
#define IDC_FILTER_NAME_02 1079
#define IDC_BUTTON_RELOAD_SAMPLES 1080
#define IDC_FILTER_22 1080
#define IDC_FILTER_NAME_03 1081
#define IDC_FILTER_NAME_04 1082
#define IDC_FILTER_NAME_05 1083
#define IDC_FILTER_NAME_06 1084
#define IDC_BUTTON_RELOAD_SOUND_BANKS 1085
#define IDC_FILTER_23 1085
#define IDC_FILTER_NAME_07 1086
#define IDC_FILTER_NAME_08 1087
#define IDC_FILTER_NAME_09 1088
#define IDC_FILTER_NAME_10 1089
#define IDC_FILTER_NAME_11 1090
#define IDC_FILTER_NAME_12 1091
#define IDC_FILTER_NAME_13 1092
#define IDC_FILTER_NAME_14 1093
#define IDC_FILTER_NAME_15 1094
#define IDC_ENV_NAME_00 1095
#define IDC_ENV_NAME_01 1096
#define IDC_ENV_NAME_02 1097
#define IDC_ENV_NAME_03 1098
#define IDC_ENV_NAME_04 1099
#define IDC_ENV_NAME_05 1100
#define IDC_ENV_NAME_06 1101
#define IDC_ENV_NAME_07 1102
#define IDC_ENV_NAME_08 1103
#define IDC_ENV_NAME_09 1104
#define IDC_ENV_NAME_10 1105
#define IDC_ENV_NAME_11 1106
#define IDC_ENV_NAME_12 1107
#define IDC_ENV_NAME_13 1108
#define IDC_ENV_NAME_14 1109
#define IDC_ENV_NAME_15 1110
#define IDC_EDIT_ARG_6 1110
#define IDC_STATIC_SOUND_FILTER 1111
#define IDC_FILTER_24 1111
#define IDC_EDIT_ARG_0 1112
#define IDC_FILTER_25 1112
#define IDC_EDIT_ARG_1 1113
#define IDC_FILTER_26 1113
#define IDC_CHECK_CONTEXT_ARG 1114
#define IDC_FILTER_27 1114
#define IDC_EDIT_ARG_2 1115
#define IDC_FILTER_28 1115
#define IDC_TAB1 1116
#define IDC_FILTER_29 1116
#define IDC_EDIT_ARG_3 1117
#define IDC_FILTER_30 1117
#define IDC_EDIT_ARG_4 1118
#define IDC_FILTER_31 1118
#define IDC_EDIT_ARG_5 1119
#define IDC_FILTER_NAME_16 1119
#define IDC_FILTER_NAME_17 1120
#define IDC_EDIT_ARG_7 1121
#define IDC_FILTER_NAME_18 1121
#define IDC_EDIT_ARG_8 1122
#define IDC_FILTER_NAME_19 1122
#define IDC_EDIT_ARG_9 1123
#define IDC_FILTER_NAME_20 1123
#define IDC_FILTER_NAME_21 1124
#define IDC_FILTER_NAME_22 1125
#define IDC_FILTER_NAME_23 1126
#define IDC_FILTER_NAME_24 1127
#define IDC_FILTER_NAME_25 1128
#define IDC_FILTER_NAME_26 1129
#define IDC_FILTER_NAME_27 1130
#define IDC_FILTER_NAME_28 1131
#define IDC_FILTER_NAME_29 1132
#define IDC_FILTER_NAME_30 1133
#define IDC_FILTER_NAME_31 1134
#define IDC_ENV_FLAG_16 1135
#define IDC_ENV_FLAG_17 1136
#define IDC_ENV_FLAG_18 1137
#define IDC_ENV_FLAG_19 1138
#define IDC_ENV_FLAG_20 1139
#define IDC_ENV_FLAG_21 1140
#define IDC_ENV_FLAG_22 1141
#define IDC_ENV_FLAG_23 1142
#define IDC_ENV_FLAG_24 1143
#define IDC_ENV_FLAG_25 1144
#define IDC_ENV_FLAG_26 1145
#define IDC_ENV_FLAG_27 1146
#define IDC_ENV_FLAG_28 1147
#define IDC_ENV_FLAG_29 1148
#define IDC_ENV_FLAG_30 1149
#define IDC_ENV_FLAG_31 1150
#define IDC_ENV_NAME_16 1151
#define IDC_ENV_NAME_17 1152
#define IDC_ENV_NAME_18 1153
#define IDC_ENV_NAME_19 1154
#define IDC_ENV_NAME_20 1155
#define IDC_ENV_NAME_21 1156
#define IDC_ENV_NAME_22 1157
#define IDC_ENV_NAME_23 1158
#define IDC_ENV_NAME_24 1159
#define IDC_ENV_NAME_25 1160
#define IDC_ENV_NAME_26 1161
#define IDC_ENV_NAME_27 1162
#define IDC_ENV_NAME_28 1163
#define IDC_ENV_NAME_29 1164
#define IDC_ENV_NAME_30 1165
#define IDC_ENV_NAME_31 1166
#define IDC_BTN_EDIT_ALL_ON 1167
#define IDC_BTN_EDIT_ALL_OFF 1168
#define IDC_BTN_ENV_ALL_ON 1169
#define IDC_BTN_ENV_ALL_OFF 1170
#define IDC_SHEET_POS 1170
#define IDC_FADE_IN_00 1171
#define IDC_FADE_OUT_00 1172
#define IDC_FADE_IN_08 1173
#define IDC_FADE_OUT_08 1174
#define IDC_FADE_IN_16 1175
#define IDC_FADE_OUT_16 1176
#define IDC_FADE_IN_01 1177
#define IDC_FADE_OUT_01 1178
#define IDC_FADE_IN_17 1179
#define IDC_FADE_OUT_17 1180
#define IDC_FADE_IN_02 1181
#define IDC_FADE_OUT_02 1182
#define IDC_FADE_IN_18 1183
#define IDC_FADE_OUT_18 1184
#define IDC_FADE_IN_03 1185
#define IDC_FADE_OUT_03 1186
#define IDC_FADE_IN_19 1187
#define IDC_FADE_OUT_19 1188
#define IDC_FADE_IN_04 1189
#define IDC_FADE_OUT_04 1190
#define IDC_FADE_IN_20 1191
#define IDC_FADE_OUT_20 1192
#define IDC_FADE_IN_05 1193
#define IDC_FADE_OUT_05 1194
#define IDC_FADE_IN_21 1195
#define IDC_FADE_OUT_21 1196
#define IDC_FADE_IN_06 1197
#define IDC_FADE_OUT_06 1198
#define IDC_FADE_IN_22 1199
#define IDC_FADE_OUT_22 1200
#define IDC_FADE_IN_07 1201
#define IDC_FADE_OUT_07 1202
#define IDC_FADE_IN_23 1203
#define IDC_FADE_OUT_23 1204
#define IDC_FADE_IN_24 1205
#define IDC_FADE_OUT_24 1206
#define IDC_FADE_IN_09 1207
#define IDC_FADE_OUT_09 1208
#define IDC_FADE_IN_25 1209
#define IDC_FADE_OUT_25 1210
#define IDC_FADE_IN_10 1211
#define IDC_FADE_OUT_10 1212
#define IDC_FADE_IN_26 1213
#define IDC_FADE_OUT_26 1214
#define IDC_FADE_IN_11 1215
#define IDC_FADE_OUT_11 1216
#define IDC_FADE_IN_27 1217
#define IDC_FADE_OUT_27 1218
#define IDC_FADE_IN_12 1219
#define IDC_FADE_OUT_12 1220
#define IDC_FADE_IN_28 1221
#define IDC_FADE_OUT_28 1222
#define IDC_FADE_IN_13 1223
#define IDC_FADE_OUT_13 1224
#define IDC_FADE_IN_29 1225
#define IDC_FADE_OUT_29 1226
#define IDC_FADE_IN_14 1227
#define IDC_FADE_OUT_14 1228
#define IDC_FADE_IN_30 1229
#define IDC_FADE_OUT_30 1230
#define IDC_FADE_IN_15 1231
#define IDC_FADE_OUT_15 1232
#define IDC_FADE_IN_31 1233
#define IDC_FADE_OUT_31 1234
#define IDC_PSEUDO_PICTURE 1244
#define IDC_SUB_SOUND_NAME 1245
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 1021
#define _APS_NEXT_COMMAND_VALUE 32773
#define _APS_NEXT_CONTROL_VALUE 1246
#define _APS_NEXT_SYMED_VALUE 1000
#endif
#endif

@ -1,144 +1,144 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef _NLGEORGES_SOUND_DIALOG_H
#define _NLGEORGES_SOUND_DIALOG_H
#include <afxcmn.h>
#include "std_sound_plugin.h"
#include "listener_view.h"
#include "nel/sound/u_audio_mixer.h"
#include "../georges_dll/plugin_interface.h"
class CPageBase;
class CPagePosition;
class CPageSimple;
class CPageComplex;
class CPageComtext;
class CPageBgFlags;
class CPageBgFades;
namespace NLGEORGES
{
class CSoundPlugin;
class CListenerView;
class CSoundDialog : public CDialog
{
public:
CSoundDialog();
virtual ~CSoundDialog();
// Dialog Data
//{{AFX_DATA(CSoundDialog)
enum { IDD = IDD_TEST_LOCAL };
CStatic _SheetPos;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSoundDialog)
//}}AFX_VIRTUAL
void init(CSoundPlugin* plugin, HWND documentView);
void setName(std::string& name) { _Name = name; updateInfo(); }
void setFilename(std::string& filename) { _Filename = filename; updateInfo(); }
void setAngles(uint32 inner, uint32 outer) { _InnerAngle = inner; _OuterAngle = outer; updateAngles(); updateInfo();}
void setPlaying(bool playing);
void setAlpha(double alpha) {/* _ListenerView->setAlpha(alpha); */}
void setMinMaxDistances(float mindist, float maxdist) { /*_ListenerView->setMinMaxDistances(mindist, maxdist);*/ updateInfo();}
void setDuration(uint32 msec);
void DoDataExchange(CDataExchange *pDX);
void fillContextArgs(NLSOUND::CSoundContext *context);
CSoundPlugin *getSoundPlugin() {return _Plugin;};
bool getFileInfo(std::string& filename, uint& sampleRate, uint& sampleSize, uint& channels, uint& size);
private:
void updateInfo();
void updateButton();
void updateTime();
void displayTime(uint32 msec);
void updateAngles();
CSoundPlugin *_Plugin;
// CListenerView *_ListenerView;
std::string _Name;
std::string _Filename;
bool _Playing;
UINT _Timer;
uint32 _InnerAngle;
uint32 _OuterAngle;
uint32 _Duration;
uint32 _BackgroundIndex;
NLSOUND::UAudioMixer::TBackgroundFlags _BackgroundFlags;
// The property sheet page
CPagePosition *_PagePosition;
CPageSimple *_PageSimple;
CPageComplex *_PageComplex;
CPageComtext *_PageComtext;
CPageBgFlags *_PageBgFlags;
CPageBgFades *_PageBgFades;
struct TEnvName
{
std::string ShortName;
std::string Name;
};
public:
std::vector<TEnvName> EnvNames;
NLSOUND::UAudioMixer::TBackgroundFilterFades FilterFades;
private:
static CBitmap _StopBitmap;
static CBitmap _StartBitmap;
static CBitmap _DesactivatedBitmap;
static CBitmap _NewBitmap;
static CBitmap _ContextBitmap;
static CPen _Red;
// Generated message map functions
//{{AFX_MSG(CSoundDialog)
afx_msg void OnTimer(UINT id);
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnControlPlayback();
afx_msg void OnZoom(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnReloadSamples();
virtual BOOL OnInitDialog();
afx_msg void OnDestroy();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
} // namespace NLGEORGES
#endif // _NLGEORGES_SOUND_DIALOG_H
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef _NLGEORGES_SOUND_DIALOG_H
#define _NLGEORGES_SOUND_DIALOG_H
#include <afxcmn.h>
#include "std_sound_plugin.h"
#include "listener_view.h"
#include "nel/sound/u_audio_mixer.h"
#include "../georges_dll/plugin_interface.h"
class CPageBase;
class CPagePosition;
class CPageSimple;
class CPageComplex;
class CPageComtext;
class CPageBgFlags;
class CPageBgFades;
namespace NLGEORGES
{
class CSoundPlugin;
class CListenerView;
class CSoundDialog : public CDialog
{
public:
CSoundDialog();
virtual ~CSoundDialog();
// Dialog Data
//{{AFX_DATA(CSoundDialog)
enum { IDD = IDD_TEST_LOCAL };
CStatic _SheetPos;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSoundDialog)
//}}AFX_VIRTUAL
void init(CSoundPlugin* plugin, HWND documentView);
void setName(std::string& name) { _Name = name; updateInfo(); }
void setFilename(std::string& filename) { _Filename = filename; updateInfo(); }
void setAngles(uint32 inner, uint32 outer) { _InnerAngle = inner; _OuterAngle = outer; updateAngles(); updateInfo();}
void setPlaying(bool playing);
void setAlpha(double alpha) {/* _ListenerView->setAlpha(alpha); */}
void setMinMaxDistances(float mindist, float maxdist) { /*_ListenerView->setMinMaxDistances(mindist, maxdist);*/ updateInfo();}
void setDuration(uint32 msec);
void DoDataExchange(CDataExchange *pDX);
void fillContextArgs(NLSOUND::CSoundContext *context);
CSoundPlugin *getSoundPlugin() {return _Plugin;};
bool getFileInfo(std::string& filename, uint& sampleRate, uint& sampleSize, uint& channels, uint& size);
private:
void updateInfo();
void updateButton();
void updateTime();
void displayTime(uint32 msec);
void updateAngles();
CSoundPlugin *_Plugin;
// CListenerView *_ListenerView;
std::string _Name;
std::string _Filename;
bool _Playing;
UINT _Timer;
uint32 _InnerAngle;
uint32 _OuterAngle;
uint32 _Duration;
uint32 _BackgroundIndex;
NLSOUND::UAudioMixer::TBackgroundFlags _BackgroundFlags;
// The property sheet page
CPagePosition *_PagePosition;
CPageSimple *_PageSimple;
CPageComplex *_PageComplex;
CPageComtext *_PageComtext;
CPageBgFlags *_PageBgFlags;
CPageBgFades *_PageBgFades;
struct TEnvName
{
std::string ShortName;
std::string Name;
};
public:
std::vector<TEnvName> EnvNames;
NLSOUND::UAudioMixer::TBackgroundFilterFades FilterFades;
private:
static CBitmap _StopBitmap;
static CBitmap _StartBitmap;
static CBitmap _DesactivatedBitmap;
static CBitmap _NewBitmap;
static CBitmap _ContextBitmap;
static CPen _Red;
// Generated message map functions
//{{AFX_MSG(CSoundDialog)
afx_msg void OnTimer(UINT id);
afx_msg void OnKeyUp(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnControlPlayback();
afx_msg void OnZoom(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnReloadSamples();
virtual BOOL OnInitDialog();
afx_msg void OnDestroy();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
} // namespace NLGEORGES
#endif // _NLGEORGES_SOUND_DIALOG_H

@ -1,190 +1,190 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "sound_document_plugin.h"
#include "resource.h"
#include "nel/misc/debug.h"
#include "nel/misc/path.h"
#include "nel/georges/u_form.h"
#include "nel/georges/u_form_elm.h"
#include <mmsystem.h>
#include <math.h>
using namespace std;
using namespace NLMISC;
namespace NLGEORGES
{
// ***************************************************************************
void CSoundDocumentPlugin::dialogInit(HWND documentView)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
updateInfo(true);
}
// ***************************************************************************
bool CSoundDocumentPlugin::pretranslateMessage(MSG *pMsg)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
return false;
}
// ***************************************************************************
void CSoundDocumentPlugin::activate(bool activated)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if (activated)
{
updateInfo(true);
_Plugin->setActiveDocument(_Document);
}
else
{
_Plugin->stop();
}
}
// ***************************************************************************
void CSoundDocumentPlugin::onValueChanged(const char *formName)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
updateInfo(true);
}
// ***************************************************************************
void CSoundDocumentPlugin::onNodeChanged()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
updateInfo(false);
}
// ***************************************************************************
//
//
// FIXME: Should be using CSound.importForm()
//
//
//
void CSoundDocumentPlugin::updateInfo(bool stopSound)
{
// Filename
// _Document->getForm()->getRootNode().getValueByName(_Filename, ".SoundType.Filename");
/* // InternalConeAngle
_Document->getForm()->getRootNode().getValueByName(_InnerAngle, ".InternalConeAngle");
if (_InnerAngle > 360)
{
_InnerAngle = 360;
}
float inner = (float) (Pi * _InnerAngle / 180.0f); // convert to radians
// ExternalConeAngle
_Document->getForm()->getRootNode().getValueByName(_OuterAngle, ".ExternalConeAngle");
if (_OuterAngle > 360)
{
_OuterAngle = 360;
}
float outer = (float) (Pi * _OuterAngle / 180.0f); // convert to radians
*/
/* // Loop
_Document->getForm()->getRootNode().getValueByName(_Loop, ".Loop");
// Gain
_Document->getForm()->getRootNode().getValueByName(_Gain, ".Gain");
if (_Gain > 0)
{
_Gain = 0;
}
if (_Gain < -100)
{
_Gain = -100;
}
float ampGain = (float) pow(10.0, _Gain / 20.0); // convert dB to linear gain
*/
/* // External gain
_Document->getForm()->getRootNode().getValueByName(_ExternalGain, ".ExternalGain");
if (_ExternalGain > 0)
{
_ExternalGain = 0;
}
if (_ExternalGain < -100)
{
_ExternalGain = -100;
}
float ampExtGain = (float) pow(10.0, _ExternalGain / 20.0); // convert dB to linear gain
*/
/*
// Transpoee
_Document->getForm()->getRootNode().getValueByName(_Transpose, ".Transpose");
float pitch = (float) pow(1.0594630943592952645618252949463, _Transpose); // convert semi-tones to playback speed
*/
// MinDistance
/* float mindist;
_Document->getForm()->getRootNode().getValueByName(mindist, ".SoundType.MinDistance");
// MaxDistance
float maxdist;
_Document->getForm()->getRootNode().getValueByName(maxdist, ".SoundType.MaxDistance");
// Alpha
float alpha;
_Document->getForm()->getRootNode().getValueByName(alpha, ".SoundType.Alpha");
*/
// Send the values down the drain
// For the source
// _Plugin->setLoop(_Loop);
// _Plugin->setGain(ampGain);
// _Plugin->setCone(inner, outer, ampExtGain);
// _Plugin->setPitch(pitch);
// _Plugin->setMinMaxDistances(mindist, maxdist);
// _Plugin->setAlpha(alpha);
// For the dialog
string filename;
_Document->getFilename(filename);
string name = NLMISC::CFile::getFilenameWithoutExtension(filename);
if( stopSound)
_Plugin->setActiveDocument(_Document);
_Plugin->updateDisplay();
// _Plugin->setName(name);
// _Plugin->setFilename(_Filename);
// _Plugin->setAngles(_InnerAngle, _OuterAngle);
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "sound_document_plugin.h"
#include "resource.h"
#include "nel/misc/debug.h"
#include "nel/misc/path.h"
#include "nel/georges/u_form.h"
#include "nel/georges/u_form_elm.h"
#include <mmsystem.h>
#include <math.h>
using namespace std;
using namespace NLMISC;
namespace NLGEORGES
{
// ***************************************************************************
void CSoundDocumentPlugin::dialogInit(HWND documentView)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
updateInfo(true);
}
// ***************************************************************************
bool CSoundDocumentPlugin::pretranslateMessage(MSG *pMsg)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
return false;
}
// ***************************************************************************
void CSoundDocumentPlugin::activate(bool activated)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if (activated)
{
updateInfo(true);
_Plugin->setActiveDocument(_Document);
}
else
{
_Plugin->stop();
}
}
// ***************************************************************************
void CSoundDocumentPlugin::onValueChanged(const char *formName)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
updateInfo(true);
}
// ***************************************************************************
void CSoundDocumentPlugin::onNodeChanged()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
updateInfo(false);
}
// ***************************************************************************
//
//
// FIXME: Should be using CSound.importForm()
//
//
//
void CSoundDocumentPlugin::updateInfo(bool stopSound)
{
// Filename
// _Document->getForm()->getRootNode().getValueByName(_Filename, ".SoundType.Filename");
/* // InternalConeAngle
_Document->getForm()->getRootNode().getValueByName(_InnerAngle, ".InternalConeAngle");
if (_InnerAngle > 360)
{
_InnerAngle = 360;
}
float inner = (float) (Pi * _InnerAngle / 180.0f); // convert to radians
// ExternalConeAngle
_Document->getForm()->getRootNode().getValueByName(_OuterAngle, ".ExternalConeAngle");
if (_OuterAngle > 360)
{
_OuterAngle = 360;
}
float outer = (float) (Pi * _OuterAngle / 180.0f); // convert to radians
*/
/* // Loop
_Document->getForm()->getRootNode().getValueByName(_Loop, ".Loop");
// Gain
_Document->getForm()->getRootNode().getValueByName(_Gain, ".Gain");
if (_Gain > 0)
{
_Gain = 0;
}
if (_Gain < -100)
{
_Gain = -100;
}
float ampGain = (float) pow(10.0, _Gain / 20.0); // convert dB to linear gain
*/
/* // External gain
_Document->getForm()->getRootNode().getValueByName(_ExternalGain, ".ExternalGain");
if (_ExternalGain > 0)
{
_ExternalGain = 0;
}
if (_ExternalGain < -100)
{
_ExternalGain = -100;
}
float ampExtGain = (float) pow(10.0, _ExternalGain / 20.0); // convert dB to linear gain
*/
/*
// Transpoee
_Document->getForm()->getRootNode().getValueByName(_Transpose, ".Transpose");
float pitch = (float) pow(1.0594630943592952645618252949463, _Transpose); // convert semi-tones to playback speed
*/
// MinDistance
/* float mindist;
_Document->getForm()->getRootNode().getValueByName(mindist, ".SoundType.MinDistance");
// MaxDistance
float maxdist;
_Document->getForm()->getRootNode().getValueByName(maxdist, ".SoundType.MaxDistance");
// Alpha
float alpha;
_Document->getForm()->getRootNode().getValueByName(alpha, ".SoundType.Alpha");
*/
// Send the values down the drain
// For the source
// _Plugin->setLoop(_Loop);
// _Plugin->setGain(ampGain);
// _Plugin->setCone(inner, outer, ampExtGain);
// _Plugin->setPitch(pitch);
// _Plugin->setMinMaxDistances(mindist, maxdist);
// _Plugin->setAlpha(alpha);
// For the dialog
string filename;
_Document->getFilename(filename);
string name = NLMISC::CFile::getFilenameWithoutExtension(filename);
if( stopSound)
_Plugin->setActiveDocument(_Document);
_Plugin->updateDisplay();
// _Plugin->setName(name);
// _Plugin->setFilename(_Filename);
// _Plugin->setAngles(_InnerAngle, _OuterAngle);
}
} // namespace NLGEORGES

@ -1,62 +1,62 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef _NLGEORGES_SNDDOCPLUG_H
#define _NLGEORGES_SNDDOCPLUG_H
#include "std_sound_plugin.h"
#include "../georges_dll/plugin_interface.h"
#include "sound_plugin.h"
#include "nel/misc/vector.h"
namespace NLGEORGES
{
class CSoundPlugin;
class CSoundDocumentPlugin : public IEditDocumentPlugin
{
public:
CSoundDocumentPlugin(CSoundPlugin *plugin, IEditDocument *document) : _Plugin(plugin), _Document(document), _Filename() {}
virtual ~CSoundDocumentPlugin() {}
virtual void dialogInit(HWND documentView);
virtual bool pretranslateMessage(MSG *pMsg);
virtual void activate(bool activated);
virtual void onValueChanged(const char *formName);
virtual void onNodeChanged();
private:
void updateInfo(bool stopSound);
CSoundPlugin *_Plugin;
IEditDocument *_Document;
std::string _Filename;
uint32 _InnerAngle;
uint32 _OuterAngle;
bool _Loop;
sint32 _Gain;
sint32 _ExternalGain;
sint32 _Transpose;
};
} // namespace NLGEORGES
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef _NLGEORGES_SNDDOCPLUG_H
#define _NLGEORGES_SNDDOCPLUG_H
#include "std_sound_plugin.h"
#include "../georges_dll/plugin_interface.h"
#include "sound_plugin.h"
#include "nel/misc/vector.h"
namespace NLGEORGES
{
class CSoundPlugin;
class CSoundDocumentPlugin : public IEditDocumentPlugin
{
public:
CSoundDocumentPlugin(CSoundPlugin *plugin, IEditDocument *document) : _Plugin(plugin), _Document(document), _Filename() {}
virtual ~CSoundDocumentPlugin() {}
virtual void dialogInit(HWND documentView);
virtual bool pretranslateMessage(MSG *pMsg);
virtual void activate(bool activated);
virtual void onValueChanged(const char *formName);
virtual void onNodeChanged();
private:
void updateInfo(bool stopSound);
CSoundPlugin *_Plugin;
IEditDocument *_Document;
std::string _Filename;
uint32 _InnerAngle;
uint32 _OuterAngle;
bool _Loop;
sint32 _Gain;
sint32 _ExternalGain;
sint32 _Transpose;
};
} // namespace NLGEORGES
#endif // _NLGEORGES_SNDDOCPLUG_H

@ -1,157 +1,157 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef _NLGEORGES_SOUND_PLUGIN_H
#define _NLGEORGES_SOUND_PLUGIN_H
#include "std_sound_plugin.h"
#include <windows.h>
#include <mmsystem.h>
#include <dsound.h>
#ifdef min
#undef min
#endif
#ifdef max
#undef max
#endif
#include "sound_dialog.h"
#include "../georges_dll/plugin_interface.h"
#include "nel/misc/vector.h"
#include "nel/sound/driver/sound_driver.h"
#include "nel/sound/driver/source.h"
#include "nel/sound/driver/listener.h"
#include "sound/driver/dsound/source_dsound.h"
#include "nel/sound/u_audio_mixer.h"
#include "nel/sound/u_listener.h"
class NLSOUND::IBuffer;
class NLSOUND::IListener;
class NLSOUND::USource;
class NLSOUND::CSourceDSound;
class NLSOUND::CSound;
namespace NLGEORGES
{
class CSoundPlugin : public IEditPlugin
{
public:
// From IEditPlugin
CSoundPlugin(NLGEORGES::IEdit *globalInterface);
virtual ~CSoundPlugin();
// Overriden methods
virtual void dialogInit(HWND mainFrm);
virtual bool pretranslateMessage(MSG *pMsg);
virtual void onCreateDocument(IEditDocument *document);
virtual void activate(bool activate);
virtual void getPluginName(std::string &name);
// Source control
virtual void play(std::string &filename);
virtual void play() { play(_Filename); };
virtual void stop();
virtual uint32 getTime();
void update();
bool isPlaying();
// Source parameters
virtual void setListenerPos(const NLMISC::CVector& pos) { _Listener->setPos(pos); /*commit();*/ }
virtual void setListenerOrientation(const NLMISC::CVector& front, const NLMISC::CVector& up) { _Listener->setOrientation(front, up); /*commit(); */}
virtual void setDirection(const NLMISC::CVector& dir) { /*_Source->setDirection(dir);*/ commit(); }
virtual void setGain(float gain) { /*_Source->setGain(gain);*/ commit(); }
virtual void setPitch(float pitch) { /*_Source->setPitch(pitch);*/ commit(); }
virtual void setMinMaxDistances(float mindist, float maxdist) { /*_Source->setMinMaxDistances(mindist, maxdist);*/ commit(); _Dialog.setMinMaxDistances(mindist, maxdist); }
virtual void setCone(float inner, float outer, float outerGain) { /*_Source->setCone(inner, outer, outerGain);*/ commit(); }
virtual void setLoop(bool v) { /*_Source->setLooping(v);*/ }
virtual void commit() { /*_SoundDriver->commit3DChanges(); */}
virtual void setAlpha(double alpha) { /*_Source->setAlpha(alpha);*/ _Dialog.setAlpha(alpha); }
// Dialog display
virtual void setName(std::string& name) { _Dialog.setName(name); }
virtual void setFilename(std::string& filename) { _Filename = filename; _Dialog.setFilename(filename); }
virtual void setAngles(uint32 inner, uint32 outer) { _Dialog.setAngles(inner, outer); }
// Form creation
virtual void createNew();
// Boris : hum, simpler ?
void setActiveDocument(IEditDocument *pdoc);
IEditDocument *getActiveDocument() { return _ActiveDoc; }
/// Ask if the sound has an alpha info (ie simple sound).
bool hasAlpha();
bool isSoundValid() { return !_InvalidSound;}
/// The dialog update the environnement flags.
void updateEnvFlags(const NLSOUND::UAudioMixer::TBackgroundFlags &backgroundFlags);
// Return the global interface (for dialog)
IEdit *getGlobalInterface() { return _GlobalInterface; }
void reloadSamples();
void reloadSounds();
void updateDisplay();
NLSOUND::UAudioMixer *getMixer() { return _Mixer;}
NLSOUND::USource *getSource() { return _Source; }
NLSOUND::CSound *getSound() { return _Sound; }
private:
bool checkSound(NLSOUND::CSound *sound, const std::vector<std::pair<std::string, NLSOUND::CSound*> > &subsounds, std::vector<std::string> &missingFiles);
IEdit *_GlobalInterface;
CSoundDialog _Dialog;
// NLSOUND::ISoundDriver *_SoundDriver;
// NLSOUND::IBuffer *_Buffer;
NLSOUND::UListener *_Listener;
NLSOUND::USource *_Source;
NLSOUND::CSound *_Sound;
bool _FreeSound;
bool _PlayBackground;
std::string _Filename;
NLSOUND::CSoundContext _Context;
/// Flag for sound with infinite recursion !
bool _InvalidSound;
IEditDocument *_ActiveDoc;
NLSOUND::UAudioMixer *_Mixer;
};
} // namespace NLGEORGES
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef _NLGEORGES_SOUND_PLUGIN_H
#define _NLGEORGES_SOUND_PLUGIN_H
#include "std_sound_plugin.h"
#include <windows.h>
#include <mmsystem.h>
#include <dsound.h>
#ifdef min
#undef min
#endif
#ifdef max
#undef max
#endif
#include "sound_dialog.h"
#include "../georges_dll/plugin_interface.h"
#include "nel/misc/vector.h"
#include "nel/sound/driver/sound_driver.h"
#include "nel/sound/driver/source.h"
#include "nel/sound/driver/listener.h"
#include "sound/driver/dsound/source_dsound.h"
#include "nel/sound/u_audio_mixer.h"
#include "nel/sound/u_listener.h"
class NLSOUND::IBuffer;
class NLSOUND::IListener;
class NLSOUND::USource;
class NLSOUND::CSourceDSound;
class NLSOUND::CSound;
namespace NLGEORGES
{
class CSoundPlugin : public IEditPlugin
{
public:
// From IEditPlugin
CSoundPlugin(NLGEORGES::IEdit *globalInterface);
virtual ~CSoundPlugin();
// Overriden methods
virtual void dialogInit(HWND mainFrm);
virtual bool pretranslateMessage(MSG *pMsg);
virtual void onCreateDocument(IEditDocument *document);
virtual void activate(bool activate);
virtual void getPluginName(std::string &name);
// Source control
virtual void play(std::string &filename);
virtual void play() { play(_Filename); };
virtual void stop();
virtual uint32 getTime();
void update();
bool isPlaying();
// Source parameters
virtual void setListenerPos(const NLMISC::CVector& pos) { _Listener->setPos(pos); /*commit();*/ }
virtual void setListenerOrientation(const NLMISC::CVector& front, const NLMISC::CVector& up) { _Listener->setOrientation(front, up); /*commit(); */}
virtual void setDirection(const NLMISC::CVector& dir) { /*_Source->setDirection(dir);*/ commit(); }
virtual void setGain(float gain) { /*_Source->setGain(gain);*/ commit(); }
virtual void setPitch(float pitch) { /*_Source->setPitch(pitch);*/ commit(); }
virtual void setMinMaxDistances(float mindist, float maxdist) { /*_Source->setMinMaxDistances(mindist, maxdist);*/ commit(); _Dialog.setMinMaxDistances(mindist, maxdist); }
virtual void setCone(float inner, float outer, float outerGain) { /*_Source->setCone(inner, outer, outerGain);*/ commit(); }
virtual void setLoop(bool v) { /*_Source->setLooping(v);*/ }
virtual void commit() { /*_SoundDriver->commit3DChanges(); */}
virtual void setAlpha(double alpha) { /*_Source->setAlpha(alpha);*/ _Dialog.setAlpha(alpha); }
// Dialog display
virtual void setName(std::string& name) { _Dialog.setName(name); }
virtual void setFilename(std::string& filename) { _Filename = filename; _Dialog.setFilename(filename); }
virtual void setAngles(uint32 inner, uint32 outer) { _Dialog.setAngles(inner, outer); }
// Form creation
virtual void createNew();
// Boris : hum, simpler ?
void setActiveDocument(IEditDocument *pdoc);
IEditDocument *getActiveDocument() { return _ActiveDoc; }
/// Ask if the sound has an alpha info (ie simple sound).
bool hasAlpha();
bool isSoundValid() { return !_InvalidSound;}
/// The dialog update the environnement flags.
void updateEnvFlags(const NLSOUND::UAudioMixer::TBackgroundFlags &backgroundFlags);
// Return the global interface (for dialog)
IEdit *getGlobalInterface() { return _GlobalInterface; }
void reloadSamples();
void reloadSounds();
void updateDisplay();
NLSOUND::UAudioMixer *getMixer() { return _Mixer;}
NLSOUND::USource *getSource() { return _Source; }
NLSOUND::CSound *getSound() { return _Sound; }
private:
bool checkSound(NLSOUND::CSound *sound, const std::vector<std::pair<std::string, NLSOUND::CSound*> > &subsounds, std::vector<std::string> &missingFiles);
IEdit *_GlobalInterface;
CSoundDialog _Dialog;
// NLSOUND::ISoundDriver *_SoundDriver;
// NLSOUND::IBuffer *_Buffer;
NLSOUND::UListener *_Listener;
NLSOUND::USource *_Source;
NLSOUND::CSound *_Sound;
bool _FreeSound;
bool _PlayBackground;
std::string _Filename;
NLSOUND::CSoundContext _Context;
/// Flag for sound with infinite recursion !
bool _InvalidSound;
IEditDocument *_ActiveDoc;
NLSOUND::UAudioMixer *_Mixer;
};
} // namespace NLGEORGES
#endif // _NLGEORGES_SOUND_PLUGIN_H

@ -1,29 +1,29 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#define NOMINMAX
#define _WIN32_WINNT 0x0500
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include "resource.h"
#include "nel/misc/types_nl.h"
#include "nel/misc/debug.h"
#include "nel/georges/u_form_elm.h"
#include "georges_plugin_sound.h"
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#define NOMINMAX
#define _WIN32_WINNT 0x0500
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include "resource.h"
#include "nel/misc/types_nl.h"
#include "nel/misc/debug.h"
#include "nel/georges/u_form_elm.h"
#include "georges_plugin_sound.h"

@ -1,39 +1,39 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by georges_plugin_test.rc
//
#define IDC_MESSAGE 1000
#define IDD_TEST_GLOBAL 1000
#define IDD_TEST_LOCAL 1001
#define IDC_MESSAGE2 1001
#define IDC_REFRESH 1002
#define IDC_SET 1003
#define IDC_CREATE_DOC 1003
#define IDC_SAVE 1004
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 1001
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1004
#define _APS_NEXT_SYMED_VALUE 1000
#endif
#endif
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by georges_plugin_test.rc
//
#define IDC_MESSAGE 1000
#define IDD_TEST_GLOBAL 1000
#define IDD_TEST_LOCAL 1001
#define IDC_MESSAGE2 1001
#define IDC_REFRESH 1002
#define IDC_SET 1003
#define IDC_CREATE_DOC 1003
#define IDC_SAVE 1004
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 1001
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1004
#define _APS_NEXT_SYMED_VALUE 1000
#endif
#endif

@ -1,24 +1,24 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// stdafx.cpp : source file that includes just the standard includes
// georges_plugin_test.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// stdafx.cpp : source file that includes just the standard includes
// georges_plugin_test.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

@ -1,58 +1,58 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__B0A2DD8B_37A5_4B73_ABC0_99C4E6FECAE1__INCLUDED_)
#define AFX_STDAFX_H__B0A2DD8B_37A5_4B73_ABC0_99C4E6FECAE1__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxole.h> // MFC OLE classes
#include <afxodlgs.h> // MFC OLE dialog classes
#include <afxdisp.h> // MFC Automation classes
#endif // _AFX_NO_OLE_SUPPORT
#ifndef _AFX_NO_DB_SUPPORT
#include <afxdb.h> // MFC ODBC database classes
#endif // _AFX_NO_DB_SUPPORT
#ifndef _AFX_NO_DAO_SUPPORT
#include <afxdao.h> // MFC DAO database classes
#endif // _AFX_NO_DAO_SUPPORT
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__B0A2DD8B_37A5_4B73_ABC0_99C4E6FECAE1__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__B0A2DD8B_37A5_4B73_ABC0_99C4E6FECAE1__INCLUDED_)
#define AFX_STDAFX_H__B0A2DD8B_37A5_4B73_ABC0_99C4E6FECAE1__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#ifndef _AFX_NO_OLE_SUPPORT
#include <afxole.h> // MFC OLE classes
#include <afxodlgs.h> // MFC OLE dialog classes
#include <afxdisp.h> // MFC Automation classes
#endif // _AFX_NO_OLE_SUPPORT
#ifndef _AFX_NO_DB_SUPPORT
#include <afxdb.h> // MFC ODBC database classes
#endif // _AFX_NO_DB_SUPPORT
#ifndef _AFX_NO_DAO_SUPPORT
#include <afxdao.h> // MFC DAO database classes
#endif // _AFX_NO_DAO_SUPPORT
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__B0A2DD8B_37A5_4B73_ABC0_99C4E6FECAE1__INCLUDED_)

@ -1,253 +1,253 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// georges_plugin_test.cpp : Defines the initialization routines for the DLL.
//
#include "stdafx.h"
#include "georges_plugin_test.h"
using namespace NLGEORGES;
using namespace std;
//
// Note!
//
// If this DLL is dynamically linked against the MFC
// DLLs, any functions exported from this DLL which
// call into MFC must have the AFX_MANAGE_STATE macro
// added at the very beginning of the function.
//
// For example:
//
// extern "C" BOOL PASCAL EXPORT ExportedFunction()
// {
// AFX_MANAGE_STATE(AfxGetStaticModuleState());
// // normal function body here
// }
//
// It is very important that this macro appear in each
// function, prior to any calls into MFC. This means that
// it must appear as the first statement within the
// function, even before any object variable declarations
// as their constructors may generate calls into the MFC
// DLL.
//
// Please see MFC Technical Notes 33 and 58 for additional
// details.
//
/////////////////////////////////////////////////////////////////////////////
// CGeorges_plugin_testApp
BEGIN_MESSAGE_MAP(CGeorges_plugin_testApp, CWinApp)
//{{AFX_MSG_MAP(CGeorges_plugin_testApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGeorges_plugin_testApp construction
CGeorges_plugin_testApp::CGeorges_plugin_testApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CGeorges_plugin_testApp object
CGeorges_plugin_testApp theApp;
// ***************************************************************************
// MyDocumentPlugin
// ***************************************************************************
MyDocumentPlugin::MyDocumentPlugin (IEditDocument *doc)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
Document = doc;
MyLocalDialog.Plugin = this;
}
// ***************************************************************************
MyDocumentPlugin::~MyDocumentPlugin ()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if (IsWindow (MyLocalDialog))
MyLocalDialog.DestroyWindow ();
}
// ***************************************************************************
void MyDocumentPlugin::dialogInit (HWND documentView)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
MyLocalDialog.Create (IDD_TEST_LOCAL, CWnd::FromHandle( documentView ));
}
// ***************************************************************************
bool MyDocumentPlugin::pretranslateMessage (MSG *pMsg)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_F3))
{
MessageBox (NULL, "LOCAL: F3", "Test georges plugin", MB_OK);
}
return false;
}
// ***************************************************************************
void MyDocumentPlugin::activate (bool activated)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if (IsWindow (MyLocalDialog))
MyLocalDialog.ShowWindow (activated?SW_SHOW:SW_HIDE);
}
// ***************************************************************************
void MyDocumentPlugin::onValueChanged (const char *formName)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
MyLocalDialog.GetDlgItem (IDC_MESSAGE)->SetWindowText (formName);
LastValue = formName;
}
// ***************************************************************************
void MyDocumentPlugin::onNodeChanged ()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
string str;
if (Document->getActiveNode (str))
MyLocalDialog.GetDlgItem (IDC_MESSAGE2)->SetWindowText (str.c_str ());
else
MyLocalDialog.GetDlgItem (IDC_MESSAGE2)->SetWindowText ("NILL");
}
// ***************************************************************************
// MyPlugin
// ***************************************************************************
MyPlugin::MyPlugin (NLGEORGES::IEdit *globalInterface)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
GlobalInterface = globalInterface;
MyGlobalDialog.Plugin = this;
}
// ***************************************************************************
MyPlugin::~MyPlugin ()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if (IsWindow (MyGlobalDialog))
MyGlobalDialog.DestroyWindow ();
}
// ***************************************************************************
void MyPlugin::dialogInit (HWND mainFrm)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
MyGlobalDialog.Create (IDD_TEST_GLOBAL, CWnd::FromHandle( mainFrm ));
}
// ***************************************************************************
bool MyPlugin::pretranslateMessage (MSG *pMsg)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_F1))
{
MessageBox (NULL, "GLOBAL: F1", "Test georges plugin", MB_OK);
}
return false;
}
// ***************************************************************************
void MyPlugin::onCreateDocument (IEditDocument *document)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
// Set text in the global dialog
string toto;
document->getDfnFilename (toto);
if (IsWindow (MyGlobalDialog))
MyGlobalDialog.GetDlgItem (IDC_MESSAGE)->SetWindowText (toto.c_str());
// Bind an interface on the document
document->bind (this, new MyDocumentPlugin (document));
}
// ***************************************************************************
void MyPlugin::activate (bool activate)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if (IsWindow (MyGlobalDialog))
MyGlobalDialog.ShowWindow (activate?SW_SHOW:SW_HIDE);
}
// ***************************************************************************
void MyPlugin::getPluginName (std::string &name)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
name = "Test georges plugin";
}
// ***************************************************************************
__declspec( dllexport ) IEditPlugin *IGeorgesEditGetInterface (int version, NLGEORGES::IEdit *globalInterface)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
// Same version ?
if (version == NLGEORGES_PLUGIN_INTERFACE_VERSION)
{
return new MyPlugin (globalInterface);
}
else
{
MessageBox (NULL, "Plugin version invalid.", "Test plugin for georges editor", MB_OK|MB_ICONEXCLAMATION);
return NULL;
}
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// georges_plugin_test.cpp : Defines the initialization routines for the DLL.
//
#include "stdafx.h"
#include "georges_plugin_test.h"
using namespace NLGEORGES;
using namespace std;
//
// Note!
//
// If this DLL is dynamically linked against the MFC
// DLLs, any functions exported from this DLL which
// call into MFC must have the AFX_MANAGE_STATE macro
// added at the very beginning of the function.
//
// For example:
//
// extern "C" BOOL PASCAL EXPORT ExportedFunction()
// {
// AFX_MANAGE_STATE(AfxGetStaticModuleState());
// // normal function body here
// }
//
// It is very important that this macro appear in each
// function, prior to any calls into MFC. This means that
// it must appear as the first statement within the
// function, even before any object variable declarations
// as their constructors may generate calls into the MFC
// DLL.
//
// Please see MFC Technical Notes 33 and 58 for additional
// details.
//
/////////////////////////////////////////////////////////////////////////////
// CGeorges_plugin_testApp
BEGIN_MESSAGE_MAP(CGeorges_plugin_testApp, CWinApp)
//{{AFX_MSG_MAP(CGeorges_plugin_testApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGeorges_plugin_testApp construction
CGeorges_plugin_testApp::CGeorges_plugin_testApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CGeorges_plugin_testApp object
CGeorges_plugin_testApp theApp;
// ***************************************************************************
// MyDocumentPlugin
// ***************************************************************************
MyDocumentPlugin::MyDocumentPlugin (IEditDocument *doc)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
Document = doc;
MyLocalDialog.Plugin = this;
}
// ***************************************************************************
MyDocumentPlugin::~MyDocumentPlugin ()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if (IsWindow (MyLocalDialog))
MyLocalDialog.DestroyWindow ();
}
// ***************************************************************************
void MyDocumentPlugin::dialogInit (HWND documentView)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
MyLocalDialog.Create (IDD_TEST_LOCAL, CWnd::FromHandle( documentView ));
}
// ***************************************************************************
bool MyDocumentPlugin::pretranslateMessage (MSG *pMsg)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_F3))
{
MessageBox (NULL, "LOCAL: F3", "Test georges plugin", MB_OK);
}
return false;
}
// ***************************************************************************
void MyDocumentPlugin::activate (bool activated)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if (IsWindow (MyLocalDialog))
MyLocalDialog.ShowWindow (activated?SW_SHOW:SW_HIDE);
}
// ***************************************************************************
void MyDocumentPlugin::onValueChanged (const char *formName)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
MyLocalDialog.GetDlgItem (IDC_MESSAGE)->SetWindowText (formName);
LastValue = formName;
}
// ***************************************************************************
void MyDocumentPlugin::onNodeChanged ()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
string str;
if (Document->getActiveNode (str))
MyLocalDialog.GetDlgItem (IDC_MESSAGE2)->SetWindowText (str.c_str ());
else
MyLocalDialog.GetDlgItem (IDC_MESSAGE2)->SetWindowText ("NILL");
}
// ***************************************************************************
// MyPlugin
// ***************************************************************************
MyPlugin::MyPlugin (NLGEORGES::IEdit *globalInterface)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
GlobalInterface = globalInterface;
MyGlobalDialog.Plugin = this;
}
// ***************************************************************************
MyPlugin::~MyPlugin ()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if (IsWindow (MyGlobalDialog))
MyGlobalDialog.DestroyWindow ();
}
// ***************************************************************************
void MyPlugin::dialogInit (HWND mainFrm)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
MyGlobalDialog.Create (IDD_TEST_GLOBAL, CWnd::FromHandle( mainFrm ));
}
// ***************************************************************************
bool MyPlugin::pretranslateMessage (MSG *pMsg)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if ((pMsg->message == WM_KEYDOWN) && (pMsg->wParam == VK_F1))
{
MessageBox (NULL, "GLOBAL: F1", "Test georges plugin", MB_OK);
}
return false;
}
// ***************************************************************************
void MyPlugin::onCreateDocument (IEditDocument *document)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
// Set text in the global dialog
string toto;
document->getDfnFilename (toto);
if (IsWindow (MyGlobalDialog))
MyGlobalDialog.GetDlgItem (IDC_MESSAGE)->SetWindowText (toto.c_str());
// Bind an interface on the document
document->bind (this, new MyDocumentPlugin (document));
}
// ***************************************************************************
void MyPlugin::activate (bool activate)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
if (IsWindow (MyGlobalDialog))
MyGlobalDialog.ShowWindow (activate?SW_SHOW:SW_HIDE);
}
// ***************************************************************************
void MyPlugin::getPluginName (std::string &name)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
name = "Test georges plugin";
}
// ***************************************************************************
__declspec( dllexport ) IEditPlugin *IGeorgesEditGetInterface (int version, NLGEORGES::IEdit *globalInterface)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
// Same version ?
if (version == NLGEORGES_PLUGIN_INTERFACE_VERSION)
{
return new MyPlugin (globalInterface);
}
else
{
MessageBox (NULL, "Plugin version invalid.", "Test plugin for georges editor", MB_OK|MB_ICONEXCLAMATION);
return NULL;
}
}

@ -1,96 +1,96 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// georges_plugin_test.h : main header file for the GEORGES_PLUGIN_TEST DLL
//
#if !defined(AFX_GEORGES_PLUGIN_TEST_H__17C63138_6057_4288_99B4_D1158EE798CA__INCLUDED_)
#define AFX_GEORGES_PLUGIN_TEST_H__17C63138_6057_4288_99B4_D1158EE798CA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
#include "../georges_dll/plugin_interface.h"
#include "test_local_dialog.h"
#include "test_global_dialog.h"
/////////////////////////////////////////////////////////////////////////////
// CGeorges_plugin_testApp
// See georges_plugin_test.cpp for the implementation of this class
//
class CGeorges_plugin_testApp : public CWinApp
{
public:
CGeorges_plugin_testApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGeorges_plugin_testApp)
//}}AFX_VIRTUAL
//{{AFX_MSG(CGeorges_plugin_testApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
class MyDocumentPlugin : public NLGEORGES::IEditDocumentPlugin
{
public:
MyDocumentPlugin (NLGEORGES::IEditDocument *doc);
~MyDocumentPlugin ();
virtual void dialogInit (HWND documentView);
virtual bool pretranslateMessage (MSG *pMsg);
virtual void activate (bool activated);
virtual void onValueChanged (const char *formName);
virtual void onNodeChanged ();
CTestLocalDialog MyLocalDialog;
NLGEORGES::IEditDocument *Document;
std::string LastValue;
};
class MyPlugin : public NLGEORGES::IEditPlugin
{
public:
// From IEditPlugin
MyPlugin (NLGEORGES::IEdit *globalInterface);
virtual ~MyPlugin ();
virtual void dialogInit (HWND mainFrm);
virtual bool pretranslateMessage (MSG *pMsg);
virtual void onCreateDocument (NLGEORGES::IEditDocument *document);
virtual void activate (bool activate);
virtual void getPluginName (std::string &name);
CTestGlobalDialog MyGlobalDialog;
NLGEORGES::IEdit *GlobalInterface;
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GEORGES_PLUGIN_TEST_H__17C63138_6057_4288_99B4_D1158EE798CA__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// georges_plugin_test.h : main header file for the GEORGES_PLUGIN_TEST DLL
//
#if !defined(AFX_GEORGES_PLUGIN_TEST_H__17C63138_6057_4288_99B4_D1158EE798CA__INCLUDED_)
#define AFX_GEORGES_PLUGIN_TEST_H__17C63138_6057_4288_99B4_D1158EE798CA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
#include "../georges_dll/plugin_interface.h"
#include "test_local_dialog.h"
#include "test_global_dialog.h"
/////////////////////////////////////////////////////////////////////////////
// CGeorges_plugin_testApp
// See georges_plugin_test.cpp for the implementation of this class
//
class CGeorges_plugin_testApp : public CWinApp
{
public:
CGeorges_plugin_testApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGeorges_plugin_testApp)
//}}AFX_VIRTUAL
//{{AFX_MSG(CGeorges_plugin_testApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
class MyDocumentPlugin : public NLGEORGES::IEditDocumentPlugin
{
public:
MyDocumentPlugin (NLGEORGES::IEditDocument *doc);
~MyDocumentPlugin ();
virtual void dialogInit (HWND documentView);
virtual bool pretranslateMessage (MSG *pMsg);
virtual void activate (bool activated);
virtual void onValueChanged (const char *formName);
virtual void onNodeChanged ();
CTestLocalDialog MyLocalDialog;
NLGEORGES::IEditDocument *Document;
std::string LastValue;
};
class MyPlugin : public NLGEORGES::IEditPlugin
{
public:
// From IEditPlugin
MyPlugin (NLGEORGES::IEdit *globalInterface);
virtual ~MyPlugin ();
virtual void dialogInit (HWND mainFrm);
virtual bool pretranslateMessage (MSG *pMsg);
virtual void onCreateDocument (NLGEORGES::IEditDocument *document);
virtual void activate (bool activate);
virtual void getPluginName (std::string &name);
CTestGlobalDialog MyGlobalDialog;
NLGEORGES::IEdit *GlobalInterface;
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GEORGES_PLUGIN_TEST_H__17C63138_6057_4288_99B4_D1158EE798CA__INCLUDED_)

@ -1,58 +1,58 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// test_global_dialog.cpp : implementation file
//
#include "stdafx.h"
#include "georges_plugin_test.h"
#include "test_global_dialog.h"
/////////////////////////////////////////////////////////////////////////////
// CTestGlobalDialog dialog
CTestGlobalDialog::CTestGlobalDialog(CWnd* pParent /*=NULL*/)
: CDialog(CTestGlobalDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CTestGlobalDialog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CTestGlobalDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTestGlobalDialog)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTestGlobalDialog, CDialog)
//{{AFX_MSG_MAP(CTestGlobalDialog)
ON_BN_CLICKED(IDC_CREATE_DOC, OnCreateDoc)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTestGlobalDialog message handlers
void CTestGlobalDialog::OnCreateDoc()
{
Plugin->GlobalInterface->createDocument ("item.dfn", "test_new_document_plugin.item");
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// test_global_dialog.cpp : implementation file
//
#include "stdafx.h"
#include "georges_plugin_test.h"
#include "test_global_dialog.h"
/////////////////////////////////////////////////////////////////////////////
// CTestGlobalDialog dialog
CTestGlobalDialog::CTestGlobalDialog(CWnd* pParent /*=NULL*/)
: CDialog(CTestGlobalDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CTestGlobalDialog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CTestGlobalDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTestGlobalDialog)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTestGlobalDialog, CDialog)
//{{AFX_MSG_MAP(CTestGlobalDialog)
ON_BN_CLICKED(IDC_CREATE_DOC, OnCreateDoc)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTestGlobalDialog message handlers
void CTestGlobalDialog::OnCreateDoc()
{
Plugin->GlobalInterface->createDocument ("item.dfn", "test_new_document_plugin.item");
}

@ -1,63 +1,63 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_TEST_GLOBAL_DIALOG_H__7979954A_B56B_46BB_BD90_F69FD2EE52F7__INCLUDED_)
#define AFX_TEST_GLOBAL_DIALOG_H__7979954A_B56B_46BB_BD90_F69FD2EE52F7__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// test_global_dialog.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CTestGlobalDialog dialog
class CTestGlobalDialog : public CDialog
{
// Construction
public:
CTestGlobalDialog(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CTestGlobalDialog)
enum { IDD = IDD_TEST_GLOBAL };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
class MyPlugin *Plugin;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTestGlobalDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CTestGlobalDialog)
afx_msg void OnCreateDoc();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TEST_GLOBAL_DIALOG_H__7979954A_B56B_46BB_BD90_F69FD2EE52F7__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_TEST_GLOBAL_DIALOG_H__7979954A_B56B_46BB_BD90_F69FD2EE52F7__INCLUDED_)
#define AFX_TEST_GLOBAL_DIALOG_H__7979954A_B56B_46BB_BD90_F69FD2EE52F7__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// test_global_dialog.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CTestGlobalDialog dialog
class CTestGlobalDialog : public CDialog
{
// Construction
public:
CTestGlobalDialog(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CTestGlobalDialog)
enum { IDD = IDD_TEST_GLOBAL };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
class MyPlugin *Plugin;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTestGlobalDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CTestGlobalDialog)
afx_msg void OnCreateDoc();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TEST_GLOBAL_DIALOG_H__7979954A_B56B_46BB_BD90_F69FD2EE52F7__INCLUDED_)

@ -1,84 +1,84 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// test_local_dialog.cpp : implementation file
//
#include "stdafx.h"
#include "georges_plugin_test.h"
#include "test_local_dialog.h"
#include "nel/misc/file.h"
#include "nel/georges/u_form.h"
#include "nel/georges/u_form_elm.h"
using namespace NLMISC;
using namespace std;
/////////////////////////////////////////////////////////////////////////////
// CTestLocalDialog dialog
CTestLocalDialog::CTestLocalDialog(CWnd* pParent /*=NULL*/)
: CDialog(CTestLocalDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CTestLocalDialog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CTestLocalDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTestLocalDialog)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTestLocalDialog, CDialog)
//{{AFX_MSG_MAP(CTestLocalDialog)
ON_BN_CLICKED(IDC_REFRESH, OnRefresh)
ON_BN_CLICKED(IDC_SET, OnSet)
ON_BN_CLICKED(IDC_SAVE, OnSave)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTestLocalDialog message handlers
void CTestLocalDialog::OnRefresh()
{
Plugin->Document->refreshView ();
}
void CTestLocalDialog::OnSet()
{
Plugin->Document->setValue ("test set value", Plugin->LastValue.c_str ());
// Plugin->Document->refreshView ();
}
void CTestLocalDialog::OnSave()
{
CFileDialog dialog (FALSE);
if (dialog.DoModal () == IDOK)
{
string name = (const char*)dialog.GetPathName ();
COFile file (name.c_str ());
Plugin->Document->getForm ()->write (file, true);
}
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// test_local_dialog.cpp : implementation file
//
#include "stdafx.h"
#include "georges_plugin_test.h"
#include "test_local_dialog.h"
#include "nel/misc/file.h"
#include "nel/georges/u_form.h"
#include "nel/georges/u_form_elm.h"
using namespace NLMISC;
using namespace std;
/////////////////////////////////////////////////////////////////////////////
// CTestLocalDialog dialog
CTestLocalDialog::CTestLocalDialog(CWnd* pParent /*=NULL*/)
: CDialog(CTestLocalDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CTestLocalDialog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CTestLocalDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTestLocalDialog)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTestLocalDialog, CDialog)
//{{AFX_MSG_MAP(CTestLocalDialog)
ON_BN_CLICKED(IDC_REFRESH, OnRefresh)
ON_BN_CLICKED(IDC_SET, OnSet)
ON_BN_CLICKED(IDC_SAVE, OnSave)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTestLocalDialog message handlers
void CTestLocalDialog::OnRefresh()
{
Plugin->Document->refreshView ();
}
void CTestLocalDialog::OnSet()
{
Plugin->Document->setValue ("test set value", Plugin->LastValue.c_str ());
// Plugin->Document->refreshView ();
}
void CTestLocalDialog::OnSave()
{
CFileDialog dialog (FALSE);
if (dialog.DoModal () == IDOK)
{
string name = (const char*)dialog.GetPathName ();
COFile file (name.c_str ());
Plugin->Document->getForm ()->write (file, true);
}
}

@ -1,65 +1,65 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_TEST_LOCAL_DIALOG_H__D6FE10F8_A2E7_4166_AD85_D8C05B599E2A__INCLUDED_)
#define AFX_TEST_LOCAL_DIALOG_H__D6FE10F8_A2E7_4166_AD85_D8C05B599E2A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// test_local_dialog.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CTestLocalDialog dialog
class CTestLocalDialog : public CDialog
{
// Construction
public:
CTestLocalDialog(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CTestLocalDialog)
enum { IDD = IDD_TEST_LOCAL };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
class MyDocumentPlugin *Plugin;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTestLocalDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CTestLocalDialog)
afx_msg void OnRefresh();
afx_msg void OnSet();
afx_msg void OnSave();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TEST_LOCAL_DIALOG_H__D6FE10F8_A2E7_4166_AD85_D8C05B599E2A__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_TEST_LOCAL_DIALOG_H__D6FE10F8_A2E7_4166_AD85_D8C05B599E2A__INCLUDED_)
#define AFX_TEST_LOCAL_DIALOG_H__D6FE10F8_A2E7_4166_AD85_D8C05B599E2A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// test_local_dialog.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CTestLocalDialog dialog
class CTestLocalDialog : public CDialog
{
// Construction
public:
CTestLocalDialog(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CTestLocalDialog)
enum { IDD = IDD_TEST_LOCAL };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
class MyDocumentPlugin *Plugin;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTestLocalDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CTestLocalDialog)
afx_msg void OnRefresh();
afx_msg void OnSet();
afx_msg void OnSave();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TEST_LOCAL_DIALOG_H__D6FE10F8_A2E7_4166_AD85_D8C05B599E2A__INCLUDED_)

@ -1,392 +1,392 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <nel/misc/types_nl.h>
#include <nel/misc/file.h>
#include <nel/misc/sstring.h>
#include <nel/misc/path.h>
#include <nel/misc/algo.h>
#include <nel/misc/config_file.h>
#include <nel/misc/bitmap.h>
#include <iostream>
using namespace NLMISC;
using namespace std;
CSString REP_SRC; //= "R:\\code\\ryzom\\src_v2\\client\\";
CSString REP_GUI; //= "R:\\code\\ryzom\\data\\gamedev\\interfaces_v3\\";
CSString REP_ITEM; //= "R:\\code\\ryzom\\data_leveldesign\\leveldesign\\Game_elem\\items\\";
CSString REP_MISSION; //= "R:\\code\\ryzom\\data_leveldesign\\leveldesign\\Game_elem\\mission\\";
CSString REP_SITEM; //= "R:\\code\\ryzom\\data_leveldesign\\leveldesign\\game_element\\sitem\\";
CSString REP_SBRICK; //= "R:\\code\\ryzom\\data_leveldesign\\leveldesign\\game_element\\sbrick\\";
CSString REP_DFN; //= "R:\\code\\ryzom\\data_leveldesign\\leveldesign\\DFN\\";
CSString REP_FACTION;// = "R:\\code\\ryzom\\data_leveldesign\\leveldesign\\World\\factions\\";
typedef vector<string> StringVector;
StringVector listeIcones;
map<CSString, StringVector> citations;
bool addUsedIcons = true;
bool addFreeIcons = true;
// Fill listeIcones from source directories
void findIcons(CConfigFile::CVar *var)
{
nlassert(var != NULL);
// clear vector
listeIcones.clear();
vector<string> files;
// Scan each directory
for (uint i=0 ; i<var->size() ; i++)
{
// clear files list
files.clear();
// get files list
CPath::getPathContent(CPath::standardizePath(var->asString(i)), false, false, true, files);
// Convert each file
for (uint j=0 ; j<files.size() ; j++)
{
// get filename
string iconName = CFile::getFilename(files[j]);
// store icon's name
listeIcones.push_back(iconName);
citations[iconName].push_back(iconName);
}
}
}
string remap2Jpg(const string &s)
{
// change extension from TGA to JPG
string jpg(s);
string::size_type n = jpg.find(".tga");
nlassert(n != string::npos);
jpg.erase(n);
jpg += ".jpg";
return jpg;
}
void writeString(COFile &f, const string &s)
{
f.serialBuffer((uint8*)s.c_str(), (uint)s.size());
}
void writeHTMLline(COFile &f, const string &icon, const StringVector files, uint sizeLimit)
{
// discard if needed
if ((files.size() == 1 && !addFreeIcons) || (files.size() > 1 && !addUsedIcons))
return;
// begin line
writeString(f, "<tr>");
// write icon as jpg
writeString(f, "<th><img src=\"");
writeString(f, "images\\");
writeString(f, remap2Jpg(files[0]));
writeString(f, "\"></th>");
// fix limit based on configuration file
uint n;
if (sizeLimit == 0)
n = (uint)files.size();
else
n = sizeLimit > files.size() ? (uint)files.size() : sizeLimit;
// write each file using this icon
for (uint i=0 ; i<n ; i++)
writeString(f, "<td>" + files[i] + "</td>");
// end line
writeString(f, "</tr>\n");
}
void generateHTML(const string &name, uint sizeLimit)
{
COFile f;
nlassert(f.open(name, false, true));
// write header
writeString(f, "<html>\n<head>\n<title>Nevrax - Ryzom icons</title>\n</title>\n\n<body><table border=1>\n");
// write lines
for (map<CSString, StringVector>::iterator it = citations.begin(); it != citations.end(); ++it)
{
string str = it->second[0];
writeHTMLline(f, str, it->second, sizeLimit);
}
// write end
writeString(f, "</table></body>\n</html>");
f.close();
}
void tga2Jpg(const string &tga, const string &jpg)
{
// read TGA
CIFile fTga;
CBitmap im;
nlassert(fTga.open(tga));
nlassert(im.load(fTga));
fTga.close();
// write JPG
COFile fJpg;
nlassert(fJpg.open(jpg));
nlassert(im.writeJPG(fJpg));
fJpg.close();
}
void convertImages(CConfigFile::CVar *var)
{
nlassert(var != NULL);
// store current path
string curPath = CPath::standardizePath(CPath::getCurrentPath());
// Create 'images' directory in the root folder if not present
if (!CFile::isExists("images"))
CFile::createDirectory("images");
// Scan each directory
for (uint i=0 ; i<var->size() ; i++)
{
string path = CPath::standardizePath(var->asString(i));
vector<string> files;
CPath::getPathContent(path, false, false, true, files);
// Convert each file
for (uint j=0 ; j<files.size() ; j++)
{
// get filenames
string file = CFile::getFilename(files[j]);
string src = path + file;
string dst = remap2Jpg(curPath + "images/" + file);
cout << "Copying file (" << i+1 << "/" << var->size() << " - " << j+1 << " / " << files.size() << ") : " << file << " ... ";
// Convert the file
if (!CFile::isExists(dst))
{
tga2Jpg(src, dst);
cout << " OK\n";
}
else
{
cout << "skipped\n";
}
}
}
}
bool endsWith( const CSString& s, const CSString& substring )
{
return ( s.right( (uint)substring.size() ) == substring );
}
void ProcessDirectory( const CSString& dir, const StringVector& extensions )
{
CSString data;
int nbResults = 0;
int sixieme;
vector<string> files;
printf( "%s\n", dir.c_str() );
CPath::getPathContent ( dir.c_str(), true, false, true, files );
sixieme = (int)files.size() / 6;
printf( "%u files are processed", (uint) files.size() );
for (uint32 i=0; i<files.size(); ++i)
{
bool extOK = false;
uint numExt = 0;
while ( ( !extOK ) && ( numExt < extensions.size() ) )
{
extOK = endsWith( files[i], extensions[numExt] );
numExt++;
}
if ( extOK )
{
data.readFromFile( files[i] );
// Don't parse LOG
string::size_type n = data.find("<LOG>");
if (n != CSString::npos)
data.erase(n);
data = data.toLower();
for ( uint it=0; it<listeIcones.size(); it++ )
{
if ( data.contains( CSString(listeIcones[it]).toLower().c_str() ) )
{
string fileName = CFile::getFilename( files[i] );
citations[ listeIcones[it] ].push_back( fileName );
nbResults++;
}
}
}
if ( i%sixieme == 0 )
printf( "." );
}
printf( " %d results found\n\n", nbResults );
}
int main()
{
StringVector extensions;
new CApplicationContext();
CSString REP_SRC, REP_GUI, REP_LEVEL_DESIGN;
int searchSrcClient, searchGui, searchLevelDesign;
uint sizeLimit = 5;
CConfigFile cf;
CConfigFile::CVar *var;
cf.load("icon_search.cfg");
var = cf.getVarPtr("SearchClientSrc");
nlassert(var);
searchSrcClient = var->asInt();
var = cf.getVarPtr("ClientSrcPath");
nlassert(var);
REP_SRC = var->asString();
var = cf.getVarPtr("SearchGUI");
nlassert(var);
searchGui = var->asInt();
var = cf.getVarPtr("GUIPath");
nlassert(var);
REP_GUI = var->asString();
var = cf.getVarPtr("SearchLevelDesign");
nlassert(var);
searchLevelDesign = var->asInt();
var = cf.getVarPtr("LevelDesignPath");
nlassert(var);
REP_LEVEL_DESIGN = var->asString();
var = cf.getVarPtr("IconPath");
nlassert(var);
convertImages(var);
findIcons(var);
var = cf.getVarPtr("SizeLimit");
if (var)
sizeLimit = (uint)var->asInt();
var = cf.getVarPtr("AddUsedIcons");
if (var)
addUsedIcons = var->asBool();
var = cf.getVarPtr("AddFreeIcons");
if (var)
addFreeIcons = var->asBool();
REP_ITEM = REP_LEVEL_DESIGN + "leveldesign\\Game_elem\\items\\";
REP_MISSION = REP_LEVEL_DESIGN + "leveldesign\\Game_elem\\mission\\";
REP_SITEM = REP_LEVEL_DESIGN + "leveldesign\\game_element\\sitem\\";
REP_SBRICK = REP_LEVEL_DESIGN + "leveldesign\\game_element\\sbrick\\";
REP_DFN = REP_LEVEL_DESIGN + "leveldesign\\DFN\\";
REP_FACTION = REP_LEVEL_DESIGN + "leveldesign\\World\\factions\\";
var = cf.getVarPtr("Wildcard");
if (var)
for (uint i=0 ; i<var->size() ; i++)
for (uint it=0; it<listeIcones.size(); it++)
{
string wild = var->asString(i);
if (testWildCard(listeIcones[it], wild))
{
citations[listeIcones[it]].push_back("Matched with: " + wild);
}
}
printf( "\nProcessing Directories\n----------------------\n\n" );
// CLIENT SRC FILES
if ( searchSrcClient )
{
extensions.push_back( "cpp" );
extensions.push_back( "h" );
ProcessDirectory( REP_SRC, extensions );
}
// GUI FILES
if ( searchGui )
{
extensions.clear();
extensions.push_back( "xml" );
ProcessDirectory( REP_GUI, extensions );
}
if ( searchLevelDesign )
{
// ITEM FILES
extensions.clear();
extensions.push_back( "item" );
ProcessDirectory( REP_ITEM, extensions );
// MISSION FILES
extensions.clear();
extensions.push_back( "mission_icon" );
ProcessDirectory( REP_MISSION, extensions );
// SITEM FILES
extensions.clear();
extensions.push_back( "sitem" );
ProcessDirectory( REP_SITEM, extensions );
// SBRICK FILES
extensions.clear();
extensions.push_back( "sbrick" );
ProcessDirectory( REP_SBRICK, extensions );
// DFN FILES
extensions.clear();
extensions.push_back( "dfn" );
ProcessDirectory( REP_DFN, extensions );
// FACTION FILES
extensions.clear();
extensions.push_back( "faction" );
ProcessDirectory( REP_FACTION, extensions );
}
generateHTML("icons.html", sizeLimit);
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <nel/misc/types_nl.h>
#include <nel/misc/file.h>
#include <nel/misc/sstring.h>
#include <nel/misc/path.h>
#include <nel/misc/algo.h>
#include <nel/misc/config_file.h>
#include <nel/misc/bitmap.h>
#include <iostream>
using namespace NLMISC;
using namespace std;
CSString REP_SRC; //= "R:\\code\\ryzom\\src_v2\\client\\";
CSString REP_GUI; //= "R:\\code\\ryzom\\data\\gamedev\\interfaces_v3\\";
CSString REP_ITEM; //= "R:\\code\\ryzom\\data_leveldesign\\leveldesign\\Game_elem\\items\\";
CSString REP_MISSION; //= "R:\\code\\ryzom\\data_leveldesign\\leveldesign\\Game_elem\\mission\\";
CSString REP_SITEM; //= "R:\\code\\ryzom\\data_leveldesign\\leveldesign\\game_element\\sitem\\";
CSString REP_SBRICK; //= "R:\\code\\ryzom\\data_leveldesign\\leveldesign\\game_element\\sbrick\\";
CSString REP_DFN; //= "R:\\code\\ryzom\\data_leveldesign\\leveldesign\\DFN\\";
CSString REP_FACTION;// = "R:\\code\\ryzom\\data_leveldesign\\leveldesign\\World\\factions\\";
typedef vector<string> StringVector;
StringVector listeIcones;
map<CSString, StringVector> citations;
bool addUsedIcons = true;
bool addFreeIcons = true;
// Fill listeIcones from source directories
void findIcons(CConfigFile::CVar *var)
{
nlassert(var != NULL);
// clear vector
listeIcones.clear();
vector<string> files;
// Scan each directory
for (uint i=0 ; i<var->size() ; i++)
{
// clear files list
files.clear();
// get files list
CPath::getPathContent(CPath::standardizePath(var->asString(i)), false, false, true, files);
// Convert each file
for (uint j=0 ; j<files.size() ; j++)
{
// get filename
string iconName = CFile::getFilename(files[j]);
// store icon's name
listeIcones.push_back(iconName);
citations[iconName].push_back(iconName);
}
}
}
string remap2Jpg(const string &s)
{
// change extension from TGA to JPG
string jpg(s);
string::size_type n = jpg.find(".tga");
nlassert(n != string::npos);
jpg.erase(n);
jpg += ".jpg";
return jpg;
}
void writeString(COFile &f, const string &s)
{
f.serialBuffer((uint8*)s.c_str(), (uint)s.size());
}
void writeHTMLline(COFile &f, const string &icon, const StringVector files, uint sizeLimit)
{
// discard if needed
if ((files.size() == 1 && !addFreeIcons) || (files.size() > 1 && !addUsedIcons))
return;
// begin line
writeString(f, "<tr>");
// write icon as jpg
writeString(f, "<th><img src=\"");
writeString(f, "images\\");
writeString(f, remap2Jpg(files[0]));
writeString(f, "\"></th>");
// fix limit based on configuration file
uint n;
if (sizeLimit == 0)
n = (uint)files.size();
else
n = sizeLimit > files.size() ? (uint)files.size() : sizeLimit;
// write each file using this icon
for (uint i=0 ; i<n ; i++)
writeString(f, "<td>" + files[i] + "</td>");
// end line
writeString(f, "</tr>\n");
}
void generateHTML(const string &name, uint sizeLimit)
{
COFile f;
nlassert(f.open(name, false, true));
// write header
writeString(f, "<html>\n<head>\n<title>Nevrax - Ryzom icons</title>\n</title>\n\n<body><table border=1>\n");
// write lines
for (map<CSString, StringVector>::iterator it = citations.begin(); it != citations.end(); ++it)
{
string str = it->second[0];
writeHTMLline(f, str, it->second, sizeLimit);
}
// write end
writeString(f, "</table></body>\n</html>");
f.close();
}
void tga2Jpg(const string &tga, const string &jpg)
{
// read TGA
CIFile fTga;
CBitmap im;
nlassert(fTga.open(tga));
nlassert(im.load(fTga));
fTga.close();
// write JPG
COFile fJpg;
nlassert(fJpg.open(jpg));
nlassert(im.writeJPG(fJpg));
fJpg.close();
}
void convertImages(CConfigFile::CVar *var)
{
nlassert(var != NULL);
// store current path
string curPath = CPath::standardizePath(CPath::getCurrentPath());
// Create 'images' directory in the root folder if not present
if (!CFile::isExists("images"))
CFile::createDirectory("images");
// Scan each directory
for (uint i=0 ; i<var->size() ; i++)
{
string path = CPath::standardizePath(var->asString(i));
vector<string> files;
CPath::getPathContent(path, false, false, true, files);
// Convert each file
for (uint j=0 ; j<files.size() ; j++)
{
// get filenames
string file = CFile::getFilename(files[j]);
string src = path + file;
string dst = remap2Jpg(curPath + "images/" + file);
cout << "Copying file (" << i+1 << "/" << var->size() << " - " << j+1 << " / " << files.size() << ") : " << file << " ... ";
// Convert the file
if (!CFile::isExists(dst))
{
tga2Jpg(src, dst);
cout << " OK\n";
}
else
{
cout << "skipped\n";
}
}
}
}
bool endsWith( const CSString& s, const CSString& substring )
{
return ( s.right( (uint)substring.size() ) == substring );
}
void ProcessDirectory( const CSString& dir, const StringVector& extensions )
{
CSString data;
int nbResults = 0;
int sixieme;
vector<string> files;
printf( "%s\n", dir.c_str() );
CPath::getPathContent ( dir.c_str(), true, false, true, files );
sixieme = (int)files.size() / 6;
printf( "%u files are processed", (uint) files.size() );
for (uint32 i=0; i<files.size(); ++i)
{
bool extOK = false;
uint numExt = 0;
while ( ( !extOK ) && ( numExt < extensions.size() ) )
{
extOK = endsWith( files[i], extensions[numExt] );
numExt++;
}
if ( extOK )
{
data.readFromFile( files[i] );
// Don't parse LOG
string::size_type n = data.find("<LOG>");
if (n != CSString::npos)
data.erase(n);
data = data.toLower();
for ( uint it=0; it<listeIcones.size(); it++ )
{
if ( data.contains( CSString(listeIcones[it]).toLower().c_str() ) )
{
string fileName = CFile::getFilename( files[i] );
citations[ listeIcones[it] ].push_back( fileName );
nbResults++;
}
}
}
if ( i%sixieme == 0 )
printf( "." );
}
printf( " %d results found\n\n", nbResults );
}
int main()
{
StringVector extensions;
new CApplicationContext();
CSString REP_SRC, REP_GUI, REP_LEVEL_DESIGN;
int searchSrcClient, searchGui, searchLevelDesign;
uint sizeLimit = 5;
CConfigFile cf;
CConfigFile::CVar *var;
cf.load("icon_search.cfg");
var = cf.getVarPtr("SearchClientSrc");
nlassert(var);
searchSrcClient = var->asInt();
var = cf.getVarPtr("ClientSrcPath");
nlassert(var);
REP_SRC = var->asString();
var = cf.getVarPtr("SearchGUI");
nlassert(var);
searchGui = var->asInt();
var = cf.getVarPtr("GUIPath");
nlassert(var);
REP_GUI = var->asString();
var = cf.getVarPtr("SearchLevelDesign");
nlassert(var);
searchLevelDesign = var->asInt();
var = cf.getVarPtr("LevelDesignPath");
nlassert(var);
REP_LEVEL_DESIGN = var->asString();
var = cf.getVarPtr("IconPath");
nlassert(var);
convertImages(var);
findIcons(var);
var = cf.getVarPtr("SizeLimit");
if (var)
sizeLimit = (uint)var->asInt();
var = cf.getVarPtr("AddUsedIcons");
if (var)
addUsedIcons = var->asBool();
var = cf.getVarPtr("AddFreeIcons");
if (var)
addFreeIcons = var->asBool();
REP_ITEM = REP_LEVEL_DESIGN + "leveldesign\\Game_elem\\items\\";
REP_MISSION = REP_LEVEL_DESIGN + "leveldesign\\Game_elem\\mission\\";
REP_SITEM = REP_LEVEL_DESIGN + "leveldesign\\game_element\\sitem\\";
REP_SBRICK = REP_LEVEL_DESIGN + "leveldesign\\game_element\\sbrick\\";
REP_DFN = REP_LEVEL_DESIGN + "leveldesign\\DFN\\";
REP_FACTION = REP_LEVEL_DESIGN + "leveldesign\\World\\factions\\";
var = cf.getVarPtr("Wildcard");
if (var)
for (uint i=0 ; i<var->size() ; i++)
for (uint it=0; it<listeIcones.size(); it++)
{
string wild = var->asString(i);
if (testWildCard(listeIcones[it], wild))
{
citations[listeIcones[it]].push_back("Matched with: " + wild);
}
}
printf( "\nProcessing Directories\n----------------------\n\n" );
// CLIENT SRC FILES
if ( searchSrcClient )
{
extensions.push_back( "cpp" );
extensions.push_back( "h" );
ProcessDirectory( REP_SRC, extensions );
}
// GUI FILES
if ( searchGui )
{
extensions.clear();
extensions.push_back( "xml" );
ProcessDirectory( REP_GUI, extensions );
}
if ( searchLevelDesign )
{
// ITEM FILES
extensions.clear();
extensions.push_back( "item" );
ProcessDirectory( REP_ITEM, extensions );
// MISSION FILES
extensions.clear();
extensions.push_back( "mission_icon" );
ProcessDirectory( REP_MISSION, extensions );
// SITEM FILES
extensions.clear();
extensions.push_back( "sitem" );
ProcessDirectory( REP_SITEM, extensions );
// SBRICK FILES
extensions.clear();
extensions.push_back( "sbrick" );
ProcessDirectory( REP_SBRICK, extensions );
// DFN FILES
extensions.clear();
extensions.push_back( "dfn" );
ProcessDirectory( REP_DFN, extensions );
// FACTION FILES
extensions.clear();
extensions.push_back( "faction" );
ProcessDirectory( REP_FACTION, extensions );
}
generateHTML("icons.html", sizeLimit);
}

@ -1,257 +1,257 @@
NeL World Editor History
v0.47 : new age
Fixed: crash when deleting primitive
Fixed: crash in MOS
Fixed: infinite loop at the startup
v0.46
CHANGED : Better looking for 'search and replace' dialog box
v0.45
FIXED : collapse tree don't work.
v0.44
FIXED : ramdom crash and weird behavior of property editro dialof after a move of primitive in
the tree fdollowed by an edition of properties with ALT+enter
v0.43
CHANGED : edition node properties (hidden, selected and expanded) are all stored as XML comment
int the primitive files. This allow more efficient comparison of real content in
primitive files.
v0.42
FIXED : when reloading a primitive, the tree view is correctly updated.
FIXED : since new stable alias system, WE crash when relading an externaly modified primitive.
v0.41
ADDED : In property dialog, if closing or changing primitive selection without commiting the
changed property, the application will warn the user and propose to save
or discard it's modification.
ADDED : Keyboard control of the tree view while editing in property dialog.
Just press ALT and arrows keys to change the selection in the tree view.
v0.40
CHANGED : reworked 'properties' dialog, now support keyboard shurtcuts to update/cancel
or validate the dialog.
The dialog also support 'tab' to move between controls
ADDED : plugin interface to replace the standard primitive drawing code. Each plugin
can claim to be called to draw a liste of primitive types.
v0.39
FIXED : Multiple primitive file open dialog work with more than a few primitives selected.
v0.38
FIXED : load, save edit unicode primitives.
v0.37
FIXED : multiple assert when error detected in the tree structure
v0.36
ADDED : copy / paste in new combo boxes
v0.35
FIXED : Const string keybord selection work fine now
v0.34
FIXED : Select by category is no more case sensitive
FIXED : Can't move root tree nodes anymore. "nouveau projet, ajouter au moins deux landscapes, essayer de changer leur ordre en faisant ctrl + flèche, kaboum rq : pas la peine de spécifier les settings, suffit qu'il y ait deux lands, ça marche aussi avec des primitves, visiblement avec tous les trucs root."
FIXED : Log are flooded using "primitive configurations"
FIXED : "lorsque l'on copie-colle une instance, la première ainsi collée porte le même nom que l'original alors que toutes les autres après ont un numéro bien incrémenté."
FIXED : Copy works when several primitives are selected
ADDED : Button to show / hide collision
ADDED : Meter point grid
FIXED : Properties window get larger when JC's scrollbar is used
ADDED : JC's scrollbar track message handled
ADDED : JC's scrollbar works with the mouse wheel
v0.33
ADDED : Display PACS surfaces, just copy PACS .lr, .rbank and .gr in your "data directory"/pacs.
v0.32
CHANGED : Can read binary and xml .land files
v0.31
FIXED : error and continue when loading prb
v0.30
FIXED : Renommer le fichier après la sauvegarde
FIXED : charge tout de meme le continent, meme si une transition utilise des matériels inconnus.
v0.29
FIXED : Values in const_string_array was always by default.
FIXED : Default values in const_string_array work now.
CHANGED : Autoname for string_array and const_string_array copy all the content of the array and not only the first line.
v0.28
ADDED : ALT + LEFT click to drag the view
FIXED : Si selectionne une primitive dans l'arbre (zone, point ou path), tu fait 'locate' et zoom arriere et paf, ca plante.
FIXED : Peut pas charger 2 .land
FIXED : Lorsque l'on efface des zones dans un .land, la boite englobante du continent est recalculée.
FIXED : Salut on crash le world editor des que l'on zoom peux tu voir ca please merci !
FIXED : Le bouton View à droite des boites const_string_array crashe. Maintenant il fonctionne.
FIXED : On ne peut pas ajouter autant d'éléments qu'on veut dans un const_string_array car la boite n'a pas d'ascenseur. On peut ajouter des lignes avec "INSERT".
KNOWN BUG : Crash when paint several continent at a time : ask Trap
v0.27
ADDED : Primitive configuration check strings in array too
ADDED : Const string array (new property type, TYPE="const_string_array")
ADDED : Zoom on cursor
ADDED : Option to not add number when copy
FIXED : Copy / paste of generated primitives allowed (for ex: .prim children of a .flora_zone)
FIXED : A right click when draging an object followed by a left click lead to an assert. Now a right click cancel the action.
FIXED : Zoom with left click + shift
FIXED : Crash when UNDO/REDO a copy of a primitive with unique ID parameters
v0.26
FIXED : some bug fixed in configurations selection
ADDED : configurations popup menu with SHOW / HIDE / SELECT options
v0.25
ADDED : primitive configurations
v0.24
ADDED : create a new landscape
FIXED : crash when paint a larger landscape
ADDED : export continent snapshot
v0.23
ADDED : shard monitor plugin for the world editor
v0.22
FIXED : autorename rework with the new default value system
REMARK : auto rename is not working for the moment. You can replace it by set an empty name string in the primitive you want to rename
v0.21
FIXED : multi properties edition fixed
v0.20
CHANGED : edit string array with a multi line text window
v0.19
FIXED : error structure fixed (the node with the error is now marked with the error icon too)
CHANGED : some shortcuts are available in the properties dialog (help, new, open etc..)
CHANGED : ligo use a class primitive xml to get the default value in the application reading primitive files
CHANGED : set node that doesn't exist or are empty to default
FIXED : checkbox default value fixed
ADDED : add a history file
ADDED : show collisions in world editor
v0.18
CHANGED : 3 states choeck box for default value
CHANGED : empty string stand for default value
v0.17
FIXED : Edit string array
ADDED : Search the primitives matching a property value (CTRL+F)
v0.16
ADDED : Dialog non modale
ADDED : Find items in the tree
FIXED : Debug plant on path
ADDED : Reset unique id function
FIXED : Copy / paste -> unique id updated
v0.15
FIXED : select update tree bug
FIXED : expand / collapse update tree bug
FIXED : bigger primitive name
FIXED : "new_" removed
v0.14
FIXED : Bug ctrl + flèches dans l'arbre
ADDED : Initialise default value for hidden values
ADDED : Draw arrow in path
FIXED : Modify the document when initialise default values
FIXED : Ligozone name not cropped anymore
v0.13
CHANGED : The dialog property is always dispayed, even if it is too large.
CHANGED : Empty unique ID properties are initialised when a primitive file is loaded. A message box warn you when properties has been
initialised.
For the moment, i initialise default values ONLY for properties with unique id. I'm afraid to loose information if i initialise all
the empty properties with their default values.
v0.12
FIXED : Delete primitives and the root lead to a crash
FIXED : Delete a sub primitive and undo -> refresh prb
NOTABUG : Select by position bug
FIXED : Click-select and drag bug
ADDED : Default parameter value can be a unique number
Pour initialiser une propriété d'une primitive avec un identifiant "unique", ajoutez la ligne
<DEFAULT_VALUE GEN_ID="true"/> dans le noeud XML de la propriété en question.
v0.11
ADDED : Select primitive by location
ADDED : Locate selected primitives
FIXED : Refresh bug when rename a primitive
FIXED : Crash when try to delete a non deletable primitve then delete all the primitive
FIXED : Crash when delete multiple vertices in sub object
v0.10
FIXED : Select foire un peu..
FIXED : AddPrimitive crash
v0.7
FIXED : Vegetation
FIXED : Combo parameters can be a list of filename get per extension in a directory context dependent
FIXED : Generate function over a zone or a path primitive
FIXED : Load zones overlapped by generator primitives
FIXED : Test collision with others primitives of class .plant and their radius
FIXED : Radius
FIXED : Mini documentation
FIXED : Relative pathes in .worldeditor
v0.3
CHANGED : Script updaté
CHANGED : Link des points d'un group_fauna
CHANGED : Copier / couper / coller de primitive
CHANGED : Menu click droit plus intelligent
CHANGED : Icone du programme
CHANGED : On ne peut plus effacer les primitives "crées en dure"
CHANGED : Pleins de bugs en moins
CHANGED : Y'avait d'autre truc mais je ne me rappel pas de tout.. :)
NeL World Editor History
v0.47 : new age
Fixed: crash when deleting primitive
Fixed: crash in MOS
Fixed: infinite loop at the startup
v0.46
CHANGED : Better looking for 'search and replace' dialog box
v0.45
FIXED : collapse tree don't work.
v0.44
FIXED : ramdom crash and weird behavior of property editro dialof after a move of primitive in
the tree fdollowed by an edition of properties with ALT+enter
v0.43
CHANGED : edition node properties (hidden, selected and expanded) are all stored as XML comment
int the primitive files. This allow more efficient comparison of real content in
primitive files.
v0.42
FIXED : when reloading a primitive, the tree view is correctly updated.
FIXED : since new stable alias system, WE crash when relading an externaly modified primitive.
v0.41
ADDED : In property dialog, if closing or changing primitive selection without commiting the
changed property, the application will warn the user and propose to save
or discard it's modification.
ADDED : Keyboard control of the tree view while editing in property dialog.
Just press ALT and arrows keys to change the selection in the tree view.
v0.40
CHANGED : reworked 'properties' dialog, now support keyboard shurtcuts to update/cancel
or validate the dialog.
The dialog also support 'tab' to move between controls
ADDED : plugin interface to replace the standard primitive drawing code. Each plugin
can claim to be called to draw a liste of primitive types.
v0.39
FIXED : Multiple primitive file open dialog work with more than a few primitives selected.
v0.38
FIXED : load, save edit unicode primitives.
v0.37
FIXED : multiple assert when error detected in the tree structure
v0.36
ADDED : copy / paste in new combo boxes
v0.35
FIXED : Const string keybord selection work fine now
v0.34
FIXED : Select by category is no more case sensitive
FIXED : Can't move root tree nodes anymore. "nouveau projet, ajouter au moins deux landscapes, essayer de changer leur ordre en faisant ctrl + flèche, kaboum rq : pas la peine de spécifier les settings, suffit qu'il y ait deux lands, ça marche aussi avec des primitves, visiblement avec tous les trucs root."
FIXED : Log are flooded using "primitive configurations"
FIXED : "lorsque l'on copie-colle une instance, la première ainsi collée porte le même nom que l'original alors que toutes les autres après ont un numéro bien incrémenté."
FIXED : Copy works when several primitives are selected
ADDED : Button to show / hide collision
ADDED : Meter point grid
FIXED : Properties window get larger when JC's scrollbar is used
ADDED : JC's scrollbar track message handled
ADDED : JC's scrollbar works with the mouse wheel
v0.33
ADDED : Display PACS surfaces, just copy PACS .lr, .rbank and .gr in your "data directory"/pacs.
v0.32
CHANGED : Can read binary and xml .land files
v0.31
FIXED : error and continue when loading prb
v0.30
FIXED : Renommer le fichier après la sauvegarde
FIXED : charge tout de meme le continent, meme si une transition utilise des matériels inconnus.
v0.29
FIXED : Values in const_string_array was always by default.
FIXED : Default values in const_string_array work now.
CHANGED : Autoname for string_array and const_string_array copy all the content of the array and not only the first line.
v0.28
ADDED : ALT + LEFT click to drag the view
FIXED : Si selectionne une primitive dans l'arbre (zone, point ou path), tu fait 'locate' et zoom arriere et paf, ca plante.
FIXED : Peut pas charger 2 .land
FIXED : Lorsque l'on efface des zones dans un .land, la boite englobante du continent est recalculée.
FIXED : Salut on crash le world editor des que l'on zoom peux tu voir ca please merci !
FIXED : Le bouton View à droite des boites const_string_array crashe. Maintenant il fonctionne.
FIXED : On ne peut pas ajouter autant d'éléments qu'on veut dans un const_string_array car la boite n'a pas d'ascenseur. On peut ajouter des lignes avec "INSERT".
KNOWN BUG : Crash when paint several continent at a time : ask Trap
v0.27
ADDED : Primitive configuration check strings in array too
ADDED : Const string array (new property type, TYPE="const_string_array")
ADDED : Zoom on cursor
ADDED : Option to not add number when copy
FIXED : Copy / paste of generated primitives allowed (for ex: .prim children of a .flora_zone)
FIXED : A right click when draging an object followed by a left click lead to an assert. Now a right click cancel the action.
FIXED : Zoom with left click + shift
FIXED : Crash when UNDO/REDO a copy of a primitive with unique ID parameters
v0.26
FIXED : some bug fixed in configurations selection
ADDED : configurations popup menu with SHOW / HIDE / SELECT options
v0.25
ADDED : primitive configurations
v0.24
ADDED : create a new landscape
FIXED : crash when paint a larger landscape
ADDED : export continent snapshot
v0.23
ADDED : shard monitor plugin for the world editor
v0.22
FIXED : autorename rework with the new default value system
REMARK : auto rename is not working for the moment. You can replace it by set an empty name string in the primitive you want to rename
v0.21
FIXED : multi properties edition fixed
v0.20
CHANGED : edit string array with a multi line text window
v0.19
FIXED : error structure fixed (the node with the error is now marked with the error icon too)
CHANGED : some shortcuts are available in the properties dialog (help, new, open etc..)
CHANGED : ligo use a class primitive xml to get the default value in the application reading primitive files
CHANGED : set node that doesn't exist or are empty to default
FIXED : checkbox default value fixed
ADDED : add a history file
ADDED : show collisions in world editor
v0.18
CHANGED : 3 states choeck box for default value
CHANGED : empty string stand for default value
v0.17
FIXED : Edit string array
ADDED : Search the primitives matching a property value (CTRL+F)
v0.16
ADDED : Dialog non modale
ADDED : Find items in the tree
FIXED : Debug plant on path
ADDED : Reset unique id function
FIXED : Copy / paste -> unique id updated
v0.15
FIXED : select update tree bug
FIXED : expand / collapse update tree bug
FIXED : bigger primitive name
FIXED : "new_" removed
v0.14
FIXED : Bug ctrl + flèches dans l'arbre
ADDED : Initialise default value for hidden values
ADDED : Draw arrow in path
FIXED : Modify the document when initialise default values
FIXED : Ligozone name not cropped anymore
v0.13
CHANGED : The dialog property is always dispayed, even if it is too large.
CHANGED : Empty unique ID properties are initialised when a primitive file is loaded. A message box warn you when properties has been
initialised.
For the moment, i initialise default values ONLY for properties with unique id. I'm afraid to loose information if i initialise all
the empty properties with their default values.
v0.12
FIXED : Delete primitives and the root lead to a crash
FIXED : Delete a sub primitive and undo -> refresh prb
NOTABUG : Select by position bug
FIXED : Click-select and drag bug
ADDED : Default parameter value can be a unique number
Pour initialiser une propriété d'une primitive avec un identifiant "unique", ajoutez la ligne
<DEFAULT_VALUE GEN_ID="true"/> dans le noeud XML de la propriété en question.
v0.11
ADDED : Select primitive by location
ADDED : Locate selected primitives
FIXED : Refresh bug when rename a primitive
FIXED : Crash when try to delete a non deletable primitve then delete all the primitive
FIXED : Crash when delete multiple vertices in sub object
v0.10
FIXED : Select foire un peu..
FIXED : AddPrimitive crash
v0.7
FIXED : Vegetation
FIXED : Combo parameters can be a list of filename get per extension in a directory context dependent
FIXED : Generate function over a zone or a path primitive
FIXED : Load zones overlapped by generator primitives
FIXED : Test collision with others primitives of class .plant and their radius
FIXED : Radius
FIXED : Mini documentation
FIXED : Relative pathes in .worldeditor
v0.3
CHANGED : Script updaté
CHANGED : Link des points d'un group_fauna
CHANGED : Copier / couper / coller de primitive
CHANGED : Menu click droit plus intelligent
CHANGED : Icone du programme
CHANGED : On ne peut plus effacer les primitives "crées en dure"
CHANGED : Pleins de bugs en moins
CHANGED : Y'avait d'autre truc mais je ne me rappel pas de tout.. :)

@ -1,19 +1,19 @@
<?xml version="1.0"?>
<NEL_WORLD_EDITOR_CONFIG>
<!-- **** CONFIG FOR RYZOM **** -->
<!-- Search pathes -->
<SEARCH_PATH PATH="l:/leveldesign/world_editor_files"/>
<SEARCH_PATH PATH="l:/primitives/" NO_RECURSE="true"/>
<SEARCH_PATH PATH="l:/leveldesign/game_elem/creature"/>
<SEARCH_PATH PATH="l:/leveldesign/game_elem/plant"/>
<SEARCH_PATH PATH="l:/leveldesign/game_elem/items/harvest/"/>
<SEARCH_PATH PATH="l:/leveldesign/dfn"/>
<SEARCH_PATH PATH="l:/leveldesign/game_elem/mission/"/>
<SEARCH_PATH PATH="continents"/>
<!-- Html help file for node class -->
<DOC_PATH PATH="l:/leveldesign/world_editor_files/class_doc"/>
</NEL_WORLD_EDITOR_CONFIG>
<?xml version="1.0"?>
<NEL_WORLD_EDITOR_CONFIG>
<!-- **** CONFIG FOR RYZOM **** -->
<!-- Search pathes -->
<SEARCH_PATH PATH="l:/leveldesign/world_editor_files"/>
<SEARCH_PATH PATH="l:/primitives/" NO_RECURSE="true"/>
<SEARCH_PATH PATH="l:/leveldesign/game_elem/creature"/>
<SEARCH_PATH PATH="l:/leveldesign/game_elem/plant"/>
<SEARCH_PATH PATH="l:/leveldesign/game_elem/items/harvest/"/>
<SEARCH_PATH PATH="l:/leveldesign/dfn"/>
<SEARCH_PATH PATH="l:/leveldesign/game_elem/mission/"/>
<SEARCH_PATH PATH="continents"/>
<!-- Html help file for node class -->
<DOC_PATH PATH="l:/leveldesign/world_editor_files/class_doc"/>
</NEL_WORLD_EDITOR_CONFIG>

@ -1,118 +1,118 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// ChooseDir.cpp : implementation file
//
#include "nel/misc/types_nl.h"
#include "stdafx.h"
#include "master.h"
#include "ChooseDir.h"
using namespace std;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChooseDir dialog
CChooseDir::CChooseDir(CWnd* pParent /*=NULL*/)
: CDialog(CChooseDir::IDD, pParent)
{
//{{AFX_DATA_INIT(CChooseDir)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
// ---------------------------------------------------------------------------
void CChooseDir::setPath (const string &path)
{
_Path = path;
_Sel = 0;
}
// ---------------------------------------------------------------------------
BOOL CChooseDir::OnInitDialog ()
{
WIN32_FIND_DATA findData;
HANDLE hFind;
CListBox *pLB = (CListBox*)GetDlgItem(IDC_LIST);
SetCurrentDirectory (_Path.c_str());
hFind = FindFirstFile ("*.*", &findData);
while (hFind != INVALID_HANDLE_VALUE)
{
if ((stricmp (findData.cFileName, ".") != 0) && (stricmp (findData.cFileName, "..") != 0))
{
if (findData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
{
pLB->InsertString (-1, findData.cFileName);
string tmp = findData.cFileName;
_Names.push_back (tmp);
}
}
if (FindNextFile (hFind, &findData) == 0)
break;
}
FindClose (hFind);
return true;
}
// ---------------------------------------------------------------------------
const char *CChooseDir::getSelected ()
{
if (_Names.size() == 0)
return NULL;
if (_Sel == LB_ERR)
return _Names[0].c_str();
else
return _Names[_Sel].c_str();
}
// ---------------------------------------------------------------------------
void CChooseDir::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CChooseDir)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CChooseDir, CDialog)
//{{AFX_MSG_MAP(CChooseDir)
ON_LBN_SELCHANGE(IDC_LIST, OnSelChangeList)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChooseDir message handlers
void CChooseDir::OnSelChangeList()
{
// TODO: Add your control notification handler code here
CListBox *pLB = (CListBox*)GetDlgItem(IDC_LIST);
_Sel = pLB->GetCurSel();
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// ChooseDir.cpp : implementation file
//
#include "nel/misc/types_nl.h"
#include "stdafx.h"
#include "master.h"
#include "ChooseDir.h"
using namespace std;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChooseDir dialog
CChooseDir::CChooseDir(CWnd* pParent /*=NULL*/)
: CDialog(CChooseDir::IDD, pParent)
{
//{{AFX_DATA_INIT(CChooseDir)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
// ---------------------------------------------------------------------------
void CChooseDir::setPath (const string &path)
{
_Path = path;
_Sel = 0;
}
// ---------------------------------------------------------------------------
BOOL CChooseDir::OnInitDialog ()
{
WIN32_FIND_DATA findData;
HANDLE hFind;
CListBox *pLB = (CListBox*)GetDlgItem(IDC_LIST);
SetCurrentDirectory (_Path.c_str());
hFind = FindFirstFile ("*.*", &findData);
while (hFind != INVALID_HANDLE_VALUE)
{
if ((stricmp (findData.cFileName, ".") != 0) && (stricmp (findData.cFileName, "..") != 0))
{
if (findData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
{
pLB->InsertString (-1, findData.cFileName);
string tmp = findData.cFileName;
_Names.push_back (tmp);
}
}
if (FindNextFile (hFind, &findData) == 0)
break;
}
FindClose (hFind);
return true;
}
// ---------------------------------------------------------------------------
const char *CChooseDir::getSelected ()
{
if (_Names.size() == 0)
return NULL;
if (_Sel == LB_ERR)
return _Names[0].c_str();
else
return _Names[_Sel].c_str();
}
// ---------------------------------------------------------------------------
void CChooseDir::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CChooseDir)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CChooseDir, CDialog)
//{{AFX_MSG_MAP(CChooseDir)
ON_LBN_SELCHANGE(IDC_LIST, OnSelChangeList)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChooseDir message handlers
void CChooseDir::OnSelChangeList()
{
// TODO: Add your control notification handler code here
CListBox *pLB = (CListBox*)GetDlgItem(IDC_LIST);
_Sel = pLB->GetCurSel();
}

@ -1,73 +1,73 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_CHOOSEDIR_H__51164D9B_33B9_488B_AA09_75F2EF07A48A__INCLUDED_)
#define AFX_CHOOSEDIR_H__51164D9B_33B9_488B_AA09_75F2EF07A48A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ChooseDir.h : header file
//
#include <string>
#include <vector>
/////////////////////////////////////////////////////////////////////////////
// CChooseDir dialog
class CChooseDir : public CDialog
{
std::string _Path;
std::vector<std::string> _Names;
int _Sel;
// Construction
public:
CChooseDir(CWnd* pParent = NULL); // standard constructor
void setPath (const std::string &path);
const char *getSelected ();
// Dialog Data
//{{AFX_DATA(CChooseDir)
enum { IDD = IDD_CHOOSEDIR };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
BOOL OnInitDialog ();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChooseDir)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CChooseDir)
afx_msg void OnSelChangeList();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CHOOSEDIR_H__51164D9B_33B9_488B_AA09_75F2EF07A48A__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_CHOOSEDIR_H__51164D9B_33B9_488B_AA09_75F2EF07A48A__INCLUDED_)
#define AFX_CHOOSEDIR_H__51164D9B_33B9_488B_AA09_75F2EF07A48A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ChooseDir.h : header file
//
#include <string>
#include <vector>
/////////////////////////////////////////////////////////////////////////////
// CChooseDir dialog
class CChooseDir : public CDialog
{
std::string _Path;
std::vector<std::string> _Names;
int _Sel;
// Construction
public:
CChooseDir(CWnd* pParent = NULL); // standard constructor
void setPath (const std::string &path);
const char *getSelected ();
// Dialog Data
//{{AFX_DATA(CChooseDir)
enum { IDD = IDD_CHOOSEDIR };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
BOOL OnInitDialog ();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChooseDir)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CChooseDir)
afx_msg void OnSelChangeList();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CHOOSEDIR_H__51164D9B_33B9_488B_AA09_75F2EF07A48A__INCLUDED_)

@ -1,140 +1,140 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// ChooseTag.cpp : implementation file
//
#include "nel/misc/types_nl.h"
#include "stdafx.h"
#include "master.h"
#include "ChooseTag.h"
#include <set>
using namespace std;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChooseTag dialog
// ---------------------------------------------------------------------------
CChooseTag::CChooseTag (CWnd* pParent /*=NULL*/)
: CDialog(CChooseTag::IDD, pParent)
{
//{{AFX_DATA_INIT(CChooseTag)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
// ---------------------------------------------------------------------------
void CChooseTag::setPath (const string &path)
{
_Path = path;
_Sel = 0;
}
// ---------------------------------------------------------------------------
BOOL CChooseTag::OnInitDialog ()
{
WIN32_FIND_DATA findData;
HANDLE hFind;
CListBox *pLB = (CListBox*)GetDlgItem(IDC_LIST);
set<string> allTags;
SetCurrentDirectory (_Path.c_str());
hFind = FindFirstFile ("*.*", &findData);
while (hFind != INVALID_HANDLE_VALUE)
{
if ((stricmp (findData.cFileName, ".") != 0) && (stricmp (findData.cFileName, "..") != 0))
{
if (findData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
{
// Get the tag if any
if (findData.cFileName[0] == '_')
{
string tmp;
int i = 1;
while (findData.cFileName[i] != '_')
{
tmp += findData.cFileName[i];
++i;
}
if (allTags.find(tmp) == allTags.end())
{
allTags.insert (tmp);
pLB->InsertString (-1, tmp.c_str());
tmp = "_" + tmp + "_";
_Names.push_back (tmp);
}
}
}
}
if (FindNextFile (hFind, &findData) == 0)
break;
}
FindClose (hFind);
return true;
}
// ---------------------------------------------------------------------------
const char *CChooseTag::getSelected ()
{
if (_Names.size() == 0)
return NULL;
if (_Sel == LB_ERR)
return _Names[0].c_str();
else
return _Names[_Sel].c_str();
}
// ---------------------------------------------------------------------------
void CChooseTag::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CChooseTag)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CChooseTag, CDialog)
//{{AFX_MSG_MAP(CChooseTag)
ON_LBN_SELCHANGE(IDC_LIST, OnSelchangeList)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChooseTag message handlers
void CChooseTag::OnSelchangeList()
{
// TODO: Add your control notification handler code here
CListBox *pLB = (CListBox*)GetDlgItem(IDC_LIST);
_Sel = pLB->GetCurSel();
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// ChooseTag.cpp : implementation file
//
#include "nel/misc/types_nl.h"
#include "stdafx.h"
#include "master.h"
#include "ChooseTag.h"
#include <set>
using namespace std;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChooseTag dialog
// ---------------------------------------------------------------------------
CChooseTag::CChooseTag (CWnd* pParent /*=NULL*/)
: CDialog(CChooseTag::IDD, pParent)
{
//{{AFX_DATA_INIT(CChooseTag)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
// ---------------------------------------------------------------------------
void CChooseTag::setPath (const string &path)
{
_Path = path;
_Sel = 0;
}
// ---------------------------------------------------------------------------
BOOL CChooseTag::OnInitDialog ()
{
WIN32_FIND_DATA findData;
HANDLE hFind;
CListBox *pLB = (CListBox*)GetDlgItem(IDC_LIST);
set<string> allTags;
SetCurrentDirectory (_Path.c_str());
hFind = FindFirstFile ("*.*", &findData);
while (hFind != INVALID_HANDLE_VALUE)
{
if ((stricmp (findData.cFileName, ".") != 0) && (stricmp (findData.cFileName, "..") != 0))
{
if (findData.dwFileAttributes&FILE_ATTRIBUTE_DIRECTORY)
{
// Get the tag if any
if (findData.cFileName[0] == '_')
{
string tmp;
int i = 1;
while (findData.cFileName[i] != '_')
{
tmp += findData.cFileName[i];
++i;
}
if (allTags.find(tmp) == allTags.end())
{
allTags.insert (tmp);
pLB->InsertString (-1, tmp.c_str());
tmp = "_" + tmp + "_";
_Names.push_back (tmp);
}
}
}
}
if (FindNextFile (hFind, &findData) == 0)
break;
}
FindClose (hFind);
return true;
}
// ---------------------------------------------------------------------------
const char *CChooseTag::getSelected ()
{
if (_Names.size() == 0)
return NULL;
if (_Sel == LB_ERR)
return _Names[0].c_str();
else
return _Names[_Sel].c_str();
}
// ---------------------------------------------------------------------------
void CChooseTag::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CChooseTag)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CChooseTag, CDialog)
//{{AFX_MSG_MAP(CChooseTag)
ON_LBN_SELCHANGE(IDC_LIST, OnSelchangeList)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChooseTag message handlers
void CChooseTag::OnSelchangeList()
{
// TODO: Add your control notification handler code here
CListBox *pLB = (CListBox*)GetDlgItem(IDC_LIST);
_Sel = pLB->GetCurSel();
}

@ -1,71 +1,71 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_CHOOSETAG_H__4185965E_4D29_491F_8601_7B29BBF28328__INCLUDED_)
#define AFX_CHOOSETAG_H__4185965E_4D29_491F_8601_7B29BBF28328__INCLUDED_
#include <string>
#include <vector>
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ChooseTag.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CChooseTag dialog
class CChooseTag : public CDialog
{
std::string _Path;
std::vector<std::string> _Names;
int _Sel;
// Construction
public:
CChooseTag (CWnd* pParent = NULL); // standard constructor
void setPath (const std::string &path);
const char *getSelected ();
// Dialog Data
//{{AFX_DATA(CChooseTag)
enum { IDD = IDD_CHOOSETAG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
BOOL OnInitDialog ();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChooseTag)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CChooseTag)
afx_msg void OnSelchangeList();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CHOOSETAG_H__4185965E_4D29_491F_8601_7B29BBF28328__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_CHOOSETAG_H__4185965E_4D29_491F_8601_7B29BBF28328__INCLUDED_)
#define AFX_CHOOSETAG_H__4185965E_4D29_491F_8601_7B29BBF28328__INCLUDED_
#include <string>
#include <vector>
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ChooseTag.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CChooseTag dialog
class CChooseTag : public CDialog
{
std::string _Path;
std::vector<std::string> _Names;
int _Sel;
// Construction
public:
CChooseTag (CWnd* pParent = NULL); // standard constructor
void setPath (const std::string &path);
const char *getSelected ();
// Dialog Data
//{{AFX_DATA(CChooseTag)
enum { IDD = IDD_CHOOSETAG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
BOOL OnInitDialog ();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChooseTag)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CChooseTag)
afx_msg void OnSelchangeList();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CHOOSETAG_H__4185965E_4D29_491F_8601_7B29BBF28328__INCLUDED_)

@ -1,72 +1,72 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
#include "ContinentCfg.h"
#include "nel/misc/config_file.h"
using namespace NLMISC;
using namespace std;
// ---------------------------------------------------------------------------
SContinentCfg::SContinentCfg ()
{
}
// ---------------------------------------------------------------------------
bool SContinentCfg::load (const string &filename)
{
if (!openRead(filename))
return false;
LandFile = getStr ("LandFile");
LandDir = getStr ("LandDir");
DfnDir = getStr ("DfnDir");
GameElemDir = getStr ("GameElemDir");
LandBankFile = getStr ("LandBankFile");
LandFarBankFile = getStr ("LandFarBankFile");
LandTileNoiseDir = getStr ("LandTileNoiseDir");
LandZoneWDir = getStr ("LandZoneWDir");
OutIGDir = getStr ("OutIGDir");
close();
return true;
}
// ---------------------------------------------------------------------------
bool SContinentCfg::save (const string &filename)
{
if (!openWrite(filename))
return false;
putCommentLine ("-------------");
putCommentLine ("Continent Cfg");
putCommentLine ("-------------");
putStr ("LandFile", LandFile);
putStr ("LandDir", LandDir);
putStr ("DfnDir", DfnDir);
putStr ("GameElemDir", GameElemDir);
putStr ("LandBankFile", LandBankFile);
putStr ("LandFarBankFile", LandFarBankFile);
putStr ("LandTileNoiseDir", LandTileNoiseDir);
putStr ("LandZoneWDir", LandZoneWDir);
putStr ("OutIGDir", OutIGDir);
close ();
return true;
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
#include "ContinentCfg.h"
#include "nel/misc/config_file.h"
using namespace NLMISC;
using namespace std;
// ---------------------------------------------------------------------------
SContinentCfg::SContinentCfg ()
{
}
// ---------------------------------------------------------------------------
bool SContinentCfg::load (const string &filename)
{
if (!openRead(filename))
return false;
LandFile = getStr ("LandFile");
LandDir = getStr ("LandDir");
DfnDir = getStr ("DfnDir");
GameElemDir = getStr ("GameElemDir");
LandBankFile = getStr ("LandBankFile");
LandFarBankFile = getStr ("LandFarBankFile");
LandTileNoiseDir = getStr ("LandTileNoiseDir");
LandZoneWDir = getStr ("LandZoneWDir");
OutIGDir = getStr ("OutIGDir");
close();
return true;
}
// ---------------------------------------------------------------------------
bool SContinentCfg::save (const string &filename)
{
if (!openWrite(filename))
return false;
putCommentLine ("-------------");
putCommentLine ("Continent Cfg");
putCommentLine ("-------------");
putStr ("LandFile", LandFile);
putStr ("LandDir", LandDir);
putStr ("DfnDir", DfnDir);
putStr ("GameElemDir", GameElemDir);
putStr ("LandBankFile", LandBankFile);
putStr ("LandFarBankFile", LandFarBankFile);
putStr ("LandTileNoiseDir", LandTileNoiseDir);
putStr ("LandZoneWDir", LandZoneWDir);
putStr ("OutIGDir", OutIGDir);
close ();
return true;
}

@ -1,49 +1,49 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef LD_CONTINENTCFG_H
#define LD_CONTINENTCFG_H
// ---------------------------------------------------------------------------
#include <string>
#include "easy_cfg.h"
// ---------------------------------------------------------------------------
struct SContinentCfg : public IEasyCFG
{
std::string LandFile; // The .land file
std::string LandDir; // Directory where the zoneLigos and zoneBitmaps are (used for the .land)
std::string DfnDir; // Directory where to get georges dfn
std::string GameElemDir; // Directory where to get georges file (pipoti.plant)
std::string LandBankFile; // .smallbank
std::string LandFarBankFile; // .farbank
std::string LandTileNoiseDir; // displace
std::string LandZoneWDir; // .zoneW
std::string OutIGDir; // Where to put ig
// =======================================================================
SContinentCfg ();
bool load (const std::string &filename);
bool save (const std::string &filename);
};
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef LD_CONTINENTCFG_H
#define LD_CONTINENTCFG_H
// ---------------------------------------------------------------------------
#include <string>
#include "easy_cfg.h"
// ---------------------------------------------------------------------------
struct SContinentCfg : public IEasyCFG
{
std::string LandFile; // The .land file
std::string LandDir; // Directory where the zoneLigos and zoneBitmaps are (used for the .land)
std::string DfnDir; // Directory where to get georges dfn
std::string GameElemDir; // Directory where to get georges file (pipoti.plant)
std::string LandBankFile; // .smallbank
std::string LandFarBankFile; // .farbank
std::string LandTileNoiseDir; // displace
std::string LandZoneWDir; // .zoneW
std::string OutIGDir; // Where to put ig
// =======================================================================
SContinentCfg ();
bool load (const std::string &filename);
bool save (const std::string &filename);
};
#endif // LD_CONTINENTCFG_H

@ -1,365 +1,365 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// ContinentPropertiesDlg.cpp : implementation file
//
#include "stdafx.h"
#include "master.h"
#include "ContinentPropertiesDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
CContinentPropertiesDlg::CContinentPropertiesDlg (CWnd* pParent /*=NULL*/)
: CDialog(CContinentPropertiesDlg::IDD, pParent)
{
ContinentName = _T("");
LandFile = _T("");
LandDir = _T("");
LandBankFile = _T("");
LandFarBankFile = _T("");
LandTileNoiseDir = _T("");
LandZoneWDir = _T("");
OutIGDir = _T("");
DfnDir = _T("");
GameElemDir = _T("");
}
void CContinentPropertiesDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT_CONTINENT_NAME, ContinentName);
DDX_Text(pDX, IDC_EDIT_LANDFILE, LandFile);
DDX_Text(pDX, IDC_EDIT_LANDDIR, LandDir);
DDX_Text(pDX, IDC_LAND_BANK_FILE, LandBankFile);
DDX_Text(pDX, IDC_LAND_FAR_BANK_FILE, LandFarBankFile);
DDX_Text(pDX, IDC_LAND_TILE_NOISE_DIR, LandTileNoiseDir);
DDX_Text(pDX, IDC_OUT_LANDSCAPE_DIR, LandZoneWDir);
DDX_Text(pDX, IDC_OUT_VEGETABLE_DIR, OutIGDir);
DDX_Text(pDX, IDC_EDIT_DFNDIR, DfnDir);
DDX_Text(pDX, IDC_EDIT_GAMEELEMDIR, GameElemDir);
}
BEGIN_MESSAGE_MAP(CContinentPropertiesDlg, CDialog)
ON_COMMAND(IDC_BUTTON_LANDFILE, OnButtonLandFile)
ON_COMMAND(IDC_BUTTON_LANDDIR, OnButtonLandDir)
ON_COMMAND(IDC_EXPLORE_LAND_BANK_FILE, OnButtonLandBankFile)
ON_COMMAND(IDC_EXPLORE_LAND_FAR_BANK_FILE, OnButtonLandFarBankFile)
ON_COMMAND(IDC_EXPLORE_LAND_TILE_NOISE_DIR, OnButtonLandTileNoiseDir)
ON_COMMAND(IDC_EXPLORE_LANDSCAPE, OnButtonLandZoneW)
ON_COMMAND(IDC_EXPLORE_VEGETABLE, OnButtonOutIGDir)
ON_COMMAND(IDC_BUTTON_DFNDIR, OnButtonDfnDir)
ON_COMMAND(IDC_BUTTON_GAMEELEMDIR, OnButtonGameElemDir)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
BOOL CContinentPropertiesDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
GetDlgItem(IDC_EDIT_CONTINENT_NAME)->SetFocus();
UpdateData (FALSE); // Upload
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
// ---------------------------------------------------------------------------
// This function serve to initiate the browsing dialog box to the good position in the tree
int CALLBACK cpdBrowseCallbackProc (HWND hwnd,UINT uMsg,LPARAM lp, LPARAM pData)
{
switch(uMsg)
{
case BFFM_INITIALIZED:
SendMessage (hwnd, BFFM_SETSELECTION, TRUE, pData);
break;
default:
break;
}
return 0;
}
// ---------------------------------------------------------------------------
void CContinentPropertiesDlg::OnButtonLandFile ()
{
CFileDialog dialog (true, "land", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "Land (*.land)|*.land", this);
CString iniDir;
int k = LandFile.GetLength()-1;
while (k > 0)
{
if (LandFile[k] == '\\')
break;
--k;
}
for (int i = 0; i < k; ++i)
iniDir += LandFile[i];
dialog.m_ofn.lpstrInitialDir = iniDir;
if (dialog.DoModal() == IDOK)
{
LandFile = dialog.GetPathName ();
UpdateData (FALSE); // Upload
}
}
// ---------------------------------------------------------------------------
void CContinentPropertiesDlg::OnButtonLandDir ()
{
BROWSEINFO bi;
char str[MAX_PATH];
ITEMIDLIST* pidl;
char sTemp[1024];
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path for land stuff";
bi.ulFlags = 0;
bi.lpfn = cpdBrowseCallbackProc;
char sDir[512];
strcpy(sDir, (LPCSTR)LandDir);
bi.lParam = (LPARAM)sDir;
bi.iImage = 0;
pidl = SHBrowseForFolder (&bi);
if (!SHGetPathFromIDList(pidl, str))
{
return;
}
LandDir= str;
UpdateData (FALSE); // Upload
}
// ---------------------------------------------------------------------------
void CContinentPropertiesDlg::OnButtonDfnDir ()
{
BROWSEINFO bi;
char str[MAX_PATH];
ITEMIDLIST* pidl;
char sTemp[1024];
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path for DFN";
bi.ulFlags = 0;
bi.lpfn = cpdBrowseCallbackProc;
char sDir[512];
strcpy(sDir, (LPCSTR)DfnDir);
bi.lParam = (LPARAM)sDir;
bi.iImage = 0;
pidl = SHBrowseForFolder (&bi);
if (!SHGetPathFromIDList(pidl, str))
{
return;
}
DfnDir= str;
UpdateData (FALSE); // Upload
}
// ---------------------------------------------------------------------------
void CContinentPropertiesDlg::OnButtonGameElemDir()
{
BROWSEINFO bi;
char str[MAX_PATH];
ITEMIDLIST* pidl;
char sTemp[1024];
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path for GameElem";
bi.ulFlags = 0;
bi.lpfn = cpdBrowseCallbackProc;
char sDir[512];
strcpy(sDir, (LPCSTR)GameElemDir);
bi.lParam = (LPARAM)sDir;
bi.iImage = 0;
pidl = SHBrowseForFolder (&bi);
if (!SHGetPathFromIDList(pidl, str))
{
return;
}
GameElemDir = str;
UpdateData (FALSE); // Upload
}
void CContinentPropertiesDlg::OnButtonLandBankFile ()
{
CFileDialog dialog (true, "smallbank", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "smallbank (*.smallbank)|*.smallbank", this);
CString iniDir;
int k = LandBankFile.GetLength()-1;
while (k > 0)
{
if (LandBankFile[k] == '\\')
break;
--k;
}
for (int i = 0; i < k; ++i)
iniDir += LandBankFile[i];
dialog.m_ofn.lpstrInitialDir = iniDir;
if (dialog.DoModal() == IDOK)
{
LandBankFile = dialog.GetPathName ();
UpdateData (FALSE); // Upload
}
}
void CContinentPropertiesDlg::OnButtonLandFarBankFile ()
{
CFileDialog dialog (true, "farbank", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "farbank (*.farbank)|*.farbank", this);
CString iniDir;
int k = LandFarBankFile.GetLength()-1;
while (k > 0)
{
if (LandFarBankFile[k] == '\\')
break;
--k;
}
for (int i = 0; i < k; ++i)
iniDir += LandFarBankFile[i];
dialog.m_ofn.lpstrInitialDir = iniDir;
if (dialog.DoModal() == IDOK)
{
LandFarBankFile = dialog.GetPathName ();
UpdateData (FALSE); // Upload
}
}
void CContinentPropertiesDlg::OnButtonLandTileNoiseDir ()
{
BROWSEINFO bi;
char str[MAX_PATH];
ITEMIDLIST* pidl;
char sTemp[1024];
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path for Tile Noise";
bi.ulFlags = 0;
bi.lpfn = cpdBrowseCallbackProc;
char sDir[512];
strcpy(sDir, (LPCSTR)LandTileNoiseDir);
bi.lParam = (LPARAM)sDir;
bi.iImage = 0;
pidl = SHBrowseForFolder (&bi);
if (!SHGetPathFromIDList(pidl, str))
{
return;
}
LandTileNoiseDir = str;
UpdateData (FALSE); // Upload
}
void CContinentPropertiesDlg::OnButtonLandZoneW ()
{
BROWSEINFO bi;
char str[MAX_PATH];
ITEMIDLIST* pidl;
char sTemp[1024];
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path for ZoneW";
bi.ulFlags = 0;
bi.lpfn = cpdBrowseCallbackProc;
char sDir[512];
strcpy(sDir, (LPCSTR)LandZoneWDir);
bi.lParam = (LPARAM)sDir;
bi.iImage = 0;
pidl = SHBrowseForFolder (&bi);
if (!SHGetPathFromIDList(pidl, str))
{
return;
}
LandZoneWDir = str;
UpdateData (FALSE); // Upload
}
void CContinentPropertiesDlg::OnButtonOutIGDir ()
{
BROWSEINFO bi;
char str[MAX_PATH];
ITEMIDLIST* pidl;
char sTemp[1024];
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path for IG output";
bi.ulFlags = 0;
bi.lpfn = cpdBrowseCallbackProc;
char sDir[512];
strcpy(sDir, (LPCSTR)OutIGDir);
bi.lParam = (LPARAM)sDir;
bi.iImage = 0;
pidl = SHBrowseForFolder (&bi);
if (!SHGetPathFromIDList(pidl, str))
{
return;
}
OutIGDir = str;
UpdateData (FALSE); // Upload
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// ContinentPropertiesDlg.cpp : implementation file
//
#include "stdafx.h"
#include "master.h"
#include "ContinentPropertiesDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
CContinentPropertiesDlg::CContinentPropertiesDlg (CWnd* pParent /*=NULL*/)
: CDialog(CContinentPropertiesDlg::IDD, pParent)
{
ContinentName = _T("");
LandFile = _T("");
LandDir = _T("");
LandBankFile = _T("");
LandFarBankFile = _T("");
LandTileNoiseDir = _T("");
LandZoneWDir = _T("");
OutIGDir = _T("");
DfnDir = _T("");
GameElemDir = _T("");
}
void CContinentPropertiesDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT_CONTINENT_NAME, ContinentName);
DDX_Text(pDX, IDC_EDIT_LANDFILE, LandFile);
DDX_Text(pDX, IDC_EDIT_LANDDIR, LandDir);
DDX_Text(pDX, IDC_LAND_BANK_FILE, LandBankFile);
DDX_Text(pDX, IDC_LAND_FAR_BANK_FILE, LandFarBankFile);
DDX_Text(pDX, IDC_LAND_TILE_NOISE_DIR, LandTileNoiseDir);
DDX_Text(pDX, IDC_OUT_LANDSCAPE_DIR, LandZoneWDir);
DDX_Text(pDX, IDC_OUT_VEGETABLE_DIR, OutIGDir);
DDX_Text(pDX, IDC_EDIT_DFNDIR, DfnDir);
DDX_Text(pDX, IDC_EDIT_GAMEELEMDIR, GameElemDir);
}
BEGIN_MESSAGE_MAP(CContinentPropertiesDlg, CDialog)
ON_COMMAND(IDC_BUTTON_LANDFILE, OnButtonLandFile)
ON_COMMAND(IDC_BUTTON_LANDDIR, OnButtonLandDir)
ON_COMMAND(IDC_EXPLORE_LAND_BANK_FILE, OnButtonLandBankFile)
ON_COMMAND(IDC_EXPLORE_LAND_FAR_BANK_FILE, OnButtonLandFarBankFile)
ON_COMMAND(IDC_EXPLORE_LAND_TILE_NOISE_DIR, OnButtonLandTileNoiseDir)
ON_COMMAND(IDC_EXPLORE_LANDSCAPE, OnButtonLandZoneW)
ON_COMMAND(IDC_EXPLORE_VEGETABLE, OnButtonOutIGDir)
ON_COMMAND(IDC_BUTTON_DFNDIR, OnButtonDfnDir)
ON_COMMAND(IDC_BUTTON_GAMEELEMDIR, OnButtonGameElemDir)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
BOOL CContinentPropertiesDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
GetDlgItem(IDC_EDIT_CONTINENT_NAME)->SetFocus();
UpdateData (FALSE); // Upload
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
// ---------------------------------------------------------------------------
// This function serve to initiate the browsing dialog box to the good position in the tree
int CALLBACK cpdBrowseCallbackProc (HWND hwnd,UINT uMsg,LPARAM lp, LPARAM pData)
{
switch(uMsg)
{
case BFFM_INITIALIZED:
SendMessage (hwnd, BFFM_SETSELECTION, TRUE, pData);
break;
default:
break;
}
return 0;
}
// ---------------------------------------------------------------------------
void CContinentPropertiesDlg::OnButtonLandFile ()
{
CFileDialog dialog (true, "land", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "Land (*.land)|*.land", this);
CString iniDir;
int k = LandFile.GetLength()-1;
while (k > 0)
{
if (LandFile[k] == '\\')
break;
--k;
}
for (int i = 0; i < k; ++i)
iniDir += LandFile[i];
dialog.m_ofn.lpstrInitialDir = iniDir;
if (dialog.DoModal() == IDOK)
{
LandFile = dialog.GetPathName ();
UpdateData (FALSE); // Upload
}
}
// ---------------------------------------------------------------------------
void CContinentPropertiesDlg::OnButtonLandDir ()
{
BROWSEINFO bi;
char str[MAX_PATH];
ITEMIDLIST* pidl;
char sTemp[1024];
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path for land stuff";
bi.ulFlags = 0;
bi.lpfn = cpdBrowseCallbackProc;
char sDir[512];
strcpy(sDir, (LPCSTR)LandDir);
bi.lParam = (LPARAM)sDir;
bi.iImage = 0;
pidl = SHBrowseForFolder (&bi);
if (!SHGetPathFromIDList(pidl, str))
{
return;
}
LandDir= str;
UpdateData (FALSE); // Upload
}
// ---------------------------------------------------------------------------
void CContinentPropertiesDlg::OnButtonDfnDir ()
{
BROWSEINFO bi;
char str[MAX_PATH];
ITEMIDLIST* pidl;
char sTemp[1024];
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path for DFN";
bi.ulFlags = 0;
bi.lpfn = cpdBrowseCallbackProc;
char sDir[512];
strcpy(sDir, (LPCSTR)DfnDir);
bi.lParam = (LPARAM)sDir;
bi.iImage = 0;
pidl = SHBrowseForFolder (&bi);
if (!SHGetPathFromIDList(pidl, str))
{
return;
}
DfnDir= str;
UpdateData (FALSE); // Upload
}
// ---------------------------------------------------------------------------
void CContinentPropertiesDlg::OnButtonGameElemDir()
{
BROWSEINFO bi;
char str[MAX_PATH];
ITEMIDLIST* pidl;
char sTemp[1024];
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path for GameElem";
bi.ulFlags = 0;
bi.lpfn = cpdBrowseCallbackProc;
char sDir[512];
strcpy(sDir, (LPCSTR)GameElemDir);
bi.lParam = (LPARAM)sDir;
bi.iImage = 0;
pidl = SHBrowseForFolder (&bi);
if (!SHGetPathFromIDList(pidl, str))
{
return;
}
GameElemDir = str;
UpdateData (FALSE); // Upload
}
void CContinentPropertiesDlg::OnButtonLandBankFile ()
{
CFileDialog dialog (true, "smallbank", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "smallbank (*.smallbank)|*.smallbank", this);
CString iniDir;
int k = LandBankFile.GetLength()-1;
while (k > 0)
{
if (LandBankFile[k] == '\\')
break;
--k;
}
for (int i = 0; i < k; ++i)
iniDir += LandBankFile[i];
dialog.m_ofn.lpstrInitialDir = iniDir;
if (dialog.DoModal() == IDOK)
{
LandBankFile = dialog.GetPathName ();
UpdateData (FALSE); // Upload
}
}
void CContinentPropertiesDlg::OnButtonLandFarBankFile ()
{
CFileDialog dialog (true, "farbank", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "farbank (*.farbank)|*.farbank", this);
CString iniDir;
int k = LandFarBankFile.GetLength()-1;
while (k > 0)
{
if (LandFarBankFile[k] == '\\')
break;
--k;
}
for (int i = 0; i < k; ++i)
iniDir += LandFarBankFile[i];
dialog.m_ofn.lpstrInitialDir = iniDir;
if (dialog.DoModal() == IDOK)
{
LandFarBankFile = dialog.GetPathName ();
UpdateData (FALSE); // Upload
}
}
void CContinentPropertiesDlg::OnButtonLandTileNoiseDir ()
{
BROWSEINFO bi;
char str[MAX_PATH];
ITEMIDLIST* pidl;
char sTemp[1024];
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path for Tile Noise";
bi.ulFlags = 0;
bi.lpfn = cpdBrowseCallbackProc;
char sDir[512];
strcpy(sDir, (LPCSTR)LandTileNoiseDir);
bi.lParam = (LPARAM)sDir;
bi.iImage = 0;
pidl = SHBrowseForFolder (&bi);
if (!SHGetPathFromIDList(pidl, str))
{
return;
}
LandTileNoiseDir = str;
UpdateData (FALSE); // Upload
}
void CContinentPropertiesDlg::OnButtonLandZoneW ()
{
BROWSEINFO bi;
char str[MAX_PATH];
ITEMIDLIST* pidl;
char sTemp[1024];
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path for ZoneW";
bi.ulFlags = 0;
bi.lpfn = cpdBrowseCallbackProc;
char sDir[512];
strcpy(sDir, (LPCSTR)LandZoneWDir);
bi.lParam = (LPARAM)sDir;
bi.iImage = 0;
pidl = SHBrowseForFolder (&bi);
if (!SHGetPathFromIDList(pidl, str))
{
return;
}
LandZoneWDir = str;
UpdateData (FALSE); // Upload
}
void CContinentPropertiesDlg::OnButtonOutIGDir ()
{
BROWSEINFO bi;
char str[MAX_PATH];
ITEMIDLIST* pidl;
char sTemp[1024];
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path for IG output";
bi.ulFlags = 0;
bi.lpfn = cpdBrowseCallbackProc;
char sDir[512];
strcpy(sDir, (LPCSTR)OutIGDir);
bi.lParam = (LPARAM)sDir;
bi.iImage = 0;
pidl = SHBrowseForFolder (&bi);
if (!SHGetPathFromIDList(pidl, str))
{
return;
}
OutIGDir = str;
UpdateData (FALSE); // Upload
}

@ -1,68 +1,68 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef CONTINENT_PROPERTIES_DLG_H
#define CONTINENT_PROPERTIES_DLG_H
/////////////////////////////////////////////////////////////////////////////
// ContinentProperties dialog
class CContinentPropertiesDlg : public CDialog
{
// Construction
public:
CContinentPropertiesDlg(CWnd* pParent = NULL);
// Dialog Data
enum { IDD = IDD_CONTINENT_PROPERTIES };
CString ContinentName;
CString LandFile;
CString LandDir;
CString LandBankFile;
CString LandFarBankFile;
CString LandTileNoiseDir;
CString LandZoneWDir;
CString OutIGDir;
CString DfnDir;
CString GameElemDir;
afx_msg void OnButtonLandFile ();
afx_msg void OnButtonLandDir ();
afx_msg void OnButtonDfnDir ();
afx_msg void OnButtonGameElemDir ();
afx_msg void OnButtonLandBankFile ();
afx_msg void OnButtonLandFarBankFile ();
afx_msg void OnButtonLandTileNoiseDir ();
afx_msg void OnButtonLandZoneW ();
afx_msg void OnButtonOutIGDir ();
protected:
virtual void DoDataExchange (CDataExchange* pDX);
// Implementation
protected:
virtual BOOL OnInitDialog();
DECLARE_MESSAGE_MAP()
};
#endif
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef CONTINENT_PROPERTIES_DLG_H
#define CONTINENT_PROPERTIES_DLG_H
/////////////////////////////////////////////////////////////////////////////
// ContinentProperties dialog
class CContinentPropertiesDlg : public CDialog
{
// Construction
public:
CContinentPropertiesDlg(CWnd* pParent = NULL);
// Dialog Data
enum { IDD = IDD_CONTINENT_PROPERTIES };
CString ContinentName;
CString LandFile;
CString LandDir;
CString LandBankFile;
CString LandFarBankFile;
CString LandTileNoiseDir;
CString LandZoneWDir;
CString OutIGDir;
CString DfnDir;
CString GameElemDir;
afx_msg void OnButtonLandFile ();
afx_msg void OnButtonLandDir ();
afx_msg void OnButtonDfnDir ();
afx_msg void OnButtonGameElemDir ();
afx_msg void OnButtonLandBankFile ();
afx_msg void OnButtonLandFarBankFile ();
afx_msg void OnButtonLandTileNoiseDir ();
afx_msg void OnButtonLandZoneW ();
afx_msg void OnButtonOutIGDir ();
protected:
virtual void DoDataExchange (CDataExchange* pDX);
// Implementation
protected:
virtual BOOL OnInitDialog();
DECLARE_MESSAGE_MAP()
};
#endif

@ -1,183 +1,183 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// ExportCBDlg.cpp : implementation file
//
#include "stdafx.h"
#include "master.h"
#include "ExportCBDlg.h"
#ifdef _DEBUG
# ifdef new
# undef new
# endif
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CExportCB
/////////////////////////////////////////////////////////////////////////////
CExportCB::CExportCB()
{
_Canceled = false;
}
/////////////////////////////////////////////////////////////////////////////
void CExportCB::setExportCBDlg (CExportCBDlg *dlg)
{
_Dialog = dlg;
}
/////////////////////////////////////////////////////////////////////////////
void CExportCB::cancel ()
{
_Canceled = true;
}
/////////////////////////////////////////////////////////////////////////////
void CExportCB::pump()
{
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
}
/////////////////////////////////////////////////////////////////////////////
bool CExportCB::isCanceled ()
{
pump();
return _Canceled;
}
/////////////////////////////////////////////////////////////////////////////
void CExportCB::dispPass (const std::string &Text)
{
_Dialog->PassText = Text.c_str();
_Dialog->ProgressBar.SetPos (0);
_Dialog->UpdateData (FALSE); // Upload
_Dialog->Invalidate();
pump();
}
/////////////////////////////////////////////////////////////////////////////
void CExportCB::dispPassProgress (float percentage)
{
_Dialog->ProgressBar.SetPos ((sint32)(100*percentage));
_Dialog->UpdateData (FALSE); // Upload
pump();
}
/////////////////////////////////////////////////////////////////////////////
void CExportCB::dispInfo (const std::string &Text)
{
_Dialog->InfoText = CString(Text.c_str()) + "\r\n" + _Dialog->InfoText;
_Dialog->UpdateData (FALSE); // Upload
pump();
}
/////////////////////////////////////////////////////////////////////////////
void CExportCB::dispWarning (const std::string &Text)
{
_Dialog->InfoText = CString("WARNING : ") + CString(Text.c_str()) + "\r\n" + _Dialog->InfoText;
_Dialog->UpdateData (FALSE); // Upload
pump();
}
/////////////////////////////////////////////////////////////////////////////
void CExportCB::dispError (const std::string &Text)
{
_Dialog->InfoText = CString("ERROR : ") + CString(Text.c_str()) + "\r\n" + _Dialog->InfoText;
_Dialog->UpdateData (FALSE); // Upload
pump();
}
/////////////////////////////////////////////////////////////////////////////
// CExportCBDlg dialog
/////////////////////////////////////////////////////////////////////////////
CExportCBDlg::CExportCBDlg(CWnd* pParent /*=NULL*/)
: CDialog(CExportCBDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CExportCBDlg)
PassText = _T("");
InfoText = _T("");
_Finished = false;
//}}AFX_DATA_INIT
}
/////////////////////////////////////////////////////////////////////////////
void CExportCBDlg::setFinishedButton ()
{
CButton *but = (CButton*)GetDlgItem (IDCANCEL);
but->SetWindowText ("FINISHED");
Invalidate ();
pump ();
}
/////////////////////////////////////////////////////////////////////////////
void CExportCBDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CExportCBDlg)
DDX_Control(pDX, IDC_EDIT1, EditCtrl);
DDX_Control(pDX, IDC_PROGRESS1, ProgressBar);
DDX_Text(pDX, IDC_PASS, PassText);
DDX_Text(pDX, IDC_EDIT1, InfoText);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CExportCBDlg, CDialog)
//{{AFX_MSG_MAP(CExportCBDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CExportCBDlg message handlers
/////////////////////////////////////////////////////////////////////////////
void CExportCBDlg::OnCancel()
{
CButton *but = (CButton*)GetDlgItem (IDCANCEL);
CString zeText;
but->GetWindowText (zeText);
if (zeText == "Cancel")
_ExportCB.cancel ();
else
_Finished = true;
//CDialog::OnCancel();
}
/////////////////////////////////////////////////////////////////////////////
BOOL CExportCBDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
_ExportCB.setExportCBDlg (this);
ProgressBar.SetRange (0, 100);
EditCtrl.SetLimitText (200);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// ExportCBDlg.cpp : implementation file
//
#include "stdafx.h"
#include "master.h"
#include "ExportCBDlg.h"
#ifdef _DEBUG
# ifdef new
# undef new
# endif
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CExportCB
/////////////////////////////////////////////////////////////////////////////
CExportCB::CExportCB()
{
_Canceled = false;
}
/////////////////////////////////////////////////////////////////////////////
void CExportCB::setExportCBDlg (CExportCBDlg *dlg)
{
_Dialog = dlg;
}
/////////////////////////////////////////////////////////////////////////////
void CExportCB::cancel ()
{
_Canceled = true;
}
/////////////////////////////////////////////////////////////////////////////
void CExportCB::pump()
{
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
TranslateMessage (&msg);
DispatchMessage (&msg);
}
}
/////////////////////////////////////////////////////////////////////////////
bool CExportCB::isCanceled ()
{
pump();
return _Canceled;
}
/////////////////////////////////////////////////////////////////////////////
void CExportCB::dispPass (const std::string &Text)
{
_Dialog->PassText = Text.c_str();
_Dialog->ProgressBar.SetPos (0);
_Dialog->UpdateData (FALSE); // Upload
_Dialog->Invalidate();
pump();
}
/////////////////////////////////////////////////////////////////////////////
void CExportCB::dispPassProgress (float percentage)
{
_Dialog->ProgressBar.SetPos ((sint32)(100*percentage));
_Dialog->UpdateData (FALSE); // Upload
pump();
}
/////////////////////////////////////////////////////////////////////////////
void CExportCB::dispInfo (const std::string &Text)
{
_Dialog->InfoText = CString(Text.c_str()) + "\r\n" + _Dialog->InfoText;
_Dialog->UpdateData (FALSE); // Upload
pump();
}
/////////////////////////////////////////////////////////////////////////////
void CExportCB::dispWarning (const std::string &Text)
{
_Dialog->InfoText = CString("WARNING : ") + CString(Text.c_str()) + "\r\n" + _Dialog->InfoText;
_Dialog->UpdateData (FALSE); // Upload
pump();
}
/////////////////////////////////////////////////////////////////////////////
void CExportCB::dispError (const std::string &Text)
{
_Dialog->InfoText = CString("ERROR : ") + CString(Text.c_str()) + "\r\n" + _Dialog->InfoText;
_Dialog->UpdateData (FALSE); // Upload
pump();
}
/////////////////////////////////////////////////////////////////////////////
// CExportCBDlg dialog
/////////////////////////////////////////////////////////////////////////////
CExportCBDlg::CExportCBDlg(CWnd* pParent /*=NULL*/)
: CDialog(CExportCBDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CExportCBDlg)
PassText = _T("");
InfoText = _T("");
_Finished = false;
//}}AFX_DATA_INIT
}
/////////////////////////////////////////////////////////////////////////////
void CExportCBDlg::setFinishedButton ()
{
CButton *but = (CButton*)GetDlgItem (IDCANCEL);
but->SetWindowText ("FINISHED");
Invalidate ();
pump ();
}
/////////////////////////////////////////////////////////////////////////////
void CExportCBDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CExportCBDlg)
DDX_Control(pDX, IDC_EDIT1, EditCtrl);
DDX_Control(pDX, IDC_PROGRESS1, ProgressBar);
DDX_Text(pDX, IDC_PASS, PassText);
DDX_Text(pDX, IDC_EDIT1, InfoText);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CExportCBDlg, CDialog)
//{{AFX_MSG_MAP(CExportCBDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CExportCBDlg message handlers
/////////////////////////////////////////////////////////////////////////////
void CExportCBDlg::OnCancel()
{
CButton *but = (CButton*)GetDlgItem (IDCANCEL);
CString zeText;
but->GetWindowText (zeText);
if (zeText == "Cancel")
_ExportCB.cancel ();
else
_Finished = true;
//CDialog::OnCancel();
}
/////////////////////////////////////////////////////////////////////////////
BOOL CExportCBDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
_ExportCB.setExportCBDlg (this);
ProgressBar.SetRange (0, 100);
EditCtrl.SetLimitText (200);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

@ -1,106 +1,106 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_EXPORTCBDLG_H__34C63700_C8D7_454C_A752_3722257D9160__INCLUDED_)
#define AFX_EXPORTCBDLG_H__34C63700_C8D7_454C_A752_3722257D9160__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ExportCBDlg.h : header file
//
#include "../export/export.h"
/////////////////////////////////////////////////////////////////////////////
class CExportCBDlg;
/////////////////////////////////////////////////////////////////////////////
// CExportCB
class CExportCB : public IExportCB
{
CExportCBDlg *_Dialog;
bool _Canceled;
public:
CExportCB();
void setExportCBDlg (CExportCBDlg *dlg);
void cancel ();
void pump ();
// Interface
virtual bool isCanceled (); // Tell the exporter if it must end as quick as possible
// Display callbacks
virtual void dispPass (const std::string &Text); // Pass (generate land, vegetable, etc...)
virtual void dispPassProgress (float percentage); // [ 0.0 , 1.0 ]
virtual void dispInfo (const std::string &Text); // Verbose
virtual void dispWarning (const std::string &Text); // Error but not critical
virtual void dispError (const std::string &Text); // Should block (misfunction)
};
/////////////////////////////////////////////////////////////////////////////
// CExportCBDlg dialog
class CExportCBDlg : public CDialog
{
CExportCB _ExportCB;
bool _Finished;
// Construction
public:
CExportCBDlg(CWnd* pParent = NULL); // standard constructor
CExportCB *getExportCB () { return &_ExportCB; }
void setFinishedButton ();
bool getFinished () { return _Finished; }
void pump () { _ExportCB.pump (); }
// Dialog Data
//{{AFX_DATA(CExportCBDlg)
enum { IDD = IDD_EXPORTCB };
CEdit EditCtrl;
CProgressCtrl ProgressBar;
CString PassText;
CString InfoText;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CExportCBDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CExportCBDlg)
virtual void OnCancel();
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_EXPORTCBDLG_H__34C63700_C8D7_454C_A752_3722257D9160__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_EXPORTCBDLG_H__34C63700_C8D7_454C_A752_3722257D9160__INCLUDED_)
#define AFX_EXPORTCBDLG_H__34C63700_C8D7_454C_A752_3722257D9160__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ExportCBDlg.h : header file
//
#include "../export/export.h"
/////////////////////////////////////////////////////////////////////////////
class CExportCBDlg;
/////////////////////////////////////////////////////////////////////////////
// CExportCB
class CExportCB : public IExportCB
{
CExportCBDlg *_Dialog;
bool _Canceled;
public:
CExportCB();
void setExportCBDlg (CExportCBDlg *dlg);
void cancel ();
void pump ();
// Interface
virtual bool isCanceled (); // Tell the exporter if it must end as quick as possible
// Display callbacks
virtual void dispPass (const std::string &Text); // Pass (generate land, vegetable, etc...)
virtual void dispPassProgress (float percentage); // [ 0.0 , 1.0 ]
virtual void dispInfo (const std::string &Text); // Verbose
virtual void dispWarning (const std::string &Text); // Error but not critical
virtual void dispError (const std::string &Text); // Should block (misfunction)
};
/////////////////////////////////////////////////////////////////////////////
// CExportCBDlg dialog
class CExportCBDlg : public CDialog
{
CExportCB _ExportCB;
bool _Finished;
// Construction
public:
CExportCBDlg(CWnd* pParent = NULL); // standard constructor
CExportCB *getExportCB () { return &_ExportCB; }
void setFinishedButton ();
bool getFinished () { return _Finished; }
void pump () { _ExportCB.pump (); }
// Dialog Data
//{{AFX_DATA(CExportCBDlg)
enum { IDD = IDD_EXPORTCB };
CEdit EditCtrl;
CProgressCtrl ProgressBar;
CString PassText;
CString InfoText;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CExportCBDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CExportCBDlg)
virtual void OnCancel();
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_EXPORTCBDLG_H__34C63700_C8D7_454C_A752_3722257D9160__INCLUDED_)

@ -1,261 +1,261 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// ExportDlg.cpp : implementation file
//
#include "stdafx.h"
#include "master.h"
#include "ExportDlg.h"
#ifdef _DEBUG
# ifdef new
# undef new
# endif
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
using namespace std;
/////////////////////////////////////////////////////////////////////////////
// CExportDlg dialog
// ---------------------------------------------------------------------------
CExportDlg::CExportDlg(CWnd* pParent /*=NULL*/)
: CDialog(CExportDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CExportDlg)
//GenerateLandscape = FALSE;
//GenerateVegetable = FALSE;
/* OutLandscapeDir = _T("");
OutIGDir = _T("");*/
ContinentName = _T("");
/*LandBankFile = _T("");
LandFarBankFile = _T("");*/
_Options = NULL;
_Finished = false;
//LandTileNoiseDir = _T("");
//}}AFX_DATA_INIT
}
// ---------------------------------------------------------------------------
void CExportDlg::setOptions (SExportOptions &options, vector<string> &regNames)
{
_Options = &options;
_Continents = &regNames;
}
// ---------------------------------------------------------------------------
void CExportDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CExportDlg)
DDX_Control(pDX, IDC_CONTINENTLIST, ContinentList);
//DDX_Check(pDX, IDC_GENERATE_VEGETABLE, GenerateVegetable);
//DDX_Text(pDX, IDC_OUT_LANDSCAPE_DIR, OutLandscapeDir);
//DDX_Text(pDX, IDC_OUT_VEGETABLE_DIR, OutIGDir);
DDX_CBString(pDX, IDC_CONTINENTLIST, ContinentName);
//DDX_Text(pDX, IDC_LAND_BANK_FILE, LandBankFile);
//DDX_Text(pDX, IDC_LAND_FAR_BANK_FILE, LandFarBankFile);
//DDX_Text(pDX, IDC_LAND_TILE_NOISE_DIR, LandTileNoiseDir);
//}}AFX_DATA_MAP
}
/////////////////////////////////////////////////////////////////////////////
BEGIN_MESSAGE_MAP(CExportDlg, CDialog)
//{{AFX_MSG_MAP(CExportDlg)
/* ON_BN_CLICKED(IDC_EXPLORE_LANDSCAPE, OnExploreOutLandscapeDir)
ON_BN_CLICKED(IDC_EXPLORE_VEGETABLE, OnExploreOutIGDir)
ON_BN_CLICKED(IDC_EXPLORE_LAND_BANK_FILE, OnExploreLandSmallBankFile)
ON_BN_CLICKED(IDC_EXPLORE_LAND_FAR_BANK_FILE, OnExploreLandFarBankFile)
ON_BN_CLICKED(IDC_EXPLORE_LAND_TILE_NOISE_DIR, OnExploreLandTileNoiseDir)*/
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CExportDlg message handlers
// ---------------------------------------------------------------------------
BOOL CExportDlg::OnInitDialog ()
{
CDialog::OnInitDialog ();
// TODO: Add extra initialization here
// OutLandscapeDir = _Options->InLandscapeDir.c_str();
// OutIGDir = _Options->OutIGDir.c_str ();
// LandBankFile = _Options->LandBankFile.c_str ();
// LandFarBankFile = _Options->LandFarBankFile.c_str ();
// LandTileNoiseDir = _Options->LandTileNoiseDir.c_str ();
for (uint32 i=0; i < _Continents->size(); ++i)
{
ContinentList.InsertString (-1, (_Continents->operator[](i)).c_str());
}
ContinentName = _Options->PrimFloraDir.c_str ();
sint32 si = _Options->PrimFloraDir.size()-1;
while (si >= 0)
{
if (_Options->PrimFloraDir[si] == '\\')
break;
--si;
}
if (si > -1)
{
ContinentName = "";
++si;
for (;si < (sint32)_Options->PrimFloraDir.size(); ++si)
ContinentName += _Options->PrimFloraDir[si];
}
UpdateData (FALSE); // Upload
if (ContinentName == "")
ContinentList.SetCurSel (0);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
// ---------------------------------------------------------------------------
void CExportDlg::OnOK ()
{
UpdateData (TRUE); // Download
_Options->PrimFloraDir = (LPCSTR)ContinentName;
// _Options->OutIGDir = (LPCSTR)OutIGDir;
// _Options->LandBankFile = (LPCSTR)LandBankFile;
// _Options->LandFarBankFile = (LPCSTR)LandFarBankFile;
// _Options->PrimFloraDir = (LPCSTR)ContinentName;
// _Options->LandTileNoiseDir = (LPCSTR)LandTileNoiseDir;
// _Options->InLandscapeDir = (LPCSTR)OutLandscapeDir;
CDialog::OnOK();
}
/*
// ---------------------------------------------------------------------------
int CALLBACK expBrowseCallbackProc (HWND hwnd,UINT uMsg,LPARAM lp, LPARAM pData)
{
switch(uMsg)
{
case BFFM_INITIALIZED:
SendMessage (hwnd, BFFM_SETSELECTION, TRUE, pData);
break;
default:
break;
}
return 0;
}
// ---------------------------------------------------------------------------
void CExportDlg::OnExploreOutLandscapeDir ()
{
BROWSEINFO bi;
char str[MAX_PATH];
ITEMIDLIST* pidl;
char sTemp[1024];
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path";
bi.ulFlags = 0;
bi.lpfn = expBrowseCallbackProc;
bi.lParam = (LPARAM)(LPCSTR)OutLandscapeDir;
bi.iImage = 0;
pidl = SHBrowseForFolder (&bi);
if (!SHGetPathFromIDList(pidl, str))
{
return;
}
OutLandscapeDir = str;
UpdateData (FALSE); // Upload
}
// ---------------------------------------------------------------------------
void CExportDlg::OnExploreOutIGDir()
{
BROWSEINFO bi;
char str[MAX_PATH];
ITEMIDLIST* pidl;
char sTemp[1024];
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path";
bi.ulFlags = 0;
bi.lpfn = expBrowseCallbackProc;
bi.lParam = (LPARAM)(LPCSTR)OutIGDir;
bi.iImage = 0;
pidl = SHBrowseForFolder (&bi);
if (!SHGetPathFromIDList(pidl, str))
{
return;
}
OutIGDir = str;
UpdateData (FALSE); // Upload
}
// ---------------------------------------------------------------------------
void CExportDlg::OnExploreLandSmallBankFile()
{
CFileDialog dialog (true, "smallbank", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "SmallBank (*.smallbank)|*.smallbank", this);
if (dialog.DoModal() == IDOK)
{
LandBankFile = dialog.GetPathName ();
}
UpdateData (FALSE); // Upload
}
// ---------------------------------------------------------------------------
void CExportDlg::OnExploreLandFarBankFile()
{
CFileDialog dialog (true, "farbank", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "FarBank (*.farbank)|*.farbank", this);
if (dialog.DoModal() == IDOK)
{
LandFarBankFile = dialog.GetPathName();
}
UpdateData (FALSE); // Upload
}
// ---------------------------------------------------------------------------
void CExportDlg::OnExploreLandTileNoiseDir()
{
BROWSEINFO bi;
char str[MAX_PATH];
ITEMIDLIST* pidl;
char sTemp[1024];
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path";
bi.ulFlags = 0;
bi.lpfn = expBrowseCallbackProc;
bi.lParam = (LPARAM)(LPCSTR)LandTileNoiseDir;
bi.iImage = 0;
pidl = SHBrowseForFolder (&bi);
if (!SHGetPathFromIDList(pidl, str))
{
return;
}
LandTileNoiseDir = str;
UpdateData (FALSE); // Upload
}*/
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// ExportDlg.cpp : implementation file
//
#include "stdafx.h"
#include "master.h"
#include "ExportDlg.h"
#ifdef _DEBUG
# ifdef new
# undef new
# endif
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
using namespace std;
/////////////////////////////////////////////////////////////////////////////
// CExportDlg dialog
// ---------------------------------------------------------------------------
CExportDlg::CExportDlg(CWnd* pParent /*=NULL*/)
: CDialog(CExportDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CExportDlg)
//GenerateLandscape = FALSE;
//GenerateVegetable = FALSE;
/* OutLandscapeDir = _T("");
OutIGDir = _T("");*/
ContinentName = _T("");
/*LandBankFile = _T("");
LandFarBankFile = _T("");*/
_Options = NULL;
_Finished = false;
//LandTileNoiseDir = _T("");
//}}AFX_DATA_INIT
}
// ---------------------------------------------------------------------------
void CExportDlg::setOptions (SExportOptions &options, vector<string> &regNames)
{
_Options = &options;
_Continents = &regNames;
}
// ---------------------------------------------------------------------------
void CExportDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CExportDlg)
DDX_Control(pDX, IDC_CONTINENTLIST, ContinentList);
//DDX_Check(pDX, IDC_GENERATE_VEGETABLE, GenerateVegetable);
//DDX_Text(pDX, IDC_OUT_LANDSCAPE_DIR, OutLandscapeDir);
//DDX_Text(pDX, IDC_OUT_VEGETABLE_DIR, OutIGDir);
DDX_CBString(pDX, IDC_CONTINENTLIST, ContinentName);
//DDX_Text(pDX, IDC_LAND_BANK_FILE, LandBankFile);
//DDX_Text(pDX, IDC_LAND_FAR_BANK_FILE, LandFarBankFile);
//DDX_Text(pDX, IDC_LAND_TILE_NOISE_DIR, LandTileNoiseDir);
//}}AFX_DATA_MAP
}
/////////////////////////////////////////////////////////////////////////////
BEGIN_MESSAGE_MAP(CExportDlg, CDialog)
//{{AFX_MSG_MAP(CExportDlg)
/* ON_BN_CLICKED(IDC_EXPLORE_LANDSCAPE, OnExploreOutLandscapeDir)
ON_BN_CLICKED(IDC_EXPLORE_VEGETABLE, OnExploreOutIGDir)
ON_BN_CLICKED(IDC_EXPLORE_LAND_BANK_FILE, OnExploreLandSmallBankFile)
ON_BN_CLICKED(IDC_EXPLORE_LAND_FAR_BANK_FILE, OnExploreLandFarBankFile)
ON_BN_CLICKED(IDC_EXPLORE_LAND_TILE_NOISE_DIR, OnExploreLandTileNoiseDir)*/
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CExportDlg message handlers
// ---------------------------------------------------------------------------
BOOL CExportDlg::OnInitDialog ()
{
CDialog::OnInitDialog ();
// TODO: Add extra initialization here
// OutLandscapeDir = _Options->InLandscapeDir.c_str();
// OutIGDir = _Options->OutIGDir.c_str ();
// LandBankFile = _Options->LandBankFile.c_str ();
// LandFarBankFile = _Options->LandFarBankFile.c_str ();
// LandTileNoiseDir = _Options->LandTileNoiseDir.c_str ();
for (uint32 i=0; i < _Continents->size(); ++i)
{
ContinentList.InsertString (-1, (_Continents->operator[](i)).c_str());
}
ContinentName = _Options->PrimFloraDir.c_str ();
sint32 si = _Options->PrimFloraDir.size()-1;
while (si >= 0)
{
if (_Options->PrimFloraDir[si] == '\\')
break;
--si;
}
if (si > -1)
{
ContinentName = "";
++si;
for (;si < (sint32)_Options->PrimFloraDir.size(); ++si)
ContinentName += _Options->PrimFloraDir[si];
}
UpdateData (FALSE); // Upload
if (ContinentName == "")
ContinentList.SetCurSel (0);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
// ---------------------------------------------------------------------------
void CExportDlg::OnOK ()
{
UpdateData (TRUE); // Download
_Options->PrimFloraDir = (LPCSTR)ContinentName;
// _Options->OutIGDir = (LPCSTR)OutIGDir;
// _Options->LandBankFile = (LPCSTR)LandBankFile;
// _Options->LandFarBankFile = (LPCSTR)LandFarBankFile;
// _Options->PrimFloraDir = (LPCSTR)ContinentName;
// _Options->LandTileNoiseDir = (LPCSTR)LandTileNoiseDir;
// _Options->InLandscapeDir = (LPCSTR)OutLandscapeDir;
CDialog::OnOK();
}
/*
// ---------------------------------------------------------------------------
int CALLBACK expBrowseCallbackProc (HWND hwnd,UINT uMsg,LPARAM lp, LPARAM pData)
{
switch(uMsg)
{
case BFFM_INITIALIZED:
SendMessage (hwnd, BFFM_SETSELECTION, TRUE, pData);
break;
default:
break;
}
return 0;
}
// ---------------------------------------------------------------------------
void CExportDlg::OnExploreOutLandscapeDir ()
{
BROWSEINFO bi;
char str[MAX_PATH];
ITEMIDLIST* pidl;
char sTemp[1024];
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path";
bi.ulFlags = 0;
bi.lpfn = expBrowseCallbackProc;
bi.lParam = (LPARAM)(LPCSTR)OutLandscapeDir;
bi.iImage = 0;
pidl = SHBrowseForFolder (&bi);
if (!SHGetPathFromIDList(pidl, str))
{
return;
}
OutLandscapeDir = str;
UpdateData (FALSE); // Upload
}
// ---------------------------------------------------------------------------
void CExportDlg::OnExploreOutIGDir()
{
BROWSEINFO bi;
char str[MAX_PATH];
ITEMIDLIST* pidl;
char sTemp[1024];
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path";
bi.ulFlags = 0;
bi.lpfn = expBrowseCallbackProc;
bi.lParam = (LPARAM)(LPCSTR)OutIGDir;
bi.iImage = 0;
pidl = SHBrowseForFolder (&bi);
if (!SHGetPathFromIDList(pidl, str))
{
return;
}
OutIGDir = str;
UpdateData (FALSE); // Upload
}
// ---------------------------------------------------------------------------
void CExportDlg::OnExploreLandSmallBankFile()
{
CFileDialog dialog (true, "smallbank", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "SmallBank (*.smallbank)|*.smallbank", this);
if (dialog.DoModal() == IDOK)
{
LandBankFile = dialog.GetPathName ();
}
UpdateData (FALSE); // Upload
}
// ---------------------------------------------------------------------------
void CExportDlg::OnExploreLandFarBankFile()
{
CFileDialog dialog (true, "farbank", NULL, OFN_HIDEREADONLY|OFN_OVERWRITEPROMPT, "FarBank (*.farbank)|*.farbank", this);
if (dialog.DoModal() == IDOK)
{
LandFarBankFile = dialog.GetPathName();
}
UpdateData (FALSE); // Upload
}
// ---------------------------------------------------------------------------
void CExportDlg::OnExploreLandTileNoiseDir()
{
BROWSEINFO bi;
char str[MAX_PATH];
ITEMIDLIST* pidl;
char sTemp[1024];
bi.hwndOwner = this->m_hWnd;
bi.pidlRoot = NULL;
bi.pidlRoot = NULL;
bi.pszDisplayName = sTemp;;
bi.lpszTitle = "Choose the path";
bi.ulFlags = 0;
bi.lpfn = expBrowseCallbackProc;
bi.lParam = (LPARAM)(LPCSTR)LandTileNoiseDir;
bi.iImage = 0;
pidl = SHBrowseForFolder (&bi);
if (!SHGetPathFromIDList(pidl, str))
{
return;
}
LandTileNoiseDir = str;
UpdateData (FALSE); // Upload
}*/

@ -1,89 +1,89 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_EXPORTDLG_H__D698050D_CF34_4D22_8F5B_FF8BAEFF6774__INCLUDED_)
#define AFX_EXPORTDLG_H__D698050D_CF34_4D22_8F5B_FF8BAEFF6774__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ExportDlg.h : header file
//
#include "../export/export.h"
/////////////////////////////////////////////////////////////////////////////
// CExportDlg dialog
class CExportDlg : public CDialog
{
SExportOptions *_Options;
std::vector<std::string> *_Continents;
std::string _ActiveContinent;
bool _Finished;
// Construction
public:
CExportDlg (CWnd* pParent = NULL); // standard constructor
void setOptions (SExportOptions &options, std::vector<std::string> &regNames);
// Dialog Data
//{{AFX_DATA(CExportDlg)
enum { IDD = IDD_EXPORTOPT };
CComboBox ContinentList;
//BOOL GenerateLandscape;
/*
BOOL GenerateVegetable;
CString OutLandscapeDir;
CString OutIGDir;*/
CString ContinentName;
/*CString LandBankFile;
CString LandFarBankFile;
CString LandTileNoiseDir;*/
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CExportDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CExportDlg)
virtual BOOL OnInitDialog();
virtual void OnOK();
/*
afx_msg void OnExploreOutLandscapeDir();
afx_msg void OnExploreOutIGDir();
afx_msg void OnExploreLandSmallBankFile();
afx_msg void OnExploreLandFarBankFile();
afx_msg void OnExploreLandTileNoiseDir();
*/
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EXPORTDLG_H__D698050D_CF34_4D22_8F5B_FF8BAEFF6774__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_EXPORTDLG_H__D698050D_CF34_4D22_8F5B_FF8BAEFF6774__INCLUDED_)
#define AFX_EXPORTDLG_H__D698050D_CF34_4D22_8F5B_FF8BAEFF6774__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ExportDlg.h : header file
//
#include "../export/export.h"
/////////////////////////////////////////////////////////////////////////////
// CExportDlg dialog
class CExportDlg : public CDialog
{
SExportOptions *_Options;
std::vector<std::string> *_Continents;
std::string _ActiveContinent;
bool _Finished;
// Construction
public:
CExportDlg (CWnd* pParent = NULL); // standard constructor
void setOptions (SExportOptions &options, std::vector<std::string> &regNames);
// Dialog Data
//{{AFX_DATA(CExportDlg)
enum { IDD = IDD_EXPORTOPT };
CComboBox ContinentList;
//BOOL GenerateLandscape;
/*
BOOL GenerateVegetable;
CString OutLandscapeDir;
CString OutIGDir;*/
CString ContinentName;
/*CString LandBankFile;
CString LandFarBankFile;
CString LandTileNoiseDir;*/
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CExportDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CExportDlg)
virtual BOOL OnInitDialog();
virtual void OnOK();
/*
afx_msg void OnExploreOutLandscapeDir();
afx_msg void OnExploreOutIGDir();
afx_msg void OnExploreLandSmallBankFile();
afx_msg void OnExploreLandFarBankFile();
afx_msg void OnExploreLandTileNoiseDir();
*/
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_EXPORTDLG_H__D698050D_CF34_4D22_8F5B_FF8BAEFF6774__INCLUDED_)

File diff suppressed because it is too large Load Diff

@ -1,286 +1,286 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// ---------------------------------------------------------------------------
// MainFrm.h : interface of the CMainFrame class
// ---------------------------------------------------------------------------
#if !defined(AFX_MAINFRM_H__D9ABC57D_9514_49B1_A65F_1CC64C6D6BB6__INCLUDED_)
#define AFX_MAINFRM_H__D9ABC57D_9514_49B1_A65F_1CC64C6D6BB6__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ---------------------------------------------------------------------------
#include "nel/misc/stream.h"
#include "nel/misc/file.h"
#include "MasterTree.h"
#include <string>
#include "../export/export.h"
#include "../../3d/ligo/worldeditor/worldeditor_interface.h" // MasterCB
#include "easy_cfg.h"
// ---------------------------------------------------------------------------
// Interface to the tools
// ---------------------------------------------------------------------------
class IWorldEditor;
class IGeorges;
class ILogicEditor;
class CMainFrame;
class CExportCBDlg;
// ---------------------------------------------------------------------------
// Do not parse following directories
#define MAX_SYS_DIR 7
extern char *gSysDir[MAX_SYS_DIR];
// Do not display files with those extensions
#define MAX_INVALID_EXT 1
extern char *gInvalidExt[MAX_INVALID_EXT];
// ---------------------------------------------------------------------------
struct SEnvironnement : public IEasyCFG
{
// Master params
sint32 MasterX, MasterY;
sint32 MasterTreeX, MasterTreeY;
sint32 MasterTreeCX, MasterTreeCY;
bool MasterTreeLocked;
std::string ContinentsDir;
std::string DefaultDFNDir;
std::string DefaultGameElemDir;
// WorldEditor params
bool WorldEdOpened;
sint32 WorldEdX, WorldEdY, WorldEdCX, WorldEdCY;
// Georges params
bool GeorgesOpened;
sint32 GeorgesX, GeorgesY, GeorgesCX, GeorgesCY;
// LogicEditor params
bool LogicEditorOpened;
sint32 LogicEditorX, LogicEditorY, LogicEditorCX, LogicEditorCY;
// Export params
SExportOptions ExportOptions;
SEnvironnement ();
bool load (const std::string &filename);
bool save (const std::string &filename);
};
// ---------------------------------------------------------------------------
class CMasterCB : public IMasterCB
{
CMainFrame *_MainFrame;
std::vector<std::string> _PrimZoneList;
std::string _Text;
std::vector<std::string> _GroupPrimList;
public:
CMasterCB ();
void setMainFrame (CMainFrame*pMF); // Link to master
// Accessors
std::vector<std::string> &getAllPrimZoneNames ();
// Overridables
// setAllPrimZoneNames : called when the list of patatoid changes
virtual void setAllPrimZoneNames (std::vector<std::string> &primZoneList);
// transfert : called when WE want to transfert text to georges
virtual void multiTransfert (const std::vector<std::string> &vText, bool append);
virtual void transfert (const std::string &sText);
// Selection line up and down
virtual void lineUp ();
virtual void lineDown ();
};
// ---------------------------------------------------------------------------
class CMainFrame : public CFrameWnd
{
SEnvironnement _Environnement;
IWorldEditor *_WorldEditor;
HMODULE _WorldEditorModule;
IGeorges *_Georges;
HMODULE _GeorgesModule;
ILogicEditor *_LogicEditor;
HMODULE _LogicEditorModule;
CMasterTreeDlg *_Tree;
std::string _ActivePath;
CMasterCB _MasterCB;
std::string _MasterExeDir;
CExport *_Export;
CExportCBDlg *_ExportCBDlg;
public:
CMainFrame ();
virtual ~CMainFrame ();
void getAllInterfaces (); // Load all dlls and get tools interfaces
void releaseAllInterfaces ();
void openFile (const std::string &fname);
void openDir (const std::string &fname);
void openDirParse (const std::string &sBaseName, const std::string &sRelativeName);
void openContinentCfgFile (const std::string &filename);
// ***********
// WORLDEDITOR
// ***********
void openWorldEditor ();
void openWorldEditorFile (const std::string &fileName);
void closeWorldEditor ();
// *******
// GEORGES
// *******
void openGeorges ();
void openGeorgesFile (const std::string &fileName);
void closeGeorges ();
void georgesSetPathesFromActive (); // Set Path from _ActiveContinent/_ActiveWorld/etc...
void georgesPutGroupText (const std::vector<std::string> &vText, bool append);
void georgesPutText (const std::string &sText);
void georgesLineUp ();
void georgesLineDown ();
void georgesCreatePlantName ();
// ***********
// LOGICEDITOR
// ***********
void openLogicEditor ();
void openLogicEditorFile (const std::string &fileName);
void closeLogicEditor ();
// *****
// TOOLS
// *****
// Tree and directories manipulation
bool createDirIfNotExist (const std::string& dirName, const std::string& errorMsg);
void deltree (const std::string &dirName);
void copytree (const std::string &srcDir, const std::string &dstDir);
void displayLastErrorDialog ();
void updateTree ();
// Continent methods
// -----------------
void continentNew ();
void continentOpen (const std::string &contName);
void continentProperties (const std::string &contName);
void continentNewRegion (const std::string &contName);
void continentDelete (const std::string &contName);
// Active path
void setActivePath (const std::string &contName);
std::string getActivePath () { return _ActivePath; }
// Region methods
// --------------
void regionOpen (const std::string &path);
void regionRename (const std::string &path);
void regionNewPrim (const std::string &path);
void regionNewGeorges (const std::string &path);
void regionNewSubRegion (const std::string &path);
void regionDelete (const std::string &path);
// File methods
// ------------
void fileOpen (const std::string &sFileFullName);
void fileRename (const std::string &sFileFullName);
void fileDelete (const std::string &sFileFullName);
void copy (const std::string &sPathSrc, const std::string &sPathDst);
#ifdef _DEBUG
virtual void AssertValid () const;
virtual void Dump (CDumpContext& dc) const;
#endif
virtual BOOL PreCreateWindow (CREATESTRUCT& cs);
virtual BOOL PreTranslateMessage (MSG*pMsg);
protected:
afx_msg void OnSize (UINT nType, int cx, int cy);
afx_msg void OnMove (int x, int y);
afx_msg int OnCreate (LPCREATESTRUCT lpCreateStruct);
afx_msg BOOL OnEraseBkgnd (CDC* pDC);
protected:
// Menu methods
afx_msg void onContinentSave ();
afx_msg void onContinentExport ();
afx_msg void OnContinentDelete ();
afx_msg void onOptionsTreeLock ();
afx_msg void onOptionsSetContinentsDir ();
afx_msg void onOptionsSetDefaultDFNDir ();
afx_msg void onOptionsSetDefaultGameElemDir ();
afx_msg void onWindowsWorldEditor ();
afx_msg void onWindowsGeorges ();
afx_msg void onWindowsLogicEditor ();
afx_msg void onWindowsReset ();
afx_msg void OnClose ();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINFRM_H__D9ABC57D_9514_49B1_A65F_1CC64C6D6BB6__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// ---------------------------------------------------------------------------
// MainFrm.h : interface of the CMainFrame class
// ---------------------------------------------------------------------------
#if !defined(AFX_MAINFRM_H__D9ABC57D_9514_49B1_A65F_1CC64C6D6BB6__INCLUDED_)
#define AFX_MAINFRM_H__D9ABC57D_9514_49B1_A65F_1CC64C6D6BB6__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ---------------------------------------------------------------------------
#include "nel/misc/stream.h"
#include "nel/misc/file.h"
#include "MasterTree.h"
#include <string>
#include "../export/export.h"
#include "../../3d/ligo/worldeditor/worldeditor_interface.h" // MasterCB
#include "easy_cfg.h"
// ---------------------------------------------------------------------------
// Interface to the tools
// ---------------------------------------------------------------------------
class IWorldEditor;
class IGeorges;
class ILogicEditor;
class CMainFrame;
class CExportCBDlg;
// ---------------------------------------------------------------------------
// Do not parse following directories
#define MAX_SYS_DIR 7
extern char *gSysDir[MAX_SYS_DIR];
// Do not display files with those extensions
#define MAX_INVALID_EXT 1
extern char *gInvalidExt[MAX_INVALID_EXT];
// ---------------------------------------------------------------------------
struct SEnvironnement : public IEasyCFG
{
// Master params
sint32 MasterX, MasterY;
sint32 MasterTreeX, MasterTreeY;
sint32 MasterTreeCX, MasterTreeCY;
bool MasterTreeLocked;
std::string ContinentsDir;
std::string DefaultDFNDir;
std::string DefaultGameElemDir;
// WorldEditor params
bool WorldEdOpened;
sint32 WorldEdX, WorldEdY, WorldEdCX, WorldEdCY;
// Georges params
bool GeorgesOpened;
sint32 GeorgesX, GeorgesY, GeorgesCX, GeorgesCY;
// LogicEditor params
bool LogicEditorOpened;
sint32 LogicEditorX, LogicEditorY, LogicEditorCX, LogicEditorCY;
// Export params
SExportOptions ExportOptions;
SEnvironnement ();
bool load (const std::string &filename);
bool save (const std::string &filename);
};
// ---------------------------------------------------------------------------
class CMasterCB : public IMasterCB
{
CMainFrame *_MainFrame;
std::vector<std::string> _PrimZoneList;
std::string _Text;
std::vector<std::string> _GroupPrimList;
public:
CMasterCB ();
void setMainFrame (CMainFrame*pMF); // Link to master
// Accessors
std::vector<std::string> &getAllPrimZoneNames ();
// Overridables
// setAllPrimZoneNames : called when the list of patatoid changes
virtual void setAllPrimZoneNames (std::vector<std::string> &primZoneList);
// transfert : called when WE want to transfert text to georges
virtual void multiTransfert (const std::vector<std::string> &vText, bool append);
virtual void transfert (const std::string &sText);
// Selection line up and down
virtual void lineUp ();
virtual void lineDown ();
};
// ---------------------------------------------------------------------------
class CMainFrame : public CFrameWnd
{
SEnvironnement _Environnement;
IWorldEditor *_WorldEditor;
HMODULE _WorldEditorModule;
IGeorges *_Georges;
HMODULE _GeorgesModule;
ILogicEditor *_LogicEditor;
HMODULE _LogicEditorModule;
CMasterTreeDlg *_Tree;
std::string _ActivePath;
CMasterCB _MasterCB;
std::string _MasterExeDir;
CExport *_Export;
CExportCBDlg *_ExportCBDlg;
public:
CMainFrame ();
virtual ~CMainFrame ();
void getAllInterfaces (); // Load all dlls and get tools interfaces
void releaseAllInterfaces ();
void openFile (const std::string &fname);
void openDir (const std::string &fname);
void openDirParse (const std::string &sBaseName, const std::string &sRelativeName);
void openContinentCfgFile (const std::string &filename);
// ***********
// WORLDEDITOR
// ***********
void openWorldEditor ();
void openWorldEditorFile (const std::string &fileName);
void closeWorldEditor ();
// *******
// GEORGES
// *******
void openGeorges ();
void openGeorgesFile (const std::string &fileName);
void closeGeorges ();
void georgesSetPathesFromActive (); // Set Path from _ActiveContinent/_ActiveWorld/etc...
void georgesPutGroupText (const std::vector<std::string> &vText, bool append);
void georgesPutText (const std::string &sText);
void georgesLineUp ();
void georgesLineDown ();
void georgesCreatePlantName ();
// ***********
// LOGICEDITOR
// ***********
void openLogicEditor ();
void openLogicEditorFile (const std::string &fileName);
void closeLogicEditor ();
// *****
// TOOLS
// *****
// Tree and directories manipulation
bool createDirIfNotExist (const std::string& dirName, const std::string& errorMsg);
void deltree (const std::string &dirName);
void copytree (const std::string &srcDir, const std::string &dstDir);
void displayLastErrorDialog ();
void updateTree ();
// Continent methods
// -----------------
void continentNew ();
void continentOpen (const std::string &contName);
void continentProperties (const std::string &contName);
void continentNewRegion (const std::string &contName);
void continentDelete (const std::string &contName);
// Active path
void setActivePath (const std::string &contName);
std::string getActivePath () { return _ActivePath; }
// Region methods
// --------------
void regionOpen (const std::string &path);
void regionRename (const std::string &path);
void regionNewPrim (const std::string &path);
void regionNewGeorges (const std::string &path);
void regionNewSubRegion (const std::string &path);
void regionDelete (const std::string &path);
// File methods
// ------------
void fileOpen (const std::string &sFileFullName);
void fileRename (const std::string &sFileFullName);
void fileDelete (const std::string &sFileFullName);
void copy (const std::string &sPathSrc, const std::string &sPathDst);
#ifdef _DEBUG
virtual void AssertValid () const;
virtual void Dump (CDumpContext& dc) const;
#endif
virtual BOOL PreCreateWindow (CREATESTRUCT& cs);
virtual BOOL PreTranslateMessage (MSG*pMsg);
protected:
afx_msg void OnSize (UINT nType, int cx, int cy);
afx_msg void OnMove (int x, int y);
afx_msg int OnCreate (LPCREATESTRUCT lpCreateStruct);
afx_msg BOOL OnEraseBkgnd (CDC* pDC);
protected:
// Menu methods
afx_msg void onContinentSave ();
afx_msg void onContinentExport ();
afx_msg void OnContinentDelete ();
afx_msg void onOptionsTreeLock ();
afx_msg void onOptionsSetContinentsDir ();
afx_msg void onOptionsSetDefaultDFNDir ();
afx_msg void onOptionsSetDefaultGameElemDir ();
afx_msg void onWindowsWorldEditor ();
afx_msg void onWindowsGeorges ();
afx_msg void onWindowsLogicEditor ();
afx_msg void onWindowsReset ();
afx_msg void OnClose ();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINFRM_H__D9ABC57D_9514_49B1_A65F_1CC64C6D6BB6__INCLUDED_)

File diff suppressed because it is too large Load Diff

@ -1,182 +1,182 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef __MASTERTREE_H__
#define __MASTERTREE_H__
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MasterTree.h : header file
//
#include <string>
#include <map>
/////////////////////////////////////////////////////////////////////////////
#define MT_SORT_BY_NAME_INC 0
#define MT_SORT_BY_NAME_DEC 1
#define MT_SORT_BY_DATE_INC 2
#define MT_SORT_BY_DATE_DEC 3
/////////////////////////////////////////////////////////////////////////////
// CMasterTree Control
/////////////////////////////////////////////////////////////////////////////
class CMasterTree : public CTreeCtrl
{
bool _LDrag;
CImageList *_DragImg;
HTREEITEM _DragItem;
HTREEITEM _LastItemSelected;
HTREEITEM _LastActiveContinent;
UINT m_nTimerID;
UINT m_timerticks;
public:
CMasterTree ();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnLBeginDrag (NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnMouseMove (UINT nFlags, CPoint point);
afx_msg void OnLButtonDown (UINT nFlags, CPoint point);
afx_msg void OnLButtonUp (UINT nFlags, CPoint point);
afx_msg void OnLButtonDblClk (UINT nFlags, CPoint point);
afx_msg void OnRButtonDown (UINT nFlags, CPoint point);
// Continent menus (a level under the root)
afx_msg void OnMenuNewContinent ();
afx_msg void OnMenuContinentOpen ();
afx_msg void OnMenuContinentProperties ();
afx_msg void OnMenuContinentNewRegion ();
afx_msg void OnMenuContinentDelete ();
// Regions menus (a level under the continent)
afx_msg void OnMenuRegionOpen ();
afx_msg void OnMenuRegionRename ();
afx_msg void OnMenuRegionNewSubRegion ();
afx_msg void OnMenuRegionNewPrim ();
afx_msg void OnMenuRegionNewGeorges ();
afx_msg void OnMenuRegionDelete ();
// File menus (a level under the Region)
afx_msg void OnMenuFileOpen ();
afx_msg void OnMenuFileRename ();
afx_msg void OnMenuFileDelete ();
std::string getCurrentPath ();
DECLARE_MESSAGE_MAP()
private:
// TOOLS
std::string getPath (HTREEITEM ht);
HTREEITEM getContinent (HTREEITEM ht);
HTREEITEM getRegion (HTREEITEM ht);
bool isFile (HTREEITEM ht);
};
/////////////////////////////////////////////////////////////////////////////
// CMasterTreeDlg Dialog
/////////////////////////////////////////////////////////////////////////////
class CMasterTreeDlg : public CDialog
{
CMasterTree *_Tree;
std::map<HTREEITEM,std::string> _Files;
char ContinentSortBy; // 0/1 - Sort by name increasing(z-a)/decreasing(a-z)
char TrashSortBy; // 2/3 - Sort by date increasing(new-old)/decreasing(old-new)
char BackupSortBy;
private:
void parseAdd (HTREEITEM itRoot, const std::string &path, char nSortType, int DirDepth = 0);
public:
CMasterTreeDlg(); // standard constructor
HTREEITEM activate (const std::string& EltName, HTREEITEM parent);
void update (const std::string& ContinentsPath);
void openFile (const std::string &fname);
void openDir (const std::string &fname);
void continentNew ();
void sortContinentBy (int mt_sort_type);
// Continent byPass
void continentDelete (const std::string &Continent);
void continentProperties (const std::string &Continent);
void continentNewRegion (const std::string &Continent);
void continentOpen (const std::string &Continent);
// Region byPass
void regionOpen (const std::string &path);
void regionRename (const std::string &path);
void regionNewPrim (const std::string &path);
void regionNewGeorges (const std::string &path);
void regionNewSubRegion (const std::string &path);
void regionDelete (const std::string &path);
// File byPass
void fileOpen (const std::string &sFileFullName);
void fileRename (const std::string &sFileFullName);
void fileDelete (const std::string &sFileFullName);
void copy (const std::string &pathSrc, const std::string &pathDst);
enum { IDD = IDD_MASTERTREE };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// Implementation
protected:
BOOL OnInitDialog ();
void OnCancel ();
void OnOK ();
afx_msg void OnSize (UINT nType, int cx, int cy);
afx_msg void OnExpanding (LPNMHDR pnmhdr, LRESULT *pLResult);
afx_msg void OnLDblClkTree(NMHDR* pNMHDR, LRESULT* pResult);
DECLARE_MESSAGE_MAP()
// Friends
friend class CMasterTree;
};
#endif // __MASTERTREE_H__
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef __MASTERTREE_H__
#define __MASTERTREE_H__
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// MasterTree.h : header file
//
#include <string>
#include <map>
/////////////////////////////////////////////////////////////////////////////
#define MT_SORT_BY_NAME_INC 0
#define MT_SORT_BY_NAME_DEC 1
#define MT_SORT_BY_DATE_INC 2
#define MT_SORT_BY_DATE_DEC 3
/////////////////////////////////////////////////////////////////////////////
// CMasterTree Control
/////////////////////////////////////////////////////////////////////////////
class CMasterTree : public CTreeCtrl
{
bool _LDrag;
CImageList *_DragImg;
HTREEITEM _DragItem;
HTREEITEM _LastItemSelected;
HTREEITEM _LastActiveContinent;
UINT m_nTimerID;
UINT m_timerticks;
public:
CMasterTree ();
afx_msg void OnTimer(UINT nIDEvent);
afx_msg void OnLBeginDrag (NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnMouseMove (UINT nFlags, CPoint point);
afx_msg void OnLButtonDown (UINT nFlags, CPoint point);
afx_msg void OnLButtonUp (UINT nFlags, CPoint point);
afx_msg void OnLButtonDblClk (UINT nFlags, CPoint point);
afx_msg void OnRButtonDown (UINT nFlags, CPoint point);
// Continent menus (a level under the root)
afx_msg void OnMenuNewContinent ();
afx_msg void OnMenuContinentOpen ();
afx_msg void OnMenuContinentProperties ();
afx_msg void OnMenuContinentNewRegion ();
afx_msg void OnMenuContinentDelete ();
// Regions menus (a level under the continent)
afx_msg void OnMenuRegionOpen ();
afx_msg void OnMenuRegionRename ();
afx_msg void OnMenuRegionNewSubRegion ();
afx_msg void OnMenuRegionNewPrim ();
afx_msg void OnMenuRegionNewGeorges ();
afx_msg void OnMenuRegionDelete ();
// File menus (a level under the Region)
afx_msg void OnMenuFileOpen ();
afx_msg void OnMenuFileRename ();
afx_msg void OnMenuFileDelete ();
std::string getCurrentPath ();
DECLARE_MESSAGE_MAP()
private:
// TOOLS
std::string getPath (HTREEITEM ht);
HTREEITEM getContinent (HTREEITEM ht);
HTREEITEM getRegion (HTREEITEM ht);
bool isFile (HTREEITEM ht);
};
/////////////////////////////////////////////////////////////////////////////
// CMasterTreeDlg Dialog
/////////////////////////////////////////////////////////////////////////////
class CMasterTreeDlg : public CDialog
{
CMasterTree *_Tree;
std::map<HTREEITEM,std::string> _Files;
char ContinentSortBy; // 0/1 - Sort by name increasing(z-a)/decreasing(a-z)
char TrashSortBy; // 2/3 - Sort by date increasing(new-old)/decreasing(old-new)
char BackupSortBy;
private:
void parseAdd (HTREEITEM itRoot, const std::string &path, char nSortType, int DirDepth = 0);
public:
CMasterTreeDlg(); // standard constructor
HTREEITEM activate (const std::string& EltName, HTREEITEM parent);
void update (const std::string& ContinentsPath);
void openFile (const std::string &fname);
void openDir (const std::string &fname);
void continentNew ();
void sortContinentBy (int mt_sort_type);
// Continent byPass
void continentDelete (const std::string &Continent);
void continentProperties (const std::string &Continent);
void continentNewRegion (const std::string &Continent);
void continentOpen (const std::string &Continent);
// Region byPass
void regionOpen (const std::string &path);
void regionRename (const std::string &path);
void regionNewPrim (const std::string &path);
void regionNewGeorges (const std::string &path);
void regionNewSubRegion (const std::string &path);
void regionDelete (const std::string &path);
// File byPass
void fileOpen (const std::string &sFileFullName);
void fileRename (const std::string &sFileFullName);
void fileDelete (const std::string &sFileFullName);
void copy (const std::string &pathSrc, const std::string &pathDst);
enum { IDD = IDD_MASTERTREE };
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
// Implementation
protected:
BOOL OnInitDialog ();
void OnCancel ();
void OnOK ();
afx_msg void OnSize (UINT nType, int cx, int cy);
afx_msg void OnExpanding (LPNMHDR pnmhdr, LRESULT *pLResult);
afx_msg void OnLDblClkTree(NMHDR* pNMHDR, LRESULT* pResult);
DECLARE_MESSAGE_MAP()
// Friends
friend class CMasterTree;
};
#endif // __MASTERTREE_H__

@ -1,79 +1,79 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// NewRegion.cpp : implementation file
//
#include "stdafx.h"
#include "master.h"
#include "NameEditDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRegionPropertiesDlg dialog
CNameEditDlg::CNameEditDlg(CWnd* pParent /*=NULL*/)
: CDialog(CNameEditDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CRegionPropertiesDlg)
Title = _T("");
Comment = _T("");
Name = _T("");
//}}AFX_DATA_INIT
}
void CNameEditDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CRegionPropertiesDlg)
DDX_Text(pDX, IDC_EDIT_NAME, Name);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CNameEditDlg, CDialog)
//{{AFX_MSG_MAP(CRegionPropertiesDlg)
ON_WM_SHOWWINDOW ()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRegionPropertiesDlg message handlers
BOOL CNameEditDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
SetWindowText (Title);
CStatic *pS = (CStatic*)GetDlgItem (IDC_COMMENT);
pS->SetWindowText (Comment);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CNameEditDlg::OnShowWindow (BOOL bShow, UINT nStatus)
{
CEdit *pEd = (CEdit*)GetDlgItem(IDC_EDIT_NAME);
pEd->SetSel (0,-1);
pEd->SetFocus ();
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// NewRegion.cpp : implementation file
//
#include "stdafx.h"
#include "master.h"
#include "NameEditDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CRegionPropertiesDlg dialog
CNameEditDlg::CNameEditDlg(CWnd* pParent /*=NULL*/)
: CDialog(CNameEditDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CRegionPropertiesDlg)
Title = _T("");
Comment = _T("");
Name = _T("");
//}}AFX_DATA_INIT
}
void CNameEditDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CRegionPropertiesDlg)
DDX_Text(pDX, IDC_EDIT_NAME, Name);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CNameEditDlg, CDialog)
//{{AFX_MSG_MAP(CRegionPropertiesDlg)
ON_WM_SHOWWINDOW ()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CRegionPropertiesDlg message handlers
BOOL CNameEditDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
SetWindowText (Title);
CStatic *pS = (CStatic*)GetDlgItem (IDC_COMMENT);
pS->SetWindowText (Comment);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CNameEditDlg::OnShowWindow (BOOL bShow, UINT nStatus)
{
CEdit *pEd = (CEdit*)GetDlgItem(IDC_EDIT_NAME);
pEd->SetSel (0,-1);
pEd->SetFocus ();
}

@ -1,62 +1,62 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef __REGION_PROPERTIES_DLG__
#define __REGION_PROPERTIES_DLG__
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// NewRegion.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// NewRegion dialog
class CNameEditDlg : public CDialog
{
// Construction
public:
CNameEditDlg (CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CNewRegion)
enum { IDD = IDD_NAME_EDIT };
CString Title;
CString Comment;
CString Name;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNewRegion)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CNewRegion)
virtual BOOL OnInitDialog ();
afx_msg void OnShowWindow( BOOL bShow, UINT nStatus );
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif // __REGION_PROPERTIES_DLG__
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef __REGION_PROPERTIES_DLG__
#define __REGION_PROPERTIES_DLG__
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// NewRegion.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// NewRegion dialog
class CNameEditDlg : public CDialog
{
// Construction
public:
CNameEditDlg (CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CNewRegion)
enum { IDD = IDD_NAME_EDIT };
CString Title;
CString Comment;
CString Name;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CNewRegion)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CNewRegion)
virtual BOOL OnInitDialog ();
afx_msg void OnShowWindow( BOOL bShow, UINT nStatus );
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif // __REGION_PROPERTIES_DLG__

@ -1,98 +1,98 @@
****************
* Master Tools *
****************
3 Main directories : Continents / Backup / Trash
------------------------------------------------
A World (like Continents or Backup) is a group of directories.
Each directory is a continent. And a continent is made by a
file continent.cfg which contains basics information about the
continent. A continent contains directories which represents regions
Example of directories
+ Continents
+ Fyros
+ near_the_city
+ oasis
oasis.flora
oasisflora.prim
fyros.tribe
respawn.prim
+ near_holes
continent.cfg
fyros.continent
+ Matis
+ Tryker
+ Backup
+ Trash
Backup/clean : keep the most recent version of all inside the backup
including continent and tag (tags are all the Continents world at a certain date)
Other launchable tools
----------------------
This tools regroup the 3 other tools in a common workspace.
- WorldEditor : Easily generates landscapes and primitives
- LogicEditor : Condition and trigger tools
- Georges : Edit the monsters, the primitives description and so on
With the master tool you can export vegetable through the landscape.
Simply create a new form herited from a vegetable.dfn and edit it.
The fields are
+ Include_patats A set of patats in which we will plant the "Plants"
+ Exclude_patats A set of patats in which the "Plants" will never appear
+ Plants A structure of plants
+ Name The name of the plant
+ Shape The .shape associated
+ Shadow The shape that will generate the shadows on the landscape
+ CollisionRadius The radius of the base of the plant (serve to plant it on the ground)
+ BundingRadius The minimum radius that between the center of the plant and another plant
+ Jitter_Pos The "randomness" of the position of the plants in the patat (from 0.0 (order) to 1.0 (random))
+ Scale_Min Minimum scaling for all plants ( normal scale is 1.0)
+ Scale_Max Maximum scale for all plants
+ Put_On_Water Do we have to put the plant on the water ?
+ Water_Height If we put the plant on water at which height is the water.
+ Random_Seed Number between 0 and 4,294,967,295 that initialize the random generation
WorldEditor
-----------
WorldEditor needs some directories to functionnate :
ZoneBitmaps (contains the .TGA from the max plugin)
ZoneLigos (contains the .LIGOZONE from the max plugin)
In the integrated mode (when launched from the master tool) you cannot paint zones.
This functionnality is accessible when you execute the stand alone program which is just
a DLL loader. You have access to the .prim edition of the zone and can link your primitives
to contents (vegetable plants, construction, IA zones, etc.) with the georges tool.
LogicEditor
-----------
This is a stand alone tool. It does not need any system data.
Georges
-------
Georges needs a root directory with a subdirectory called "DFN" (This directory regroups
the .DFN definition of a type class).
RESTRICTIONS
************
Do not use prim.dfn, land.dfn nor logic.dfn in georges, else if you
instanciate those you will get xxx.logic or something like that which
****************
* Master Tools *
****************
3 Main directories : Continents / Backup / Trash
------------------------------------------------
A World (like Continents or Backup) is a group of directories.
Each directory is a continent. And a continent is made by a
file continent.cfg which contains basics information about the
continent. A continent contains directories which represents regions
Example of directories
+ Continents
+ Fyros
+ near_the_city
+ oasis
oasis.flora
oasisflora.prim
fyros.tribe
respawn.prim
+ near_holes
continent.cfg
fyros.continent
+ Matis
+ Tryker
+ Backup
+ Trash
Backup/clean : keep the most recent version of all inside the backup
including continent and tag (tags are all the Continents world at a certain date)
Other launchable tools
----------------------
This tools regroup the 3 other tools in a common workspace.
- WorldEditor : Easily generates landscapes and primitives
- LogicEditor : Condition and trigger tools
- Georges : Edit the monsters, the primitives description and so on
With the master tool you can export vegetable through the landscape.
Simply create a new form herited from a vegetable.dfn and edit it.
The fields are
+ Include_patats A set of patats in which we will plant the "Plants"
+ Exclude_patats A set of patats in which the "Plants" will never appear
+ Plants A structure of plants
+ Name The name of the plant
+ Shape The .shape associated
+ Shadow The shape that will generate the shadows on the landscape
+ CollisionRadius The radius of the base of the plant (serve to plant it on the ground)
+ BundingRadius The minimum radius that between the center of the plant and another plant
+ Jitter_Pos The "randomness" of the position of the plants in the patat (from 0.0 (order) to 1.0 (random))
+ Scale_Min Minimum scaling for all plants ( normal scale is 1.0)
+ Scale_Max Maximum scale for all plants
+ Put_On_Water Do we have to put the plant on the water ?
+ Water_Height If we put the plant on water at which height is the water.
+ Random_Seed Number between 0 and 4,294,967,295 that initialize the random generation
WorldEditor
-----------
WorldEditor needs some directories to functionnate :
ZoneBitmaps (contains the .TGA from the max plugin)
ZoneLigos (contains the .LIGOZONE from the max plugin)
In the integrated mode (when launched from the master tool) you cannot paint zones.
This functionnality is accessible when you execute the stand alone program which is just
a DLL loader. You have access to the .prim edition of the zone and can link your primitives
to contents (vegetable plants, construction, IA zones, etc.) with the georges tool.
LogicEditor
-----------
This is a stand alone tool. It does not need any system data.
Georges
-------
Georges needs a root directory with a subdirectory called "DFN" (This directory regroups
the .DFN definition of a type class).
RESTRICTIONS
************
Do not use prim.dfn, land.dfn nor logic.dfn in georges, else if you
instanciate those you will get xxx.logic or something like that which
could be not easy to differenciate from a worldeditor logic file.

@ -1,24 +1,24 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// stdafx.cpp : source file that includes just the standard includes
// master.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// stdafx.cpp : source file that includes just the standard includes
// master.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

@ -1,49 +1,49 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__9C164BA4_D949_42A3_897E_0DF639A02E19__INCLUDED_)
#define AFX_STDAFX_H__9C164BA4_D949_42A3_897E_0DF639A02E19__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef _CONSOLE
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#endif // _CONSOLE
#undef min
#undef max
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__9C164BA4_D949_42A3_897E_0DF639A02E19__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__9C164BA4_D949_42A3_897E_0DF639A02E19__INCLUDED_)
#define AFX_STDAFX_H__9C164BA4_D949_42A3_897E_0DF639A02E19__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef _CONSOLE
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#endif // _CONSOLE
#undef min
#undef max
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__9C164BA4_D949_42A3_897E_0DF639A02E19__INCLUDED_)

@ -1,158 +1,158 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
#include "easy_cfg.h"
#include "nel/misc/config_file.h"
using namespace NLMISC;
using namespace std;
// ---------------------------------------------------------------------------
IEasyCFG::IEasyCFG()
{
cf = NULL;
f = NULL;
}
// ---------------------------------------------------------------------------
IEasyCFG::~IEasyCFG()
{
if (cf != NULL)
delete cf;
cf = NULL;
if (f != NULL)
fclose(f);
f = NULL;
}
// ---------------------------------------------------------------------------
bool IEasyCFG::openRead (const std::string &filename)
{
try
{
FILE *fTemp = fopen (filename.c_str(), "rt");
if (fTemp == NULL)
return false;
else
fclose(fTemp);
cf = new CConfigFile;
cf->load (filename);
}
catch (Exception &)
{
return false;
}
return true;
}
// ---------------------------------------------------------------------------
bool IEasyCFG::openWrite (const std::string &filename)
{
f = fopen (filename.c_str(), "wt");
if (f == NULL)
return false;
return true;
}
// ---------------------------------------------------------------------------
void IEasyCFG::close ()
{
if (cf != NULL)
delete cf;
cf = NULL;
if (f != NULL)
fclose (f);
f = NULL;
}
// ---------------------------------------------------------------------------
sint32 IEasyCFG::getInt (const string &sVarName)
{
if (cf == NULL)
return 0;
try
{
CConfigFile::CVar &cv = cf->getVar(sVarName);
return cv.asInt();
}
catch (Exception &)
{
return 0;
}
}
// ---------------------------------------------------------------------------
void IEasyCFG::putInt (const string &sVarName, sint32 sVarValue)
{
if (f == NULL)
return;
fprintf (f, "%s = %d;\n", sVarName.c_str(), sVarValue);
}
// ---------------------------------------------------------------------------
string IEasyCFG::getStr (const string &sVarName)
{
if (cf == NULL)
return string("");
try
{
CConfigFile::CVar &cv = cf->getVar(sVarName);
return cv.asString();
}
catch (Exception &)
{
return string("");
}
}
// ---------------------------------------------------------------------------
void IEasyCFG::putStr (const string &sVarName, const string &sVarValue)
{
if (f == NULL)
return;
fprintf (f, "%s = \"%s\";\n", sVarName.c_str(), sVarValue.c_str());
}
// ---------------------------------------------------------------------------
bool IEasyCFG::getBool (const string &sVarName)
{
if (cf == NULL)
return false;
return (getStr (sVarName) == "true" ? true : false);
}
// ---------------------------------------------------------------------------
void IEasyCFG::putBool (const string &sVarName, bool sVarValue)
{
if (f == NULL)
return;
if (sVarValue)
fprintf (f, "%s = \"true\";\n", sVarName.c_str());
else
fprintf (f, "%s = \"false\";\n", sVarName.c_str());
}
// ---------------------------------------------------------------------------
void IEasyCFG::putCommentLine (const std::string &sComments)
{
if (f == NULL)
return;
fprintf (f, "// %s\n", sComments.c_str());
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
#include "easy_cfg.h"
#include "nel/misc/config_file.h"
using namespace NLMISC;
using namespace std;
// ---------------------------------------------------------------------------
IEasyCFG::IEasyCFG()
{
cf = NULL;
f = NULL;
}
// ---------------------------------------------------------------------------
IEasyCFG::~IEasyCFG()
{
if (cf != NULL)
delete cf;
cf = NULL;
if (f != NULL)
fclose(f);
f = NULL;
}
// ---------------------------------------------------------------------------
bool IEasyCFG::openRead (const std::string &filename)
{
try
{
FILE *fTemp = fopen (filename.c_str(), "rt");
if (fTemp == NULL)
return false;
else
fclose(fTemp);
cf = new CConfigFile;
cf->load (filename);
}
catch (Exception &)
{
return false;
}
return true;
}
// ---------------------------------------------------------------------------
bool IEasyCFG::openWrite (const std::string &filename)
{
f = fopen (filename.c_str(), "wt");
if (f == NULL)
return false;
return true;
}
// ---------------------------------------------------------------------------
void IEasyCFG::close ()
{
if (cf != NULL)
delete cf;
cf = NULL;
if (f != NULL)
fclose (f);
f = NULL;
}
// ---------------------------------------------------------------------------
sint32 IEasyCFG::getInt (const string &sVarName)
{
if (cf == NULL)
return 0;
try
{
CConfigFile::CVar &cv = cf->getVar(sVarName);
return cv.asInt();
}
catch (Exception &)
{
return 0;
}
}
// ---------------------------------------------------------------------------
void IEasyCFG::putInt (const string &sVarName, sint32 sVarValue)
{
if (f == NULL)
return;
fprintf (f, "%s = %d;\n", sVarName.c_str(), sVarValue);
}
// ---------------------------------------------------------------------------
string IEasyCFG::getStr (const string &sVarName)
{
if (cf == NULL)
return string("");
try
{
CConfigFile::CVar &cv = cf->getVar(sVarName);
return cv.asString();
}
catch (Exception &)
{
return string("");
}
}
// ---------------------------------------------------------------------------
void IEasyCFG::putStr (const string &sVarName, const string &sVarValue)
{
if (f == NULL)
return;
fprintf (f, "%s = \"%s\";\n", sVarName.c_str(), sVarValue.c_str());
}
// ---------------------------------------------------------------------------
bool IEasyCFG::getBool (const string &sVarName)
{
if (cf == NULL)
return false;
return (getStr (sVarName) == "true" ? true : false);
}
// ---------------------------------------------------------------------------
void IEasyCFG::putBool (const string &sVarName, bool sVarValue)
{
if (f == NULL)
return;
if (sVarValue)
fprintf (f, "%s = \"true\";\n", sVarName.c_str());
else
fprintf (f, "%s = \"false\";\n", sVarName.c_str());
}
// ---------------------------------------------------------------------------
void IEasyCFG::putCommentLine (const std::string &sComments)
{
if (f == NULL)
return;
fprintf (f, "// %s\n", sComments.c_str());
}

@ -1,58 +1,58 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef __EASY_CFG_H__
#define __EASY_CFG_H__
#include <string>
#include "nel/misc/types_nl.h"
namespace NLMISC
{
class CConfigFile;
}
struct IEasyCFG
{
IEasyCFG ();
~IEasyCFG ();
bool openRead (const std::string &filename);
bool openWrite (const std::string &filename);
void close ();
// Read/Write int
sint32 getInt (const std::string &sVarName);
void putInt (const std::string &sVarName, sint32 sVarValue);
// Read/Write string
std::string getStr (const std::string &sVarName);
void putStr (const std::string &sVarName, const std::string &sVarValue);
// Read/Write boolean
bool getBool (const std::string &sVarName);
void putBool (const std::string &sVarName, bool sVarValue);
// Put a comment line (in write mode only)
void putCommentLine (const std::string &sComments);
virtual bool load (const std::string &filename) = 0;
virtual bool save (const std::string &filename) = 0;
NLMISC::CConfigFile *cf;
FILE *f;
};
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef __EASY_CFG_H__
#define __EASY_CFG_H__
#include <string>
#include "nel/misc/types_nl.h"
namespace NLMISC
{
class CConfigFile;
}
struct IEasyCFG
{
IEasyCFG ();
~IEasyCFG ();
bool openRead (const std::string &filename);
bool openWrite (const std::string &filename);
void close ();
// Read/Write int
sint32 getInt (const std::string &sVarName);
void putInt (const std::string &sVarName, sint32 sVarValue);
// Read/Write string
std::string getStr (const std::string &sVarName);
void putStr (const std::string &sVarName, const std::string &sVarValue);
// Read/Write boolean
bool getBool (const std::string &sVarName);
void putBool (const std::string &sVarName, bool sVarValue);
// Put a comment line (in write mode only)
void putCommentLine (const std::string &sComments);
virtual bool load (const std::string &filename) = 0;
virtual bool save (const std::string &filename) = 0;
NLMISC::CConfigFile *cf;
FILE *f;
};
#endif // __EASY_CFG_H__

@ -1,169 +1,169 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// master.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "master.h"
#include "MainFrm.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#ifdef NL_NEW
#undef new
#endif
/////////////////////////////////////////////////////////////////////////////
// CMasterApp
BEGIN_MESSAGE_MAP(CMasterApp, CWinApp)
//{{AFX_MSG_MAP(CMasterApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMasterApp construction
CMasterApp::CMasterApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
m_pMainWnd = NULL;
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CMasterApp object
CMasterApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CMasterApp initialization
BOOL CMasterApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
CMainFrame *pMF = new CMainFrame();
pMF->LoadFrame(IDR_MAINFRAME);
m_pMainWnd = pMF;
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
BOOL CMasterApp::PreTranslateMessage (MSG*pMsg)
{
if (m_pMainWnd != NULL)
return ((CMainFrame*)m_pMainWnd)->PreTranslateMessage (pMsg);
return FALSE;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CMasterApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CMasterApp message handlers
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// master.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "master.h"
#include "MainFrm.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#ifdef NL_NEW
#undef new
#endif
/////////////////////////////////////////////////////////////////////////////
// CMasterApp
BEGIN_MESSAGE_MAP(CMasterApp, CWinApp)
//{{AFX_MSG_MAP(CMasterApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMasterApp construction
CMasterApp::CMasterApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
m_pMainWnd = NULL;
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CMasterApp object
CMasterApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CMasterApp initialization
BOOL CMasterApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
CMainFrame *pMF = new CMainFrame();
pMF->LoadFrame(IDR_MAINFRAME);
m_pMainWnd = pMF;
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The one and only window has been initialized, so show and update it.
m_pMainWnd->ShowWindow(SW_SHOW);
m_pMainWnd->UpdateWindow();
return TRUE;
}
BOOL CMasterApp::PreTranslateMessage (MSG*pMsg)
{
if (m_pMainWnd != NULL)
return ((CMainFrame*)m_pMainWnd)->PreTranslateMessage (pMsg);
return FALSE;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
// No message handlers
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
// No message handlers
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CMasterApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CMasterApp message handlers

@ -1,66 +1,66 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// master.h : main header file for the MASTER application
//
#if !defined(AFX_MASTER_H__D57178C3_47CE_46E4_948A_55FCB49181A9__INCLUDED_)
#define AFX_MASTER_H__D57178C3_47CE_46E4_948A_55FCB49181A9__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CMasterApp:
// See master.cpp for the implementation of this class
//
class CMasterApp : public CWinApp
{
public:
CMasterApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMasterApp)
public:
virtual BOOL InitInstance();
virtual BOOL PreTranslateMessage(MSG*pMsg);
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CMasterApp)
afx_msg void OnAppAbout();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MASTER_H__D57178C3_47CE_46E4_948A_55FCB49181A9__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// master.h : main header file for the MASTER application
//
#if !defined(AFX_MASTER_H__D57178C3_47CE_46E4_948A_55FCB49181A9__INCLUDED_)
#define AFX_MASTER_H__D57178C3_47CE_46E4_948A_55FCB49181A9__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CMasterApp:
// See master.cpp for the implementation of this class
//
class CMasterApp : public CWinApp
{
public:
CMasterApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMasterApp)
public:
virtual BOOL InitInstance();
virtual BOOL PreTranslateMessage(MSG*pMsg);
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CMasterApp)
afx_msg void OnAppAbout();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MASTER_H__D57178C3_47CE_46E4_948A_55FCB49181A9__INCLUDED_)

@ -1,108 +1,108 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by master.rc
//
#define IDOK2 2
#define IDOK3 3
#define IDOK4 4
#define IDD_ABOUTBOX 100
#define IDR_MAINFRAME 128
#define IDR_MASTERTYPE 129
#define IDD_MASTERTREE 130
#define IDI_FOLDER 131
#define IDI_FILE 132
#define IDD_NEWREGION 133
#define IDI_CONTINENTS 134
#define IDI_BACKUP 135
#define IDI_TRASH 136
#define IDD_CHOOSETAG 137
#define IDD_CHOOSEDIR 138
#define IDD_PRIMNAME 139
#define IDD_GEORGESFORM 140
#define IDD_EXPORTOPT 141
#define IDD_EXPORTCB 142
#define IDD_REGION_PROPERTIES 143
#define IDD_NAME_EDIT 143
#define IDD_CONTINENT_PROPERTIES 148
#define IDC_EDIT1 1001
#define IDC_LIST 1002
#define IDC_EDIT_CONTINENT_NAME 1002
#define IDC_GENERATE_LANDSCAPE 1004
#define IDC_GENERATE_VEGETABLE 1005
#define IDC_OUT_LANDSCAPE_DIR 1006
#define IDC_EXPLORE_LANDSCAPE 1007
#define IDC_OUT_VEGETABLE_DIR 1008
#define IDC_EXPLORE_VEGETABLE 1009
#define IDC_CONTINENTLIST 1010
#define IDC_LAND_BANK_FILE 1011
#define IDC_EXPLORE_LAND_BANK_FILE 1012
#define IDC_LAND_FAR_BANK_FILE 1013
#define IDC_EDIT_REGION_NAME 1013
#define IDC_EDIT_NAME 1013
#define IDC_EXPLORE_LAND_FAR_BANK_FILE 1014
#define IDC_COMMENT 1014
#define IDC_LAND_TILE_NOISE_DIR 1015
#define IDC_EXPLORE_LAND_TILE_NOISE_DIR 1016
#define IDC_BUTTON_LANDDIR 1017
#define IDC_EDIT_DFNDIR 1018
#define IDC_BUTTON_DFNDIR 1019
#define IDC_EDIT_GAMEELEMDIR 1020
#define IDC_BUTTON_GAMEELEMDIR 1021
#define IDC_PASS 1111
#define IDC_PROGRESS1 1112
#define IDC_EDIT_LANDFILE 1114
#define IDC_BUTTON_LANDFILE 1115
#define IDC_EDIT_LANDDIR 1116
#define ID_CONTINENT_NEW 32771
#define ID_CONTINENT_SAVE 32773
#define ID_OPTIONS_TREELOCK 32774
#define ID_WINDOWS_WORLDEDITOR 32775
#define ID_OPTIONS_SETROOT 32776
#define ID_OPTIONS_SETCONTINENTSDIR 32776
#define ID_CONTINENT_EMPTY_TRASH 32777
#define ID_CONTINENT_EMPTY_BACKUP 32778
#define ID_CONTINENT_CONTINENT_BACKUP_ALL 32779
#define ID_CONTINENT_TRASH_CONTINENTS 32780
#define ID_CONTINENT_RESTORE_TAG 32781
#define ID_CONTINENT_DELETE_IN_TRASH 32782
#define ID_CONTINENT_DELETE_IN_BACKUP 32783
#define ID_CONTINENT_DELETE 32784
#define ID_CONTINENT_RESTORE_FROM_TRASH 32785
#define ID_CONTINENT_RESTORE_FROM_BACKUP 32786
#define ID_CONTINENT_BACKUP 32787
#define ID_WINDOWS_GEORGES 32788
#define ID_WINDOWS_LOGICEDITOR 32789
#define ID_CONTINENT_EXPORT 32790
#define ID_WINDOWS_RESET 32791
#define ID_OPTIONS_SETBACKUPDIR 32792
#define ID_OPTIONS_SETTRASHDIR 32793
#define ID_OPTIONS_SETDEFAULTDFNDIR 32794
#define ID_OPTIONS_SETDEFAULTGAMEELEMDIR 32795
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 144
#define _APS_NEXT_COMMAND_VALUE 32796
#define _APS_NEXT_CONTROL_VALUE 1015
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by master.rc
//
#define IDOK2 2
#define IDOK3 3
#define IDOK4 4
#define IDD_ABOUTBOX 100
#define IDR_MAINFRAME 128
#define IDR_MASTERTYPE 129
#define IDD_MASTERTREE 130
#define IDI_FOLDER 131
#define IDI_FILE 132
#define IDD_NEWREGION 133
#define IDI_CONTINENTS 134
#define IDI_BACKUP 135
#define IDI_TRASH 136
#define IDD_CHOOSETAG 137
#define IDD_CHOOSEDIR 138
#define IDD_PRIMNAME 139
#define IDD_GEORGESFORM 140
#define IDD_EXPORTOPT 141
#define IDD_EXPORTCB 142
#define IDD_REGION_PROPERTIES 143
#define IDD_NAME_EDIT 143
#define IDD_CONTINENT_PROPERTIES 148
#define IDC_EDIT1 1001
#define IDC_LIST 1002
#define IDC_EDIT_CONTINENT_NAME 1002
#define IDC_GENERATE_LANDSCAPE 1004
#define IDC_GENERATE_VEGETABLE 1005
#define IDC_OUT_LANDSCAPE_DIR 1006
#define IDC_EXPLORE_LANDSCAPE 1007
#define IDC_OUT_VEGETABLE_DIR 1008
#define IDC_EXPLORE_VEGETABLE 1009
#define IDC_CONTINENTLIST 1010
#define IDC_LAND_BANK_FILE 1011
#define IDC_EXPLORE_LAND_BANK_FILE 1012
#define IDC_LAND_FAR_BANK_FILE 1013
#define IDC_EDIT_REGION_NAME 1013
#define IDC_EDIT_NAME 1013
#define IDC_EXPLORE_LAND_FAR_BANK_FILE 1014
#define IDC_COMMENT 1014
#define IDC_LAND_TILE_NOISE_DIR 1015
#define IDC_EXPLORE_LAND_TILE_NOISE_DIR 1016
#define IDC_BUTTON_LANDDIR 1017
#define IDC_EDIT_DFNDIR 1018
#define IDC_BUTTON_DFNDIR 1019
#define IDC_EDIT_GAMEELEMDIR 1020
#define IDC_BUTTON_GAMEELEMDIR 1021
#define IDC_PASS 1111
#define IDC_PROGRESS1 1112
#define IDC_EDIT_LANDFILE 1114
#define IDC_BUTTON_LANDFILE 1115
#define IDC_EDIT_LANDDIR 1116
#define ID_CONTINENT_NEW 32771
#define ID_CONTINENT_SAVE 32773
#define ID_OPTIONS_TREELOCK 32774
#define ID_WINDOWS_WORLDEDITOR 32775
#define ID_OPTIONS_SETROOT 32776
#define ID_OPTIONS_SETCONTINENTSDIR 32776
#define ID_CONTINENT_EMPTY_TRASH 32777
#define ID_CONTINENT_EMPTY_BACKUP 32778
#define ID_CONTINENT_CONTINENT_BACKUP_ALL 32779
#define ID_CONTINENT_TRASH_CONTINENTS 32780
#define ID_CONTINENT_RESTORE_TAG 32781
#define ID_CONTINENT_DELETE_IN_TRASH 32782
#define ID_CONTINENT_DELETE_IN_BACKUP 32783
#define ID_CONTINENT_DELETE 32784
#define ID_CONTINENT_RESTORE_FROM_TRASH 32785
#define ID_CONTINENT_RESTORE_FROM_BACKUP 32786
#define ID_CONTINENT_BACKUP 32787
#define ID_WINDOWS_GEORGES 32788
#define ID_WINDOWS_LOGICEDITOR 32789
#define ID_CONTINENT_EXPORT 32790
#define ID_WINDOWS_RESET 32791
#define ID_OPTIONS_SETBACKUPDIR 32792
#define ID_OPTIONS_SETTRASHDIR 32793
#define ID_OPTIONS_SETDEFAULTDFNDIR 32794
#define ID_OPTIONS_SETDEFAULTGAMEELEMDIR 32795
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 144
#define _APS_NEXT_COMMAND_VALUE 32796
#define _APS_NEXT_CONTROL_VALUE 1015
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

@ -1,53 +1,53 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// AddPathDlg.cpp : implementation file
//
#include "stdafx.h"
#include "mission_compiler_fe.h"
#include "AddPathDlg.h"
/////////////////////////////////////////////////////////////////////////////
// CAddPathDlg dialog
CAddPathDlg::CAddPathDlg(CWnd* pParent /*=NULL*/)
: CDialog(CAddPathDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CAddPathDlg)
m_addPathLog = _T("");
//}}AFX_DATA_INIT
}
void CAddPathDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAddPathDlg)
DDX_Text(pDX, IDC_ADD_PATH, m_addPathLog);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAddPathDlg, CDialog)
//{{AFX_MSG_MAP(CAddPathDlg)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAddPathDlg message handlers
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// AddPathDlg.cpp : implementation file
//
#include "stdafx.h"
#include "mission_compiler_fe.h"
#include "AddPathDlg.h"
/////////////////////////////////////////////////////////////////////////////
// CAddPathDlg dialog
CAddPathDlg::CAddPathDlg(CWnd* pParent /*=NULL*/)
: CDialog(CAddPathDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CAddPathDlg)
m_addPathLog = _T("");
//}}AFX_DATA_INIT
}
void CAddPathDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAddPathDlg)
DDX_Text(pDX, IDC_ADD_PATH, m_addPathLog);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAddPathDlg, CDialog)
//{{AFX_MSG_MAP(CAddPathDlg)
// NOTE: the ClassWizard will add message map macros here
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CAddPathDlg message handlers

@ -1,62 +1,62 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_ADDPATHDLG_H__794D160D_4E32_4B4C_B3D9_AE1432FFDCF8__INCLUDED_)
#define AFX_ADDPATHDLG_H__794D160D_4E32_4B4C_B3D9_AE1432FFDCF8__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// AddPathDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CAddPathDlg dialog
class CAddPathDlg : public CDialog
{
// Construction
public:
CAddPathDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CAddPathDlg)
enum { IDD = IDD_DIALOG_ADD_PATH };
CString m_addPathLog;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAddPathDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CAddPathDlg)
// 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_ADDPATHDLG_H__794D160D_4E32_4B4C_B3D9_AE1432FFDCF8__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_ADDPATHDLG_H__794D160D_4E32_4B4C_B3D9_AE1432FFDCF8__INCLUDED_)
#define AFX_ADDPATHDLG_H__794D160D_4E32_4B4C_B3D9_AE1432FFDCF8__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// AddPathDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CAddPathDlg dialog
class CAddPathDlg : public CDialog
{
// Construction
public:
CAddPathDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CAddPathDlg)
enum { IDD = IDD_DIALOG_ADD_PATH };
CString m_addPathLog;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAddPathDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CAddPathDlg)
// 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_ADDPATHDLG_H__794D160D_4E32_4B4C_B3D9_AE1432FFDCF8__INCLUDED_)

@ -1,59 +1,59 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// CompilDialog.cpp : implementation file
//
#include "stdafx.h"
#include "mission_compiler_fe.h"
#include "CompilDialog.h"
/////////////////////////////////////////////////////////////////////////////
// CCompilDialog dialog
CCompilDialog::CCompilDialog(CWnd* pParent /*=NULL*/)
: CDialog(CCompilDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CCompilDialog)
m_compileLog = _T("");
//}}AFX_DATA_INIT
}
void CCompilDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCompilDialog)
DDX_Control(pDX, IDC_COMPIL_LOG, m_compileLogCtrl);
DDX_Control(pDX, IDOK, m_okBtn);
DDX_Text(pDX, IDC_COMPIL_LOG, m_compileLog);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCompilDialog, CDialog)
//{{AFX_MSG_MAP(CCompilDialog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCompilDialog message handlers
void CCompilDialog::OnOK()
{
CDialog::OnOK();
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// CompilDialog.cpp : implementation file
//
#include "stdafx.h"
#include "mission_compiler_fe.h"
#include "CompilDialog.h"
/////////////////////////////////////////////////////////////////////////////
// CCompilDialog dialog
CCompilDialog::CCompilDialog(CWnd* pParent /*=NULL*/)
: CDialog(CCompilDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CCompilDialog)
m_compileLog = _T("");
//}}AFX_DATA_INIT
}
void CCompilDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CCompilDialog)
DDX_Control(pDX, IDC_COMPIL_LOG, m_compileLogCtrl);
DDX_Control(pDX, IDOK, m_okBtn);
DDX_Text(pDX, IDC_COMPIL_LOG, m_compileLog);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CCompilDialog, CDialog)
//{{AFX_MSG_MAP(CCompilDialog)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CCompilDialog message handlers
void CCompilDialog::OnOK()
{
CDialog::OnOK();
}

@ -1,64 +1,64 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_COMPILDIALOG_H__A1192050_A0DB_4928_B153_0271CCF7DF99__INCLUDED_)
#define AFX_COMPILDIALOG_H__A1192050_A0DB_4928_B153_0271CCF7DF99__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// CompilDialog.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CCompilDialog dialog
class CCompilDialog : public CDialog
{
// Construction
public:
CCompilDialog(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CCompilDialog)
enum { IDD = IDD_COMPIL };
CEdit m_compileLogCtrl;
CButton m_okBtn;
CString m_compileLog;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCompilDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CCompilDialog)
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_COMPILDIALOG_H__A1192050_A0DB_4928_B153_0271CCF7DF99__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_COMPILDIALOG_H__A1192050_A0DB_4928_B153_0271CCF7DF99__INCLUDED_)
#define AFX_COMPILDIALOG_H__A1192050_A0DB_4928_B153_0271CCF7DF99__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// CompilDialog.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CCompilDialog dialog
class CCompilDialog : public CDialog
{
// Construction
public:
CCompilDialog(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CCompilDialog)
enum { IDD = IDD_COMPIL };
CEdit m_compileLogCtrl;
CButton m_okBtn;
CString m_compileLog;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CCompilDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CCompilDialog)
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_COMPILDIALOG_H__A1192050_A0DB_4928_B153_0271CCF7DF99__INCLUDED_)

@ -1,69 +1,69 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by mission_compiler_fe.rc
//
#define IDM_ABOUTBOX 0x0010
#define IDD_ABOUTBOX 100
#define IDS_ABOUTBOX 101
#define IDD_MISSION_COMPILER_FE_DIALOG 102
#define IDR_MAINFRAME 128
#define IDD_COMPIL 129
#define IDI_ICON_FILTER 130
#define IDR_MENU1 131
#define IDD_DIALOG_ADD_PATH 132
#define IDD_DIALOG_MODE 133
#define IDC_LIST_SRC 1000
#define IDC_LIST_DST 1001
#define IDC_ADD 1002
#define IDC_REMOVE 1003
#define IDC_REMOVE_ALL 1004
#define IDC_ADD_ALL 1005
#define IDC_COMPILE 1006
#define IDC_PUBLISH 1007
#define IDC_FILTER 1008
#define IDC_PRIMITIVE_NAME 1009
#define IDC_VALIDATE 1009
#define IDC_COMPIL_LOG 1010
#define IDC_ADD_PATH 1012
#define ID_MODE_COMPILE 1013
#define ID_MODE_PUBLISH 1014
#define IDC_DATA_DIRECTORY 1015
#define IDC_CHANGE_DIR 1016
#define IDC_PATH_WARNING 1018
#define IDC_CHECK_SRV1 1021
#define IDC_CHECK_SRV2 1022
#define IDC_CHECK_SRV3 1023
#define IDC_CHECK_SRV4 1024
#define IDC_CHECK_SRV5 1025
#define IDC_CHECK_SRV6 1026
#define IDC_CHECK_SRV7 1028
#define IDC_CHECK_SRV8 1029
#define ID_SPECIAL_RUNCOMPILERTEST 32771
#define ID_SPECIAL_VALIDATE_MISSIONS 32772
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 134
#define _APS_NEXT_COMMAND_VALUE 32773
#define _APS_NEXT_CONTROL_VALUE 1030
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by mission_compiler_fe.rc
//
#define IDM_ABOUTBOX 0x0010
#define IDD_ABOUTBOX 100
#define IDS_ABOUTBOX 101
#define IDD_MISSION_COMPILER_FE_DIALOG 102
#define IDR_MAINFRAME 128
#define IDD_COMPIL 129
#define IDI_ICON_FILTER 130
#define IDR_MENU1 131
#define IDD_DIALOG_ADD_PATH 132
#define IDD_DIALOG_MODE 133
#define IDC_LIST_SRC 1000
#define IDC_LIST_DST 1001
#define IDC_ADD 1002
#define IDC_REMOVE 1003
#define IDC_REMOVE_ALL 1004
#define IDC_ADD_ALL 1005
#define IDC_COMPILE 1006
#define IDC_PUBLISH 1007
#define IDC_FILTER 1008
#define IDC_PRIMITIVE_NAME 1009
#define IDC_VALIDATE 1009
#define IDC_COMPIL_LOG 1010
#define IDC_ADD_PATH 1012
#define ID_MODE_COMPILE 1013
#define ID_MODE_PUBLISH 1014
#define IDC_DATA_DIRECTORY 1015
#define IDC_CHANGE_DIR 1016
#define IDC_PATH_WARNING 1018
#define IDC_CHECK_SRV1 1021
#define IDC_CHECK_SRV2 1022
#define IDC_CHECK_SRV3 1023
#define IDC_CHECK_SRV4 1024
#define IDC_CHECK_SRV5 1025
#define IDC_CHECK_SRV6 1026
#define IDC_CHECK_SRV7 1028
#define IDC_CHECK_SRV8 1029
#define ID_SPECIAL_RUNCOMPILERTEST 32771
#define ID_SPECIAL_VALIDATE_MISSIONS 32772
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 134
#define _APS_NEXT_COMMAND_VALUE 32773
#define _APS_NEXT_CONTROL_VALUE 1030
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

@ -1,24 +1,24 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// stdafx.cpp : source file that includes just the standard includes
// mission_compiler_fe.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// stdafx.cpp : source file that includes just the standard includes
// mission_compiler_fe.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

@ -1,54 +1,54 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__79CA33FC_8CE1_4558_A98F_5AB64042C02B__INCLUDED_)
#define AFX_STDAFX_H__79CA33FC_8CE1_4558_A98F_5AB64042C02B__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#define NOMINMAX
#define _WIN32_WINNT 0x0500
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
# include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <nel/misc/types_nl.h>
enum TToolMode
{
mode_compile,
mode_publish
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__79CA33FC_8CE1_4558_A98F_5AB64042C02B__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__79CA33FC_8CE1_4558_A98F_5AB64042C02B__INCLUDED_)
#define AFX_STDAFX_H__79CA33FC_8CE1_4558_A98F_5AB64042C02B__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#define NOMINMAX
#define _WIN32_WINNT 0x0500
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
# include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <nel/misc/types_nl.h>
enum TToolMode
{
mode_compile,
mode_publish
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__79CA33FC_8CE1_4558_A98F_5AB64042C02B__INCLUDED_)

@ -1,69 +1,69 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// dialog_mode.cpp : implementation file
//
#include "stdafx.h"
#include "mission_compiler_fe.h"
#include "dialog_mode.h"
/////////////////////////////////////////////////////////////////////////////
// CDialogMode dialog
CDialogMode::CDialogMode(CWnd* pParent /*=NULL*/)
: CDialog(CDialogMode::IDD, pParent)
{
Mode = mode_compile;
//{{AFX_DATA_INIT(CDialogMode)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDialogMode::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDialogMode)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDialogMode, CDialog)
//{{AFX_MSG_MAP(CDialogMode)
ON_BN_CLICKED(ID_MODE_COMPILE, OnModeCompile)
ON_BN_CLICKED(ID_MODE_PUBLISH, OnModePublish)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDialogMode message handlers
void CDialogMode::OnModeCompile()
{
Mode = mode_compile;
this->EndDialog(IDOK);
}
void CDialogMode::OnModePublish()
{
Mode = mode_publish;
this->EndDialog(IDOK);
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// dialog_mode.cpp : implementation file
//
#include "stdafx.h"
#include "mission_compiler_fe.h"
#include "dialog_mode.h"
/////////////////////////////////////////////////////////////////////////////
// CDialogMode dialog
CDialogMode::CDialogMode(CWnd* pParent /*=NULL*/)
: CDialog(CDialogMode::IDD, pParent)
{
Mode = mode_compile;
//{{AFX_DATA_INIT(CDialogMode)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CDialogMode::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CDialogMode)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CDialogMode, CDialog)
//{{AFX_MSG_MAP(CDialogMode)
ON_BN_CLICKED(ID_MODE_COMPILE, OnModeCompile)
ON_BN_CLICKED(ID_MODE_PUBLISH, OnModePublish)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CDialogMode message handlers
void CDialogMode::OnModeCompile()
{
Mode = mode_compile;
this->EndDialog(IDOK);
}
void CDialogMode::OnModePublish()
{
Mode = mode_publish;
this->EndDialog(IDOK);
}

@ -1,66 +1,66 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_DIALOG_MODE_H__2662605B_D96D_4739_9FCE_FF639513FEFD__INCLUDED_)
#define AFX_DIALOG_MODE_H__2662605B_D96D_4739_9FCE_FF639513FEFD__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// dialog_mode.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDialogMode dialog
class CDialogMode : public CDialog
{
// Construction
public:
CDialogMode(CWnd* pParent = NULL); // standard constructor
TToolMode Mode;
// Dialog Data
//{{AFX_DATA(CDialogMode)
enum { IDD = IDD_DIALOG_MODE };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDialogMode)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDialogMode)
afx_msg void OnModeCompile();
afx_msg void OnModePublish();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DIALOG_MODE_H__2662605B_D96D_4739_9FCE_FF639513FEFD__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#if !defined(AFX_DIALOG_MODE_H__2662605B_D96D_4739_9FCE_FF639513FEFD__INCLUDED_)
#define AFX_DIALOG_MODE_H__2662605B_D96D_4739_9FCE_FF639513FEFD__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// dialog_mode.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CDialogMode dialog
class CDialogMode : public CDialog
{
// Construction
public:
CDialogMode(CWnd* pParent = NULL); // standard constructor
TToolMode Mode;
// Dialog Data
//{{AFX_DATA(CDialogMode)
enum { IDD = IDD_DIALOG_MODE };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CDialogMode)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CDialogMode)
afx_msg void OnModeCompile();
afx_msg void OnModePublish();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_DIALOG_MODE_H__2662605B_D96D_4739_9FCE_FF639513FEFD__INCLUDED_)

@ -1,168 +1,168 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// mission_compiler_fe.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "mission_compiler_fe.h"
#include "mission_compiler_feDlg.h"
#include "dialog_mode.h"
#include <string>
#include "nel/misc/debug.h"
#include "nel/misc/path.h"
#include "nel/ligo/primitive.h"
#include "nel/ligo/primitive_utils.h"
#include "nel/misc/config_file.h"
#include "../mission_compiler_lib/mission_compiler.h"
using namespace std;
/////////////////////////////////////////////////////////////////////////////
// CMissionCompilerFeApp
BEGIN_MESSAGE_MAP(CMissionCompilerFeApp, CWinApp)
//{{AFX_MSG_MAP(CMissionCompilerFeApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMissionCompilerFeApp construction
CMissionCompilerFeApp::CMissionCompilerFeApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
// The nel context
NLMISC::CApplicationContext AppContext;
/////////////////////////////////////////////////////////////////////////////
// The one and only CMissionCompilerFeApp object
CMissionCompilerFeApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CMissionCompilerFeApp initialization
BOOL CMissionCompilerFeApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// look at the command line parameters for command line mode
string cmdLine = m_lpCmdLine;
if (cmdLine.find("-c") != string::npos)
{
NLMISC::createDebug();
NLMISC::CStdDisplayer disp;
NLMISC::DebugLog->addDisplayer(&disp);
NLMISC::InfoLog->addDisplayer(&disp);
NLMISC::WarningLog->addDisplayer(&disp);
NLMISC::ErrorLog->addDisplayer(&disp);
CMissionCompilerFeDlg dlg;
// init the config file and other params
if (!dlg.readConfigFile())
exit(-1);
// get the primitive file to compile
string::size_type pos = cmdLine.find("-c");
string fileName = cmdLine.substr(pos+2);
fileName = fileName.substr(0, fileName.find(" "));
if (!NLMISC::CFile::isExists(NLMISC::CPath::lookup(fileName, false, true)))
{
nlwarning("Can't find file '%s'", fileName.c_str());
return -1;
}
uint32 nbMission = 0;
nlinfo("Compiling primitive file '%s' in '%s'", fileName.c_str(), NLMISC::CPath::lookup(fileName, false, true).c_str());
NLLIGO::CPrimitives primDoc;
NLLIGO::CPrimitiveContext::instance().CurrentPrimitive = &primDoc;
NLLIGO::loadXmlPrimitiveFile(primDoc, fileName, dlg.LigoConfig);
NLLIGO::CPrimitiveContext::instance().CurrentPrimitive = NULL;
try
{
CMissionCompiler mc;
mc.compileMissions(primDoc.RootNode, fileName);
nlinfo("Found %u valid missions",mc.getMissionsCount());
mc.installCompiledMission(dlg.LigoConfig, fileName);
nbMission += mc.getMissionsCount();
}
catch(EParseException e)
{
string msg;
msg + "\r\n";
if (e.Primitive != NULL)
{
msg += "In '"+NLLIGO::buildPrimPath(e.Primitive)+"'\r\n";
}
msg += "Error while compiling '"+fileName+"' :\r\n"+e.Why+"\r\n";
nlwarning(msg.c_str());
exit(-1);
}
nlinfo("Compiled and installed %u missions", nbMission);
NLMISC::DebugLog->removeDisplayer(&disp);
NLMISC::InfoLog->removeDisplayer(&disp);
NLMISC::WarningLog->removeDisplayer(&disp);
NLMISC::ErrorLog->removeDisplayer(&disp);
return FALSE;
}
//CDialogMode dlgMode;
//dlgMode.DoModal();
CMissionCompilerFeDlg dlg;
//dlg.Mode = dlgMode.Mode;
dlg.Mode = mode_compile;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// mission_compiler_fe.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "mission_compiler_fe.h"
#include "mission_compiler_feDlg.h"
#include "dialog_mode.h"
#include <string>
#include "nel/misc/debug.h"
#include "nel/misc/path.h"
#include "nel/ligo/primitive.h"
#include "nel/ligo/primitive_utils.h"
#include "nel/misc/config_file.h"
#include "../mission_compiler_lib/mission_compiler.h"
using namespace std;
/////////////////////////////////////////////////////////////////////////////
// CMissionCompilerFeApp
BEGIN_MESSAGE_MAP(CMissionCompilerFeApp, CWinApp)
//{{AFX_MSG_MAP(CMissionCompilerFeApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CMissionCompilerFeApp construction
CMissionCompilerFeApp::CMissionCompilerFeApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
// The nel context
NLMISC::CApplicationContext AppContext;
/////////////////////////////////////////////////////////////////////////////
// The one and only CMissionCompilerFeApp object
CMissionCompilerFeApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CMissionCompilerFeApp initialization
BOOL CMissionCompilerFeApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// look at the command line parameters for command line mode
string cmdLine = m_lpCmdLine;
if (cmdLine.find("-c") != string::npos)
{
NLMISC::createDebug();
NLMISC::CStdDisplayer disp;
NLMISC::DebugLog->addDisplayer(&disp);
NLMISC::InfoLog->addDisplayer(&disp);
NLMISC::WarningLog->addDisplayer(&disp);
NLMISC::ErrorLog->addDisplayer(&disp);
CMissionCompilerFeDlg dlg;
// init the config file and other params
if (!dlg.readConfigFile())
exit(-1);
// get the primitive file to compile
string::size_type pos = cmdLine.find("-c");
string fileName = cmdLine.substr(pos+2);
fileName = fileName.substr(0, fileName.find(" "));
if (!NLMISC::CFile::isExists(NLMISC::CPath::lookup(fileName, false, true)))
{
nlwarning("Can't find file '%s'", fileName.c_str());
return -1;
}
uint32 nbMission = 0;
nlinfo("Compiling primitive file '%s' in '%s'", fileName.c_str(), NLMISC::CPath::lookup(fileName, false, true).c_str());
NLLIGO::CPrimitives primDoc;
NLLIGO::CPrimitiveContext::instance().CurrentPrimitive = &primDoc;
NLLIGO::loadXmlPrimitiveFile(primDoc, fileName, dlg.LigoConfig);
NLLIGO::CPrimitiveContext::instance().CurrentPrimitive = NULL;
try
{
CMissionCompiler mc;
mc.compileMissions(primDoc.RootNode, fileName);
nlinfo("Found %u valid missions",mc.getMissionsCount());
mc.installCompiledMission(dlg.LigoConfig, fileName);
nbMission += mc.getMissionsCount();
}
catch(EParseException e)
{
string msg;
msg + "\r\n";
if (e.Primitive != NULL)
{
msg += "In '"+NLLIGO::buildPrimPath(e.Primitive)+"'\r\n";
}
msg += "Error while compiling '"+fileName+"' :\r\n"+e.Why+"\r\n";
nlwarning(msg.c_str());
exit(-1);
}
nlinfo("Compiled and installed %u missions", nbMission);
NLMISC::DebugLog->removeDisplayer(&disp);
NLMISC::InfoLog->removeDisplayer(&disp);
NLMISC::WarningLog->removeDisplayer(&disp);
NLMISC::ErrorLog->removeDisplayer(&disp);
return FALSE;
}
//CDialogMode dlgMode;
//dlgMode.DoModal();
CMissionCompilerFeDlg dlg;
//dlg.Mode = dlgMode.Mode;
dlg.Mode = mode_compile;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}

@ -1,65 +1,65 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// mission_compiler_fe.h : main header file for the MISSION_COMPILER_FE application
//
#if !defined(AFX_MISSION_COMPILER_FE_H__BBB671A5_D31E_43CD_879A_B901DED3C746__INCLUDED_)
#define AFX_MISSION_COMPILER_FE_H__BBB671A5_D31E_43CD_879A_B901DED3C746__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CMissionCompilerFeApp:
// See mission_compiler_fe.cpp for the implementation of this class
//
class CMissionCompilerFeApp : public CWinApp
{
public:
CMissionCompilerFeApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMissionCompilerFeApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CMissionCompilerFeApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MISSION_COMPILER_FE_H__BBB671A5_D31E_43CD_879A_B901DED3C746__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// mission_compiler_fe.h : main header file for the MISSION_COMPILER_FE application
//
#if !defined(AFX_MISSION_COMPILER_FE_H__BBB671A5_D31E_43CD_879A_B901DED3C746__INCLUDED_)
#define AFX_MISSION_COMPILER_FE_H__BBB671A5_D31E_43CD_879A_B901DED3C746__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CMissionCompilerFeApp:
// See mission_compiler_fe.cpp for the implementation of this class
//
class CMissionCompilerFeApp : public CWinApp
{
public:
CMissionCompilerFeApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMissionCompilerFeApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CMissionCompilerFeApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MISSION_COMPILER_FE_H__BBB671A5_D31E_43CD_879A_B901DED3C746__INCLUDED_)

@ -1,168 +1,168 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// mission_compiler_feDlg.h : header file
//
#if !defined(AFX_MISSION_COMPILER_FEDLG_H__5A765948_0BD6_4A62_982F_11C11323C840__INCLUDED_)
#define AFX_MISSION_COMPILER_FEDLG_H__5A765948_0BD6_4A62_982F_11C11323C840__INCLUDED_
#include "nel/misc/types_nl.h"
#include <map>
#include <vector>
#include <deque>
#include "nel/ligo/ligo_config.h"
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CMissionCompilerFeDlg dialog
struct CMissionState
{
std::string name;
std::string state;
std::string hashKey;
CMissionState(std::string _name, std::string _state, std::string _hashKey)
: name(_name), state(_state), hashKey(_hashKey) { }
};
struct CMission
{
std::string name;
std::string hashKey;
CMission(std::string _name, std::string _hashKey)
: name(_name), hashKey(_hashKey) { }
bool parsePrim(NLLIGO::IPrimitive const* prim);
};
class CValidationFile
{
public:
typedef std::map<std::string, CMissionState> TMissionStateContainer;
std::deque<std::string> _AuthorizedStates;
TMissionStateContainer _MissionStates;
public:
// CValidationFile() { }
void loadMissionValidationFile(std::string filename);
void saveMissionValidationFile(std::string filename);
void insertMission(std::string const& mission, std::string const& hashKey)
{
_MissionStates.insert(std::make_pair(mission, CMissionState(mission, defaultState(), hashKey)));
}
std::string defaultState()
{
if (!_AuthorizedStates.empty())
return _AuthorizedStates.front();
else
return "";
}
};
class CMissionCompilerFeDlg : public CDialog
{
// Construction
public:
CMissionCompilerFeDlg(CWnd* pParent = NULL); // standard constructor
TToolMode Mode;
bool readConfigFile();
void updateSearchPath();
// Dialog Data
//{{AFX_DATA(CMissionCompilerFeDlg)
enum { IDD = IDD_MISSION_COMPILER_FE_DIALOG };
CButton m_validateBtn;
CButton m_compileBtn;
CButton m_publishBtn;
CListBox m_listDst;
CListBox m_listSrc;
CString m_filter;
CString m_dataDirectory;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMissionCompilerFeDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
public:
NLLIGO::CLigoConfig LigoConfig;
// Implementation
protected:
HICON m_hIcon;
std::vector<std::string> SearchPaths;
std::string LigoConfigFile;
std::string DefaultFilter;
std::string TestPrimitive;
std::string TestPrimitiveDest;
std::string ReferenceScript;
// Publish data
std::vector<std::string> ServerName;
std::vector<std::string> ServerPathPrim;
std::vector<std::string> ServerPathText;
std::string LocalTextPath;
typedef std::map<std::string, std::string> TFileList;
TFileList _SrcList;
TFileList _DstList;
void fillSourceList();
void updateFileList();
typedef std::map<std::string, CMission> TMissionContainer;
bool parsePrimForMissions(NLLIGO::IPrimitive const* prim, TMissionContainer& missions);
void compile(BOOL publish);
// Generated message map functions
//{{AFX_MSG(CMissionCompilerFeDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnAdd();
afx_msg void OnAddAll();
afx_msg void OnRemove();
afx_msg void OnRemoveAll();
afx_msg void OnChangeFilter();
afx_msg void OnCompile();
afx_msg void OnSpecialRuncompilertest();
afx_msg void OnDblclkListSrc();
afx_msg void OnDblclkListDst();
afx_msg void OnPublish();
afx_msg void OnSpecialValidateMissions();
afx_msg void OnValidate();
afx_msg void OnChangeDir();
afx_msg void OnChangeDataDir();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MISSION_COMPILER_FEDLG_H__5A765948_0BD6_4A62_982F_11C11323C840__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// mission_compiler_feDlg.h : header file
//
#if !defined(AFX_MISSION_COMPILER_FEDLG_H__5A765948_0BD6_4A62_982F_11C11323C840__INCLUDED_)
#define AFX_MISSION_COMPILER_FEDLG_H__5A765948_0BD6_4A62_982F_11C11323C840__INCLUDED_
#include "nel/misc/types_nl.h"
#include <map>
#include <vector>
#include <deque>
#include "nel/ligo/ligo_config.h"
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
/////////////////////////////////////////////////////////////////////////////
// CMissionCompilerFeDlg dialog
struct CMissionState
{
std::string name;
std::string state;
std::string hashKey;
CMissionState(std::string _name, std::string _state, std::string _hashKey)
: name(_name), state(_state), hashKey(_hashKey) { }
};
struct CMission
{
std::string name;
std::string hashKey;
CMission(std::string _name, std::string _hashKey)
: name(_name), hashKey(_hashKey) { }
bool parsePrim(NLLIGO::IPrimitive const* prim);
};
class CValidationFile
{
public:
typedef std::map<std::string, CMissionState> TMissionStateContainer;
std::deque<std::string> _AuthorizedStates;
TMissionStateContainer _MissionStates;
public:
// CValidationFile() { }
void loadMissionValidationFile(std::string filename);
void saveMissionValidationFile(std::string filename);
void insertMission(std::string const& mission, std::string const& hashKey)
{
_MissionStates.insert(std::make_pair(mission, CMissionState(mission, defaultState(), hashKey)));
}
std::string defaultState()
{
if (!_AuthorizedStates.empty())
return _AuthorizedStates.front();
else
return "";
}
};
class CMissionCompilerFeDlg : public CDialog
{
// Construction
public:
CMissionCompilerFeDlg(CWnd* pParent = NULL); // standard constructor
TToolMode Mode;
bool readConfigFile();
void updateSearchPath();
// Dialog Data
//{{AFX_DATA(CMissionCompilerFeDlg)
enum { IDD = IDD_MISSION_COMPILER_FE_DIALOG };
CButton m_validateBtn;
CButton m_compileBtn;
CButton m_publishBtn;
CListBox m_listDst;
CListBox m_listSrc;
CString m_filter;
CString m_dataDirectory;
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMissionCompilerFeDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
public:
NLLIGO::CLigoConfig LigoConfig;
// Implementation
protected:
HICON m_hIcon;
std::vector<std::string> SearchPaths;
std::string LigoConfigFile;
std::string DefaultFilter;
std::string TestPrimitive;
std::string TestPrimitiveDest;
std::string ReferenceScript;
// Publish data
std::vector<std::string> ServerName;
std::vector<std::string> ServerPathPrim;
std::vector<std::string> ServerPathText;
std::string LocalTextPath;
typedef std::map<std::string, std::string> TFileList;
TFileList _SrcList;
TFileList _DstList;
void fillSourceList();
void updateFileList();
typedef std::map<std::string, CMission> TMissionContainer;
bool parsePrimForMissions(NLLIGO::IPrimitive const* prim, TMissionContainer& missions);
void compile(BOOL publish);
// Generated message map functions
//{{AFX_MSG(CMissionCompilerFeDlg)
virtual BOOL OnInitDialog();
afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
afx_msg void OnPaint();
afx_msg HCURSOR OnQueryDragIcon();
afx_msg void OnAdd();
afx_msg void OnAddAll();
afx_msg void OnRemove();
afx_msg void OnRemoveAll();
afx_msg void OnChangeFilter();
afx_msg void OnCompile();
afx_msg void OnSpecialRuncompilertest();
afx_msg void OnDblclkListSrc();
afx_msg void OnDblclkListDst();
afx_msg void OnPublish();
afx_msg void OnSpecialValidateMissions();
afx_msg void OnValidate();
afx_msg void OnChangeDir();
afx_msg void OnChangeDataDir();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MISSION_COMPILER_FEDLG_H__5A765948_0BD6_4A62_982F_11C11323C840__INCLUDED_)

@ -1,270 +1,270 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "nel/misc/i18n.h"
#include "mission_compiler.h"
#include "nel/misc/config_file.h"
using namespace std;
using namespace NLMISC;
using namespace NLLIGO;
class CMissionData;
class IStep;
int main(int argc, char *argv[])
{
new NLMISC::CApplicationContext;
CPath::addSearchPath("L:\\primitives\\", true, false);
bool test = false;
if (argc == 4 && string(argv[3]) == "-test")
{
test = true;
}
else if ( argc != 3)
{
printf("%s <world_edit_class> <primitive_file> [-test]", argv[0]);
return -1;
}
string sourceDocName;
if (!test)
sourceDocName = argv[2];
else
sourceDocName = "test_compilateur.primitive";
// remove the path
sourceDocName = CFile::getFilename(sourceDocName);
// init ligo
NLLIGO::CLigoConfig LigoConfig;
CPrimitiveContext::instance().CurrentLigoConfig = &LigoConfig;
nlinfo("Reading ligo configuration file...");
if (!LigoConfig.readPrimitiveClass (argv[1], false))
{
nlwarning("Can't read '%s' !", argv[1]);
return -1;
}
NLLIGO::Register();
nlinfo("Reading primitive file...");
CPrimitives primDoc;
CPrimitiveContext::instance().CurrentPrimitive = &primDoc;
loadXmlPrimitiveFile(primDoc, sourceDocName, LigoConfig);
CMissionCompiler mc;
if (test)
{
nlinfo("Compiling test mission");
try
{
mc.compileMissions(primDoc.RootNode, sourceDocName);
TMissionDataPtr testMission = mc.getMission(0);
CSString script = testMission->generateMissionScript(sourceDocName);
script += "======================================================"+NL;
script += testMission->generatePhraseFile();
script += "======================================================"+NL;
script += testMission->generateDotScript();
script = script.replace(NL.c_str(), "\n");
char *tmp = ::getenv("TEMP");
FILE *fp = ::fopen((string(tmp)+"/compiled_mission.script").c_str(), "w");
::fwrite(script.data(), script.size(), 1, fp);
::fclose(fp);
system((string("\"C:\\Program Files\\Beyond Compare 2\\bc2.exe\" ")+string(tmp)+"/compiled_mission.script test_compilateur.script").c_str());
}
catch(const EParseException &e)
{
nlwarning(e.Why.c_str());
return -1;
}
return 0;
}
nlinfo("Compiling missions...");
try
{
mc.compileMissions(primDoc.RootNode, sourceDocName);
mc.installCompiledMission(LigoConfig, sourceDocName);
/* std::vector <TMissionDataPtr> &missions = mc.getMissions();
// generate the mission script into the npcs...
{
map<string, TLoadedPrimitive > loadedPrimitives;
// First loop to remove any mission that belong to the compiled primitive file
for (uint i=0; i<missions.size(); ++i)
{
CMissionData &mission = *(missions[i]);
// first, look for the primitive file to load
string fileName = mission.getGiverPrimitive();
if (fileName.empty())
{
// use mission primitive instead
fileName = sourceDocName;
}
if (loadedPrimitives.find(fileName) == loadedPrimitives.end())
{
string fullFileName = CPath::lookup(fileName);
if (fullFileName.empty())
{
nlwarning("Can't find primitive file '%s' in path", fileName.c_str());
throw EParseException(NULL, "Destination primitive file not found");
}
// we need to load this primitive file.
CPrimitives *primDoc = new CPrimitives;
if (loadXmlPrimitiveFile(*primDoc, fullFileName, LigoConfig))
{
// the primitive file is loaded correctly
loadedPrimitives.insert(make_pair(fileName, TLoadedPrimitive(primDoc, fullFileName)));
}
else
throw EParseException(NULL, "Can't read primitive file");
}
TLoadedPrimitive &loadedPrim = loadedPrimitives[fileName];
CPrimitives *primDoc = loadedPrim.PrimDoc;
TPrimitiveSet scripts;
CPrimitiveSet<TPrimitiveClassPredicate> filter;
filter.buildSet(primDoc->RootNode, TPrimitiveClassPredicate("mission"), scripts);
// for each script, check if it was generated, and if so, check the name
// of the source primitive file.
for (uint i=0; i<scripts.size(); ++i)
{
vector<string> *script;
if (scripts[i]->getPropertyByName("script", script) && !script->empty())
{
// Format should be : #compiled from <source_primitive_name>
if (script->front().find("compiled from"))
{
// we have a compiled mission
if (script->front().find(sourceDocName))
{
// ok, this mission is compiled from the same primitive, remove it
scripts[i]->getParent()->removeChild(scripts[i]);
}
}
}
}
}
// second loop to assign compiled mission to giver npc
for (uint i=0; i<missions.size(); ++i)
{
CMissionData &mission = *(missions[i]);
string fileName = mission.getGiverPrimitive();
if (fileName.empty())
{
// no giver primitive file specified in the mission, use the mission primitive instead
fileName = sourceDocName;
}
TLoadedPrimitive &loadedPrim = loadedPrimitives[fileName];
CPrimitives *primDoc = loadedPrim.PrimDoc;
TPrimitiveSet bots;
CPrimitiveSet<TPrimitiveClassAndNamePredicate> filter;
filter.buildSet(primDoc->RootNode, TPrimitiveClassAndNamePredicate("npc_bot", mission.getGiverName()), bots);
if (bots.empty())
{
nlwarning("Can't find bot '%s' in primitive '%s' !",
mission.getGiverName().c_str(),
fileName.c_str());
throw EParseException(NULL, "Can't find giver in primitive");
}
else if (bots.size() > 1)
{
nlwarning("Found more than one bot named '%s' in primitive '%s' !",
mission.getGiverName().c_str(),
fileName.c_str());
throw EParseException(NULL, "More than one bot with giver name in primitive");
}
// ok, all is good, we can add the mission node to the giver
IPrimitive *giver = bots.front();
// create a new node for the mission
IPrimitive *script = new CPrimNode;
// set the class
script->addPropertyByName("class", new CPropertyString("mission"));
// set the name
script->addPropertyByName("name", new CPropertyString(mission.getMissionName()));
// string alias(toString("%u", makeHash32(mission.getMissionName())));
script->addPropertyByName("alias", new CPropertyString(mission.getAlias()));
string scriptLines = mission.generateMissionScript();
vector<string> lines;
explode(scriptLines, NL, lines, false);
script->addPropertyByName("script", new CPropertyStringArray(lines));
// insert the script into the giver
giver->insertChild(script);
}
// Save the modified primitive files
while (!loadedPrimitives.empty())
{
TLoadedPrimitive &loadedPrim = loadedPrimitives.begin()->second;
saveXmlPrimitiveFile(*(loadedPrim.PrimDoc), loadedPrim.FullFileName);
// Free the memory
delete loadedPrim.PrimDoc;
loadedPrimitives.erase(loadedPrimitives.begin());
}
}
// generate the phrase file (in any)
{
string phraseFileName = CFile::getFilenameWithoutExtension(sourceDocName) + "_en.txt";
CSString content;
for (uint i=0; i<missions.size(); ++i)
{
content += missions[i]->generatePhraseFile();
}
// transform NL (\n\r) into single \n
content = content.replace(NL.c_str(), "\n");
ucstring ucs;
ucs.fromUtf8(content);
CI18N::writeTextFile(phraseFileName, ucs, true);
}
*/
}
catch (const EParseException &e)
{
CPrimitiveContext::instance().CurrentLigoConfig = NULL;
nlerror("Compilation error : '%s'", e.Why.c_str());
}
CPrimitiveContext::instance().CurrentLigoConfig = NULL;
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "nel/misc/i18n.h"
#include "mission_compiler.h"
#include "nel/misc/config_file.h"
using namespace std;
using namespace NLMISC;
using namespace NLLIGO;
class CMissionData;
class IStep;
int main(int argc, char *argv[])
{
new NLMISC::CApplicationContext;
CPath::addSearchPath("L:\\primitives\\", true, false);
bool test = false;
if (argc == 4 && string(argv[3]) == "-test")
{
test = true;
}
else if ( argc != 3)
{
printf("%s <world_edit_class> <primitive_file> [-test]", argv[0]);
return -1;
}
string sourceDocName;
if (!test)
sourceDocName = argv[2];
else
sourceDocName = "test_compilateur.primitive";
// remove the path
sourceDocName = CFile::getFilename(sourceDocName);
// init ligo
NLLIGO::CLigoConfig LigoConfig;
CPrimitiveContext::instance().CurrentLigoConfig = &LigoConfig;
nlinfo("Reading ligo configuration file...");
if (!LigoConfig.readPrimitiveClass (argv[1], false))
{
nlwarning("Can't read '%s' !", argv[1]);
return -1;
}
NLLIGO::Register();
nlinfo("Reading primitive file...");
CPrimitives primDoc;
CPrimitiveContext::instance().CurrentPrimitive = &primDoc;
loadXmlPrimitiveFile(primDoc, sourceDocName, LigoConfig);
CMissionCompiler mc;
if (test)
{
nlinfo("Compiling test mission");
try
{
mc.compileMissions(primDoc.RootNode, sourceDocName);
TMissionDataPtr testMission = mc.getMission(0);
CSString script = testMission->generateMissionScript(sourceDocName);
script += "======================================================"+NL;
script += testMission->generatePhraseFile();
script += "======================================================"+NL;
script += testMission->generateDotScript();
script = script.replace(NL.c_str(), "\n");
char *tmp = ::getenv("TEMP");
FILE *fp = ::fopen((string(tmp)+"/compiled_mission.script").c_str(), "w");
::fwrite(script.data(), script.size(), 1, fp);
::fclose(fp);
system((string("\"C:\\Program Files\\Beyond Compare 2\\bc2.exe\" ")+string(tmp)+"/compiled_mission.script test_compilateur.script").c_str());
}
catch(const EParseException &e)
{
nlwarning(e.Why.c_str());
return -1;
}
return 0;
}
nlinfo("Compiling missions...");
try
{
mc.compileMissions(primDoc.RootNode, sourceDocName);
mc.installCompiledMission(LigoConfig, sourceDocName);
/* std::vector <TMissionDataPtr> &missions = mc.getMissions();
// generate the mission script into the npcs...
{
map<string, TLoadedPrimitive > loadedPrimitives;
// First loop to remove any mission that belong to the compiled primitive file
for (uint i=0; i<missions.size(); ++i)
{
CMissionData &mission = *(missions[i]);
// first, look for the primitive file to load
string fileName = mission.getGiverPrimitive();
if (fileName.empty())
{
// use mission primitive instead
fileName = sourceDocName;
}
if (loadedPrimitives.find(fileName) == loadedPrimitives.end())
{
string fullFileName = CPath::lookup(fileName);
if (fullFileName.empty())
{
nlwarning("Can't find primitive file '%s' in path", fileName.c_str());
throw EParseException(NULL, "Destination primitive file not found");
}
// we need to load this primitive file.
CPrimitives *primDoc = new CPrimitives;
if (loadXmlPrimitiveFile(*primDoc, fullFileName, LigoConfig))
{
// the primitive file is loaded correctly
loadedPrimitives.insert(make_pair(fileName, TLoadedPrimitive(primDoc, fullFileName)));
}
else
throw EParseException(NULL, "Can't read primitive file");
}
TLoadedPrimitive &loadedPrim = loadedPrimitives[fileName];
CPrimitives *primDoc = loadedPrim.PrimDoc;
TPrimitiveSet scripts;
CPrimitiveSet<TPrimitiveClassPredicate> filter;
filter.buildSet(primDoc->RootNode, TPrimitiveClassPredicate("mission"), scripts);
// for each script, check if it was generated, and if so, check the name
// of the source primitive file.
for (uint i=0; i<scripts.size(); ++i)
{
vector<string> *script;
if (scripts[i]->getPropertyByName("script", script) && !script->empty())
{
// Format should be : #compiled from <source_primitive_name>
if (script->front().find("compiled from"))
{
// we have a compiled mission
if (script->front().find(sourceDocName))
{
// ok, this mission is compiled from the same primitive, remove it
scripts[i]->getParent()->removeChild(scripts[i]);
}
}
}
}
}
// second loop to assign compiled mission to giver npc
for (uint i=0; i<missions.size(); ++i)
{
CMissionData &mission = *(missions[i]);
string fileName = mission.getGiverPrimitive();
if (fileName.empty())
{
// no giver primitive file specified in the mission, use the mission primitive instead
fileName = sourceDocName;
}
TLoadedPrimitive &loadedPrim = loadedPrimitives[fileName];
CPrimitives *primDoc = loadedPrim.PrimDoc;
TPrimitiveSet bots;
CPrimitiveSet<TPrimitiveClassAndNamePredicate> filter;
filter.buildSet(primDoc->RootNode, TPrimitiveClassAndNamePredicate("npc_bot", mission.getGiverName()), bots);
if (bots.empty())
{
nlwarning("Can't find bot '%s' in primitive '%s' !",
mission.getGiverName().c_str(),
fileName.c_str());
throw EParseException(NULL, "Can't find giver in primitive");
}
else if (bots.size() > 1)
{
nlwarning("Found more than one bot named '%s' in primitive '%s' !",
mission.getGiverName().c_str(),
fileName.c_str());
throw EParseException(NULL, "More than one bot with giver name in primitive");
}
// ok, all is good, we can add the mission node to the giver
IPrimitive *giver = bots.front();
// create a new node for the mission
IPrimitive *script = new CPrimNode;
// set the class
script->addPropertyByName("class", new CPropertyString("mission"));
// set the name
script->addPropertyByName("name", new CPropertyString(mission.getMissionName()));
// string alias(toString("%u", makeHash32(mission.getMissionName())));
script->addPropertyByName("alias", new CPropertyString(mission.getAlias()));
string scriptLines = mission.generateMissionScript();
vector<string> lines;
explode(scriptLines, NL, lines, false);
script->addPropertyByName("script", new CPropertyStringArray(lines));
// insert the script into the giver
giver->insertChild(script);
}
// Save the modified primitive files
while (!loadedPrimitives.empty())
{
TLoadedPrimitive &loadedPrim = loadedPrimitives.begin()->second;
saveXmlPrimitiveFile(*(loadedPrim.PrimDoc), loadedPrim.FullFileName);
// Free the memory
delete loadedPrim.PrimDoc;
loadedPrimitives.erase(loadedPrimitives.begin());
}
}
// generate the phrase file (in any)
{
string phraseFileName = CFile::getFilenameWithoutExtension(sourceDocName) + "_en.txt";
CSString content;
for (uint i=0; i<missions.size(); ++i)
{
content += missions[i]->generatePhraseFile();
}
// transform NL (\n\r) into single \n
content = content.replace(NL.c_str(), "\n");
ucstring ucs;
ucs.fromUtf8(content);
CI18N::writeTextFile(phraseFileName, ucs, true);
}
*/
}
catch (const EParseException &e)
{
CPrimitiveContext::instance().CurrentLigoConfig = NULL;
nlerror("Compilation error : '%s'", e.Why.c_str());
}
CPrimitiveContext::instance().CurrentLigoConfig = NULL;
}

@ -1,268 +1,268 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "nel/misc/types_nl.h"
#include "nel/ligo/primitive.h"
#include <string>
#ifndef __STEP_H__
#define __STEP_H__
/** Action and objective base class */
class IStepContent
{
public:
enum TStepContentType
{
objective,
action
};
protected:
std::string _ContentName;
TStepContentType _ContentType;
/// post action list
std::vector<IStepContent*> _PostActions;
// called by base class to retrieve the predefined parameters lists
virtual void getPredefParam(uint32 &numEntry, CPhrase::TPredefParams &predef) = 0;
public:
virtual void init(CMissionData &md, NLLIGO::IPrimitive *prim);
/// Generate the mission script code for this step content.
std::string genStepContentCode(CMissionData &md);
/// Generate the phrase string.
std::string genStepContentPhrase();
static IStepContent *createStepContent(CMissionData &md, NLLIGO::IPrimitive *prim);
virtual void fillJump(CMissionData &md, std::set<TJumpInfo> &jumpPoints);
protected:
/// Generate the mission script code for this step content.
virtual std::string genCode(CMissionData &md) = 0;
/// Generate the phrase string.
virtual std::string genPhrase() { return std::string();}
};
/** Step base class */
class IStep
{
protected:
/// The name of the step
std::string _StepName;
/// The type of the step
std::string _StepType;
/// Pointer on primitive that generate this step
NLLIGO::IPrimitive *_Primitive;
/// The list of pre-action
std::vector<IStepContent *> _PreActions;
/// The list of objectives
std::vector<IStepContent *> _Objectives;
/// The list of post action
std::vector<IStepContent *> _PostActions;
/// Substeps used for sequence interruption (like an if)
std::vector<IStep*> _SubSteps;
public:
/// Flag this step a last of a branch, the compiler will generate a fail after it.
bool EndOfBranch;
/// Flag this step as a jump point. This mean that there is a jump that jump on this step.
bool JumpPoint;
IStep(CMissionData &md, NLLIGO::IPrimitive *prim);
virtual ~IStep() {}
virtual void init(CMissionData &md, NLLIGO::IPrimitive *prim) {}
/// Get the step name
const std::string &getStepName()
{
return _StepName;
}
NLLIGO::IPrimitive *getPrimitive()
{
return _Primitive;
}
/// Return true if the step is an action step.
// virtual bool isAction() { return false; }
virtual bool isAJump() { return false; }
virtual bool isEnd() { return false; }
/// Return a set of primitive pointer on the sub branch of this step (if any)
virtual NLLIGO::TPrimitiveSet getSubBranchs() { return NLLIGO::TPrimitiveSet(); }
/// Fill a vector of step name where this step eventualy jump (if any)
void fillStepJump(CMissionData &md, std::set<TJumpInfo> &jumpPoints);
/// Generate the mission script code for this step.
virtual std::string genCode(CMissionData &md);
virtual std::string genCodePreActions(CMissionData &md);
virtual std::string genCodeObjectives(CMissionData &md);
virtual std::string genCodePostActions(CMissionData &md);
void addSubStep(IStep *s) { _SubSteps.push_back(s); }
/// Generate the string phrase text.
virtual std::string genPhrase();
/// Factory function to create a new step. The caller is responsible for deleting the allocated object.
static IStep *createStep(CMissionData &md, NLLIGO::IPrimitive *prim);
protected:
/// Fill a vector of step name where this step eventualy jump (if any)
virtual void fillJump(CMissionData &md, std::set<TJumpInfo> &jumpPoints);
};
/** StepContent FACTORY **/
class IStepContentFactory
{
public:
virtual IStepContent *createStepContent(CMissionData &md, NLLIGO::IPrimitive *prim) =0;
};
template <class contentClass>
class CStepContentFactory : public IStepContentFactory
{
public:
IStepContent *createStepContent(CMissionData &md, NLLIGO::IPrimitive *prim)
{
IStepContent *ret = new contentClass;
ret->init(md, prim);
return ret;
}
};
#define REGISTER_STEP_CONTENT(className, key) typedef CStepContentFactory<className> TStepContentFactory##className; \
NLMISC_REGISTER_OBJECT_INDIRECT(IStepContentFactory, TStepContentFactory##className, string, key)
/** Step FACTORY **/
class IStepFactory
{
public:
virtual IStep *createStep(CMissionData &md, NLLIGO::IPrimitive *prim) = 0;
};
template <class StepClass>
class CStepFactory : public IStepFactory
{
IStep *createStep(CMissionData &md, NLLIGO::IPrimitive *prim)
{
return new StepClass(md, prim);
}
};
#define REGISTER_STEP_INDIRECT(stepClass, key) typedef CStepFactory<stepClass> TStepFactory##stepClass; \
NLMISC_REGISTER_OBJECT_INDIRECT(IStepFactory, TStepFactory##stepClass, string, string(key));
/** objective base class **/
class CContentObjective : public IStepContent
{
protected:
std::vector<std::string> _OverloadObj;
CPhrase _OverloadPhrase;
std::vector<std::string> _RoleplayObj;
CPhrase _RoleplayPhrase;
bool _HideObj;
// Option nb_guild_members_needed, available for each objective
/*int _NbGuildMembersNeeded;
std::string genNbGuildMembersNeededOption(CMissionData &md);*/
public:
void init(CMissionData &md, NLLIGO::IPrimitive *prim);
std::string genCode(CMissionData &md);
std::string genPhrase();
};
/** special case for step if **/
class CStepIf : public IStep
{
enum TIfType
{
it_mission_done,
it_skills,
it_bricks,
it_sdb,
it_race,
it_cult,
it_civ,
it_faction_point,
it_guild_cult,
it_guild_civ,
it_guild_fame,
it_no_trial,
it_item_in_inv,
};
public:
CStepIf(CMissionData &md, NLLIGO::IPrimitive *prim);
NLLIGO::TPrimitiveSet getSubBranchs();
void fillJump(CMissionData &md, std::set<TJumpInfo> &jumpPoints);
std::string genCode(CMissionData &md);
/// type of test
TIfType _IfType;
/// If parameters
std::vector<std::string> _IfParams;
/// the list of sub branch for the dyn chat.
NLLIGO::TPrimitiveSet _SubBranchs;
};
/** special case for step player reconnect **/
class CStepPlayerReconnect : public IStep
{
// Optional jump at end of failure
std::string _JumpTo;
/// the list of sub branch
NLLIGO::TPrimitiveSet _SubBranchs;
public:
CStepPlayerReconnect(CMissionData &md, NLLIGO::IPrimitive *prim);
NLLIGO::TPrimitiveSet getSubBranchs();
std::string genCode(CMissionData &md);
void fillJump(CMissionData &md, std::set<TJumpInfo> &jumpPoints);
};
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "nel/misc/types_nl.h"
#include "nel/ligo/primitive.h"
#include <string>
#ifndef __STEP_H__
#define __STEP_H__
/** Action and objective base class */
class IStepContent
{
public:
enum TStepContentType
{
objective,
action
};
protected:
std::string _ContentName;
TStepContentType _ContentType;
/// post action list
std::vector<IStepContent*> _PostActions;
// called by base class to retrieve the predefined parameters lists
virtual void getPredefParam(uint32 &numEntry, CPhrase::TPredefParams &predef) = 0;
public:
virtual void init(CMissionData &md, NLLIGO::IPrimitive *prim);
/// Generate the mission script code for this step content.
std::string genStepContentCode(CMissionData &md);
/// Generate the phrase string.
std::string genStepContentPhrase();
static IStepContent *createStepContent(CMissionData &md, NLLIGO::IPrimitive *prim);
virtual void fillJump(CMissionData &md, std::set<TJumpInfo> &jumpPoints);
protected:
/// Generate the mission script code for this step content.
virtual std::string genCode(CMissionData &md) = 0;
/// Generate the phrase string.
virtual std::string genPhrase() { return std::string();}
};
/** Step base class */
class IStep
{
protected:
/// The name of the step
std::string _StepName;
/// The type of the step
std::string _StepType;
/// Pointer on primitive that generate this step
NLLIGO::IPrimitive *_Primitive;
/// The list of pre-action
std::vector<IStepContent *> _PreActions;
/// The list of objectives
std::vector<IStepContent *> _Objectives;
/// The list of post action
std::vector<IStepContent *> _PostActions;
/// Substeps used for sequence interruption (like an if)
std::vector<IStep*> _SubSteps;
public:
/// Flag this step a last of a branch, the compiler will generate a fail after it.
bool EndOfBranch;
/// Flag this step as a jump point. This mean that there is a jump that jump on this step.
bool JumpPoint;
IStep(CMissionData &md, NLLIGO::IPrimitive *prim);
virtual ~IStep() {}
virtual void init(CMissionData &md, NLLIGO::IPrimitive *prim) {}
/// Get the step name
const std::string &getStepName()
{
return _StepName;
}
NLLIGO::IPrimitive *getPrimitive()
{
return _Primitive;
}
/// Return true if the step is an action step.
// virtual bool isAction() { return false; }
virtual bool isAJump() { return false; }
virtual bool isEnd() { return false; }
/// Return a set of primitive pointer on the sub branch of this step (if any)
virtual NLLIGO::TPrimitiveSet getSubBranchs() { return NLLIGO::TPrimitiveSet(); }
/// Fill a vector of step name where this step eventualy jump (if any)
void fillStepJump(CMissionData &md, std::set<TJumpInfo> &jumpPoints);
/// Generate the mission script code for this step.
virtual std::string genCode(CMissionData &md);
virtual std::string genCodePreActions(CMissionData &md);
virtual std::string genCodeObjectives(CMissionData &md);
virtual std::string genCodePostActions(CMissionData &md);
void addSubStep(IStep *s) { _SubSteps.push_back(s); }
/// Generate the string phrase text.
virtual std::string genPhrase();
/// Factory function to create a new step. The caller is responsible for deleting the allocated object.
static IStep *createStep(CMissionData &md, NLLIGO::IPrimitive *prim);
protected:
/// Fill a vector of step name where this step eventualy jump (if any)
virtual void fillJump(CMissionData &md, std::set<TJumpInfo> &jumpPoints);
};
/** StepContent FACTORY **/
class IStepContentFactory
{
public:
virtual IStepContent *createStepContent(CMissionData &md, NLLIGO::IPrimitive *prim) =0;
};
template <class contentClass>
class CStepContentFactory : public IStepContentFactory
{
public:
IStepContent *createStepContent(CMissionData &md, NLLIGO::IPrimitive *prim)
{
IStepContent *ret = new contentClass;
ret->init(md, prim);
return ret;
}
};
#define REGISTER_STEP_CONTENT(className, key) typedef CStepContentFactory<className> TStepContentFactory##className; \
NLMISC_REGISTER_OBJECT_INDIRECT(IStepContentFactory, TStepContentFactory##className, string, key)
/** Step FACTORY **/
class IStepFactory
{
public:
virtual IStep *createStep(CMissionData &md, NLLIGO::IPrimitive *prim) = 0;
};
template <class StepClass>
class CStepFactory : public IStepFactory
{
IStep *createStep(CMissionData &md, NLLIGO::IPrimitive *prim)
{
return new StepClass(md, prim);
}
};
#define REGISTER_STEP_INDIRECT(stepClass, key) typedef CStepFactory<stepClass> TStepFactory##stepClass; \
NLMISC_REGISTER_OBJECT_INDIRECT(IStepFactory, TStepFactory##stepClass, string, string(key));
/** objective base class **/
class CContentObjective : public IStepContent
{
protected:
std::vector<std::string> _OverloadObj;
CPhrase _OverloadPhrase;
std::vector<std::string> _RoleplayObj;
CPhrase _RoleplayPhrase;
bool _HideObj;
// Option nb_guild_members_needed, available for each objective
/*int _NbGuildMembersNeeded;
std::string genNbGuildMembersNeededOption(CMissionData &md);*/
public:
void init(CMissionData &md, NLLIGO::IPrimitive *prim);
std::string genCode(CMissionData &md);
std::string genPhrase();
};
/** special case for step if **/
class CStepIf : public IStep
{
enum TIfType
{
it_mission_done,
it_skills,
it_bricks,
it_sdb,
it_race,
it_cult,
it_civ,
it_faction_point,
it_guild_cult,
it_guild_civ,
it_guild_fame,
it_no_trial,
it_item_in_inv,
};
public:
CStepIf(CMissionData &md, NLLIGO::IPrimitive *prim);
NLLIGO::TPrimitiveSet getSubBranchs();
void fillJump(CMissionData &md, std::set<TJumpInfo> &jumpPoints);
std::string genCode(CMissionData &md);
/// type of test
TIfType _IfType;
/// If parameters
std::vector<std::string> _IfParams;
/// the list of sub branch for the dyn chat.
NLLIGO::TPrimitiveSet _SubBranchs;
};
/** special case for step player reconnect **/
class CStepPlayerReconnect : public IStep
{
// Optional jump at end of failure
std::string _JumpTo;
/// the list of sub branch
NLLIGO::TPrimitiveSet _SubBranchs;
public:
CStepPlayerReconnect(CMissionData &md, NLLIGO::IPrimitive *prim);
NLLIGO::TPrimitiveSet getSubBranchs();
std::string genCode(CMissionData &md);
void fillJump(CMissionData &md, std::set<TJumpInfo> &jumpPoints);
};
#endif // __STEP_H__

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,154 +1,154 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef MOULINETTE_H_
#define MOULINETTE_H_
//////////////////////////////////
// INCLUDE FILES //
//////////////////////////////////
#include <nel/misc/types_nl.h>
#include <nel/misc/sstring.h>
#include "nel/misc/path.h"
#include <nel/misc/file.h>
//////////////////////////////////
// USED NAMESPACES //
//////////////////////////////////
using namespace NLMISC;
using namespace std;
//////////////////////////////////
// DATA STRUCTURES //
//////////////////////////////////
enum
{
NumMPStats= 34,
NumMPCraftParts= 26, // Warning: changing this value won't be sufficient.
// You'll have to look deeper into code
};
// Contient la description d'une Craft Part
// ainsi que les différentes caracteristiques
// qu'elle concerne
struct CraftPart
{
CSString Desc;
bool Carac[NumMPStats];
};
// Caractéristiques d'une MP relatives au craft
struct MPCraftStats
{
CSString Craft;
bool UsedAsCraftRequirement;
int bestStatA;
int worstStatA1;
int worstStatA2;
int bestStatB;
int worstStatB1;
int worstStatB2;
int color;
MPCraftStats()
{
UsedAsCraftRequirement= false;
}
};
// Permet de trier des chaines de caractères
struct ItemSort : public std::less<NLMISC::CSString>
{
bool operator()( const NLMISC::CSString& x, const NLMISC::CSString& y ) const
{
return x.icompare( y );
}
};
typedef set<CSString, ItemSort> CSortedStringSet;
// Decrit un des items générés
// pour une MP de créature
struct CreatureMPItem
{
char eco;
int itemLevel;
int creatureLevel;
CSString codeCreature;
CSortedStringSet generatedItems;
CSString creatureFileName;
};
typedef list<CreatureMPItem*> ListeCreatureMP;
// Misc Info on a MP family
class CExtraInfo
{
public:
bool DropOrSell;
CExtraInfo()
{
DropOrSell= false;
}
};
//////////////////////////////////
// VARIABLES GLOBALES //
//////////////////////////////////
// Liste des différentes Craft parts
CraftPart craftParts[NumMPCraftParts];
// Liste des fichiers .creature
map<string, string> creatureFiles;
// noms générés pour chaque item
CSortedStringSet itemNames;
// Liste des items à generer
// pour chaque code de créature
map<CSString, ListeCreatureMP> itemsAGenerer;
// MP Family list
class CMPFamily
{
public:
// Name of the family
CSString Name;
// Icon
CSString Icon;
};
std::vector<CMPFamily> MPFamilies;
// chemin des différents repertoires
CSString LEVEL_DESIGN_PATH;
CSString TRANSLATION_PATH;
CSString ITEM_MP_FAMILY_TYP;
CSString ITEM_MP_GROUPE_TYP;
CSString ITEM_MP_PARAM_DFN;
CSString MP_DIRECTORY;
CSString DEPOSIT_MPS;
CSString RAW_MATERIAL_ASSIGN;
CSString IC_FAMILIES_FORAGE_SOURCE;
CSString WK_UXT;
CSString ITEM_WORDS_WK;
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef MOULINETTE_H_
#define MOULINETTE_H_
//////////////////////////////////
// INCLUDE FILES //
//////////////////////////////////
#include <nel/misc/types_nl.h>
#include <nel/misc/sstring.h>
#include "nel/misc/path.h"
#include <nel/misc/file.h>
//////////////////////////////////
// USED NAMESPACES //
//////////////////////////////////
using namespace NLMISC;
using namespace std;
//////////////////////////////////
// DATA STRUCTURES //
//////////////////////////////////
enum
{
NumMPStats= 34,
NumMPCraftParts= 26, // Warning: changing this value won't be sufficient.
// You'll have to look deeper into code
};
// Contient la description d'une Craft Part
// ainsi que les différentes caracteristiques
// qu'elle concerne
struct CraftPart
{
CSString Desc;
bool Carac[NumMPStats];
};
// Caractéristiques d'une MP relatives au craft
struct MPCraftStats
{
CSString Craft;
bool UsedAsCraftRequirement;
int bestStatA;
int worstStatA1;
int worstStatA2;
int bestStatB;
int worstStatB1;
int worstStatB2;
int color;
MPCraftStats()
{
UsedAsCraftRequirement= false;
}
};
// Permet de trier des chaines de caractères
struct ItemSort : public std::less<NLMISC::CSString>
{
bool operator()( const NLMISC::CSString& x, const NLMISC::CSString& y ) const
{
return x.icompare( y );
}
};
typedef set<CSString, ItemSort> CSortedStringSet;
// Decrit un des items générés
// pour une MP de créature
struct CreatureMPItem
{
char eco;
int itemLevel;
int creatureLevel;
CSString codeCreature;
CSortedStringSet generatedItems;
CSString creatureFileName;
};
typedef list<CreatureMPItem*> ListeCreatureMP;
// Misc Info on a MP family
class CExtraInfo
{
public:
bool DropOrSell;
CExtraInfo()
{
DropOrSell= false;
}
};
//////////////////////////////////
// VARIABLES GLOBALES //
//////////////////////////////////
// Liste des différentes Craft parts
CraftPart craftParts[NumMPCraftParts];
// Liste des fichiers .creature
map<string, string> creatureFiles;
// noms générés pour chaque item
CSortedStringSet itemNames;
// Liste des items à generer
// pour chaque code de créature
map<CSString, ListeCreatureMP> itemsAGenerer;
// MP Family list
class CMPFamily
{
public:
// Name of the family
CSString Name;
// Icon
CSString Icon;
};
std::vector<CMPFamily> MPFamilies;
// chemin des différents repertoires
CSString LEVEL_DESIGN_PATH;
CSString TRANSLATION_PATH;
CSString ITEM_MP_FAMILY_TYP;
CSString ITEM_MP_GROUPE_TYP;
CSString ITEM_MP_PARAM_DFN;
CSString MP_DIRECTORY;
CSString DEPOSIT_MPS;
CSString RAW_MATERIAL_ASSIGN;
CSString IC_FAMILIES_FORAGE_SOURCE;
CSString WK_UXT;
CSString ITEM_WORDS_WK;
#endif

@ -1,330 +1,330 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef UTILS_H_
#define UTILS_H_
// DtName must be the 1st one
enum TDataCol { DtName, DtTitle, DtRMFamily, DtGroup, DtEcosystem, DtLevelZone, DtStatQuality, DtProp, DtCreature, DtCreaTitle, DtCraftSlotName, DtCraftCivSpec, DtColor, DtAverageEnergy, DtMaxLevel, DtCustomizedProperties, DtNbCols };
const char *DataColStr [DtNbCols] = { "Code", "Name", "Family", "Group", "Ecosystem", "LevelZone", "Stat Quality", "Properties", "Creature sheets", "Creatures", "Item parts", "Craft civ spec", "Color", "Average energy", "Max level", "Customized" };
/*
* Multi-indexed array.
* NC is the number of columns.
*/
template <uint32 NC>
class CSortableData
{
public:
/// A row is made of fields, usually 1 per column but there may be more than one (each one is a key)
struct TSortableItem
{
std::vector<std::string> Fields [NC];
///
void push( uint32 column, const std::string& f, bool allowDuplicates=false )
{
if ( (allowDuplicates) || (find( Fields[column].begin(), Fields[column].end(), f ) == Fields[column].end()) )
Fields[column].push_back( f );
}
///
void reset( uint32 column )
{
Fields[ column ].clear();
}
/**
* Display the item as a row of a HTML table.
* If (key!=previousKey) and (name==previousName), the row will not be displayed entirely to save space
*
* \param keyColumn If not ~0, column used for sorting => this column displays only the field matching the key
* \param key The key used for sorting (see keyColumn)
* \param previousKey Previous key
* \param nameColumn If not ~0, column used for the unique name (column must have exaclty one element)
* \param previousName Previous name
*/
std::string toHTMLRow( uint32 keyColumn=~0, const string& key=string(), const string& previousKey=string(),
uint32 nameColumn=~0, const string& previousName=string() ) const
{
std::string s = "<tr>";
bool lightMode = (nameColumn == ~0) ? false : ((key != previousKey) && (Fields[nameColumn][0] == previousName));
for ( uint32 c=0; c!=NC; ++c )
{
s += "<td>";
if ( c == keyColumn )
s += key; // key should be a substr of toString( c )
else
{
if ( lightMode )
s += "\"";
else
s += columnToString( c );
}
s += "</td>";
}
s += "</tr>\n";
return s;
}
///
std::string toCSVLine( char columnSeparator=',', string internalSeparator=" - ", uint32 keyColumn=~0, const string& key=string(), const string& previousKey=string(),
uint32 nameColumn=~0, const string& previousName=string() ) const
{
std::string s;
bool lightMode = (nameColumn == ~0) ? false : ((key != previousKey) && (Fields[nameColumn][0] == previousName));
for ( uint32 c=0; c!=NC; ++c )
{
if ( c == keyColumn )
s += key; // key should be a substr of columnToString( c )
else
{
if ( lightMode )
s += "\"";
else
s += columnToString( c, internalSeparator );
}
s += columnSeparator;
}
s += "\n";
return s;
}
///
std::string columnToString( uint32 column, const std::string& internalSeparator=", " ) const
{
std::string s;
std::vector<std::string>::const_iterator ivs;
for ( ivs=Fields[column].begin(); ivs!=Fields[column].end(); ++ivs )
{
if ( ivs!=Fields[column].begin() )
s += internalSeparator;
s += (*ivs);
}
return s;
}
};
typedef std::multimap< std::string, uint32 > CLookup; // key to index (not pt because reallocation invalidates pointers)
typedef std::vector< TSortableItem > CItems;
/// Init
void init( bool enabled )
{
_Enabled = enabled;
}
/// Add a row
void addItem( const TSortableItem& item )
{
if ( ! _Enabled )
return;
_Items.push_back( item );
for ( uint32 c=0; c!=NC; ++c )
{
for ( std::vector<std::string>::const_iterator ik=item.Fields[c].begin(); ik!=item.Fields[c].end(); ++ik )
{
_Indices[c].insert( make_pair( *ik, (uint32)_Items.size()-1 ) );
}
}
}
/**
* Update a row (found by the first column, which must have exactly one element).
* Returns true if it existed before, false if it's being created.
* If it existed before:
* - Does not remove elements that already exist and are not in the new item
* - Adds the new elements found in the new item at the specified columns, and updates lookup map
*/
bool updateItemAppend( const TSortableItem& item, uint32 column )
{
if ( ! _Enabled )
return true; // quiet
uint32 nameColumn = 0;
CLookup::iterator ilk = _Indices[nameColumn].find( item.Fields[nameColumn][0] );
if ( ilk != _Indices[nameColumn].end() )
{
uint32& index = (*ilk).second;
// Update map for the specified column
// and update item column
for ( std::vector<std::string>::const_iterator ivs=item.Fields[column].begin(); ivs!=item.Fields[column].end(); ++ivs )
{
ilk = _Indices[column].find( *ivs );
if ( (ilk == _Indices[column].end()) || ( getRow( (*ilk).second ).Fields[nameColumn][0] != item.Fields[nameColumn][0]) )
{
_Indices[column].insert( make_pair( *ivs, index ) );
_Items[index].Fields[column].push_back( *ivs );
}
}
return true;
}
else
{
addItem( item );
return false;
}
}
/**
* Update a row (found by the first column, which must have exactly one element).
* Returns true if it existed before, false if it's being created.
* If it existed before:
* - Does not update lookup maps or item for columns that were already present.
* - Adds entries in lookup maps and updates item for new columns (fields that were empty).
*/
/*bool updateItemAppend( const TSortableItem& item )
{
if ( ! _Enabled )
return true; // quiet
CLookup::iterator ilk = _Indices[0].find( item.Fields[0][0] );
if ( ilk != _Indices[0].end() )
{
uint32& index = (*ilk).second;
for ( uint32 c=1; c!=NC; ++c )
{
// Update maps for previously empty columns
if ( _Items[index].Fields[c].empty() )
{
for ( std::vector<std::string>::iterator ivs=item.Fields[c].begin(); ivs!=item.Fields[c].end(); ++ivs )
_Indices[c].insert( make_pair( *ivs, index ) );
}
// Update item column
_Items[index].Fields[c] = item.Fields[c];
}
return true;
}
else
{
addItem( item );
return false;
}
}*/
/// Find or browse by key
CLookup& lookup( uint32 column )
{
return _Indices[column];
}
/// Browse by adding order
CItems& items()
{
return _Items;
}
/// Get a row by index
TSortableItem& getRow( uint32 index )
{
return _Items[index];
}
private:
CLookup _Indices [NC];
CItems _Items;
bool _Enabled;
};
typedef CSortableData<DtNbCols> CRMData;
typedef CRMData::TSortableItem TRMItem;
/**
*
*/
class CProducedDocHtml
{
public:
///
CProducedDocHtml() : _File(NULL), _Enabled(false) {}
///
void open( const std::string& filename, const std::string& title, bool enableFlag )
{
_Enabled = enableFlag;
if ( ! _Enabled )
return;
_File = fopen( filename.c_str(), "wt" );
if(!_File)
{
throw Exception("Could not open html: %s", filename.c_str());
}
fprintf( _File, ("<html><head>\n<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n<title>" + title + "</title>\n</head><body>\n").c_str() );
}
///
void write( const std::string& htmlCode )
{
if ( ! _Enabled )
return;
fprintf( _File, htmlCode.c_str() );
}
///
void writeln( const std::string& htmlCode )
{
write( htmlCode + "\n" );
}
///
void writebln( const std::string& htmlCode )
{
write( htmlCode + "<br>\n" );
}
///
void writepln( const std::string& htmlCode )
{
write( "<p>" + htmlCode + "</p>\n" );
}
///
void save()
{
if ( ! _Enabled )
return;
fprintf( _File, "</body></html>\n" );
fclose( _File );
}
private:
FILE *_File;
bool _Enabled;
};
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef UTILS_H_
#define UTILS_H_
// DtName must be the 1st one
enum TDataCol { DtName, DtTitle, DtRMFamily, DtGroup, DtEcosystem, DtLevelZone, DtStatQuality, DtProp, DtCreature, DtCreaTitle, DtCraftSlotName, DtCraftCivSpec, DtColor, DtAverageEnergy, DtMaxLevel, DtCustomizedProperties, DtNbCols };
const char *DataColStr [DtNbCols] = { "Code", "Name", "Family", "Group", "Ecosystem", "LevelZone", "Stat Quality", "Properties", "Creature sheets", "Creatures", "Item parts", "Craft civ spec", "Color", "Average energy", "Max level", "Customized" };
/*
* Multi-indexed array.
* NC is the number of columns.
*/
template <uint32 NC>
class CSortableData
{
public:
/// A row is made of fields, usually 1 per column but there may be more than one (each one is a key)
struct TSortableItem
{
std::vector<std::string> Fields [NC];
///
void push( uint32 column, const std::string& f, bool allowDuplicates=false )
{
if ( (allowDuplicates) || (find( Fields[column].begin(), Fields[column].end(), f ) == Fields[column].end()) )
Fields[column].push_back( f );
}
///
void reset( uint32 column )
{
Fields[ column ].clear();
}
/**
* Display the item as a row of a HTML table.
* If (key!=previousKey) and (name==previousName), the row will not be displayed entirely to save space
*
* \param keyColumn If not ~0, column used for sorting => this column displays only the field matching the key
* \param key The key used for sorting (see keyColumn)
* \param previousKey Previous key
* \param nameColumn If not ~0, column used for the unique name (column must have exaclty one element)
* \param previousName Previous name
*/
std::string toHTMLRow( uint32 keyColumn=~0, const string& key=string(), const string& previousKey=string(),
uint32 nameColumn=~0, const string& previousName=string() ) const
{
std::string s = "<tr>";
bool lightMode = (nameColumn == ~0) ? false : ((key != previousKey) && (Fields[nameColumn][0] == previousName));
for ( uint32 c=0; c!=NC; ++c )
{
s += "<td>";
if ( c == keyColumn )
s += key; // key should be a substr of toString( c )
else
{
if ( lightMode )
s += "\"";
else
s += columnToString( c );
}
s += "</td>";
}
s += "</tr>\n";
return s;
}
///
std::string toCSVLine( char columnSeparator=',', string internalSeparator=" - ", uint32 keyColumn=~0, const string& key=string(), const string& previousKey=string(),
uint32 nameColumn=~0, const string& previousName=string() ) const
{
std::string s;
bool lightMode = (nameColumn == ~0) ? false : ((key != previousKey) && (Fields[nameColumn][0] == previousName));
for ( uint32 c=0; c!=NC; ++c )
{
if ( c == keyColumn )
s += key; // key should be a substr of columnToString( c )
else
{
if ( lightMode )
s += "\"";
else
s += columnToString( c, internalSeparator );
}
s += columnSeparator;
}
s += "\n";
return s;
}
///
std::string columnToString( uint32 column, const std::string& internalSeparator=", " ) const
{
std::string s;
std::vector<std::string>::const_iterator ivs;
for ( ivs=Fields[column].begin(); ivs!=Fields[column].end(); ++ivs )
{
if ( ivs!=Fields[column].begin() )
s += internalSeparator;
s += (*ivs);
}
return s;
}
};
typedef std::multimap< std::string, uint32 > CLookup; // key to index (not pt because reallocation invalidates pointers)
typedef std::vector< TSortableItem > CItems;
/// Init
void init( bool enabled )
{
_Enabled = enabled;
}
/// Add a row
void addItem( const TSortableItem& item )
{
if ( ! _Enabled )
return;
_Items.push_back( item );
for ( uint32 c=0; c!=NC; ++c )
{
for ( std::vector<std::string>::const_iterator ik=item.Fields[c].begin(); ik!=item.Fields[c].end(); ++ik )
{
_Indices[c].insert( make_pair( *ik, (uint32)_Items.size()-1 ) );
}
}
}
/**
* Update a row (found by the first column, which must have exactly one element).
* Returns true if it existed before, false if it's being created.
* If it existed before:
* - Does not remove elements that already exist and are not in the new item
* - Adds the new elements found in the new item at the specified columns, and updates lookup map
*/
bool updateItemAppend( const TSortableItem& item, uint32 column )
{
if ( ! _Enabled )
return true; // quiet
uint32 nameColumn = 0;
CLookup::iterator ilk = _Indices[nameColumn].find( item.Fields[nameColumn][0] );
if ( ilk != _Indices[nameColumn].end() )
{
uint32& index = (*ilk).second;
// Update map for the specified column
// and update item column
for ( std::vector<std::string>::const_iterator ivs=item.Fields[column].begin(); ivs!=item.Fields[column].end(); ++ivs )
{
ilk = _Indices[column].find( *ivs );
if ( (ilk == _Indices[column].end()) || ( getRow( (*ilk).second ).Fields[nameColumn][0] != item.Fields[nameColumn][0]) )
{
_Indices[column].insert( make_pair( *ivs, index ) );
_Items[index].Fields[column].push_back( *ivs );
}
}
return true;
}
else
{
addItem( item );
return false;
}
}
/**
* Update a row (found by the first column, which must have exactly one element).
* Returns true if it existed before, false if it's being created.
* If it existed before:
* - Does not update lookup maps or item for columns that were already present.
* - Adds entries in lookup maps and updates item for new columns (fields that were empty).
*/
/*bool updateItemAppend( const TSortableItem& item )
{
if ( ! _Enabled )
return true; // quiet
CLookup::iterator ilk = _Indices[0].find( item.Fields[0][0] );
if ( ilk != _Indices[0].end() )
{
uint32& index = (*ilk).second;
for ( uint32 c=1; c!=NC; ++c )
{
// Update maps for previously empty columns
if ( _Items[index].Fields[c].empty() )
{
for ( std::vector<std::string>::iterator ivs=item.Fields[c].begin(); ivs!=item.Fields[c].end(); ++ivs )
_Indices[c].insert( make_pair( *ivs, index ) );
}
// Update item column
_Items[index].Fields[c] = item.Fields[c];
}
return true;
}
else
{
addItem( item );
return false;
}
}*/
/// Find or browse by key
CLookup& lookup( uint32 column )
{
return _Indices[column];
}
/// Browse by adding order
CItems& items()
{
return _Items;
}
/// Get a row by index
TSortableItem& getRow( uint32 index )
{
return _Items[index];
}
private:
CLookup _Indices [NC];
CItems _Items;
bool _Enabled;
};
typedef CSortableData<DtNbCols> CRMData;
typedef CRMData::TSortableItem TRMItem;
/**
*
*/
class CProducedDocHtml
{
public:
///
CProducedDocHtml() : _File(NULL), _Enabled(false) {}
///
void open( const std::string& filename, const std::string& title, bool enableFlag )
{
_Enabled = enableFlag;
if ( ! _Enabled )
return;
_File = fopen( filename.c_str(), "wt" );
if(!_File)
{
throw Exception("Could not open html: %s", filename.c_str());
}
fprintf( _File, ("<html><head>\n<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">\n<title>" + title + "</title>\n</head><body>\n").c_str() );
}
///
void write( const std::string& htmlCode )
{
if ( ! _Enabled )
return;
fprintf( _File, htmlCode.c_str() );
}
///
void writeln( const std::string& htmlCode )
{
write( htmlCode + "\n" );
}
///
void writebln( const std::string& htmlCode )
{
write( htmlCode + "<br>\n" );
}
///
void writepln( const std::string& htmlCode )
{
write( "<p>" + htmlCode + "</p>\n" );
}
///
void save()
{
if ( ! _Enabled )
return;
fprintf( _File, "</body></html>\n" );
fclose( _File );
}
private:
FILE *_File;
bool _Enabled;
};
#endif

File diff suppressed because it is too large Load Diff

@ -1,158 +1,158 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "nel/misc/types_nl.h"
#include "nel/misc/config_file.h"
#include "nel/misc/path.h"
#include "nel/misc/file.h"
using namespace std;
using namespace NLMISC;
int main(int argc, char *argv[])
{
new NLMISC::CApplicationContext;
CConfigFile cf;
uint32 firstFreeIndex = 0;
// load the config file
cf.load("primitive_id_assignator.cfg");
// get the list of extension
CConfigFile::CVar &ext = cf.getVar("Extension");
// get the list of filter
CConfigFile::CVar &filters = cf.getVar("Filters");
// Add the search paths
CConfigFile::CVar &sp = cf.getVar("SearchPath");
for (uint i=0; i<sp.size(); ++i)
{
CPath::addSearchPath(sp.asString(i), true, false);
}
// get the index file.
CConfigFile indexFile;
map<string, uint32> indexMap;
CConfigFile::CVar &vif = cf.getVar("IndexFile");
if (!CFile::isExists(vif.asString()))
{
// build a default config file
string fileName = vif.asString();
FILE *fp = fopen(fileName.c_str(), "wt");
if (fp == NULL)
{
nlwarning("Can't open file '%s' for writing",
fileName.c_str());
return -1;
}
fprintf(fp, "Files = {};\n");
fclose(fp);
}
indexFile.load(vif.asString());
// parse the index file
CConfigFile::CVar &fl = indexFile.getVar("Files");
for (uint i=0; i<(fl.size())/2; i++)
{
string fileName;
uint32 index;
fileName = fl.asString(i*2);
index = fl.asInt(i*2+1);
if (indexMap.find(fileName) != indexMap.end())
{
nlwarning("Association for file '%s' already exist as index %u, new association with index %u will be lost",
fileName.c_str(),
index,
indexMap[fileName]);
}
else
{
indexMap[fileName] = index;
if (index >= firstFreeIndex)
firstFreeIndex = index + 1;
}
}
// scan the search path
for (uint i=0; i<ext.size(); ++i)
{
vector<string> files;
CPath::getFileList(ext.asString(i), files);
for (uint i=0; i<files.size(); ++i)
{
string fileName(CFile::getFilename(files[i]));
if (indexMap.find(fileName) == indexMap.end())
{
// check the first on full path
bool filtered = false;
string path = CPath::lookup(fileName);
for (uint i=0; i<filters.size(); ++i)
{
if (path.find(filters.asString(i)) != string::npos)
{
// skip this file
nlinfo("File '%s' filtered out by rule '%s' (in '%s')",
fileName.c_str(),
filters.asString(i).c_str(),
path.c_str());
filtered = true;
continue;
}
}
if (!filtered)
{
// this file is not index, add it!
indexMap[fileName] = firstFreeIndex++;
nlinfo("Indexing file '%s' with index %u",
fileName.c_str(),
indexMap[fileName]);
}
}
}
}
// rebuild the config file
indexFile.clearVars();
map<string, uint32>::iterator first(indexMap.begin()), last(indexMap.end());
for (uint i=0; first != last; ++first, ++i)
{
if (i == 0)
fl.forceAsString(first->first);
else
fl.setAsString(first->first, i*2);
fl.setAsString(toString("%u", first->second), i*2+1);
}
nlinfo("Writing index with %u files indexed",
fl.size());
indexFile.save();
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "nel/misc/types_nl.h"
#include "nel/misc/config_file.h"
#include "nel/misc/path.h"
#include "nel/misc/file.h"
using namespace std;
using namespace NLMISC;
int main(int argc, char *argv[])
{
new NLMISC::CApplicationContext;
CConfigFile cf;
uint32 firstFreeIndex = 0;
// load the config file
cf.load("primitive_id_assignator.cfg");
// get the list of extension
CConfigFile::CVar &ext = cf.getVar("Extension");
// get the list of filter
CConfigFile::CVar &filters = cf.getVar("Filters");
// Add the search paths
CConfigFile::CVar &sp = cf.getVar("SearchPath");
for (uint i=0; i<sp.size(); ++i)
{
CPath::addSearchPath(sp.asString(i), true, false);
}
// get the index file.
CConfigFile indexFile;
map<string, uint32> indexMap;
CConfigFile::CVar &vif = cf.getVar("IndexFile");
if (!CFile::isExists(vif.asString()))
{
// build a default config file
string fileName = vif.asString();
FILE *fp = fopen(fileName.c_str(), "wt");
if (fp == NULL)
{
nlwarning("Can't open file '%s' for writing",
fileName.c_str());
return -1;
}
fprintf(fp, "Files = {};\n");
fclose(fp);
}
indexFile.load(vif.asString());
// parse the index file
CConfigFile::CVar &fl = indexFile.getVar("Files");
for (uint i=0; i<(fl.size())/2; i++)
{
string fileName;
uint32 index;
fileName = fl.asString(i*2);
index = fl.asInt(i*2+1);
if (indexMap.find(fileName) != indexMap.end())
{
nlwarning("Association for file '%s' already exist as index %u, new association with index %u will be lost",
fileName.c_str(),
index,
indexMap[fileName]);
}
else
{
indexMap[fileName] = index;
if (index >= firstFreeIndex)
firstFreeIndex = index + 1;
}
}
// scan the search path
for (uint i=0; i<ext.size(); ++i)
{
vector<string> files;
CPath::getFileList(ext.asString(i), files);
for (uint i=0; i<files.size(); ++i)
{
string fileName(CFile::getFilename(files[i]));
if (indexMap.find(fileName) == indexMap.end())
{
// check the first on full path
bool filtered = false;
string path = CPath::lookup(fileName);
for (uint i=0; i<filters.size(); ++i)
{
if (path.find(filters.asString(i)) != string::npos)
{
// skip this file
nlinfo("File '%s' filtered out by rule '%s' (in '%s')",
fileName.c_str(),
filters.asString(i).c_str(),
path.c_str());
filtered = true;
continue;
}
}
if (!filtered)
{
// this file is not index, add it!
indexMap[fileName] = firstFreeIndex++;
nlinfo("Indexing file '%s' with index %u",
fileName.c_str(),
indexMap[fileName]);
}
}
}
}
// rebuild the config file
indexFile.clearVars();
map<string, uint32>::iterator first(indexMap.begin()), last(indexMap.end());
for (uint i=0; first != last; ++first, ++i)
{
if (i == 0)
fl.forceAsString(first->first);
else
fl.setAsString(first->first, i*2);
fl.setAsString(toString("%u", first->second), i*2+1);
}
nlinfo("Writing index with %u files indexed",
fl.size());
indexFile.save();
}

@ -1,133 +1,133 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <nel/misc/types_nl.h>
#include <nel/misc/ucstring.h>
#include <nel/misc/sstring.h>
#include <nel/misc/i18n.h>
using namespace std;
using namespace NLMISC;
void usage()
{
printf("uni_conv [option] <output_mode> <input_file> <output_file>\n");
printf("output_mode is one of:\n");
printf("\t-8 output in UTF-8\n");
printf("\t-16 output in UTF-16\n");
printf("\t-a output in ascii, non ascii char are silently removed\n");
printf("option:\n");
printf("\t-x minimal support for XML : encode &, < and > in XML chat tag\n");
}
int main(int argc, char *argv[])
{
new NLMISC::CApplicationContext;
bool xmlSupport = false;
enum TOutMode {UNDEF, UTF8, UTF16, ASCII};
CSString inputFile;
CSString outputFile;
TOutMode outMode = UNDEF;
if (argc < 4)
{
usage();
return -1;
}
for (int i=1; i<argc; ++i)
{
CSString arg = argv[i];
if (arg == "-x")
xmlSupport = true;
else if (arg == "-8")
outMode = UTF8;
else if (arg == "-16")
outMode = UTF16;
else if (arg == "-a")
outMode = ASCII;
else if (i == argc-1)
outputFile = arg;
else if (i == argc-2)
inputFile = arg;
}
if (outputFile.empty() || inputFile.empty() || outMode == UNDEF)
{
usage();
return -1;
}
ucstring str;
CI18N::readTextFile(inputFile, str, false, false, false);
if (outMode == ASCII)
{
// remove any outof ascii char
ucstring temp;
for (uint i=0; i<str.size(); ++i)
{
if (str[i] < 256)
temp += str[i];
}
str = temp;
}
if (xmlSupport)
{
ucstring temp;
for (uint i=0; i<str.size(); ++i)
{
switch(str[i])
{
case '&':
temp += "&amp;";
break;
case '<':
temp += "&gt;";
break;
case '>':
temp += "&lt;";
break;
default:
temp += str[i];
}
}
str = temp;
}
switch(outMode)
{
case UTF8:
CI18N::writeTextFile(outputFile, str, true);
break;
case UTF16:
CI18N::writeTextFile(outputFile, str, false);
break;
case ASCII:
{
string s = str.toString();
FILE *fp = fopen(outputFile.c_str(), "wt");
fwrite(s.data(), s.size(), 1, fp);
fclose(fp);
}
break;
default:
break;
}
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <nel/misc/types_nl.h>
#include <nel/misc/ucstring.h>
#include <nel/misc/sstring.h>
#include <nel/misc/i18n.h>
using namespace std;
using namespace NLMISC;
void usage()
{
printf("uni_conv [option] <output_mode> <input_file> <output_file>\n");
printf("output_mode is one of:\n");
printf("\t-8 output in UTF-8\n");
printf("\t-16 output in UTF-16\n");
printf("\t-a output in ascii, non ascii char are silently removed\n");
printf("option:\n");
printf("\t-x minimal support for XML : encode &, < and > in XML chat tag\n");
}
int main(int argc, char *argv[])
{
new NLMISC::CApplicationContext;
bool xmlSupport = false;
enum TOutMode {UNDEF, UTF8, UTF16, ASCII};
CSString inputFile;
CSString outputFile;
TOutMode outMode = UNDEF;
if (argc < 4)
{
usage();
return -1;
}
for (int i=1; i<argc; ++i)
{
CSString arg = argv[i];
if (arg == "-x")
xmlSupport = true;
else if (arg == "-8")
outMode = UTF8;
else if (arg == "-16")
outMode = UTF16;
else if (arg == "-a")
outMode = ASCII;
else if (i == argc-1)
outputFile = arg;
else if (i == argc-2)
inputFile = arg;
}
if (outputFile.empty() || inputFile.empty() || outMode == UNDEF)
{
usage();
return -1;
}
ucstring str;
CI18N::readTextFile(inputFile, str, false, false, false);
if (outMode == ASCII)
{
// remove any outof ascii char
ucstring temp;
for (uint i=0; i<str.size(); ++i)
{
if (str[i] < 256)
temp += str[i];
}
str = temp;
}
if (xmlSupport)
{
ucstring temp;
for (uint i=0; i<str.size(); ++i)
{
switch(str[i])
{
case '&':
temp += "&amp;";
break;
case '<':
temp += "&gt;";
break;
case '>':
temp += "&lt;";
break;
default:
temp += str[i];
}
}
str = temp;
}
switch(outMode)
{
case UTF8:
CI18N::writeTextFile(outputFile, str, true);
break;
case UTF16:
CI18N::writeTextFile(outputFile, str, false);
break;
case ASCII:
{
string s = str.toString();
FILE *fp = fopen(outputFile.c_str(), "wt");
fwrite(s.data(), s.size(), 1, fp);
fclose(fp);
}
break;
default:
break;
}
}

@ -1,88 +1,88 @@
========================================================================
MICROSOFT FOUNDATION CLASS LIBRARY : VariableParser
========================================================================
AppWizard has created this VariableParser application for you. This application
not only demonstrates the basics of using the Microsoft Foundation classes
but is also a starting point for writing your application.
This file contains a summary of what you will find in each of the files that
make up your VariableParser application.
VariableParser.dsp
This file (the project file) contains information at the project level and
is used to build a single project or subproject. Other users can share the
project (.dsp) file, but they should export the makefiles locally.
VariableParser.h
This is the main header file for the application. It includes other
project specific headers (including Resource.h) and declares the
CVariableParserApp application class.
VariableParser.cpp
This is the main application source file that contains the application
class CVariableParserApp.
VariableParser.rc
This is a listing of all of the Microsoft Windows resources that the
program uses. It includes the icons, bitmaps, and cursors that are stored
in the RES subdirectory. This file can be directly edited in Microsoft
Visual C++.
VariableParser.clw
This file contains information used by ClassWizard to edit existing
classes or add new classes. ClassWizard also uses this file to store
information needed to create and edit message maps and dialog data
maps and to create prototype member functions.
res\VariableParser.ico
This is an icon file, which is used as the application's icon. This
icon is included by the main resource file VariableParser.rc.
res\VariableParser.rc2
This file contains resources that are not edited by Microsoft
Visual C++. You should place all resources not editable by
the resource editor in this file.
/////////////////////////////////////////////////////////////////////////////
AppWizard creates one dialog class:
VariableParserDlg.h, VariableParserDlg.cpp - the dialog
These files contain your CVariableParserDlg class. This class defines
the behavior of your application's main dialog. The dialog's
template is in VariableParser.rc, which can be edited in Microsoft
Visual C++.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named VariableParser.pch and a precompiled types file named StdAfx.obj.
Resource.h
This is the standard header file, which defines new resource IDs.
Microsoft Visual C++ reads and updates this file.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" to indicate parts of the source code you
should add to or customize.
If your application uses MFC in a shared DLL, and your application is
in a language other than the operating system's current language, you
will need to copy the corresponding localized resources MFC42XXX.DLL
from the Microsoft Visual C++ CD-ROM onto the system or system32 directory,
and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation.
For example, MFC42DEU.DLL contains resources translated to German.) If you
don't do this, some of the UI elements of your application will remain in the
language of the operating system.
/////////////////////////////////////////////////////////////////////////////
========================================================================
MICROSOFT FOUNDATION CLASS LIBRARY : VariableParser
========================================================================
AppWizard has created this VariableParser application for you. This application
not only demonstrates the basics of using the Microsoft Foundation classes
but is also a starting point for writing your application.
This file contains a summary of what you will find in each of the files that
make up your VariableParser application.
VariableParser.dsp
This file (the project file) contains information at the project level and
is used to build a single project or subproject. Other users can share the
project (.dsp) file, but they should export the makefiles locally.
VariableParser.h
This is the main header file for the application. It includes other
project specific headers (including Resource.h) and declares the
CVariableParserApp application class.
VariableParser.cpp
This is the main application source file that contains the application
class CVariableParserApp.
VariableParser.rc
This is a listing of all of the Microsoft Windows resources that the
program uses. It includes the icons, bitmaps, and cursors that are stored
in the RES subdirectory. This file can be directly edited in Microsoft
Visual C++.
VariableParser.clw
This file contains information used by ClassWizard to edit existing
classes or add new classes. ClassWizard also uses this file to store
information needed to create and edit message maps and dialog data
maps and to create prototype member functions.
res\VariableParser.ico
This is an icon file, which is used as the application's icon. This
icon is included by the main resource file VariableParser.rc.
res\VariableParser.rc2
This file contains resources that are not edited by Microsoft
Visual C++. You should place all resources not editable by
the resource editor in this file.
/////////////////////////////////////////////////////////////////////////////
AppWizard creates one dialog class:
VariableParserDlg.h, VariableParserDlg.cpp - the dialog
These files contain your CVariableParserDlg class. This class defines
the behavior of your application's main dialog. The dialog's
template is in VariableParser.rc, which can be edited in Microsoft
Visual C++.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named VariableParser.pch and a precompiled types file named StdAfx.obj.
Resource.h
This is the standard header file, which defines new resource IDs.
Microsoft Visual C++ reads and updates this file.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" to indicate parts of the source code you
should add to or customize.
If your application uses MFC in a shared DLL, and your application is
in a language other than the operating system's current language, you
will need to copy the corresponding localized resources MFC42XXX.DLL
from the Microsoft Visual C++ CD-ROM onto the system or system32 directory,
and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation.
For example, MFC42DEU.DLL contains resources translated to German.) If you
don't do this, some of the UI elements of your application will remain in the
language of the operating system.
/////////////////////////////////////////////////////////////////////////////

@ -1,24 +1,24 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// stdafx.cpp : source file that includes just the standard includes
// VariableParser.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// stdafx.cpp : source file that includes just the standard includes
// VariableParser.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

@ -1,44 +1,44 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__17D2C6E8_64DB_4922_95A2_E74A8E91D24E__INCLUDED_)
#define AFX_STDAFX_H__17D2C6E8_64DB_4922_95A2_E74A8E91D24E__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#define NOMINMAX
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__17D2C6E8_64DB_4922_95A2_E74A8E91D24E__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__17D2C6E8_64DB_4922_95A2_E74A8E91D24E__INCLUDED_)
#define AFX_STDAFX_H__17D2C6E8_64DB_4922_95A2_E74A8E91D24E__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#define NOMINMAX
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__17D2C6E8_64DB_4922_95A2_E74A8E91D24E__INCLUDED_)

File diff suppressed because it is too large Load Diff

@ -1,374 +1,374 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef RZ_LUA_HELPER_H
#define RZ_LUA_HELPER_H
#include "nel/misc/types_nl.h"
#include "nel/misc/smart_ptr.h"
extern "C"
{
#include <lua.h>
}
class CLuaState;
// ***************************************************************************
/** Helper class to see if a stack is restored at its initial size (or with n return results).
* Check that the stack size remains unchanged when the object goes out of scope
*/
class CLuaStackChecker
{
public:
CLuaStackChecker(CLuaState *state, int numWantedResults = 0);
~CLuaStackChecker();
/** Increment exception context counter
* When an exception is thrown, lua stack checker do any assert bu will
* rather restore the lua stack at its original size, and will
* let the exception a chance to propagate
*/
static void incrementExceptionContextCounter();
static void decrementExceptionContextCounter();
private:
CLuaState *_State;
int _FinalWantedSize;
static uint _ExceptionContextCounter;
};
// **************************************************************************
/** Helper class to restore the lua stack to the desired size when this object goes out of scope
*/
class CLuaStackRestorer
{
public:
CLuaStackRestorer(CLuaState *state, int finalSize);
~CLuaStackRestorer();
private:
int _FinalSize;
CLuaState *_State;
};
////////////////
// EXCEPTIONS //
////////////////
class ELuaError : public NLMISC::Exception
{
public:
ELuaError() { CLuaStackChecker::incrementExceptionContextCounter(); }
virtual ~ELuaError() throw() { CLuaStackChecker::decrementExceptionContextCounter(); }
ELuaError(const std::string &reason) : Exception(reason) { CLuaStackChecker::incrementExceptionContextCounter(); }
// what(), plus append the Reason
virtual std::string luaWhat() const throw() {return NLMISC::toString("LUAError: %s", what());}
};
// A parse error occured
class ELuaParseError : public ELuaError
{
public:
ELuaParseError() {}
ELuaParseError(const std::string &reason) : ELuaError(reason) {}
virtual ~ELuaParseError() throw() { }
// what(), plus append the Reason
virtual std::string luaWhat() const throw() {return NLMISC::toString("ELuaParseError: %s", what());}
};
/** Exception thrown when something went wrong inside a wrapped function called by lua
*/
class ELuaWrappedFunctionException : public ELuaError
{
public:
ELuaWrappedFunctionException(CLuaState *luaState);
ELuaWrappedFunctionException(CLuaState *luaState, const std::string &reason);
ELuaWrappedFunctionException(CLuaState *luaState, const char *format, ...);
virtual ~ELuaWrappedFunctionException() throw() { }
virtual const char *what() const throw() {return _Reason.c_str();}
protected:
void init(CLuaState *ls, const std::string &reason);
protected:
std::string _Reason;
};
// A execution error occured
class ELuaExecuteError : public ELuaError
{
public:
ELuaExecuteError() {}
ELuaExecuteError(const std::string &reason) : ELuaError(reason) {}
virtual ~ELuaExecuteError() throw() { }
// what(), plus append the Reason
virtual std::string luaWhat() const throw() {return NLMISC::toString("ELuaExecuteError: %s", what());}
};
// A bad cast occured when using lua_checkcast
class ELuaBadCast : public ELuaError
{
public:
ELuaBadCast() {}
ELuaBadCast(const std::string &reason) : ELuaError(reason) {}
// what(), plus append the Reason
virtual std::string luaWhat() const throw() {return NLMISC::toString("ELuaBadCast: %s", what());}
};
// Error when trying to indexate an object that is not a table
class ELuaNotATable : public ELuaError
{
public:
ELuaNotATable() {}
ELuaNotATable(const std::string &reason) : ELuaError(reason) {}
// what(), plus append the Reason
virtual std::string luaWhat() const throw() {return NLMISC::toString("ELuaNotATable: %s", what());}
};
// ***************************************************************************
// a function to be used with a CLuaState instance
typedef int (* TLuaWrappedFunction) (CLuaState &ls);
// ***************************************************************************
/** C++ version of a lua state
*/
class CLuaState : public NLMISC::CRefCount
{
public:
typedef NLMISC::CRefPtr<CLuaState> TRefPtr;
// Create a new environement
CLuaState();
~CLuaState();
/// \name Registering
// @{
// register a wrapped function
void registerFunc(const char *name, TLuaWrappedFunction function);
// @}
/// \name Script execution
// @{
/** Parse a script and push as a function in top of the LUA stack
* \throw ELuaParseError
* \param dbgSrc is a string for debug. Should be a filename (preceded with '@'), or a short script.
*/
void loadScript(const std::string &code, const std::string &dbgSrc);
/** Execute a script from a string, possibly throwing an exception if there's a parse error
* \throw ELuaParseError, ELuaExecuteError
*/
void executeScript(const std::string &code, int numRet = 0);
/** Execute a script from a string. If an errors occurs it is printed in the log
* \return true if script execution was successful
*/
bool executeScriptNoThrow(const std::string &code, int numRet = 0);
/** Load a Script from a File (maybe in a BNP), and execute it
* \return false if file not found
* \throw ELuaParseError, ELuaExecuteError
*/
bool executeFile(const std::string &pathName);
/** execute a very Small Script (a function call for instance)
* It is different from doString() in such there is a cache (where the key is the script itself)
* so that the second time this script is executed, there is no parsing
* Note: I experienced optim with about 10 times faster than a executeScript() on a simple "a= a+1;" script
* \throw ELuaParseError, ELuaExecuteError
*/
void executeSmallScript(const std::string &script);
// @}
/// \name Stack Manipulation
// @{
// stack manipulation (indices start at 1)
void setTop(int index); // set new size of stack
void clear() { setTop(0); }
int getTop();
bool empty() { return getTop() == 0; }
void pushValue(int index); // copie nth element of stack to the top of the stack
void remove(int index); // remove nth element of stack
void insert(int index); // insert last element of the stack before the given position
void replace(int index); // replace nth element of the stack with the top of the stack
void pop(int numElem = 1); // remove n elements from the top of the stack
// test the type of an element in the stack
// return one of the following values :
// LUA_TNIL
// LUA_TNUMBER
// LUA_TBOOLEAN
// LUA_TSTRING
// LUA_TTABLE
// LUA_TFUNCTION
// LUA_TUSERDATA
// LUA_TTHREAD
// LUA_TLIGHTUSERDATA
int type(int index = -1);
const char *getTypename(int type);
bool isNil(int index = -1);
bool isBoolean(int index = -1);
bool isNumber(int index = -1);
bool isString(int index = -1);
bool isTable(int index = -1);
bool isFunction(int index = -1);
bool isCFunction(int index = -1);
bool isUserData(int index = -1);
bool isLightUserData(int index = -1);
// converting then getting a value from the stack
bool toBoolean(int index = -1);
lua_Number toNumber(int index = -1);
const char *toString(int index = -1);
void toString(int index, std::string &str); // convert to a std::string, with a NULL check.
size_t strlen(int index = -1);
lua_CFunction toCFunction(int index = -1);
void *toUserData(int index = -1);
const void *toPointer(int index = -1);
/** Helper functions : get value of the wanted type in the top table after conversion
* A default value is used if the stack entry is NULL.
* If conversion fails then an exception is thrown (with optional msg)
*/
bool getTableBooleanValue(const char *name, bool defaultValue= false);
double getTableNumberValue(const char *name, double defaultValue= 0);
const char *getTableStringValue(const char *name, const char *defaultValue= NULL);
// pushing value onto the stack
void push(bool value);
void push(lua_Number value);
void push(const char *str);
void push(const char *str, int length);
void push(const std::string &str);
void pushNil();
void push(lua_CFunction f);
void push(TLuaWrappedFunction function);
void pushLightUserData(void *); // push a light user data (use newUserData to push a full userdata)
// metatables
bool getMetaTable(int index = -1);
bool setMetaTable(int index = -1); // set the metatable at top of stack to the object at 'index' (usually -2), then pop the metatable
// even if asignment failed
// comparison
bool equal(int index1, int index2);
bool rawEqual(int index1, int index2);
bool lessThan(int index1, int index2);
// concatenation of the n element at the top of the stack (using lua semantic)
void concat(int numElem);
// tables
void newTable(); // create a new table at top of the stack
void getTable(int index); // get value from a table at index 'index' (key is at top)
void rawGet(int index);
void setTable(int index); // set (key, value) from top of the stack into the given table
// both key and value are poped
void rawSet(int index);
bool next(int index); // table traversal
// UserData
void *newUserData(uint size);
// seting value by int index in a table
void rawSetI(int index, int n);
void rawGetI(int index, int n);
/** Calling functions (it's up to the caller to clear the results)
* The function should have been pushed on the stack
*/
void call(int nargs, int nresults);
int pcall(int nargs, int nresults, int errfunc = 0);
/** Helper : Execute a function by name. Lookup for the function is done in the table at the index 'funcTableIndex'
* the behaviour is the same than with call of pcall.
*/
int pcallByName(const char *functionName, int nargs, int nresults, int funcTableIndex = LUA_GLOBALSINDEX, int errfunc = 0);
// push a C closure (pop n element from the stack and associate with the function)
void pushCClosure(lua_CFunction function, int n);
// @}
/// \name Misc
// @{
/** Retrieve pointer to a CLuaState environment from its lua_State pointer, or NULL
* if there no such environment
*/
static CLuaState *fromStatePointer(lua_State *state);
// Get state pointer. The state should not be closed (this object has ownership)
lua_State *getStatePointer() const {return _State;}
// check that an index is valid when accessing the stack
// an assertion is raised if the index is not valid
void checkIndex(int index);
// registering C function to use with a lua state pointer
void registerFunc(const char *name, lua_CFunction function);
// Garbage collector
int getGCCount(); // get memory in use in KB
int getGCThreshold(); // get max memory in KB
void setGCThreshold(int kb); // set max memory in KB (no-op with ref-counted version)
// handle garbage collector for ref-counted version of lua (no-op with standard version, in which case gc handling is automatic)
void handleGC();
/** For Debug: get the Stack context of execution (filename / line)
* \param stackLevel: get the context of execution of the given stackLevel.
* 0 for the current function
* 1 for the function that called 0
* 2 ....
* NB: if called from a C function called from LUA, remember that stackLevel 0 is the current function.
* Hence if you want to know what LUA context called you, pass stackLevel=1!
* \param ret string cleared if any error, else filled with formated FileName / LineNumber
*/
void getStackContext(std::string &ret, uint stackLevel);
// @}
// for debug : dump the current content of the stack (no recursion)
void dumpStack();
static void dumpStack(lua_State *ls);
void getStackAsString(std::string &dest);
private:
lua_State *_State;
// Small Script Cache
uint _SmallScriptPool;
typedef std::map<std::string, uint> TSmallScriptCache;
TSmallScriptCache _SmallScriptCache;
static const char * _NELSmallScriptTableName;
private:
// this object isn't intended to be copied
CLuaState(const CLuaState &/* other */):NLMISC::CRefCount() { nlassert(0); }
CLuaState &operator=(const CLuaState &/* other */) { nlassert(0); return *this; }
void executeScriptInternal(const std::string &code, const std::string &dbgSrc, int numRet = 0);
};
// Access to lua function
// one should not include lua.h directly because if a debugger is present, lua
// function pointer will be taken from a dynamic library.
//=============================================================================================
// include implementation
#define RZ_INCLUDE_LUA_HELPER_INLINE
#include "lua_helper_inline.h"
#undef RZ_INCLUDE_LUA_HELPER_INLINE
#endif
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef RZ_LUA_HELPER_H
#define RZ_LUA_HELPER_H
#include "nel/misc/types_nl.h"
#include "nel/misc/smart_ptr.h"
extern "C"
{
#include <lua.h>
}
class CLuaState;
// ***************************************************************************
/** Helper class to see if a stack is restored at its initial size (or with n return results).
* Check that the stack size remains unchanged when the object goes out of scope
*/
class CLuaStackChecker
{
public:
CLuaStackChecker(CLuaState *state, int numWantedResults = 0);
~CLuaStackChecker();
/** Increment exception context counter
* When an exception is thrown, lua stack checker do any assert bu will
* rather restore the lua stack at its original size, and will
* let the exception a chance to propagate
*/
static void incrementExceptionContextCounter();
static void decrementExceptionContextCounter();
private:
CLuaState *_State;
int _FinalWantedSize;
static uint _ExceptionContextCounter;
};
// **************************************************************************
/** Helper class to restore the lua stack to the desired size when this object goes out of scope
*/
class CLuaStackRestorer
{
public:
CLuaStackRestorer(CLuaState *state, int finalSize);
~CLuaStackRestorer();
private:
int _FinalSize;
CLuaState *_State;
};
////////////////
// EXCEPTIONS //
////////////////
class ELuaError : public NLMISC::Exception
{
public:
ELuaError() { CLuaStackChecker::incrementExceptionContextCounter(); }
virtual ~ELuaError() throw() { CLuaStackChecker::decrementExceptionContextCounter(); }
ELuaError(const std::string &reason) : Exception(reason) { CLuaStackChecker::incrementExceptionContextCounter(); }
// what(), plus append the Reason
virtual std::string luaWhat() const throw() {return NLMISC::toString("LUAError: %s", what());}
};
// A parse error occured
class ELuaParseError : public ELuaError
{
public:
ELuaParseError() {}
ELuaParseError(const std::string &reason) : ELuaError(reason) {}
virtual ~ELuaParseError() throw() { }
// what(), plus append the Reason
virtual std::string luaWhat() const throw() {return NLMISC::toString("ELuaParseError: %s", what());}
};
/** Exception thrown when something went wrong inside a wrapped function called by lua
*/
class ELuaWrappedFunctionException : public ELuaError
{
public:
ELuaWrappedFunctionException(CLuaState *luaState);
ELuaWrappedFunctionException(CLuaState *luaState, const std::string &reason);
ELuaWrappedFunctionException(CLuaState *luaState, const char *format, ...);
virtual ~ELuaWrappedFunctionException() throw() { }
virtual const char *what() const throw() {return _Reason.c_str();}
protected:
void init(CLuaState *ls, const std::string &reason);
protected:
std::string _Reason;
};
// A execution error occured
class ELuaExecuteError : public ELuaError
{
public:
ELuaExecuteError() {}
ELuaExecuteError(const std::string &reason) : ELuaError(reason) {}
virtual ~ELuaExecuteError() throw() { }
// what(), plus append the Reason
virtual std::string luaWhat() const throw() {return NLMISC::toString("ELuaExecuteError: %s", what());}
};
// A bad cast occured when using lua_checkcast
class ELuaBadCast : public ELuaError
{
public:
ELuaBadCast() {}
ELuaBadCast(const std::string &reason) : ELuaError(reason) {}
// what(), plus append the Reason
virtual std::string luaWhat() const throw() {return NLMISC::toString("ELuaBadCast: %s", what());}
};
// Error when trying to indexate an object that is not a table
class ELuaNotATable : public ELuaError
{
public:
ELuaNotATable() {}
ELuaNotATable(const std::string &reason) : ELuaError(reason) {}
// what(), plus append the Reason
virtual std::string luaWhat() const throw() {return NLMISC::toString("ELuaNotATable: %s", what());}
};
// ***************************************************************************
// a function to be used with a CLuaState instance
typedef int (* TLuaWrappedFunction) (CLuaState &ls);
// ***************************************************************************
/** C++ version of a lua state
*/
class CLuaState : public NLMISC::CRefCount
{
public:
typedef NLMISC::CRefPtr<CLuaState> TRefPtr;
// Create a new environement
CLuaState();
~CLuaState();
/// \name Registering
// @{
// register a wrapped function
void registerFunc(const char *name, TLuaWrappedFunction function);
// @}
/// \name Script execution
// @{
/** Parse a script and push as a function in top of the LUA stack
* \throw ELuaParseError
* \param dbgSrc is a string for debug. Should be a filename (preceded with '@'), or a short script.
*/
void loadScript(const std::string &code, const std::string &dbgSrc);
/** Execute a script from a string, possibly throwing an exception if there's a parse error
* \throw ELuaParseError, ELuaExecuteError
*/
void executeScript(const std::string &code, int numRet = 0);
/** Execute a script from a string. If an errors occurs it is printed in the log
* \return true if script execution was successful
*/
bool executeScriptNoThrow(const std::string &code, int numRet = 0);
/** Load a Script from a File (maybe in a BNP), and execute it
* \return false if file not found
* \throw ELuaParseError, ELuaExecuteError
*/
bool executeFile(const std::string &pathName);
/** execute a very Small Script (a function call for instance)
* It is different from doString() in such there is a cache (where the key is the script itself)
* so that the second time this script is executed, there is no parsing
* Note: I experienced optim with about 10 times faster than a executeScript() on a simple "a= a+1;" script
* \throw ELuaParseError, ELuaExecuteError
*/
void executeSmallScript(const std::string &script);
// @}
/// \name Stack Manipulation
// @{
// stack manipulation (indices start at 1)
void setTop(int index); // set new size of stack
void clear() { setTop(0); }
int getTop();
bool empty() { return getTop() == 0; }
void pushValue(int index); // copie nth element of stack to the top of the stack
void remove(int index); // remove nth element of stack
void insert(int index); // insert last element of the stack before the given position
void replace(int index); // replace nth element of the stack with the top of the stack
void pop(int numElem = 1); // remove n elements from the top of the stack
// test the type of an element in the stack
// return one of the following values :
// LUA_TNIL
// LUA_TNUMBER
// LUA_TBOOLEAN
// LUA_TSTRING
// LUA_TTABLE
// LUA_TFUNCTION
// LUA_TUSERDATA
// LUA_TTHREAD
// LUA_TLIGHTUSERDATA
int type(int index = -1);
const char *getTypename(int type);
bool isNil(int index = -1);
bool isBoolean(int index = -1);
bool isNumber(int index = -1);
bool isString(int index = -1);
bool isTable(int index = -1);
bool isFunction(int index = -1);
bool isCFunction(int index = -1);
bool isUserData(int index = -1);
bool isLightUserData(int index = -1);
// converting then getting a value from the stack
bool toBoolean(int index = -1);
lua_Number toNumber(int index = -1);
const char *toString(int index = -1);
void toString(int index, std::string &str); // convert to a std::string, with a NULL check.
size_t strlen(int index = -1);
lua_CFunction toCFunction(int index = -1);
void *toUserData(int index = -1);
const void *toPointer(int index = -1);
/** Helper functions : get value of the wanted type in the top table after conversion
* A default value is used if the stack entry is NULL.
* If conversion fails then an exception is thrown (with optional msg)
*/
bool getTableBooleanValue(const char *name, bool defaultValue= false);
double getTableNumberValue(const char *name, double defaultValue= 0);
const char *getTableStringValue(const char *name, const char *defaultValue= NULL);
// pushing value onto the stack
void push(bool value);
void push(lua_Number value);
void push(const char *str);
void push(const char *str, int length);
void push(const std::string &str);
void pushNil();
void push(lua_CFunction f);
void push(TLuaWrappedFunction function);
void pushLightUserData(void *); // push a light user data (use newUserData to push a full userdata)
// metatables
bool getMetaTable(int index = -1);
bool setMetaTable(int index = -1); // set the metatable at top of stack to the object at 'index' (usually -2), then pop the metatable
// even if asignment failed
// comparison
bool equal(int index1, int index2);
bool rawEqual(int index1, int index2);
bool lessThan(int index1, int index2);
// concatenation of the n element at the top of the stack (using lua semantic)
void concat(int numElem);
// tables
void newTable(); // create a new table at top of the stack
void getTable(int index); // get value from a table at index 'index' (key is at top)
void rawGet(int index);
void setTable(int index); // set (key, value) from top of the stack into the given table
// both key and value are poped
void rawSet(int index);
bool next(int index); // table traversal
// UserData
void *newUserData(uint size);
// seting value by int index in a table
void rawSetI(int index, int n);
void rawGetI(int index, int n);
/** Calling functions (it's up to the caller to clear the results)
* The function should have been pushed on the stack
*/
void call(int nargs, int nresults);
int pcall(int nargs, int nresults, int errfunc = 0);
/** Helper : Execute a function by name. Lookup for the function is done in the table at the index 'funcTableIndex'
* the behaviour is the same than with call of pcall.
*/
int pcallByName(const char *functionName, int nargs, int nresults, int funcTableIndex = LUA_GLOBALSINDEX, int errfunc = 0);
// push a C closure (pop n element from the stack and associate with the function)
void pushCClosure(lua_CFunction function, int n);
// @}
/// \name Misc
// @{
/** Retrieve pointer to a CLuaState environment from its lua_State pointer, or NULL
* if there no such environment
*/
static CLuaState *fromStatePointer(lua_State *state);
// Get state pointer. The state should not be closed (this object has ownership)
lua_State *getStatePointer() const {return _State;}
// check that an index is valid when accessing the stack
// an assertion is raised if the index is not valid
void checkIndex(int index);
// registering C function to use with a lua state pointer
void registerFunc(const char *name, lua_CFunction function);
// Garbage collector
int getGCCount(); // get memory in use in KB
int getGCThreshold(); // get max memory in KB
void setGCThreshold(int kb); // set max memory in KB (no-op with ref-counted version)
// handle garbage collector for ref-counted version of lua (no-op with standard version, in which case gc handling is automatic)
void handleGC();
/** For Debug: get the Stack context of execution (filename / line)
* \param stackLevel: get the context of execution of the given stackLevel.
* 0 for the current function
* 1 for the function that called 0
* 2 ....
* NB: if called from a C function called from LUA, remember that stackLevel 0 is the current function.
* Hence if you want to know what LUA context called you, pass stackLevel=1!
* \param ret string cleared if any error, else filled with formated FileName / LineNumber
*/
void getStackContext(std::string &ret, uint stackLevel);
// @}
// for debug : dump the current content of the stack (no recursion)
void dumpStack();
static void dumpStack(lua_State *ls);
void getStackAsString(std::string &dest);
private:
lua_State *_State;
// Small Script Cache
uint _SmallScriptPool;
typedef std::map<std::string, uint> TSmallScriptCache;
TSmallScriptCache _SmallScriptCache;
static const char * _NELSmallScriptTableName;
private:
// this object isn't intended to be copied
CLuaState(const CLuaState &/* other */):NLMISC::CRefCount() { nlassert(0); }
CLuaState &operator=(const CLuaState &/* other */) { nlassert(0); return *this; }
void executeScriptInternal(const std::string &code, const std::string &dbgSrc, int numRet = 0);
};
// Access to lua function
// one should not include lua.h directly because if a debugger is present, lua
// function pointer will be taken from a dynamic library.
//=============================================================================================
// include implementation
#define RZ_INCLUDE_LUA_HELPER_INLINE
#include "lua_helper_inline.h"
#undef RZ_INCLUDE_LUA_HELPER_INLINE
#endif

@ -1,422 +1,422 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef RZ_INCLUDE_LUA_HELPER_INLINE
#error "don't include directly, include lua_helper.h instead"
#endif
/////////////////////
// CLuaStackChecker //
//////////////////////
//================================================================================
inline CLuaStackChecker::CLuaStackChecker(CLuaState *state, int numWantedResults)
{
nlassert(state);
_State = state;
_FinalWantedSize = state->getTop() + numWantedResults;
}
///////////////
// CLuaState //
///////////////
//================================================================================
inline void CLuaState::checkIndex(int index)
{
// NB : more restrictive test that in the documentation there, because
// we don't expose the check stack function
nlassert( (index!=0 && abs(index) <= getTop())
|| index == LUA_REGISTRYINDEX
|| index == LUA_GLOBALSINDEX
);
}
//================================================================================
inline int CLuaState::getTop()
{
return lua_gettop(_State);
}
//================================================================================
inline void CLuaState::setTop(int index)
{
// if index is strictly negative, this is a "pop". ensure that the user don't pop more than allowed
if (index < 0)
{
checkIndex(index);
}
// if index is positive and is more than the current top
else if ( index>getTop() )
{
// must ensure that we have enough stack space
nlverify( lua_checkstack(_State, index-getTop()) );
}
// set top
lua_settop(_State, index);
}
//================================================================================
inline void CLuaState::pushValue(int index)
{
checkIndex(index);
lua_pushvalue(_State, index);
}
//================================================================================
inline void CLuaState::remove(int index)
{
checkIndex(index);
lua_remove(_State, index);
}
//================================================================================
inline void CLuaState::insert(int index)
{
checkIndex(index);
lua_insert(_State, index);
}
//================================================================================
inline void CLuaState::replace(int index)
{
checkIndex(index);
lua_replace(_State, index);
}
//================================================================================
inline void CLuaState::pop(int numElem /* = 1 */)
{
nlassert(numElem <= getTop());
lua_pop(_State, numElem);
}
//================================================================================
inline int CLuaState::type(int index /* = -1 */)
{
checkIndex(index);
return lua_type(_State, index);
}
//================================================================================
inline const char *CLuaState::getTypename(int type)
{
return lua_typename(_State, type);
}
//================================================================================
inline bool CLuaState::isNil(int index)
{
checkIndex(index);
return lua_isnil(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::isBoolean(int index)
{
checkIndex(index);
return lua_isboolean(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::isNumber(int index)
{
checkIndex(index);
return lua_isnumber(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::isString(int index)
{
checkIndex(index);
return lua_isstring(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::isTable(int index)
{
checkIndex(index);
return lua_istable(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::isFunction(int index)
{
checkIndex(index);
return lua_isfunction(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::isCFunction(int index)
{
checkIndex(index);
return lua_iscfunction(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::isUserData(int index)
{
checkIndex(index);
return lua_isuserdata(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::isLightUserData(int index)
{
checkIndex(index);
return lua_islightuserdata(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::toBoolean(int index)
{
checkIndex(index);
return lua_toboolean(_State, index) != 0;
}
//================================================================================
inline lua_Number CLuaState::toNumber(int index)
{
checkIndex(index);
return lua_tonumber(_State, index);
}
//================================================================================
inline const char *CLuaState::toString(int index)
{
checkIndex(index);
return lua_tostring(_State, index);
}
//================================================================================
inline void CLuaState::toString(int index, std::string &str)
{
checkIndex(index);
const char *pc= lua_tostring(_State, index);
if(pc)
str= pc;
else
str.clear();
}
//================================================================================
inline size_t CLuaState::strlen(int index)
{
checkIndex(index);
return lua_strlen(_State, index);
}
//================================================================================
inline lua_CFunction CLuaState::toCFunction(int index)
{
checkIndex(index);
return lua_tocfunction(_State, index);
}
//================================================================================
inline void *CLuaState::toUserData(int index)
{
checkIndex(index);
return lua_touserdata(_State, index);
}
//================================================================================
inline const void *CLuaState::toPointer(int index)
{
checkIndex(index);
return lua_topointer(_State, index);
}
//================================================================================
inline void CLuaState::push(bool value)
{
nlverify( lua_checkstack(_State, 1) );
lua_pushboolean(_State, (int) value);
}
//================================================================================
inline void CLuaState::push(lua_Number value)
{
nlverify( lua_checkstack(_State, 1) );
lua_pushnumber(_State, value);
}
//================================================================================
inline void CLuaState::push(const char *str)
{
nlverify( lua_checkstack(_State, 1) );
lua_pushstring(_State, str);
}
//================================================================================
inline void CLuaState::push(const char *str, int length)
{
nlverify( lua_checkstack(_State, 1) );
lua_pushlstring(_State, str, length);
}
//================================================================================
inline void CLuaState::push(const std::string &str)
{
nlverify( lua_checkstack(_State, 1) );
push(str.c_str());
}
//================================================================================
inline void CLuaState::pushNil()
{
nlverify( lua_checkstack(_State, 1) );
lua_pushnil(_State);
}
//================================================================================
inline void CLuaState::push(lua_CFunction f)
{
nlverify( lua_checkstack(_State, 1) );
lua_pushcfunction(_State, f);
}
//================================================================================
inline void CLuaState::pushLightUserData(void *ptr)
{
nlverify( lua_checkstack(_State, 1) );
lua_pushlightuserdata(_State, ptr);
}
//================================================================================
inline bool CLuaState::equal(int index1, int index2)
{
checkIndex(index1);
checkIndex(index2);
return lua_equal(_State, index1, index2) != 0;
}
//================================================================================
inline bool CLuaState::getMetaTable(int index)
{
checkIndex(index);
return lua_getmetatable(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::setMetaTable(int index)
{
checkIndex(index);
return lua_setmetatable(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::rawEqual(int index1, int index2)
{
checkIndex(index1);
checkIndex(index2);
return lua_rawequal(_State, index1, index2) != 0;
}
//================================================================================
inline bool CLuaState::lessThan(int index1, int index2)
{
checkIndex(index1);
checkIndex(index2);
return lua_lessthan(_State, index1, index2) != 0;
}
//================================================================================
inline void CLuaState::concat(int numElem)
{
nlassert(numElem <= getTop());
lua_concat(_State, numElem);
}
//================================================================================
inline void CLuaState::getTable(int index)
{
checkIndex(index);
nlassert(isTable(index) || isUserData(index));
lua_gettable(_State, index);
}
//================================================================================
inline void CLuaState::rawGet(int index)
{
checkIndex(index);
lua_rawget(_State, index);
}
//================================================================================
inline void CLuaState::setTable(int index)
{
checkIndex(index);
nlassert(getTop() >= 2);
nlassert(isTable(index));
lua_settable(_State, index);
}
//================================================================================
inline void CLuaState::rawSet(int index)
{
checkIndex(index);
lua_rawset(_State, index);
}
//================================================================================
inline bool CLuaState::next(int index)
{
//H_AUTO(Lua_CLuaState_next)
checkIndex(index);
return lua_next(_State, index) != 0;
}
//================================================================================
inline void CLuaState::rawSetI(int index, int n)
{
//H_AUTO(Lua_CLuaState_rawSetI)
checkIndex(index);
lua_rawseti(_State, index, n);
}
//================================================================================
inline void CLuaState::rawGetI(int index, int n)
{
checkIndex(index);
lua_rawgeti(_State, index, n);
}
//================================================================================
inline void CLuaState::call(int nargs, int nresults)
{
nlassert(getTop() >= nargs);
lua_call(_State, nargs, nresults);
}
//================================================================================
inline int CLuaState::pcall(int nargs, int nresults, int errfunc)
{
return lua_pcall(_State, nargs, nresults, errfunc);
}
//================================================================================
inline void *CLuaState::newUserData(uint size)
{
nlassert(size>0);
return lua_newuserdata(_State, size);
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef RZ_INCLUDE_LUA_HELPER_INLINE
#error "don't include directly, include lua_helper.h instead"
#endif
/////////////////////
// CLuaStackChecker //
//////////////////////
//================================================================================
inline CLuaStackChecker::CLuaStackChecker(CLuaState *state, int numWantedResults)
{
nlassert(state);
_State = state;
_FinalWantedSize = state->getTop() + numWantedResults;
}
///////////////
// CLuaState //
///////////////
//================================================================================
inline void CLuaState::checkIndex(int index)
{
// NB : more restrictive test that in the documentation there, because
// we don't expose the check stack function
nlassert( (index!=0 && abs(index) <= getTop())
|| index == LUA_REGISTRYINDEX
|| index == LUA_GLOBALSINDEX
);
}
//================================================================================
inline int CLuaState::getTop()
{
return lua_gettop(_State);
}
//================================================================================
inline void CLuaState::setTop(int index)
{
// if index is strictly negative, this is a "pop". ensure that the user don't pop more than allowed
if (index < 0)
{
checkIndex(index);
}
// if index is positive and is more than the current top
else if ( index>getTop() )
{
// must ensure that we have enough stack space
nlverify( lua_checkstack(_State, index-getTop()) );
}
// set top
lua_settop(_State, index);
}
//================================================================================
inline void CLuaState::pushValue(int index)
{
checkIndex(index);
lua_pushvalue(_State, index);
}
//================================================================================
inline void CLuaState::remove(int index)
{
checkIndex(index);
lua_remove(_State, index);
}
//================================================================================
inline void CLuaState::insert(int index)
{
checkIndex(index);
lua_insert(_State, index);
}
//================================================================================
inline void CLuaState::replace(int index)
{
checkIndex(index);
lua_replace(_State, index);
}
//================================================================================
inline void CLuaState::pop(int numElem /* = 1 */)
{
nlassert(numElem <= getTop());
lua_pop(_State, numElem);
}
//================================================================================
inline int CLuaState::type(int index /* = -1 */)
{
checkIndex(index);
return lua_type(_State, index);
}
//================================================================================
inline const char *CLuaState::getTypename(int type)
{
return lua_typename(_State, type);
}
//================================================================================
inline bool CLuaState::isNil(int index)
{
checkIndex(index);
return lua_isnil(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::isBoolean(int index)
{
checkIndex(index);
return lua_isboolean(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::isNumber(int index)
{
checkIndex(index);
return lua_isnumber(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::isString(int index)
{
checkIndex(index);
return lua_isstring(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::isTable(int index)
{
checkIndex(index);
return lua_istable(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::isFunction(int index)
{
checkIndex(index);
return lua_isfunction(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::isCFunction(int index)
{
checkIndex(index);
return lua_iscfunction(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::isUserData(int index)
{
checkIndex(index);
return lua_isuserdata(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::isLightUserData(int index)
{
checkIndex(index);
return lua_islightuserdata(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::toBoolean(int index)
{
checkIndex(index);
return lua_toboolean(_State, index) != 0;
}
//================================================================================
inline lua_Number CLuaState::toNumber(int index)
{
checkIndex(index);
return lua_tonumber(_State, index);
}
//================================================================================
inline const char *CLuaState::toString(int index)
{
checkIndex(index);
return lua_tostring(_State, index);
}
//================================================================================
inline void CLuaState::toString(int index, std::string &str)
{
checkIndex(index);
const char *pc= lua_tostring(_State, index);
if(pc)
str= pc;
else
str.clear();
}
//================================================================================
inline size_t CLuaState::strlen(int index)
{
checkIndex(index);
return lua_strlen(_State, index);
}
//================================================================================
inline lua_CFunction CLuaState::toCFunction(int index)
{
checkIndex(index);
return lua_tocfunction(_State, index);
}
//================================================================================
inline void *CLuaState::toUserData(int index)
{
checkIndex(index);
return lua_touserdata(_State, index);
}
//================================================================================
inline const void *CLuaState::toPointer(int index)
{
checkIndex(index);
return lua_topointer(_State, index);
}
//================================================================================
inline void CLuaState::push(bool value)
{
nlverify( lua_checkstack(_State, 1) );
lua_pushboolean(_State, (int) value);
}
//================================================================================
inline void CLuaState::push(lua_Number value)
{
nlverify( lua_checkstack(_State, 1) );
lua_pushnumber(_State, value);
}
//================================================================================
inline void CLuaState::push(const char *str)
{
nlverify( lua_checkstack(_State, 1) );
lua_pushstring(_State, str);
}
//================================================================================
inline void CLuaState::push(const char *str, int length)
{
nlverify( lua_checkstack(_State, 1) );
lua_pushlstring(_State, str, length);
}
//================================================================================
inline void CLuaState::push(const std::string &str)
{
nlverify( lua_checkstack(_State, 1) );
push(str.c_str());
}
//================================================================================
inline void CLuaState::pushNil()
{
nlverify( lua_checkstack(_State, 1) );
lua_pushnil(_State);
}
//================================================================================
inline void CLuaState::push(lua_CFunction f)
{
nlverify( lua_checkstack(_State, 1) );
lua_pushcfunction(_State, f);
}
//================================================================================
inline void CLuaState::pushLightUserData(void *ptr)
{
nlverify( lua_checkstack(_State, 1) );
lua_pushlightuserdata(_State, ptr);
}
//================================================================================
inline bool CLuaState::equal(int index1, int index2)
{
checkIndex(index1);
checkIndex(index2);
return lua_equal(_State, index1, index2) != 0;
}
//================================================================================
inline bool CLuaState::getMetaTable(int index)
{
checkIndex(index);
return lua_getmetatable(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::setMetaTable(int index)
{
checkIndex(index);
return lua_setmetatable(_State, index) != 0;
}
//================================================================================
inline bool CLuaState::rawEqual(int index1, int index2)
{
checkIndex(index1);
checkIndex(index2);
return lua_rawequal(_State, index1, index2) != 0;
}
//================================================================================
inline bool CLuaState::lessThan(int index1, int index2)
{
checkIndex(index1);
checkIndex(index2);
return lua_lessthan(_State, index1, index2) != 0;
}
//================================================================================
inline void CLuaState::concat(int numElem)
{
nlassert(numElem <= getTop());
lua_concat(_State, numElem);
}
//================================================================================
inline void CLuaState::getTable(int index)
{
checkIndex(index);
nlassert(isTable(index) || isUserData(index));
lua_gettable(_State, index);
}
//================================================================================
inline void CLuaState::rawGet(int index)
{
checkIndex(index);
lua_rawget(_State, index);
}
//================================================================================
inline void CLuaState::setTable(int index)
{
checkIndex(index);
nlassert(getTop() >= 2);
nlassert(isTable(index));
lua_settable(_State, index);
}
//================================================================================
inline void CLuaState::rawSet(int index)
{
checkIndex(index);
lua_rawset(_State, index);
}
//================================================================================
inline bool CLuaState::next(int index)
{
//H_AUTO(Lua_CLuaState_next)
checkIndex(index);
return lua_next(_State, index) != 0;
}
//================================================================================
inline void CLuaState::rawSetI(int index, int n)
{
//H_AUTO(Lua_CLuaState_rawSetI)
checkIndex(index);
lua_rawseti(_State, index, n);
}
//================================================================================
inline void CLuaState::rawGetI(int index, int n)
{
checkIndex(index);
lua_rawgeti(_State, index, n);
}
//================================================================================
inline void CLuaState::call(int nargs, int nresults)
{
nlassert(getTop() >= nargs);
lua_call(_State, nargs, nresults);
}
//================================================================================
inline int CLuaState::pcall(int nargs, int nresults, int errfunc)
{
return lua_pcall(_State, nargs, nresults, errfunc);
}
//================================================================================
inline void *CLuaState::newUserData(uint size)
{
nlassert(size>0);
return lua_newuserdata(_State, size);
}

@ -1,49 +1,49 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by variable_parser.rc
//
#define IDD_VARIABLEPARSER_DIALOG 102
#define IDR_MAINFRAME 128
#define IDC_HDR_FILE 1000
#define IDC_TMPL_FILE 1001
#define IDC_FOOT_FILE 1002
#define IDC_HDR_BROWSE 1003
#define IDC_TMPL_BROWSE 1004
#define IDC_FOOT_BROWSE 1005
#define IDC_GENERATE 1006
#define IDC_OUTPUT_FILE 1007
#define IDC_OUTPUT_BROWSE 1008
#define IDC_GEN_FILE 1009
#define IDC_GEN_BROWSE 1010
#define IDC_LUA_FILE 1011
#define IDC_LUA_BROWSE 1012
#define IDC_VARDEF 1013
#define IDC_ADDVARDEF 1014
#define IDC_REMVARDEF 1015
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 130
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1016
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by variable_parser.rc
//
#define IDD_VARIABLEPARSER_DIALOG 102
#define IDR_MAINFRAME 128
#define IDC_HDR_FILE 1000
#define IDC_TMPL_FILE 1001
#define IDC_FOOT_FILE 1002
#define IDC_HDR_BROWSE 1003
#define IDC_TMPL_BROWSE 1004
#define IDC_FOOT_BROWSE 1005
#define IDC_GENERATE 1006
#define IDC_OUTPUT_FILE 1007
#define IDC_OUTPUT_BROWSE 1008
#define IDC_GEN_FILE 1009
#define IDC_GEN_BROWSE 1010
#define IDC_LUA_FILE 1011
#define IDC_LUA_BROWSE 1012
#define IDC_VARDEF 1013
#define IDC_ADDVARDEF 1014
#define IDC_REMVARDEF 1015
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 130
#define _APS_NEXT_COMMAND_VALUE 32771
#define _APS_NEXT_CONTROL_VALUE 1016
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

@ -1,92 +1,92 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// VariableParser.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "variable_parser.h"
#include "variable_parserDlg.h"
/*#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
*/
/////////////////////////////////////////////////////////////////////////////
// CVariableParserApp
BEGIN_MESSAGE_MAP(CVariableParserApp, CWinApp)
//{{AFX_MSG_MAP(CVariableParserApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CVariableParserApp construction
CVariableParserApp::CVariableParserApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CVariableParserApp object
CVariableParserApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CVariableParserApp initialization
BOOL CVariableParserApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
CVariableParserDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// VariableParser.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "variable_parser.h"
#include "variable_parserDlg.h"
/*#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
*/
/////////////////////////////////////////////////////////////////////////////
// CVariableParserApp
BEGIN_MESSAGE_MAP(CVariableParserApp, CWinApp)
//{{AFX_MSG_MAP(CVariableParserApp)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
ON_COMMAND(ID_HELP, CWinApp::OnHelp)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CVariableParserApp construction
CVariableParserApp::CVariableParserApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CVariableParserApp object
CVariableParserApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CVariableParserApp initialization
BOOL CVariableParserApp::InitInstance()
{
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
CVariableParserDlg dlg;
m_pMainWnd = &dlg;
int nResponse = dlg.DoModal();
if (nResponse == IDOK)
{
// TODO: Place code here to handle when the dialog is
// dismissed with OK
}
else if (nResponse == IDCANCEL)
{
// TODO: Place code here to handle when the dialog is
// dismissed with Cancel
}
// Since the dialog has been closed, return FALSE so that we exit the
// application, rather than start the application's message pump.
return FALSE;
}

@ -1,65 +1,65 @@
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// VariableParser.h : main header file for the VARIABLEPARSER application
//
#if !defined(AFX_VARIABLEPARSER_H__8AF5C966_94E0_4F89_AA0E_1DCA9720623A__INCLUDED_)
#define AFX_VARIABLEPARSER_H__8AF5C966_94E0_4F89_AA0E_1DCA9720623A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CVariableParserApp:
// See VariableParser.cpp for the implementation of this class
//
class CVariableParserApp : public CWinApp
{
public:
CVariableParserApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CVariableParserApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CVariableParserApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_VARIABLEPARSER_H__8AF5C966_94E0_4F89_AA0E_1DCA9720623A__INCLUDED_)
// Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
// Copyright (C) 2010 Winch Gate Property Limited
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// VariableParser.h : main header file for the VARIABLEPARSER application
//
#if !defined(AFX_VARIABLEPARSER_H__8AF5C966_94E0_4F89_AA0E_1DCA9720623A__INCLUDED_)
#define AFX_VARIABLEPARSER_H__8AF5C966_94E0_4F89_AA0E_1DCA9720623A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CVariableParserApp:
// See VariableParser.cpp for the implementation of this class
//
class CVariableParserApp : public CWinApp
{
public:
CVariableParserApp();
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CVariableParserApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CVariableParserApp)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_VARIABLEPARSER_H__8AF5C966_94E0_4F89_AA0E_1DCA9720623A__INCLUDED_)

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

Loading…
Cancel
Save