Add rayman2 source files

This commit is contained in:
2024-09-18 02:33:44 +08:00
parent bcc093f8ed
commit fb036c54fd
14339 changed files with 2596224 additions and 0 deletions

View File

@@ -0,0 +1,114 @@
/*=========================================================================
*
* SECTelem.hpp : Definition of Editor Elements
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
#ifndef __SECT_ELEMB_HPP__
#define __SECT_ELEMB_HPP__
#include "incITF.h"
#include "incGAM.h"
//**************************************
#ifndef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
#endif
//**************************************
class Sector_Object;
class Sector_Interface;
#define C_szSectorsLinkSubSection "SectorsLink"
//Shaitan Clean Env
//#define C_szEnvAndSurfSubSection "ENVAndSRF"
//#################################################################################
// SECTORS LINK
//#################################################################################
/*===========================================================================
Element
===========================================================================*/
class SECT_ElementBase : public CPA_SectionObject
{
protected:
CPA_SuperObject *m_pSector;
Sector_Object *m_pOwnerSector;
public:
SECT_ElementBase (Sector_Object *pOwnerSector);
~SECT_ElementBase() {}
CPA_SuperObject * GetSector (void) { return m_pSector; }
Sector_Object * GetOwnerSector (void) { return m_pOwnerSector; }
// save
static void CallBackSaveSectorsLink (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction);
};
/*===========================================================================
List
===========================================================================*/
class SECT_ListBase
{
protected:
Sector_Object *m_pOwnerSector;
long m_lNbElements;
public:
SECT_ListBase (void);
~SECT_ListBase (void) { };
virtual BOOL fn_bAddAnElement (SECT_ElementBase *pNewElem, BOOL bUpdateEngine = TRUE);
virtual void fn_vRemoveAnElement (SECT_ElementBase *pOldElem, BOOL bUpdateEngine = TRUE);
virtual void fn_vRemoveAllElements (BOOL bUpdateEngine);
virtual SECT_ElementBase * GetHeadElementBase (POSITION& rPosition) { return NULL; }
virtual SECT_ElementBase * GetNextElementBase (POSITION& rPosition) { return NULL; }
void SetOwnerSector (Sector_Object *pOwnerSector) { m_pOwnerSector = pOwnerSector; }
long GetNbElements (void) { return m_lNbElements; }
SECT_ElementBase * GetElementWithSector (CPA_SuperObject *pSector);
};
//#################################################################################
// ENVIRONMENT AND SURFACE
//#################################################################################
/*===========================================================================
Element
===========================================================================*/
/*
class SECT_EnvElementBase : public CPA_SectionObject
{
protected:
Sector_Object *m_pOwnerSector;
public:
SECT_EnvElementBase (Sector_Object *pOwnerSector);
~SECT_EnvElementBase() {}
Sector_Object * GetOwnerSector (void) { return m_pOwnerSector; }
// save
static void CallBackSaveEnvAndSurf (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction);
};
*/
#endif //__SECT_ELEMB_HPP__

View File

@@ -0,0 +1,292 @@
/*=========================================================================
*
* SECTenv.hpp : Definition of Environments
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
/*
#ifndef __SECT_ENV_HPP__
#define __SECT_ENV_HPP__
#include "incGLI.h"
#include "incSPO.h"
#include "incMEC.h"
#define ENV_FRIEND
#include "incENV.h"
#undef ENV_FRIEND
#define SCTFriend
#include "incSCT.h"
#undef SCTFriend
#include "incITF.h"
#include "incGAM.h"
#include "HDL.h"
#include "SECTelem.hpp"
#include "x:\cpa\Main\inc\_editid.h"
//**************************************
#ifndef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
#endif
//**************************************
class Sector_Object;
class Sector_Interface;
typedef enum
{
E_te_Environment,
E_te_Surface,
E_te_MecEnvironment,
E_te_VisEnvironment,
E_te_SndEnvironment,
E_te_NoType
}
tdeTypeElem;
typedef CPA_SaveObject SECT_SndEnvironment;
//#################################################################################
// MecEnvironment
//#################################################################################
class SECT_MecEnvironment : public CPA_SaveObject,
public CPA_EdMot<DNM_tdxHandleToMecEnvironment>
{
protected:
DNM_stMecEnvironment * GetMecStruct (void);
public:
SECT_MecEnvironment (Sector_Interface *p_oDLL,
DNM_tdxHandleToMecEnvironment hMecEnv, BOOL bAvailable,
CString csName, CString csFileName, BOOL bSectionExists);
SECT_MecEnvironment (Sector_Interface *p_oDLL, CString csName);
~SECT_MecEnvironment (void);
// return Data
long GetDataType (void) { return -1; }
void * GetData (void) { return GetStruct(); };
void * GetEngineStruct (void) { return GetStruct(); }
Sector_Interface * GetSectorInterface (void) { return (Sector_Interface *)GetEditor(); }
// default values
void fn_vSetDefaultValues (void);
// gravity parameters
DNM_tdxReal GetGravity (void);
DNM_tdstVector * GetVertical (void);
void SetGravity (MTH_tdxReal tdxNewGravity, BOOL bNotify = TRUE);
void SetVertical (DNM_tdstVector *tdstNewVertical, BOOL bNotify = TRUE);
// fluid
DNM_tdxReal GetFluidDensity (void);
DNM_tdxReal GetFluidViscosity (void);
DNM_tdxReal GetFluidLevel (void);
DNM_tdstVector * GetFluidStream (void);
void SetFluidDensity (MTH_tdxReal tdxNewFluidDensity, BOOL bNotify = TRUE);
void SetFluidViscosity (MTH_tdxReal tdxNewFluidViscosity, BOOL bNotify = TRUE);
void SetFluidLevel (MTH_tdxReal tdxNewFluidLevel, BOOL bNotify = TRUE);
void SetFluidStream (DNM_tdstVector *tdstNewFluidStream, BOOL bNotify = TRUE);
// volumic environment
CString GetVolumicEnvironment (void);
void SetVolumicEnvironment (CString, BOOL bNotify = TRUE);
// save
static void CallBackSaveMecEnvironment (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction);
};
//#################################################################################
// VisEnvironment
//#################################################################################
class SECT_VisEnvironment : public CPA_SaveObject,
public CPA_EdMot<ACP_tdxHandleToVisualEnvironment>
{
public:
SECT_VisEnvironment (Sector_Interface *p_oDLL,
ACP_tdxHandleToVisualEnvironment hVisEnv, BOOL bAvailable,
CString csName, CString csFileName, BOOL bSectionExists);
SECT_VisEnvironment (Sector_Interface *p_oDLL, CString csName);
~SECT_VisEnvironment (void);
// return Data
long GetDataType (void) { return -1; }
void * GetData (void) { return GetStruct(); };
void * GetEngineStruct (void) { return GetStruct(); }
Sector_Interface * GetSectorInterface (void) { return (Sector_Interface *)GetEditor(); }
// default values
void fn_vInitFog (void);
// global parameters
BOOL fn_bHasFog (void);
// Fog
MTH_tdxReal GetFogNear (void);
MTH_tdxReal GetFogFar (void);
MTH_tdxReal GetFogBlendNear (void);
MTH_tdxReal GetFogBlendFar (void);
MTH_tdxReal GetFogInfinite (void);
GLI_tdstColor * GetFogColor (void);
void SetFogNear (MTH_tdxReal xNewNear, BOOL bNotify = TRUE);
void SetFogFar (MTH_tdxReal xNewFar, BOOL bNotify = TRUE);
void SetFogBlendNear (MTH_tdxReal xNewBlendNear, BOOL bNotify = TRUE);
void SetFogBlendFar (MTH_tdxReal xNewBlendFar, BOOL bNotify = TRUE);
void SetFogInfinite (MTH_tdxReal xNewInfinite, BOOL bNotify = TRUE);
void SetFogColor (GLI_tdstColor *pNewColor, BOOL bNotify = TRUE);
// save
static void CallBackSaveVisEnvironment (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction);
};
//#################################################################################
// Environment
//#################################################################################
class SECT_Environment : public CPA_SaveObject,
public CPA_EdMot<ENV_tdxHandleToEnvironment>
{
protected:
SECT_MecEnvironment *m_pMecEnvironment;
SECT_VisEnvironment *m_pVisEnvironment;
SECT_SndEnvironment *m_pSndEnvironment;
public:
SECT_Environment (Sector_Interface *p_oDLL,
ENV_tdxHandleToEnvironment hEnvironment, BOOL bAvailable,
CString csName, CString csFileName);
SECT_Environment (Sector_Interface *p_oDLL,
SECT_MecEnvironment *pMecEnvironment,
SECT_VisEnvironment *pVisEnvironment,
SECT_SndEnvironment *pSndEnvironment,
CString csName);
~SECT_Environment (void);
// return Data
long GetDataType (void) { return -1; }
void * GetData (void) { return GetStruct(); };
void * GetEngineStruct (void) { return GetStruct(); }
Sector_Interface * GetSectorInterface (void) { return (Sector_Interface *)GetEditor(); }
// get functions
SECT_MecEnvironment * GetMecEnvironment (void) { return m_pMecEnvironment; }
SECT_VisEnvironment * GetVisEnvironment (void) { return m_pVisEnvironment; }
SECT_SndEnvironment * GetSndEnvironment (void) { return m_pSndEnvironment; }
// set functions
void SetMecEnvironment (SECT_MecEnvironment * pMecEnv, BOOL bNotifySave = TRUE);
void SetVisEnvironment (SECT_VisEnvironment * pVisEnv, BOOL bNotifySave = TRUE);
void SetSndEnvironment (SECT_SndEnvironment * pSndEnv, BOOL bNotifySave = TRUE);
void fn_vInitSndEnvironment (void);
CString GetSndEnvironmentReference (void);
// save
static void CallBackSaveEnvironment (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction);
};
//#################################################################################
// Environment (list element)
//#################################################################################
class SECT_EnvElem : public SECT_EnvElementBase,
public CPA_EdElement<SECT_EnvElem, SECT_tdxHandleOfElementLstEnvironment, LST2_M_StaticAnchorTo(SECT_tdxHandleOfElementLstEnvironment)*>
{
protected:
SECT_Environment *m_pEnvironment;
public:
SECT_EnvElem (SECT_tdxHandleOfElementLstEnvironment hEnvElem, Sector_Object *pOwnerSector);
SECT_EnvElem (SECT_Environment *pEnvironment, Sector_Object *pOwnerSector);
~SECT_EnvElem (void);
void *GetEngineStruct() { return GetStruct(); }
// environment
SECT_Environment * GetEnvironment (void) { return m_pEnvironment; }
void SetEnvironment (SECT_Environment *pEnvironment);
};
//#################################################################################
// Environment List
//#################################################################################
class SECT_EnvironmentList : public CPA_EdList<SECT_EnvElem, SECT_tdxHandleOfElementLstEnvironment, LST2_M_StaticAnchorTo(SECT_tdxHandleOfElementLstEnvironment)*>
{
protected:
Sector_Object *m_pOwnerSector;
public:
SECT_EnvironmentList (void) { };
~SECT_EnvironmentList (void) { };
void SetOwnerSector (Sector_Object *pOwnerSector) { m_pOwnerSector = pOwnerSector; }
BOOL fn_bAddAnElement (SECT_EnvElem *pNewElem, SECT_EnvElem *pPreviousElem, BOOL bUpdateEngine = TRUE);
void fn_vRemoveAnElement (SECT_EnvElem *pOldElem, BOOL bUpdateEngine = TRUE);
void fn_vRemoveAllElements (BOOL bUpdateEngine = TRUE);
SECT_EnvElem * GetElementWithEnvironment (SECT_Environment *pEnvironment);
};
//#################################################################################
// Environment ListBox
//#################################################################################
class SECT_EnvListBox : public CPA_SortedListBox
{
protected:
Sector_Interface *m_pSectorInterface;
tdeTypeElem m_eType;
CFormView *m_pDialog;
public:
SECT_EnvListBox (void);
~SECT_EnvListBox (void);
void fn_vInitParameters (CFormView *pDialog, Sector_Interface *pSectorInterface, tdeTypeElem eType);
void DrawItem (LPDRAWITEMSTRUCT lpDIS);
virtual BOOL fn_bIsCurrentElement (CPA_BaseObject *pElem);
virtual BOOL fn_bIsSelectedElement (CPA_BaseObject *pElem);
virtual BOOL fn_bIsAlreadyUsed (CPA_BaseObject *pElem);
};
#endif //__SECT_ENV_HPP__
*/

View File

@@ -0,0 +1,497 @@
/*=========================================================================
*
* SECTint.hpp : Sector DLL Interface - definition
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
#ifndef __SECT_INT_HPP__
#define __SECT_INT_HPP__
#include "incSND.h"
#include "incITF.h"
#include "SECTobj.hpp"
// if you want only one instance of your DLL
// activate the next line
#define DLL_ONLY_ONE_INSTANCE
// mode
typedef enum
{
E_em_EditSector,
E_em_EditList
//Shaitan Clean Env
// E_em_EditEnv
}
tdeEditMode;
// colors
#define C_ColorEdited E_lc_Red
#define C_ColorSelected E_lc_Blue
#define C_ColorShow E_lc_Green
#define C_ColorSurf E_lc_LightBlue
#define C_NoColor E_lc_NoColor
// dialogs
class SECT_DialogList;
class SECT_DialogMode;
class SECT_DialogEdit;
class SECT_DialogSel;
class SECT_DialogBase;
class SECT_DialogActiv;
class SECT_DialogColls;
class SECT_DialogGraph;
class SECT_DialogSound;
class SECT_DialogSoundEvent;
class SECT_DialogDistance;
//Shaitan Clean Env
/*
class SECT_DialogEnvList;
class SECT_DialogEnvs;
class SECT_DialogSrf;
class SECT_DialogEnv;
class SECT_DialogMec;
class SECT_DialogVis;
*/
extern BOOL g_bCanSave;
/*===========================================================================
* Description: class Sector_Interface
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
class Sector_Interface : public CPA_ObjectDLLBase
{
private:
// edited sector
CPA_SuperObject *m_pEditedSector;
CPA_SuperObject *m_pSelectedSector;
// KeyBoard
CPA_KeyActionConfiguration * m_pKeyboard;
// ImageList
CImageList m_oStateIconList;
// Frames
CSplitFrame * m_pSectorLeftFrame;
CSplitFrame * m_pSectorBottomFrame;
//Shaitan Clean Env
/*
CSplitFrame * m_pEnvLeftFrame;
CSplitFrame * m_pEnvBottomFrame;
*/
CSplitFrame * m_pCurrentLeftFrame;
CSplitFrame * m_pCurrentBottomFrame;
// Dialogs (Sector)
CPA_DialogList * m_pSectorDialogList;
SECT_DialogEdit * m_pSectorDialogEdit;
SECT_DialogMode * m_pSectorDialogMode;
SECT_DialogSel * m_pDialogSel;
SECT_DialogActiv * m_pDialogActiv;
SECT_DialogColls * m_pDialogColls;
SECT_DialogGraph * m_pDialogGraph;
SECT_DialogSound * m_pDialogSound;
SECT_DialogSoundEvent * m_pDialogSoundEvent;
SECT_DialogDistance * m_pDialogDistance;
//Shaitan Clean Env
/*
// Dialogs (Env)
CPA_DialogList * m_pEnvDialogList;
SECT_DialogEdit * m_pEnvDialogEdit;
SECT_DialogMode * m_pEnvDialogMode;
SECT_DialogEnvList * m_pDialogEnvList;
SECT_DialogEnvs * m_pDialogEnvs;
SECT_DialogSrf * m_pDialogSrf;
SECT_DialogEnv * m_pDialogEnv;
SECT_DialogMec * m_pDialogMec;
SECT_DialogVis * m_pDialogVis;
*/
// Dialogs (Current)
CPA_DialogList * m_pCurrentDialogList;
SECT_DialogEdit * m_pCurrentDialogEdit;
SECT_DialogMode * m_pCurrentDialogMode;
// Modes
tdeEditMode m_eEditMode;
int m_aListActivity[C_NumberOfLists];
//Shaitan Clean Env
/*
// Environment
CString m_csEnvFileName;
CString m_csMecEnvFileName;
CString m_csVisEnvFileName;
*/
// Reference Path
CString m_csSECTRefPath;
//Shaitan Clean Env
/*
CString m_csSURFRefPath;
CString m_csENVRefPath;
CString m_csMECRefPath;
CString m_csVISRefPath;
*/
// Select Mode
CString m_csSaveSelectMode;
BOOL m_bPreviousState;
BOOL m_bPreviousLinkMode;
// Sound
CPA_BaseObjectList * m_pSoundEventList;
//Shaitan Clean Env
/*
CPA_BaseObjectList * m_pSoundEnvList;
// Surface
CPA_SuperObject * m_pCurrentVisual;
SECT_Surface * m_pSurfaceToDraw;
*/
// Init
BOOL m_bAllInitialised;
//Shaitan Clean Env
// Environments
// CPA_List<CPA_SuperObject> m_oSelectList;
// Symetric Mode
BOOL m_bSymetricMode;
// Borders
BOOL m_bDisplayBorders;
// Copy / Paste
CPA_List<CPA_SuperObject> m_oCopyOfSectorList;
public:
Sector_Interface(void);
~Sector_Interface(void);
/*===========================================================================
Get functions
=========================================================================*/
// current dialog
CPA_DialogList * GetDialogList (void) { return m_pCurrentDialogList; }
SECT_DialogEdit * GetDialogEdit (void) { return m_pCurrentDialogEdit; }
SECT_DialogMode * GetDialogMode (void) { return m_pCurrentDialogMode; }
// sector dialogs
SECT_DialogSel * GetDialogSel (void) { return m_pDialogSel; }
SECT_DialogBase * GetSingleList (tdeTypeList eType);
//Shaitan Clean Env
/*
// env dialogs
SECT_DialogEnvList * GetDialogEnvList (void) { return m_pDialogEnvList; }
SECT_DialogEnvs * GetDialogEnvs (void) { return m_pDialogEnvs; }
SECT_DialogSrf * GetDialogSrf (void) { return m_pDialogSrf; }
SECT_DialogEnv * GetDialogEnv (void) { return m_pDialogEnv; }
SECT_DialogMec * GetDialogMec (void) { return m_pDialogMec; }
SECT_DialogVis * GetDialogVis (void) { return m_pDialogVis; }
*/
CPA_SuperObject * GetEditedSector (void) { return m_pEditedSector; }
CPA_SuperObject * GetSectorToEdit (CPA_List<CPA_BaseObject> *pParam);
tdeEditMode GetEditMode (void) { return m_eEditMode; }
int GetListActivity (tdeTypeList eList) { return m_aListActivity[eList]; }
CString GetSECTRefPath (void) { return m_csSECTRefPath; }
//Shaitan Clean Env
/*
CString GetSURFRefPath (void) { return m_csSURFRefPath; }
CString GetENVRefPath (void) { return m_csENVRefPath; }
CString GetMECRefPath (void) { return m_csMECRefPath; }
CString GetVISRefPath (void) { return m_csVISRefPath; }
SECT_Surface * GetSurfaceToDraw (void) { return m_pSurfaceToDraw; }
*/
CPA_SuperObject * GetSectorWithName (CString csName);
//Shaitan Clean Env
// CPA_BaseObjectList * GetSoundEnvList (void) { return m_pSoundEnvList; }
CPA_BaseObjectList * GetSoundEventList (void) { return m_pSoundEventList; }
//Shaitan Clean Env
// CPA_List<CPA_SuperObject> * GetSelectList (void) { return &m_oSelectList; }
CPA_List<CPA_SuperObject> * GetCopyOfSectorList (void) { return &m_oCopyOfSectorList; }
BOOL fn_bSymetricMode (void) { return m_bSymetricMode; }
BOOL fn_bDisplayBorders (void) { return m_bDisplayBorders; }
/*===========================================================================
Set functions
=========================================================================*/
void SetEditMode (tdeEditMode eNewMode, BOOL bRedraw = TRUE);
void SetListActivity (tdeTypeList eType, BOOL bActive, BOOL bRedraw = TRUE);
void SetCurrentFrame (tdeEditMode eNewMode);
void SetSymetricMode (BOOL bSymetricMode) { m_bSymetricMode = bSymetricMode; }
void fn_vUpdateEditMode (BOOL bReinit = FALSE);
/*===========================================================================
Dialogs
=========================================================================*/
void fn_vCreateSectorDialogs (CString csFileName);
//Shaitan Clean Env
// void fn_vCreateEnvironmentDialogs (CString csFileName);
void fn_vOnKeyDownInSectorList (SECT_DialogBase *pDialog, UINT nChar);
//Shaitan Clean Env
// void fn_vOnKeyDownInEnvList (CPA_SuperObject *pSector, long lNumEnvElem, UINT nKey);
/*===========================================================================
Others
=========================================================================*/
// inits
void fn_vReinitEditor (CPA_SuperObject *pSectorToEdit);
// permissions & modifs
BOOL fn_bAcceptModifHierarchy (tdeStatus eStatus);
void fn_vOnModifHierarchy (tdeStatus eStatus);
// colors
void fn_vShowEditedSector (BOOL bUpdateDrawing, BOOL bAlone = TRUE);
void fn_vShowAllSectors (BOOL bUpdateDrawing = TRUE);
void fn_vShowSelection (BOOL bUpdateDrawing = TRUE);
void fn_vSetRecursiveColor (CPA_SuperObject *pEdObj, tdeLocalColor eColor);
// selection
void fn_vSelectNewSector (CPA_SuperObject *pSector, BOOL bCenterOnSector = FALSE, BOOL bUpdateDrawing = TRUE);
// lists
void fn_vUpdateActiveLists (CPA_SuperObject *pSector);
// select for environment
void fn_vUpdateSelectList (CPA_SuperObject *pSector);
// preferences
void fn_vSaveDialogsPreferences (void);
// copy / paste
void fn_vCopySectorList (CPA_SuperObject *pSector, tdeTypeList eList);
void fn_vPasteSectorList (CPA_SuperObject *pSector, tdeTypeList eList);
/*===========================================================================
Environments
=========================================================================*/
//Shaitan Clean Env
/*
void fn_vInitEnvironmentFiles (void);
void fn_vLoadEnvironments (void);
void fn_vLoadMecEnvironments (void);
void fn_vLoadVisEnvironments (void);
CString GetEnvFileName (void) { return m_csEnvFileName; }
CString GetMecEnvFileName (void) { return m_csMecEnvFileName; }
CString GetVisEnvFileName (void) { return m_csVisEnvFileName; }
SECT_Environment * GetOrBuildEnvironment (ENV_tdxHandleToEnvironment hEnvironment);
SECT_Environment * GetEnvironmentWithName (CString csName);
SECT_Environment * GetDefaultEnvironment (void);
SECT_MecEnvironment * GetOrBuildMecEnvironment (DNM_tdxHandleToMecEnvironment hMecEnv);
SECT_MecEnvironment * GetDefaultMecEnvironment (void);
SECT_VisEnvironment * GetOrBuildVisEnvironment (ACP_tdxHandleToVisualEnvironment hVisEnv);
SECT_VisEnvironment * GetDefaultVisEnvironment (void);
SECT_SndEnvironment * GetOrNullSndEnvironment (SND_tdxHandleToSoundInfo hSndEnv);
SECT_SndEnvironment * GetDefaultSndEnvironment (void);
*/
/*===========================================================================
Sounds
=========================================================================*/
void fn_vReinitSoundParameters (void);
SECT_SoundEvent * GetOrNullSoundEvent (SND_tdxHandleToSoundEvent hSoundEvent);
SECT_SoundEvent * GetDefaultSoundEvent (void);
/*===========================================================================
Surface
=========================================================================*/
//Shaitan Clean Env
/*
void fn_vLoadSurfaces (void);
void SetSurfaceToDraw (SECT_Surface *pSurface);
SECT_Surface * GetOrBuildSurface (SRF_tdxHandleToSurface hSurface);
SECT_Surface * GetDefaultSurface (Sector_Object *pSector);
long GetSurfaceHeightIndex (SECT_Surface *pSurface, long lPrevIndex);
void fn_vUpdateHeightIndex (SECT_Surface *pSurface);
void fn_vUpdateAllSurfaceList (SECT_Surface *pSurface);
*/
/*===========================================================================
Water Effect
=========================================================================*/
//Shaitan Clean Env
// void fn_vUpdateSurfaceList (BOOL bOnlyCurrentSurfaces = TRUE);
/*===========================================================================
Borders
=========================================================================*/
void fn_vDisplayBorder (Sector_Object *pSector, BOOL bDisplay, BOOL bUpdate);
void fn_vDisplayBorders (BOOL bDisplay);
/*===========================================================================
Virtual
=========================================================================*/
BOOL fn_bCanChangeVirtual (CPA_SuperObject *pSector, BOOL bVirtual);
void fn_vUpdateAllVirtuals (void);
//#################################################################################
// DLL FUNCTIONS OVERLOAD
//#################################################################################
/*===========================================================================
Inits
=========================================================================*/
void fn_vJustAfterRegistered (void);
void fn_vConstruct (void);
void fn_vInitListByType (CPA_World *pWorld);
void fn_vBeforeEngine (void);
void fn_vBeforeEditor (void);
void fn_vLevelChanges (void);
void fn_vLevelHasChanged (void);
/*===========================================================================
Hierarchy
=========================================================================*/
void fn_vBuildNewEditorInstance (CPA_SuperObject *pEditorInstance, HIE_tdxHandleToSuperObject pEngineInstance);
void fn_vUpdateEditorInstance (CPA_SuperObject *pEditorInstance, HIE_tdxHandleToSuperObject pEngineInstance);
BOOL fn_bCanHandleThisType (long lEngineType);
BOOL fn_bLoadBaseObject(CPA_BaseObject *p_oObject);
/*===========================================================================
Dialog Bar - Mircea Dunka 31 Aug. 1998
=========================================================================*/
void fn_vDefineDlgBarBtnIcon (tde_DlgBarCategory wCategory, tds_DlgBarBtn *_pDlgBarBtn);
/*===========================================================================
Editor
=========================================================================*/
BOOL fn_bDefineSubMenu (EDT_SubMenu *_p_oEDTSubMenu);
void _OnSubMenuCommand (EDT_SubMenu *_p_oEDTSubMenu, UINT uiMsgID);
BOOL fn_bDefinePopupMenu (EDT_PopUpMenu *pPopup, CPA_List<CPA_SuperObject> *pSelection, BOOL bAsCurrentEditor);
void _OnPopUpMenuCommand (UINT m_IDCmdMsg);
BOOL fn_bCanActivateEditor (CPA_List<CPA_BaseObject> *pParams);
void fn_vOnActivateEditor (CPA_List<CPA_BaseObject> *pParam, BOOL bBackActivated=FALSE);
void fn_vOnCloseEditor (void);
BOOL fn_bHasGainedFocus (void);
void fn_vHasLostFocus (void);
/*===========================================================================
Permissions
=========================================================================*/
tdeTypeAnswer fn_bAcceptSelect (CPA_SuperObject *pEdObj, ACP_tdxIndex xIndex, HIE_tdstPickInfo *pPicking, tdeStatus eStatus);
BOOL fn_bAcceptModifDelete (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus);
BOOL fn_bAcceptModifParent (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus);
BOOL fn_bAcceptModifCopy (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus);
BOOL fn_bAcceptModifTranslate (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus);
BOOL fn_bAcceptModifRotate (CPA_List<CPA_SuperObject> *pListObjects, tdeStatus eStatus);
BOOL fn_bAcceptModifScale (CPA_SuperObject *pEdObj, tdeStatus eStatus);
BOOL fn_bAcceptModifInsert (CPA_SuperObject *pEdObj, CPA_SuperObject *pParent, tdeStatus eStatus);
BOOL fn_bAcceptAsParent (CPA_BaseObject *pChild, CPA_BaseObject *pParent);
BOOL fn_bAcceptAsChild (CPA_BaseObject *pParent, CPA_BaseObject *pChild);
/*===========================================================================
Modifs
=========================================================================*/
void fn_vOnSelect (CPA_SuperObject *pEdObj, tdeTypeModif eType, tdeStatus eStatus);
void fn_vOnModifName (CPA_SuperObject *pEdObj, CString csInitalName, CString csFinalName, tdeTypeModif eType, tdeStatus eStatus);
void fn_vOnModifDelete (CPA_List<EDT_SaveParents> *pListObjects, tdeTypeModif eType, tdeStatus eStatus);
void fn_vOnModifParent (CPA_List<EDT_SaveParents> *pListObjects, tdeTypeModif eType, tdeStatus eStatus);
void fn_vOnModifCopy (CPA_List<EDT_SaveParents> *pListObjects, tdeTypeModif eType, tdeStatus eStatus);
void fn_vOnModifInsert (CPA_SuperObject *pEdObj, CPA_SuperObject *pParent, tdstPosition *p_stPosition,
tdeTypeModif eType, tdeStatus eStatus);
void fn_vOnChangeRoot (void);
void fn_vOnChangeWorld (void);
void fn_vOnChangeDevice (void);
/*===========================================================================
Messages
=========================================================================*/
BOOL _OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags);
BOOL _OnLButtonDown (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *pPicking);
BOOL _OnRButtonDown (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *pPicking);
BOOL _OnLButtonDblClk (UINT nFlags, tdstMousePos *p_stPos, ACP_tdxIndex xIndex, HIE_tdstPickInfo *pPicking);
/*===========================================================================
for Dialog List
=========================================================================*/
void GetListsForDialog (CPA_DialogList *pDialog);
void fn_vInitDefaultParameters (CPA_DialogList *pDialog);
BOOL fn_bOnSelChangeListObjects (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pSelectedObject, BOOL bUnselect);
BOOL fn_bOnDblClkListObjects (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pSelectedObject);
int GetStateForListItem (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pObject);
BOOL GetColorsForListItem (CPA_DialogList *pDialog, CString csListName, CPA_BaseObject *pObject,
COLORREF *pRectColor, COLORREF *pTextColor);
BOOL fn_bIsInActiveLists (CPA_SuperObject *pSector);
BOOL fn_bIsAvailableForList (CPA_SuperObject *pSector);
tdeTypeList GetFirstActiveList (void);
void fn_vGetSectorsToDraw (CPA_List<CPA_SuperObject> *pSectorList);
void fn_vLinkNearestSectors (void);
};
extern tdstDLLIdentity g_stSectorIdentity;
#endif // __SECT_INT_HPP__

View File

@@ -0,0 +1,255 @@
/*=========================================================================
*
* SECTlist.hpp : Definition of Editor Lists
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
#ifndef __SECT_LIST_HPP__
#define __SECT_LIST_HPP__
#include "incGLI.h"
#include "incSPO.h"
/*
#define ENV_FRIEND
#include "incENV.h"
#undef ENV_FRIEND
*/
#define SCTFriend
#include "incSCT.h"
#undef SCTFriend
#include "incITF.h"
#include "incGAM.h"
#include "SECTelem.hpp"
class Sector_Interface;
typedef CPA_SaveObject SECT_SoundEvent;
//#################################################################################
// Elements
//#################################################################################
/*===========================================================================
Graphic Element
===========================================================================*/
class SECT_GraphicElement : public SECT_ElementBase,
public CPA_EdElement<SECT_GraphicElement, SECT_tdxHandleOfElementLstGraphicInteraction, LST2_M_StaticAnchorTo(SECT_tdxHandleOfElementLstGraphicInteraction)*>
{
public:
SECT_GraphicElement (SECT_tdxHandleOfElementLstGraphicInteraction hGraphicElement, Sector_Object *pOwnerSector);
SECT_GraphicElement (CPA_SuperObject *pSector, Sector_Object *pOwnerSector);
~SECT_GraphicElement (void);
void *GetEngineStruct() { return GetStruct(); }
int GetGraphicLevel (void);
void SetGraphicLevel (int iNewLevel, BOOL bNotify = TRUE);
char GetGraphicMode (void);
void SetGraphicMode (char cNewMode, BOOL bNotify = TRUE);
};
/*===========================================================================
Collision Element
===========================================================================*/
class SECT_CollisionElement : public SECT_ElementBase,
public CPA_EdElement<SECT_CollisionElement, SECT_tdxHandleOfElementLstCollisionInteraction, LST2_M_StaticAnchorTo(SECT_tdxHandleOfElementLstCollisionInteraction)*>
{
public:
SECT_CollisionElement (SECT_tdxHandleOfElementLstCollisionInteraction hCollisionElement, Sector_Object *pOwnerSector);
SECT_CollisionElement (CPA_SuperObject *pSector, Sector_Object *pOwnerSector);
~SECT_CollisionElement (void);
void *GetEngineStruct() { return GetStruct(); }
};
/*===========================================================================
Activity Element
===========================================================================*/
class SECT_ActivityElement : public SECT_ElementBase,
public CPA_EdElement<SECT_ActivityElement, SECT_tdxHandleOfElementLstActivityInteraction, LST2_M_StaticAnchorTo(SECT_tdxHandleOfElementLstActivityInteraction)*>
{
public:
SECT_ActivityElement (SECT_tdxHandleOfElementLstActivityInteraction hActivityElement, Sector_Object *pOwnerSector);
SECT_ActivityElement (CPA_SuperObject *pSector, Sector_Object *pOwnerSector);
~SECT_ActivityElement (void);
void *GetEngineStruct() { return GetStruct(); }
};
/*===========================================================================
Sound Element
===========================================================================*/
class SECT_SoundElement : public SECT_ElementBase,
public CPA_EdElement<SECT_SoundElement, SECT_tdxHandleOfElementLstSoundInteraction, LST2_M_StaticAnchorTo(SECT_tdxHandleOfElementLstSoundInteraction)*>
{
public:
SECT_SoundElement (SECT_tdxHandleOfElementLstSoundInteraction hSoundElement, Sector_Object *pOwnerSector);
SECT_SoundElement (CPA_SuperObject *pSector, Sector_Object *pOwnerSector);
~SECT_SoundElement (void);
void *GetEngineStruct() { return GetStruct(); }
int GetSoundLevel (void);
void SetSoundLevel (int iNewLevel, BOOL bNotify = TRUE);
};
/*===========================================================================
SoundEvent Engine Element
===========================================================================*/
class SECT_SndEvtEngineElem : public CPA_EdElement<SECT_SndEvtEngineElem, SCT_tdxHandleOfLstSoundEvent , LST2_M_StaticAnchorTo(SCT_tdxHandleOfLstSoundEvent)*>
{
protected:
Sector_Object *m_pOwnerSector;
CPA_SuperObject *m_pSector;
SECT_SoundEvent *m_pSoundEvent;
public:
SECT_SndEvtEngineElem (SCT_tdxHandleOfLstSoundEvent hSoundEventElement, Sector_Object *pOwnerSector);
SECT_SndEvtEngineElem (CPA_SuperObject *pSector, SECT_SoundEvent *pSoundEvent, Sector_Object *pOwnerSector);
~SECT_SndEvtEngineElem (void);
void *GetEngineStruct() { return GetStruct(); }
Sector_Object * GetOwnerSector (void) { return m_pOwnerSector; }
CPA_SuperObject * GetSector (void) { return m_pSector; }
SECT_SoundEvent * GetSoundEvent (void) { return m_pSoundEvent; }
CString GetSoundEventReference (void);
void fn_vInitSoundEvent (void);
};
/*===========================================================================
SoundEvent Element
===========================================================================*/
class SECT_SoundEventElement : public SECT_ElementBase
{
protected:
CPA_List<SECT_SndEvtEngineElem> m_oSoundEventList;
public:
SECT_SoundEventElement (CPA_SuperObject *pSector, Sector_Object *pOwnerSector);
~SECT_SoundEventElement (void);
CPA_List<SECT_SndEvtEngineElem> * GetSndEvtList (void) { return &m_oSoundEventList; }
void fn_vAddSoundEvent (SECT_SndEvtEngineElem *pSoundEventElement, BOOL bNotify = TRUE);
void fn_vRemoveSoundEvent (SECT_SndEvtEngineElem *pSoundEventElement, BOOL bNotify = TRUE);
void fn_vRemoveAllSoundEvents (BOOL bNotify = TRUE);
void fn_vCopyMissingSoundEvents (SECT_SoundEventElement *pModel, BOOL bNotify = TRUE);
SECT_SndEvtEngineElem * GetElementWithSoundEvent (SECT_SoundEvent *pSoundEvent);
};
//#################################################################################
// Lists
//#################################################################################
/*===========================================================================
Graphic List
===========================================================================*/
class SECT_GraphicList : public CPA_EdList<SECT_GraphicElement, SECT_tdxHandleOfElementLstGraphicInteraction, LST2_M_StaticAnchorTo(SECT_tdxHandleOfElementLstGraphicInteraction)*>,
public SECT_ListBase
{
public:
SECT_GraphicList (void) { };
~SECT_GraphicList (void) { };
BOOL fn_bAddAnElement (SECT_ElementBase *pNewElem, BOOL bUpdateEngine = TRUE);
void fn_vRemoveAnElement (SECT_ElementBase *pOldElem, BOOL bUpdateEngine = TRUE);
void fn_vRemoveAllElements (BOOL bUpdateEngine = TRUE);
SECT_ElementBase * GetHeadElementBase (POSITION& rPosition);
SECT_ElementBase * GetNextElementBase (POSITION& rPosition);
};
/*===========================================================================
Collision List
===========================================================================*/
class SECT_CollisionList : public CPA_EdList<SECT_CollisionElement, SECT_tdxHandleOfElementLstCollisionInteraction, LST2_M_StaticAnchorTo(SECT_tdxHandleOfElementLstCollisionInteraction)*>,
public SECT_ListBase
{
public:
SECT_CollisionList (void) { };
~SECT_CollisionList (void) { };
BOOL fn_bAddAnElement (SECT_ElementBase *pNewElem, BOOL bUpdateEngine = TRUE);
void fn_vRemoveAnElement (SECT_ElementBase *pOldElem, BOOL bUpdateEngine = TRUE);
void fn_vRemoveAllElements (BOOL bUpdateEngine = TRUE);
SECT_ElementBase * GetHeadElementBase (POSITION& rPosition);
SECT_ElementBase * GetNextElementBase (POSITION& rPosition);
};
/*===========================================================================
Activity List
===========================================================================*/
class SECT_ActivityList : public CPA_EdList<SECT_ActivityElement, SECT_tdxHandleOfElementLstActivityInteraction, LST2_M_StaticAnchorTo(SECT_tdxHandleOfElementLstActivityInteraction)*>,
public SECT_ListBase
{
public:
SECT_ActivityList (void) { };
~SECT_ActivityList (void) { };
BOOL fn_bAddAnElement (SECT_ElementBase *pNewElem, BOOL bUpdateEngine = TRUE);
void fn_vRemoveAnElement (SECT_ElementBase *pOldElem, BOOL bUpdateEngine = TRUE);
void fn_vRemoveAllElements (BOOL bUpdateEngine = TRUE);
SECT_ElementBase * GetHeadElementBase (POSITION& rPosition);
SECT_ElementBase * GetNextElementBase (POSITION& rPosition);
};
/*===========================================================================
Sound List
===========================================================================*/
class SECT_SoundList : public CPA_EdList<SECT_SoundElement, SECT_tdxHandleOfElementLstSoundInteraction, LST2_M_StaticAnchorTo(SECT_tdxHandleOfElementLstSoundInteraction)*>,
public SECT_ListBase
{
public:
SECT_SoundList (void) { };
~SECT_SoundList (void) { };
BOOL fn_bAddAnElement (SECT_ElementBase *pNewElem, BOOL bUpdateEngine = TRUE);
void fn_vRemoveAnElement (SECT_ElementBase *pOldElem, BOOL bUpdateEngine = TRUE);
void fn_vRemoveAllElements (BOOL bUpdateEngine = TRUE);
SECT_ElementBase * GetHeadElementBase (POSITION& rPosition);
SECT_ElementBase * GetNextElementBase (POSITION& rPosition);
};
/*===========================================================================
SoundEvent List
===========================================================================*/
class SECT_SoundEventList : public CPA_EdList<SECT_SndEvtEngineElem, SCT_tdxHandleOfLstSoundEvent, LST2_M_StaticAnchorTo(SCT_tdxHandleOfLstSoundEvent)*>,
public SECT_ListBase
{
protected:
CPA_List<SECT_SoundEventElement> m_oElementList;
public:
SECT_SoundEventList (void) { };
~SECT_SoundEventList (void) { };
BOOL fn_bAddAnElement (SECT_SndEvtEngineElem *pEngineElem);
BOOL fn_bAddAnElement (CPA_SuperObject *pSector, SECT_SoundEvent *pSoundEvent);
BOOL fn_bRemoveAnElement (CPA_SuperObject *pSector, SECT_SoundEvent *pSoundEvent);
BOOL fn_bAddAnElement (SECT_ElementBase *pNewElem, BOOL bUpdateEngine = TRUE);
void fn_vRemoveAnElement (SECT_ElementBase *pOldElem, BOOL bUpdateEngine = TRUE);
void fn_vRemoveAllElements (BOOL bUpdateEngine = TRUE);
SECT_ElementBase * GetHeadElementBase (POSITION& rPosition);
SECT_ElementBase * GetNextElementBase (POSITION& rPosition);
};
#endif //__SECT_LIST_HPP__

View File

@@ -0,0 +1,224 @@
/*=========================================================================
*
* SECTobj.hpp : Sector_Object
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
#ifndef __SECT_OBJ_HPP__
#define __SECT_OBJ_HPP__
//Shaitan Clean Env
//#include "SECTenv.hpp"
#include "SECTlist.hpp"
//Shaitan Clean Env
//#include "SECTsurf.hpp"
//**************************************
#ifndef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
#endif
//**************************************
//#################################################################################
// Defines
//#################################################################################
typedef enum
{
E_NoActiveList = -1,
E_Graphic = 0,
E_Collision = 1,
E_Activity = 2,
E_Sound = 3,
E_SoundEvent = 4
}
tdeTypeList;
#define C_NumberOfLists 5
#define C_szSectorBorderSubSection "Border"
/*===========================================================================
* Description: class Sector_Object
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
class Sector_Object : public CPA_SaveObject,
public CPA_EdMot<SECT_tdxHandleOfSectorObject>
{
protected:
// links
SECT_CollisionList m_oCollisionList;
SECT_ActivityList m_oActivityList;
SECT_GraphicList m_oGraphicList;
SECT_SoundList m_oSoundList;
SECT_SoundEventList m_oSoundEventList;
//Shaitan Clean Env
/*
// env & srf
SECT_SurfaceList m_oSurfaceList;
SECT_EnvironmentList m_oEnvironmentList;
long m_lNbEnvironments;
long m_lNbSurfaces;
*/
// sub-sections
BOOL m_bHasSectorsLinkSection;
//Shaitan Clean Env
// BOOL m_bHasEnvAndSurfSection;
// super-object
CPA_SuperObject *m_pSuperObject;
BOOL m_bWasRenamed;
CPA_SuperObject *m_pBorder;
CPA_SectionObject *m_pBorderSection;
SECT_ElementBase *m_pVirtualSection;
SECT_ElementBase *m_pCameraSection;
SECT_ElementBase *m_pPrioritySection;
void fn_vInitEngineAnchors (void);
public:
Sector_Object (CPA_ObjectDLLBase *p_oDLL,
SECT_tdxHandleOfSectorObject hObj,
CString csName = "", CString csFileName = "");
~Sector_Object (void);
// inits
static void StaticInit();
// return Data
virtual long GetDataType (void) { return HIE_C_ulSector; }
virtual void * GetData (void) { return GetStruct(); }
// engine struct
void *GetEngineStruct() { return GetStruct(); }
void SetEngineStruct (SECT_tdxHandleOfSectorObject hObj);
// super-object
CPA_SuperObject * GetSuperObject (void) { return m_pSuperObject; }
void SetSuperObject (CPA_SuperObject *pSupObj) { m_pSuperObject = pSupObj; }
// border
CPA_SuperObject * GetBorder (void) { return m_pBorder; }
CPA_SectionObject * GetBorderSection (void) { return m_pBorderSection; }
MTH_tdxReal GetZmaxOfSector (void);
MTH_tdxReal GetZmaxOfBorder (void);
void SetZmaxOfBorder (MTH_tdxReal xNewZmax);
void GetMinPointInBorder (MTH3D_tdstVector *p_stMinPoint);
void GetMaxPointInBorder (MTH3D_tdstVector *p_stMaxPoint);
void GetCenterInBorder (MTH3D_tdstVector *p_stCenter);
MTH_tdxReal GetMaxDimension (void);
// Zfar
MTH_tdxReal GetZfarInSector (void);
void SetZfarInSector (MTH_tdxReal xNewZfar);
// virtual
SECT_ElementBase * GetVirtualSection (void) { return m_pVirtualSection; }
SECT_ElementBase * GetCameraSection (void) { return m_pCameraSection; }
SECT_ElementBase * GetPrioritySection (void) { return m_pPrioritySection; }
// interface
Sector_Interface * GetSectorInterface (void) { return (Sector_Interface *)GetEditor(); }
// lists
SECT_SoundEventList * GetSoundEventList (void) { return &m_oSoundEventList; }
SECT_CollisionList * GetCollisionList (void) { return &m_oCollisionList; }
SECT_ActivityList * GetActivityList (void) { return &m_oActivityList; }
SECT_GraphicList * GetGraphicList (void) { return &m_oGraphicList; }
SECT_SoundList * GetSoundList (void) { return &m_oSoundList; }
//Shaitan Clean Env
/*
SECT_EnvironmentList * GetEnvironmentList (void) { return &m_oEnvironmentList; }
SECT_SurfaceList * GetSurfaceList (void) { return &m_oSurfaceList; }
long GetNbEnvironments (void) { return m_lNbEnvironments; }
long GetNbSurfaces (void) { return m_lNbSurfaces; }
*/
// inits
void fn_vInitSortedLists (void);
//Shaitan Clean Env
// void fn_vInitEnvironments (void);
// void fn_vInitSurfaces (void);
void fn_vInitBorder (void);
// virtual or gothrough
BOOL fn_bIsVirtual (void);
void fn_vSetVirtual (BOOL bVirtual, CPA_SuperObject *pBorder = NULL);
// sector links
BOOL fn_bAddSectorInList (SECT_ElementBase *pNewElem, tdeTypeList eType);
BOOL fn_bRemoveSectorInList (SECT_ElementBase *pOldElem, tdeTypeList eType);
SECT_ListBase * GetCurrentList (tdeTypeList eType);
SECT_ElementBase * GetNewElement (tdeTypeList eType, CPA_SuperObject *pSector);
BOOL fn_bHasFullLink (tdeTypeList eType);
//Shaitan Clean Env
/*
// environment element
BOOL fn_bAddEnvironmentElement (SECT_EnvElem *pEnvElem, SECT_SurfElem *pSurfElem);
BOOL fn_bDelEnvironmentElement (SECT_EnvElem *pEnvElem, SECT_SurfElem *pSurfElem);
SECT_EnvElem * GetEnvironment (long lNumEnv);
SECT_SurfElem * GetSurface (long lNumSurf);
long fn_lUpdateEnvironmentElement (long lNumEnvElem);
void fn_vApplySameEnvironment (CPA_List<SECT_Environment> *pListEnv, CPA_List<SECT_Surface> *pListSrf);
*/
// save
BOOL fn_bHasSectorsLinkSection (void) { return m_bHasSectorsLinkSection; }
//Shaitan Clean Env
// BOOL fn_bHasEnvAndSurfSection (void) { return m_bHasEnvAndSurfSection; }
void SetExistingSectorsLinkSection (BOOL bExist) { m_bHasSectorsLinkSection = bExist; }
//Shaitan Clean Env
// void SetExistingEnvAndSurfSection (BOOL bExist) { m_bHasEnvAndSurfSection = bExist; }
CString GetSectorsLinkSection (void);
//Shaitan Clean Env
// CString GetEnvAndSurfSection (void);
static void CallBackSaveName (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction);
// border
CString GetSectorBorderSection (void);
void fn_vNotifyBorderSection (BOOL bWrite);
static void CallBackSaveSectorBorder (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction);
char GetCameraType (void);
void SetCameraType (char cType);
char GetPriority (void);
void SetPriority (char cPriority);
};
#endif //__SECT_OBJ_HPP__

View File

@@ -0,0 +1,160 @@
/*=========================================================================
*
* SECTsurf.hpp : Definition of Editor Surface Lists
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
/*
#ifndef __SECT_SURF_HPP__
#define __SECT_SURF_HPP__
#include "incGLI.h"
#include "incSPO.h"
#include "incSRF.h"
#define ENV_FRIEND
#include "incENV.h"
#undef ENV_FRIEND
#define SCTFriend
#include "incSCT.h"
#undef SCTFriend
#include "incITF.h"
#include "incGAM.h"
#include "SECTelem.hpp"
#include "x:\cpa\Main\inc\_editid.h"
//**************************************
#ifndef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
#endif
//**************************************
class Sector_Object;
class Sector_Interface;
#define C_szSurfaceActionName "SurfaceDescription"
//#################################################################################
// Surface
//#################################################################################
class SECT_Surface : public CPA_SaveObject,
public CPA_EdMot<SRF_tdxHandleToSurface>
{
protected:
CPA_SuperObject *m_pSuperObject;
CPA_SuperObject *m_pVisualSuperObject;
CPA_BaseObject *m_pVisualSurface;
CPA_SectionObject *m_pMatrixSection;
public:
SECT_Surface (Sector_Interface *p_oDLL,
SRF_tdxHandleToSurface hSurface, BOOL bAvailable,
CString csName, CString csFileName);
~SECT_Surface (void);
// return Data
long GetDataType (void) { return -1; }
void * GetData (void) { return GetStruct(); }
// matrix
CPA_SectionObject * GetMatrixSection (void) { return m_pMatrixSection; }
CString GetMatrixSectionName (void);
// notify
void fn_vNotifySave (void);
void fn_vNotifyUnSave (void);
void fn_vNotifyRestore (void);
void fn_vNotifyRename (void);
void fn_vUpdateSectionName (void);
void * GetEngineStruct (void) { return GetStruct(); }
Sector_Interface * GetSectorInterface (void) { return (Sector_Interface *)GetEditor(); }
// height
MTH_tdxReal GetHeight (void);
void SetHeight (MTH_tdxReal xNewHeight);
// super-object
CPA_SuperObject * GetSuperObject (void) { return m_pSuperObject; }
// visual surface
CPA_SuperObject * GetVisualSuperObject (void) { return m_pVisualSuperObject; }
CPA_BaseObject * GetVisualSurface (void) { return m_pVisualSurface; }
void SetVisualSurface (CPA_BaseObject *pVisual) { m_pVisualSurface = pVisual; }
// save
static void CallBackSaveSurfaceMatrix (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction);
};
//#################################################################################
// Surface (list element)
//#################################################################################
class SECT_SurfElem : public SECT_EnvElementBase,
public CPA_EdElement<SECT_SurfElem, SCT_tdxHandleOfElementLstSurface, LST2_M_StaticAnchorTo(SCT_tdxHandleOfElementLstSurface)*>
{
protected:
SECT_Surface *m_pSurface;
public:
SECT_SurfElem (SCT_tdxHandleOfElementLstSurface hSurfElem, Sector_Object *pOwnerSector);
SECT_SurfElem (SECT_Surface *pSurface, Sector_Object *pOwnerSector);
~SECT_SurfElem (void);
void *GetEngineStruct() { return GetStruct(); }
// environment
SECT_Surface * GetSurface (void) { return m_pSurface; }
void SetSurface (SECT_Surface *pSurface);
};
//#################################################################################
// Environment List
//#################################################################################
class SECT_SurfaceList : public CPA_EdList<SECT_SurfElem, SCT_tdxHandleOfElementLstSurface, LST2_M_StaticAnchorTo(SCT_tdxHandleOfElementLstSurface)*>
{
protected:
Sector_Object *m_pOwnerSector;
public:
SECT_SurfaceList (void) { };
~SECT_SurfaceList (void) { };
void SetOwnerSector (Sector_Object *pOwnerSector) { m_pOwnerSector = pOwnerSector; }
BOOL fn_bAddAnElement (SECT_SurfElem *pNewElem, SECT_SurfElem *pPreviousElem, BOOL bUpdateEngine = TRUE);
void fn_vRemoveAnElement (SECT_SurfElem *pOldElem, BOOL bUpdateEngine = TRUE);
void fn_vRemoveAllElements (BOOL bUpdateEngine = TRUE);
SECT_SurfElem * GetElementWithSurface (SECT_Surface *pSurface);
long GetInsertPosition (SECT_SurfElem *pSurfElem);
long GetCurrentPosition (SECT_SurfElem *pSurfElem);
};
#endif //__SECT_SURF_HPP__
*/

View File

@@ -0,0 +1,77 @@
/*=========================================================================
*
* SECdDist.hpp : class SECT_DialogDistance
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
#ifndef __SECT_D_DIST_HPP__
#define __SECT_D_DIST_HPP__
#include "SECTres.h"
class Sector_Interface;
//#################################################################################
// Sector Links
//#################################################################################
/*===========================================================================
* Description: Class for the Distance Dialog
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
class SECT_DialogDistance : public CDialog
{
protected:
// dialog parameters
Sector_Interface *m_pSectorInterface;
long m_lLinkDistance;
public:
// standard constructor
SECT_DialogDistance (CWnd* pParent = NULL);
void fn_vInitSectorInterface (Sector_Interface *pInterface);
long GetLinkDistance (void) { return m_lLinkDistance; }
protected:
// Dialog Data
//{{AFX_DATA(SECT_DialogDistance)
enum { IDD = SEC_IDD_DIALOGDISTANCE};
CEdit m_cEditDistance;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(SECT_DialogDistance)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(SECT_DialogDistance)
afx_msg void OnSize(UINT, int, int);
afx_msg void OnDestroy();
// env elem
virtual BOOL OnInitDialog();
afx_msg void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif //__SECT_D_DIST_HPP__

View File

@@ -0,0 +1,96 @@
/*=========================================================================
*
* SECdEdit.hpp : class SECT_DialogEdit
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
#ifndef __SECT_D_EDIT_HPP__
#define __SECT_D_EDIT_HPP__
#include "SECTres.h"
class Sector_Interface;
class SECT_DialogEnv;
/*===========================================================================
* Description: Class for the Dialog
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
class SECT_DialogEdit : public CFormView
{
// Construction
protected:
Sector_Interface *m_pSectorInterface;
CPA_SuperObject *m_pEditedSector;
char m_szName[256];
BOOL m_bInitialised;
public:
// standard constructor
SECT_DialogEdit (CWnd* pParent = NULL);
// get functions
CPA_SuperObject * GetSelectedSector (void) { return m_pEditedSector; }
Sector_Interface * GetSectorInterface (void) { return m_pSectorInterface; }
// Dialog
void fn_vInitDialog (Sector_Interface *p_oDLL, CWnd *pParent, const CString csTag);
void fn_vReinitDialog (CPA_SuperObject *pSector);
protected:
// Dialog Data
//{{AFX_DATA(SECT_DialogEdit)
enum { IDD = SEC_IDD_DIALOGEDIT };
CComboBox m_cComboSector;
CButton m_cVirtual;
CButton m_cZmaxCheck;
CEdit m_cZmaxEdit;
CButton m_cZfarCheck;
CEdit m_cZfarEdit;
CButton m_cDefault;
CEdit m_cCamTypeEdit;
CEdit m_cPriorityEdit;
CSpinButtonCtrl m_cPrioritySpin;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(SECT_DialogEdit)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(SECT_DialogEdit)
afx_msg void OnSize(UINT, int, int);
afx_msg void OnSelChangeComboSector();
afx_msg void OnVirtual();
afx_msg void OnZmaxCheck();
afx_msg void OnEditZmax();
afx_msg void OnZfarCheck();
afx_msg void OnEditZfar();
afx_msg void OnDefault();
afx_msg void OnEditCamType();
// afx_msg void OnEditPriority();
afx_msg void OnPrioritySpin(NMHDR * pNMHDR, LRESULT * pResult);
afx_msg void OnDestroy();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif //__SECT_D_EDIT_HPP__

View File

@@ -0,0 +1,157 @@
/*=========================================================================
*
* SECTdEnv.hpp : class SECT_DialogEnv
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
/*
#ifndef __SECT_D_ENV_HPP__
#define __SECT_D_ENV_HPP__
#include "SECTres.h"
#include "SECTenv.hpp"
class Sector_Interface;
*/
/*===========================================================================
* Description: Class for the ListBox
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
class SECT_EnvParamListBox : public SECT_EnvListBox
{
public:
SECT_EnvParamListBox (void);
~SECT_EnvParamListBox (void);
BOOL fn_bIsCurrentElement (CPA_BaseObject *pElem);
BOOL fn_bIsSelectedElement (CPA_BaseObject *pElem);
BOOL fn_bIsAlreadyUsed (CPA_BaseObject *pElem);
};
*/
/*===========================================================================
* Description: Class for the Dialog Environment
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
class SECT_DialogEnv : public CFormView
{
protected:
// dialog parameters
Sector_Interface *m_pSectorInterface;
SECT_Environment *m_pEnvironment;
SECT_Environment *m_pDefaultEnv;
BOOL m_bInitialised;
CString m_csName;
SECT_MecEnvironment *m_pMecEnvironment;
SECT_VisEnvironment *m_pVisEnvironment;
SECT_SndEnvironment *m_pSndEnvironment;
public:
// standard constructor
SECT_DialogEnv (CWnd* pParent = NULL);
// Dialog
void fn_vInitDialog (Sector_Interface *p_oDLL, CWnd *pParent);
void fn_vInitEnvironment (SECT_Environment *pEnvironment, BOOL bNewEnv);
void fn_vInitControls (BOOL bEnable);
void fn_vReinitDialog (void);
// list box
void fn_vInitMecListBox (void);
void fn_vInitVisListBox (void);
void fn_vInitSndListBox (void);
// selection
void fn_vSelectMechanic (SECT_MecEnvironment *pMecEnv, BOOL bUpdateEnv = TRUE);
void fn_vSelectVisual (SECT_VisEnvironment *pVisEnv, BOOL bUpdateEnv = TRUE);
void fn_vSelectSound (SECT_SndEnvironment *pSndEnv, BOOL bUpdateEnv = TRUE);
// sound
int GetSoundIndex (DWORD pElem);
// Get Functions
SECT_MecEnvironment * GetSelectedMecEnv (void) { return m_pMecEnvironment; }
SECT_VisEnvironment * GetSelectedVisEnv (void) { return m_pVisEnvironment; }
SECT_SndEnvironment * GetSelectedSndEnv (void) { return m_pSndEnvironment; }
SECT_Environment * GetCurrentEnv (void) { return m_pEnvironment; }
protected:
// Dialog Data
//{{AFX_DATA(SECT_DialogEnv)
enum { IDD = SEC_IDD_DIALOGENV };
// name
CEdit m_cName;
CButton m_cDefault;
// modifs
CButton m_cCancel;
CButton m_cSave;
// mechanic environment
SECT_EnvParamListBox m_cMecListBox;
CButton m_cEditMec;
CButton m_cNewMec;
// mechanic environment
SECT_EnvParamListBox m_cVisListBox;
CButton m_cEditVis;
CButton m_cNewVis;
// sound environment
CListBox m_cSndListBox;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(SECT_DialogEnv)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(SECT_DialogEnv)
afx_msg void OnSize(UINT, int, int);
afx_msg void OnDestroy();
// name
afx_msg void OnChangeName();
afx_msg void OnDefault();
// modifs
afx_msg void OnCancel();
afx_msg void OnSave();
// mechanic environment
afx_msg void OnSelChangeMecListBox(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDblClkMecListBox(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnEditMec();
afx_msg void OnNewMec();
// mechanic environment
afx_msg void OnSelChangeVisListBox(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDblClkVisListBox(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnEditVis();
afx_msg void OnNewVis();
// sound environment
afx_msg void OnSelChangeSndListBox();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif //__SECT_D_ENV_HPP__
*/

View File

@@ -0,0 +1,123 @@
/*=========================================================================
*
* SECdEnvs.hpp : class SECT_DialogEnvs
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
/*
#ifndef __SECT_D_ENVS_HPP__
#define __SECT_D_ENVS_HPP__
#include "SECTres.h"
#include "SECTenv.hpp"
#include "SECdRep.hpp"
class Sector_Interface;
*/
//#################################################################################
// Environments
//#################################################################################
/*===========================================================================
* Description: Class for the Environment List Box
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
class SECT_EnvElemListBox : public SECT_EnvListBox
{
public:
SECT_EnvElemListBox (void);
~SECT_EnvElemListBox (void);
BOOL fn_bIsCurrentElement (CPA_BaseObject *pElem);
BOOL fn_bIsSelectedElement (CPA_BaseObject *pElem);
BOOL fn_bIsAlreadyUsed (CPA_BaseObject *pElem);
};
*/
/*===========================================================================
* Description: Class for the Environment List
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
class SECT_DialogEnvs : public CFormView
{
protected:
// dialog parameters
Sector_Interface *m_pSectorInterface;
SECT_EnvElem *m_pEnvElem;
SECT_Environment *m_pEnvironment;
BOOL m_bInitialised;
long m_lEnvElem;
SECT_DialogReplace m_oDialogReplace;
public:
// standard constructor
SECT_DialogEnvs (CWnd* pParent = NULL);
// Dialog
void fn_vInitDialog (Sector_Interface *pDLL, CWnd *pParent);
void fn_vReinitDialog (void);
void fn_vInitEnvListBox (void);
void fn_vInitEnvElem (long lEnvElem);
void fn_vSelectEnv (SECT_Environment *pEnvironment, BOOL bUpdateEnvElem = TRUE);
void fn_vInitControls (BOOL bEnable);
// Get Functions
SECT_EnvElem * GetCurrentEnvElem (void) { return m_pEnvElem; }
SECT_Environment * GetSelectedEnvironment (void) { return m_pEnvironment; }
protected:
// Dialog Data
//{{AFX_DATA(SECT_DialogEnvs)
enum { IDD = SEC_IDD_DIALOGENVS };
// env elem
SECT_EnvElemListBox m_cEnvListBox;
CButton m_cNewEnv;
CButton m_cReplace;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(SECT_DialogEnvElem)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(SECT_DialogEnvElem)
afx_msg void OnSize(UINT, int, int);
afx_msg void OnDestroy();
// env elem
afx_msg void OnSelChangeEnvListBox(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDblClkEnvListBox(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnNewEnv();
afx_msg void OnReplace();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif //__SECT_D_ENVS_HPP__
*/

View File

@@ -0,0 +1,127 @@
/*=========================================================================
*
* SECTdMec.hpp : class SECT_DialogMec
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
/*
#ifndef __SECT_D_MEC_HPP__
#define __SECT_D_MEC_HPP__
#include "SECTres.h"
class Sector_Interface;
/===========================================================================
* Description: Class for the Dialog
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================/
class SECT_DialogMec : public CFormView
{
protected:
// dialog parameters
Sector_Interface *m_pSectorInterface;
SECT_MecEnvironment *m_pMecEnv;
SECT_MecEnvironment *m_pDefaultMecEnv;
BOOL m_bInitialised;
// mec environment parameters
CString m_csName;
MTH_tdxReal m_xGravity;
DNM_tdstVector *m_pVertical;
MTH_tdxReal m_xViscosity;
MTH_tdxReal m_xDensity;
MTH_tdxReal m_xLevel;
DNM_tdstVector *m_pStream;
CString m_csVolumic;
public:
// standard constructor
SECT_DialogMec (CWnd* pParent = NULL);
// Dialog
void fn_vInitDialog (Sector_Interface *p_oDLL, CWnd *pParent);
void fn_vReinitDialog (void);
void fn_vInitControls (BOOL bEnable);
void fn_vInitMecEnvironment (SECT_MecEnvironment *pMecEnv, BOOL bEnable);
protected:
// Dialog Data
//{{AFX_DATA(SECT_DialogMec)
enum { IDD = SEC_IDD_DIALOGMECENV };
CButton m_cSave;
CButton m_cCancel;
CEdit m_cName;
CButton m_cDefault;
CEdit m_cGravity;
CEdit m_cVectorX;
CEdit m_cVectorY;
CEdit m_cVectorZ;
CEdit m_cViscosity;
CEdit m_cDensity;
CEdit m_cLevel;
CEdit m_cStreamX;
CEdit m_cStreamY;
CEdit m_cStreamZ;
CComboBox m_cVolumic;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(SECT_DialogMec)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(SECT_DialogMec)
afx_msg void OnSize(UINT, int, int);
afx_msg void OnDestroy();
afx_msg void OnSave();
afx_msg void OnCancel();
afx_msg void OnChangeName();
afx_msg void OnDefault();
afx_msg void OnChangeGravity();
afx_msg void OnChangeVectorX();
afx_msg void OnChangeVectorY();
afx_msg void OnChangeVectorZ();
afx_msg void OnChangeViscosity();
afx_msg void OnChangeDensity();
afx_msg void OnChangeLevel();
afx_msg void OnChangeStreamX();
afx_msg void OnChangeStreamY();
afx_msg void OnChangeStreamZ();
afx_msg void OnSelChangeComboVolumic();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif //__SECT_D_MEC_HPP__
*/

View File

@@ -0,0 +1,88 @@
/*=========================================================================
*
* SECdMode.hpp : class SECT_DialogMode
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
#ifndef __SECT_D_MODE_HPP__
#define __SECT_D_MODE_HPP__
#include "SECTres.h"
class Sector_Interface;
/*===========================================================================
* Description: Class for the Dialog
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
class SECT_DialogMode : public CFormView
{
// Construction
protected:
Sector_Interface *m_pOwnerDLL;
BOOL m_bShowSymetric;
BOOL m_bInitialised;
public:
// standard constructor
SECT_DialogMode (CWnd* pParent = NULL);
// get functions
Sector_Interface * GetOwnerDLL (void) { return m_pOwnerDLL; }
// Dialog
void fn_vInitDialog (Sector_Interface *pDLL, CWnd *pParent, BOOL bShowSymetric, const CString csTag);
void fn_vInitControls (void);
void fn_vUpdateEditMode (void);
protected:
// Dialog Data
//{{AFX_DATA(SECT_DialogMode)
enum { IDD = SEC_IDD_DIALOGMODE };
CButton m_cSector;
CButton m_cList;
//Shaitan Clean Env
// CButton m_cEnv;
CStatic m_cSectorText;
CStatic m_cListText;
//Shaitan Clean Env
// CStatic m_cEnvText;
CButton m_cModeSym;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(SECT_DialogMode)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(SECT_DialogMode)
afx_msg void OnSize(UINT, int, int);
afx_msg void OnDestroy();
afx_msg void OnSectors();
afx_msg void OnList();
//Shaitan Clean Env
// afx_msg void OnEnv();
afx_msg void OnModeSym();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif //__SECT_D_MODE_HPP__

View File

@@ -0,0 +1,83 @@
/*=========================================================================
*
* SECdRep.hpp : class SECT_DialogReplace
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
/*
#ifndef __SECT_D_REP_HPP__
#define __SECT_D_REP_HPP__
#include "SECTres.h"
class Sector_Interface;
*/
//#################################################################################
// Environments
//#################################################################################
/*===========================================================================
* Description: Class for the Environment List
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
class SECT_DialogReplace : public CDialog
{
protected:
// dialog parameters
Sector_Interface *m_pSectorInterface;
public:
// standard constructor
SECT_DialogReplace (CWnd* pParent = NULL);
void fn_vInitSectorInterface (Sector_Interface *pInterface);
protected:
// Dialog Data
//{{AFX_DATA(SECT_DialogReplace)
enum { IDD = SEC_IDD_DIALOGREPLACE };
// env elem
CComboBox m_cInitEnv;
CComboBox m_cNewEnv;
CButton m_cEdit;
CButton m_cSelect;
CButton m_cAll;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(SECT_DialogEnvElem)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(SECT_DialogEnvElem)
afx_msg void OnSize(UINT, int, int);
afx_msg void OnDestroy();
// env elem
virtual BOOL OnInitDialog();
afx_msg void OnOK();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif //__SECT_D_REP_HPP__
*/

View File

@@ -0,0 +1,136 @@
/*=========================================================================
*
* SECdSel.hpp : class SECT_DialogSel
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
#ifndef __SECT_D_SEL_HPP__
#define __SECT_D_SEL_HPP__
#include "SECTres.h"
class Sector_Interface;
class SECT_DialogSel;
/*===========================================================================
* Description: Class for the SoundEventListBox
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
class SECT_SndEvListBox : public CPA_SortedListBox
{
protected:
Sector_Interface *m_pSectorInterface;
SECT_DialogSel *m_pDialogSel;
public:
SECT_SndEvListBox();
~SECT_SndEvListBox() { }
void fn_vInitDialogParameters (SECT_DialogSel *pDialogSel);
BOOL fn_bIsInCurrentList (CPA_SaveObject *pSoundEvent);
void DrawItem (LPDRAWITEMSTRUCT lpDIS);
};
/*===========================================================================
* Description: Class for the Dialog
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
class SECT_DialogSel : public CFormView
{
// Construction
protected:
Sector_Interface *m_pSectorInterface;
CPA_SuperObject *m_pSelectedSector;
CPA_SuperObject *m_pEditedSector;
char m_szName[256];
BOOL m_bInitialised;
public:
// standard constructor
SECT_DialogSel (CWnd* pParent = NULL);
// get functions
CPA_SuperObject * GetEditedSector (void) { return m_pEditedSector; }
CPA_SuperObject * GetSelectedSector (void) { return m_pSelectedSector; }
Sector_Interface * GetSectorInterface (void) { return m_pSectorInterface; }
// Dialog
void fn_vInitDialog (Sector_Interface *p_oDLL, CWnd *pParent);
void fn_vReinitDialog (CPA_SuperObject *pSector, CPA_SuperObject *pEditedSector);
void fn_vInitControls (BOOL bEnable);
void fn_vOnCheckList (CButton *pControl, tdeTypeList eType);
void fn_vUpdateCheck (void);
void fn_vInitSoundEventList (void);
void fn_vUpdateSoundEventList (SECT_SoundEventElement *pSoundEvent);
protected:
// Dialog Data
//{{AFX_DATA(SECT_DialogSel)
enum { IDD = SEC_IDD_DIALOGSELECT };
CButton m_cSymetric;
CComboBox m_cComboSector;
CButton m_cVirtual;
CButton m_cGraphic;
CSpinButtonCtrl m_cGraphicSpin;
CEdit m_cGraphicLevel;
CButton m_cGraphicMode;
CButton m_cCollision;
CButton m_cActivity;
CButton m_cSound;
CSpinButtonCtrl m_cSoundSpin;
CEdit m_cSoundLevel;
CButton m_cSoundEvent;
SECT_SndEvListBox m_cSoundEventList;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(SECT_DialogSel)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(SECT_DialogSel)
afx_msg void OnSelChangeComboSector();
afx_msg void OnSymetric();
afx_msg void OnGraphic();
afx_msg void OnGraphicSpin(NMHDR * pNMHDR, LRESULT * pResult);
afx_msg void OnGraphicMode();
afx_msg void OnCollision();
afx_msg void OnActivity();
afx_msg void OnSound();
afx_msg void OnSoundSpin(NMHDR * pNMHDR, LRESULT * pResult);
afx_msg void OnSoundEvent();
afx_msg void OnSelChangeSoundEventList(NMHDR * pNMHDR, LRESULT * pResult);
afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDIS);
afx_msg void OnSize(UINT, int, int);
afx_msg void OnDestroy();
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
BOOL OnCommand(WPARAM wParam, LPARAM lParam);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif //__SECT_D_SEL_HPP__

View File

@@ -0,0 +1,128 @@
/*=========================================================================
*
* SEClSrfs.hpp : class SECT_DialogSrf
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
/*
#ifndef __SECT_D_SRF_HPP__
#define __SECT_D_SRF_HPP__
#include "SECTres.h"
#include "SECTenv.hpp"
class Sector_Interface;
*/
//#################################################################################
// Surfaces
//#################################################################################
/*===========================================================================
* Description: Class for the Surface List Box
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
class SECT_SrfElemListBox : public SECT_EnvListBox
{
public:
SECT_SrfElemListBox (void);
~SECT_SrfElemListBox (void);
BOOL fn_bIsCurrentElement (CPA_BaseObject *pElem);
BOOL fn_bIsSelectedElement (CPA_BaseObject *pElem);
BOOL fn_bIsAlreadyUsed (CPA_BaseObject *pElem);
};
*/
/*===========================================================================
* Description: Class for the Environment Element
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
class SECT_DialogSrf : public CFormView
{
protected:
// dialog parameters
Sector_Interface *m_pSectorInterface;
SECT_SurfElem *m_pSurfElem;
SECT_Surface *m_pSurface;
BOOL m_bViewSurface;
BOOL m_bInitialised;
long m_lEnvElem;
public:
// standard constructor
SECT_DialogSrf (CWnd* pParent = NULL);
// Dialog
void fn_vInitDialog (Sector_Interface *pDLL, CWnd *pParent);
void fn_vReinitDialog (void);
void fn_vInitSurfListBox (void);
void fn_vInitEnvElem (long lEnvElem);
void fn_vSelectSurf (SECT_Surface *pSurface, BOOL bUpdateSurfElem = TRUE);
void fn_vInitControls (BOOL bEnable);
// Get Functions
SECT_SurfElem * GetCurrentSurfElem (void) { return m_pSurfElem; }
SECT_Surface * GetSelectedSurface (void) { return m_pSurface; }
protected:
// Dialog Data
//{{AFX_DATA(SECT_DialogSrf)
enum { IDD = SEC_IDD_DIALOGSRF };
// surf elem
SECT_SrfElemListBox m_cSurfListBox;
CButton m_cViewSurf;
CEdit m_cSurfHeight;
// default
CButton m_cDefault;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(SECT_DialogSrf)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(SECT_DialogSrf)
afx_msg void OnSize(UINT, int, int);
afx_msg void OnDestroy();
// surf elem
afx_msg void OnSelChangeSurfListBox(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDblClkSurfListBox(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnChangeHeight();
afx_msg void OnViewSurf();
// default
afx_msg void OnDefault();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif //__SECT_D_SRF_HPP__
*/

View File

@@ -0,0 +1,124 @@
/*=========================================================================
*
* SECTdVis.hpp : class SECT_DialogVis
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
/*
#ifndef __SECT_D_VIS_HPP__
#define __SECT_D_VIS_HPP__
#include "SECTres.h"
#include "SECTenv.hpp"
class Sector_Interface;
/===========================================================================
* Description: Class for the Dialog Visual Environment
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================/
class SECT_DialogVis : public CFormView
{
protected:
// dialog parameters
Sector_Interface *m_pSectorInterface;
SECT_VisEnvironment *m_pVisEnv;
SECT_VisEnvironment *m_pDefaultVisEnv;
BOOL m_bInitialised;
// visual environment parameters
CString m_csName;
MTH_tdxReal m_xNear;
MTH_tdxReal m_xFar;
MTH_tdxReal m_xBlendNear;
MTH_tdxReal m_xBlendFar;
MTH_tdxReal m_xInfinite;
COLORREF m_stColor;
public:
// standard constructor
SECT_DialogVis (CWnd* pParent = NULL);
// Dialog
void fn_vInitDialog (Sector_Interface *p_oDLL, CWnd *pParent);
void fn_vReinitDialog (void);
void fn_vInitControls (BOOL bEnable);
void fn_vInitVisEnvironment (SECT_VisEnvironment *pVisEnv, BOOL bEnable);
void fn_vUpdateSliders (void);
void fn_vUpdateColor (void);
protected:
// Dialog Data
//{{AFX_DATA(SECT_DialogVis)
enum { IDD = SEC_IDD_DIALOGVIS };
// name
CEdit m_cName;
CButton m_cDefault;
// save
CButton m_cCancel;
CButton m_cSave;
// parameters
CEdit m_cNear;
CEdit m_cFar;
CSliderCtrl m_cBlendNear;
CSliderCtrl m_cBlendFar;
CEdit m_cInfinite;
// color
CSliderCtrl m_cRSlider;
CSliderCtrl m_cGSlider;
CSliderCtrl m_cBSlider;
CButton m_cColor;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(SECT_DialogVis)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(SECT_DialogVis)
afx_msg void OnSize(UINT, int, int);
afx_msg void OnDestroy();
afx_msg void OnDrawItem (int nIDCtl, LPDRAWITEMSTRUCT lpDIS);
// save
afx_msg void OnSave();
afx_msg void OnCancel();
// name
afx_msg void OnChangeName();
afx_msg void OnDefault();
// parameters
afx_msg void OnChangeNear();
afx_msg void OnChangeFar();
afx_msg void OnChangeInfinite();
// color
afx_msg void OnVScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnHScroll (UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnEditColor ();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif //__SECT_D_VIS_HPP__
*/

View File

@@ -0,0 +1,275 @@
/*=========================================================================
*
* SECTlDias.hpp : lists & dialogs for sector links
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
#ifndef __SECT_L_DIAS_HPP__
#define __SECT_L_DIAS_HPP__
#include "SECTres.h"
class Sector_Interface;
class SECT_CustomListBox;
/*===========================================================================
* Description: Class for the dialogbox
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
class SECT_DialogBase : public CFormView
{
// Construction
protected:
Sector_Interface *m_pSectorInterface;
SECT_ElementBase *m_pSelectedElem;
SECT_ListBase *m_pSectorList;
tdeTypeList m_eType;
BOOL m_bShowListParams;
BOOL m_bInitialised;
public:
// standard constructor
SECT_DialogBase (CWnd* pParent = NULL);
// get functions
Sector_Interface * GetSectorInterface (void) { return m_pSectorInterface; }
SECT_ElementBase * GetSelectedElement (void) { return m_pSelectedElem; }
SECT_ListBase * GetListBase (void) { return m_pSectorList; }
tdeTypeList GetListType (void) { return m_eType; }
virtual SECT_CustomListBox * GetSectorList (void) { return NULL; }
// Dialog
void fn_vInitDialog (Sector_Interface *p_oDLL, CWnd *pParent, const CString csTag, BOOL bShowListParams = FALSE);
void fn_vReinitDialog (SECT_ListBase *pSectorList);
void fn_vUpdateSelection (CPA_SuperObject *pSector);
void fn_vInitSectorList (SECT_ListBase *pSectorList);
// custom
virtual void fn_vReinitListParams (void) { };
protected:
CPA_SuperObject * GetSectorFromName (char *szName);
// Dialog Data
//{{AFX_DATA(SECT_DialogBase)
enum { IDD = SEC_IDD_DIALOGBASE };
CButton m_cSymetric;
CListBox m_cListParams;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(SECT_DialogBase)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(SECT_DialogList)
afx_msg void OnSelchangeSectorList();
afx_msg void OnDblClkSectorList();
afx_msg void OnSymetric();
afx_msg void OnSize(UINT, int, int);
afx_msg void OnDestroy();
afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDIS);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//#################################################################################
// SortedListBox
//#################################################################################
class SECT_CustomListBox : public CListBox
{
protected:
SECT_DialogBase *m_pDialog;
Sector_Interface *m_pSectorInterface;
public:
SECT_CustomListBox();
~SECT_CustomListBox() { }
void fn_vInitDialogParameters (SECT_DialogBase *pDialogList);
void fn_vInitSectorList (SECT_ListBase *pSectorList);
int GetCorrespondingIndex (DWORD pElem);
virtual void fn_vDrawListItem (int nIDCtl, LPDRAWITEMSTRUCT lpDIS) { }
afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
afx_msg void OnRButtonDown(UINT nFlags, CPoint point);
BOOL OnCommand(WPARAM wParam, LPARAM lParam);
DECLARE_MESSAGE_MAP()
};
//#################################################################################
// ACTIVITY
//#################################################################################
class SECT_ActivityListBox : public SECT_CustomListBox
{
public:
SECT_ActivityListBox() { }
~SECT_ActivityListBox() { }
void fn_vDrawListItem (int nIDCtl, LPDRAWITEMSTRUCT lpDIS);
};
/*===========================================================================
*=========================================================================*/
class SECT_DialogActiv : public SECT_DialogBase
{
protected:
SECT_ActivityListBox m_cSectorList;
public:
SECT_DialogActiv (CWnd* pParent = NULL);
~SECT_DialogActiv() { }
SECT_CustomListBox * GetSectorList (void) { return &m_cSectorList; }
protected:
void DoDataExchange (CDataExchange* pDX);
};
//#################################################################################
// COLLISION
//#################################################################################
class SECT_CollisionListBox : public SECT_CustomListBox
{
public:
SECT_CollisionListBox() { }
~SECT_CollisionListBox() { }
void fn_vDrawListItem (int nIDCtl, LPDRAWITEMSTRUCT lpDIS);
};
/*===========================================================================
*=========================================================================*/
class SECT_DialogColls : public SECT_DialogBase
{
protected:
SECT_CollisionListBox m_cSectorList;
public:
SECT_DialogColls (CWnd* pParent = NULL);
~SECT_DialogColls() { }
SECT_CustomListBox * GetSectorList (void) { return &m_cSectorList; }
protected:
void DoDataExchange (CDataExchange* pDX);
};
//#################################################################################
// GRAPHIC
//#################################################################################
class SECT_GraphicListBox : public SECT_CustomListBox
{
public:
SECT_GraphicListBox() { }
~SECT_GraphicListBox() { }
void fn_vDrawListItem (int nIDCtl, LPDRAWITEMSTRUCT lpDIS);
};
/*===========================================================================
*=========================================================================*/
class SECT_DialogGraph : public SECT_DialogBase
{
protected:
SECT_GraphicListBox m_cSectorList;
public:
SECT_DialogGraph (CWnd* pParent = NULL);
~SECT_DialogGraph() { }
SECT_CustomListBox * GetSectorList (void) { return &m_cSectorList; }
protected:
void DoDataExchange (CDataExchange* pDX);
};
//#################################################################################
// SOUND
//#################################################################################
class SECT_SoundListBox : public SECT_CustomListBox
{
public:
SECT_SoundListBox() { }
~SECT_SoundListBox() { }
void fn_vDrawListItem (int nIDCtl, LPDRAWITEMSTRUCT lpDIS);
};
/*===========================================================================
*=========================================================================*/
class SECT_DialogSound : public SECT_DialogBase
{
protected:
SECT_SoundListBox m_cSectorList;
public:
SECT_DialogSound (CWnd* pParent = NULL);
~SECT_DialogSound() { }
SECT_CustomListBox * GetSectorList (void) { return &m_cSectorList; }
protected:
void DoDataExchange (CDataExchange* pDX);
};
//#################################################################################
// SOUND EVENT
//#################################################################################
class SECT_SoundEventListBox : public SECT_CustomListBox
{
public:
SECT_SoundEventListBox() { }
~SECT_SoundEventListBox() { }
void fn_vDrawListItem (int nIDCtl, LPDRAWITEMSTRUCT lpDIS);
};
/*===========================================================================
*=========================================================================*/
class SECT_DialogSoundEvent : public SECT_DialogBase
{
protected:
SECT_SoundEventListBox m_cSectorList;
public:
SECT_DialogSoundEvent (CWnd* pParent = NULL);
~SECT_DialogSoundEvent() { }
SECT_CustomListBox * GetSectorList (void) { return &m_cSectorList; }
void fn_vReinitListParams (void);
protected:
void DoDataExchange (CDataExchange* pDX);
};
#endif //__SECT_L_DIAS_HPP__

View File

@@ -0,0 +1,108 @@
/*=========================================================================
*
* SEClEnvs.hpp : class SECT_DialogEnvList
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
/*
#ifndef __SECT_L_ENV_HPP__
#define __SECT_L_ENV_HPP__
#include "SECTres.h"
#include "SECTenv.hpp"
class Sector_Interface;
*/
//#################################################################################
// Environment List
//#################################################################################
/*===========================================================================
* Description: Class for the Environment List
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
class SECT_DialogEnvList : public CFormView
{
protected:
// dialog parameters
Sector_Interface *m_pSectorInterface;
CPA_SuperObject *m_pEditedSector;
long m_lEnvElem;
BOOL m_bInitialised;
public:
// standard constructor
SECT_DialogEnvList (CWnd* pParent = NULL);
// Dialog
void fn_vInitDialog (Sector_Interface *pDLL, CWnd *pParent);
void fn_vInitEnvList (CPA_SuperObject *pEditedSector);
void fn_vInitEnvElem (long lEnvElem);
void fn_vUpdateEnvElem (void);
void fn_vInitControls (BOOL bEnable);
void fn_vDrawEnvListItem (int nIDCtl, LPDRAWITEMSTRUCT lpDIS);
protected:
// Dialog Data
//{{AFX_DATA(SECT_DialogEnvList)
enum { IDD = SEC_IDD_DIALOGENVLIST };
// env list
CListBox m_cEnvList;
CButton m_cAddElem;
CButton m_cDelElem;
// apply
CButton m_cApplyAll;
CButton m_cApplySelect;
CButton m_cCancelSelect;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(SECT_DialogEnvList)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(SECT_DialogEnvList)
afx_msg void OnSize(UINT, int, int);
afx_msg void OnDestroy();
afx_msg void OnDrawItem(int nIDCtl, LPDRAWITEMSTRUCT lpDIS);
// env list
afx_msg void OnSelChangeEnvList();
afx_msg void OnAddElem();
afx_msg void OnDelElem();
// keydown
afx_msg int OnVKeyToItem (UINT, CWnd*, UINT);
// apply
afx_msg void OnApplyAll();
afx_msg void OnApplySelect();
afx_msg void OnCancelSelect();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#endif //__SECT_L_ENV_HPP__
*/

View File

@@ -0,0 +1,815 @@
/*=========================================================================
*
* SECmodif.hpp : Definition of Editor Modifications
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
#ifndef __SECT_MODIF_HPP__
#define __SECT_MODIF_HPP__
#include "incITF.h"
#include "incGAM.h"
//**************************************
#ifndef CPA_EXPORT
#if defined(CPA_WANTS_IMPORT)
#define CPA_EXPORT __declspec(dllimport)
#elif defined(CPA_WANTS_EXPORT)
#define CPA_EXPORT __declspec(dllexport)
#else
#define CPA_EXPORT
#endif
#endif
//**************************************
#include "SECTint.hpp"
#define TYPE_SECTORLINKS 1
#define TYPE_SECTORPARAMS 2
//Shaitan Clean Env
/*
#define TYPE_ENVANDSRF 3
#define TYPE_MODIFENV 4
#define TYPE_MODIFSRF 5
#define TYPE_SRFPARAMS 6
#define TYPE_ENVPARAMS 7
#define TYPE_MECENV 8
#define TYPE_APPLY 9
*/
#define TYPE_SYMETRICLINKS 10
#define TYPE_SYMETRICSELECT 11
#define TYPE_VIRTUALSTATUS 12
#define TYPE_FULLLINK 13
//Shaitan Clean Env
//#define TYPE_REPLACE 14
#define TYPE_COPYLIST 15
typedef enum
{
// sector links
E_mt_AddSectorInList,
E_mt_DelSectorInList,
E_mt_AddFullLink,
E_mt_DelFullLink,
// sector params
E_mt_ChangeLevelOfDetail,
E_mt_ChangeGraphicMode,
E_mt_ChangeSoundVolume,
E_mt_AddSoundEvent,
E_mt_DelSoundEvent,
//Shaitan Clean Env
/*
// env and srf
E_mt_AddEnvAndSrf,
E_mt_DelEnvAndSrf,
E_mt_ChangeEnv,
E_mt_ChangeSrf,
// srf params
E_mt_ChangeSrfHeight,
// env params
E_mt_ChangeMecEnv,
E_mt_ChangeVisEnv,
E_mt_ChangeSndEnv,
// mec env
E_tm_ModifMecEnv,
// vis env
E_tm_ModifVisEnv,
// apply to sector
E_tm_ApplyToSectors,
*/
// symetric links
E_tm_SymetricLinks,
E_tm_SymetricSelect,
// virtual status
E_tm_VirtualStatus,
//Shaitan Clean Env
// replace env
// E_tm_Replace,
E_tm_CopyList,
// unknown
E_tm_Unknown
}
tdeSectModifType;
//#################################################################################
// SECTORS LINK
//#################################################################################
/*===========================================================================
* Description: save sector links
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
class SECT_SaveSectorLinks : public CObject
{
public:
Sector_Object *m_pSector;
SECT_ElementBase *m_pNewElement;
SECT_ElementBase *m_pOldElement;
int m_iNewParam;
int m_iOldParam;
int m_iNewMode;
int m_iOldMode;
SECT_SaveSectorLinks (CPA_SuperObject *pSector, CPA_SuperObject *pModel, tdeTypeList eList);
~SECT_SaveSectorLinks ();
};
/*===========================================================================
* Description: Add or remove sector in sector links
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
class SECT_ModifSectorLinks : public CPA_Modif
{
protected:
Sector_Interface *m_pSectorInterface;
SECT_ElementBase * m_aElements[C_NumberOfLists];
SECT_ElementBase * m_aSymElems[C_NumberOfLists];
CPA_SuperObject *m_pEditedSector;
CPA_SuperObject *m_pSectorToAdd;
tdeSectModifType m_eModifType;
tdeEditMode m_eCurrentEditMode;
BOOL m_bSymetric;
BOOL m_aHadSymElem[C_NumberOfLists];
BOOL m_bFirstTime;
BOOL m_bAdded;
BOOL m_bDone;
public:
// constructors
SECT_ModifSectorLinks (Sector_Interface *pInterface, tdeSectModifType eModifType,
CPA_SuperObject *pEditedSector, CPA_SuperObject *pSectorToAdd,
tdeTypeList eTypeList);
~SECT_ModifSectorLinks (void);
// actions
BOOL Do (void);
BOOL Undo (void);
// functions
void fn_vInitSymetricLinks (void);
void fn_vUpdateSymetricLinks (BOOL bDo);
void fn_vReinitEditorState (void);
void fn_vUpdateEditorState (void);
};
/*===========================================================================
* Description: save sector links
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
class SECT_SaveFullLink : public CObject
{
public:
Sector_Object *m_pSector;
SECT_ElementBase *m_pElement;
tdeTypeList m_eListToUpdate;
SECT_SaveFullLink (Sector_Object *pSector, SECT_ElementBase *pElement, tdeTypeList eList);
~SECT_SaveFullLink ();
};
/*===========================================================================
* Description: Add or remove sector in sector links
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
class SECT_ModifFullLink : public CPA_Modif
{
protected:
Sector_Interface *m_pSectorInterface;
CPA_SuperObject *m_pEditedSector;
tdeTypeList m_eListToUpdate;
tdeSectModifType m_eModifType;
BOOL m_bSymetric;
BOOL m_bFirstTime;
BOOL m_bAdded;
BOOL m_bDone;
CPA_List<SECT_ElementBase> m_oListOfSectors;
CPA_List<SECT_SaveFullLink> m_oListOfSymetrics;
public:
// constructors
SECT_ModifFullLink (Sector_Interface *pInterface, tdeSectModifType eModifType,
CPA_SuperObject *pEditedSector, tdeTypeList eTypeList);
~SECT_ModifFullLink (void);
// actions
BOOL Do (void);
BOOL Undo (void);
// functions
void fn_vInitSymetricLinks (void);
void fn_vUpdateSymetricLinks (BOOL bDo);
void fn_vReinitEditorState (void);
void fn_vUpdateEditorState (void);
};
/*===========================================================================
* Description: modify parameter in sector links
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
class SECT_ModifSectorParams : public CPA_Modif
{
protected:
Sector_Interface *m_pSectorInterface;
SECT_ElementBase *m_pElementToUpdate;
CPA_SuperObject *m_pEditedSector, *m_pSelectedSector;
SECT_SoundEvent *m_pSoundEvent;
tdeSectModifType m_eModifType;
tdeTypeList m_eListToUpdate;
int m_iNewValue, m_iOldValue, m_iOldSymetric;
BOOL m_bSymetricLink;
BOOL m_bFirstTime;
BOOL m_bDone;
public:
// constructors
SECT_ModifSectorParams (Sector_Interface *pInterface, tdeSectModifType eModifType,
tdeTypeList eListToUpdate, SECT_ElementBase *pElem,
int iNewValue, SECT_SoundEvent *pSoundEvent);
~SECT_ModifSectorParams (void);
// actions
BOOL Do (void);
BOOL Undo (void);
// functions
void fn_vReinitEditorState (void);
void fn_vUpdateEditorState (void);
};
//#################################################################################
// ENV AND SRF
//#################################################################################
/*===========================================================================
* Description: add or remove environment element
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
class SECT_ModifEnvAndSrf : public CPA_Modif
{
protected:
Sector_Interface *m_pSectorInterface;
CPA_SuperObject *m_pEditedSector;
SECT_SurfElem *m_pNewSurfElem, *m_pOldSurfElem;
SECT_EnvElem *m_pNewEnvElem, *m_pOldEnvElem;
tdeSectModifType m_eModifType;
BOOL m_bFirstTime;
BOOL m_bDone;
public:
// constructors
SECT_ModifEnvAndSrf (Sector_Interface *pInterface, tdeSectModifType eModifType,
CPA_SuperObject *pEditedSector, long lNumEnvElem,
SECT_Environment *pNewEnv, SECT_Surface *pNewSurf);
~SECT_ModifEnvAndSrf (void);
// actions
BOOL Do (void);
BOOL Undo (void);
// functions
void fn_vReinitEditorState (void);
void fn_vUpdateEditorState (void);
};
*/
/*===========================================================================
* Description: change environment element
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
{
protected:
Sector_Interface *m_pSectorInterface;
SECT_Environment *m_pNewEnv, *m_pOldEnv;
CPA_SuperObject *m_pEditedSector;
SECT_EnvElem *m_pEnvElem;
tdeSectModifType m_eModifType;
BOOL m_bFirstTime;
BOOL m_bDone;
long m_lNumEnvElem;
public:
// constructors
SECT_ModifEnvElem (Sector_Interface *pInterface, tdeSectModifType eModifType,
SECT_EnvElem *pEnvElem, SECT_Environment *pNewEnv, long lNumEnvElem);
~SECT_ModifEnvElem (void);
// actions
BOOL Do (void);
BOOL Undo (void);
// functions
void fn_vReinitEditorState (void);
void fn_vUpdateEditorState (void);
};
*/
/*===========================================================================
* Description: change surface element
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
class SECT_ModifSurfElem : public CPA_Modif
{
protected:
Sector_Interface *m_pSectorInterface;
CPA_SuperObject *m_pEditedSector;
SECT_SurfElem *m_pSurfElem;
SECT_Surface *m_pNewSurf, *m_pOldSurf;
tdeSectModifType m_eModifType;
BOOL m_bFirstTime;
BOOL m_bDone;
long m_lOldNum, m_lNewNum;
public:
// constructors
SECT_ModifSurfElem (Sector_Interface *pInterface, tdeSectModifType eModifType,
SECT_SurfElem *pSurfElem, SECT_Surface *pNewSurf, long lNumEnvElem);
~SECT_ModifSurfElem (void);
// actions
BOOL Do (void);
BOOL Undo (void);
// functions
void fn_vReinitEditorState (void);
void fn_vUpdateEditorState (void);
};
*/
//#################################################################################
// SURFACE
//#################################################################################
/*===========================================================================
* Description: modify surface parameters
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
class SECT_ModifSrfParams : public CPA_Modif
{
protected:
Sector_Interface *m_pSectorInterface;
tdeSectModifType m_eModifType;
SECT_Surface *m_pSurface;
MTH_tdxReal m_xNewHeight, m_xOldHeight;
BOOL m_bFirstTime;
BOOL m_bDone;
public:
// constructors
SECT_ModifSrfParams (Sector_Interface *pInterface, tdeSectModifType eModifType,
SECT_Surface *pSurface, MTH_tdxReal xNewHeight);
~SECT_ModifSrfParams (void);
// actions
BOOL Do (void);
BOOL Undo (void);
// functions
void fn_vReinitEditorState (void);
void fn_vUpdateEditorState (void);
};
*/
//#################################################################################
// ENVIRONMENT
//#################################################################################
/*===========================================================================
* Description: modify environment parameters
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
class SECT_ModifEnvParams : public CPA_Modif
{
protected:
Sector_Interface *m_pSectorInterface;
SECT_Environment *m_pEnvironment;
SECT_MecEnvironment *m_pNewMecEnv, *m_pOldMecEnv;
SECT_VisEnvironment *m_pNewVisEnv, *m_pOldVisEnv;
SECT_SndEnvironment *m_pNewSndEnv, *m_pOldSndEnv;
tdeSectModifType m_eModifType;
BOOL m_bFirstTime;
BOOL m_bDone;
public:
// constructors
SECT_ModifEnvParams (Sector_Interface *pInterface, tdeSectModifType eModifType,
SECT_Environment *pEnvironment, SECT_MecEnvironment *pNewMecEnv,
SECT_VisEnvironment *pNewVisEnv, SECT_SndEnvironment *pNewSndEnv);
~SECT_ModifEnvParams (void);
// actions
BOOL Do (void);
BOOL Undo (void);
// functions
void fn_vReinitEditorState (void);
void fn_vUpdateEditorState (void);
};
*/
/*===========================================================================
* Description: modify mechanic environment parameters
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
class SECT_ModifMecEnvParams : public CPA_Modif
{
protected:
Sector_Interface *m_pSectorInterface;
SECT_MecEnvironment *m_pMecEnv;
tdeSectModifType m_eModifType;
BOOL m_bFirstTime;
BOOL m_bDone;
CString m_csNewName, m_csOldName;
MTH_tdxReal m_xNewGravity, m_xOldGravity;
DNM_tdstVector m_stNewVertical, m_stOldVertical;
MTH_tdxReal m_xNewViscosity, m_xOldViscosity;
MTH_tdxReal m_xNewDensity, m_xOldDensity;
MTH_tdxReal m_xNewLevel, m_xOldLevel;
DNM_tdstVector m_stNewStream, m_stOldStream;
CString m_csNewVolumic, m_csOldVolumic;
public:
// constructors
SECT_ModifMecEnvParams (Sector_Interface *pInterface, tdeSectModifType eModifType,
SECT_MecEnvironment *pMecEnv, CString csName,
MTH_tdxReal xGravity, DNM_tdstVector *pVertical,
MTH_tdxReal xViscosity, MTH_tdxReal xDensity,
MTH_tdxReal xLevel, DNM_tdstVector *pStream,
CString csVolumic);
~SECT_ModifMecEnvParams (void);
// actions
BOOL Do (void);
BOOL Undo (void);
// functions
void fn_vReinitEditorState (void);
void fn_vUpdateEditorState (void);
};
*/
/*===========================================================================
* Description: modify visual environment parameters
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
class SECT_ModifVisEnvParams : public CPA_Modif
{
protected:
Sector_Interface *m_pSectorInterface;
SECT_VisEnvironment *m_pVisEnv;
tdeSectModifType m_eModifType;
BOOL m_bFirstTime;
BOOL m_bDone;
CString m_csNewName, m_csOldName;
MTH_tdxReal m_xNewNear, m_xOldNear;
MTH_tdxReal m_xNewFar, m_xOldFar;
MTH_tdxReal m_xNewBlendNear, m_xOldBlendNear;
MTH_tdxReal m_xNewBlendFar, m_xOldBlendFar;
MTH_tdxReal m_xNewInfinite, m_xOldInfinite;
GLI_tdstColor m_stNewColor, m_stOldColor;
public:
// constructors
SECT_ModifVisEnvParams (Sector_Interface *pInterface, tdeSectModifType eModifType,
SECT_VisEnvironment *pVisEnv, CString csName,
MTH_tdxReal xNear, MTH_tdxReal xFar,
MTH_tdxReal xBlendNear, MTH_tdxReal xBlendFar,
MTH_tdxReal xInfinite, GLI_tdstColor *pColor);
~SECT_ModifVisEnvParams (void);
// actions
BOOL Do (void);
BOOL Undo (void);
// functions
void fn_vReinitEditorState (void);
void fn_vUpdateEditorState (void);
};
*/
//#################################################################################
// APPLY
//#################################################################################
/*===========================================================================
* Description: save env lists
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
class SECT_SaveEnvList : public CObject
{
public:
Sector_Object *m_pSector;
CPA_List<SECT_Surface> m_oListSrf;
CPA_List<SECT_Environment> m_oListEnv;
SECT_SaveEnvList (Sector_Object *pSector);
~SECT_SaveEnvList ();
};
*/
/*===========================================================================
* Description: apply envlist to sectors
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
class SECT_ModifApplyToSectors : public CPA_Modif
{
protected:
Sector_Interface *m_pSectorInterface;
CPA_SuperObject *m_pModel;
CPA_List<SECT_Surface> m_oListSrf;
CPA_List<SECT_Environment> m_oListEnv;
CPA_List<SECT_SaveEnvList> m_oListSectors;
tdeSectModifType m_eModifType;
BOOL m_bFirstTime;
BOOL m_bDone;
public:
// constructors
SECT_ModifApplyToSectors (Sector_Interface *pInterface, tdeSectModifType eModifType,
CPA_SuperObject *pModel, CPA_List<CPA_SuperObject> *pListSectors);
~SECT_ModifApplyToSectors (void);
// actions
BOOL Do (void);
BOOL Undo (void);
// functions
void fn_vReinitEditorState (void);
void fn_vUpdateEditorState (void);
};
*/
//#################################################################################
// SYMETRIC
//#################################################################################
/*===========================================================================
* Description: apply symetric links to sectors
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
class SECT_ModifSymetricLinks : public CPA_Modif
{
protected:
CPA_List<SECT_SaveSectorLinks> m_oListSectors;
Sector_Interface *m_pSectorInterface;
tdeSectModifType m_eModifType;
CPA_SuperObject *m_pModel;
tdeTypeList m_eListToUpdate;
tdeEditMode m_eCurrentEditMode;
BOOL m_bFirstTime;
BOOL m_bDone;
public:
// constructors
SECT_ModifSymetricLinks (Sector_Interface *pInterface, tdeSectModifType eModifType,
CPA_SuperObject *pModel, tdeTypeList eList);
~SECT_ModifSymetricLinks (void);
// actions
BOOL Do (void);
BOOL Undo (void);
// functions
void fn_vReinitEditorState (void);
void fn_vUpdateEditorState (void);
};
/*===========================================================================
* Description: apply symetric links to sectors
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
class SECT_ModifSymetricSelect : public CPA_Modif
{
protected:
Sector_Interface *m_pSectorInterface;
CPA_SuperObject *m_pEditedSector;
CPA_SuperObject *m_pSelectedSector;
tdeSectModifType m_eModifType;
BOOL m_bFirstTime;
BOOL m_bDone;
SECT_SoundElement *m_pNewSoundElement;
SECT_GraphicElement *m_pNewGraphicElement;
SECT_ActivityElement *m_pNewActivityElement;
SECT_CollisionElement *m_pNewCollisionElement;
SECT_SoundEventElement *m_pNewSndEvtElement;
SECT_SoundEventElement *m_pOldSndEvtElement;
int m_iOldGraphic, m_iNewGraphic;
int m_iOldGMode, m_iNewGMode;
int m_iOldSound, m_iNewSound;
public:
// constructors
SECT_ModifSymetricSelect (Sector_Interface *pInterface, tdeSectModifType eModifType,
CPA_SuperObject *pEditedSector, CPA_SuperObject *pSelectedSector);
~SECT_ModifSymetricSelect (void);
// actions
BOOL Do (void);
BOOL Undo (void);
// functions
void fn_vReinitEditorState (void);
void fn_vUpdateEditorState (void);
};
//#################################################################################
// VIRTUAL
//#################################################################################
/*===========================================================================
* Description: update virtual sector
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
class SECT_ModifVirtualSector : public CPA_Modif
{
protected:
Sector_Interface *m_pSectorInterface;
CPA_SuperObject *m_pEditedSector;
CPA_SuperObject *m_pBorder;
tdeSectModifType m_eModifType;
BOOL m_bNewStatus;
BOOL m_bFirstTime;
BOOL m_bDone;
public:
//constructors
SECT_ModifVirtualSector (Sector_Interface *pInterface, tdeSectModifType eModifType,
CPA_SuperObject *pEditedSector, BOOL bNewState);
~SECT_ModifVirtualSector (void);
// actions
BOOL Do (void);
BOOL Undo (void);
// functions
void fn_vReinitEditorState (void);
void fn_vUpdateEditorState (void);
};
//#################################################################################
// REPLACE
//#################################################################################
//#define C_lMaxEnvironments 20
/*===========================================================================
* Description: save initial sector
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
class SECT_SaveInitEnv: public CObject
{
public:
Sector_Object *m_pSector;
long m_aNumEnv[C_lMaxEnvironments];
long m_lNbEnv;
SECT_SaveInitEnv (Sector_Object *pSector, SECT_Environment *pInitEnv);
~SECT_SaveInitEnv ();
};
*/
/*===========================================================================
* Description: apply envlist to sectors
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
class SECT_ModifReplaceEnvironment : public CPA_Modif
{
protected:
Sector_Interface *m_pSectorInterface;
CPA_SuperObject *m_pEditedSector;
SECT_Environment *m_pInitEnv;
SECT_Environment *m_pNewEnv;
CPA_List<SECT_SaveInitEnv> m_oListSectors;
tdeSectModifType m_eModifType;
BOOL m_bFirstTime;
BOOL m_bDone;
public:
// constructors
SECT_ModifReplaceEnvironment (Sector_Interface *pInterface, tdeSectModifType eModifType,
SECT_Environment *pInitEnv, SECT_Environment *pNewEnv,
CPA_List<CPA_SuperObject> *pListSectors);
~SECT_ModifReplaceEnvironment (void);
// actions
BOOL Do (void);
BOOL Undo (void);
// functions
void fn_vReinitEditorState (void);
void fn_vUpdateEditorState (void);
};
*/
//#################################################################################
// COPY LIST
//#################################################################################
/*===========================================================================
* Description: apply envlist to sectors
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
class SECT_ModifCopyList : public CPA_Modif
{
protected:
Sector_Interface *m_pSectorInterface;
CPA_SuperObject *m_pEditedSector;
tdeSectModifType m_eModifType;
tdeEditMode m_eCurrentEditMode;
BOOL m_bSymetric;
BOOL m_bFirstTime;
BOOL m_bDone;
CPA_List<SECT_ElementBase> m_aListOfElements[C_NumberOfLists];
CPA_List<SECT_ElementBase> m_aListOfSymElems[C_NumberOfLists];
public:
// constructors
SECT_ModifCopyList (Sector_Interface *pInterface, tdeSectModifType eModifType,
CPA_List<CPA_SuperObject> *pCopyOfSectorList, tdeTypeList eList);
~SECT_ModifCopyList(void);
// actions
BOOL Do (void);
BOOL Undo (void);
// functions
void fn_vReinitEditorState (void);
void fn_vUpdateEditorState (void);
};
#endif //__SECT_MODIF_HPP__

View File

@@ -0,0 +1,18 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#ifndef __STDAAFX_H__
#define __STDAAFX_H__
#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_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows 95 Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#endif //__STDAAFX_H__

View File

@@ -0,0 +1,215 @@
# Microsoft Developer Studio Project File - Name="OSC" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 5.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
CFG=OSC - Win32 Debug Glide with Editors
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "Osc.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "Osc.mak" CFG="OSC - Win32 Debug Glide with Editors"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "OSC - Win32 Debug Glide with Editors" (based on\
"Win32 (x86) Dynamic-Link Library")
!MESSAGE
# Begin Project
# PROP Scc_ProjName ""$/CPA/TempGrp/osc", WEGAAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug Glide with Editors"
# PROP BASE Intermediate_Dir "Debug Glide with Editors"
# PROP BASE Target_Dir ""
# PROP Use_MFC 2
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "x:\CPA\EXE\main\EDT_Data\Objects"
# PROP Intermediate_Dir "tmp\oscdfevd"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /MD /W3 /GX /Z7 /Od /I "X:\CPA\Public" /I "X:\CPA\TempGrp\SCT" /I "inc" /I "res" /D "CPA_WANTS_IMPORT" /D "ACTIVE_EDITOR" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "CPA_VISUAL" /D "CPA_DEBUG" /D "_WINDLL" /D "_AFXDLL" /D "USE_ALTIMAPS" /YX /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32
# ADD BASE RSC /l 0x40c /d "_DEBUG"
# ADD RSC /l 0x40c /d "_DEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /subsystem:windows /dll /debug /machine:I386 /nodefaultlib:"msvcrtd.lib" /out:"x:\CPA\EXE\main\EDT_Data\Objects/OSCDFEvd.dll" /pdbtype:sept
# SUBTRACT LINK32 /pdb:none
# Begin Target
# Name "OSC - Win32 Debug Glide with Editors"
# Begin Group "Source Files"
# PROP Default_Filter "cpp"
# Begin Source File
SOURCE=.\Src\_object.def
# End Source File
# Begin Source File
SOURCE=.\Src\DLLCom.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\SECdDist.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\SECdEdit.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\SECdMode.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\SECdSel.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\SEClDias.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\SECmodif.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\SECTelem.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\SECTint.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\SECTlist.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\SECTobj.cpp
# End Source File
# Begin Source File
SOURCE=.\Src\StdAfx.cpp
# End Source File
# End Group
# Begin Group "Include Files"
# PROP Default_Filter "h,hpp"
# Begin Source File
SOURCE=.\Inc\SECdDist.hpp
# End Source File
# Begin Source File
SOURCE=.\Inc\SECdEdit.hpp
# End Source File
# Begin Source File
SOURCE=.\Inc\SECdMode.hpp
# End Source File
# Begin Source File
SOURCE=.\Inc\SECdSel.hpp
# End Source File
# Begin Source File
SOURCE=.\Inc\SEClDias.hpp
# End Source File
# Begin Source File
SOURCE=.\Inc\SECmodif.hpp
# End Source File
# Begin Source File
SOURCE=.\Inc\SECTelem.hpp
# End Source File
# Begin Source File
SOURCE=.\Inc\SECTint.hpp
# End Source File
# Begin Source File
SOURCE=.\Inc\SECTlist.hpp
# End Source File
# Begin Source File
SOURCE=.\Inc\SECTobj.hpp
# End Source File
# Begin Source File
SOURCE=.\Inc\StdAfx.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\Res\osc_dlgb.ico
# End Source File
# Begin Source File
SOURCE=.\Res\SECiSect.ico
# End Source File
# Begin Source File
SOURCE=.\Res\SECiVirt.ico
# End Source File
# Begin Source File
SOURCE=.\Res\SECTres.h
# End Source File
# Begin Source File
SOURCE=.\Res\SECTres.rc
# End Source File
# End Group
# Begin Group "others"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Exe\Main\EDT_Data\Objects\Sector\Sector.cnt
# End Source File
# Begin Source File
SOURCE=..\..\Exe\Main\EDT_Data\Objects\Sector\SECTOR.HLP
# End Source File
# Begin Source File
SOURCE=..\..\Exe\Main\EDT_Data\Objects\Sector\Sectors.ini
# End Source File
# End Group
# Begin Group "libs debug"
# PROP Default_Filter ""
# Begin Source File
SOURCE=..\..\Exe\Main\MaiDFEvd.lib
# End Source File
# Begin Source File
SOURCE=..\..\Exe\Main\EDT_Data\Objects\OGDDFEvd.lib
# End Source File
# End Group
# End Target
# End Project

View File

@@ -0,0 +1,306 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="OSC"
ProjectGUID="{1F3B7C27-27E4-47E4-8A91-EA98A1A0E91D}"
SccProjectName="&quot;$/CPA/TempGrp/osc&quot;, WEGAAAAA"
SccAuxPath=""
SccLocalPath="."
SccProvider="MSSCCI:NXN alienbrain"
Keyword="MFCProj">
<Platforms>
<Platform
Name="Win32"/>
</Platforms>
<Configurations>
<Configuration
Name="Debug Glide with Editors|Win32"
OutputDirectory="x:\CPA\EXE\main\EDT_Data\Objects"
IntermediateDirectory=".\tmp\oscdfevd"
ConfigurationType="2"
UseOfMFC="2"
ATLMinimizesCRunTimeLibraryUsage="FALSE">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="X:\CPA\Public,X:\CPA\TempGrp\SCT,inc,res"
PreprocessorDefinitions="CPA_WANTS_IMPORT;ACTIVE_EDITOR;WIN32;_DEBUG;_WINDOWS;CPA_VISUAL;CPA_DEBUG;USE_ALTIMAPS"
RuntimeLibrary="3"
UsePrecompiledHeader="2"
PrecompiledHeaderFile=".\tmp\oscdfevd/OSC.pch"
AssemblerListingLocation=".\tmp\oscdfevd/"
ObjectFile=".\tmp\oscdfevd/"
ProgramDataBaseFileName=".\tmp\oscdfevd/"
WarningLevel="3"
SuppressStartupBanner="TRUE"
DebugInformationFormat="1"
CompileAs="0"/>
<Tool
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="maidfevd.lib ogddfevd.lib"
OutputFile="x:\CPA\EXE\main\EDT_Data\Objects/OSCDFEvd.dll"
LinkIncremental="1"
SuppressStartupBanner="TRUE"
AdditionalLibraryDirectories="X:\cpa\exe\main\edt_data\objects;X:\cpa\exe\main\edt_data;X:\cpa\exe\main;X:\cpa\libd"
IgnoreDefaultLibraryNames=""
ModuleDefinitionFile=".\Src\_object.def"
GenerateDebugInformation="TRUE"
ProgramDatabaseFile="x:\CPA\EXE\main\EDT_Data\Objects/OSCDFEvd.pdb"
SubSystem="2"
ImportLibrary="x:\CPA\EXE\main\EDT_Data\Objects/OSCDFEvd.lib"
TargetMachine="1"/>
<Tool
Name="VCMIDLTool"
PreprocessorDefinitions="_DEBUG"
MkTypLibCompatible="TRUE"
SuppressStartupBanner="TRUE"
TargetEnvironment="1"
TypeLibraryName="x:\CPA\EXE\main\EDT_Data\Objects/OSC.tlb"
HeaderFileName=""/>
<Tool
Name="VCPostBuildEventTool"/>
<Tool
Name="VCPreBuildEventTool"/>
<Tool
Name="VCPreLinkEventTool"/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1036"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp">
<File
RelativePath="Src\_object.def">
</File>
<File
RelativePath="Src\DLLCom.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="Src\SECdDist.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="Src\SECdEdit.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="Src\SECdMode.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="Src\SECdSel.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="Src\SEClDias.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="Src\SECmodif.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="Src\SECTelem.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="Src\SECTint.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="Src\SECTlist.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="Src\SECTobj.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
<File
RelativePath="Src\StdAfx.cpp">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="Include Files"
Filter="h,hpp">
<File
RelativePath="Inc\SECdDist.hpp">
</File>
<File
RelativePath="Inc\SECdEdit.hpp">
</File>
<File
RelativePath="Inc\SECdMode.hpp">
</File>
<File
RelativePath="Inc\SECdSel.hpp">
</File>
<File
RelativePath="Inc\SEClDias.hpp">
</File>
<File
RelativePath="Inc\SECmodif.hpp">
</File>
<File
RelativePath="Inc\SECTelem.hpp">
</File>
<File
RelativePath="Inc\SECTint.hpp">
</File>
<File
RelativePath="Inc\SECTlist.hpp">
</File>
<File
RelativePath="Inc\SECTobj.hpp">
</File>
<File
RelativePath="Inc\StdAfx.h">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="">
<File
RelativePath="Res\osc_dlgb.ico">
</File>
<File
RelativePath="Res\SECiSect.ico">
</File>
<File
RelativePath="Res\SECiVirt.ico">
</File>
<File
RelativePath="Res\SECTres.h">
</File>
<File
RelativePath="Res\SECTres.rc">
<FileConfiguration
Name="Debug Glide with Editors|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions=""
AdditionalIncludeDirectories="Res"/>
</FileConfiguration>
</File>
</Filter>
<Filter
Name="others"
Filter="">
<File
RelativePath="..\..\Exe\Main\EDT_Data\Objects\Sector\Sector.cnt">
</File>
<File
RelativePath="..\..\Exe\Main\EDT_Data\Objects\Sector\SECTOR.HLP">
</File>
<File
RelativePath="..\..\Exe\Main\EDT_Data\Objects\Sector\Sectors.ini">
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

View File

@@ -0,0 +1,162 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by SECTres.rc
//
#define SECT_IDC_MECSAVE 3
#define SECT_IDC_NEWENV 4
#define SECT_IDC_MECCANCEL 4
#define SECT_IDC_ENVCANCEL 7
#define SECT_IDC_EDITMEC 8
#define SECT_IDC_NEWMEC 9
#define SECT_IDC_EDITVIS 10
#define SECT_IDC_NEWVIS 11
#define SEC_IDD_DIALOGSELECT 192
#define SEC_IDD_DIALOGEDIT 193
#define SEC_IDD_DIALOGLIST 195
#define SEC_IDD_DIALOGMODE 196
#define SEC_IDD_DIALOGENV 197
#define SEC_IDD_DIALOGLISTENV 198
#define SEC_IDD_DIALOGENVLIST 198
#define SEC_IDD_DIALOGBASE 199
#define SEC_IDD_DIALOGMECENVBIS 200
#define SEC_IDD_DIALOGENVS 201
#define SEC_IDD_DIALOGVIS 202
#define SEC_IDD_DIALOGSRF 203
#define SEC_IDD_DIALOGMECENV 204
#define SEC_IDD_DIALOGREPLACE 205
#define SECT_IDI_SECTOR 206
#define SEC_IDD_DIALOGDISTANCE 206
#define SECT_IDI_VIRTUAL 207
#define IDI_OSC_DLGBAR_ICON 208
#define SECT_IDC_GRAPHIC 1005
#define SECT_IDC_SOUND 1006
#define SECT_IDC_COLLISION 1007
#define SECT_IDC_ACTIVITY 1008
#define SECT_IDC_MECNAME 1009
#define SECT_IDC_SECTORTEXT 1011
#define SECT_IDC_LISTTEXT 1012
#define SECT_IDC_ENVTEXT 1013
#define SECT_IDC_EDITLIST 1021
#define SECT_IDC_EDITSECTOR 1022
#define SECT_IDC_EDITENV 1023
#define SECT_IDC_SECTORLIST 1026
#define SECT_IDC_GRAVITY 1039
#define SECT_IDC_VISCOSITY 1040
#define SECT_IDC_DENSITY 1041
#define SECT_IDC_LEVEL 1042
#define SECT_IDC_VERTICALX 1043
#define SECT_IDC_STATICENVLIST 1044
#define SECT_IDC_VERTICALY 1044
#define SECT_IDC_VERTICALZ 1045
#define SECT_IDC_ENVLIST 1046
#define SECT_IDC_STREAMX 1046
#define SECT_IDC_STREAMY 1047
#define SECT_IDC_STREAMZ 1048
#define SECT_IDC_ADDENVELEM 1050
#define SECT_IDC_DELENVELEM 1051
#define SECT_IDC_VOLUMIC 1052
#define SECT_IDC_GRAPHICLEVEL 1055
#define SECT_IDC_SURFHEIGHT 1055
#define SECT_IDC_SOUNDLEVEL 1056
#define SECT_IDC_SELECTEDSECTOR 1070
#define SECT_IDC_EDITEDSECTOR 1071
#define SECT_IDC_SORTEDLISTBOX 1072
#define SECT_IDC_STATICENVELEM 1073
#define SECT_IDC_STATICENVTEXT 1074
#define SECT_IDC_STATICHEIGHT 1075
#define SECT_IDC_DEFAULT 1076
#define SECT_IDC_EDITHEIGHT 1077
#define SECT_IDC_EDITELEM 1077
#define SECT_IDC_COMBOENV 1078
#define SECT_IDC_ENVNAME 1079
#define SECT_IDC_ENVSAVE 1080
#define SECT_IDC_ENVDEFAULT 1082
#define SECT_IDC_STATICMEC 1083
#define SECT_IDC_MECDEFAULT 1084
#define SECT_IDC_STATICVIS 1084
#define SECT_IDC_ENVLISTBOX 1085
#define SECT_IDC_MECLISTBOX 1086
#define SECT_IDC_SOUNDLISTBOX 1087
#define SECT_IDC_VISLISTBOX 1087
#define SECT_IDC_GRAPHICSPIN 1091
#define SECT_IDC_SOUNDSPIN 1092
#define SECT_IDC_SOUNDEVENT 1093
#define SECT_IDC_SOUNDEVENTLIST 1094
#define SECT_IDC_STATICSOUND 1095
#define SECT_IDC_TEXTVOLUMIC 1096
#define SECT_IDC_TEXTGRAVITY 1097
#define SECT_IDC_TEXTCOEFF 1098
#define SECT_IDC_TEXTVERTICAL 1099
#define SECT_IDC_TEXTFLUID 1100
#define SECT_IDC_TEXTDENSITY 1101
#define SECT_IDC_TEXTVISCOSITY 1102
#define SECT_IDC_TEXTLEVEL 1103
#define SECT_IDC_TEXTSTREAM 1104
#define SECT_IDC_TEXTENVELEM 1107
#define SECT_IDC_TEXTSURFELEM 1108
#define SECT_IDC_SURFLISTBOX 1109
#define SECT_IDC_VIEWSURF 1111
#define SECT_IDC_ENVELEMDEFAULT 1112
#define SECT_IDC_APPLYALL 1113
#define SECT_IDC_APPLYSELECT 1114
#define SECT_IDC_CANCELSELECT 1115
#define SECT_IDC_SEPARATOR 1116
#define SECT_IDC_SYMETRIC 1117
#define SECT_IDC_MODESYM 1119
#define SECT_IDC_SOUNDCOMBO 1123
#define SECT_IDC_COLORTEXT 1124
#define SECT_IDC_STATICCOLOR 1124
#define SECT_IDC_REDSLIDER 1125
#define SECT_IDC_GREENSLIDER 1126
#define SECT_IDC_BLUESLIDER 1127
#define SECT_IDC_COLOR 1129
#define SECT_IDC_EDITCOLOR 1135
#define SECT_IDC_VISNAME 1136
#define SECT_IDC_VISCANCEL 1137
#define SECT_IDC_VISSAVE 1138
#define SECT_IDC_VISDEFAULT 1139
#define SECT_IDC_STATICFOG 1140
#define SECT_IDC_NEAR 1141
#define SECT_IDC_STATICNEAR 1142
#define SECT_IDC_FAR 1143
#define SECT_IDC_STATICFAR 1144
#define SECT_IDC_INFINITE 1145
#define SECT_IDC_STATICINFINITE 1146
#define SECT_IDC_SRFDEFAULT 1149
#define SECT_IDC_SOUNDLIST 1150
#define SECT_IDC_LISTPARAMS 1152
#define SECT_IDC_EDITVIRTUAL 1154
#define SECT_IDC_SELECTVIRTUAL 1155
#define SECT_IDC_REPLACE 1156
#define SECT_IDC_CINITENV 1157
#define SECT_IDC_CNEWENV 1158
#define SECT_IDC_CURRENT 1159
#define SECT_IDC_SELECT 1160
#define SECT_IDC_ALL 1161
#define SECT_IDC_ZMAXCHECK 1162
#define SECT_IDC_ZMAXVALUE 1163
#define SECT_IDC_ZMAXDEFAULT 1164
#define SECT_IDC_STATICBLEND 1165
#define SECT_IDC_ZFARCHECK 1165
#define SECT_IDC_BLENDNEAR 1166
#define SECT_IDC_ZFARVALUE 1166
#define SECT_IDC_BLENDFAR 1167
#define SECT_IDC_DISTANCE 1168
#define SECT_IDC_STATICCAM 1169
#define SECT_IDC_CAMERATYPE 1170
#define SECT_IDC_STATICPRIORITY 1171
#define SECT_IDC_PRIORITY 1172
#define SECT_IDC_PSPIN 1173
#define SECT_IDC_GRAPHICMODE 1174
#define SECT_IDC_DSTATIC 65535
// Next default values for new objects
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 209
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1175
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif

View File

@@ -0,0 +1,442 @@
//Microsoft Developer Studio generated resource script.
//
#include "SECTres.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// French (France) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
#ifdef _WIN32
LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"SECTres.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
SEC_IDD_DIALOGSELECT DIALOG DISCARDABLE 0, 0, 133, 151
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "Graphic",SECT_IDC_GRAPHIC,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,10,21,40,10
CONTROL "Sound",SECT_IDC_SOUND,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,10,66,40,10
CONTROL "Collision",SECT_IDC_COLLISION,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,10,36,50,10
CONTROL "Activity",SECT_IDC_ACTIVITY,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,10,51,50,10
COMBOBOX SECT_IDC_SELECTEDSECTOR,5,2,60,95,CBS_DROPDOWN |
CBS_SORT | WS_VSCROLL | WS_TABSTOP
CONTROL "Spin1",SECT_IDC_GRAPHICSPIN,"msctls_updown32",UDS_WRAP |
UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS,86,18,
11,14
EDITTEXT SECT_IDC_GRAPHICLEVEL,55,19,30,12,ES_AUTOHSCROLL |
ES_READONLY
CONTROL "Spin1",SECT_IDC_SOUNDSPIN,"msctls_updown32",UDS_WRAP |
UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS,86,63,
11,14
EDITTEXT SECT_IDC_SOUNDLEVEL,55,64,30,12,ES_AUTOHSCROLL |
ES_READONLY
CONTROL "SoundEvent",SECT_IDC_SOUNDEVENT,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,10,81,55,10
PUSHBUTTON "Symetric",SECT_IDC_SYMETRIC,73,2,35,10
CONTROL "List1",SECT_IDC_SOUNDEVENTLIST,"SysListView32",
LVS_REPORT | LVS_SINGLESEL | LVS_SHAREIMAGELISTS |
LVS_OWNERDRAWFIXED | LVS_NOCOLUMNHEADER |
LVS_NOSORTHEADER | WS_BORDER | WS_TABSTOP,5,105,100,40
CONTROL "Look",SECT_IDC_GRAPHICMODE,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,89,21,31,10
END
SEC_IDD_DIALOGEDIT DIALOG DISCARDABLE 0, 0, 156, 91
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
COMBOBOX SECT_IDC_EDITEDSECTOR,0,5,95,80,CBS_DROPDOWN | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
CONTROL "Virtual",SECT_IDC_EDITVIRTUAL,"Button",BS_AUTOCHECKBOX |
WS_TABSTOP,100,5,35,10
CONTROL "Zmax of Border",SECT_IDC_ZMAXCHECK,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,3,25,64,10
EDITTEXT SECT_IDC_ZMAXVALUE,91,23,41,14,ES_AUTOHSCROLL
DEFPUSHBUTTON "",SECT_IDC_ZMAXDEFAULT,143,3,10,6,NOT WS_VISIBLE
LTEXT "Camera Type",SECT_IDC_STATICCAM,3,55,64,12
EDITTEXT SECT_IDC_CAMERATYPE,91,53,41,12,ES_AUTOHSCROLL
CONTROL "ZFar in Sector",SECT_IDC_ZFARCHECK,"Button",
BS_AUTOCHECKBOX | WS_TABSTOP,3,40,61,10
EDITTEXT SECT_IDC_ZFARVALUE,91,38,41,14,ES_AUTOHSCROLL
LTEXT "Priority",SECT_IDC_STATICPRIORITY,3,68,64,12
EDITTEXT SECT_IDC_PRIORITY,91,66,41,12,ES_AUTOHSCROLL |
ES_READONLY
CONTROL "Spin1",SECT_IDC_PSPIN,"msctls_updown32",UDS_WRAP |
UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_ARROWKEYS,129,66,
11,11
END
SEC_IDD_DIALOGLIST DIALOG DISCARDABLE 0, 0, 186, 95
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "List1",SECT_IDC_SECTORLIST,"SysListView32",LVS_REPORT |
LVS_SINGLESEL | LVS_SHAREIMAGELISTS | LVS_OWNERDRAWFIXED |
LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER |
WS_TABSTOP,0,0,170,90
END
SEC_IDD_DIALOGMODE DIALOG DISCARDABLE 0, 0, 106, 61
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "",SECT_IDC_EDITLIST,"Button",BS_AUTORADIOBUTTON,43,23,
12,10
CONTROL "",SECT_IDC_EDITSECTOR,"Button",BS_AUTORADIOBUTTON,9,23,
13,10
CONTROL "",SECT_IDC_EDITENV,"Button",BS_AUTORADIOBUTTON | NOT
WS_VISIBLE | WS_DISABLED,80,23,12,10
CTEXT "Sector",SECT_IDC_SECTORTEXT,3,3,28,11,WS_BORDER
CTEXT "List",SECT_IDC_LISTTEXT,37,3,29,11,WS_BORDER
CTEXT "Env",SECT_IDC_ENVTEXT,73,3,27,11,NOT WS_VISIBLE |
WS_DISABLED | WS_BORDER
CONTROL "SYMETRIC",SECT_IDC_MODESYM,"Button",BS_AUTOCHECKBOX |
BS_PUSHLIKE | WS_TABSTOP,20,41,65,14
END
SEC_IDD_DIALOGENVLIST DIALOG DISCARDABLE 0, 0, 81, 146
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
LISTBOX SECT_IDC_ENVLIST,5,10,70,60,LBS_OWNERDRAWFIXED |
LBS_HASSTRINGS | LBS_NOINTEGRALHEIGHT |
LBS_WANTKEYBOARDINPUT | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Add",SECT_IDC_ADDENVELEM,10,75,25,12
PUSHBUTTON "Del",SECT_IDC_DELENVELEM,40,75,25,12
PUSHBUTTON "Apply to All Sectors",SECT_IDC_APPLYALL,5,100,65,10
PUSHBUTTON "Apply to Selection",SECT_IDC_APPLYSELECT,5,115,65,10
PUSHBUTTON "Cancel Selection",SECT_IDC_CANCELSELECT,5,130,65,10
LTEXT "",SECT_IDC_SEPARATOR,0,92,80,5,SS_SUNKEN | WS_BORDER |
NOT WS_GROUP
END
SEC_IDD_DIALOGBASE DIALOG DISCARDABLE 0, 0, 96, 116
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
LISTBOX SECT_IDC_SORTEDLISTBOX,5,20,85,89,LBS_OWNERDRAWFIXED |
LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Symetric",SECT_IDC_SYMETRIC,55,5,35,10
LISTBOX SECT_IDC_LISTPARAMS,5,10,80,90,LBS_NOINTEGRALHEIGHT |
NOT WS_VISIBLE | WS_DISABLED | WS_VSCROLL | WS_TABSTOP
END
SEC_IDD_DIALOGENV DIALOG DISCARDABLE 0, 0, 216, 116
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT SECT_IDC_ENVNAME,35,2,68,14,ES_AUTOHSCROLL
GROUPBOX "Sound",SECT_IDC_STATICSOUND,145,20,68,90,BS_CENTER
GROUPBOX "Mechanic",SECT_IDC_STATICMEC,2,20,68,90,BS_CENTER | NOT
WS_VISIBLE | WS_DISABLED
PUSHBUTTON "Apply",SECT_IDC_ENVSAVE,109,5,25,10
PUSHBUTTON "Cancel",SECT_IDC_ENVCANCEL,5,4,25,10
PUSHBUTTON "Edit",SECT_IDC_EDITMEC,7,98,28,9,NOT WS_VISIBLE |
WS_DISABLED
PUSHBUTTON "New",SECT_IDC_NEWMEC,37,98,28,9,NOT WS_VISIBLE |
WS_DISABLED
DEFPUSHBUTTON "",SECT_IDC_ENVDEFAULT,0,0,6,6,NOT WS_VISIBLE
CONTROL "List1",SECT_IDC_MECLISTBOX,"SysListView32",LVS_REPORT |
LVS_SHAREIMAGELISTS | LVS_OWNERDRAWFIXED |
LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | NOT WS_VISIBLE |
WS_DISABLED | WS_BORDER | WS_TABSTOP,5,30,60,65
GROUPBOX "Visual",SECT_IDC_STATICVIS,75,20,68,90,BS_CENTER | NOT
WS_VISIBLE | WS_DISABLED
PUSHBUTTON "Edit",SECT_IDC_EDITVIS,81,98,28,9,NOT WS_VISIBLE |
WS_DISABLED
PUSHBUTTON "New",SECT_IDC_NEWVIS,111,98,28,9,NOT WS_VISIBLE |
WS_DISABLED
CONTROL "List1",SECT_IDC_VISLISTBOX,"SysListView32",LVS_REPORT |
LVS_SHAREIMAGELISTS | LVS_OWNERDRAWFIXED |
LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | NOT WS_VISIBLE |
WS_DISABLED | WS_BORDER | WS_TABSTOP,79,30,60,65
LISTBOX SECT_IDC_SOUNDLIST,150,30,55,75,LBS_NOINTEGRALHEIGHT |
WS_VSCROLL | WS_TABSTOP
END
SEC_IDD_DIALOGENVS DIALOG DISCARDABLE 0, 0, 71, 106
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "New",SECT_IDC_NEWENV,10,85,20,10
GROUPBOX "Environments",SECT_IDC_TEXTENVELEM,5,5,65,95
CONTROL "List2",SECT_IDC_ENVLISTBOX,"SysListView32",LVS_REPORT |
LVS_SHAREIMAGELISTS | LVS_OWNERDRAWFIXED |
LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER |
WS_TABSTOP,10,20,55,60
PUSHBUTTON "<-->",SECT_IDC_REPLACE,35,85,30,10
END
SEC_IDD_DIALOGVIS DIALOG DISCARDABLE 0, 0, 109, 116
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "Slider1",SECT_IDC_REDSLIDER,"msctls_trackbar32",
TBS_VERT | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,36,80,10,
31
CONTROL "Slider1",SECT_IDC_GREENSLIDER,"msctls_trackbar32",
TBS_VERT | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,46,80,10,
31
CONTROL "Slider1",SECT_IDC_BLUESLIDER,"msctls_trackbar32",
TBS_VERT | TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,56,80,10,
31
EDITTEXT SECT_IDC_VISNAME,3,15,102,14,ES_AUTOHSCROLL
PUSHBUTTON "Apply",SECT_IDC_VISSAVE,79,3,26,9
PUSHBUTTON "Cancel",SECT_IDC_VISCANCEL,3,2,26,9
DEFPUSHBUTTON "",SECT_IDC_VISDEFAULT,49,3,10,6,NOT WS_VISIBLE
GROUPBOX "FOG",SECT_IDC_STATICFOG,4,31,101,83,BS_CENTER
LTEXT "Near",SECT_IDC_STATICNEAR,7,55,24,10,SS_SUNKEN
LTEXT "Far",SECT_IDC_STATICFAR,7,66,24,10,SS_SUNKEN
LTEXT "Infinite",SECT_IDC_STATICINFINITE,7,42,24,10,SS_SUNKEN
CTEXT "Color",SECT_IDC_STATICCOLOR,10,90,24,10,SS_SUNKEN
CONTROL "",SECT_IDC_COLOR,"Button",BS_OWNERDRAW | BS_NOTIFY |
BS_FLAT | WS_TABSTOP,72,84,26,21
EDITTEXT SECT_IDC_NEAR,34,54,30,12,ES_AUTOHSCROLL
EDITTEXT SECT_IDC_FAR,34,65,30,12,ES_AUTOHSCROLL
EDITTEXT SECT_IDC_INFINITE,34,41,30,12,ES_AUTOHSCROLL
CTEXT "Blend",SECT_IDC_STATICBLEND,71,43,27,9
CONTROL "Slider1",SECT_IDC_BLENDNEAR,"msctls_trackbar32",
TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,69,56,29,10
CONTROL "Slider1",SECT_IDC_BLENDFAR,"msctls_trackbar32",TBS_BOTH |
TBS_NOTICKS | WS_TABSTOP,69,67,29,10
END
SEC_IDD_DIALOGSRF DIALOG DISCARDABLE 0, 0, 66, 91
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
GROUPBOX "Surfaces",SECT_IDC_TEXTSURFELEM,0,5,65,85
CONTROL "View",SECT_IDC_VIEWSURF,"Button",BS_AUTOCHECKBOX |
BS_PUSHLIKE | WS_TABSTOP,40,75,21,10
EDITTEXT SECT_IDC_SURFHEIGHT,5,75,30,10,ES_AUTOHSCROLL
CONTROL "List1",SECT_IDC_SURFLISTBOX,"SysListView32",LVS_REPORT |
LVS_SHAREIMAGELISTS | LVS_OWNERDRAWFIXED |
LVS_NOCOLUMNHEADER | LVS_NOSORTHEADER | WS_BORDER |
WS_TABSTOP,5,15,55,55
DEFPUSHBUTTON "",SECT_IDC_SRFDEFAULT,50,5,10,6,NOT WS_VISIBLE
END
SEC_IDD_DIALOGMECENV DIALOG DISCARDABLE 0, 0, 161, 106
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
PUSHBUTTON "Cancel",SECT_IDC_MECCANCEL,5,5,30,10
PUSHBUTTON "Apply",SECT_IDC_MECSAVE,130,5,25,10
EDITTEXT SECT_IDC_MECNAME,37,2,90,12,ES_AUTOHSCROLL
GROUPBOX "GRAVITY",SECT_IDC_TEXTGRAVITY,2,16,153,31,BS_CENTER
LTEXT "Vertical",SECT_IDC_TEXTVERTICAL,6,22,55,10
EDITTEXT SECT_IDC_VERTICALX,6,32,27,12,ES_AUTOHSCROLL
EDITTEXT SECT_IDC_VERTICALY,33,32,27,12,ES_AUTOHSCROLL
EDITTEXT SECT_IDC_VERTICALZ,61,32,27,12,ES_AUTOHSCROLL
LTEXT "Coefficient",SECT_IDC_TEXTCOEFF,111,22,35,10
EDITTEXT SECT_IDC_GRAVITY,115,32,31,12,ES_AUTOHSCROLL
GROUPBOX "FLUID",SECT_IDC_TEXTFLUID,2,47,153,58,BS_CENTER
LTEXT "Stream",SECT_IDC_TEXTSTREAM,6,53,23,10
EDITTEXT SECT_IDC_STREAMX,6,63,28,12,ES_AUTOHSCROLL
EDITTEXT SECT_IDC_STREAMY,34,63,28,12,ES_AUTOHSCROLL
EDITTEXT SECT_IDC_STREAMZ,62,63,28,12,ES_AUTOHSCROLL
LTEXT "Viscosity",SECT_IDC_TEXTVISCOSITY,92,89,29,10
LTEXT "Density",SECT_IDC_TEXTDENSITY,94,75,24,10
LTEXT "Level",SECT_IDC_TEXTLEVEL,95,62,18,10
EDITTEXT SECT_IDC_LEVEL,121,59,27,12,ES_AUTOHSCROLL
EDITTEXT SECT_IDC_DENSITY,121,73,27,12,ES_AUTOHSCROLL
EDITTEXT SECT_IDC_VISCOSITY,121,86,27,12,ES_AUTOHSCROLL
GROUPBOX "Volumic Environment",SECT_IDC_TEXTVOLUMIC,2,78,83,27
COMBOBOX SECT_IDC_VOLUMIC,6,89,73,63,CBS_DROPDOWN | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
DEFPUSHBUTTON "",SECT_IDC_MECDEFAULT,13,15,10,5,NOT WS_VISIBLE
END
SEC_IDD_DIALOGREPLACE DIALOG DISCARDABLE 0, 0, 123, 151
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Replace Environment"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,7,130,30,14
PUSHBUTTON "Cancel",IDCANCEL,75,130,35,14
COMBOBOX SECT_IDC_CINITENV,10,20,95,65,CBS_DROPDOWNLIST |
CBS_SORT | WS_VSCROLL | WS_TABSTOP
COMBOBOX SECT_IDC_CNEWENV,10,60,95,75,CBS_DROPDOWNLIST | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
CONTROL "Edited",SECT_IDC_CURRENT,"Button",BS_AUTORADIOBUTTON,2,
105,36,10
CONTROL "Selection",SECT_IDC_SELECT,"Button",BS_AUTORADIOBUTTON,
45,105,45,10
CONTROL "All",SECT_IDC_ALL,"Button",BS_AUTORADIOBUTTON,97,105,23,
10
LTEXT "Initial Environment",IDC_STATIC,10,5,95,10
LTEXT "New Environment",IDC_STATIC,10,45,95,10
LTEXT "Apply to sector(s) :",IDC_STATIC,10,90,95,10
END
SEC_IDD_DIALOGDISTANCE DIALOG DISCARDABLE 0, 0, 104, 50
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Link Nearest Sectors"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,7,28,30,14
PUSHBUTTON "Cancel",IDCANCEL,62,29,35,14
LTEXT "Distance",SECT_IDC_DSTATIC,7,8,34,10
EDITTEXT SECT_IDC_DISTANCE,54,7,43,12,ES_AUTOHSCROLL
END
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
SEC_IDD_DIALOGEDIT, DIALOG
BEGIN
LEFTMARGIN, 3
RIGHTMARGIN, 153
TOPMARGIN, 3
BOTTOMMARGIN, 88
END
SEC_IDD_DIALOGMODE, DIALOG
BEGIN
LEFTMARGIN, 3
RIGHTMARGIN, 103
TOPMARGIN, 3
BOTTOMMARGIN, 58
END
SEC_IDD_DIALOGENVLIST, DIALOG
BEGIN
LEFTMARGIN, 3
RIGHTMARGIN, 78
TOPMARGIN, 3
BOTTOMMARGIN, 143
END
SEC_IDD_DIALOGBASE, DIALOG
BEGIN
BOTTOMMARGIN, 70
END
SEC_IDD_DIALOGENV, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 212
TOPMARGIN, 3
BOTTOMMARGIN, 112
END
SEC_IDD_DIALOGENVS, DIALOG
BEGIN
LEFTMARGIN, 3
RIGHTMARGIN, 68
TOPMARGIN, 3
BOTTOMMARGIN, 103
END
SEC_IDD_DIALOGVIS, DIALOG
BEGIN
LEFTMARGIN, 4
RIGHTMARGIN, 105
TOPMARGIN, 3
BOTTOMMARGIN, 112
END
SEC_IDD_DIALOGSRF, DIALOG
BEGIN
LEFTMARGIN, 3
RIGHTMARGIN, 63
TOPMARGIN, 3
BOTTOMMARGIN, 88
END
SEC_IDD_DIALOGREPLACE, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 116
TOPMARGIN, 7
BOTTOMMARGIN, 144
END
SEC_IDD_DIALOGDISTANCE, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 97
TOPMARGIN, 7
BOTTOMMARGIN, 43
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
SECT_IDI_SECTOR ICON DISCARDABLE "SECiSect.ico"
SECT_IDI_VIRTUAL ICON DISCARDABLE "SECiVirt.ico"
IDI_OSC_DLGBAR_ICON ICON DISCARDABLE "osc_dlgb.ico"
#endif // French (France) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

View File

@@ -0,0 +1,120 @@
/*=========================================================================
*
* dllcom.cpp : DLL definition
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
#include "stdafx.h"
#include "acp_base.h"
#include "afxdllx.h"
#include "SECTint.hpp"
//------------------------------------------------------------------------
// Global vars
static char *gs_p_szCPAVersion = C_szCPAVersion;
static AFX_EXTENSION_MODULE NEAR extensionDLL = { NULL, NULL };
#ifdef DLL_ONLY_ONE_INSTANCE
static Sector_Interface *gs_p_oSectorInterface = NULL;
#endif
// list of instances
static CList<CPA_DLLBase*,CPA_DLLBase*> g_oListOfInstances; //private internal
//------------------------------------------------------------------------
// functions that are present in all DLL :
//------------------------------------------------------------------------
//========================================================================
// Get current CPA version
//========================================================================
extern "C" char __declspec(dllexport) *fn_p_szGetCPAVersion(void)
{
return gs_p_szCPAVersion;
}
//========================================================================
// Get type of this DLL
//========================================================================
extern "C" tdstDLLIdentity __declspec(dllexport) *fn_p_stGetDLLIdentity(void)
{
g_stSectorIdentity.eType = OBJECT_DLL;
g_stSectorIdentity.csName = C_szDLLSectorName;
g_stSectorIdentity.hModule = NULL;
g_stSectorIdentity.p_oListOfInstances = &g_oListOfInstances;
return &g_stSectorIdentity;
}
//========================================================================
// DLL int function
//========================================================================
extern "C" void __declspec(dllexport) fn_vInitDll(void)
{
new CDynLinkLibrary(extensionDLL);
}
//========================================================================
// DLL entry point
//========================================================================
extern "C" int __stdcall DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved)
{
if (dwReason == DLL_PROCESS_ATTACH)
{
if (!AfxInitExtensionModule(extensionDLL, hInstance))
return 0;
}
return 1;
}
//========================================================================
// Get the DLL
//========================================================================
extern "C" CPA_DLLBase __declspec(dllexport) *fn_p_oGetDLL(long lKey)
{
#ifdef DLL_ONLY_ONE_INSTANCE
switch(lKey)
{
case 0: // the game world
if (gs_p_oSectorInterface == NULL)
{
gs_p_oSectorInterface = new Sector_Interface();
ASSERT(gs_p_oSectorInterface != NULL);
}
return gs_p_oSectorInterface;
break;
default:
return NULL;
}
#else //DLL_ONLY_ONE_INSTANCE
switch(lKey)
{
case 0: // the game world
return new Sector_Interface();
break;
default:
return NULL;
}
#endif //DLL_ONLY_ONE_INSTANCE
}
//------------------------------------------------------------------------
// functions that are present in this type of DLL only :
//------------------------------------------------------------------------
#undef DLL_ONLY_ONE_INSTANCE

View File

@@ -0,0 +1,369 @@
/*=========================================================================
*
* SECTelem.cpp : Implementation of Editor Elements
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
#include "stdafx.h"
#include "acp_base.h"
#include "SECTint.hpp"
#include "DPT.h"
//#################################################################################
// Element Base
//#################################################################################
SECT_ElementBase::SECT_ElementBase (Sector_Object *pOwnerSector)
: CPA_SectionObject ("", fn_szGetLevelsDataPath(), SECT_ElementBase::CallBackSaveSectorsLink,
pOwnerSector, pOwnerSector->fn_bHasSectorsLinkSection())
{
// init owner
m_pOwnerSector = pOwnerSector;
// init section name
SetReferencedSectionName(m_pOwnerSector->GetSectorsLinkSection());
}
/*===========================================================================
* Description: callback for save
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
void SECT_ElementBase::CallBackSaveSectorsLink (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction)
{
SECT_SoundEventElement *pSoundEventElem;
SECT_SndEvtEngineElem *pEngineElem;
SECT_CollisionElement *pCollisionElem;
SECT_ActivityElement *pActivityElem;
SECT_GraphicElement *pGraphicElem;
SECT_SoundElement *pSoundElem;
SECT_ElementBase *pElem;
Sector_Object *pSector;
POSITION pos, pos1;
CString csReference, csSoundEvent;
char szNewSectionName[SCR_CV_ui_Cfg_MaxLenName];
int iSaveIndentLevel;
// get sector
pSector = (Sector_Object *) p_vData;
switch (eAction)
{
case SCR_EA_Ntfy_AddSection:
case SCR_EA_Ntfy_RebuildSection:
// indent level
iSaveIndentLevel = SCR_g_ui_SvL0_IndentationLevel;
SCR_g_ui_SvL0_IndentationLevel = 1;
// save begin section
SCR_fn_v_RdL0_ComputeSectionName(szNewSectionName, NULL, C_szSectorsLinkSubSection, " ");
SCR_M_SvL0_SaveBeginSection(p_stFile, szNewSectionName, SCR_CC_C_Cfg_EOL);
// virtual
if (pSector->fn_bIsVirtual())
{
SCR_M_SvL0_SaveEntry(p_stFile, "Virtual", SCR_CC_C_Cfg_EOL);
}
pSector->GetVirtualSection()->fn_vSectionSaved();
// Zfar clipping
if (pSector->GetZfarInSector() > MTH_C_ZERO)
{
SCR_M_SvL0_SaveEntry(p_stFile, "ZFar", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Scanf, 1, "%f", GLI_M_ValueToFloat(pSector->GetZfarInSector()));
}
// camera type
SCR_M_SvL0_SaveEntry(p_stFile, "CameraType", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Scanf, 1, "%d", (int) pSector->GetCameraType());
pSector->GetCameraSection()->fn_vSectionSaved();
// priority
SCR_M_SvL0_SaveEntry(p_stFile, "Priority", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Scanf, 1, "%d", (int) pSector->GetPriority());
pSector->GetPrioritySection()->fn_vSectionSaved();
// graphic list
for (pGraphicElem = pSector->GetGraphicList()->GetHeadElement(pos); pGraphicElem;
pGraphicElem = pSector->GetGraphicList()->GetNextElement(pos))
{
csReference = pGraphicElem->GetSector()->GetReferencedSectionName();
SCR_M_SvL0_SaveEntry(p_stFile, "AddLstGraphic", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Scanf, 1, "%s,%d,%d",
(char *) (LPCSTR) csReference, pGraphicElem->GetGraphicLevel(), pGraphicElem->GetGraphicMode());
pGraphicElem->fn_vSectionSaved();
}
// collision list
for (pCollisionElem = pSector->GetCollisionList()->GetHeadElement(pos); pCollisionElem;
pCollisionElem = pSector->GetCollisionList()->GetNextElement(pos))
{
csReference = pCollisionElem->GetSector()->GetReferencedSectionName();
SCR_M_SvL0_SaveEntry(p_stFile, "AddLstCollision", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Scanf, 1, "%s,0",
(char *) (LPCSTR) csReference);
pCollisionElem->fn_vSectionSaved();
}
// activity list
for (pActivityElem = pSector->GetActivityList()->GetHeadElement(pos); pActivityElem;
pActivityElem = pSector->GetActivityList()->GetNextElement(pos))
{
csReference = pActivityElem->GetSector()->GetReferencedSectionName();
SCR_M_SvL0_SaveEntry(p_stFile, "AddLstActivity", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Scanf, 1, "%s,0",
(char *) (LPCSTR) csReference);
pActivityElem->fn_vSectionSaved();
}
// sound list
for (pSoundElem = pSector->GetSoundList()->GetHeadElement(pos); pSoundElem;
pSoundElem = pSector->GetSoundList()->GetNextElement(pos))
{
csReference = pSoundElem->GetSector()->GetReferencedSectionName();
SCR_M_SvL0_SaveEntry(p_stFile, "AddLstSound", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Scanf, 1, "%s,%d,0",
(char *) (LPCSTR) csReference, pSoundElem->GetSoundLevel());
pSoundElem->fn_vSectionSaved();
}
// sound event list
for (pElem = pSector->GetSoundEventList()->GetHeadElementBase(pos); pElem;
pElem = pSector->GetSoundEventList()->GetNextElementBase(pos))
{
// get sound event element
pSoundEventElem = (SECT_SoundEventElement *) pElem;
if (pSoundEventElem->GetSector())
csReference = pSoundEventElem->GetSector()->GetReferencedSectionName();
else
csReference = "FromAllSectors";
// save all sound events
for (pEngineElem = pSoundEventElem->GetSndEvtList()->GetHeadElement(pos1); pEngineElem;
pEngineElem = pSoundEventElem->GetSndEvtList()->GetNextElement(pos1))
{
// get references
csSoundEvent = pEngineElem->GetSoundEventReference();
// save element
SCR_M_SvL0_SaveEntry(p_stFile, "AddLstSoundEvent", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Scanf, 1, "%s,%s",
(char *) (LPCSTR) csReference, (char *) (LPCSTR) csSoundEvent);
}
pSoundEventElem->fn_vSectionSaved();
}
// end section
SCR_M_SvL0_SaveEndSection (p_stFile, SCR_CC_C_Cfg_EOL);
if (eAction == SCR_EA_Ntfy_AddSection)
SCR_M_SvL0_SaveBlankLine (p_stFile);
// indent level
SCR_g_ui_SvL0_IndentationLevel = iSaveIndentLevel;
// reinit super-object
pSector->SetExistingSectorsLinkSection(TRUE);
break;
case SCR_EA_Ntfy_DeleteSection:
// reinit super-object
pSector->SetExistingSectorsLinkSection(FALSE);
// virtual
pSector->GetVirtualSection()->fn_vSectionDeleted();
// camera
pSector->GetCameraSection()->fn_vSectionDeleted();
// priority
pSector->GetPrioritySection()->fn_vSectionDeleted();
// graphic list
for (pGraphicElem = pSector->GetGraphicList()->GetHeadElement(pos); pGraphicElem;
pGraphicElem = pSector->GetGraphicList()->GetNextElement(pos))
pGraphicElem->fn_vSectionDeleted();
// collision list
for (pCollisionElem = pSector->GetCollisionList()->GetHeadElement(pos); pCollisionElem;
pCollisionElem = pSector->GetCollisionList()->GetNextElement(pos))
pCollisionElem->fn_vSectionDeleted();
// activity list
for (pActivityElem = pSector->GetActivityList()->GetHeadElement(pos); pActivityElem;
pActivityElem = pSector->GetActivityList()->GetNextElement(pos))
pActivityElem->fn_vSectionDeleted();
// sound list
for (pSoundElem = pSector->GetSoundList()->GetHeadElement(pos); pSoundElem;
pSoundElem = pSector->GetSoundList()->GetNextElement(pos))
pSoundElem->fn_vSectionDeleted();
// sound event list
for (pElem = pSector->GetSoundEventList()->GetHeadElementBase(pos); pElem;
pElem = pSector->GetSoundEventList()->GetNextElementBase(pos))
{
// get sound event element
pSoundEventElem = (SECT_SoundEventElement *) pElem;
pSoundEventElem->fn_vSectionDeleted();
}
break;
}
}
//#################################################################################
// List Base
//#################################################################################
SECT_ListBase::SECT_ListBase (void)
{
// init owner
m_pOwnerSector = NULL;
// init nb elements
m_lNbElements = 0;
}
/*===========================================================================
Add Element
===========================================================================*/
BOOL SECT_ListBase::fn_bAddAnElement (SECT_ElementBase *pNewElem, BOOL bUpdateEngine)
{
// check owner sector
if (pNewElem->GetOwnerSector() != m_pOwnerSector)
return FALSE;
// check linked sector
if (pNewElem->GetSector() && (pNewElem->GetSector()->GetObject() == m_pOwnerSector))
return FALSE;
// update nb elements
m_lNbElements++;
// update links
g_oCoherenceManager.m_fn_vAddALink(m_pOwnerSector, pNewElem->GetSector());
return TRUE;
}
/*===========================================================================
Remove Element
===========================================================================*/
void SECT_ListBase::fn_vRemoveAnElement (SECT_ElementBase *pOldElem, BOOL bUpdateEngine)
{
// update nb elements
m_lNbElements--;
// update links
g_oCoherenceManager.m_fn_vRemoveALink(m_pOwnerSector, pOldElem->GetSector());
}
/*===========================================================================
Remove All Elements
===========================================================================*/
void SECT_ListBase::fn_vRemoveAllElements (BOOL bUpdateEngine)
{
// update nb elements
m_lNbElements = 0;
}
/*===========================================================================
Get Element With Sector
===========================================================================*/
SECT_ElementBase * SECT_ListBase::GetElementWithSector (CPA_SuperObject *pSector)
{
SECT_ElementBase *pElem;
POSITION pos;
// search all element in list
for (pElem = GetHeadElementBase(pos); pElem; pElem = GetNextElementBase(pos))
{
if (pElem->GetSector() == pSector)
return pElem;
}
// sector was not found
return NULL;
}
//#################################################################################
// Environment Element Base
//#################################################################################
/*
SECT_EnvElementBase::SECT_EnvElementBase (Sector_Object *pOwnerSector)
: CPA_SectionObject ("", fn_szGetLevelsDataPath(), SECT_EnvElementBase::CallBackSaveEnvAndSurf,
pOwnerSector, pOwnerSector->fn_bHasEnvAndSurfSection())
{
// init owner
m_pOwnerSector = pOwnerSector;
// init section name
SetReferencedSectionName(m_pOwnerSector->GetEnvAndSurfSection());
}
*/
/*===========================================================================
* Description: callback for save
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_EnvElementBase::CallBackSaveEnvAndSurf (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction)
{
Sector_Object *pSector;
SECT_SurfElem *pSurfElem;
SECT_EnvElem *pEnvElem;
POSITION pos;
CString csReference;
char szNewSectionName[SCR_CV_ui_Cfg_MaxLenName];
int iSaveIndentLevel;
// get sector
pSector = (Sector_Object *) p_vData;
switch (eAction)
{
case SCR_EA_Ntfy_AddSection:
case SCR_EA_Ntfy_RebuildSection:
// indent level
iSaveIndentLevel = SCR_g_ui_SvL0_IndentationLevel;
SCR_g_ui_SvL0_IndentationLevel = 1;
// save begin section
SCR_fn_v_RdL0_ComputeSectionName(szNewSectionName, NULL, C_szEnvAndSurfSubSection, " ");
SCR_M_SvL0_SaveBeginSection(p_stFile, szNewSectionName, SCR_CC_C_Cfg_EOL);
// environment list
for (pEnvElem = pSector->GetEnvironmentList()->GetHeadElement(pos); pEnvElem;
pEnvElem = pSector->GetEnvironmentList()->GetNextElement(pos))
{
csReference = pEnvElem->GetEnvironment()->GetReferencedSectionName();
SCR_M_SvL0_SaveEntry(p_stFile, "AddLstEnvironment", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Scanf, 1, "%s",
(char *) (LPCSTR) csReference);
pEnvElem->fn_vSectionSaved();
}
// surface list
for (pSurfElem = pSector->GetSurfaceList()->GetHeadElement(pos); pSurfElem;
pSurfElem = pSector->GetSurfaceList()->GetNextElement(pos))
{
csReference = pSurfElem->GetSurface()->GetReferencedSectionName();
SCR_M_SvL0_SaveEntry(p_stFile, "AddLstSurface", SCR_CC_C_Cfg_NoChar);
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Scanf, 1, "%s",
(char *) (LPCSTR) csReference);
pSurfElem->fn_vSectionSaved();
}
// end section
SCR_M_SvL0_SaveEndSection (p_stFile, SCR_CC_C_Cfg_EOL);
if (eAction == SCR_EA_Ntfy_AddSection)
SCR_M_SvL0_SaveBlankLine (p_stFile);
// indent level
SCR_g_ui_SvL0_IndentationLevel = iSaveIndentLevel;
// reinit super-object
pSector->SetExistingEnvAndSurfSection(TRUE);
break;
case SCR_EA_Ntfy_DeleteSection:
// reinit super-object
pSector->SetExistingEnvAndSurfSection(FALSE);
// environment list
for (pEnvElem = pSector->GetEnvironmentList()->GetHeadElement(pos); pEnvElem;
pEnvElem = pSector->GetEnvironmentList()->GetNextElement(pos))
pEnvElem->fn_vSectionDeleted();
// surface list
for (pSurfElem = pSector->GetSurfaceList()->GetHeadElement(pos); pSurfElem;
pSurfElem = pSector->GetSurfaceList()->GetNextElement(pos))
pSurfElem->fn_vSectionDeleted();
break;
}
}
*/

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,462 @@
/*=========================================================================
*
* SECTsurf.cpp : Implementation of Editor Surface Lists
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
/*
#include "stdafx.h"
#include "acp_base.h"
#define SRF_FRIEND
#define SRF_MAIN
#include "SECTint.hpp"
#include "DPT.h"
#undef SRF_MAIN
#undef SRF_FRIEND
#include "SRF\SRF_Fct.h"
DeclareTemplateStatic(SCT_tdxHandleOfElementLstSurface);
DeclareTemplateStatic(SRF_tdxHandleToSurface);
static long NbSurf = 0;
//#################################################################################
// Surface
//#################################################################################
/===========================================================================
Default Constructor
===========================================================================/
SECT_Surface::SECT_Surface (Sector_Interface *p_oDLL,
SRF_tdxHandleToSurface hSurface, BOOL bAvailable,
CString csName, CString csFileName)
: CPA_SaveObject(p_oDLL, C_szSurfaceTypeName, E_ss_Responsible, NULL, bAvailable,
fn_szGetLevelsDataPath(), SECT_Surface::CallBackSaveSurfaceMatrix),
CPA_EdMot<SRF_tdxHandleToSurface>(hSurface)
{
ACP_tdxHandleOfObject hVisual;
CPA_DLLBase *pGeomDLL;
CString csVisualName, csSuperObjectName;
char szSectionName[SCR_CV_ui_Cfg_MaxLenName];
// section object
SetSectionData(this);
// section name
SCR_fn_v_RdL0_ComputeSectionName(szSectionName, (char *)(LPCSTR)csFileName, C_szSurfaceActionName, " ");
SetReferencedSectionName(szSectionName);
// matrix section
m_pMatrixSection = new CPA_SectionObject (GetMatrixSectionName(), fn_szGetLevelsDataPath(),
SECT_Surface::CallBackSaveSurfaceMatrix,
this, TRUE);
// create editor visual
hVisual = SRF_M_hGetVisualOfSurface(GetStruct());
pGeomDLL = p_oDLL->GetMainWorld()->GetObjectDLLWithName(C_szDLLGeometryName);
m_pVisualSurface = (CPA_BaseObject *) pGeomDLL->OnQueryAction(p_oDLL, C_uiCreateGeometricObject, (long) hVisual);
// create visual super-object
csVisualName = "SPO_Visual" + csName;
m_pVisualSuperObject = p_oDLL->GetInterface()->GetNewSuperObject(E_ss_NoSave, C_Dynamic, csVisualName, "");
m_pVisualSuperObject->SetObject(m_pVisualSurface);
HIE_fn_vSetSuperObjectMatrix(m_pVisualSuperObject->GetStruct(), SRF_M_hGetPositionOfSurface(GetStruct()));
// name
if (fn_eRename(csName ) != E_mc_None)
SetDefaultValidName();
fn_vUpdateSectionName();
// create super-object
csSuperObjectName = "SPO_" + GetName();
m_pSuperObject = p_oDLL->GetInterface()->GetNewSuperObject(E_ss_NoSave, C_Dynamic, csSuperObjectName, "");
m_pSuperObject->SetObject(this);
// update hierarchy
m_pSuperObject->AddANewChild(m_pVisualSuperObject);
m_pVisualSuperObject->SetSuperObjectOwner(m_pSuperObject);
// existence
SetExistingSection(TRUE);
}
/===========================================================================
Destructor
===========================================================================/
SECT_Surface::~SECT_Surface (void)
{
}
/===========================================================================
Matrix
===========================================================================/
CString SECT_Surface::GetMatrixSectionName (void)
{
CString csSectionName;
char szSectionName[SCR_CV_ui_Cfg_MaxLenName];
char szActionName[SCR_CV_ui_Cfg_MaxLenName];
char szFileName[SCR_CV_ui_Cfg_MaxLenName];
char szName[SCR_CV_ui_Cfg_MaxLenName];
// get corresponding section
SCR_fn_v_RdL0_SplitSectionName((char*)(LPCSTR) GetReferencedSectionName(), szFileName, szActionName, szName);
SCR_fn_v_RdL0_ComputeSectionName(szSectionName, szFileName, "Matrix", szName);
csSectionName = szSectionName;
return csSectionName;
}
/===========================================================================
Height (Get)
===========================================================================/
MTH_tdxReal SECT_Surface::GetHeight (void)
{
// get engine height
return SRF_fn_xGetSurfaceHeight(GetStruct());
}
/===========================================================================
Height (Set)
===========================================================================/
void SECT_Surface::SetHeight (MTH_tdxReal xNewHeight)
{
MTH3D_tdstVector stSurfacePos;
// update engine height
SRF_fn_vSetSurfaceHeight(GetStruct(), xNewHeight);
// set initial height
POS_fn_vGetTranslationVector(SRF_M_hGetPositionOfSurface(GetStruct()), &stSurfacePos);
POS_fn_vSetTranslationVector(SRF_M_hGetInitPositionOfSurface(GetStruct()), &stSurfacePos);
// update visual super-object
HIE_fn_vSetSuperObjectMatrix(m_pVisualSuperObject->GetStruct(), SRF_M_hGetPositionOfSurface(GetStruct()));
// notify the change
fn_vNotifySave();
}
//#################################################################################
// Save
//#################################################################################
/===========================================================================
Update Section Name
=========================================================================/
void SECT_Surface::fn_vUpdateSectionName (void)
{
// update main section
CPA_SaveObject::fn_vUpdateSectionName();
// update matrix section
m_pMatrixSection->SetReferencedSectionName(GetMatrixSectionName());
}
/===========================================================================
Notifications
=========================================================================/
void SECT_Surface::fn_vNotifySave (void)
{
// matrix section
m_pMatrixSection->fn_vWriteSection();
}
//===========================================================================
void SECT_Surface::fn_vNotifyUnSave (void)
{
// matrix section
m_pMatrixSection->fn_vDeleteSection();
}
//===========================================================================
void SECT_Surface::fn_vNotifyRestore (void)
{
// matrix section
m_pMatrixSection->fn_vRestoreSection();
}
//===========================================================================
void SECT_Surface::fn_vNotifyRename (void)
{
// matrix section
m_pMatrixSection->fn_vRenameSection(GetMatrixSectionName());
}
/*===========================================================================
* Description: CallBack Save for matrix
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_Surface::CallBackSaveSurfaceMatrix (SCR_tdst_File_Description *p_stFile, char *szSectionName, void *p_vData, SCR_tde_Ntfy_Action eAction)
{
GEO_tdxHandleToMatrix hMatrix;
MTH3D_tdstVector stVecI,stVecJ,stVecK;
SECT_Surface *pSurface;
CString csName;
double dUnit;
char szNewSectionName[SCR_CV_ui_Cfg_MaxLenName];
char szMatrixName[SCR_CV_ui_Cfg_MaxLenName];
char szName[SCR_CV_ui_Cfg_MaxLenName];
// get parameters
pSurface = (SECT_Surface *) p_vData;
dUnit = GLI_dGetUnitInMeterInFile(NULL);
if (dUnit == 0)
dUnit = 1;
switch (eAction)
{
case SCR_EA_Ntfy_RebuildSection:
// corresponding matrix
hMatrix = SRF_M_hGetPositionOfSurface(pSurface->GetStruct());
// get section name
SCR_fn_v_RdL0_SplitSectionName(szSectionName, NULL, szNewSectionName, szName);
strcpy(szMatrixName, szName);
// save begin section
SCR_fn_v_RdL0_ComputeSectionName(szNewSectionName, NULL, "Matrix", szMatrixName);
SCR_M_SvL0_SaveBeginSection(p_stFile, szNewSectionName, SCR_CC_C_Cfg_EOL);
// save translation
SCR_M_SvL0_SaveEntry(p_stFile, "MatrixTranslation", SCR_CC_C_Cfg_NoChar);
POS_fn_vGetTranslationVector(hMatrix,&stVecI);
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Scanf, 1,
"%f,%f,%f",
GLI_M_ValueToFloat(MTH3D_M_xGetXofVector(&stVecI)) / dUnit,
GLI_M_ValueToFloat(MTH3D_M_xGetYofVector(&stVecI)) / dUnit,
GLI_M_ValueToFloat(MTH3D_M_xGetZofVector(&stVecI)) / dUnit);
// save scale
SCR_M_SvL0_SaveEntry(p_stFile, "MatrixScale", SCR_CC_C_Cfg_NoChar);
POS_fn_vGetScaleMatrix(hMatrix,&stVecI,&stVecJ,&stVecK);
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Scanf, 1,
"%f,%f,%f,%f,%f,%f,%f,%f,%f",
GLI_M_ValueToFloat(MTH3D_M_xGetXofVector(&stVecI)),
GLI_M_ValueToFloat(MTH3D_M_xGetYofVector(&stVecI)),
GLI_M_ValueToFloat(MTH3D_M_xGetZofVector(&stVecI)),
GLI_M_ValueToFloat(MTH3D_M_xGetXofVector(&stVecJ)),
GLI_M_ValueToFloat(MTH3D_M_xGetYofVector(&stVecJ)),
GLI_M_ValueToFloat(MTH3D_M_xGetZofVector(&stVecJ)),
GLI_M_ValueToFloat(MTH3D_M_xGetXofVector(&stVecK)),
GLI_M_ValueToFloat(MTH3D_M_xGetYofVector(&stVecK)),
GLI_M_ValueToFloat(MTH3D_M_xGetZofVector(&stVecK)));
// save rotation
SCR_M_SvL0_SaveEntry(p_stFile, "MatrixRotation", SCR_CC_C_Cfg_NoChar);
POS_fn_vGetRotationMatrix (hMatrix,&stVecI,&stVecJ,&stVecK);
SCR_fn_v_SvL0_SaveParameters_MP(p_stFile, SCR_EF_SvL0_Scanf, 1,
"%f,%f,%f,%f,%f,%f,%f,%f,%f",
GLI_M_ValueToFloat(MTH3D_M_xGetXofVector(&stVecI)),
GLI_M_ValueToFloat(MTH3D_M_xGetYofVector(&stVecI)),
GLI_M_ValueToFloat(MTH3D_M_xGetZofVector(&stVecI)),
GLI_M_ValueToFloat(MTH3D_M_xGetXofVector(&stVecJ)),
GLI_M_ValueToFloat(MTH3D_M_xGetYofVector(&stVecJ)),
GLI_M_ValueToFloat(MTH3D_M_xGetZofVector(&stVecJ)),
GLI_M_ValueToFloat(MTH3D_M_xGetXofVector(&stVecK)),
GLI_M_ValueToFloat(MTH3D_M_xGetYofVector(&stVecK)),
GLI_M_ValueToFloat(MTH3D_M_xGetZofVector(&stVecK)));
// save end section
SCR_M_SvL0_SaveEndSection (p_stFile, SCR_CC_C_Cfg_EOL);
// update section object
pSurface->fn_vSectionSaved();
pSurface->GetMatrixSection()->fn_vSectionSaved();
break;
}
}
//#################################################################################
// Surface Element
//#################################################################################
/===========================================================================
Default Constructor
===========================================================================/
SECT_SurfElem::SECT_SurfElem (SCT_tdxHandleOfElementLstSurface hSurfElem, Sector_Object *pOwnerSector)
: CPA_EdMot<SCT_tdxHandleOfElementLstSurface>(hSurfElem),
SECT_EnvElementBase (pOwnerSector)
{
SRF_tdxHandleToSurface hSurface;
// init environment
hSurface = SCT_GetSurfaceInList(hSurfElem);
m_pSurface = pOwnerSector->GetSectorInterface()->GetOrBuildSurface(hSurface);
}
/===========================================================================
New Constructor
===========================================================================/
SECT_SurfElem::SECT_SurfElem (SECT_Surface *pSurface, Sector_Object *pOwnerSector)
: CPA_EdMot<SCT_tdxHandleOfElementLstSurface>(),
SECT_EnvElementBase (pOwnerSector)
{
// init environment
m_pSurface = pSurface;
SCT_fn_vSetHandleOfSurfaceInSurfaceList(GetStruct(), m_pSurface->GetStruct());
}
/===========================================================================
Destructor
===========================================================================/
SECT_SurfElem::~SECT_SurfElem (void)
{
}
/===========================================================================
Surface
===========================================================================/
void SECT_SurfElem::SetSurface (SECT_Surface *pSurface)
{
// if there was a surface, warn coherence manager
if ((m_pSurface)&&(m_pOwnerSector))
g_oCoherenceManager.m_fn_vRemoveALink(m_pOwnerSector, m_pSurface);
// set environment
m_pSurface = pSurface;
// update engine element
SCT_fn_vSetHandleOfSurfaceInSurfaceList(GetStruct(), m_pSurface->GetStruct());
// warn coherence manager
if (m_pOwnerSector)
g_oCoherenceManager.m_fn_vAddALink(m_pOwnerSector, m_pSurface);
// notify modif
if (g_bCanSave)
fn_vWriteSection();
}
//#################################################################################
// Surface List
//#################################################################################
/===========================================================================
Add Surface Element
===========================================================================/
BOOL SECT_SurfaceList::fn_bAddAnElement (SECT_SurfElem *pNewElem, SECT_SurfElem *pPreviousElem, BOOL bUpdateEngine)
{
POSITION pos;
// check element owner
if (pNewElem->GetOwnerSector() != m_pOwnerSector)
return FALSE;
// no previous element => add head
if (!pPreviousElem)
AddHead(pNewElem, bUpdateEngine);
// previous element => add at corresponding position
else
{
pos = Find(pPreviousElem, NULL);
InsertAfter(pos, pNewElem, bUpdateEngine);
}
// warn coherence manager
g_oCoherenceManager.m_fn_vAddALink(m_pOwnerSector, pNewElem->GetSurface());
return TRUE;
}
/===========================================================================
Remove Surface Element
===========================================================================/
void SECT_SurfaceList::fn_vRemoveAnElement (SECT_SurfElem *pOldElem, BOOL bUpdateEngine)
{
POSITION pos;
// add element to the list
pos = Find(pOldElem, NULL);
if (pos)
RemoveAt(pos, bUpdateEngine);
// warn coherence manager
g_oCoherenceManager.m_fn_vRemoveALink(m_pOwnerSector, pOldElem->GetSurface());
}
/===========================================================================
Remove All Elements
===========================================================================/
void SECT_SurfaceList::fn_vRemoveAllElements (BOOL bUpdateEngine)
{
SECT_SurfElem *pElem;
while (GetCount() > 0)
{
pElem = RemoveTail(bUpdateEngine);
g_oCoherenceManager.m_fn_vRemoveALink(m_pOwnerSector, pElem->GetSurface());
}
}
/===========================================================================
Find Surface Element
===========================================================================/
SECT_SurfElem * SECT_SurfaceList::GetElementWithSurface (SECT_Surface *pSurface)
{
SECT_SurfElem *pElem;
POSITION pos;
// check every element
for (pElem = GetHeadElement(pos); pElem; pElem = GetNextElement(pos))
{
if (pElem->GetSurface() == pSurface)
return pElem;
}
// element was not found
return NULL;
}
/===========================================================================
Find Previous Surface Element
===========================================================================/
long SECT_SurfaceList::GetInsertPosition (SECT_SurfElem *pSurfElem)
{
SECT_SurfElem *pElem;
POSITION pos;
long lPosition = 0;
// check every element
for (pElem = GetHeadElement(pos); pElem; pElem = GetNextElement(pos))
{
if (pElem->GetSurface()->GetHeight() <= pSurfElem->GetSurface()->GetHeight())
return lPosition;
lPosition++;
}
// element was not found
return GetCount();
}
/===========================================================================
Find Surface Element
===========================================================================/
long SECT_SurfaceList::GetCurrentPosition (SECT_SurfElem *pSurfElem)
{
SECT_SurfElem *pElem;
POSITION pos;
long lPosition = 0;
// check every element
for (pElem = GetHeadElement(pos); pElem; pElem = GetNextElement(pos))
{
if (pElem == pSurfElem)
return lPosition;
lPosition++;
}
// element was not found
return -1;
}
*/

View File

@@ -0,0 +1,113 @@
/*=========================================================================
*
* SECdDist.cpp : Distance dialog - Implementation file
*
*
* Version 1.0
* Creation date 16/08/97
* Revision date 18/08/97
*
* Shaitan
*=======================================================================*/
#include "stdafx.h"
#include "acp_base.h"
#include "SECdDist.hpp"
#include "SECTint.hpp"
#include "..\Main\Inc\_EditID.h"
#include "TUT.h"
//#################################################################################
// SECT_DialogReplace dialog
//#################################################################################
/*----------------------------------------
----------------------------------------*/
SECT_DialogDistance::SECT_DialogDistance(CWnd* pParent /*=NULL*/)
: CDialog(SECT_DialogDistance::IDD, pParent)
{
// init editor
m_pSectorInterface = NULL;
m_lLinkDistance = 1;
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogDistance::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SECT_DialogDistance)
DDX_Control(pDX, SECT_IDC_DISTANCE, m_cEditDistance);
//}}AFX_DATA_MAP
}
/*----------------------------------------
----------------------------------------*/
BEGIN_MESSAGE_MAP(SECT_DialogDistance, CDialog)
//{{AFX_MSG_MAP(SECT_DialogDistance)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//#################################################################################
// SECT_DialogDistance message handlers
//#################################################################################
/*----------------------------------------
----------------------------------------*/
BOOL SECT_DialogDistance::OnInitDialog (void)
{
CString csText;
CDialog::OnInitDialog();
// FOR TUTORIAL
TUT_M_vGetTutDll();
TUT_M_vRegisterControl(m_cEditDistance.m_hWnd, "OSC_DDIST_EDIT_DISTANCE", TUT_e_TextEdit);
// END TUTORIAL
// Init Distance
csText.Format("%ld", m_lLinkDistance);
m_cEditDistance.SetWindowText(csText);
return TRUE;
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogDistance::OnOK (void)
{
char szText[15];
// get distance
m_cEditDistance.GetWindowText(szText, 15);
m_lLinkDistance = atol(szText);
CDialog::OnOK();
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogDistance::fn_vInitSectorInterface (Sector_Interface *pInterface)
{
m_pSectorInterface = pInterface;
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogDistance::OnDestroy (void)
{
// FOR TUTORIAL
TUT_M_vGetTutDll();
TUT_M_vUnregisterControl(m_cEditDistance.m_hWnd);
// END TUTORIAL
CDialog::OnDestroy();
}

View File

@@ -0,0 +1,560 @@
/*=========================================================================
*
* SECdEdit.cpp : Edited Sector Dialog - Implementation file
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
#include "stdafx.h"
#include "acp_base.h"
#include "SECTint.hpp"
#include "SECdEdit.hpp"
#include "SECmodif.hpp"
#include "..\Main\Inc\_EditID.h"
#include "TUT.h"
#define C_xMinZfar 10.0
#define C_MinPriorityLevel C_SectorMinPriority - C_SectorNormalPriority + 1
#define C_MaxPriorityLevel C_SectorMaxPriority - C_SectorNormalPriority - 1
//#################################################################################
// SECT_DialogEdit dialog
//#################################################################################
/*----------------------------------------
----------------------------------------*/
SECT_DialogEdit::SECT_DialogEdit(CWnd* pParent)
: CFormView(SECT_DialogEdit::IDD)
{
//{{AFX_DATA_INIT(SECT_DialogEdit)
//}}AFX_DATA_INIT
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogEdit::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SECT_DialogEdit)
DDX_Control(pDX, SECT_IDC_EDITEDSECTOR, m_cComboSector);
DDX_Control(pDX, SECT_IDC_EDITVIRTUAL, m_cVirtual);
DDX_Control(pDX, SECT_IDC_ZMAXCHECK, m_cZmaxCheck);
DDX_Control(pDX, SECT_IDC_ZMAXVALUE, m_cZmaxEdit);
DDX_Control(pDX, SECT_IDC_ZFARCHECK, m_cZfarCheck);
DDX_Control(pDX, SECT_IDC_ZFARVALUE, m_cZfarEdit);
DDX_Control(pDX, SECT_IDC_ZMAXDEFAULT, m_cDefault);
DDX_Control(pDX, SECT_IDC_CAMERATYPE, m_cCamTypeEdit);
DDX_Control(pDX, SECT_IDC_PRIORITY, m_cPriorityEdit);
DDX_Control(pDX, SECT_IDC_PSPIN, m_cPrioritySpin);
//}}AFX_DATA_MAP
}
/*----------------------------------------
----------------------------------------*/
BEGIN_MESSAGE_MAP(SECT_DialogEdit, CFormView)
//{{AFX_MSG_MAP(SECT_DialogEdit)
ON_WM_SIZE()
ON_WM_DESTROY()
ON_CBN_SELCHANGE(SECT_IDC_EDITEDSECTOR, OnSelChangeComboSector)
ON_BN_CLICKED(SECT_IDC_EDITVIRTUAL, OnVirtual)
ON_BN_CLICKED(SECT_IDC_ZMAXCHECK, OnZmaxCheck)
ON_EN_KILLFOCUS(SECT_IDC_ZMAXVALUE, OnEditZmax)
ON_BN_CLICKED(SECT_IDC_ZFARCHECK, OnZfarCheck)
ON_EN_KILLFOCUS(SECT_IDC_ZFARVALUE, OnEditZfar)
ON_BN_CLICKED(SECT_IDC_ZMAXDEFAULT, OnDefault)
ON_EN_KILLFOCUS(SECT_IDC_CAMERATYPE, OnEditCamType)
// ON_EN_KILLFOCUS(SECT_IDC_PRIORITY, OnEditPriority)
ON_NOTIFY(UDN_DELTAPOS, SECT_IDC_PSPIN, OnPrioritySpin)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//#################################################################################
// SECT_DialogEdit Inits
//#################################################################################
/*===========================================================================
* Description: Init dialog
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
void SECT_DialogEdit::fn_vInitDialog (Sector_Interface *p_oDLL, CWnd *pParent, const CString csTag)
{
// create the dialog
m_bInitialised = FALSE;
m_pSectorInterface = p_oDLL;
CFormView::Create(NULL, "", AFX_WS_DEFAULT_VIEW, CRect(0,0,120,180), pParent, AFX_IDW_PANE_FIRST, NULL);
// init data for dialog
CFormView::UpdateData(FALSE);
// FOR TUTORIAL
TUT_M_vGetTutDll();
TUT_M_vRegisterControl(m_cComboSector.m_hWnd, "OSC_DEDIT"+ csTag + "_COMBO_EDITEDSECTOR", TUT_e_ComboBox);
TUT_M_vRegisterControl(m_cVirtual.m_hWnd, "OSC_DEDIT"+ csTag + "_CHECK_VIRTUALSECTOR", TUT_e_Button );
TUT_M_vRegisterControl(m_cZmaxCheck.m_hWnd, "OSC_DEDIT"+ csTag + "_CHECK_ZMAXSECTOR", TUT_e_Button );
TUT_M_vRegisterControl(m_cZmaxEdit.m_hWnd, "OSC_DEDIT"+ csTag + "_EDIT_ZMAXSECTOR", TUT_e_TextEdit);
TUT_M_vRegisterControl(m_cZfarCheck.m_hWnd, "OSC_DEDIT"+ csTag + "_CHECK_ZFARSECTOR", TUT_e_Button );
TUT_M_vRegisterControl(m_cZfarEdit.m_hWnd, "OSC_DEDIT"+ csTag + "_EDIT_ZFARSECTOR", TUT_e_TextEdit);
TUT_M_vRegisterControl(m_cCamTypeEdit.m_hWnd, "OSC_DEDIT"+ csTag + "_EDIT_CAMERASECTOR", TUT_e_TextEdit);
TUT_M_vRegisterControl(m_cPrioritySpin.m_hWnd, "OSC_DEDIT"+ csTag + "_SPIN_PRIORITYSECTOR", TUT_e_Spin);
// END TUTORIAL
// inti spin parameters
m_cPrioritySpin.SetBuddy(&m_cPriorityEdit);
m_cPrioritySpin.SetRange(C_MinPriorityLevel, C_MaxPriorityLevel);
m_cPrioritySpin.SetPos(0);
// init all controls
fn_vReinitDialog(NULL);
m_bInitialised = TRUE;
}
/*===========================================================================
* Description: Init all controls
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
void SECT_DialogEdit::fn_vReinitDialog (CPA_SuperObject *pSector)
{
CPA_BaseObjectList *pListObject;
CPA_BaseObject *pElem;
Sector_Object *pSectObj;
Position pos;
CString csText;
BOOL bZmax;
BOOL bZfar;
int iInd;
// init sector
m_pEditedSector = pSector;
// reinit combo
m_cComboSector.ResetContent();
pListObject = m_pSectorInterface->GetBaseObjectList(C_szSectorTypeName);
if (pListObject->GetCount() > 0)
{
for (pElem = pListObject->GetHeadElement(pos); pElem; pElem = pListObject->GetNextElement(pos))
m_cComboSector.AddString(pElem->GetName());
}
// select current sector
if (!m_pEditedSector)
{
strcpy(m_szName, "");
m_cComboSector.SetCurSel(-1);
// virtual
m_cVirtual.SetCheck(0);
m_cVirtual.EnableWindow(FALSE);
// zmax
m_cZmaxCheck.SetCheck(0);
m_cZmaxCheck.EnableWindow(FALSE);
m_cZmaxEdit.SetWindowText("");
m_cZmaxEdit.EnableWindow(FALSE);
// zfar
m_cZfarCheck.SetCheck(0);
m_cZfarCheck.EnableWindow(FALSE);
m_cZfarEdit.SetWindowText("");
m_cZfarEdit.EnableWindow(FALSE);
// camera
m_cCamTypeEdit.SetWindowText("");
m_cCamTypeEdit.EnableWindow(FALSE);
// priority
m_cPrioritySpin.SetPos(0);
m_cPrioritySpin.EnableWindow(FALSE);
}
else
{
pSectObj = (Sector_Object *) m_pEditedSector->GetObject();
// sector
strcpy(m_szName, pSectObj->GetName());
iInd = m_cComboSector.FindStringExact(-1,m_szName);
m_cComboSector.SetCurSel(iInd);
// vitual
m_cVirtual.SetCheck(pSectObj->fn_bIsVirtual());
m_cVirtual.EnableWindow(TRUE);
// Zmax
m_cZmaxCheck.EnableWindow(TRUE);
bZmax = (pSectObj->GetZmaxOfBorder() != MTH_C_InfinitMinus);
m_cZmaxCheck.SetCheck(bZmax);
m_cZmaxEdit.EnableWindow(bZmax);
if (bZmax)
csText.Format("%5.2f", (float) pSectObj->GetZmaxOfBorder());
else
csText = "";
m_cZmaxEdit.SetWindowText(csText);
// Zfar
m_cZfarCheck.EnableWindow(TRUE);
bZfar = (pSectObj->GetZfarInSector() != MTH_C_ZERO );
m_cZfarCheck.SetCheck(bZfar);
m_cZfarEdit.EnableWindow(bZfar);
if (bZfar)
csText.Format("%5.2f", (float) pSectObj->GetZfarInSector());
else
csText = "";
m_cZfarEdit.SetWindowText(csText);
// camera type
m_cCamTypeEdit.EnableWindow(TRUE);
csText.Format("%d", (int) pSectObj->GetCameraType());
m_cCamTypeEdit.SetWindowText(csText);
// priority
m_cPrioritySpin.EnableWindow(TRUE);
m_cPrioritySpin.SetPos(pSectObj->GetPriority() - C_SectorNormalPriority);
//csText.Format("%d", (int) pSectObj->GetPriority());
//m_cPriorityEdit.SetWindowText(csText);
}
}
//#################################################################################
// SECT_DialogEdit Messages
//#################################################################################
/*----------------------------------------
----------------------------------------*/
void SECT_DialogEdit::OnSize (UINT nFlags, int cx, int cy)
{
RECT WindowPosition;
int ecx;
if (!m_bInitialised)
return;
// calculate name position
GetWindowRect(&WindowPosition);
ecx = WindowPosition.right - WindowPosition.left - 10;
ecx = (ecx < 60) ? 60 : ecx;
// move name
m_cComboSector.MoveWindow(5, 5, ecx-55, 20);
m_cVirtual.MoveWindow(ecx-45, 5, 50, 20);
// move Zmax
m_cZmaxCheck.MoveWindow(5, 30, 100, 20);
m_cZmaxEdit.MoveWindow(110, 30, 50, 20);
// move Zfar
m_cZfarCheck.MoveWindow(5, 50, 100, 20);
m_cZfarEdit.MoveWindow(110, 50, 50, 20);
// move camera
GetDlgItem(SECT_IDC_STATICCAM)->MoveWindow(5, 70, 100, 20);
m_cCamTypeEdit.MoveWindow(110, 70, 50, 20);
// move priority
GetDlgItem(SECT_IDC_STATICPRIORITY)->MoveWindow(5, 90, 100, 20);
m_cPriorityEdit.MoveWindow(110, 90, 30, 20);
m_cPrioritySpin.MoveWindow(140, 90, 20, 20);
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogEdit::OnSelChangeComboSector (void)
{
char szName[256];
if (!m_bInitialised)
return;
// name was changed ?
m_cComboSector.GetLBText(m_cComboSector.GetCurSel(), szName);
m_pEditedSector = m_pSectorInterface->GetSectorWithName(szName);
m_pSectorInterface->fn_vReinitEditor(m_pEditedSector);
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogEdit::OnVirtual (void)
{
SECT_ModifVirtualSector *pModif;
Sector_Object *pSector;
pSector = (Sector_Object *) m_pEditedSector->GetObject();
// check if virtual status can be changed
if (m_pSectorInterface->fn_bCanChangeVirtual(m_pEditedSector, m_cVirtual.GetCheck()))
{
pModif = new SECT_ModifVirtualSector(m_pSectorInterface, E_tm_VirtualStatus,
m_pEditedSector, m_cVirtual.GetCheck());
m_pSectorInterface->M_GetEditManager()->AskFor(pModif);
}
else
m_cVirtual.SetCheck(((Sector_Object *)m_pEditedSector->GetObject())->fn_bIsVirtual());
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogEdit::OnZmaxCheck (void)
{
Sector_Object *pSector;
MTH_tdxReal xZmax;
CString csText;
pSector = (Sector_Object *) m_pEditedSector->GetObject();
// update sector
xZmax = pSector->GetZmaxOfSector();
pSector->SetZmaxOfBorder(xZmax);
// cancel Zmax
if (!m_cZmaxCheck.GetCheck())
{
// update sector
pSector->SetZmaxOfBorder(MTH_C_InfinitMinus);
// update dialog
m_cZmaxEdit.SetWindowText("");
m_cZmaxEdit.EnableWindow(FALSE);
}
// init Zmax
else
{
// update dialog
m_cZmaxEdit.EnableWindow(TRUE);
csText.Format("%5.2f", (float) pSector->GetZmaxOfBorder());
m_cZmaxEdit.SetWindowText(csText);
}
m_pSectorInterface->GetInterface()->fn_vUpdateAll(E_mc_JustDraw);
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogEdit::OnEditZmax()
{
Sector_Object *pSector;
MTH_tdxReal xNewZmax;
char szVal[15];
pSector = (Sector_Object *) m_pEditedSector->GetObject();
if (m_cZmaxEdit.GetModify())
{
m_cZmaxEdit.GetWindowText(szVal, 15);
xNewZmax = (float) atof(szVal);
pSector->SetZmaxOfBorder(xNewZmax);
}
m_pSectorInterface->GetInterface()->fn_vUpdateAll(E_mc_JustDraw);
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogEdit::OnZfarCheck (void)
{
Sector_Object *pSector;
CString csText;
pSector = (Sector_Object *) m_pEditedSector->GetObject();
// cancel Zmax
if (!m_cZfarCheck.GetCheck())
{
// update sector
pSector->SetZfarInSector(MTH_C_ZERO);
// update dialog
m_cZfarEdit.SetWindowText("");
m_cZfarEdit.EnableWindow(FALSE);
}
// init Zmax
else
{
// update dialog
m_cZfarEdit.EnableWindow(TRUE);
pSector->SetZfarInSector(C_xMinZfar);
csText.Format("%5.2f", (float) pSector->GetZfarInSector());
m_cZfarEdit.SetWindowText(csText);
}
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogEdit::OnEditZfar()
{
Sector_Object *pSector;
MTH_tdxReal xNewZfar;
CString csText;
char szVal[15];
pSector = (Sector_Object *) m_pEditedSector->GetObject();
if (m_cZfarEdit.GetModify())
{
m_cZfarEdit.GetWindowText(szVal, 15);
xNewZfar = (float) atof(szVal);
if (xNewZfar >= C_xMinZfar)
pSector->SetZfarInSector(xNewZfar);
else
{
csText.Format("%5.2f", (float) pSector->GetZfarInSector());
m_cZfarEdit.SetWindowText(csText);
}
}
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogEdit::OnEditCamType()
{
Sector_Object *pSector;
char szVal[15];
int iNewType;
pSector = (Sector_Object *) m_pEditedSector->GetObject();
if (m_cCamTypeEdit.GetModify())
{
m_cCamTypeEdit.GetWindowText(szVal, 15);
iNewType = (int) atoi(szVal);
pSector->SetCameraType((char) iNewType);
}
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogEdit::OnPrioritySpin (NMHDR * pNMHDR, LRESULT * pResult)
{
Sector_Object *pSectObj = NULL;
LPNM_UPDOWN pUpDown;
int iFinalPos;
int iNewPriority;
// get action code
pUpDown = (LPNM_UPDOWN)pNMHDR;
if (pUpDown->hdr.code != UDN_DELTAPOS)
return;
// get parameters
pSectObj = (Sector_Object *) m_pEditedSector->GetObject();
// get final pos
iFinalPos = pUpDown->iPos + pUpDown->iDelta;
iNewPriority = iFinalPos + C_SectorNormalPriority;
// update sector
pSectObj->SetPriority((char) iNewPriority);
}
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEdit::OnEditPriority()
{
Sector_Object *pSector;
CString csText;
char szVal[15];
int iNewPriority;
pSector = (Sector_Object *) m_pEditedSector->GetObject();
if (m_cPriorityEdit.GetModify())
{
// get value
m_cPriorityEdit.GetWindowText(szVal, 15);
iNewPriority = (int) atoi(szVal);
// check limits
if (iNewPriority > C_SectorMaxPriority)
{
iNewPriority = C_SectorMaxPriority;
csText.Format("%d", iNewPriority);
m_cPriorityEdit.SetWindowText(csText);
}
if (iNewPriority < C_SectorMinPriority)
{
iNewPriority = C_SectorMinPriority;
csText.Format("%d", iNewPriority);
m_cPriorityEdit.SetWindowText(csText);
}
pSector->SetPriority((char) iNewPriority);
}
}
*/
/*----------------------------------------
----------------------------------------*/
void SECT_DialogEdit::OnDefault()
{
if (m_cZmaxEdit.GetModify())
{
OnEditZmax();
m_pSectorInterface->GetInterface()->fn_vUpdateAll(E_mc_JustDraw);
m_cZmaxEdit.SetFocus();
}
if (m_cZfarEdit.GetModify())
{
OnEditZfar();
m_cZfarEdit.SetFocus();
}
if (m_cCamTypeEdit.GetModify())
{
OnEditCamType();
m_cCamTypeEdit.SetFocus();
}
/*
if (m_cPriorityEdit.GetModify())
{
OnEditPriority();
m_cPriorityEdit.SetFocus();
}
*/
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogEdit::OnDestroy (void)
{
// FOR TUTORIAL
TUT_M_vGetTutDll();
TUT_M_vUnregisterControl(m_cComboSector.m_hWnd);
TUT_M_vUnregisterControl(m_cVirtual.m_hWnd);
TUT_M_vUnregisterControl(m_cZmaxCheck.m_hWnd);
TUT_M_vUnregisterControl(m_cZmaxEdit.m_hWnd);
TUT_M_vUnregisterControl(m_cZfarCheck.m_hWnd);
TUT_M_vUnregisterControl(m_cZfarEdit.m_hWnd);
TUT_M_vUnregisterControl(m_cCamTypeEdit.m_hWnd);
TUT_M_vUnregisterControl(m_cPrioritySpin.m_hWnd);
// END TUTORIAL
CFormView::OnDestroy();
}

View File

@@ -0,0 +1,946 @@
/*=========================================================================
*
* SECTdEnv.cpp : Environment dialog - Implementation file
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
/*
#include "stdafx.h"
#include "acp_base.h"
#include "SECTint.hpp"
#include "SECdEnv.hpp"
#include "SECmodif.hpp"
#include "SECdMec.hpp"
#include "SECdVis.hpp"
#include "SEClEnvs.hpp"
#include "SECdEnvs.hpp"
#include "SECdSrfs.hpp"
#include "..\Main\Inc\_EditID.h"
#include "TUT.h"
SECT_MecEnvironment *g_pClickedMecEnv;
SECT_VisEnvironment *g_pClickedVisEnv;
//#################################################################################
// SECT_DialogEnv dialog
//#################################################################################
/*----------------------------------------
----------------------------------------*/
/*
SECT_DialogEnv::SECT_DialogEnv(CWnd* pParent)
: CFormView(SECT_DialogEnv::IDD)
{
//{{AFX_DATA_INIT(SECT_DialogEnv)
//}}AFX_DATA_INIT
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnv::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SECT_DialogEnv)
DDX_Control(pDX, SECT_IDC_ENVNAME, m_cName);
DDX_Control(pDX, SECT_IDC_ENVDEFAULT, m_cDefault);
DDX_Control(pDX, SECT_IDC_ENVCANCEL, m_cCancel);
DDX_Control(pDX, SECT_IDC_ENVSAVE, m_cSave);
DDX_Control(pDX, SECT_IDC_MECLISTBOX, m_cMecListBox);
DDX_Control(pDX, SECT_IDC_EDITMEC, m_cEditMec);
DDX_Control(pDX, SECT_IDC_NEWMEC, m_cNewMec);
DDX_Control(pDX, SECT_IDC_VISLISTBOX, m_cVisListBox);
DDX_Control(pDX, SECT_IDC_EDITVIS, m_cEditVis);
DDX_Control(pDX, SECT_IDC_NEWVIS, m_cNewVis);
DDX_Control(pDX, SECT_IDC_SOUNDLIST, m_cSndListBox);
//}}AFX_DATA_MAP
}
*/
/*----------------------------------------
----------------------------------------*/
/*
BEGIN_MESSAGE_MAP(SECT_DialogEnv, CFormView)
//{{AFX_MSG_MAP(SECT_DialogEnv)
ON_WM_SIZE()
ON_WM_DESTROY()
ON_EN_KILLFOCUS(SECT_IDC_ENVNAME, OnChangeName)
ON_BN_CLICKED(SECT_IDC_ENVDEFAULT, OnDefault)
ON_BN_CLICKED(SECT_IDC_ENVCANCEL, OnCancel)
ON_BN_CLICKED(SECT_IDC_ENVSAVE, OnSave)
ON_NOTIFY(LVN_ITEMCHANGED, SECT_IDC_MECLISTBOX, OnSelChangeMecListBox)
ON_NOTIFY(NM_DBLCLK, SECT_IDC_MECLISTBOX, OnDblClkMecListBox)
ON_BN_CLICKED(SECT_IDC_EDITMEC, OnEditMec)
ON_BN_CLICKED(SECT_IDC_NEWMEC, OnNewMec)
ON_NOTIFY(LVN_ITEMCHANGED, SECT_IDC_VISLISTBOX, OnSelChangeVisListBox)
ON_NOTIFY(NM_DBLCLK, SECT_IDC_VISLISTBOX, OnDblClkVisListBox)
ON_BN_CLICKED(SECT_IDC_EDITVIS, OnEditVis)
ON_BN_CLICKED(SECT_IDC_NEWVIS, OnNewVis)
ON_CBN_SELCHANGE(SECT_IDC_SOUNDLIST, OnSelChangeSndListBox)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
*/
//#################################################################################
// SECT_DialogEnv Inits
//#################################################################################
/*===========================================================================
* Description: Init dialog
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnv::fn_vInitDialog (Sector_Interface *p_oDLL, CWnd *pParent)
{
// create the dialog
m_bInitialised = FALSE;
m_pSectorInterface = p_oDLL;
CFormView::Create(NULL, "", AFX_WS_DEFAULT_VIEW, CRect(0,0,120,180), pParent, AFX_IDW_PANE_FIRST, NULL);
// init data for dialog
CFormView::UpdateData(FALSE);
// FOR TUTORIAL
TUT_M_vGetTutDll();
// environment
TUT_M_vRegisterControl(m_cName.m_hWnd, "OSC_DENV_EDIT_NAME", TUT_e_TextEdit);
TUT_M_vRegisterControl(m_cDefault.m_hWnd, "OSC_DENV_BUTTON_DEFAULT", TUT_e_Button);
TUT_M_vRegisterControl(m_cCancel.m_hWnd, "OSC_DENV_BUTTON_CANCEL", TUT_e_Button);
TUT_M_vRegisterControl(m_cSave.m_hWnd, "OSC_DENV_BUTTON_SAVE", TUT_e_Button);
// mechanic environment
TUT_M_vRegisterControl(m_cMecListBox.m_hWnd, "OSC_DENV_LIST_MECENVS", TUT_e_ListBox);
TUT_M_vRegisterControl(m_cEditMec.m_hWnd, "OSC_DENV_BUTTON_EDITMEC", TUT_e_Button);
TUT_M_vRegisterControl(m_cNewMec.m_hWnd, "OSC_DENV_BUTTON_NEWMEC", TUT_e_Button);
// visual environment
TUT_M_vRegisterControl(m_cVisListBox.m_hWnd, "OSC_DENV_LIST_VISENVS", TUT_e_ListBox);
TUT_M_vRegisterControl(m_cEditVis.m_hWnd, "OSC_DENV_BUTTON_EDITVIS", TUT_e_Button);
TUT_M_vRegisterControl(m_cNewVis.m_hWnd, "OSC_DENV_BUTTON_NEWVIS", TUT_e_Button);
// sound environment
TUT_M_vRegisterControl(m_cSndListBox.m_hWnd, "OSC_DENV_LIST_SOUNDENVS", TUT_e_ListBox);
// END TUTORIAL
// init all controls
m_pDefaultEnv = NULL;
fn_vInitEnvironment(NULL, FALSE);
// init lists
m_cMecListBox.fn_vInitParameters(this, m_pSectorInterface, E_te_MecEnvironment);
m_cVisListBox.fn_vInitParameters(this, m_pSectorInterface, E_te_VisEnvironment);
m_bInitialised = TRUE;
}
*/
/*===========================================================================
* Description: Init environment and controls
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnv::fn_vInitEnvironment (SECT_Environment *pEnv, BOOL bNewEnv)
{
// no environment and controls enabled => new environment
if ((!pEnv) && bNewEnv)
m_pEnvironment = m_pDefaultEnv;
else
m_pEnvironment = pEnv;
// update controls state
fn_vInitControls(TRUE);
// update parameters
m_csName = (m_pEnvironment) ? m_pEnvironment->GetName() : "";
// update controls
m_cName.SetWindowText(m_csName);
fn_vSelectMechanic((m_pEnvironment) ? m_pEnvironment->GetMecEnvironment() : NULL);
fn_vSelectVisual((m_pEnvironment) ? m_pEnvironment->GetVisEnvironment() : NULL);
fn_vSelectSound((m_pEnvironment) ? m_pEnvironment->GetSndEnvironment() : NULL);
// sound
m_cSndListBox.EnableWindow((m_pEnvironment != NULL));
}
*/
/*===========================================================================
* Description: Init controls
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnv::fn_vInitControls (BOOL bEnable)
{
m_cCancel.EnableWindow(bEnable&&(m_pEnvironment == m_pDefaultEnv));
m_cSave.EnableWindow(bEnable&&(m_pEnvironment == m_pDefaultEnv));
m_cName.EnableWindow(bEnable&&(m_pEnvironment != NULL));
m_cDefault.EnableWindow(bEnable&&(m_pEnvironment != NULL));
// mec
m_cMecListBox.EnableWindow(bEnable);
m_cEditMec.EnableWindow(bEnable);
m_cNewMec.EnableWindow(bEnable);
// vis
m_cVisListBox.EnableWindow(bEnable);
m_cEditVis.EnableWindow(bEnable);
m_cNewVis.EnableWindow(bEnable);
// snd => only if Sound DLL present
if (m_pSectorInterface->GetSoundEnvList())
m_cSndListBox.EnableWindow(bEnable);
else
m_cSndListBox.EnableWindow(FALSE);
}
*/
/*===========================================================================
* Description: Reinit dialog
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnv::fn_vReinitDialog (void)
{
// init default environment
if (!m_pDefaultEnv)
{
m_pDefaultEnv = new SECT_Environment(m_pSectorInterface, NULL, NULL, NULL, "");
m_pDefaultEnv->fn_bUnValidate();
m_pDefaultEnv->fn_vNotifyUnSave();
}
// init mechanic
fn_vInitMecListBox();
// init mechanic
fn_vInitVisListBox();
// init sound
fn_vInitSndListBox();
}
*/
/*===========================================================================
* Description: Init mechanic listbox
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnv::fn_vInitMecListBox (void)
{
// init style
m_cMecListBox.SetOrder(E_lo_Alpha, FALSE, FALSE);
// reinit list
m_cMecListBox.SetSortedList(m_pSectorInterface->GetBaseObjectList(C_szMecEnvironmentTypeName));
// current selection => none
m_cMecListBox.SetSelectedItem(-1);
}
*/
/*===========================================================================
* Description: update mechanic selection
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnv::fn_vSelectMechanic (SECT_MecEnvironment *pMecEnv, BOOL bUpdateEnv)
{
SECT_MecEnvironment *pOldSelect, *pOldCurrent = NULL;
SECT_ModifEnvParams *pModif;
int iInd;
// update mechanic
pOldSelect = m_pMecEnvironment;
m_pMecEnvironment = pMecEnv;
// update mechanic dialog
if (m_pSectorInterface->GetDialogMec())
m_pSectorInterface->GetDialogMec()->fn_vInitMecEnvironment(m_pMecEnvironment, FALSE);
// update environment
if ((bUpdateEnv)&&(m_pEnvironment))
{
pOldCurrent = m_pEnvironment->GetMecEnvironment();
if ((m_pMecEnvironment)&&(m_pMecEnvironment != pOldCurrent))
{
if (m_pEnvironment != m_pDefaultEnv)
{
pModif = new SECT_ModifEnvParams(m_pSectorInterface, E_mt_ChangeMecEnv,
m_pEnvironment, m_pMecEnvironment, NULL, NULL);
m_pSectorInterface->M_GetEditManager()->AskFor(pModif);
}
else
m_pEnvironment->SetMecEnvironment(m_pMecEnvironment, FALSE);
}
}
// redraw previous element
if (pOldSelect != m_pMecEnvironment)
{
iInd = m_cMecListBox.GetCorrespondingIndex((DWORD) pOldSelect);
m_cMecListBox.RedrawItems(iInd, iInd);
}
// redraw previous element
if ((pOldCurrent)&&(pOldCurrent != pOldSelect))
{
iInd = m_cMecListBox.GetCorrespondingIndex((DWORD) pOldCurrent);
m_cMecListBox.RedrawItems(iInd, iInd);
}
// update selection
iInd = m_cMecListBox.GetCorrespondingIndex((DWORD) m_pMecEnvironment);
m_cMecListBox.RedrawItems(iInd, iInd);
// update button
m_cEditMec.EnableWindow(m_pMecEnvironment != NULL);
m_cMecListBox.UpdateWindow();
}
*/
/*===========================================================================
* Description: Init visual listbox
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnv::fn_vInitVisListBox (void)
{
// init style
m_cVisListBox.SetOrder(E_lo_Alpha, FALSE, FALSE);
// reinit list
m_cVisListBox.SetSortedList(m_pSectorInterface->GetBaseObjectList(C_szVisEnvironmentTypeName));
// m_cVisListBox selection => none
m_cVisListBox.SetSelectedItem(-1);
}
*/
/*===========================================================================
* Description: update visual selection
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnv::fn_vSelectVisual (SECT_VisEnvironment *pVisEnv, BOOL bUpdateEnv)
{
SECT_VisEnvironment *pOldSelect, *pOldCurrent = NULL;
SECT_ModifEnvParams *pModif;
int iInd;
// update mechanic
pOldSelect = m_pVisEnvironment;
m_pVisEnvironment = pVisEnv;
// update mechanic dialog
if (m_pSectorInterface->GetDialogVis())
m_pSectorInterface->GetDialogVis()->fn_vInitVisEnvironment(m_pVisEnvironment, FALSE);
// update environment
if ((bUpdateEnv)&&(m_pEnvironment))
{
pOldCurrent = m_pEnvironment->GetVisEnvironment();
if (m_pVisEnvironment != pOldCurrent)
{
if (m_pEnvironment != m_pDefaultEnv)
{
pModif = new SECT_ModifEnvParams(m_pSectorInterface, E_mt_ChangeVisEnv,
m_pEnvironment, NULL, m_pVisEnvironment, NULL);
m_pSectorInterface->M_GetEditManager()->AskFor(pModif);
}
else
m_pEnvironment->SetVisEnvironment(m_pVisEnvironment, FALSE);
}
}
// redraw previous element
if (pOldSelect != m_pVisEnvironment)
{
iInd = m_cVisListBox.GetCorrespondingIndex((DWORD) pOldSelect);
m_cVisListBox.RedrawItems(iInd, iInd);
}
// redraw previous element
if ((pOldCurrent)&&(pOldCurrent != pOldSelect))
{
iInd = m_cVisListBox.GetCorrespondingIndex((DWORD) pOldCurrent);
m_cVisListBox.RedrawItems(iInd, iInd);
}
// update selection
iInd = m_cVisListBox.GetCorrespondingIndex((DWORD) m_pVisEnvironment);
m_cVisListBox.RedrawItems(iInd, iInd);
// update button
m_cEditVis.EnableWindow(m_pVisEnvironment != NULL);
m_cVisListBox.UpdateWindow();
}
*/
/*===========================================================================
* Description: Init sound listbox
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnv::fn_vInitSndListBox (void)
{
CPA_BaseObjectList *pListObject;
CPA_BaseObject *pElem;
Position pos;
int iInd;
// RAZ
m_cSndListBox.ResetContent();
pListObject = m_pSectorInterface->GetSoundEnvList();
if (!pListObject)
return;
// init content
for (pElem = pListObject->GetHeadElement(pos); pElem;
pElem = pListObject->GetNextElement(pos))
{
// reinit list
iInd = m_cSndListBox.AddString(pElem->GetName());
m_cSndListBox.SetItemData(iInd, (DWORD) pElem);
}
// current selection => none
m_cSndListBox.SetCurSel(-1);
}
*/
/*===========================================================================
* Description: update sound selection
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnv::fn_vSelectSound (SECT_SndEnvironment *pSndEnv, BOOL bUpdateEnv)
{
SECT_SndEnvironment *pOldSelect, *pOldCurrent = NULL;
SECT_ModifEnvParams *pModif;
int iInd;
// update mechanic
pOldSelect = m_pSndEnvironment;
m_pSndEnvironment = pSndEnv;
// update sound
if ((bUpdateEnv)&&(m_pEnvironment)&&(m_pEnvironment != m_pDefaultEnv))
{
pOldCurrent = m_pEnvironment->GetSndEnvironment();
if ((m_pSndEnvironment)&&(m_pSndEnvironment != pOldCurrent))
{
pModif = new SECT_ModifEnvParams(m_pSectorInterface, E_mt_ChangeSndEnv,
m_pEnvironment, NULL, NULL, m_pSndEnvironment);
m_pSectorInterface->M_GetEditManager()->AskFor(pModif);
}
}
// update selection
iInd = GetSoundIndex((DWORD) m_pSndEnvironment);
m_cSndListBox.SetCurSel(iInd);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
int SECT_DialogEnv::GetSoundIndex (DWORD pElem)
{
DWORD pData;
int iIndex;
for (iIndex = 0; iIndex < m_cSndListBox.GetCount(); iIndex++)
{
pData = m_cSndListBox.GetItemData(iIndex);
if (pData == pElem)
return iIndex;
}
return -1;
}
*/
//#################################################################################
// Messages
//#################################################################################
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnv::OnSize(UINT, int, int)
{
RECT WindowPosition;
int ecx, ecy;
if (!m_bInitialised)
return;
// calculate name position
GetWindowRect(&WindowPosition);
ecx = WindowPosition.right - WindowPosition.left - 10;
ecx = (ecx < 100) ? 100 : ecx;
ecy = WindowPosition.bottom - WindowPosition.top - 10;
ecy = (ecy < 140) ? 140 : ecy;
// buttons
m_cCancel.MoveWindow(5, 7, 40, 16);
m_cSave.MoveWindow(ecx-35, 7, 40, 16);
// save
m_cName.MoveWindow(50, 5, ecx-90, 20);
// mechanic
GetDlgItem(SECT_IDC_STATICMEC)->MoveWindow(5, 30, ecx/3, ecy-25);
m_cMecListBox.MoveWindow(10, 45, ecx/3-10, ecy-75);
m_cEditMec.MoveWindow(15, ecy-20, 25, 18);
m_cNewMec.MoveWindow(ecx/3-30, ecy-20, 25, 18);
// visual
GetDlgItem(SECT_IDC_STATICVIS)->MoveWindow(ecx/3+5, 30, ecx/3, ecy-25);
m_cVisListBox.MoveWindow(ecx/3+10, 45, ecx/3-10, ecy-75);
m_cEditVis.MoveWindow(ecx/3+15, ecy-20, 25, 18);
m_cNewVis.MoveWindow(2*ecx/3-30, ecy-20, 25, 18);
// sound
GetDlgItem(SECT_IDC_STATICSOUND)->MoveWindow(2*ecx/3+5, 30, ecx/3, ecy-25);
m_cSndListBox.MoveWindow(2*ecx/3+10, 45, ecx/3-10, ecy-45);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnv::OnDestroy (void)
{
// FOR TUTORIAL
TUT_M_vGetTutDll();
// environment
TUT_M_vUnregisterControl(m_cName.m_hWnd);
TUT_M_vUnregisterControl(m_cDefault.m_hWnd);
TUT_M_vUnregisterControl(m_cCancel.m_hWnd);
TUT_M_vUnregisterControl(m_cSave.m_hWnd);
// mechanic environment
TUT_M_vUnregisterControl(m_cMecListBox.m_hWnd);
TUT_M_vUnregisterControl(m_cEditMec.m_hWnd);
TUT_M_vUnregisterControl(m_cNewMec.m_hWnd);
// visual environment
TUT_M_vUnregisterControl(m_cVisListBox.m_hWnd);
TUT_M_vUnregisterControl(m_cEditVis.m_hWnd);
TUT_M_vUnregisterControl(m_cNewVis.m_hWnd);
// sound environment
TUT_M_vUnregisterControl(m_cSndListBox.m_hWnd);
// END TUTORIAL
CFormView::OnDestroy();
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnv::OnChangeName()
{
CString csFinalName;
char szNewName[256];
// no environment => no modif
if ((!m_pEnvironment)||(!m_cName.GetModify()))
return;
// get corresponding name
m_cName.GetWindowText(szNewName, 255);
if (!strcmp(szNewName, ""))
{
m_cName.SetWindowText(m_csName);
return;
}
// get prefixed name
csFinalName = m_pSectorInterface->GetInterface()->GetPrefixedName(szNewName);
// check name validity
if (m_pEnvironment->fn_eCheckValidity(csFinalName) == E_mc_None)
m_csName = csFinalName;
// update window
m_cName.SetWindowText(m_csName);
// update name
if ((m_pEnvironment != m_pDefaultEnv)&&(m_csName != m_pEnvironment->GetName()))
{
m_pEnvironment->fn_eRename(m_csName);
m_pSectorInterface->GetDialogEnvs()->fn_vInitEnvListBox();
}
// update flag
m_cName.SetModify(FALSE);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnv::OnDefault()
{
if (m_cName.GetModify())
{
OnChangeName();
m_cName.SetFocus();
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnv::OnCancel()
{
// default env => cancel
if (m_pEnvironment == m_pDefaultEnv)
m_pEnvironment = NULL;
// reinit controls
fn_vInitEnvironment(m_pEnvironment, FALSE);
// enable previous dialog
m_pSectorInterface->GetDialogEnvs()->fn_vInitControls(TRUE);
m_pSectorInterface->GetDialogSrf()->fn_vInitControls(TRUE);
m_pSectorInterface->GetDialogEnvList()->fn_vInitControls(TRUE);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnv::OnSave()
{
// default env => create it
if (m_pEnvironment == m_pDefaultEnv)
{
m_pEnvironment = new SECT_Environment(m_pSectorInterface, m_pMecEnvironment,
m_pVisEnvironment, m_pSndEnvironment, m_csName);
m_pEnvironment->fn_vNotifySave();
m_pSectorInterface->GetDialogEnvs()->fn_vInitEnvListBox();
}
// enable previous dialog
m_pSectorInterface->GetDialogEnvList()->fn_vInitControls(TRUE);
m_pSectorInterface->GetDialogSrf()->fn_vInitControls(TRUE);
m_pSectorInterface->GetDialogEnvs()->fn_vInitControls(TRUE);
m_pSectorInterface->GetDialogEnvs()->fn_vSelectEnv(m_pEnvironment);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnv::OnSelChangeMecListBox(NMHDR* pNMHDR, LRESULT* pResult)
{
SECT_MecEnvironment *pMecEnv = NULL;
LPNM_LISTVIEW pNMListView = (LPNM_LISTVIEW)pNMHDR;
BOOL bOldSelect, bNewSelect;
int iIndex;
// update param
*pResult = 0;
if ((pNMListView->uChanged != LVIF_STATE)||(m_cMecListBox.fn_bIsSelecting()))
return;
bOldSelect = (pNMListView->uOldState & LVIS_SELECTED);
bNewSelect = (pNMListView->uNewState & LVIS_SELECTED);
// get corresponding sector
iIndex = pNMListView->iItem;
pMecEnv = (SECT_MecEnvironment *) m_cMecListBox.GetItemData(iIndex);
g_pClickedMecEnv = pMecEnv;
m_cMecListBox.SetSelectedItem(-1);
if (bOldSelect != bNewSelect)
{
// no env or unavailable env => invalid
if ((!pMecEnv)||(!pMecEnv->fn_bIsAvailable()))
fn_vSelectMechanic(m_pMecEnvironment, FALSE);
else if (pMecEnv != m_pMecEnvironment)
fn_vSelectMechanic(pMecEnv, FALSE);
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnv::OnDblClkMecListBox(NMHDR* pNMHDR, LRESULT* pResult)
{
SECT_MecEnvironment *pMecEnv = NULL;
// update param
*pResult = 0;
// get corresponding sector
pMecEnv = g_pClickedMecEnv;
g_pClickedMecEnv = NULL;
// no env or unavailable env => invalid
if ((!pMecEnv)||(!pMecEnv->fn_bIsAvailable()))
fn_vSelectMechanic(m_pMecEnvironment);
else
fn_vSelectMechanic(pMecEnv);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnv::OnEditMec()
{
// no mecenv => no edition
if (!m_pMecEnvironment)
return;
// disable dialog
fn_vInitControls(FALSE);
m_pSectorInterface->GetDialogSrf()->fn_vInitControls(FALSE);
m_pSectorInterface->GetDialogEnvs()->fn_vInitControls(FALSE);
m_pSectorInterface->GetDialogEnvList()->fn_vInitControls(FALSE);
// update mechanic dialog
m_pSectorInterface->GetDialogMec()->fn_vInitMecEnvironment(m_pMecEnvironment, TRUE);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnv::OnNewMec()
{
// disable dialog
fn_vInitControls(FALSE);
m_pSectorInterface->GetDialogSrf()->fn_vInitControls(FALSE);
m_pSectorInterface->GetDialogEnvs()->fn_vInitControls(FALSE);
m_pSectorInterface->GetDialogEnvList()->fn_vInitControls(FALSE);
// set selection
m_cMecListBox.SetSelectedItem(-1);
m_pSectorInterface->GetDialogMec()->fn_vInitMecEnvironment(NULL, TRUE);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnv::OnSelChangeVisListBox(NMHDR* pNMHDR, LRESULT* pResult)
{
SECT_VisEnvironment *pVisEnv = NULL;
LPNM_LISTVIEW pNMListView = (LPNM_LISTVIEW)pNMHDR;
BOOL bOldSelect, bNewSelect;
int iIndex;
// update param
*pResult = 0;
if ((pNMListView->uChanged != LVIF_STATE)||(m_cVisListBox.fn_bIsSelecting()))
return;
bOldSelect = (pNMListView->uOldState & LVIS_SELECTED);
bNewSelect = (pNMListView->uNewState & LVIS_SELECTED);
// get corresponding sector
iIndex = pNMListView->iItem;
pVisEnv = (SECT_VisEnvironment *) m_cVisListBox.GetItemData(iIndex);
g_pClickedVisEnv = pVisEnv;
m_cVisListBox.SetSelectedItem(-1);
if (bOldSelect != bNewSelect)
{
// no env or unavailable env => invalid
if ((!pVisEnv)||(!pVisEnv->fn_bIsAvailable()))
fn_vSelectVisual(m_pVisEnvironment, FALSE);
else if (pVisEnv != m_pVisEnvironment)
fn_vSelectVisual(pVisEnv, FALSE);
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnv::OnDblClkVisListBox(NMHDR* pNMHDR, LRESULT* pResult)
{
SECT_VisEnvironment *pVisEnv = NULL;
// update param
*pResult = 0;
// get corresponding sector
pVisEnv = g_pClickedVisEnv;
g_pClickedVisEnv = NULL;
// no env or unavailable env => invalid
if ((pVisEnv)&&(!pVisEnv->fn_bIsAvailable()))
fn_vSelectVisual(m_pVisEnvironment);
else
fn_vSelectVisual(pVisEnv);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnv::OnEditVis()
{
// no visenv => no edition
if (!m_pVisEnvironment)
return;
// disable dialog
fn_vInitControls(FALSE);
m_pSectorInterface->GetDialogSrf()->fn_vInitControls(FALSE);
m_pSectorInterface->GetDialogEnvs()->fn_vInitControls(FALSE);
m_pSectorInterface->GetDialogEnvList()->fn_vInitControls(FALSE);
// update mechanic dialog
m_pSectorInterface->GetDialogVis()->fn_vInitVisEnvironment(m_pVisEnvironment, TRUE);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnv::OnNewVis()
{
// disable dialog
fn_vInitControls(FALSE);
m_pSectorInterface->GetDialogSrf()->fn_vInitControls(FALSE);
m_pSectorInterface->GetDialogEnvs()->fn_vInitControls(FALSE);
m_pSectorInterface->GetDialogEnvList()->fn_vInitControls(FALSE);
// set selection
m_cVisListBox.SetSelectedItem(-1);
m_pSectorInterface->GetDialogVis()->fn_vInitVisEnvironment(NULL, TRUE);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnv::OnSelChangeSndListBox()
{
SECT_SndEnvironment *pSndEnv = NULL;
int iInd;
// no sound DLL => no change in sound environment
if (!m_pSectorInterface->GetSoundEnvList())
return;
// get corresponding element
iInd = m_cSndListBox.GetCurSel();
if (iInd !=-1)
pSndEnv = (SECT_SndEnvironment *) m_cSndListBox.GetItemData(iInd);
// no env or unavailable env => invalid
if ((pSndEnv)&&(!pSndEnv->fn_bIsAvailable()))
fn_vSelectSound(m_pSndEnvironment);
else if (pSndEnv != m_pSndEnvironment)
fn_vSelectSound(pSndEnv);
}
*/
//#################################################################################
// SECT_EnvParamListBox
//#################################################################################
/*----------------------------------------
----------------------------------------*/
/*
SECT_EnvParamListBox::SECT_EnvParamListBox (void)
{
}
*/
/*----------------------------------------
----------------------------------------*/
/*
SECT_EnvParamListBox::~SECT_EnvParamListBox (void)
{
}
*/
/*----------------------------------------
----------------------------------------*/
/*
BOOL SECT_EnvParamListBox::fn_bIsCurrentElement (CPA_BaseObject *pElem)
{
SECT_Environment *pEnv;
// no dialog => no current element
if (!m_pDialog)
return FALSE;
// init parameters
pEnv = ((SECT_DialogEnv *) m_pDialog)->GetCurrentEnv();
switch (m_eType)
{
case E_te_MecEnvironment:
return ((pEnv)&&(pElem == pEnv->GetMecEnvironment()));
case E_te_VisEnvironment:
return ((pEnv)&&(pElem == pEnv->GetVisEnvironment()));
case E_te_SndEnvironment:
return ((pEnv)&&(pElem == pEnv->GetSndEnvironment()));
case E_te_NoType:
return FALSE;
}
return FALSE;
}
*/
/*----------------------------------------
----------------------------------------*/
/*
BOOL SECT_EnvParamListBox::fn_bIsSelectedElement (CPA_BaseObject *pElem)
{
// no dialog => no selected element
if (!m_pDialog)
return FALSE;
switch (m_eType)
{
case E_te_MecEnvironment:
return (pElem == ((SECT_DialogEnv *) m_pDialog)->GetSelectedMecEnv());
case E_te_VisEnvironment:
return (pElem == ((SECT_DialogEnv *) m_pDialog)->GetSelectedVisEnv());
case E_te_SndEnvironment:
return (pElem == ((SECT_DialogEnv *) m_pDialog)->GetSelectedSndEnv());
case E_te_NoType:
return FALSE;
}
return FALSE;
}
*/
/*----------------------------------------
----------------------------------------*/
/*
BOOL SECT_EnvParamListBox::fn_bIsAlreadyUsed (CPA_BaseObject *pElem)
{
return FALSE;
}
*/

View File

@@ -0,0 +1,443 @@
/*=========================================================================
*
* SECdEnvs.cpp : Environments List Dialog - Implementation file
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
/*
#include "stdafx.h"
#include "acp_base.h"
#include "SECTint.hpp"
#include "SECdEnvs.hpp"
#include "SECmodif.hpp"
#include "SECdEnv.hpp"
#include "SEClEnvs.hpp"
#include "..\Main\Inc\_EditID.h"
#include "TUT.h"
SECT_Environment *g_pClickedEnv;
*/
//#################################################################################
// SECT_DialogEnvElem dialog
//#################################################################################
/*----------------------------------------
----------------------------------------*/
/*
SECT_DialogEnvs::SECT_DialogEnvs(CWnd* pParent)
: CFormView(SECT_DialogEnvs::IDD)
{
//{{AFX_DATA_INIT(SECT_DialogEnvs)
//}}AFX_DATA_INIT
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnvs::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SECT_DialogEnvs)
// env elem
DDX_Control(pDX, SECT_IDC_ENVLISTBOX, m_cEnvListBox);
DDX_Control(pDX, SECT_IDC_NEWENV, m_cNewEnv);
DDX_Control(pDX, SECT_IDC_REPLACE, m_cReplace);
//}}AFX_DATA_MAP
}
*/
/*----------------------------------------
----------------------------------------*/
/*
BEGIN_MESSAGE_MAP(SECT_DialogEnvs, CFormView)
//{{AFX_MSG_MAP(SECT_DialogEnvs)
ON_WM_SIZE()
ON_WM_DESTROY()
// env elem
ON_NOTIFY(LVN_ITEMCHANGED, SECT_IDC_ENVLISTBOX, OnSelChangeEnvListBox)
ON_NOTIFY(NM_DBLCLK, SECT_IDC_ENVLISTBOX, OnDblClkEnvListBox)
ON_BN_CLICKED(SECT_IDC_NEWENV, OnNewEnv)
ON_BN_CLICKED(SECT_IDC_REPLACE, OnReplace)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
*/
//#################################################################################
// SECT_DialogEdit Inits
//#################################################################################
/*===========================================================================
* Description: Init dialog
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnvs::fn_vInitDialog (Sector_Interface *p_oDLL, CWnd *pParent)
{
// create the dialog
m_bInitialised = FALSE;
m_pSectorInterface = p_oDLL;
CFormView::Create(NULL, "", AFX_WS_DEFAULT_VIEW, CRect(0,0,120,180), pParent, AFX_IDW_PANE_FIRST, NULL);
// init data for dialog
CFormView::UpdateData(FALSE);
// FOR TUTORIAL
TUT_M_vGetTutDll();
TUT_M_vRegisterControl(m_cEnvListBox.m_hWnd, "OSC_DLISTENV_LIST_ENVS", TUT_e_ListBox);
TUT_M_vRegisterControl(m_cNewEnv.m_hWnd, "OSC_DLISTENV_BUTTON_NEW", TUT_e_Button);
TUT_M_vRegisterControl(m_cReplace.m_hWnd, "OSC_DLISTENV_BUTTON_REP", TUT_e_Button);
// END TUTORIAL
// init all controls
fn_vInitEnvElem(-1);
m_bInitialised = TRUE;
// init listbox
m_cEnvListBox.fn_vInitParameters(this, m_pSectorInterface, E_te_Environment);
}
*/
/*===========================================================================
* Description: Reinit dialog
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnvs::fn_vReinitDialog (void)
{
fn_vInitEnvListBox();
}
*/
/*===========================================================================
* Description: Init controls state
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnvs::fn_vInitControls (BOOL bEnable)
{
m_cEnvListBox.EnableWindow(bEnable);
m_cNewEnv.EnableWindow(bEnable);
}
*/
/*===========================================================================
* Description: Reinit environment list
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnvs::fn_vInitEnvElem (long lEnvElem)
{
Sector_Object *pSector;
// find corresponding element
if (lEnvElem != -1)
pSector = (Sector_Object *) m_pSectorInterface->GetEditedSector()->GetObject();
else
pSector = NULL;
// update edited element
m_lEnvElem = lEnvElem;
m_pEnvElem = (pSector) ? pSector->GetEnvironment(m_lEnvElem) : NULL;
// update infos
fn_vSelectEnv((m_pEnvElem) ? m_pEnvElem->GetEnvironment() : NULL);
m_cEnvListBox.fn_vReinitListObjects();
}
*/
/*===========================================================================
* Description: Init listbox with all available environments
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnvs::fn_vInitEnvListBox (void)
{
// set list style
m_cEnvListBox.SetOrder(E_lo_Alpha, FALSE, FALSE);
// reinit list
m_cEnvListBox.SetSortedList(m_pSectorInterface->GetBaseObjectList(C_szEnvironmentTypeName));
// current selection => none
m_cEnvListBox.SetSelectedItem(-1);
}
*/
/*===========================================================================
* Description: update dialog when selection changes
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnvs::fn_vSelectEnv (SECT_Environment *pEnvironment, BOOL bUpdateEnvElem)
{
SECT_Environment *pOldSelect, *pOldCurrent = NULL;
SECT_ModifEnvElem *pModif;
int iInd;
// update current environment
pOldSelect = m_pEnvironment;
m_pEnvironment = pEnvironment;
// update corresponding env elem
if ((bUpdateEnvElem)&&(m_pEnvElem))
{
pOldCurrent = m_pEnvElem->GetEnvironment();
if ((m_pEnvironment)&&(m_pEnvironment != pOldCurrent))
{
pModif = new SECT_ModifEnvElem(m_pSectorInterface, E_mt_ChangeEnv,
m_pEnvElem, m_pEnvironment, m_lEnvElem);
m_pSectorInterface->M_GetEditManager()->AskFor(pModif);
}
}
// redraw previous element
if (pOldSelect != m_pEnvironment)
{
iInd = m_cEnvListBox.GetCorrespondingIndex((DWORD) pOldSelect);
m_cEnvListBox.RedrawItems(iInd, iInd);
}
// redraw previous element
if ((pOldCurrent)&&(pOldCurrent != pOldSelect))
{
iInd = m_cEnvListBox.GetCorrespondingIndex((DWORD) pOldCurrent);
m_cEnvListBox.RedrawItems(iInd, iInd);
}
// update selection
iInd = m_cEnvListBox.GetCorrespondingIndex((DWORD) m_pEnvironment);
m_cEnvListBox.RedrawItems(iInd, iInd);
m_cEnvListBox.EnsureVisible(iInd, TRUE);
m_cEnvListBox.UpdateWindow();
// update env list
if ((bUpdateEnvElem)&&(m_pEnvElem))
m_pSectorInterface->GetDialogEnvList()->fn_vUpdateEnvElem();
// update env dialog
if (m_pSectorInterface->GetDialogEnv())
m_pSectorInterface->GetDialogEnv()->fn_vInitEnvironment(m_pEnvironment, FALSE);
}
*/
//#################################################################################
// SECT_DialogEdit Messages
//#################################################################################
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnvs::OnSize (UINT nFlags, int cx, int cy)
{
RECT WindowPosition;
int ecx, ecy;
if (!m_bInitialised)
return;
// calculate name position
GetWindowRect(&WindowPosition);
ecx = WindowPosition.right - WindowPosition.left;
ecx = (ecx < 70) ? 70 : ecx;
ecy = WindowPosition.bottom - WindowPosition.top - 10;
ecy = (ecy < 100) ? 100 : ecy;
// mechanic
GetDlgItem(SECT_IDC_TEXTENVELEM)->MoveWindow(5, 5, ecx-10, ecy);
m_cEnvListBox.MoveWindow(10, 25, ecx-20, ecy-50);
m_cNewEnv.MoveWindow(5, ecy-20, 30, 18);
m_cReplace.MoveWindow(ecx-38, ecy-20, 30, 18);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnvs::OnDestroy (void)
{
// FOR TUTORIAL
TUT_M_vGetTutDll();
// environment
TUT_M_vUnregisterControl(m_cEnvListBox.m_hWnd);
TUT_M_vUnregisterControl(m_cNewEnv.m_hWnd);
TUT_M_vUnregisterControl(m_cReplace.m_hWnd);
// END TUTORIAL
CFormView::OnDestroy();
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnvs::OnSelChangeEnvListBox (NMHDR* pNMHDR, LRESULT* pResult)
{
SECT_Environment *pEnv = NULL;
LPNM_LISTVIEW pNMListView = (LPNM_LISTVIEW)pNMHDR;
BOOL bOldSelect, bNewSelect;
int iIndex;
// update param
*pResult = 0;
if ((pNMListView->uChanged != LVIF_STATE)||(m_cEnvListBox.fn_bIsSelecting()))
return;
bOldSelect = (pNMListView->uOldState & LVIS_SELECTED);
bNewSelect = (pNMListView->uNewState & LVIS_SELECTED);
// get corresponding sector
iIndex = pNMListView->iItem;
pEnv = (SECT_Environment *) m_cEnvListBox.GetItemData(iIndex);
g_pClickedEnv = pEnv;
m_cEnvListBox.SetSelectedItem(-1);
if (bOldSelect != bNewSelect)
{
// select corresponding environment
if ((!pEnv)||(!pEnv->fn_bIsAvailable()))
fn_vSelectEnv((m_pEnvElem) ? m_pEnvElem->GetEnvironment() : NULL, FALSE);
else
fn_vSelectEnv((pEnv != m_pEnvironment) ? pEnv : NULL, FALSE);
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnvs::OnDblClkEnvListBox (NMHDR* pNMHDR, LRESULT* pResult)
{
SECT_Environment *pEnv = NULL;
// update param
*pResult = 0;
// get corresponding sector
pEnv = g_pClickedEnv;
g_pClickedEnv = NULL;
// select corresponding environment
if ((!pEnv)||(!pEnv->fn_bIsAvailable()))
fn_vSelectEnv((m_pEnvElem) ? m_pEnvElem->GetEnvironment() : NULL);
else
fn_vSelectEnv(pEnv);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnvs::OnNewEnv (void)
{
// update env dialog
fn_vSelectEnv(NULL);
m_pSectorInterface->GetDialogEnv()->fn_vInitEnvironment(NULL, TRUE);
// disable dialog
fn_vInitControls(FALSE);
m_pSectorInterface->GetDialogEnvList()->fn_vInitControls(FALSE);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnvs::OnReplace (void)
{
m_oDialogReplace.fn_vInitSectorInterface(m_pSectorInterface);
m_oDialogReplace.DoModal();
}
*/
//#################################################################################
// SECT_EnvElemListBox
//#################################################################################
/*----------------------------------------
----------------------------------------*/
/*
SECT_EnvElemListBox::SECT_EnvElemListBox (void)
{
}
*/
/*----------------------------------------
----------------------------------------*/
/*
SECT_EnvElemListBox::~SECT_EnvElemListBox (void)
{
}
*/
/*----------------------------------------
----------------------------------------*/
/*
BOOL SECT_EnvElemListBox::fn_bIsCurrentElement (CPA_BaseObject *pElem)
{
SECT_EnvElem *pEnvElem;
// no dialog => no current element
if (!m_pDialog)
return FALSE;
// init parameters
pEnvElem = ((SECT_DialogEnvs *) m_pDialog)->GetCurrentEnvElem();
return ((pEnvElem)&&(pElem == pEnvElem->GetEnvironment()));
}
*/
/*----------------------------------------
----------------------------------------*/
/*
BOOL SECT_EnvElemListBox::fn_bIsSelectedElement (CPA_BaseObject *pElem)
{
// no dialog => no selected element
if (!m_pDialog)
return FALSE;
return (pElem == ((SECT_DialogEnvs *) m_pDialog)->GetSelectedEnvironment());
}
*/
/*----------------------------------------
----------------------------------------*/
/*
BOOL SECT_EnvElemListBox::fn_bIsAlreadyUsed (CPA_BaseObject *pElem)
{
return FALSE;
}
*/

View File

@@ -0,0 +1,635 @@
/*=========================================================================
*
* SECTdMec.cpp : Mechanic Environment dialog - Implementation file
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
/*
#include "stdafx.h"
#include "acp_base.h"
#include "SECTint.hpp"
#include "SECdMec.hpp"
#include "SECmodif.hpp"
#include "SECdEnv.hpp"
#include "SEClEnvs.hpp"
#include "SECdEnvs.hpp"
#include "SECdSrfs.hpp"
#include "..\Main\Inc\_EditID.h"
#include "TUT.h"
*/
//#################################################################################
// SECT_DialogMec dialog
//#################################################################################
/*----------------------------------------
----------------------------------------*/
/*
SECT_DialogMec::SECT_DialogMec(CWnd* pParent)
: CFormView(SECT_DialogMec::IDD)
{
//{{AFX_DATA_INIT(SECT_DialogMec)
//}}AFX_DATA_INIT
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogMec::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SECT_DialogMec)
DDX_Control(pDX, SECT_IDC_MECSAVE, m_cSave);
DDX_Control(pDX, SECT_IDC_MECCANCEL, m_cCancel);
DDX_Control(pDX, SECT_IDC_MECNAME, m_cName);
DDX_Control(pDX, SECT_IDC_MECDEFAULT, m_cDefault);
DDX_Control(pDX, SECT_IDC_GRAVITY, m_cGravity);
DDX_Control(pDX, SECT_IDC_VERTICALX, m_cVectorX);
DDX_Control(pDX, SECT_IDC_VERTICALY, m_cVectorY);
DDX_Control(pDX, SECT_IDC_VERTICALZ, m_cVectorZ);
DDX_Control(pDX, SECT_IDC_VISCOSITY, m_cViscosity);
DDX_Control(pDX, SECT_IDC_DENSITY, m_cDensity);
DDX_Control(pDX, SECT_IDC_LEVEL, m_cLevel);
DDX_Control(pDX, SECT_IDC_STREAMX, m_cStreamX);
DDX_Control(pDX, SECT_IDC_STREAMY, m_cStreamY);
DDX_Control(pDX, SECT_IDC_STREAMZ, m_cStreamZ);
DDX_Control(pDX, SECT_IDC_VOLUMIC, m_cVolumic);
//}}AFX_DATA_MAP
}
*/
/*----------------------------------------
----------------------------------------*/
/*
BEGIN_MESSAGE_MAP(SECT_DialogMec, CFormView)
//{{AFX_MSG_MAP(SECT_DialogMec)
ON_WM_SIZE()
ON_WM_DESTROY()
ON_BN_CLICKED(SECT_IDC_MECSAVE, OnSave)
ON_BN_CLICKED(SECT_IDC_MECCANCEL, OnCancel)
ON_EN_KILLFOCUS(SECT_IDC_MECNAME, OnChangeName)
ON_BN_CLICKED(SECT_IDC_MECDEFAULT, OnDefault)
ON_EN_KILLFOCUS(SECT_IDC_GRAVITY, OnChangeGravity)
ON_EN_KILLFOCUS(SECT_IDC_VERTICALX, OnChangeVectorX)
ON_EN_KILLFOCUS(SECT_IDC_VERTICALY, OnChangeVectorY)
ON_EN_KILLFOCUS(SECT_IDC_VERTICALZ, OnChangeVectorZ)
ON_EN_KILLFOCUS(SECT_IDC_VISCOSITY, OnChangeViscosity)
ON_EN_KILLFOCUS(SECT_IDC_DENSITY, OnChangeDensity)
ON_EN_KILLFOCUS(SECT_IDC_LEVEL, OnChangeLevel)
ON_EN_KILLFOCUS(SECT_IDC_STREAMX, OnChangeStreamX)
ON_EN_KILLFOCUS(SECT_IDC_STREAMY, OnChangeStreamY)
ON_EN_KILLFOCUS(SECT_IDC_STREAMZ, OnChangeStreamZ)
ON_CBN_SELCHANGE(SECT_IDC_VOLUMIC, OnSelChangeComboVolumic)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
*/
//#################################################################################
// SECT_DialogMec Inits
//#################################################################################
/*===========================================================================
* Description: Init dialog
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogMec::fn_vInitDialog (Sector_Interface *p_oDLL, CWnd *pParent)
{
// create the dialog
m_bInitialised = FALSE;
m_pSectorInterface = p_oDLL;
CFormView::Create(NULL, "", AFX_WS_DEFAULT_VIEW, CRect(0,0,120,180), pParent, AFX_IDW_PANE_FIRST, NULL);
// init data for dialog
CFormView::UpdateData(FALSE);
// FOR TUTORIAL
TUT_M_vGetTutDll();
// environment
TUT_M_vRegisterControl(m_cName.m_hWnd, "OSC_DMEC_EDIT_NAME", TUT_e_TextEdit);
TUT_M_vRegisterControl(m_cDefault.m_hWnd, "OSC_DMEC_BUTTON_DEFAULT", TUT_e_Button);
TUT_M_vRegisterControl(m_cCancel.m_hWnd, "OSC_DMEC_BUTTON_CANCEL", TUT_e_Button);
TUT_M_vRegisterControl(m_cSave.m_hWnd, "OSC_DMEC_BUTTON_SAVE", TUT_e_Button);
// gravity
TUT_M_vRegisterControl(m_cGravity.m_hWnd, "OSC_DMEC_EDIT_GRAVITY", TUT_e_TextEdit);
TUT_M_vRegisterControl(m_cVectorX.m_hWnd, "OSC_DMEC_EDIT_VECTORX", TUT_e_TextEdit);
TUT_M_vRegisterControl(m_cVectorY.m_hWnd, "OSC_DMEC_EDIT_VECTORY", TUT_e_TextEdit);
TUT_M_vRegisterControl(m_cVectorZ.m_hWnd, "OSC_DMEC_EDIT_VECTORZ", TUT_e_TextEdit);
// fluid
TUT_M_vRegisterControl(m_cViscosity.m_hWnd, "OSC_DMEC_EDIT_VISCOSITY", TUT_e_TextEdit);
TUT_M_vRegisterControl(m_cDensity.m_hWnd, "OSC_DMEC_EDIT_DENSITY", TUT_e_TextEdit);
TUT_M_vRegisterControl(m_cLevel.m_hWnd, "OSC_DMEC_EDIT_LEVEL", TUT_e_TextEdit);
TUT_M_vRegisterControl(m_cStreamX.m_hWnd, "OSC_DMEC_EDIT_STREAMX", TUT_e_TextEdit);
TUT_M_vRegisterControl(m_cStreamY.m_hWnd, "OSC_DMEC_EDIT_STREAMY", TUT_e_TextEdit);
TUT_M_vRegisterControl(m_cStreamZ.m_hWnd, "OSC_DMEC_EDIT_STREAMZ", TUT_e_TextEdit);
// volumic environment
TUT_M_vRegisterControl(m_cVolumic.m_hWnd, "OSC_DMEC_COMBO_VOLUMIC", TUT_e_ComboBox);
// END TUTORIAL
// init volumic combo
m_cVolumic.ResetContent();
m_cVolumic.AddString(C_EntryVolumicAir);
m_cVolumic.AddString(C_EntryVolumicWater);
m_cVolumic.AddString(C_EntryVolumicLava);
// init environment values
m_pDefaultMecEnv = NULL;
fn_vInitMecEnvironment(NULL, FALSE);
m_bInitialised = TRUE;
}
*/
/*===========================================================================
* Description: Init default mec env
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogMec::fn_vReinitDialog (void)
{
if (!m_pDefaultMecEnv)
{
m_pDefaultMecEnv = new SECT_MecEnvironment(m_pSectorInterface, "");
m_pDefaultMecEnv->fn_bUnValidate();
m_pDefaultMecEnv->fn_vNotifyUnSave();
}
}
*/
/*===========================================================================
* Description: Init all control state
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogMec::fn_vInitControls (BOOL bEnable)
{
// init button states
m_cSave.EnableWindow(bEnable);
m_cCancel.EnableWindow(bEnable);
// init name
m_cName.SetReadOnly(!bEnable);
m_cDefault.EnableWindow(bEnable);
// init gravity controls
m_cGravity.SetReadOnly(!bEnable);
m_cVectorX.SetReadOnly(!bEnable);
m_cVectorY.SetReadOnly(!bEnable);
m_cVectorZ.SetReadOnly(!bEnable);
// init fluid controls
m_cDensity.SetReadOnly(!bEnable);
m_cViscosity.SetReadOnly(!bEnable);
m_cLevel.SetReadOnly(!bEnable);
m_cStreamX.SetReadOnly(!bEnable);
m_cStreamY.SetReadOnly(!bEnable);
m_cStreamZ.SetReadOnly(!bEnable);
// init volumic control
m_cVolumic.EnableWindow(bEnable);
}
*/
/*===========================================================================
* Description: register initial values
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogMec::fn_vInitMecEnvironment (SECT_MecEnvironment *pMecEnv, BOOL bEnable)
{
int iInd;
char szVal[256];
// update or create mec env
if ((!pMecEnv) && bEnable)
m_pMecEnv = m_pDefaultMecEnv;
else
m_pMecEnv = pMecEnv;
// update all controls
fn_vInitControls(bEnable);
// init name
m_csName = (m_pMecEnv) ? m_pMecEnv->GetName() : "";
// init gravity
m_xGravity = (m_pMecEnv) ? (float) m_pMecEnv->GetGravity() : (float) 0.0;
m_pVertical = (m_pMecEnv) ? m_pMecEnv->GetVertical() : NULL;
// init fluid
m_xViscosity = (m_pMecEnv) ? (float) m_pMecEnv->GetFluidViscosity() : (float) 0.0;
m_xDensity = (m_pMecEnv) ? (float) m_pMecEnv->GetFluidDensity() : (float) 0.0;
m_xLevel = (m_pMecEnv) ? (float) m_pMecEnv->GetFluidLevel() : (float) 0.0;
m_pStream = (m_pMecEnv) ? m_pMecEnv->GetFluidStream() : NULL;
// init volumic
m_csVolumic = (m_pMecEnv) ? m_pMecEnv->GetVolumicEnvironment() : "";
// init text
if (!m_pMecEnv)
{
m_cName.SetWindowText("");
m_cGravity.SetWindowText("");
m_cVectorX.SetWindowText("");
m_cVectorY.SetWindowText("");
m_cVectorZ.SetWindowText("");
m_cDensity.SetWindowText("");
m_cViscosity.SetWindowText("");
m_cLevel.SetWindowText("");
m_cStreamX.SetWindowText("");
m_cStreamY.SetWindowText("");
m_cStreamZ.SetWindowText("");
m_cVolumic.SetCurSel(-1);
}
else
{
// name
m_cName.SetWindowText(m_csName);
// gravity
sprintf(szVal, "%5.2f", m_xGravity);
m_cGravity.SetWindowText(szVal);
sprintf(szVal, "%5.2f", m_pVertical->m_xX);
m_cVectorX.SetWindowText(szVal);
sprintf(szVal, "%5.2f", m_pVertical->m_xY);
m_cVectorY.SetWindowText(szVal);
sprintf(szVal, "%5.2f", m_pVertical->m_xZ);
m_cVectorZ.SetWindowText(szVal);
// fluid
sprintf(szVal, "%5.2f", m_xDensity);
m_cDensity.SetWindowText(szVal);
sprintf(szVal, "%5.2f", m_xViscosity);
m_cViscosity.SetWindowText(szVal);
sprintf(szVal, "%5.2f", m_xLevel);
m_cLevel.SetWindowText(szVal);
sprintf(szVal, "%5.2f", m_pStream->m_xX);
m_cStreamX.SetWindowText(szVal);
sprintf(szVal, "%5.2f", m_pStream->m_xY);
m_cStreamY.SetWindowText(szVal);
sprintf(szVal, "%5.2f", m_pStream->m_xZ);
m_cStreamZ.SetWindowText(szVal);
// volumic
iInd = m_cVolumic.FindStringExact(-1, m_csVolumic);
m_cVolumic.SetCurSel(iInd);
}
}
*/
//#################################################################################
// Specific Parameters
//#################################################################################
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogMec::OnChangeName (void)
{
CString csFinalName;
char szNewName[256];
// no mec env => no changes
if ((!m_pMecEnv)||(!m_cName.GetModify()))
return;
// get corresponding name
m_cName.GetWindowText(szNewName, 255);
if (!strcmp(szNewName, ""))
{
m_cName.SetWindowText(m_csName);
return;
}
// get prefixed name
csFinalName = m_pSectorInterface->GetInterface()->GetPrefixedName(szNewName);
// check name validity
if (m_pMecEnv->fn_eCheckValidity(csFinalName) == E_mc_None)
m_csName = csFinalName;
// update window
m_cName.SetWindowText(m_csName);
m_cName.SetModify(FALSE);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogMec::OnChangeGravity (void)
{
char szVal[15];
if (m_cGravity.GetModify())
{
m_cGravity.GetWindowText(szVal, 15);
m_xGravity = (float) atof(szVal);
m_cGravity.SetModify(FALSE);
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogMec::OnChangeVectorX (void)
{
char szVal[15];
if (m_cVectorX.GetModify())
{
m_cVectorX.GetWindowText(szVal, 15);
m_pVertical->m_xX = (float) atof(szVal);
m_cVectorX.SetModify(FALSE);
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogMec::OnChangeVectorY (void)
{
char szVal[15];
if (m_cVectorY.GetModify())
{
m_cVectorY.GetWindowText(szVal, 15);
m_pVertical->m_xY = (float) atof(szVal);
m_cVectorY.SetModify(FALSE);
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogMec::OnChangeVectorZ (void)
{
char szVal[15];
if (m_cVectorZ.GetModify())
{
m_cVectorZ.GetWindowText(szVal, 15);
m_pVertical->m_xZ = (float) atof(szVal);
m_cVectorZ.SetModify(FALSE);
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogMec::OnChangeViscosity (void)
{
char szVal[15];
if (m_cViscosity.GetModify())
{
m_cViscosity.GetWindowText(szVal, 15);
m_xViscosity = (float) atof(szVal);
m_cViscosity.SetModify(FALSE);
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogMec::OnChangeDensity (void)
{
char szVal[15];
if (m_cDensity.GetModify())
{
m_cDensity.GetWindowText(szVal, 15);
m_xDensity = (float) atof(szVal);
m_cDensity.SetModify(FALSE);
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogMec::OnChangeLevel (void)
{
char szVal[15];
if (m_cLevel.GetModify())
{
m_cLevel.GetWindowText(szVal, 15);
m_xLevel = (float) atof(szVal);
m_cLevel.SetModify(FALSE);
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogMec::OnChangeStreamX (void)
{
char szVal[15];
if (m_cStreamX.GetModify())
{
m_cStreamX.GetWindowText(szVal, 15);
m_pStream->m_xX = (float) atof(szVal);
m_cStreamX.SetModify(FALSE);
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogMec::OnChangeStreamY (void)
{
char szVal[15];
if (m_cStreamY.GetModify())
{
m_cStreamY.GetWindowText(szVal, 15);
m_pStream->m_xY = (float) atof(szVal);
m_cStreamY.SetModify(FALSE);
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogMec::OnChangeStreamZ (void)
{
char szVal[15];
if (m_cStreamZ.GetModify())
{
m_cStreamZ.GetWindowText(szVal, 15);
m_pStream->m_xZ = (float) atof(szVal);
m_cStreamZ.SetModify(FALSE);
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogMec::OnSelChangeComboVolumic (void)
{
char szText[256];
// get corresponding environment
m_cVolumic.GetLBText(m_cVolumic.GetCurSel(), szText);
// update value
m_csVolumic = szText;
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogMec::OnSave()
{
SECT_ModifMecEnvParams *pModif;
// no mec env => no changes
if (!m_pMecEnv)
return;
// default mec env => create new one
if (m_pMecEnv == m_pDefaultMecEnv)
m_pMecEnv = new SECT_MecEnvironment(m_pSectorInterface, m_csName);
// modif
pModif = new SECT_ModifMecEnvParams(m_pSectorInterface, E_tm_ModifMecEnv, m_pMecEnv,
m_csName, m_xGravity, m_pVertical, m_xViscosity,
m_xDensity, m_xLevel, m_pStream, m_csVolumic);
m_pSectorInterface->M_GetEditManager()->AskFor(pModif);
// give controtl to dialog env & update combo meca
m_pSectorInterface->GetDialogEnv()->fn_vInitMecListBox();
m_pSectorInterface->GetDialogEnv()->fn_vSelectMechanic(m_pMecEnv);
m_pSectorInterface->GetDialogEnv()->fn_vInitControls(TRUE);
m_pSectorInterface->GetDialogSrf()->fn_vInitControls(TRUE);
m_pSectorInterface->GetDialogEnvs()->fn_vInitControls(TRUE);
m_pSectorInterface->GetDialogEnvList()->fn_vInitControls(TRUE);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogMec::OnCancel()
{
// new mec env => cancel
if (m_pMecEnv == m_pDefaultMecEnv)
m_pMecEnv = NULL;
// reinit controls
fn_vInitMecEnvironment(m_pMecEnv, FALSE);
// give controtl to dialog env
m_pSectorInterface->GetDialogEnv()->fn_vInitControls(TRUE);
m_pSectorInterface->GetDialogSrf()->fn_vInitControls(TRUE);
m_pSectorInterface->GetDialogEnvs()->fn_vInitControls(TRUE);
m_pSectorInterface->GetDialogEnvList()->fn_vInitControls(TRUE);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogMec::OnDefault()
{
if (m_cName.GetModify())
{
OnChangeName();
m_cName.SetFocus();
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogMec::OnSize(UINT, int, int)
{
RECT WindowPosition;
int ecx, ecy;
if (!m_bInitialised)
return;
// calculate name position
GetWindowRect(&WindowPosition);
ecx = WindowPosition.right - WindowPosition.left;
ecx = (ecx < 310) ? 0 : ecx-300;
ecy = WindowPosition.bottom - WindowPosition.top;
ecy = (ecy < 180) ? 0 : ecy-180;
// buttons
m_cCancel.MoveWindow(ecx/2, 7, 40, 16);
m_cSave.MoveWindow(ecx/2+260, 7, 40, 16);
// name
m_cName.MoveWindow(ecx/2+50, 5, 200, 20);
// Volumic environment
GetDlgItem(SECT_IDC_TEXTVOLUMIC)->MoveWindow(ecx/2, 30, 147, 40);
m_cVolumic.MoveWindow(ecx/2+10, 45, 130, 20);
// Gravity parameters
GetDlgItem(SECT_IDC_TEXTGRAVITY)->MoveWindow(ecx/2, 75, 147, 90);
GetDlgItem(SECT_IDC_TEXTCOEFF)->MoveWindow(ecx/2+10, 91, 60, 18);
m_cGravity.MoveWindow(ecx/2+80, 90, 60, 20);
GetDlgItem(SECT_IDC_TEXTVERTICAL)->MoveWindow(ecx/2+10, 115, 70, 18);
m_cVectorX.MoveWindow(ecx/2+5, 135, 43, 20);
m_cVectorY.MoveWindow(ecx/2+50, 135, 43, 20);
m_cVectorZ.MoveWindow(ecx/2+95, 135, 43, 20);
// mechanic
GetDlgItem(SECT_IDC_TEXTFLUID)->MoveWindow(ecx/2+152, 30, 147, 135);
GetDlgItem(SECT_IDC_TEXTVISCOSITY)->MoveWindow(ecx/2+162, 46, 60, 18);
m_cViscosity.MoveWindow(ecx/2+232, 45, 60, 20);
GetDlgItem(SECT_IDC_TEXTDENSITY)->MoveWindow(ecx/2+162, 68, 60, 18);
m_cDensity.MoveWindow(ecx/2+232, 67, 60, 20);
GetDlgItem(SECT_IDC_TEXTLEVEL)->MoveWindow(ecx/2+162, 90, 60, 18);
m_cLevel.MoveWindow(ecx/2+232, 89, 60, 20);
GetDlgItem(SECT_IDC_TEXTSTREAM)->MoveWindow(ecx/2+162, 115, 70, 18);
m_cStreamX.MoveWindow(ecx/2+157, 135, 43, 20);
m_cStreamY.MoveWindow(ecx/2+202, 135, 43, 20);
m_cStreamZ.MoveWindow(ecx/2+247, 135, 43, 20);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogMec::OnDestroy (void)
{
// FOR TUTORIAL
TUT_M_vGetTutDll();
// environment
TUT_M_vUnregisterControl(m_cName.m_hWnd);
TUT_M_vUnregisterControl(m_cDefault.m_hWnd);
TUT_M_vUnregisterControl(m_cCancel.m_hWnd);
TUT_M_vUnregisterControl(m_cSave.m_hWnd);
// gravity
TUT_M_vUnregisterControl(m_cGravity.m_hWnd);
TUT_M_vUnregisterControl(m_cVectorX.m_hWnd);
TUT_M_vUnregisterControl(m_cVectorY.m_hWnd);
TUT_M_vUnregisterControl(m_cVectorZ.m_hWnd);
// fluid
TUT_M_vUnregisterControl(m_cViscosity.m_hWnd);
TUT_M_vUnregisterControl(m_cDensity.m_hWnd);
TUT_M_vUnregisterControl(m_cLevel.m_hWnd);
TUT_M_vUnregisterControl(m_cStreamX.m_hWnd);
TUT_M_vUnregisterControl(m_cStreamY.m_hWnd);
TUT_M_vUnregisterControl(m_cStreamZ.m_hWnd);
// volumic environment
TUT_M_vUnregisterControl(m_cVolumic.m_hWnd);
// END TUTORIAL
CFormView::OnDestroy();
}
*/

View File

@@ -0,0 +1,232 @@
/*=========================================================================
*
* SECdMode.cpp : display mode dialog - Implementation file
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
#include "stdafx.h"
#include "acp_base.h"
#include "SECTint.hpp"
#include "SECdMode.hpp"
#include "..\Main\Inc\_EditID.h"
#include "TUT.h"
//#################################################################################
// SECT_DialogMode dialog
//#################################################################################
/*----------------------------------------
----------------------------------------*/
SECT_DialogMode::SECT_DialogMode(CWnd* pParent)
: CFormView(SECT_DialogMode::IDD)
{
//{{AFX_DATA_INIT(SECT_DialogMode)
//}}AFX_DATA_INIT
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogMode::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SECT_DialogMode)
DDX_Control(pDX, SECT_IDC_EDITSECTOR, m_cSector);
DDX_Control(pDX, SECT_IDC_EDITLIST, m_cList);
//Shaitan Clean Env
// DDX_Control(pDX, SECT_IDC_EDITENV, m_cEnv);
DDX_Control(pDX, SECT_IDC_SECTORTEXT, m_cSectorText);
DDX_Control(pDX, SECT_IDC_LISTTEXT, m_cListText);
//Shaitan Clean Env
// DDX_Control(pDX, SECT_IDC_ENVTEXT, m_cEnvText);
DDX_Control(pDX, SECT_IDC_MODESYM, m_cModeSym);
//}}AFX_DATA_MAP
}
/*----------------------------------------
----------------------------------------*/
BEGIN_MESSAGE_MAP(SECT_DialogMode, CFormView)
//{{AFX_MSG_MAP(SECT_DialogMode)
ON_WM_SIZE()
ON_WM_DESTROY()
ON_BN_CLICKED(SECT_IDC_EDITSECTOR, OnSectors)
ON_BN_CLICKED(SECT_IDC_EDITLIST, OnList)
//Shaitan Clean Env
// ON_BN_CLICKED(SECT_IDC_EDITENV, OnEnv)
ON_BN_CLICKED(SECT_IDC_MODESYM, OnModeSym)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
//#################################################################################
// SECT_DialogMode Inits
//#################################################################################
/*===========================================================================
* Description: Init dialog
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
void SECT_DialogMode::fn_vInitDialog (Sector_Interface *pOwnerDLL, CWnd *pParent, BOOL bShowSymetric, const CString csTag)
{
// create the dialog
m_bInitialised = FALSE;
m_pOwnerDLL = pOwnerDLL;
CFormView::Create(NULL, "", AFX_WS_DEFAULT_VIEW, CRect(0,0,120,180), pParent, AFX_IDW_PANE_FIRST, NULL);
// init data for dialog
CFormView::UpdateData(FALSE);
// FOR TUTORIAL
TUT_M_vGetTutDll();
TUT_M_vRegisterControl(m_cModeSym.m_hWnd, "OSC_DMODE" + csTag + "_BUTTON_SYMETRIC", TUT_e_Button);
TUT_M_vRegisterControl(m_cSector.m_hWnd, "OSC_DMODE" + csTag + "_BUTTON_SECTOR", TUT_e_Button);
TUT_M_vRegisterControl(m_cList.m_hWnd, "OSC_DMODE" + csTag + "_BUTTON_LIST", TUT_e_Button);
//Shaitan Clean Env
// TUT_M_vRegisterControl(m_cEnv.m_hWnd, "OSC_DMODE" + csTag + "_BUTTON_ENV", TUT_e_Button);
// END TUTORIAL
// update mode
m_bShowSymetric = bShowSymetric;
m_cModeSym.EnableWindow(bShowSymetric);
m_cModeSym.ShowWindow(bShowSymetric);
m_cModeSym.SetCheck(m_pOwnerDLL->fn_bSymetricMode());
fn_vUpdateEditMode();
m_bInitialised = TRUE;
}
/*===========================================================================
* Description: update dialog when selection changes
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
void SECT_DialogMode::fn_vUpdateEditMode (void)
{
tdeEditMode eEditMode;
eEditMode = m_pOwnerDLL->GetEditMode();
// reinit buttons
m_cSector.SetCheck(eEditMode == E_em_EditSector);
m_cList.SetCheck(eEditMode == E_em_EditList);
//Shaitan Clean Env
// m_cEnv.SetCheck(eEditMode == E_em_EditEnv);
}
//#################################################################################
// SECT_DialogMode Messages
//#################################################################################
/*----------------------------------------
----------------------------------------*/
void SECT_DialogMode::OnSize (UINT nFlags, int cx, int cy)
{
RECT WindowPosition;
int wcx, mcx, scx, mpy;
if (!m_bInitialised)
return;
GetWindowRect(&WindowPosition);
// calculate position
wcx = WindowPosition.right - WindowPosition.left - 20;
//Shaitan Clean Env
mcx = (wcx > 0) ? wcx / 2/*3*/ : 0;
scx = (wcx < 20) ? 20 : wcx-20;
// if necessary, move symetric
if (m_bShowSymetric)
{
m_cModeSym.MoveWindow(20, 2, scx, 18);
mpy = 20;
}
else
mpy = 0;
// move text
m_cSectorText.MoveWindow(5, mpy+5, mcx, 20);
m_cListText.MoveWindow(mcx+10, mpy+5, mcx, 20);
//Shaitan Clean Env
// m_cEnvText.MoveWindow(2*mcx + 15, mpy+5, mcx, 20);
// move radio buttons
m_cSector.MoveWindow(mcx/2, mpy+25, 20, 17);
m_cList.MoveWindow(3*mcx/2 + 5, mpy+25, 20, 17);
//Shaitan Clean Env
// m_cEnv.MoveWindow(5*mcx/2 + 10, mpy+25, 20, 17);
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogMode::OnDestroy (void)
{
// FOR TUTORIAL
TUT_M_vGetTutDll();
TUT_M_vUnregisterControl(m_cModeSym.m_hWnd);
TUT_M_vUnregisterControl(m_cSector.m_hWnd);
TUT_M_vUnregisterControl(m_cList.m_hWnd);
//Shaitan Clean Env
// TUT_M_vUnregisterControl(m_cEnv.m_hWnd);
// END TUTORIAL
CFormView::OnDestroy();
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogMode::OnSectors (void)
{
if (m_cSector.GetCheck())
m_pOwnerDLL->SetEditMode(E_em_EditSector);
else
m_pOwnerDLL->SetEditMode(E_em_EditList);
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogMode::OnList (void)
{
if (m_cList.GetCheck())
m_pOwnerDLL->SetEditMode(E_em_EditList);
else
m_pOwnerDLL->SetEditMode(E_em_EditSector/*E_em_EditEnv*/);
}
/*----------------------------------------
----------------------------------------*/
//Shaitan Clean Env
/*
void SECT_DialogMode::OnEnv (void)
{
if (m_cEnv.GetCheck())
m_pOwnerDLL->SetEditMode(E_em_EditEnv);
else
m_pOwnerDLL->SetEditMode(E_em_EditSector);
}
*/
/*----------------------------------------
----------------------------------------*/
void SECT_DialogMode::OnModeSym (void)
{
m_pOwnerDLL->SetSymetricMode(m_cModeSym.GetCheck());
}

View File

@@ -0,0 +1,184 @@
/*=========================================================================
*
* SECdRep.cpp : Replace dialog - Implementation file
*
*
* Version 1.0
* Creation date 16/08/97
* Revision date 18/08/97
*
* Shaitan
*=======================================================================*/
/*
#include "stdafx.h"
#include "acp_base.h"
#include "SECdRep.hpp"
#include "SECTint.hpp"
#include "SECmodif.hpp"
#include "..\Main\Inc\_EditID.h"
#include "TUT.h"
*/
//#################################################################################
// SECT_DialogReplace dialog
//#################################################################################
/*----------------------------------------
----------------------------------------*/
/*
SECT_DialogReplace::SECT_DialogReplace(CWnd* pParent)
: CDialog(SECT_DialogReplace::IDD, pParent)
{
// init editor
m_pSectorInterface = NULL;
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogReplace::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SECT_DialogReplace)
DDX_Control(pDX, SECT_IDC_CINITENV, m_cInitEnv);
DDX_Control(pDX, SECT_IDC_CNEWENV, m_cNewEnv);
DDX_Control(pDX, SECT_IDC_CURRENT, m_cEdit);
DDX_Control(pDX, SECT_IDC_SELECT, m_cSelect);
DDX_Control(pDX, SECT_IDC_ALL, m_cAll);
//}}AFX_DATA_MAP
}
*/
/*----------------------------------------
----------------------------------------*/
/*
BEGIN_MESSAGE_MAP(SECT_DialogReplace, CDialog)
//{{AFX_MSG_MAP(SECT_DialogReplace)
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
*/
//#################################################################################
// SECT_DialogReplace message handlers
//#################################################################################
/*----------------------------------------
----------------------------------------*/
/*
BOOL SECT_DialogReplace::OnInitDialog (void)
{
CPA_BaseObjectList *pListObjects;
CPA_BaseObject *pObject;
Position pos;
int iIndex;
CDialog::OnInitDialog();
// FOR TUTORIAL
TUT_M_vGetTutDll();
TUT_M_vRegisterControl(m_cInitEnv.m_hWnd, "OSC_DREP_COMBO_OLDENV", TUT_e_ComboBox);
TUT_M_vRegisterControl(m_cNewEnv.m_hWnd, "OSC_DREP_COMBO_NEWENV", TUT_e_ComboBox);
TUT_M_vRegisterControl(m_cEdit.m_hWnd, "OSC_DREP_BUTTON_EDITED", TUT_e_Button);
TUT_M_vRegisterControl(m_cSelect.m_hWnd, "OSC_DREP_BUTTON_SELECTED", TUT_e_Button);
TUT_M_vRegisterControl(m_cAll.m_hWnd, "OSC_DREP_BUTTON_ALLSECTORS", TUT_e_Button);
// END TUTORIAL
// RAZ
m_cInitEnv.ResetContent();
m_cNewEnv.ResetContent();
// init combos
pListObjects = m_pSectorInterface->GetBaseObjectList(C_szEnvironmentTypeName);
for (pObject = pListObjects->GetHeadElement(pos); pObject;
pObject = pListObjects->GetNextElement(pos))
{
// initial environment
iIndex = m_cInitEnv.AddString(pObject->GetNameToDraw());
m_cInitEnv.SetItemData(iIndex, (DWORD) pObject);
// new environment
iIndex = m_cNewEnv.AddString(pObject->GetNameToDraw());
m_cNewEnv.SetItemData(iIndex, (DWORD) pObject);
}
// init radio buttons
m_cEdit.SetCheck(TRUE);
m_cSelect.SetCheck(FALSE);
m_cAll.SetCheck(FALSE);
return TRUE;
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogReplace::OnOK (void)
{
SECT_ModifReplaceEnvironment *pModif;
CPA_List<CPA_SuperObject> oListSectors;
CPA_List<CPA_SuperObject> *pListSectors;
SECT_Environment *pInitEnv, *pNewEnv;
int iIndex;
// init sector list
oListSectors.RemoveAll();
oListSectors.AddTail(m_pSectorInterface->GetEditedSector());
// get initial environment
iIndex = m_cInitEnv.GetCurSel();
pInitEnv = (iIndex != -1) ? (SECT_Environment *) m_cInitEnv.GetItemData(iIndex) : NULL;
// get final environment
iIndex = m_cNewEnv.GetCurSel();
pNewEnv = (iIndex != -1) ? (SECT_Environment *) m_cNewEnv.GetItemData(iIndex) : NULL;
// no replace => can't close dialog
if ((!pInitEnv)||(!pNewEnv)||(pInitEnv == pNewEnv))
return;
// get sector list
if (m_cEdit.GetCheck())
pListSectors = &oListSectors;
else if (m_cSelect.GetCheck())
pListSectors = m_pSectorInterface->GetSelectList();
else
pListSectors = NULL;
// ask for modif
pModif = new SECT_ModifReplaceEnvironment(m_pSectorInterface, E_tm_Replace, pInitEnv, pNewEnv, pListSectors);
m_pSectorInterface->M_GetEditManager()->AskFor(pModif);
CDialog::OnOK();
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogReplace::fn_vInitSectorInterface (Sector_Interface *pInterface)
{
m_pSectorInterface = pInterface;
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogReplace::OnDestroy (void)
{
// FOR TUTORIAL
TUT_M_vGetTutDll();
TUT_M_vUnregisterControl(m_cInitEnv.m_hWnd);
TUT_M_vUnregisterControl(m_cNewEnv.m_hWnd);
TUT_M_vUnregisterControl(m_cEdit.m_hWnd);
TUT_M_vUnregisterControl(m_cSelect.m_hWnd);
TUT_M_vUnregisterControl(m_cAll.m_hWnd);
// END TUTORIAL
CDialog::OnDestroy();
}
*/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,504 @@
/*=========================================================================
*
* SEClEnvs.cpp : Environment List Sector Dialog - Implementation file
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
/*
#include "stdafx.h"
#include "acp_base.h"
#include "SECTint.hpp"
#include "SECdSrfs.hpp"
#include "SECmodif.hpp"
#include "SECdEnv.hpp"
#include "SEClEnvs.hpp"
#include "..\Main\Inc\_EditID.h"
#include "TUT.h"
SECT_Surface *g_pClickedSrf;
*/
//#################################################################################
// SECT_DialogEnvElem dialog
//#################################################################################
/*----------------------------------------
----------------------------------------*/
/*
SECT_DialogSrf::SECT_DialogSrf(CWnd* pParent)
: CFormView(SECT_DialogSrf::IDD)
{
//{{AFX_DATA_INIT(SECT_DialogEnvElem)
//}}AFX_DATA_INIT
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogSrf::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SECT_DialogSrf)
// surf elem
DDX_Control(pDX, SECT_IDC_SURFLISTBOX, m_cSurfListBox);
DDX_Control(pDX, SECT_IDC_VIEWSURF, m_cViewSurf);
DDX_Control(pDX, SECT_IDC_SURFHEIGHT, m_cSurfHeight);
// control
DDX_Control(pDX, SECT_IDC_SRFDEFAULT, m_cDefault);
//}}AFX_DATA_MAP
}
*/
/*----------------------------------------
----------------------------------------*/
/*
BEGIN_MESSAGE_MAP(SECT_DialogSrf, CFormView)
//{{AFX_MSG_MAP(SECT_DialogSrf)
ON_WM_SIZE()
ON_WM_DESTROY()
// surf elem
ON_NOTIFY(LVN_ITEMCHANGED, SECT_IDC_SURFLISTBOX, OnSelChangeSurfListBox)
ON_NOTIFY(NM_DBLCLK, SECT_IDC_SURFLISTBOX, OnDblClkSurfListBox)
ON_EN_KILLFOCUS(SECT_IDC_SURFHEIGHT, OnChangeHeight)
ON_BN_CLICKED(SECT_IDC_VIEWSURF, OnViewSurf)
// default
ON_BN_CLICKED(SECT_IDC_SRFDEFAULT, OnDefault)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
*/
//#################################################################################
// SECT_DialogSrf Inits
//#################################################################################
/*===========================================================================
* Description: Init dialog
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogSrf::fn_vInitDialog (Sector_Interface *p_oDLL, CWnd *pParent)
{
// create the dialog
m_bInitialised = FALSE;
m_pSectorInterface = p_oDLL;
CFormView::Create(NULL, "", AFX_WS_DEFAULT_VIEW, CRect(0,0,120,180), pParent, AFX_IDW_PANE_FIRST, NULL);
// init data for dialog
CFormView::UpdateData(FALSE);
// FOR TUTORIAL
TUT_M_vGetTutDll();
TUT_M_vRegisterControl(m_cSurfListBox.m_hWnd, "OSC_DSRF_LIST_SURFACES", TUT_e_ListBox);
TUT_M_vRegisterControl(m_cViewSurf.m_hWnd, "OSC_DSRF_BUTTON_VIEW", TUT_e_Button);
TUT_M_vRegisterControl(m_cSurfHeight.m_hWnd, "OSC_DSRF_EDIT_HEIGHT", TUT_e_TextEdit);
TUT_M_vRegisterControl(m_cDefault.m_hWnd, "OSC_DSRF_BUTTON_DEFAULT", TUT_e_Button);
// END TUTORIAL
// init all controls
m_bViewSurface = FALSE;
m_cViewSurf.SetCheck(0);
fn_vInitEnvElem(-1);
m_bInitialised = TRUE;
// init listbox
m_cSurfListBox.fn_vInitParameters(this, m_pSectorInterface, E_te_Surface);
}
*/
/*===========================================================================
* Description: Reinit dialog
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogSrf::fn_vReinitDialog (void)
{
fn_vInitSurfListBox();
}
*/
/*===========================================================================
* Description: Init controls state
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogSrf::fn_vInitControls (BOOL bEnable)
{
m_cSurfListBox.EnableWindow(bEnable);
m_cViewSurf.EnableWindow(bEnable);
m_cSurfHeight.EnableWindow((m_pSurface != NULL)&&bEnable);
}
*/
/*===========================================================================
* Description: reinit environment list
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogSrf::fn_vInitEnvElem (long lEnvElem)
{
Sector_Object *pSector;
// find corresponding element
if (lEnvElem != -1)
pSector = (Sector_Object *) m_pSectorInterface->GetEditedSector()->GetObject();
else
pSector = NULL;
// update edited element
m_lEnvElem = lEnvElem;
m_pSurfElem = (pSector) ? pSector->GetSurface(m_lEnvElem) : NULL;
// update infos
fn_vSelectSurf((m_pSurfElem) ? m_pSurfElem->GetSurface() : m_pSectorInterface->GetSurfaceToDraw());
m_cSurfListBox.fn_vReinitListObjects();
}
*/
/*===========================================================================
* Description: Init combo with all available surfaces
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogSrf::fn_vInitSurfListBox (void)
{
// set list style
m_cSurfListBox.SetOrder(E_lo_Edited, FALSE, FALSE);
m_cSurfListBox.SetDragDropRight(FALSE);
// reinit list
m_cSurfListBox.SetSortedList(m_pSectorInterface->GetBaseObjectList(C_szSurfaceTypeName));
// current selection => none
m_cSurfListBox.SetSelectedItem(-1);
}
*/
/*===========================================================================
* Description: update dialog when selection changes
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogSrf::fn_vSelectSurf (SECT_Surface *pSurface, BOOL bUpdateSurfElem)
{
SECT_Surface *pOldSelect, *pOldCurrent;
SECT_ModifSurfElem *pModif;
CString csText;
int iInd;
// update current environment
pOldSelect = m_pSurface;
m_pSurface = pSurface;
// update selection
iInd = m_cSurfListBox.GetCorrespondingIndex((DWORD) m_pSurface);
m_cSurfListBox.RedrawItems(iInd, iInd);
// update env list
if ((bUpdateSurfElem)&&(m_pSurfElem))
{
pOldCurrent = m_pSurfElem->GetSurface();
if ((m_pSurface)&&(!m_cSurfListBox.fn_bIsAlreadyUsed(m_pSurface)))
{
// update sector lists
pModif = new SECT_ModifSurfElem(m_pSectorInterface, E_mt_ChangeSrf,
m_pSurfElem, m_pSurface, m_lEnvElem);
m_pSectorInterface->M_GetEditManager()->AskFor(pModif);
}
}
// update height control
m_cSurfHeight.EnableWindow((m_pSurface != NULL));
if (m_pSurface)
csText.Format("%5.2f", m_pSurface->GetHeight());
else
csText = "";
m_cSurfHeight.SetWindowText(csText);
// redraw previous element
if (pOldSelect != m_pSurface)
{
iInd = m_cSurfListBox.GetCorrespondingIndex((DWORD) pOldSelect);
m_cSurfListBox.RedrawItems(iInd, iInd);
}
// redraw previous element
if ((pOldCurrent)&&(pOldCurrent != pOldSelect))
{
iInd = m_cSurfListBox.GetCorrespondingIndex((DWORD) pOldCurrent);
m_cSurfListBox.RedrawItems(iInd, iInd);
}
// update selection
iInd = m_cSurfListBox.GetCorrespondingIndex((DWORD) m_pSurface);
m_cSurfListBox.RedrawItems(iInd, iInd);
m_cSurfListBox.EnsureVisible(iInd, TRUE);
m_cSurfListBox.UpdateWindow();
// update drawing
if (m_bViewSurface)
m_pSectorInterface->SetSurfaceToDraw(m_pSurface);
}
*/
//#################################################################################
// SECT_DialogEdit Messages
//#################################################################################
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogSrf::OnSize (UINT nFlags, int cx, int cy)
{
RECT WindowPosition;
int ecx, ecy;
if (!m_bInitialised)
return;
// calculate name position
GetWindowRect(&WindowPosition);
ecx = WindowPosition.right - WindowPosition.left - 10;
ecx = (ecx < 50) ? 50 : ecx;
ecy = WindowPosition.bottom - WindowPosition.top - 10;
ecy = (ecy < 100) ? 100 : ecy;
// mechanic
GetDlgItem(SECT_IDC_TEXTSURFELEM)->MoveWindow(5, 5, ecx, ecy);
m_cSurfListBox.MoveWindow(10, 25, ecx-10, ecy-50);
m_cViewSurf.MoveWindow(ecx-35, ecy-20, 30, 18);
m_cSurfHeight.MoveWindow(15, ecy-20, ecx-50, 18);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogSrf::OnDestroy (void)
{
// FOR TUTORIAL
TUT_M_vGetTutDll();
TUT_M_vUnregisterControl(m_cSurfListBox.m_hWnd);
TUT_M_vUnregisterControl(m_cViewSurf.m_hWnd);
TUT_M_vUnregisterControl(m_cSurfHeight.m_hWnd);
TUT_M_vUnregisterControl(m_cDefault.m_hWnd);
// END TUTORIAL
CFormView::OnDestroy();
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogSrf::OnSelChangeSurfListBox(NMHDR* pNMHDR, LRESULT* pResult)
{
SECT_Surface *pSurf = NULL;
LPNM_LISTVIEW pNMListView = (LPNM_LISTVIEW)pNMHDR;
BOOL bOldSelect, bNewSelect;
int iIndex;
// update param
*pResult = 0;
if ((pNMListView->uChanged != LVIF_STATE)||(m_cSurfListBox.fn_bIsSelecting()))
return;
bOldSelect = (pNMListView->uOldState & LVIS_SELECTED);
bNewSelect = (pNMListView->uNewState & LVIS_SELECTED);
// get corresponding sector
iIndex = pNMListView->iItem;
pSurf = (SECT_Surface *) m_cSurfListBox.GetItemData(iIndex);
g_pClickedSrf = pSurf;
m_cSurfListBox.SetSelectedItem(-1);
if (bOldSelect != bNewSelect)
{
// select corresponding environment
if ((!pSurf)||(!pSurf->fn_bIsAvailable()))
fn_vSelectSurf((m_pSurfElem) ? m_pSurfElem->GetSurface() : NULL, FALSE);
else
fn_vSelectSurf((pSurf != m_pSurface) ? pSurf : NULL, FALSE);
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogSrf::OnDblClkSurfListBox(NMHDR* pNMHDR, LRESULT* pResult)
{
SECT_Surface *pSurf = NULL;
// update param
*pResult = 0;
// get corresponding sector
pSurf = g_pClickedSrf;
g_pClickedSrf = NULL;
// select corresponding environment
if ((!pSurf)||(!pSurf->fn_bIsAvailable()))
fn_vSelectSurf((m_pSurfElem) ? m_pSurfElem->GetSurface() : NULL);
else
fn_vSelectSurf(pSurf);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogSrf::OnViewSurf()
{
// update draw flag
m_bViewSurface = m_cViewSurf.GetCheck();
// update drawing
m_pSectorInterface->SetSurfaceToDraw((m_bViewSurface) ? m_pSurface : NULL);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogSrf::OnChangeHeight()
{
SECT_ModifSrfParams *pModif;
MTH_tdxReal xHeight;
char szVal[15];
// no surface => no modif
if ((!m_pSurface)||(!m_cSurfHeight.GetModify()))
return;
// get new height
m_cSurfHeight.GetWindowText(szVal, 15);
xHeight = (float) atof(szVal);
// if necessary, update height
if (m_pSurface->GetHeight() != xHeight)
{
// update surface
pModif = new SECT_ModifSrfParams(m_pSectorInterface, E_mt_ChangeSrfHeight, m_pSurface, xHeight);
m_pSectorInterface->M_GetEditManager()->AskFor(pModif);
// update drawing
m_cSurfListBox.fn_vReinitListObjects();
if (m_bViewSurface)
m_pSectorInterface->GetInterface()->fn_vUpdateAll(E_mc_JustDraw);
}
// update flag
m_cSurfHeight.SetModify(FALSE);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogSrf::OnDefault()
{
if (m_cSurfHeight.GetModify())
{
OnChangeHeight();
m_cSurfHeight.SetFocus();
}
}
*/
//#################################################################################
// SECT_SrfElemListBox
//#################################################################################
/*----------------------------------------
----------------------------------------*/
/*
SECT_SrfElemListBox::SECT_SrfElemListBox (void)
{
}
*/
/*----------------------------------------
----------------------------------------*/
/*
SECT_SrfElemListBox::~SECT_SrfElemListBox (void)
{
}
*/
/*----------------------------------------
----------------------------------------*/
/*
BOOL SECT_SrfElemListBox::fn_bIsCurrentElement (CPA_BaseObject *pElem)
{
SECT_SurfElem *pSurfElem;
// no dialog => no current element
if (!m_pDialog)
return FALSE;
// init parameters
pSurfElem = ((SECT_DialogSrf *) m_pDialog)->GetCurrentSurfElem();
return ((pSurfElem)&&(pElem == pSurfElem->GetSurface()));
}
*/
/*----------------------------------------
----------------------------------------*/
/*
BOOL SECT_SrfElemListBox::fn_bIsSelectedElement (CPA_BaseObject *pElem)
{
// no dialog => no selected element
if (!m_pDialog)
return FALSE;
return (pElem == ((SECT_DialogSrf *) m_pDialog)->GetSelectedSurface());
}
*/
/*----------------------------------------
----------------------------------------*/
/*
BOOL SECT_SrfElemListBox::fn_bIsAlreadyUsed (CPA_BaseObject *pElem)
{
Sector_Object *pSector;
// no edited sector => no used element
if (!m_pSectorInterface->GetEditedSector())
return FALSE;
pSector = (Sector_Object *) m_pSectorInterface->GetEditedSector()->GetObject();
return (pSector->GetSurfaceList()->GetElementWithSurface((SECT_Surface *)pElem) != NULL);
}
*/

View File

@@ -0,0 +1,663 @@
/*=========================================================================
*
* SECTdVis.cpp : Visual Environment dialog - Implementation file
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
/*
#include "stdafx.h"
#include "acp_base.h"
#include "SECTint.hpp"
#include "SECdVis.hpp"
#include "SECmodif.hpp"
#include "SECdEnv.hpp"
#include "SEClEnvs.hpp"
#include "SECdEnvs.hpp"
#include "SECdSrfs.hpp"
#include "..\Main\Inc\_EditID.h"
#include "TUT.h"
*/
//#################################################################################
// SECT_DialogVis dialog
//#################################################################################
/*----------------------------------------
----------------------------------------*/
/*
SECT_DialogVis::SECT_DialogVis(CWnd* pParent)
: CFormView(SECT_DialogVis::IDD)
{
//{{AFX_DATA_INIT(SECT_DialogVis)
//}}AFX_DATA_INIT
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogVis::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SECT_DialogVis)
DDX_Control(pDX, SECT_IDC_VISNAME, m_cName);
DDX_Control(pDX, SECT_IDC_VISDEFAULT, m_cDefault);
DDX_Control(pDX, SECT_IDC_VISSAVE, m_cSave);
DDX_Control(pDX, SECT_IDC_VISCANCEL, m_cCancel);
DDX_Control(pDX, SECT_IDC_NEAR, m_cNear);
DDX_Control(pDX, SECT_IDC_FAR, m_cFar);
DDX_Control(pDX, SECT_IDC_BLENDNEAR, m_cBlendNear);
DDX_Control(pDX, SECT_IDC_BLENDFAR, m_cBlendFar);
DDX_Control(pDX, SECT_IDC_INFINITE, m_cInfinite);
DDX_Control(pDX, SECT_IDC_COLOR, m_cColor);
DDX_Control(pDX, SECT_IDC_REDSLIDER, m_cRSlider);
DDX_Control(pDX, SECT_IDC_GREENSLIDER, m_cGSlider);
DDX_Control(pDX, SECT_IDC_BLUESLIDER, m_cBSlider);
//}}AFX_DATA_MAP
}
*/
/*----------------------------------------
----------------------------------------*/
/*
BEGIN_MESSAGE_MAP(SECT_DialogVis, CFormView)
//{{AFX_MSG_MAP(SECT_DialogVis)
ON_WM_SIZE()
ON_WM_DESTROY()
ON_WM_DRAWITEM()
ON_BN_CLICKED(SECT_IDC_VISSAVE, OnSave)
ON_BN_CLICKED(SECT_IDC_VISCANCEL, OnCancel)
ON_EN_KILLFOCUS(SECT_IDC_VISNAME, OnChangeName)
ON_BN_CLICKED(SECT_IDC_VISDEFAULT, OnDefault)
ON_EN_KILLFOCUS(SECT_IDC_NEAR, OnChangeNear)
ON_EN_KILLFOCUS(SECT_IDC_FAR, OnChangeFar)
ON_EN_KILLFOCUS(SECT_IDC_INFINITE, OnChangeInfinite)
ON_WM_VSCROLL()
ON_WM_HSCROLL()
ON_BN_DOUBLECLICKED(SECT_IDC_COLOR, OnEditColor)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
*/
//#################################################################################
// SECT_DialogVis Inits
//#################################################################################
/*===========================================================================
* Description: Init dialog
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogVis::fn_vInitDialog (Sector_Interface *p_oDLL, CWnd *pParent)
{
// create the dialog
m_bInitialised = FALSE;
m_pSectorInterface = p_oDLL;
CFormView::Create(NULL, "", AFX_WS_DEFAULT_VIEW, CRect(0,0,120,180), pParent, AFX_IDW_PANE_FIRST, NULL);
// init data for dialog
CFormView::UpdateData(FALSE);
// FOR TUTORIAL
TUT_M_vGetTutDll();
// visual environment
TUT_M_vRegisterControl(m_cName.m_hWnd, "OSC_DVIS_EDIT_VISENV", TUT_e_TextEdit);
TUT_M_vRegisterControl(m_cDefault.m_hWnd, "OSC_DVIS_BUTTON_DEFAULT", TUT_e_Button);
TUT_M_vRegisterControl(m_cCancel.m_hWnd, "OSC_DVIS_BUTTON_CANCEL", TUT_e_Button);
TUT_M_vRegisterControl(m_cSave.m_hWnd, "OSC_DVIS_BUTTON_SAVE", TUT_e_Button);
// parameters
TUT_M_vRegisterControl(m_cNear.m_hWnd, "OSC_DVIS_EDIT_NEAR", TUT_e_TextEdit);
TUT_M_vRegisterControl(m_cFar.m_hWnd, "OSC_DVIS_EDIT_FAR", TUT_e_TextEdit);
TUT_M_vRegisterControl(m_cInfinite.m_hWnd, "OSC_DVIS_EDIT_INFINITE", TUT_e_TextEdit);
TUT_M_vRegisterControl(m_cBlendNear.m_hWnd, "OSC_DVIS_EDIT_BLENDNEAR", TUT_e_Slider);
TUT_M_vRegisterControl(m_cBlendFar.m_hWnd, "OSC_DVIS_EDIT_BLENDFAR", TUT_e_Slider);
// color
TUT_M_vRegisterControl(m_cRSlider.m_hWnd, "OSC_DVIS_SLIDER_RED", TUT_e_Slider);
TUT_M_vRegisterControl(m_cGSlider.m_hWnd, "OSC_DVIS_SLIDER_GREEN", TUT_e_Slider);
TUT_M_vRegisterControl(m_cBSlider.m_hWnd, "OSC_DVIS_SLIDER_BLUE", TUT_e_Slider);
TUT_M_vRegisterControl(m_cColor.m_hWnd, "OSC_DVIS_BUTTON_COLOR", TUT_e_Button);
// END TUTORIAL
// init blend
m_cBlendNear.SetRange(0, 255);
m_cBlendFar.SetRange(0, 255);
// init range
m_cRSlider.SetRange(0, 254);
m_cGSlider.SetRange(0, 254);
m_cBSlider.SetRange(0, 254);
// init environment values
m_pDefaultVisEnv = NULL;
fn_vInitVisEnvironment(NULL, FALSE);
m_bInitialised = TRUE;
}
*/
/*===========================================================================
* Description: Init default vis env
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogVis::fn_vReinitDialog (void)
{
if (!m_pDefaultVisEnv)
{
m_pDefaultVisEnv = new SECT_VisEnvironment(m_pSectorInterface, "");
m_pDefaultVisEnv->fn_bUnValidate();
m_pDefaultVisEnv->fn_vNotifyUnSave();
}
}
*/
/*===========================================================================
* Description: Init controls
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogVis::fn_vInitControls (BOOL bEnable)
{
// init button states
m_cSave.EnableWindow(bEnable);
m_cCancel.EnableWindow(bEnable);
// init name
m_cName.SetReadOnly(!bEnable);
m_cDefault.EnableWindow(bEnable);
// init fog controls
m_cNear.SetReadOnly(!bEnable);
m_cFar.SetReadOnly(!bEnable);
m_cBlendNear.EnableWindow(bEnable);
m_cBlendFar.EnableWindow(bEnable);
m_cInfinite.SetReadOnly(!bEnable);
// init color controls
m_cRSlider.EnableWindow(bEnable);
m_cGSlider.EnableWindow(bEnable);
m_cBSlider.EnableWindow(bEnable);
}
*/
/*===========================================================================
* Description: register initial values
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogVis::fn_vInitVisEnvironment (SECT_VisEnvironment *pVisEnv, BOOL bEnable)
{
char szVal[256];
int iRValue, iGValue, iBValue;
// update or create mec env
if ((!pVisEnv) && bEnable)
m_pVisEnv = m_pDefaultVisEnv;
else
m_pVisEnv = pVisEnv;
// update all controls
fn_vInitControls(bEnable);
// init name
m_csName = (m_pVisEnv) ? m_pVisEnv->GetName() : "";
// init fog parameters
m_xNear = (m_pVisEnv) ? m_pVisEnv->GetFogNear() : 0;
m_xFar = (m_pVisEnv) ? m_pVisEnv->GetFogFar() : 0;
m_xBlendNear = (m_pVisEnv) ? m_pVisEnv->GetFogBlendNear() : 0;
m_xBlendFar = (m_pVisEnv) ? m_pVisEnv->GetFogBlendFar() : 0;
m_xInfinite = (m_pVisEnv) ? m_pVisEnv->GetFogInfinite() : 0;
// init fog color
iRValue = (m_pVisEnv) ? (int) (254 * m_pVisEnv->GetFogColor()->xR) : 0;
iGValue = (m_pVisEnv) ? (int) (254 * m_pVisEnv->GetFogColor()->xG) : 0;
iBValue = (m_pVisEnv) ? (int) (254 * m_pVisEnv->GetFogColor()->xB) : 0;
m_stColor = RGB(iRValue, iGValue, iBValue);
// init controls
if (!m_pVisEnv)
{
m_cName.SetWindowText("");
m_cNear.SetWindowText("");
m_cFar.SetWindowText("");
m_cBlendNear.SetPos((int) m_xBlendNear);
m_cBlendFar.SetPos((int) m_xBlendFar);
m_cInfinite.SetWindowText("");
fn_vUpdateSliders();
fn_vUpdateColor();
}
else
{
// name
m_cName.SetWindowText(m_csName);
// near
sprintf(szVal, "%5.2f", m_xNear);
m_cNear.SetWindowText(szVal);
// far
sprintf(szVal, "%5.2f", m_xFar);
m_cFar.SetWindowText(szVal);
// blend near
m_cBlendNear.SetPos((int) m_xBlendNear);
// blend far
m_cBlendFar.SetPos((int) m_xBlendFar);
// infinite
sprintf(szVal, "%5.2f", m_xInfinite);
m_cInfinite.SetWindowText(szVal);
// color
fn_vUpdateSliders();
fn_vUpdateColor();
}
}
*/
/*===========================================================================
* Description: Update sliders
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogVis::fn_vUpdateSliders (void)
{
m_cRSlider.SetPos(254 - GetRValue(m_stColor));
m_cGSlider.SetPos(254 - GetGValue(m_stColor));
m_cBSlider.SetPos(254 - GetBValue(m_stColor));
}
*/
/*===========================================================================
* Description: Update Color
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogVis::fn_vUpdateColor (void)
{
RECT rColor;
CDC *pColorDC;
// get controls parameters
pColorDC = m_cColor.GetDC();
m_cColor.GetClientRect(&rColor);
// fill control
pColorDC->FillSolidRect(&rColor, m_stColor);
}
*/
//#################################################################################
// SECT_DialogVis Messages
//#################################################################################
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogVis::OnChangeName (void)
{
CString csFinalName;
char szNewName[256];
// no mec env => no changes
if ((!m_pVisEnv)||(!m_cName.GetModify()))
return;
// get corresponding name
m_cName.GetWindowText(szNewName, 255);
if (!strcmp(szNewName, ""))
{
m_cName.SetWindowText(m_csName);
return;
}
// get prefixed name
csFinalName = m_pSectorInterface->GetInterface()->GetPrefixedName(szNewName);
// check name validity
if (m_pVisEnv->fn_eCheckValidity(csFinalName) == E_mc_None)
m_csName = csFinalName;
// update window
m_cName.SetWindowText(m_csName);
m_cName.SetModify(FALSE);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogVis::OnChangeNear (void)
{
float xNear;
char szVal[15];
if (m_cNear.GetModify())
{
m_cNear.GetWindowText(szVal, 15);
xNear = (float) atof(szVal);
if ((xNear <= m_xFar) && (xNear <= m_xInfinite) && (xNear >= 0))
m_xNear = xNear;
else
{
sprintf(szVal, "%5.2f", m_xNear);
m_cNear.SetWindowText(szVal);
}
m_cNear.SetModify(FALSE);
}
}
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogVis::OnChangeFar (void)
{
float xFar;
char szVal[15];
if (m_cFar.GetModify())
{
m_cFar.GetWindowText(szVal, 15);
xFar = (float) atof(szVal);
if ((xFar >= m_xNear) && (xFar <= m_xInfinite) && (xFar >= 0))
m_xFar = xFar;
else
{
sprintf(szVal, "%5.2f", m_xFar);
m_cFar.SetWindowText(szVal);
}
m_cFar.SetModify(FALSE);
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogVis::OnChangeInfinite (void)
{
float xInfinite;
char szVal[15];
if (m_cInfinite.GetModify())
{
m_cInfinite.GetWindowText(szVal, 15);
xInfinite = (float) atof(szVal);
if ((xInfinite >= m_xNear) && (xInfinite >= m_xFar) && (xInfinite >= 0))
m_xInfinite = xInfinite;
else
{
sprintf(szVal, "%5.2f", m_xInfinite);
m_cInfinite.SetWindowText(szVal);
}
m_cInfinite.SetModify(FALSE);
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogVis::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
int iRValue, iGValue, iBValue;
// color
if ((pScrollBar == (void*) &m_cRSlider) ||
(pScrollBar == (void*) &m_cGSlider) ||
(pScrollBar == (void*) &m_cBSlider))
{
// update color
iRValue = 254 - m_cRSlider.GetPos();
iGValue = 254 - m_cGSlider.GetPos();
iBValue = 254 - m_cBSlider.GetPos();
m_stColor = RGB(iRValue, iGValue, iBValue);
// update control
fn_vUpdateColor();
}
CFormView::OnVScroll(nSBCode, nPos, pScrollBar);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogVis::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
if (pScrollBar == (void*) &m_cBlendNear)
{
// get new near value
m_xBlendNear = (float) m_cBlendNear.GetPos();
// if necessary, update far value
if (m_xBlendFar < m_xBlendNear)
{
m_xBlendFar = m_xBlendNear + 1;
m_cBlendFar.SetPos((int)m_xBlendFar);
}
}
if (pScrollBar == (void*) &m_cBlendFar)
{
// get new far value
m_xBlendFar = (float) m_cBlendFar.GetPos();
// if necessary, update near value
if (m_xBlendFar < m_xBlendNear)
{
m_xBlendNear = m_xBlendFar - 1;
m_cBlendNear.SetPos((int)m_xBlendNear);
}
}
CFormView::OnHScroll(nSBCode, nPos, pScrollBar);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogVis::OnEditColor ()
{
CColorDialog oColorDialog;
// display color dialog
if (oColorDialog.DoModal() == IDOK)
{
// get selected color
m_stColor = oColorDialog.GetColor();
// update controls
fn_vUpdateSliders();
fn_vUpdateColor();
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogVis::OnSave()
{
SECT_ModifVisEnvParams *pModif;
GLI_tdstColor stColor;
int iRValue, iGValue, iBValue;
// no mec env => no changes
if (!m_pVisEnv)
return;
// default mec env => create new one
if (m_pVisEnv == m_pDefaultVisEnv)
m_pVisEnv = new SECT_VisEnvironment(m_pSectorInterface, m_csName);
// get real color
iRValue = GetRValue(m_stColor);
iGValue = GetGValue(m_stColor);
iBValue = GetBValue(m_stColor);
stColor.xR = ((float) iRValue) / ((float) 254.0);
stColor.xG = ((float) iGValue) / ((float) 254.0);
stColor.xB = ((float) iBValue) / ((float) 254.0);
// modif
pModif = new SECT_ModifVisEnvParams(m_pSectorInterface, E_tm_ModifVisEnv, m_pVisEnv,
m_csName, m_xNear, m_xFar, m_xBlendNear,
m_xBlendFar, m_xInfinite, &stColor);
m_pSectorInterface->M_GetEditManager()->AskFor(pModif);
// give controtl to dialog env & update combo meca
m_pSectorInterface->GetDialogEnv()->fn_vInitVisListBox();
m_pSectorInterface->GetDialogEnv()->fn_vSelectVisual(m_pVisEnv);
m_pSectorInterface->GetDialogEnv()->fn_vInitControls(TRUE);
m_pSectorInterface->GetDialogSrf()->fn_vInitControls(TRUE);
m_pSectorInterface->GetDialogEnvs()->fn_vInitControls(TRUE);
m_pSectorInterface->GetDialogEnvList()->fn_vInitControls(TRUE);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogVis::OnCancel()
{
// new mec env => cancel
if (m_pVisEnv == m_pDefaultVisEnv)
m_pVisEnv = NULL;
// reinit controls
fn_vInitVisEnvironment(m_pVisEnv, FALSE);
// give controtl to dialog env
m_pSectorInterface->GetDialogEnv()->fn_vInitControls(TRUE);
m_pSectorInterface->GetDialogSrf()->fn_vInitControls(TRUE);
m_pSectorInterface->GetDialogEnvs()->fn_vInitControls(TRUE);
m_pSectorInterface->GetDialogEnvList()->fn_vInitControls(TRUE);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogVis::OnDefault()
{
if (m_cName.GetModify())
{
OnChangeName();
m_cName.SetFocus();
}
if (m_cNear.GetModify())
{
OnChangeNear();
m_cNear.SetFocus();
}
if (m_cFar.GetModify())
{
OnChangeFar();
m_cFar.SetFocus();
}
if (m_cInfinite.GetModify())
{
OnChangeInfinite();
m_cInfinite.SetFocus();
}
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogVis::OnSize(UINT, int, int)
{
RECT WindowPosition;
int ecx, ecy;
if (!m_bInitialised)
return;
// calculate name position
GetWindowRect(&WindowPosition);
ecx = WindowPosition.right - WindowPosition.left;
ecx = (ecx < 160) ? 10 : ecx - 150;
ecy = WindowPosition.bottom - WindowPosition.top;
ecy = (ecy < 180) ? 0 : ecy-180;
// buttons
m_cCancel.MoveWindow(ecx/2, 5, 40, 16);
m_cSave.MoveWindow(ecx/2+110, 5, 40, 16);
// name
m_cName.MoveWindow(ecx/2, 25, 150, 20);
// Fog
GetDlgItem(SECT_IDC_STATICFOG)->MoveWindow(ecx/2, 50, 150, 120);
// parameters
GetDlgItem(SECT_IDC_STATICINFINITE)->MoveWindow(ecx/2+5, 65, 40, 15);
GetDlgItem(SECT_IDC_STATICNEAR)->MoveWindow(ecx/2+5, 80, 40 , 15);
GetDlgItem(SECT_IDC_STATICFAR)->MoveWindow(ecx/2+5, 95, 40, 15);
m_cInfinite.MoveWindow(ecx/2+50, 65, 45, 15);
m_cNear.MoveWindow(ecx/2+50, 80, 45, 15);
m_cFar.MoveWindow(ecx/2+50, 95, 45, 15);
GetDlgItem(SECT_IDC_STATICBLEND)->MoveWindow(ecx/2+100, 65, 45 , 15);
m_cBlendNear.MoveWindow(ecx/2+100, 80, 45, 15);
m_cBlendFar.MoveWindow(ecx/2+100, 95, 45, 15);
// color
GetDlgItem(SECT_IDC_STATICCOLOR)->MoveWindow(ecx/2+5, 133, 40, 15);
m_cColor.MoveWindow(ecx/2+100, 117, 40, 40);
m_cRSlider.MoveWindow(ecx/2+50, 123, 15, 40);
m_cGSlider.MoveWindow(ecx/2+67, 123, 15, 40);
m_cBSlider.MoveWindow(ecx/2+84, 123, 15, 40);
// update
fn_vUpdateColor();
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogVis::OnDrawItem (int nIDCtl, LPDRAWITEMSTRUCT lpDIS)
{
// not interested => default handling
if ((lpDIS->itemID == LB_ERR) || (nIDCtl != SECT_IDC_COLOR))
return;
// draw item
fn_vUpdateColor();
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogVis::OnDestroy (void)
{
// FOR TUTORIAL
TUT_M_vGetTutDll();
// visual environment
TUT_M_vUnregisterControl(m_cName.m_hWnd);
TUT_M_vUnregisterControl(m_cDefault.m_hWnd);
TUT_M_vUnregisterControl(m_cCancel.m_hWnd);
TUT_M_vUnregisterControl(m_cSave.m_hWnd);
// parameters
TUT_M_vUnregisterControl(m_cNear.m_hWnd);
TUT_M_vUnregisterControl(m_cFar.m_hWnd);
TUT_M_vUnregisterControl(m_cInfinite.m_hWnd);
// color
TUT_M_vUnregisterControl(m_cRSlider.m_hWnd);
TUT_M_vUnregisterControl(m_cGSlider.m_hWnd);
TUT_M_vUnregisterControl(m_cBSlider.m_hWnd);
TUT_M_vUnregisterControl(m_cColor.m_hWnd);
// END TUTORIAL
CFormView::OnDestroy();
}
*/

View File

@@ -0,0 +1,757 @@
/*=========================================================================
*
* SEClDias.cpp : List Dialogs - Implementation file
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
#include "stdafx.h"
#include "acp_base.h"
#include "SECTint.hpp"
#include "SEClDias.hpp"
#include "SECmodif.hpp"
#include "..\Main\Inc\_EditID.h"
#include "TUT.h"
#define C_uiCopyEntry 1
#define C_uiPasteEntry 2
//#################################################################################
// DIALOGBASE
//#################################################################################
/*----------------------------------------
----------------------------------------*/
SECT_DialogBase::SECT_DialogBase(CWnd* pParent)
: CFormView(SECT_DialogBase::IDD)
{
//{{AFX_DATA_INIT(SECT_DialogBase)
//}}AFX_DATA_INIT
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogBase::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SECT_DialogBase)
DDX_Control(pDX, SECT_IDC_SYMETRIC, m_cSymetric);
DDX_Control(pDX, SECT_IDC_LISTPARAMS, m_cListParams);
//}}AFX_DATA_MAP
}
/*----------------------------------------
----------------------------------------*/
BEGIN_MESSAGE_MAP(SECT_DialogBase, CFormView)
//{{AFX_MSG_MAP(SECT_DialogBase)
ON_LBN_SELCHANGE(SECT_IDC_SORTEDLISTBOX, OnSelchangeSectorList)
ON_LBN_DBLCLK(SECT_IDC_SORTEDLISTBOX, OnDblClkSectorList)
ON_BN_CLICKED(SECT_IDC_SYMETRIC, OnSymetric)
ON_WM_DRAWITEM()
ON_WM_SIZE()
ON_WM_DESTROY()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/*===========================================================================
*=========================================================================*/
void SECT_DialogBase::fn_vInitDialog (Sector_Interface *p_oDLL, CWnd *pParent, const CString csTag, BOOL bShowListParams)
{
// create the dialog
m_bInitialised = FALSE;
m_pSectorInterface = p_oDLL;
CFormView::Create(NULL, "", AFX_WS_DEFAULT_VIEW, CRect(0,0,120,180), pParent, AFX_IDW_PANE_FIRST, NULL);
// init data for dialog
CFormView::UpdateData(FALSE);
// FOR TUTORIAL
TUT_M_vGetTutDll();
TUT_M_vRegisterControl (m_cSymetric.m_hWnd, "OSC_DLIST" + csTag + "_BUTTON_SYMETRIC", TUT_e_Button);
TUT_M_vRegisterControl (m_cListParams.m_hWnd, "OSC_DLIST" + csTag + "_LIST_PARAMS", TUT_e_ListBox);
TUT_M_vRegisterControlID(SECT_IDC_SORTEDLISTBOX, "OSC_DLIST" + csTag + "_LIST_SECTORS", TUT_e_ListBox);
// END TUTORIAL
m_pSectorList = NULL;
m_pSelectedElem = NULL;
// init list params
m_bShowListParams = bShowListParams;
m_cListParams.EnableWindow(m_bShowListParams);
m_cListParams.ShowWindow((m_bShowListParams) ? SW_SHOW : SW_HIDE);
m_bInitialised = TRUE;
}
/*===========================================================================
*=========================================================================*/
void SECT_DialogBase::fn_vReinitDialog (SECT_ListBase *pSectorList)
{
// init list
m_pSectorList = pSectorList;
// init sorted listbox
fn_vInitSectorList(pSectorList);
m_cListParams.EnableWindow(m_bShowListParams);
m_cListParams.ShowWindow(m_bShowListParams ? SW_SHOW : SW_HIDE);
}
/*===========================================================================
*=========================================================================*/
void SECT_DialogBase::fn_vInitSectorList (SECT_ListBase *pSectorList)
{
GetSectorList()->fn_vInitSectorList(pSectorList);
// init selection
m_pSelectedElem = NULL;
// update list params
fn_vReinitListParams();
}
/*===========================================================================
*=========================================================================*/
void SECT_DialogBase::fn_vUpdateSelection (CPA_SuperObject *pSector)
{
int iIndex;
// no list => no change
if (!m_pSectorList)
return;
// get coresponding element
m_pSelectedElem = m_pSectorList->GetElementWithSector(pSector);
// set selection
iIndex = GetSectorList()->GetCorrespondingIndex((DWORD) m_pSelectedElem);
GetSectorList()->SetCurSel(iIndex);
// update list params
fn_vReinitListParams();
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogBase::OnSelchangeSectorList()
{
int iIndex;
// select the object corresponding to the choice in the list box
iIndex = GetSectorList()->GetCurSel();
if (iIndex > -1)
m_pSelectedElem = (SECT_ElementBase *) GetSectorList()->GetItemData(iIndex);
else
m_pSelectedElem = NULL;
// update editor
if ((m_pSelectedElem)&&(m_pSectorInterface->GetEditMode() == E_em_EditSector))
m_pSectorInterface->fn_vSelectNewSector(m_pSelectedElem->GetSector());
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogBase::OnDblClkSectorList()
{
int iIndex;
// select the object corresponding to the choice in the list box
iIndex = GetSectorList()->GetCurSel();
if (iIndex > -1)
m_pSelectedElem = (SECT_ElementBase *) GetSectorList()->GetItemData(iIndex);
else
m_pSelectedElem = NULL;
// update selection in editor
if ((m_pSelectedElem)&&(m_pSectorInterface->GetEditMode() == E_em_EditSector))
m_pSectorInterface->fn_vSelectNewSector(m_pSelectedElem->GetSector());
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogBase::OnSymetric()
{
SECT_ModifSymetricLinks *pModif;
pModif = new SECT_ModifSymetricLinks(m_pSectorInterface, E_tm_SymetricLinks,
m_pSectorInterface->GetEditedSector(), m_eType);
m_pSectorInterface->M_GetEditManager()->AskFor(pModif);
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogBase::OnSize (UINT nFlags, int cx, int cy)
{
RECT WindowPosition;
int lcx, lcy;
if (!m_bInitialised)
return;
GetWindowRect(&WindowPosition);
// calculate list position
lcx = WindowPosition.right - WindowPosition.left - 10;
lcy = WindowPosition.bottom - WindowPosition.top - 25;
lcx = (lcx < 50) ? 50 : lcx;
lcy = (lcy < 0) ? 0 : lcy;
m_cSymetric.MoveWindow(lcx-40, 2, 45, 16);
if (m_bShowListParams)
{
lcx = lcx - 10;
GetSectorList()->MoveWindow(5, 20, lcx/2, lcy);
m_cListParams.MoveWindow(lcx/2+10, 20, lcx/2, lcy);
}
else
GetSectorList()->MoveWindow(5, 20, lcx, lcy);
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogBase::OnDestroy (void)
{
// FOR TUTORIAL
TUT_M_vGetTutDll();
TUT_M_vUnregisterControl (m_cSymetric.m_hWnd);
TUT_M_vUnregisterControl (m_cListParams.m_hWnd);
TUT_M_vUnregisterControlID (SECT_IDC_SORTEDLISTBOX);
// END TUTORIAL
CFormView::OnDestroy();
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogBase::OnDrawItem (int nIDCtl, LPDRAWITEMSTRUCT lpDIS)
{
// not interested => default handling
if (lpDIS->itemID == LB_ERR)
return;
if (nIDCtl == SECT_IDC_SORTEDLISTBOX)
{
if ((!GetSectorList())||(!GetSectorList()->IsWindowEnabled()))
return;
// draw item
GetSectorList()->fn_vDrawListItem(nIDCtl, lpDIS);
}
}
//#################################################################################
// SORTED LIST BOX
//#################################################################################
BEGIN_MESSAGE_MAP(SECT_CustomListBox, CListBox)
ON_WM_RBUTTONDOWN()
ON_WM_KEYDOWN()
END_MESSAGE_MAP()
/*----------------------------------------
----------------------------------------*/
SECT_CustomListBox::SECT_CustomListBox (void)
{
// init dialog parameters
m_pDialog = NULL;
m_pSectorInterface = NULL;
}
/*----------------------------------------
----------------------------------------*/
void SECT_CustomListBox::fn_vInitDialogParameters (SECT_DialogBase *pDialog)
{
m_pDialog = pDialog;
m_pSectorInterface = m_pDialog->GetSectorInterface();
}
/*----------------------------------------
----------------------------------------*/
void SECT_CustomListBox::OnKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags)
{
m_pSectorInterface->fn_vOnKeyDownInSectorList(m_pDialog, nChar);
}
/*----------------------------------------
----------------------------------------*/
void SECT_CustomListBox::OnRButtonDown (UINT nFlags, CPoint point)
{
BOOL bCopy;
ClientToScreen( &point );
// create popup menu
CMenu oMenu;
oMenu.CreatePopupMenu();
// check if there is already a copy
bCopy = (m_pSectorInterface->GetCopyOfSectorList()->GetCount() > 0);
// Add Entry
oMenu.AppendMenu(MF_STRING | MF_ENABLED, C_uiCopyEntry, "Copy List");
oMenu.AppendMenu(MF_STRING | (bCopy) ? MF_ENABLED : MF_GRAYED, C_uiPasteEntry, "Paste List");
oMenu.TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON, point.x, point.y, this);
// destroy menus
oMenu.DestroyMenu();
}
/*----------------------------------------
----------------------------------------*/
BOOL SECT_CustomListBox::OnCommand (WPARAM wParam, LPARAM lParam)
{
// command from a menu ?
if (HIWORD(wParam) == 0)
{
// ID of menu item ?
switch (LOWORD(wParam))
{
// column headers
case C_uiCopyEntry:
m_pSectorInterface->fn_vCopySectorList(m_pSectorInterface->GetEditedSector(), m_pDialog->GetListType());
break;
case C_uiPasteEntry:
m_pSectorInterface->fn_vPasteSectorList(m_pSectorInterface->GetEditedSector(), m_pDialog->GetListType());
break;
}
}
return CListBox::OnCommand(wParam, lParam);
}
/*----------------------------------------
----------------------------------------*/
void SECT_CustomListBox::fn_vInitSectorList (SECT_ListBase *pSectorList)
{
SECT_ElementBase *pElem;
POSITION pos;
CString csText;
int iPos;
// RAZ
ResetContent();
if (!pSectorList)
return;
// add items to list
for (pElem = pSectorList->GetHeadElementBase(pos); pElem;
pElem = pSectorList->GetNextElementBase(pos))
{
csText = (pElem->GetSector() != NULL) ? pElem->GetSector()->GetName() : "All Sectors";
iPos = AddString(csText);
SetItemData(iPos, (DWORD)pElem);
}
}
/*----------------------------------------
----------------------------------------*/
int SECT_CustomListBox::GetCorrespondingIndex (DWORD pElem)
{
DWORD pData;
int iIndex;
for (iIndex = 0; iIndex < GetCount(); iIndex++)
{
pData = GetItemData(iIndex);
if (pData == pElem)
return iIndex;
}
return -1;
}
//#################################################################################
// ACTIVITY
//#################################################################################
/*----------------------------------------
----------------------------------------*/
void SECT_ActivityListBox::fn_vDrawListItem (int nIDCtl, LPDRAWITEMSTRUCT lpDIS)
{
SECT_ActivityElement *pElem;
COLORREF cTextColor;
COLORREF cRectColor;
BOOL bSelected;
CDC *pDC;
if (!m_pDialog)
return;
// init parameters
pElem = (SECT_ActivityElement *) GetItemData(lpDIS->itemID);
bSelected = (lpDIS->itemState & ODS_SELECTED);
// drawing rect
pDC = CDC::FromHandle(lpDIS->hDC);
// selected sector => blue
if (bSelected)
{
cRectColor = RGB (0, 0, 200);
cTextColor = RGB (254, 254, 254);
}
// normal sector => black
else
{
cRectColor = GetSysColor(COLOR_WINDOW);
cTextColor = RGB (0, 0, 0);
}
// draw item
pDC->FillSolidRect(&lpDIS->rcItem, cRectColor);
pDC->SetBkMode(TRANSPARENT);
lpDIS->rcItem.left += 2;
pDC->SetTextColor(cTextColor);
pDC->DrawText(pElem->GetSector()->GetNameToDraw(), &lpDIS->rcItem, DT_SINGLELINE | DT_LEFT | DT_VCENTER);
}
/*===========================================================================
*=========================================================================*/
SECT_DialogActiv::SECT_DialogActiv (CWnd* pParent)
{
m_eType = E_Activity;
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogActiv::DoDataExchange(CDataExchange* pDX)
{
SECT_DialogBase::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SECT_DialogList)
DDX_Control(pDX, SECT_IDC_SORTEDLISTBOX, m_cSectorList);
//}}AFX_DATA_MAP
m_cSectorList.fn_vInitDialogParameters(this);
}
//#################################################################################
// COLLISION
//#################################################################################
/*----------------------------------------
----------------------------------------*/
void SECT_CollisionListBox::fn_vDrawListItem (int nIDCtl, LPDRAWITEMSTRUCT lpDIS)
{
SECT_CollisionElement *pElem;
COLORREF cTextColor;
COLORREF cRectColor;
BOOL bSelected;
CDC *pDC;
if (!m_pDialog)
return;
// init parameters
pElem = (SECT_CollisionElement *) GetItemData(lpDIS->itemID);
bSelected = (lpDIS->itemState & ODS_SELECTED);
// drawing rect
pDC = CDC::FromHandle(lpDIS->hDC);
// selected sector => blue
if (bSelected)
{
cRectColor = RGB (0, 0, 200);
cTextColor = RGB (254, 254, 254);
}
// normal sector => black
else
{
cRectColor = GetSysColor(COLOR_WINDOW);
cTextColor = RGB (0, 0, 0);
}
// draw item
pDC->FillSolidRect(&lpDIS->rcItem, cRectColor);
pDC->SetBkMode(TRANSPARENT);
lpDIS->rcItem.left += 2;
pDC->SetTextColor(cTextColor);
pDC->DrawText(pElem->GetSector()->GetNameToDraw(), &lpDIS->rcItem, DT_SINGLELINE | DT_LEFT | DT_VCENTER);
}
/*===========================================================================
*=========================================================================*/
SECT_DialogColls::SECT_DialogColls (CWnd* pParent)
{
m_eType = E_Collision;
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogColls::DoDataExchange(CDataExchange* pDX)
{
SECT_DialogBase::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SECT_DialogList)
DDX_Control(pDX, SECT_IDC_SORTEDLISTBOX, m_cSectorList);
//}}AFX_DATA_MAP
m_cSectorList.fn_vInitDialogParameters(this);
}
//#################################################################################
// GRAPHIC
//#################################################################################
/*----------------------------------------
----------------------------------------*/
void SECT_GraphicListBox::fn_vDrawListItem (int nIDCtl, LPDRAWITEMSTRUCT lpDIS)
{
SECT_GraphicElement *pGraphicElem;
COLORREF cTextColor;
COLORREF cRectColor;
CString csText;
BOOL bSelected;
CDC *pDC;
long lWidth;
if (!m_pDialog)
return;
// init parameters
pGraphicElem = (SECT_GraphicElement *) GetItemData(lpDIS->itemID);
bSelected = (lpDIS->itemState & ODS_SELECTED);
lWidth = (lpDIS->rcItem.right < lpDIS->rcItem.left + 24) ? 0 : 22;
// drawing rect
pDC = CDC::FromHandle(lpDIS->hDC);
// selected sector => blue
if (bSelected)
{
cRectColor = RGB (0, 0, 200);
cTextColor = RGB (254, 254, 254);
}
// normal sector => black
else
{
cRectColor = GetSysColor(COLOR_WINDOW);
cTextColor = RGB (0, 0, 0);
}
// draw rect
pDC->FillSolidRect(&lpDIS->rcItem, cRectColor);
pDC->SetBkMode(TRANSPARENT);
pDC->SetTextColor(cTextColor);
// draw sector name
lpDIS->rcItem.left += 1;
lpDIS->rcItem.right -= lWidth;
pDC->DrawText(pGraphicElem->GetSector()->GetNameToDraw(), &lpDIS->rcItem, DT_SINGLELINE | DT_LEFT | DT_VCENTER);
// draw level
lpDIS->rcItem.left = lpDIS->rcItem.right + 1;
lpDIS->rcItem.right = lpDIS->rcItem.left + lWidth / 2;
csText.Format("%d", pGraphicElem->GetGraphicLevel());
pDC->DrawText(csText, &lpDIS->rcItem, DT_SINGLELINE | DT_LEFT | DT_VCENTER);
// draw mode
lpDIS->rcItem.left = lpDIS->rcItem.right + 1;
lpDIS->rcItem.right = lpDIS->rcItem.left + lWidth / 2;
csText = (pGraphicElem->GetGraphicMode() == C_SECT_ModeLookOnly) ? "L" : " ";
pDC->DrawText(csText, &lpDIS->rcItem, DT_SINGLELINE | DT_LEFT | DT_VCENTER);
}
/*===========================================================================
*=========================================================================*/
SECT_DialogGraph::SECT_DialogGraph (CWnd* pParent)
{
m_eType = E_Graphic;
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogGraph::DoDataExchange(CDataExchange* pDX)
{
SECT_DialogBase::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SECT_DialogList)
DDX_Control(pDX, SECT_IDC_SORTEDLISTBOX, m_cSectorList);
//}}AFX_DATA_MAP
m_cSectorList.fn_vInitDialogParameters(this);
}
//#################################################################################
// SOUND
//#################################################################################
/*----------------------------------------
----------------------------------------*/
void SECT_SoundListBox::fn_vDrawListItem (int nIDCtl, LPDRAWITEMSTRUCT lpDIS)
{
SECT_SoundElement *pSoundElem;
COLORREF cTextColor;
COLORREF cRectColor;
CString csText;
BOOL bSelected;
CDC *pDC;
long lWidth;
if (!m_pDialog)
return;
// init parameters
pSoundElem = (SECT_SoundElement *) GetItemData(lpDIS->itemID);
bSelected = (lpDIS->itemState & ODS_SELECTED);
lWidth = (lpDIS->rcItem.right < lpDIS->rcItem.left + 22) ? 0 : 21;
// drawing rect
pDC = CDC::FromHandle(lpDIS->hDC);
// selected sector => blue
if (bSelected)
{
cRectColor = RGB (0, 0, 200);
cTextColor = RGB (254, 254, 254);
}
// normal sector => black
else
{
cRectColor = GetSysColor(COLOR_WINDOW);
cTextColor = RGB (0, 0, 0);
}
// draw item
pDC->FillSolidRect(&lpDIS->rcItem, cRectColor);
pDC->SetBkMode(TRANSPARENT);
pDC->SetTextColor(cTextColor);
// draw sector name
lpDIS->rcItem.left += 1;
lpDIS->rcItem.right -= lWidth;
pDC->DrawText(pSoundElem->GetSector()->GetNameToDraw(), &lpDIS->rcItem, DT_SINGLELINE | DT_LEFT | DT_VCENTER);
// draw level
lpDIS->rcItem.left = lpDIS->rcItem.right + 1;
lpDIS->rcItem.right = lpDIS->rcItem.left + lWidth;
csText.Format("%d", pSoundElem->GetSoundLevel());
pDC->DrawText(csText, &lpDIS->rcItem, DT_SINGLELINE | DT_LEFT | DT_VCENTER);
}
/*===========================================================================
*=========================================================================*/
SECT_DialogSound::SECT_DialogSound (CWnd* pParent)
{
m_eType = E_Sound;
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogSound::DoDataExchange(CDataExchange* pDX)
{
SECT_DialogBase::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SECT_DialogList)
DDX_Control(pDX, SECT_IDC_SORTEDLISTBOX, m_cSectorList);
//}}AFX_DATA_MAP
m_cSectorList.fn_vInitDialogParameters(this);
}
//#################################################################################
// SOUND EVENT
//#################################################################################
/*----------------------------------------
----------------------------------------*/
void SECT_SoundEventListBox::fn_vDrawListItem (int nIDCtl, LPDRAWITEMSTRUCT lpDIS)
{
SECT_SoundEventElement *pElem;
COLORREF cTextColor;
COLORREF cRectColor;
CString csText;
BOOL bSelected;
CDC *pDC;
if (!m_pDialog)
return;
// init parameters
pElem = (SECT_SoundEventElement *) GetItemData(lpDIS->itemID);
bSelected = (lpDIS->itemState & ODS_SELECTED);
// drawing rect
pDC = CDC::FromHandle(lpDIS->hDC);
// selected sector => blue
if (bSelected)
{
cRectColor = RGB (0, 0, 200);
cTextColor = RGB (254, 254, 254);
}
// normal sector => black
else
{
cRectColor = GetSysColor(COLOR_WINDOW);
cTextColor = RGB (0, 0, 0);
}
// draw item
pDC->FillSolidRect(&lpDIS->rcItem, cRectColor);
pDC->SetBkMode(TRANSPARENT);
lpDIS->rcItem.left += 2;
pDC->SetTextColor(cTextColor);
csText = (pElem->GetSector() != NULL) ? pElem->GetSector()->GetNameToDraw() : "All Sectors";
pDC->DrawText(csText, &lpDIS->rcItem, DT_SINGLELINE | DT_LEFT | DT_VCENTER);
}
/*===========================================================================
*=========================================================================*/
SECT_DialogSoundEvent::SECT_DialogSoundEvent (CWnd* pParent)
{
m_eType = E_SoundEvent;
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogSoundEvent::DoDataExchange(CDataExchange* pDX)
{
SECT_DialogBase::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SECT_DialogList)
DDX_Control(pDX, SECT_IDC_SORTEDLISTBOX, m_cSectorList);
//}}AFX_DATA_MAP
m_cSectorList.fn_vInitDialogParameters(this);
}
/*----------------------------------------
----------------------------------------*/
void SECT_DialogSoundEvent::fn_vReinitListParams (void)
{
SECT_SoundEventElement *pSoundEventElem;
SECT_SndEvtEngineElem *pElem;
SECT_SoundEvent *pSoundEvent;
POSITION pos;
int iInd;
// RAZ
m_cListParams.ResetContent();
if (!m_pSelectedElem)
return;
pSoundEventElem = (SECT_SoundEventElement *) m_pSelectedElem;
// fill list with sector sound events
for (pElem = pSoundEventElem->GetSndEvtList()->GetHeadElement(pos); pElem;
pElem = pSoundEventElem->GetSndEvtList()->GetNextElement(pos))
{
pSoundEvent = pElem->GetSoundEvent();
if (pSoundEvent)
iInd = m_cListParams.AddString(pSoundEvent->GetName());
else
iInd = m_cListParams.AddString("Unknown");
m_cListParams.SetItemData(iInd, (DWORD) pSoundEvent);
}
// current selection => none
m_cListParams.SetCurSel(-1);
}

View File

@@ -0,0 +1,506 @@
/*=========================================================================
*
* SEClEnvs.cpp : Environment List Sector Dialog - Implementation file
*
*
* Version 1.0
* Creation date
* Revision date
*
* Shaitan
*=======================================================================*/
/*
#include "stdafx.h"
#include "acp_base.h"
#include "SECTint.hpp"
#include "SEClEnvs.hpp"
#include "SECdEnvs.hpp"
#include "SECdSrfs.hpp"
#include "SECmodif.hpp"
#include "SECdEnv.hpp"
//#include "SECdList.hpp"
#include "..\Main\Inc\_EditID.h"
#include "TUT.h"
*/
//#################################################################################
// SECT_DialogEdit dialog
//#################################################################################
/*----------------------------------------
----------------------------------------*/
/*
SECT_DialogEnvList::SECT_DialogEnvList(CWnd* pParent)
: CFormView(SECT_DialogEnvList::IDD)
{
//{{AFX_DATA_INIT(SECT_DialogEnvList)
//}}AFX_DATA_INIT
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnvList::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SECT_DialogEnvList)
// env list
DDX_Control(pDX, SECT_IDC_ENVLIST, m_cEnvList);
DDX_Control(pDX, SECT_IDC_ADDENVELEM, m_cAddElem);
DDX_Control(pDX, SECT_IDC_DELENVELEM, m_cDelElem);
// apply controls
DDX_Control(pDX, SECT_IDC_APPLYALL, m_cApplyAll);
DDX_Control(pDX, SECT_IDC_APPLYSELECT, m_cApplySelect);
DDX_Control(pDX, SECT_IDC_CANCELSELECT, m_cCancelSelect);
//}}AFX_DATA_MAP
}
*/
/*----------------------------------------
----------------------------------------*/
/*
BEGIN_MESSAGE_MAP(SECT_DialogEnvList, CFormView)
//{{AFX_MSG_MAP(SECT_DialogEnvList)
ON_WM_SIZE()
ON_WM_DESTROY()
ON_WM_DRAWITEM()
// env list
ON_LBN_SELCHANGE(SECT_IDC_ENVLIST, OnSelChangeEnvList)
ON_BN_CLICKED(SECT_IDC_ADDENVELEM, OnAddElem)
ON_BN_CLICKED(SECT_IDC_DELENVELEM, OnDelElem)
// keydown
ON_WM_VKEYTOITEM()
// apply
ON_BN_CLICKED(SECT_IDC_APPLYALL, OnApplyAll)
ON_BN_CLICKED(SECT_IDC_APPLYSELECT, OnApplySelect)
ON_BN_CLICKED(SECT_IDC_CANCELSELECT, OnCancelSelect)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
*/
//#################################################################################
// SECT_DialogEdit Inits
//#################################################################################
/*===========================================================================
* Description: Init dialog
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnvList::fn_vInitDialog (Sector_Interface *p_oDLL, CWnd *pParent)
{
// create the dialog
m_bInitialised = FALSE;
m_pSectorInterface = p_oDLL;
CFormView::Create(NULL, "", AFX_WS_DEFAULT_VIEW, CRect(0,0,120,180), pParent, AFX_IDW_PANE_FIRST, NULL);
// init data for dialog
CFormView::UpdateData(FALSE);
// init all controls
fn_vInitEnvList(NULL);
// FOR TUTORIAL
TUT_M_vGetTutDll();
// envlist
TUT_M_vRegisterControl (m_cEnvList.m_hWnd, "OSC_DELEM_LIST_ENVELEMS", TUT_e_ListBox);
TUT_M_vRegisterControl (m_cAddElem.m_hWnd, "OSC_DELEM_BUTTON_ADDELEM", TUT_e_Button);
TUT_M_vRegisterControl (m_cDelElem.m_hWnd, "OSC_DELEM_BUTTON_DELELEM", TUT_e_Button);
// apply
TUT_M_vRegisterControl (m_cApplyAll.m_hWnd, "OSC_DELEM_BUTTON_APPLYALL", TUT_e_Button);
TUT_M_vRegisterControl (m_cApplySelect.m_hWnd, "OSC_DELEM_BUTTON_APPLYSEL", TUT_e_Button);
TUT_M_vRegisterControl (m_cCancelSelect.m_hWnd, "OSC_DELEM_BUTTON_CANCELSEL", TUT_e_Button);
// END TUTORIAL
m_bInitialised = TRUE;
}
*/
/*===========================================================================
* Description: Init controls state
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnvList::fn_vInitControls (BOOL bEnable)
{
m_cEnvList.EnableWindow(bEnable);
m_cAddElem.EnableWindow(bEnable);
m_cDelElem.EnableWindow(bEnable && (m_lEnvElem != -1));
}
*/
/*===========================================================================
* Description: Init environment list
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnvList::fn_vInitEnvList (CPA_SuperObject *pEditedSector)
{
Sector_Object *pSector;
SECT_EnvElem *pEnvElem;
SECT_SurfElem *pSurfElem;
SECT_Surface *pSurface;
CString csName;
long lNumEnv = 0;
int iPos;
// update edited sector
m_pEditedSector = pEditedSector;
// reinit env list
m_cEnvList.ResetContent();
m_lEnvElem = -1;
// update controls
m_cEnvList.EnableWindow((m_pEditedSector != NULL));
m_cAddElem.EnableWindow((m_pEditedSector != NULL));
m_cDelElem.EnableWindow(FALSE);
// update apply
m_cApplyAll.EnableWindow((m_pEditedSector != NULL));
m_cApplySelect.EnableWindow((m_pEditedSector != NULL));
// no edited sector => no list
if (!m_pEditedSector)
return;
// fill env list
pSector = (Sector_Object *) m_pEditedSector->GetObject();
pEnvElem = pSector->GetEnvironment(lNumEnv);
pSurfElem = pSector->GetSurface(lNumEnv);
// fill list with all environments
while (pEnvElem)
{
if (pSurfElem)
{
pSurface = pSurfElem->GetSurface();
csName = pSurface->GetName();
}
else
csName ="NoSurface";
iPos = m_cEnvList.AddString(csName);
lNumEnv++;
pEnvElem = pSector->GetEnvironment(lNumEnv);
pSurfElem = pSector->GetSurface(lNumEnv);
}
// update controls
fn_vInitEnvElem(-1);
}
*/
/*===========================================================================
* Description: reinit environment list
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnvList::fn_vInitEnvElem (long lEnvElem)
{
// update edited element
m_lEnvElem = lEnvElem;
// update selection
m_cEnvList.SetCurSel(m_lEnvElem);
// update env list controls
m_cDelElem.EnableWindow((m_lEnvElem != -1));
// update env elem controls
m_pSectorInterface->GetDialogEnvs()->fn_vInitEnvElem(m_lEnvElem);
m_pSectorInterface->GetDialogSrf()->fn_vInitEnvElem(m_lEnvElem);
}
*/
/*===========================================================================
* Description: reinit environment list
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnvList::fn_vUpdateEnvElem (void)
{
// update selection
m_cEnvList.SetCurSel(m_lEnvElem);
}
*/
/*===========================================================================
* Description: draw item in envlist
* Creation date:
* Author: Shaitan
*---------------------------------------------------------------------------
* Revision date: Author:
*=========================================================================*/
/*
void SECT_DialogEnvList::fn_vDrawEnvListItem (int nIDCtl, LPDRAWITEMSTRUCT lpDIS)
{
// draw item
Sector_Object *pSector;
SECT_SurfElem *pSurfElem;
SECT_EnvElem *pEnvElem;
COLORREF cColor;
CString csText;
BOOL bSelected;
CDC *pDC;
long lWidth, lLeft;
// init parameters
pDC = CDC::FromHandle(lpDIS->hDC);
bSelected = (lpDIS->itemState & ODS_SELECTED);
lWidth = lpDIS->rcItem.right - lpDIS->rcItem.left - 2;
lLeft = lpDIS->rcItem.left;
// fill drawing rect
cColor = RGB (254, 254, 254);
pDC->FillSolidRect(&lpDIS->rcItem, cColor);
pSector = (Sector_Object *) m_pEditedSector->GetObject();
pEnvElem = pSector->GetEnvironment(lpDIS->itemID);
pSurfElem = pSector->GetSurface(lpDIS->itemID);
// draw env
lpDIS->rcItem.left += 1;
lpDIS->rcItem.right = lpDIS->rcItem.left + lWidth/2;
cColor = (m_cEnvList.IsWindowEnabled()) ? RGB (128, 0, 0) : RGB (128, 128, 128);
pDC->SetTextColor(cColor);
csText = pEnvElem->GetEnvironment()->GetNameToDraw();
pDC->DrawText(csText, &lpDIS->rcItem, DT_SINGLELINE | DT_LEFT | DT_VCENTER);
// draw surface
if (pSurfElem)
{
lpDIS->rcItem.left = lpDIS->rcItem.right + 1;
lpDIS->rcItem.right = lpDIS->rcItem.left + lWidth/2;
cColor = (m_cEnvList.IsWindowEnabled()) ? RGB (100, 0, 0) : RGB (128, 128, 128);
pDC->SetTextColor(cColor);
csText = pSurfElem->GetSurface()->GetNameToDraw();
pDC->DrawText(csText, &lpDIS->rcItem, DT_SINGLELINE | DT_LEFT | DT_VCENTER);
}
// selection
if (bSelected)
{
lpDIS->rcItem.left = lLeft;
lpDIS->rcItem.right = lLeft + lWidth + 2;
pDC->InvertRect(&lpDIS->rcItem);
}
}
*/
//#################################################################################
// SECT_DialogEdit Messages
//#################################################################################
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnvList::OnSize (UINT nFlags, int cx, int cy)
{
RECT WindowPosition;
int ecx, ecy;
if (!m_bInitialised)
return;
// calculate name position
GetWindowRect(&WindowPosition);
ecx = WindowPosition.right - WindowPosition.left - 20;
ecy = WindowPosition.bottom - WindowPosition.top - 105;
ecy = (ecy < 50) ? 50 : ecy;
ecx = (ecx < 80) ? 80 : ecx;
// move list
m_cEnvList.MoveWindow(10, 5, ecx, ecy);
// move list controls
m_cAddElem.MoveWindow(ecx/2 - 40, ecy+10, 30, 16);
m_cDelElem.MoveWindow(ecx/2 + 30, ecy+10, 30, 16);
// move apply controls
GetDlgItem(SECT_IDC_SEPARATOR)->MoveWindow(5, ecy+35, ecx+10, 5);
m_cApplyAll.MoveWindow(10, ecy+45, ecx, 15);
m_cApplySelect.MoveWindow(10, ecy+65, ecx, 15);
m_cCancelSelect.MoveWindow(10, ecy+85, ecx, 15);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnvList::OnDestroy (void)
{
// FOR TUTORIAL
TUT_M_vGetTutDll();
TUT_M_vUnregisterControl (m_cEnvList.m_hWnd);
TUT_M_vUnregisterControl (m_cAddElem.m_hWnd);
TUT_M_vUnregisterControl (m_cDelElem.m_hWnd);
// apply
TUT_M_vUnregisterControl (m_cApplyAll.m_hWnd);
TUT_M_vUnregisterControl (m_cApplySelect.m_hWnd);
TUT_M_vUnregisterControl (m_cCancelSelect.m_hWnd);
// END TUTORIAL
CFormView::OnDestroy();
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnvList::OnDrawItem (int nIDCtl, LPDRAWITEMSTRUCT lpDIS)
{
// invalid item => default handling
if (lpDIS->itemID == LB_ERR)
return;
// env list => draw item
if (nIDCtl == SECT_IDC_ENVLIST)
fn_vDrawEnvListItem(nIDCtl, lpDIS);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnvList::OnSelChangeEnvList()
{
SECT_EnvElem *pEnvElem = NULL;
int iInd;
// get corresponding element
iInd = m_cEnvList.GetCurSel();
// select it and update dialog
if (iInd != m_lEnvElem)
fn_vInitEnvElem(iInd);
else
fn_vInitEnvElem(-1);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnvList::OnAddElem()
{
SECT_ModifEnvAndSrf *pModif;
SECT_Environment *pDefaultEnv;
SECT_Surface *pDefaultSurf;
Sector_Object *pSector;
// no sector => no modif
if (!m_pEditedSector)
return;
pSector = (Sector_Object *) m_pEditedSector->GetObject();
// test if there is a surface available
pDefaultSurf = m_pSectorInterface->GetDefaultSurface(pSector);
if (!pDefaultSurf)
return;
// get default environment
pDefaultEnv = m_pSectorInterface->GetDefaultEnvironment();
// create new environment elements
pModif = new SECT_ModifEnvAndSrf(m_pSectorInterface, E_mt_AddEnvAndSrf,
m_pEditedSector, -1, pDefaultEnv, pDefaultSurf);
m_pSectorInterface->M_GetEditManager()->AskFor(pModif);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnvList::OnDelElem()
{
SECT_ModifEnvAndSrf *pModif;
// no sector or no environment => no modif
if ((!m_pEditedSector)||(m_lEnvElem == -1))
return;
// get parameters
pModif = new SECT_ModifEnvAndSrf(m_pSectorInterface, E_mt_DelEnvAndSrf,
m_pEditedSector, m_lEnvElem, NULL, NULL);
m_pSectorInterface->M_GetEditManager()->AskFor(pModif);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
int SECT_DialogEnvList::OnVKeyToItem (UINT nKey, CWnd *pListBox, UINT nIndex)
{
// no sector or no environment => no modif
if ((!m_pEditedSector)||(m_lEnvElem == -1))
return -2;
// interface handling
m_pSectorInterface->fn_vOnKeyDownInEnvList (m_pEditedSector, m_lEnvElem, nKey);
return -2;
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnvList::OnApplyAll()
{
SECT_ModifApplyToSectors *pModif;
pModif = new SECT_ModifApplyToSectors(m_pSectorInterface, E_tm_ApplyToSectors,
m_pEditedSector, NULL);
m_pSectorInterface->M_GetEditManager()->AskFor(pModif);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnvList::OnApplySelect()
{
SECT_ModifApplyToSectors *pModif;
pModif = new SECT_ModifApplyToSectors(m_pSectorInterface, E_tm_ApplyToSectors,
m_pEditedSector, m_pSectorInterface->GetSelectList());
m_pSectorInterface->M_GetEditManager()->AskFor(pModif);
}
*/
/*----------------------------------------
----------------------------------------*/
/*
void SECT_DialogEnvList::OnCancelSelect()
{
// remove all selected sectors
m_pSectorInterface->GetSelectList()->RemoveAll();
// update drawing
m_pSectorInterface->fn_vShowSelection();
// udpate sector list
// m_pSectorInterface->GetDialogList()->fn_vReinitSectorList();
m_pSectorInterface->GetDialogList()->fn_vUpdateSelection(E_lrm_ReinitList);
}
*/

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,6 @@
// stdafx.cpp : source file that includes just the standard includes
// ACPProject.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"

View File

@@ -0,0 +1,10 @@
LIBRARY
EXPORTS
fn_p_szGetCPAVersion
fn_p_stGetDLLIdentity
fn_p_oGetDLL
fn_vInitDll
SECTIONS
.data READ WRITE

View File

@@ -0,0 +1,5 @@
SCC = This is a source code control file
[OSC.vcproj]
SCC_Aux_Path = "P4SCC#srvperforce-ma:1666##raymandata##Editor"
SCC_Project_Name = Perforce Project

Binary file not shown.